@tailor-platform/sdk 1.82.0 → 1.84.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 +40 -0
- package/dist/application-5FOWIxFQ.mjs +3 -0
- package/dist/{application-CVeA53ok.mjs → application-CnCljDwk.mjs} +15 -10
- package/dist/application-CnCljDwk.mjs.map +1 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +1 -0
- package/dist/cli/commands/generate/service.d.mts +1 -1
- package/dist/cli/commands/generate/types.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -1
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -1
- package/dist/cli/index.mjs +65 -10
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +1 -1
- package/dist/cli/lib.mjs +2 -2
- package/dist/cli/shared/client.d.mts +28 -3
- package/dist/cli/skills.d.mts +1 -1
- package/dist/completion/zsh-worker.zsh +35 -22
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +173 -5
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/executor/index.d.mts +2 -2
- package/dist/configure/services/executor/trigger/event.d.mts +245 -2
- package/dist/configure/services/executor/trigger/index.d.mts +3 -3
- package/dist/configure/services/index.d.mts +2 -2
- package/dist/configure/services/tailordb/index.d.mts +0 -1
- package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
- package/dist/configure/services/workflow/job.d.mts +9 -0
- package/dist/configure/services/workflow/workflow.d.mts +10 -0
- package/dist/{globals-DUqEetIh.mjs → globals-DraXTdqg.mjs} +6 -5
- package/dist/globals-DraXTdqg.mjs.map +1 -0
- package/dist/{register-typescript-runtime-O7zQNif0.mjs → register-typescript-runtime-BCvWR3HC.mjs} +518 -123
- package/dist/register-typescript-runtime-BCvWR3HC.mjs.map +1 -0
- package/dist/{registry-CXi7rJq7.mjs → registry-Ct0Wgxp1.mjs} +3 -3
- package/dist/registry-Ct0Wgxp1.mjs.map +1 -0
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/workflow.d.mts +39 -21
- package/dist/runtime/workflow.mjs +2 -2
- package/dist/{service-B0MaodSg.mjs → service-CPJWhTLn.mjs} +29 -2
- package/dist/service-CPJWhTLn.mjs.map +1 -0
- package/dist/service-Cigg_U-v.mjs +3 -0
- package/dist/{service_pb-BwZRiNug.mjs → service_pb-D5--My_M.mjs} +5 -5
- package/dist/service_pb-D5--My_M.mjs.map +1 -0
- package/dist/{service_pb-wRkxUta6.mjs → service_pb-i8CmnQP4.mjs} +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +106 -1
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +24 -1
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +49 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +89 -6
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +26 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +101 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +22 -1
- package/dist/types/executor.generated.d.mts +23 -3
- package/dist/utils/test/index.mjs +18 -12
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/utils/test/mock.d.mts +2 -2
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.mjs +30 -24
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/file.d.mts +1 -1
- package/dist/vitest/mocks/workflow.d.mts +20 -15
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workflow-CkIDJpdg.mjs → workflow-B2mwc7aT.mjs} +17 -9
- package/dist/workflow-B2mwc7aT.mjs.map +1 -0
- package/dist/{workspace_resource_pb-UGK1SSn_.mjs → workspace_resource_pb-DXnO2AT-.mjs} +7 -7
- package/dist/workspace_resource_pb-DXnO2AT-.mjs.map +1 -0
- package/docs/cli/tailordb.md +14 -12
- package/docs/cli-reference.md +15 -15
- package/docs/runtime.md +1 -1
- package/docs/services/executor.md +83 -3
- package/docs/services/idp.md +3 -3
- package/docs/services/tailordb-migration.md +18 -5
- package/docs/services/workflow.md +28 -2
- package/docs/testing.md +1 -1
- package/package.json +16 -16
- package/dist/application-CP0W2sQo.mjs +0 -3
- package/dist/application-CVeA53ok.mjs.map +0 -1
- package/dist/globals-DUqEetIh.mjs.map +0 -1
- package/dist/register-typescript-runtime-O7zQNif0.mjs.map +0 -1
- package/dist/registry-CXi7rJq7.mjs.map +0 -1
- package/dist/service-B0MaodSg.mjs.map +0 -1
- package/dist/service-KnAiVofD.mjs +0 -3
- package/dist/service_pb-BwZRiNug.mjs.map +0 -1
- package/dist/workflow-CkIDJpdg.mjs.map +0 -1
- package/dist/workspace_resource_pb-UGK1SSn_.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as cleanupPlatformGlobals, r as installPlatformGlobals, t as RUNTIME_FLAG_KEY } from "../globals-
|
|
1
|
+
import { n as cleanupPlatformGlobals, r as installPlatformGlobals, t as RUNTIME_FLAG_KEY } from "../globals-DraXTdqg.mjs";
|
|
2
2
|
import * as globals from "globals";
|
|
3
3
|
|
|
4
4
|
//#region src/vitest/environment.ts
|
package/dist/vitest/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getRegisteredWorkflow, i as getRegisteredJob, t as TRIGGER_DEFAULT, u as platformSerialize } from "../registry-
|
|
1
|
+
import { a as getRegisteredWorkflow, i as getRegisteredJob, t as TRIGGER_DEFAULT, u as platformSerialize } from "../registry-Ct0Wgxp1.mjs";
|
|
2
2
|
import { a as writeWorkflowTestEnv, i as readWorkflowTestEnv, n as buildJobContext, r as clearWorkflowTestEnv } from "../test-env-key-DuZycyWM.mjs";
|
|
3
3
|
import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
|
|
4
4
|
import { i as withDispose, n as tailorRoot, r as tailordbRoot, t as mockSecretmanager } from "../secretmanager-IY4UvinW.mjs";
|
|
@@ -1314,10 +1314,10 @@ function replaceTrigger(definition) {
|
|
|
1314
1314
|
* Acquire a disposable mock for workflow operations (`tailor.workflow`).
|
|
1315
1315
|
* Restored on dispose.
|
|
1316
1316
|
*
|
|
1317
|
-
* Canonical names (`startWorkflow`, `
|
|
1318
|
-
* and their
|
|
1319
|
-
* share the same underlying `vi.fn`, so calls through
|
|
1320
|
-
* once and handlers configured on
|
|
1317
|
+
* Canonical names (`startWorkflow`, `execJobFunction`, `resumeWorkflowExecution`)
|
|
1318
|
+
* and their aliases (`triggerWorkflow`, `startJobFunction`, `triggerJobFunction`,
|
|
1319
|
+
* `resumeWorkflow`) share the same underlying `vi.fn`, so calls through any
|
|
1320
|
+
* name are recorded once and handlers configured on any name apply to all.
|
|
1321
1321
|
* @returns Disposable workflow mock control object
|
|
1322
1322
|
* @example
|
|
1323
1323
|
* ```typescript
|
|
@@ -1340,31 +1340,32 @@ function mockWorkflow() {
|
|
|
1340
1340
|
const workflowSpies = /* @__PURE__ */ new Map();
|
|
1341
1341
|
const waitPointMocks = /* @__PURE__ */ new Map();
|
|
1342
1342
|
const scopedMocks = /* @__PURE__ */ new Set();
|
|
1343
|
-
const
|
|
1343
|
+
const defaultExecJob = (jobName, args, _options) => {
|
|
1344
1344
|
const body = getRegisteredJob(jobName);
|
|
1345
1345
|
return body ? body(args, buildJobContext()) : null;
|
|
1346
1346
|
};
|
|
1347
1347
|
const defaultTriggerWorkflow = async (workflowName, args, _options) => {
|
|
1348
1348
|
const wf = getRegisteredWorkflow(workflowName);
|
|
1349
1349
|
if (wf) {
|
|
1350
|
-
const out =
|
|
1350
|
+
const out = execJobFunction(wf.mainJobName, platformSerialize(args));
|
|
1351
1351
|
if (out instanceof Promise) await out;
|
|
1352
1352
|
}
|
|
1353
1353
|
return TRIGGER_DEFAULT;
|
|
1354
1354
|
};
|
|
1355
1355
|
const defaultResumeWorkflow = async (executionId) => executionId;
|
|
1356
|
-
const
|
|
1356
|
+
const execJobFunction = vi.fn(defaultExecJob);
|
|
1357
1357
|
const triggerWorkflow = vi.fn(defaultTriggerWorkflow);
|
|
1358
1358
|
const resumeWorkflow = vi.fn(defaultResumeWorkflow);
|
|
1359
1359
|
const wait = vi.fn((_key, _payload) => null);
|
|
1360
1360
|
const resolve = vi.fn(async (_executionId, _key, _callback) => {});
|
|
1361
1361
|
const jobFunctionShim = (...call) => {
|
|
1362
|
-
const out = call.length >= 3 ?
|
|
1362
|
+
const out = call.length >= 3 ? execJobFunction(call[0], platformSerialize(call[1]), call[2]) : execJobFunction(call[0], platformSerialize(call[1]));
|
|
1363
1363
|
return out instanceof Promise ? out.then((v) => platformSerialize(v)) : platformSerialize(out);
|
|
1364
1364
|
};
|
|
1365
1365
|
const workflowShim = (...call) => call.length >= 3 ? triggerWorkflow(call[0], platformSerialize(call[1]), call[2]) : triggerWorkflow(call[0], platformSerialize(call[1]));
|
|
1366
1366
|
const resumeShim = (executionId) => resumeWorkflow(executionId);
|
|
1367
1367
|
root.workflow = {
|
|
1368
|
+
execJobFunction: jobFunctionShim,
|
|
1368
1369
|
startJobFunction: jobFunctionShim,
|
|
1369
1370
|
triggerJobFunction: jobFunctionShim,
|
|
1370
1371
|
startWorkflow: workflowShim,
|
|
@@ -1378,13 +1379,18 @@ function mockWorkflow() {
|
|
|
1378
1379
|
})
|
|
1379
1380
|
};
|
|
1380
1381
|
return withDispose({
|
|
1381
|
-
/** The `
|
|
1382
|
-
|
|
1382
|
+
/** The `execJobFunction` `vi.fn`. */
|
|
1383
|
+
execJobFunction,
|
|
1383
1384
|
/**
|
|
1384
|
-
*
|
|
1385
|
-
* @deprecated Use `
|
|
1385
|
+
* Alias of `execJobFunction` (same `vi.fn` reference).
|
|
1386
|
+
* @deprecated Use `execJobFunction` instead.
|
|
1386
1387
|
*/
|
|
1387
|
-
|
|
1388
|
+
startJobFunction: execJobFunction,
|
|
1389
|
+
/**
|
|
1390
|
+
* Frozen alias of `execJobFunction` (same `vi.fn` reference).
|
|
1391
|
+
* @deprecated Use `execJobFunction` instead.
|
|
1392
|
+
*/
|
|
1393
|
+
triggerJobFunction: execJobFunction,
|
|
1388
1394
|
/** The `startWorkflow` `vi.fn`. */
|
|
1389
1395
|
startWorkflow: triggerWorkflow,
|
|
1390
1396
|
/**
|
|
@@ -1466,29 +1472,29 @@ function mockWorkflow() {
|
|
|
1466
1472
|
* @param handler - Function returning a result for a job name, args, and options
|
|
1467
1473
|
*/
|
|
1468
1474
|
setJobHandler(handler) {
|
|
1469
|
-
|
|
1475
|
+
execJobFunction.mockImplementation((name, args, options) => handler(name, args, options));
|
|
1470
1476
|
},
|
|
1471
1477
|
/**
|
|
1472
|
-
* Enqueue a single result for the next `
|
|
1478
|
+
* Enqueue a single result for the next `execJobFunction` call (FIFO;
|
|
1473
1479
|
* takes priority over `setJobHandler`).
|
|
1474
1480
|
* @param result - Result to return from the next call
|
|
1475
1481
|
*/
|
|
1476
1482
|
enqueueResult(result) {
|
|
1477
|
-
|
|
1483
|
+
execJobFunction.mockImplementationOnce(() => result);
|
|
1478
1484
|
},
|
|
1479
1485
|
/**
|
|
1480
|
-
* Enqueue results for multiple subsequent `
|
|
1486
|
+
* Enqueue results for multiple subsequent `execJobFunction` calls (FIFO).
|
|
1481
1487
|
* @param results - Results to enqueue, one per upcoming call
|
|
1482
1488
|
*/
|
|
1483
1489
|
enqueueResults(...results) {
|
|
1484
|
-
for (const result of results)
|
|
1490
|
+
for (const result of results) execJobFunction.mockImplementationOnce(() => result);
|
|
1485
1491
|
},
|
|
1486
1492
|
/**
|
|
1487
|
-
* All jobs
|
|
1493
|
+
* All jobs executed via `execJobFunction`, in order.
|
|
1488
1494
|
* @returns Triggered jobs array
|
|
1489
1495
|
*/
|
|
1490
1496
|
get triggeredJobs() {
|
|
1491
|
-
return
|
|
1497
|
+
return execJobFunction.mock.calls.map(([jobName, args, options]) => ({
|
|
1492
1498
|
jobName,
|
|
1493
1499
|
args,
|
|
1494
1500
|
...options !== void 0 && { options }
|
|
@@ -1558,7 +1564,7 @@ function mockWorkflow() {
|
|
|
1558
1564
|
},
|
|
1559
1565
|
/** Clear recorded calls while preserving configured responses. */
|
|
1560
1566
|
clear() {
|
|
1561
|
-
|
|
1567
|
+
execJobFunction.mockClear();
|
|
1562
1568
|
triggerWorkflow.mockClear();
|
|
1563
1569
|
resumeWorkflow.mockClear();
|
|
1564
1570
|
wait.mockClear();
|
|
@@ -1567,8 +1573,8 @@ function mockWorkflow() {
|
|
|
1567
1573
|
},
|
|
1568
1574
|
/** Reset all workflow responses and recorded calls (keeps the mock installed). */
|
|
1569
1575
|
reset() {
|
|
1570
|
-
|
|
1571
|
-
|
|
1576
|
+
execJobFunction.mockReset();
|
|
1577
|
+
execJobFunction.mockImplementation(defaultExecJob);
|
|
1572
1578
|
triggerWorkflow.mockReset();
|
|
1573
1579
|
triggerWorkflow.mockImplementation(defaultTriggerWorkflow);
|
|
1574
1580
|
resumeWorkflow.mockReset();
|