Skip to content

Commit 43b7e05

Browse files
committed
Undo changes
1 parent b737850 commit 43b7e05

7 files changed

Lines changed: 2 additions & 54 deletions

File tree

packages/engine/src/lib/resolve-variable.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export async function resolveVariable(
1717
flowVersion: input.flowVersion,
1818
stepName: input.stepName,
1919
stepTestOutputs: input.stepTestOutputs,
20-
tablesDatabaseId: input.tablesDatabaseId,
21-
tablesDatabaseToken: input.tablesDatabaseToken,
2220
});
2321

2422
const executionState = await testExecutionContext.stateFromFlowVersion({

packages/engine/test/resolve-variable.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ describe('resolveVariable', () => {
1616
engineToken: 'test-engine-token',
1717
internalApiUrl: 'https://test-api.com',
1818
publicUrl: 'https://test-public.com',
19-
tablesDatabaseId: 1,
20-
tablesDatabaseToken: { iv: 'test-iv', data: 'test-data' },
2119
flowVersion: {
2220
id: 'flow-version-id',
2321
flowId: 'flow-id',
@@ -148,8 +146,6 @@ describe('resolveVariable', () => {
148146
flowVersion: mockInput.flowVersion,
149147
stepName: mockInput.stepName,
150148
stepTestOutputs: mockInput.stepTestOutputs,
151-
tablesDatabaseId: mockInput.tablesDatabaseId,
152-
tablesDatabaseToken: mockInput.tablesDatabaseToken,
153149
});
154150

155151
expect(mockTestExecutionContext.stateFromFlowVersion).toHaveBeenCalledWith({
@@ -190,8 +186,6 @@ describe('resolveVariable', () => {
190186
flowVersion: mockInput.flowVersion,
191187
stepName: mockInput.stepName,
192188
stepTestOutputs: undefined,
193-
tablesDatabaseId: mockInput.tablesDatabaseId,
194-
tablesDatabaseToken: mockInput.tablesDatabaseToken,
195189
});
196190
});
197191
});

packages/server/worker/src/lib/api/server-api.service.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
GetBlockRequestQuery,
2020
GetFlowVersionForWorkerRequest,
2121
PopulatedFlow,
22-
Project,
2322
RemoveStableJobEngineRequest,
2423
UpdateRunProgressRequest,
2524
WorkerMachineHealthcheckRequest,
@@ -87,9 +86,6 @@ export const engineApiService = (engineToken: string) => {
8786
responseType: 'arraybuffer',
8887
});
8988
},
90-
async getProject(): Promise<Project> {
91-
return client.get<Project>('/v1/worker/project', {});
92-
},
9389
async updateJobStatus(request: UpdateJobRequest): Promise<void> {
9490
await client.post('/v1/engine/update-job', request);
9591
},

packages/server/worker/src/lib/engine/engine-runner.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ import {
2727
} from '@openops/shared';
2828
import chalk from 'chalk';
2929

30-
type EngineConstants =
31-
| 'publicUrl'
32-
| 'internalApiUrl'
33-
| 'engineToken'
34-
| 'tablesDatabaseId'
35-
| 'tablesDatabaseToken';
30+
type EngineConstants = 'publicUrl' | 'internalApiUrl' | 'engineToken';
3631

3732
export type CodeArtifact = {
3833
name: string;

packages/server/worker/src/lib/engine/index.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,18 @@ import {
1414
ResolveVariableOperation,
1515
TriggerHookType,
1616
} from '@openops/shared';
17-
import { engineApiService } from '../api/server-api.service';
1817
import { webhookUtils } from '../utils/webhook-utils';
1918
import { callEngineLambda } from './call-engine';
2019
import { EngineRunner } from './engine-runner';
2120
import { blockEngineUtil } from './flow-enginer-util';
2221

2322
export const engineRunner: EngineRunner = {
2423
async executeFlow(engineToken, operation) {
25-
const project = await engineApiService(engineToken).getProject();
26-
2724
const input: ExecuteFlowOperation = {
2825
...operation,
2926
engineToken,
3027
publicUrl: await networkUtls.getPublicUrl(),
3128
internalApiUrl: networkUtls.getInternalApiUrl(),
32-
tablesDatabaseId: project.tablesDatabaseId,
33-
tablesDatabaseToken: project.tablesDatabaseToken,
3429
};
3530

3631
return callEngineLambda(EngineOperationType.EXECUTE_FLOW, input);
@@ -49,7 +44,6 @@ export const engineRunner: EngineRunner = {
4944
'[EngineHelper#executeTrigger]',
5045
);
5146

52-
const project = await engineApiService(engineToken).getProject();
5347
const triggerBlock = await blockEngineUtil.getTriggerBlock(
5448
engineToken,
5549
operation.flowVersion,
@@ -74,45 +68,34 @@ export const engineRunner: EngineRunner = {
7468
internalApiUrl: networkUtls.getInternalApiUrl(),
7569
webhookSecret: await webhookSecretsUtils.getWebhookSecret(lockedVersion),
7670
engineToken,
77-
tablesDatabaseId: project.tablesDatabaseId,
78-
tablesDatabaseToken: project.tablesDatabaseToken,
7971
};
8072

8173
return callEngineLambda(EngineOperationType.EXECUTE_TRIGGER_HOOK, input);
8274
},
8375

8476
async executeProp(engineToken, operation) {
85-
const project = await engineApiService(engineToken).getProject();
86-
8777
const input: ExecutePropsOptions = {
8878
...operation,
8979
publicUrl: await networkUtls.getPublicUrl(),
9080
internalApiUrl: networkUtls.getInternalApiUrl(),
9181
engineToken,
92-
tablesDatabaseId: project.tablesDatabaseId,
93-
tablesDatabaseToken: project.tablesDatabaseToken,
9482
};
9583

9684
return callEngineLambda(EngineOperationType.EXECUTE_PROPERTY, input);
9785
},
9886

9987
async executeValidateAuth(engineToken, operation) {
100-
const project = await engineApiService(engineToken).getProject();
101-
10288
const input: ExecuteValidateAuthOperation = {
10389
...operation,
10490
publicUrl: await networkUtls.getPublicUrl(),
10591
internalApiUrl: networkUtls.getInternalApiUrl(),
10692
engineToken,
107-
tablesDatabaseId: project.tablesDatabaseId,
108-
tablesDatabaseToken: project.tablesDatabaseToken,
10993
};
11094

11195
return callEngineLambda(EngineOperationType.EXECUTE_VALIDATE_AUTH, input);
11296
},
11397

11498
async executeAction(engineToken, operation) {
115-
const project = await engineApiService(engineToken).getProject();
11699
const lockedFlowVersion = await blockEngineUtil.lockBlockInFlowVersion({
117100
engineToken,
118101
flowVersion: operation.flowVersion,
@@ -127,23 +110,17 @@ export const engineRunner: EngineRunner = {
127110
internalApiUrl: networkUtls.getInternalApiUrl(),
128111
engineToken,
129112
stepTestOutputs: operation.stepTestOutputs,
130-
tablesDatabaseId: project.tablesDatabaseId,
131-
tablesDatabaseToken: project.tablesDatabaseToken,
132113
};
133114

134115
return callEngineLambda(EngineOperationType.EXECUTE_STEP, input);
135116
},
136117

137118
async executeVariable(engineToken, operation) {
138-
const project = await engineApiService(engineToken).getProject();
139-
140119
const input: ResolveVariableOperation = {
141120
...operation,
142121
publicUrl: await networkUtls.getPublicUrl(),
143122
internalApiUrl: networkUtls.getInternalApiUrl(),
144123
engineToken,
145-
tablesDatabaseId: project.tablesDatabaseId,
146-
tablesDatabaseToken: project.tablesDatabaseToken,
147124
};
148125

149126
return callEngineLambda(EngineOperationType.RESOLVE_VARIABLE, input);

packages/server/worker/src/lib/executors/flow-job-executor.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ import {
2525
import { engineApiService } from '../api/server-api.service';
2626
import { engineRunner } from '../engine';
2727

28-
type EngineConstants =
29-
| 'internalApiUrl'
30-
| 'publicUrl'
31-
| 'engineToken'
32-
| 'tablesDatabaseId'
33-
| 'tablesDatabaseToken';
28+
type EngineConstants = 'internalApiUrl' | 'publicUrl' | 'engineToken';
3429

3530
async function prepareInput(
3631
flowVersion: FlowVersion,

packages/shared/src/lib/engine/engine-operation.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ export enum TriggerHookType {
3232
TEST = 'TEST',
3333
}
3434

35-
export type EncryptedDatabaseToken = {
36-
iv: string;
37-
data: string;
38-
};
39-
4035
export type EngineOperation =
4136
| ExecuteStepOperation
4237
| ExecuteFlowOperation
@@ -51,8 +46,6 @@ export type BaseEngineOperation = {
5146
engineToken: string;
5247
internalApiUrl: string;
5348
publicUrl: string;
54-
tablesDatabaseId: number;
55-
tablesDatabaseToken: EncryptedDatabaseToken;
5649
};
5750

5851
export type ExecuteValidateAuthOperation = BaseEngineOperation & {

0 commit comments

Comments
 (0)