@skedulo/integration-sdk 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +38 -19
- package/dist/actions/action-registry.d.ts.map +1 -1
- package/dist/actions/action-registry.js +27 -23
- package/dist/actions/action-registry.js.map +1 -1
- package/dist/actions/data-flow/activate.action.d.ts +10 -0
- package/dist/actions/data-flow/activate.action.d.ts.map +1 -0
- package/dist/actions/data-flow/activate.action.js +22 -0
- package/dist/actions/data-flow/activate.action.js.map +1 -0
- package/dist/actions/data-flow/create.action.d.ts +9 -0
- package/dist/actions/data-flow/create.action.d.ts.map +1 -0
- package/dist/actions/data-flow/create.action.js +55 -0
- package/dist/actions/data-flow/create.action.js.map +1 -0
- package/dist/actions/data-flow/deactivate.action.d.ts +9 -0
- package/dist/actions/data-flow/deactivate.action.d.ts.map +1 -0
- package/dist/actions/data-flow/deactivate.action.js +21 -0
- package/dist/actions/data-flow/deactivate.action.js.map +1 -0
- package/dist/actions/data-flow/delete.action.d.ts +10 -0
- package/dist/actions/data-flow/delete.action.d.ts.map +1 -0
- package/dist/actions/data-flow/delete.action.js +33 -0
- package/dist/actions/data-flow/delete.action.js.map +1 -0
- package/dist/actions/data-flow/get.action.d.ts +5 -0
- package/dist/actions/data-flow/get.action.d.ts.map +1 -0
- package/dist/actions/data-flow/get.action.js +22 -0
- package/dist/actions/data-flow/get.action.js.map +1 -0
- package/dist/actions/data-flow/index.d.ts +9 -0
- package/dist/actions/data-flow/index.d.ts.map +1 -0
- package/dist/actions/data-flow/index.js +33 -0
- package/dist/actions/data-flow/index.js.map +1 -0
- package/dist/actions/data-flow/list.action.d.ts +6 -0
- package/dist/actions/data-flow/list.action.d.ts.map +1 -0
- package/dist/actions/data-flow/list.action.js +25 -0
- package/dist/actions/data-flow/list.action.js.map +1 -0
- package/dist/actions/data-flow/shared.d.ts +3 -0
- package/dist/actions/data-flow/shared.d.ts.map +1 -0
- package/dist/actions/data-flow/shared.js +16 -0
- package/dist/actions/data-flow/shared.js.map +1 -0
- package/dist/actions/data-flow/types.d.ts +21 -0
- package/dist/actions/data-flow/types.d.ts.map +1 -0
- package/dist/actions/data-flow/types.js +3 -0
- package/dist/actions/data-flow/types.js.map +1 -0
- package/dist/actions/data-flow/update.action.d.ts +16 -0
- package/dist/actions/data-flow/update.action.d.ts.map +1 -0
- package/dist/actions/data-flow/update.action.js +62 -0
- package/dist/actions/data-flow/update.action.js.map +1 -0
- package/dist/actions/data-flow.action.d.ts.map +1 -1
- package/dist/actions/data-flow.action.js +5 -9
- package/dist/actions/data-flow.action.js.map +1 -1
- package/dist/actions/event/index.d.ts +4 -0
- package/dist/actions/event/index.d.ts.map +1 -0
- package/dist/actions/event/index.js +23 -0
- package/dist/actions/event/index.js.map +1 -0
- package/dist/actions/event/on-skedulo.action.d.ts +4 -0
- package/dist/actions/event/on-skedulo.action.d.ts.map +1 -0
- package/dist/actions/event/on-skedulo.action.js +81 -0
- package/dist/actions/event/on-skedulo.action.js.map +1 -0
- package/dist/actions/event/on-vendor.action.d.ts +4 -0
- package/dist/actions/event/on-vendor.action.d.ts.map +1 -0
- package/dist/actions/event/on-vendor.action.js +39 -0
- package/dist/actions/event/on-vendor.action.js.map +1 -0
- package/dist/actions/event/types.d.ts +28 -0
- package/dist/actions/event/types.d.ts.map +1 -0
- package/dist/actions/event/types.js +3 -0
- package/dist/actions/event/types.js.map +1 -0
- package/dist/actions/metadata/get-fields.action.d.ts +5 -0
- package/dist/actions/metadata/get-fields.action.d.ts.map +1 -0
- package/dist/actions/metadata/get-fields.action.js +26 -0
- package/dist/actions/metadata/get-fields.action.js.map +1 -0
- package/dist/actions/metadata/get-objects.action.d.ts +5 -0
- package/dist/actions/metadata/get-objects.action.d.ts.map +1 -0
- package/dist/actions/metadata/get-objects.action.js +18 -0
- package/dist/actions/metadata/get-objects.action.js.map +1 -0
- package/dist/actions/metadata/get-sample-apis.action.d.ts +5 -0
- package/dist/actions/metadata/get-sample-apis.action.d.ts.map +1 -0
- package/dist/actions/metadata/get-sample-apis.action.js +19 -0
- package/dist/actions/metadata/get-sample-apis.action.js.map +1 -0
- package/dist/actions/metadata/get-sample-records.action.d.ts +5 -0
- package/dist/actions/metadata/get-sample-records.action.d.ts.map +1 -0
- package/dist/actions/metadata/get-sample-records.action.js +33 -0
- package/dist/actions/metadata/get-sample-records.action.js.map +1 -0
- package/dist/actions/metadata/get-templates.action.d.ts +5 -0
- package/dist/actions/metadata/get-templates.action.d.ts.map +1 -0
- package/dist/actions/metadata/get-templates.action.js +19 -0
- package/dist/actions/metadata/get-templates.action.js.map +1 -0
- package/dist/actions/metadata/index.d.ts +7 -0
- package/dist/actions/metadata/index.d.ts.map +1 -0
- package/dist/actions/metadata/index.js +29 -0
- package/dist/actions/metadata/index.js.map +1 -0
- package/dist/actions/metadata/shared.d.ts +6 -0
- package/dist/actions/metadata/shared.d.ts.map +1 -0
- package/dist/actions/metadata/shared.js +11 -0
- package/dist/actions/metadata/shared.js.map +1 -0
- package/dist/actions/metadata/types.d.ts +38 -0
- package/dist/actions/metadata/types.d.ts.map +1 -0
- package/dist/actions/metadata/types.js +3 -0
- package/dist/actions/metadata/types.js.map +1 -0
- package/dist/actions/scheduled-job/create.action.d.ts +5 -0
- package/dist/actions/scheduled-job/create.action.d.ts.map +1 -0
- package/dist/actions/scheduled-job/create.action.js +53 -0
- package/dist/actions/scheduled-job/create.action.js.map +1 -0
- package/dist/actions/scheduled-job/delete.action.d.ts +15 -0
- package/dist/actions/scheduled-job/delete.action.d.ts.map +1 -0
- package/dist/actions/scheduled-job/delete.action.js +42 -0
- package/dist/actions/scheduled-job/delete.action.js.map +1 -0
- package/dist/actions/scheduled-job/get.action.d.ts +7 -0
- package/dist/actions/scheduled-job/get.action.d.ts.map +1 -0
- package/dist/actions/scheduled-job/get.action.js +23 -0
- package/dist/actions/scheduled-job/get.action.js.map +1 -0
- package/dist/actions/scheduled-job/index.d.ts +7 -0
- package/dist/actions/scheduled-job/index.d.ts.map +1 -0
- package/dist/actions/scheduled-job/index.js +29 -0
- package/dist/actions/scheduled-job/index.js.map +1 -0
- package/dist/actions/scheduled-job/list.action.d.ts +5 -0
- package/dist/actions/scheduled-job/list.action.d.ts.map +1 -0
- package/dist/actions/scheduled-job/list.action.js +18 -0
- package/dist/actions/scheduled-job/list.action.js.map +1 -0
- package/dist/actions/scheduled-job/shared.d.ts +30 -0
- package/dist/actions/scheduled-job/shared.d.ts.map +1 -0
- package/dist/actions/scheduled-job/shared.js +129 -0
- package/dist/actions/scheduled-job/shared.js.map +1 -0
- package/dist/actions/scheduled-job/types.d.ts +23 -0
- package/dist/actions/scheduled-job/types.d.ts.map +1 -0
- package/dist/actions/scheduled-job/types.js +3 -0
- package/dist/actions/scheduled-job/types.js.map +1 -0
- package/dist/actions/scheduled-job/update.action.d.ts +5 -0
- package/dist/actions/scheduled-job/update.action.d.ts.map +1 -0
- package/dist/actions/scheduled-job/update.action.js +64 -0
- package/dist/actions/scheduled-job/update.action.js.map +1 -0
- package/dist/actions/scheduled-job.action.d.ts +73 -0
- package/dist/actions/scheduled-job.action.d.ts.map +1 -0
- package/dist/actions/scheduled-job.action.js +355 -0
- package/dist/actions/scheduled-job.action.js.map +1 -0
- package/dist/actions/setup.action.js +1 -1
- package/dist/actions/setup.action.js.map +1 -1
- package/dist/actions/sync/index.d.ts +4 -0
- package/dist/actions/sync/index.d.ts.map +1 -0
- package/dist/actions/sync/index.js +23 -0
- package/dist/actions/sync/index.js.map +1 -0
- package/dist/actions/sync/run-flow.action.d.ts +8 -0
- package/dist/actions/sync/run-flow.action.d.ts.map +1 -0
- package/dist/actions/sync/run-flow.action.js +81 -0
- package/dist/actions/sync/run-flow.action.js.map +1 -0
- package/dist/actions/sync/run-job.action.d.ts +11 -0
- package/dist/actions/sync/run-job.action.d.ts.map +1 -0
- package/dist/actions/sync/run-job.action.js +75 -0
- package/dist/actions/sync/run-job.action.js.map +1 -0
- package/dist/actions/sync/types.d.ts +41 -0
- package/dist/actions/sync/types.d.ts.map +1 -0
- package/dist/actions/sync/types.js +3 -0
- package/dist/actions/sync/types.js.map +1 -0
- package/dist/actions/sync.action.d.ts +8 -47
- package/dist/actions/sync.action.d.ts.map +1 -1
- package/dist/actions/sync.action.js +29 -162
- package/dist/actions/sync.action.js.map +1 -1
- package/dist/actions/utils/action-names.d.ts +19 -6
- package/dist/actions/utils/action-names.d.ts.map +1 -1
- package/dist/actions/utils/action-names.js +19 -6
- package/dist/actions/utils/action-names.js.map +1 -1
- package/dist/actions/utils/define-action.d.ts +36 -0
- package/dist/actions/utils/define-action.d.ts.map +1 -0
- package/dist/actions/utils/define-action.js +43 -0
- package/dist/actions/utils/define-action.js.map +1 -0
- package/dist/actions/utils/errors.d.ts +54 -8
- package/dist/actions/utils/errors.d.ts.map +1 -1
- package/dist/actions/utils/errors.js +104 -14
- package/dist/actions/utils/errors.js.map +1 -1
- package/dist/actions/utils/helpers.d.ts.map +1 -1
- package/dist/actions/utils/helpers.js +2 -1
- package/dist/actions/utils/helpers.js.map +1 -1
- package/dist/actions/utils/metrics.d.ts +12 -0
- package/dist/actions/utils/metrics.d.ts.map +1 -0
- package/dist/actions/utils/metrics.js +12 -0
- package/dist/actions/utils/metrics.js.map +1 -0
- package/dist/actions/utils/middleware.d.ts +39 -0
- package/dist/actions/utils/middleware.d.ts.map +1 -0
- package/dist/actions/utils/middleware.js +85 -0
- package/dist/actions/utils/middleware.js.map +1 -0
- package/dist/actions/utils/types.d.ts +5 -4
- package/dist/actions/utils/types.d.ts.map +1 -1
- package/dist/adapters/base-adapter-handler.d.ts +10 -0
- package/dist/adapters/base-adapter-handler.d.ts.map +1 -1
- package/dist/adapters/base-adapter-handler.js +18 -34
- package/dist/adapters/base-adapter-handler.js.map +1 -1
- package/dist/browser.d.ts +2 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -1
- package/dist/browser.js.map +1 -1
- package/dist/clients/integration-config.client.d.ts +21 -0
- package/dist/clients/integration-config.client.d.ts.map +1 -0
- package/dist/clients/integration-config.client.js +44 -0
- package/dist/clients/integration-config.client.js.map +1 -0
- package/dist/context.d.ts +18 -3
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +21 -5
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/data-flow-spec.interface.d.ts +14 -21
- package/dist/interfaces/data-flow-spec.interface.d.ts.map +1 -1
- package/dist/interfaces/data-flow-spec.interface.js +10 -26
- package/dist/interfaces/data-flow-spec.interface.js.map +1 -1
- package/dist/interfaces/integration-capabilities.interface.d.ts +2 -2
- package/dist/interfaces/scheduled-job.interface.d.ts +40 -0
- package/dist/interfaces/scheduled-job.interface.d.ts.map +1 -0
- package/dist/interfaces/scheduled-job.interface.js +38 -0
- package/dist/interfaces/scheduled-job.interface.js.map +1 -0
- package/dist/services/dataflow.service.d.ts +13 -6
- package/dist/services/dataflow.service.d.ts.map +1 -1
- package/dist/services/dataflow.service.js +34 -57
- package/dist/services/dataflow.service.js.map +1 -1
- package/dist/services/sync-runner.d.ts +1 -0
- package/dist/services/sync-runner.d.ts.map +1 -1
- package/dist/services/sync-runner.js +7 -27
- package/dist/services/sync-runner.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/artifact-builder.d.ts +40 -15
- package/dist/utils/artifact-builder.d.ts.map +1 -1
- package/dist/utils/artifact-builder.js +92 -17
- package/dist/utils/artifact-builder.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeRunFlowAction = makeRunFlowAction;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const sync_runner_1 = require("../../services/sync-runner");
|
|
7
|
+
const helpers_1 = require("../../utils/helpers");
|
|
8
|
+
const action_names_1 = require("../utils/action-names");
|
|
9
|
+
const helpers_2 = require("../utils/helpers");
|
|
10
|
+
const errors_1 = require("../utils/errors");
|
|
11
|
+
function parsePositiveInt(raw, field) {
|
|
12
|
+
const obj = (raw !== null && raw !== void 0 ? raw : {});
|
|
13
|
+
const v = obj[field];
|
|
14
|
+
if (!Number.isInteger(v) || v <= 0) {
|
|
15
|
+
throw new errors_1.InvalidInputError(`${field} must be a positive integer`);
|
|
16
|
+
}
|
|
17
|
+
return v;
|
|
18
|
+
}
|
|
19
|
+
function parseSinceDate(value) {
|
|
20
|
+
if (typeof value !== 'string') {
|
|
21
|
+
throw new errors_1.InvalidInputError('since must be an ISO date-time string');
|
|
22
|
+
}
|
|
23
|
+
const date = new Date(value);
|
|
24
|
+
if (Number.isNaN(date.getTime())) {
|
|
25
|
+
throw new errors_1.InvalidInputError(`since is not a valid date-time: "${value}"`);
|
|
26
|
+
}
|
|
27
|
+
return date;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Manually run a single flow. Admin-only. Supports a one-off backfill (`since`)
|
|
31
|
+
* or full resync (`fullResync`) that overrides the persisted cursor.
|
|
32
|
+
*/
|
|
33
|
+
function makeRunFlowAction(deps) {
|
|
34
|
+
return {
|
|
35
|
+
name: action_names_1.ACTIONS.sync.runFlow,
|
|
36
|
+
parseInput(raw) {
|
|
37
|
+
const obj = (raw !== null && raw !== void 0 ? raw : {});
|
|
38
|
+
const input = { flowId: parsePositiveInt(raw, 'flowId') };
|
|
39
|
+
// fullResync takes precedence over since when both are supplied.
|
|
40
|
+
if (obj.fullResync === true) {
|
|
41
|
+
input.fullResync = true;
|
|
42
|
+
}
|
|
43
|
+
else if (obj.since !== undefined) {
|
|
44
|
+
input.since = parseSinceDate(obj.since);
|
|
45
|
+
}
|
|
46
|
+
return input;
|
|
47
|
+
},
|
|
48
|
+
async handler(input, ctx) {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
if (!(0, helpers_1.isAdminRequest)(ctx.skedContext)) {
|
|
51
|
+
throw new errors_1.ForbiddenError('runFlow requires admin privileges');
|
|
52
|
+
}
|
|
53
|
+
const integrationType = deps.adapter.integrationType;
|
|
54
|
+
const lookupStrategy = (0, helpers_2.resolveLookupStrategy)(deps.adapter);
|
|
55
|
+
const runId = (0, crypto_1.randomUUID)();
|
|
56
|
+
const flow = await ctx.dataFlowService.getFlowById(input.flowId);
|
|
57
|
+
if (!flow) {
|
|
58
|
+
throw new errors_1.NotFoundError('FLOW_NOT_FOUND', `Flow ${input.flowId} not found`);
|
|
59
|
+
}
|
|
60
|
+
// overrideSince: undefined = normal resume, null = full resync, Date = backfill from time.
|
|
61
|
+
const overrideSince = input.fullResync ? null : input.since;
|
|
62
|
+
ctx.logger.info(`[run-flow] flowId=${input.flowId} runId=${runId} starting` +
|
|
63
|
+
(overrideSince === null
|
|
64
|
+
? ' (full resync)'
|
|
65
|
+
: overrideSince
|
|
66
|
+
? ` (backfill since ${overrideSince.toISOString()})`
|
|
67
|
+
: ''));
|
|
68
|
+
const stats = await new sync_runner_1.SyncRunner(deps.registry).run({
|
|
69
|
+
flowId: input.flowId,
|
|
70
|
+
since: null,
|
|
71
|
+
overrideSince,
|
|
72
|
+
sourceSystem: (_a = flow.sourceSystem) !== null && _a !== void 0 ? _a : integrationType,
|
|
73
|
+
targetSystem: (_b = flow.targetSystem) !== null && _b !== void 0 ? _b : constants_1.SKEDULO_SYSTEM,
|
|
74
|
+
options: { lookupStrategy },
|
|
75
|
+
}, ctx);
|
|
76
|
+
ctx.logger.info(`[run-flow] done: ${JSON.stringify(stats)}`);
|
|
77
|
+
return Object.assign({ runId, flowId: input.flowId }, stats);
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=run-flow.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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AC,gBAAgB;oBAClB,CAAC,CAAC,aAAa;wBACb,CAAC,CAAC,oBAAoB,aAAa,CAAC,WAAW,EAAE,GAAG;wBACpD,CAAC,CAAC,EAAE,CAAC,CACZ,CAAC;YACF,MAAM,KAAK,GAAG,MAAM,IAAI,wBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CACnD;gBACE,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,KAAK,EAAE,IAAI;gBACX,aAAa;gBACb,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,eAAe;gBAClD,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,0BAAc;gBACjD,OAAO,EAAE,EAAE,cAAc,EAAE;aAC5B,EACD,GAAG,CACJ,CAAC;YACF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC7D,uBAAS,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAK,KAAK,EAAG;QACnD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Action } from '../utils/types';
|
|
2
|
+
import type { RunJobInput, RunJobOutput, SyncDeps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Run a scheduled job: load it from config by `webhook_name`, then run its
|
|
5
|
+
* `flow_ids` sequentially in order. Continue-on-error — one flow failing does
|
|
6
|
+
* not stop the rest; the failed flow's cursor holds (SyncRunner only advances on
|
|
7
|
+
* zero failures) so it retries next cycle. Per-flow direction is decided by the
|
|
8
|
+
* flow's own `sourceSystem`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function makeRunJobAction(deps: SyncDeps): Action<RunJobInput, RunJobOutput>;
|
|
11
|
+
//# sourceMappingURL=run-job.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-job.action.d.ts","sourceRoot":"","sources":["../../../src/actions/sync/run-job.action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAa,MAAM,gBAAgB,CAAC;AAExD,OAAO,KAAK,EAAiB,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAElF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CA0ElF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeRunJobAction = makeRunJobAction;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const sync_runner_1 = require("../../services/sync-runner");
|
|
6
|
+
const action_names_1 = require("../utils/action-names");
|
|
7
|
+
const helpers_1 = require("../utils/helpers");
|
|
8
|
+
const errors_1 = require("../utils/errors");
|
|
9
|
+
const shared_1 = require("../scheduled-job/shared");
|
|
10
|
+
/**
|
|
11
|
+
* Run a scheduled job: load it from config by `webhook_name`, then run its
|
|
12
|
+
* `flow_ids` sequentially in order. Continue-on-error — one flow failing does
|
|
13
|
+
* not stop the rest; the failed flow's cursor holds (SyncRunner only advances on
|
|
14
|
+
* zero failures) so it retries next cycle. Per-flow direction is decided by the
|
|
15
|
+
* flow's own `sourceSystem`.
|
|
16
|
+
*/
|
|
17
|
+
function makeRunJobAction(deps) {
|
|
18
|
+
return {
|
|
19
|
+
name: action_names_1.ACTIONS.sync.runJob,
|
|
20
|
+
parseInput(raw, meta) {
|
|
21
|
+
const fromMeta = meta === null || meta === void 0 ? void 0 : meta.scheduledJobName;
|
|
22
|
+
if (typeof fromMeta === 'string' && fromMeta.length > 0) {
|
|
23
|
+
return { webhookName: fromMeta };
|
|
24
|
+
}
|
|
25
|
+
return { webhookName: (0, shared_1.parseWebhookName)(raw) };
|
|
26
|
+
},
|
|
27
|
+
async handler(input, ctx) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const integrationType = deps.adapter.integrationType;
|
|
30
|
+
const lookupStrategy = (0, helpers_1.resolveLookupStrategy)(deps.adapter);
|
|
31
|
+
const config = await (0, shared_1.readConfig)(ctx, integrationType);
|
|
32
|
+
const job = config.scheduled_jobs.find((j) => j.webhook_name === input.webhookName);
|
|
33
|
+
if (!job) {
|
|
34
|
+
throw new errors_1.NotFoundError('JOB_NOT_FOUND', `Scheduled job '${input.webhookName}' not found`);
|
|
35
|
+
}
|
|
36
|
+
if (!(0, shared_1.jobShouldRun)(job)) {
|
|
37
|
+
ctx.logger.info(`[run-job] ${job.webhook_name} skipped (disabled or no flows)`);
|
|
38
|
+
return { webhookName: job.webhook_name, skipped: true, results: [] };
|
|
39
|
+
}
|
|
40
|
+
ctx.logger.info(`[run-job] ${job.webhook_name} running ${job.flow_ids.length} flow(s) in order: ` +
|
|
41
|
+
job.flow_ids.join(', '));
|
|
42
|
+
const runner = new sync_runner_1.SyncRunner(deps.registry);
|
|
43
|
+
const results = [];
|
|
44
|
+
for (const flowId of job.flow_ids) {
|
|
45
|
+
const startedAt = Date.now();
|
|
46
|
+
try {
|
|
47
|
+
const flow = await ctx.dataFlowService.getFlowById(flowId);
|
|
48
|
+
if (!flow) {
|
|
49
|
+
ctx.logger.warn(`[run-job] ${job.webhook_name} flow=${flowId} not found — skipping`);
|
|
50
|
+
results.push({ flowId, skipped: true, reason: 'flow not found' });
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const stats = await runner.run({
|
|
54
|
+
flowId,
|
|
55
|
+
since: null,
|
|
56
|
+
sourceSystem: (_a = flow.sourceSystem) !== null && _a !== void 0 ? _a : integrationType,
|
|
57
|
+
targetSystem: (_b = flow.targetSystem) !== null && _b !== void 0 ? _b : constants_1.SKEDULO_SYSTEM,
|
|
58
|
+
options: { lookupStrategy },
|
|
59
|
+
}, ctx);
|
|
60
|
+
const durationMs = Date.now() - startedAt;
|
|
61
|
+
ctx.logger.info(`[run-job] ${job.webhook_name} flow=${flowId} ${flow.sourceObject}→${flow.targetObject} ` +
|
|
62
|
+
`${JSON.stringify(stats)} took=${durationMs}ms`);
|
|
63
|
+
results.push(Object.assign({ flowId, sourceObject: flow.sourceObject, targetObject: flow.targetObject, durationMs }, stats));
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
67
|
+
ctx.logger.error(`[run-job] ${job.webhook_name} flow=${flowId} failed: ${msg}`);
|
|
68
|
+
results.push({ flowId, error: msg });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { webhookName: job.webhook_name, results };
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=run-job.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-job.action.js","sourceRoot":"","sources":["../../../src/actions/sync/run-job.action.ts"],"names":[],"mappings":";;AAgBA,4CA0EC;AA1FD,+CAAiD;AACjD,4DAAwD;AACxD,wDAAgD;AAChD,8CAAyD;AACzD,4CAAgD;AAEhD,oDAAqF;AAGrF;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,IAAc;IAC7C,OAAO;QACL,IAAI,EAAE,sBAAO,CAAC,IAAI,CAAC,MAAM;QACzB,UAAU,CAAC,GAAG,EAAE,IAA2B;YACzC,MAAM,QAAQ,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAC;YACxC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;YACnC,CAAC;YACD,OAAO,EAAE,WAAW,EAAE,IAAA,yBAAgB,EAAC,GAAG,CAAC,EAAE,CAAC;QAChD,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;;YACtB,MAA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AAG,CAAC,YAAY,SAAS,MAAM,YAAY,GAAG,EAAE,CAAC,CAAC;oBAChF,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;YAED,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC;QACpD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Adapter } from '../../interfaces/adapter.interface';
|
|
2
|
+
import type { AdapterRegistry } from '../../adapters/adapter-registry';
|
|
3
|
+
import type { BatchResult } from '../../interfaces/sync-result.interface';
|
|
4
|
+
export type SyncDeps = {
|
|
5
|
+
adapter: Adapter;
|
|
6
|
+
registry: AdapterRegistry;
|
|
7
|
+
};
|
|
8
|
+
export interface RunFlowInput {
|
|
9
|
+
flowId: number;
|
|
10
|
+
/** Manual backfill: sync from this time, overriding the persisted cursor. */
|
|
11
|
+
since?: Date;
|
|
12
|
+
/** Manual full resync: ignore the persisted cursor and pull everything. */
|
|
13
|
+
fullResync?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type RunFlowOutput = {
|
|
16
|
+
runId: string;
|
|
17
|
+
flowId: number;
|
|
18
|
+
} & BatchResult;
|
|
19
|
+
export interface RunJobInput {
|
|
20
|
+
webhookName: string;
|
|
21
|
+
}
|
|
22
|
+
type PerFlowResultBase = {
|
|
23
|
+
flowId: number;
|
|
24
|
+
sourceObject?: string;
|
|
25
|
+
targetObject?: string;
|
|
26
|
+
};
|
|
27
|
+
export type PerFlowResult = PerFlowResultBase & ({
|
|
28
|
+
skipped: true;
|
|
29
|
+
reason: string;
|
|
30
|
+
} | {
|
|
31
|
+
error: string;
|
|
32
|
+
} | (BatchResult & {
|
|
33
|
+
durationMs: number;
|
|
34
|
+
}));
|
|
35
|
+
export interface RunJobOutput {
|
|
36
|
+
webhookName: string;
|
|
37
|
+
skipped?: boolean;
|
|
38
|
+
results: PerFlowResult[];
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/actions/sync/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,MAAM,MAAM,QAAQ,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAA;CAAE,CAAC;AAEvE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAAC;AAE5E,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,KAAK,iBAAiB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1F,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CAAC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,CAAC,WAAW,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC;AAEnG,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/actions/sync/types.ts"],"names":[],"mappings":""}
|
|
@@ -6,60 +6,21 @@ type SyncDeps = {
|
|
|
6
6
|
adapter: Adapter;
|
|
7
7
|
registry: AdapterRegistry;
|
|
8
8
|
};
|
|
9
|
-
export interface PushInput {
|
|
10
|
-
dataFlowId: number;
|
|
11
|
-
}
|
|
12
|
-
export type PushOutput = (BatchResult & {
|
|
13
|
-
durationMs: number;
|
|
14
|
-
flowId: number;
|
|
15
|
-
}) | {
|
|
16
|
-
flowId: number;
|
|
17
|
-
error: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Run a single outbound scheduled (push) data flow. One ElasticServer-triggered
|
|
21
|
-
* artifact per flow invokes this action with its own `dataFlowId`.
|
|
22
|
-
*/
|
|
23
|
-
export declare function makePushAction(deps: SyncDeps): Action<PushInput, PushOutput>;
|
|
24
|
-
export interface ScheduledPullInput {
|
|
25
|
-
dataFlowId: number;
|
|
26
|
-
}
|
|
27
|
-
export type ScheduledPullOutput = (BatchResult & {
|
|
28
|
-
durationMs: number;
|
|
29
|
-
flowId: number;
|
|
30
|
-
}) | {
|
|
31
|
-
flowId: number;
|
|
32
|
-
error: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Run a single inbound scheduled (pull) data flow. One ElasticServer-triggered
|
|
36
|
-
* artifact per flow invokes this action with its own `dataFlowId`.
|
|
37
|
-
*/
|
|
38
|
-
export declare function makeScheduledPullAction(deps: SyncDeps): Action<ScheduledPullInput, ScheduledPullOutput>;
|
|
39
9
|
export interface RunFlowInput {
|
|
40
10
|
flowId: number;
|
|
11
|
+
/** Manual backfill: sync from this time, overriding the persisted cursor. */
|
|
12
|
+
since?: Date;
|
|
13
|
+
/** Manual full resync: ignore the persisted cursor and pull everything. */
|
|
14
|
+
fullResync?: boolean;
|
|
41
15
|
}
|
|
42
16
|
export type RunFlowOutput = {
|
|
43
17
|
runId: string;
|
|
44
18
|
flowId: number;
|
|
45
19
|
} & BatchResult;
|
|
20
|
+
/**
|
|
21
|
+
* Manually run a single flow. Admin-only. Supports a one-off backfill (`since`)
|
|
22
|
+
* or full resync (`fullResync`) that overrides the persisted cursor.
|
|
23
|
+
*/
|
|
46
24
|
export declare function makeRunFlowAction(deps: SyncDeps): Action<RunFlowInput, RunFlowOutput>;
|
|
47
|
-
export type RunAllFlowsInput = void;
|
|
48
|
-
type RunAllFlowsEntryBase = {
|
|
49
|
-
flowId: number;
|
|
50
|
-
sourceObject: string;
|
|
51
|
-
targetObject: string;
|
|
52
|
-
};
|
|
53
|
-
export type RunAllFlowsEntry = RunAllFlowsEntryBase & ({
|
|
54
|
-
skipped: true;
|
|
55
|
-
reason: string;
|
|
56
|
-
} | {
|
|
57
|
-
error: string;
|
|
58
|
-
} | BatchResult);
|
|
59
|
-
export interface RunAllFlowsOutput {
|
|
60
|
-
message: string;
|
|
61
|
-
results: Record<string, RunAllFlowsEntry>;
|
|
62
|
-
}
|
|
63
|
-
export declare function makeRunAllFlowsAction(deps: SyncDeps): Action<RunAllFlowsInput, RunAllFlowsOutput>;
|
|
64
25
|
export {};
|
|
65
26
|
//# sourceMappingURL=sync.action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.action.d.ts","sourceRoot":"","sources":["../../src/actions/sync.action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"sync.action.d.ts","sourceRoot":"","sources":["../../src/actions/sync.action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAOvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,KAAK,QAAQ,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAA;CAAE,CAAC;AAahE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAAC;AAa5E;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,CAoDrF"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makePushAction = makePushAction;
|
|
4
|
-
exports.makeScheduledPullAction = makeScheduledPullAction;
|
|
5
3
|
exports.makeRunFlowAction = makeRunFlowAction;
|
|
6
|
-
exports.makeRunAllFlowsAction = makeRunAllFlowsAction;
|
|
7
4
|
const crypto_1 = require("crypto");
|
|
8
5
|
const constants_1 = require("../constants");
|
|
9
|
-
const data_flow_spec_interface_1 = require("../interfaces/data-flow-spec.interface");
|
|
10
6
|
const sync_runner_1 = require("../services/sync-runner");
|
|
11
7
|
const helpers_1 = require("../utils/helpers");
|
|
12
8
|
const action_names_1 = require("./utils/action-names");
|
|
@@ -20,112 +16,34 @@ function parsePositiveInt(raw, field) {
|
|
|
20
16
|
}
|
|
21
17
|
return v;
|
|
22
18
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
function parseDataFlowId(raw, meta) {
|
|
28
|
-
if ((meta === null || meta === void 0 ? void 0 : meta.dataFlowId) !== undefined) {
|
|
29
|
-
if (!Number.isInteger(meta.dataFlowId) || meta.dataFlowId <= 0) {
|
|
30
|
-
throw new errors_1.InvalidInputError('dataFlowId must be a positive integer');
|
|
31
|
-
}
|
|
32
|
-
return meta.dataFlowId;
|
|
19
|
+
function parseSinceDate(value) {
|
|
20
|
+
if (typeof value !== 'string') {
|
|
21
|
+
throw new errors_1.InvalidInputError('since must be an ISO date-time string');
|
|
33
22
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
function makePushAction(deps) {
|
|
41
|
-
return {
|
|
42
|
-
name: action_names_1.ACTIONS.sync.push,
|
|
43
|
-
parseInput(raw, meta) {
|
|
44
|
-
return { dataFlowId: parseDataFlowId(raw, meta) };
|
|
45
|
-
},
|
|
46
|
-
async handler(input, ctx) {
|
|
47
|
-
const integrationType = deps.adapter.integrationType;
|
|
48
|
-
const lookupStrategy = (0, helpers_2.resolveLookupStrategy)(deps.adapter);
|
|
49
|
-
const flow = await ctx.dataFlowService.getFlowById(input.dataFlowId);
|
|
50
|
-
if (!flow) {
|
|
51
|
-
throw new errors_1.ActionError('FLOW_NOT_FOUND', `Flow ${input.dataFlowId} not found`);
|
|
52
|
-
}
|
|
53
|
-
const sc = (0, data_flow_spec_interface_1.asSyncConfig)(flow.triggerConfig);
|
|
54
|
-
if (!sc || sc.strategy !== data_flow_spec_interface_1.SyncStrategy.SCHEDULED) {
|
|
55
|
-
throw new errors_1.ActionError('UNSUPPORTED_STRATEGY', 'push action requires strategy=scheduled');
|
|
56
|
-
}
|
|
57
|
-
const runner = new sync_runner_1.SyncRunner(deps.registry);
|
|
58
|
-
const startedAt = Date.now();
|
|
59
|
-
try {
|
|
60
|
-
const stats = await runner.run({
|
|
61
|
-
flowId: flow.id,
|
|
62
|
-
since: null,
|
|
63
|
-
sourceSystem: constants_1.SKEDULO_SYSTEM,
|
|
64
|
-
targetSystem: integrationType,
|
|
65
|
-
options: { lookupStrategy },
|
|
66
|
-
}, ctx);
|
|
67
|
-
const durationMs = Date.now() - startedAt;
|
|
68
|
-
ctx.logger.info(`[push] flow=${flow.id} ${flow.sourceObject}→${flow.targetObject} ` +
|
|
69
|
-
`${JSON.stringify(stats)} took=${durationMs}ms`);
|
|
70
|
-
return Object.assign(Object.assign({}, stats), { durationMs, flowId: flow.id });
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
74
|
-
ctx.logger.error(`[push] flow=${flow.id} failed: ${msg}`);
|
|
75
|
-
return { flowId: flow.id, error: msg };
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
};
|
|
23
|
+
const date = new Date(value);
|
|
24
|
+
if (Number.isNaN(date.getTime())) {
|
|
25
|
+
throw new errors_1.InvalidInputError(`since is not a valid date-time: "${value}"`);
|
|
26
|
+
}
|
|
27
|
+
return date;
|
|
79
28
|
}
|
|
80
29
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
30
|
+
* Manually run a single flow. Admin-only. Supports a one-off backfill (`since`)
|
|
31
|
+
* or full resync (`fullResync`) that overrides the persisted cursor.
|
|
83
32
|
*/
|
|
84
|
-
function makeScheduledPullAction(deps) {
|
|
85
|
-
return {
|
|
86
|
-
name: action_names_1.ACTIONS.sync.scheduledPull,
|
|
87
|
-
parseInput(raw, meta) {
|
|
88
|
-
return { dataFlowId: parseDataFlowId(raw, meta) };
|
|
89
|
-
},
|
|
90
|
-
async handler(input, ctx) {
|
|
91
|
-
const integrationType = deps.adapter.integrationType;
|
|
92
|
-
const lookupStrategy = (0, helpers_2.resolveLookupStrategy)(deps.adapter);
|
|
93
|
-
const flow = await ctx.dataFlowService.getFlowById(input.dataFlowId);
|
|
94
|
-
if (!flow) {
|
|
95
|
-
throw new errors_1.ActionError('FLOW_NOT_FOUND', `Flow ${input.dataFlowId} not found`);
|
|
96
|
-
}
|
|
97
|
-
const sc = (0, data_flow_spec_interface_1.asSyncConfig)(flow.triggerConfig);
|
|
98
|
-
if (!sc || sc.strategy !== data_flow_spec_interface_1.SyncStrategy.SCHEDULED) {
|
|
99
|
-
throw new errors_1.ActionError('UNSUPPORTED_STRATEGY', 'scheduledPull action requires strategy=scheduled');
|
|
100
|
-
}
|
|
101
|
-
const runner = new sync_runner_1.SyncRunner(deps.registry);
|
|
102
|
-
const startedAt = Date.now();
|
|
103
|
-
try {
|
|
104
|
-
const stats = await runner.run({
|
|
105
|
-
flowId: flow.id,
|
|
106
|
-
since: null,
|
|
107
|
-
sourceSystem: integrationType,
|
|
108
|
-
targetSystem: constants_1.SKEDULO_SYSTEM,
|
|
109
|
-
options: { lookupStrategy },
|
|
110
|
-
}, ctx);
|
|
111
|
-
const durationMs = Date.now() - startedAt;
|
|
112
|
-
ctx.logger.info(`[scheduled-pull] flow=${flow.id} ${flow.sourceObject}→${flow.targetObject} ` +
|
|
113
|
-
`${JSON.stringify(stats)} took=${durationMs}ms`);
|
|
114
|
-
return Object.assign(Object.assign({}, stats), { durationMs, flowId: flow.id });
|
|
115
|
-
}
|
|
116
|
-
catch (err) {
|
|
117
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
118
|
-
ctx.logger.error(`[scheduled-pull] flow=${flow.id} failed: ${msg}`);
|
|
119
|
-
return { flowId: flow.id, error: msg };
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
33
|
function makeRunFlowAction(deps) {
|
|
125
34
|
return {
|
|
126
35
|
name: action_names_1.ACTIONS.sync.runFlow,
|
|
127
36
|
parseInput(raw) {
|
|
128
|
-
|
|
37
|
+
const obj = (raw !== null && raw !== void 0 ? raw : {});
|
|
38
|
+
const input = { flowId: parsePositiveInt(raw, 'flowId') };
|
|
39
|
+
// fullResync takes precedence over since when both are supplied.
|
|
40
|
+
if (obj.fullResync === true) {
|
|
41
|
+
input.fullResync = true;
|
|
42
|
+
}
|
|
43
|
+
else if (obj.since !== undefined) {
|
|
44
|
+
input.since = parseSinceDate(obj.since);
|
|
45
|
+
}
|
|
46
|
+
return input;
|
|
129
47
|
},
|
|
130
48
|
async handler(input, ctx) {
|
|
131
49
|
var _a, _b;
|
|
@@ -139,10 +57,18 @@ function makeRunFlowAction(deps) {
|
|
|
139
57
|
if (!flow) {
|
|
140
58
|
throw new errors_1.ActionError('FLOW_NOT_FOUND', `Flow ${input.flowId} not found`);
|
|
141
59
|
}
|
|
142
|
-
|
|
60
|
+
// overrideSince: undefined = normal resume, null = full resync, Date = backfill from time.
|
|
61
|
+
const overrideSince = input.fullResync ? null : input.since;
|
|
62
|
+
ctx.logger.info(`[run-flow] flowId=${input.flowId} runId=${runId} starting` +
|
|
63
|
+
(overrideSince === null
|
|
64
|
+
? ' (full resync)'
|
|
65
|
+
: overrideSince
|
|
66
|
+
? ` (backfill since ${overrideSince.toISOString()})`
|
|
67
|
+
: ''));
|
|
143
68
|
const stats = await new sync_runner_1.SyncRunner(deps.registry).run({
|
|
144
69
|
flowId: input.flowId,
|
|
145
70
|
since: null,
|
|
71
|
+
overrideSince,
|
|
146
72
|
sourceSystem: (_a = flow.sourceSystem) !== null && _a !== void 0 ? _a : integrationType,
|
|
147
73
|
targetSystem: (_b = flow.targetSystem) !== null && _b !== void 0 ? _b : constants_1.SKEDULO_SYSTEM,
|
|
148
74
|
options: { lookupStrategy },
|
|
@@ -152,63 +78,4 @@ function makeRunFlowAction(deps) {
|
|
|
152
78
|
},
|
|
153
79
|
};
|
|
154
80
|
}
|
|
155
|
-
function makeRunAllFlowsAction(deps) {
|
|
156
|
-
return {
|
|
157
|
-
name: action_names_1.ACTIONS.sync.runAllFlows,
|
|
158
|
-
parseInput() {
|
|
159
|
-
return undefined;
|
|
160
|
-
},
|
|
161
|
-
async handler(_input, ctx) {
|
|
162
|
-
var _a, _b, _c, _d;
|
|
163
|
-
if (!(0, helpers_1.isAdminRequest)(ctx.skedContext)) {
|
|
164
|
-
throw new errors_1.ActionError('FORBIDDEN', 'runAllFlows requires admin privileges');
|
|
165
|
-
}
|
|
166
|
-
const integrationType = deps.adapter.integrationType;
|
|
167
|
-
const lookupStrategy = (0, helpers_2.resolveLookupStrategy)(deps.adapter);
|
|
168
|
-
const flows = await ctx.dataFlowService.listActive({ integrationType });
|
|
169
|
-
if (flows.length === 0) {
|
|
170
|
-
throw new errors_1.ActionError('NO_ACTIVE_FLOWS', `No active data flows found for ${integrationType}. Create flows first.`);
|
|
171
|
-
}
|
|
172
|
-
ctx.logger.info(`[run-all-flows] found ${flows.length} active flow(s): ` +
|
|
173
|
-
flows.map((f) => `${f.sourceObject}→${f.targetObject}`).join(', '));
|
|
174
|
-
const sorted = [...flows].sort((a, b) => { var _a, _b; return ((_a = a.executionOrder) !== null && _a !== void 0 ? _a : Infinity) - ((_b = b.executionOrder) !== null && _b !== void 0 ? _b : Infinity); });
|
|
175
|
-
const runner = new sync_runner_1.SyncRunner(deps.registry);
|
|
176
|
-
const results = {};
|
|
177
|
-
for (const flow of sorted) {
|
|
178
|
-
const startedAt = Date.now();
|
|
179
|
-
const base = {
|
|
180
|
-
flowId: flow.id,
|
|
181
|
-
sourceObject: flow.sourceObject,
|
|
182
|
-
targetObject: flow.targetObject,
|
|
183
|
-
};
|
|
184
|
-
try {
|
|
185
|
-
if (!((_b = (_a = flow.mappingConfig) === null || _a === void 0 ? void 0 : _a.mappings) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
186
|
-
ctx.logger.warn(`[run-all-flows] skipping flow ${flow.id} (${flow.sourceObject}) — no mappingConfig`);
|
|
187
|
-
results[String(flow.id)] = Object.assign(Object.assign({}, base), { skipped: true, reason: 'no mappingConfig' });
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
await ctx.dataFlowService.updateCursor(flow.id, null);
|
|
191
|
-
ctx.logger.info(`[run-all-flows] syncing ${flow.sourceObject} → ${flow.targetObject}`);
|
|
192
|
-
const stats = await runner.run({
|
|
193
|
-
flowId: flow.id,
|
|
194
|
-
since: null,
|
|
195
|
-
sourceSystem: (_c = flow.sourceSystem) !== null && _c !== void 0 ? _c : integrationType,
|
|
196
|
-
targetSystem: (_d = flow.targetSystem) !== null && _d !== void 0 ? _d : constants_1.SKEDULO_SYSTEM,
|
|
197
|
-
options: { lookupStrategy },
|
|
198
|
-
}, ctx);
|
|
199
|
-
const durationMs = Date.now() - startedAt;
|
|
200
|
-
ctx.logger.info(`[run-all-flows] flow=${flow.id} ${flow.sourceObject}→${flow.targetObject} ` +
|
|
201
|
-
`${JSON.stringify(stats)} took=${durationMs}ms`);
|
|
202
|
-
results[String(flow.id)] = Object.assign(Object.assign({}, base), stats);
|
|
203
|
-
}
|
|
204
|
-
catch (err) {
|
|
205
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
206
|
-
ctx.logger.error(`[run-all-flows] flow=${flow.id} failed: ${msg}`);
|
|
207
|
-
results[String(flow.id)] = Object.assign(Object.assign({}, base), { error: msg });
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return { message: 'All flows completed', results };
|
|
211
|
-
},
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
81
|
//# sourceMappingURL=sync.action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.action.js","sourceRoot":"","sources":["../../src/actions/sync.action.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"sync.action.js","sourceRoot":"","sources":["../../src/actions/sync.action.ts"],"names":[],"mappings":";;AAiDA,8CAoDC;AArGD,mCAAoC;AAIpC,4CAA8C;AAC9C,yDAAqD;AACrD,8CAAkD;AAClD,uDAA+C;AAC/C,6CAAwD;AACxD,2CAAgE;AAKhE,SA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AAQ,CAAC,CAAC,GAAG,CACnD;gBACE,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,KAAK,EAAE,IAAI;gBACX,aAAa;gBACb,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,eAAe;gBAClD,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,0BAAc;gBACjD,OAAO,EAAE,EAAE,cAAc,EAAE;aAC5B,EACD,GAAG,CACJ,CAAC;YACF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC7D,uBAAS,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAK,KAAK,EAAG;QACnD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -5,10 +5,18 @@
|
|
|
5
5
|
export declare const ACTION_HEADER = "sked-integration-action";
|
|
6
6
|
/**
|
|
7
7
|
* HTTP header carrying the target flow id for per-flow actions. ElasticServer
|
|
8
|
-
* scheduled webhooks post an empty body
|
|
9
|
-
* the
|
|
8
|
+
* scheduled webhooks post an empty body (and triggered actions a bare array),
|
|
9
|
+
* so the flow id rides on this header; the dispatcher passes it to `parseInput`
|
|
10
|
+
* as `meta.dataFlowId`.
|
|
10
11
|
*/
|
|
11
12
|
export declare const DATA_FLOW_ID_HEADER = "sked-data-flow-id";
|
|
13
|
+
/**
|
|
14
|
+
* HTTP header carrying the target scheduled job's `webhook_name`. The ES
|
|
15
|
+
* scheduled webhook provisioned for a job posts an empty body, so the job
|
|
16
|
+
* identity rides on this header; the dispatcher passes it to `parseInput` as
|
|
17
|
+
* `meta.scheduledJobName`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SCHEDULED_JOB_NAME_HEADER = "sked-scheduled-job-name";
|
|
12
20
|
/**
|
|
13
21
|
* Wire-format action names, grouped by domain. Use these instead of hardcoded
|
|
14
22
|
* strings on both sides of the dispatcher (SDK + UI / cross-function clients).
|
|
@@ -29,10 +37,15 @@ export declare const ACTIONS: Readonly<{
|
|
|
29
37
|
getSampleRecords: "metadata.get-sample-records";
|
|
30
38
|
}>;
|
|
31
39
|
readonly sync: Readonly<{
|
|
32
|
-
push: "sync.push";
|
|
33
|
-
scheduledPull: "sync.scheduled-pull";
|
|
34
40
|
runFlow: "sync.run-flow";
|
|
35
|
-
|
|
41
|
+
runJob: "sync.run-job";
|
|
42
|
+
}>;
|
|
43
|
+
readonly scheduledJob: Readonly<{
|
|
44
|
+
create: "scheduled-job.create";
|
|
45
|
+
update: "scheduled-job.update";
|
|
46
|
+
delete: "scheduled-job.delete";
|
|
47
|
+
list: "scheduled-job.list";
|
|
48
|
+
get: "scheduled-job.get";
|
|
36
49
|
}>;
|
|
37
50
|
readonly event: Readonly<{
|
|
38
51
|
onSkedulo: "event.on-skedulo";
|
|
@@ -48,5 +61,5 @@ export declare const ACTIONS: Readonly<{
|
|
|
48
61
|
list: "data-flow.list";
|
|
49
62
|
}>;
|
|
50
63
|
}>;
|
|
51
|
-
export type ActionName = typeof ACTIONS.capabilities | (typeof ACTIONS.setup)[keyof typeof ACTIONS.setup] | (typeof ACTIONS.metadata)[keyof typeof ACTIONS.metadata] | (typeof ACTIONS.sync)[keyof typeof ACTIONS.sync] | (typeof ACTIONS.event)[keyof typeof ACTIONS.event] | (typeof ACTIONS.dataFlow)[keyof typeof ACTIONS.dataFlow];
|
|
64
|
+
export type ActionName = typeof ACTIONS.capabilities | (typeof ACTIONS.setup)[keyof typeof ACTIONS.setup] | (typeof ACTIONS.metadata)[keyof typeof ACTIONS.metadata] | (typeof ACTIONS.sync)[keyof typeof ACTIONS.sync] | (typeof ACTIONS.scheduledJob)[keyof typeof ACTIONS.scheduledJob] | (typeof ACTIONS.event)[keyof typeof ACTIONS.event] | (typeof ACTIONS.dataFlow)[keyof typeof ACTIONS.dataFlow];
|
|
52
65
|
//# sourceMappingURL=action-names.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-names.d.ts","sourceRoot":"","sources":["../../../src/actions/utils/action-names.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,4BAA4B,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"action-names.d.ts","sourceRoot":"","sources":["../../../src/actions/utils/action-names.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,4BAA4B,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCT,CAAC;AAEZ,MAAM,MAAM,UAAU,GAClB,OAAO,OAAO,CAAC,YAAY,GAC3B,CAAC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,GAClD,CAAC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,QAAQ,CAAC,GACxD,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,IAAI,CAAC,GAChD,CAAC,OAAO,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,YAAY,CAAC,GAChE,CAAC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,GAClD,CAAC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC"}
|