@tailor-platform/sdk 1.78.0 → 1.79.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/application-BB6BlUfk.mjs +3 -0
  3. package/dist/{application-CUxVA7Fs.mjs → application-fjqb-Gh8.mjs} +50 -3
  4. package/dist/application-fjqb-Gh8.mjs.map +1 -0
  5. package/dist/cli/index.mjs +13 -35
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.mjs +2 -2
  8. package/dist/completion/zsh-worker.zsh +1 -1
  9. package/dist/configure/index.mjs +7 -6
  10. package/dist/configure/index.mjs.map +1 -1
  11. package/dist/configure/services/tailordb/schema.d.mts +1 -7
  12. package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
  13. package/dist/configure/types/type.d.mts +1 -9
  14. package/dist/{globals-CvizbGLY.mjs → globals-B-n_3uYu.mjs} +11 -5
  15. package/dist/globals-B-n_3uYu.mjs.map +1 -0
  16. package/dist/{registry-CYBRvfaU.mjs → registry-CXi7rJq7.mjs} +3 -2
  17. package/dist/registry-CXi7rJq7.mjs.map +1 -0
  18. package/dist/runtime/field-parse.d.mts +11 -0
  19. package/dist/runtime/globals.d.mts +4 -1
  20. package/dist/runtime/index.mjs +1 -1
  21. package/dist/runtime/workflow.d.mts +79 -15
  22. package/dist/runtime/workflow.mjs +2 -2
  23. package/dist/{runtime-BD2vYJFT.mjs → runtime-CjMeYuPA.mjs} +4 -4
  24. package/dist/{runtime-BD2vYJFT.mjs.map → runtime-CjMeYuPA.mjs.map} +1 -1
  25. package/dist/{schema-U6DxoZ8D.mjs → schema-CYrle8JZ.mjs} +42 -24
  26. package/dist/schema-CYrle8JZ.mjs.map +1 -0
  27. package/dist/vitest/environment.mjs +1 -1
  28. package/dist/vitest/index.mjs +36 -10
  29. package/dist/vitest/index.mjs.map +1 -1
  30. package/dist/vitest/mocks/workflow.d.mts +29 -15
  31. package/dist/vitest/setup.mjs +1 -1
  32. package/dist/workflow-CkIDJpdg.mjs +69 -0
  33. package/dist/workflow-CkIDJpdg.mjs.map +1 -0
  34. package/docs/runtime.md +2 -2
  35. package/docs/services/tailordb.md +2 -0
  36. package/docs/services/workflow.md +2 -2
  37. package/docs/testing.md +2 -2
  38. package/package.json +1 -1
  39. package/dist/application-CUxVA7Fs.mjs.map +0 -1
  40. package/dist/application-Dp_-ioiP.mjs +0 -3
  41. package/dist/configure/types/field-runtime.d.mts +0 -17
  42. package/dist/globals-CvizbGLY.mjs.map +0 -1
  43. package/dist/registry-CYBRvfaU.mjs.map +0 -1
  44. package/dist/schema-U6DxoZ8D.mjs.map +0 -1
  45. package/dist/workflow-DSwnYPPP.mjs +0 -45
  46. package/dist/workflow-DSwnYPPP.mjs.map +0 -1
@@ -3,7 +3,7 @@ import { InferFieldsOutput, TypeLevelError, output } from "../../../types/helper
3
3
  import { FieldOptions, FieldOutput, FieldValidateInput, TailorFieldType, TailorToTs, Validators } from "../../types/field.types.mjs";
4
4
  import { DBFieldMetadata, DefinedDBFieldMetadata, ExcludeNestedDBFields, Hook, Hooks, IndexDef, RelationType, SerialConfig, TailorDBField as TailorDBField$1, TailorDBType as TailorDBType$1, TypeFeatures } from "./types.mjs";
5
5
  import { AllowedValues, AllowedValuesOutput } from "../../types/field.mjs";
6
- import { FieldParseArgs, FieldParseInternalArgs } from "../../types/field-runtime.mjs";
6
+ import { FieldParseArgs } from "../../../runtime/field-parse.mjs";
7
7
  import { PluginConfigs } from "../../../plugin/types.mjs";
8
8
  import { TailorTypeGqlPermission, TailorTypePermission } from "./permission.mjs";
9
9
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -13,7 +13,6 @@ type TailorAnyDBField = Omit<TailorDBField$1<AnyBuilderMethod, AnyBuilderMethod>
13
13
  readonly fields: Record<string, AnyBuilderMethod>;
14
14
  _metadata: DBFieldMetadata;
15
15
  parse: AnyBuilderMethod;
16
- _parseInternal: AnyBuilderMethod;
17
16
  readonly typeName: TypeLevelError<string>;
18
17
  description: AnyBuilderMethod;
19
18
  relation: AnyBuilderMethod;
@@ -172,11 +171,6 @@ interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldM
172
171
  * Parse and validate a value against this field's validation rules
173
172
  */
174
173
  parse(args: FieldParseArgs): StandardSchemaV1.Result<Output>;
175
- /**
176
- * Internal parse method that tracks field path for nested validation
177
- * @private
178
- */
179
- _parseInternal(args: FieldParseInternalArgs): StandardSchemaV1.Result<Output>;
180
174
  /**
181
175
  * typeName is not available on TailorDB fields.
182
176
  * Use typeName on pipeline fields (t.enum / t.object) instead.
@@ -58,10 +58,10 @@ declare function defineWorkflowExecutionPolicy<const N extends string, const D e
58
58
  * }));
59
59
  *
60
60
  * // In a workflow job function:
61
- * await tailor.workflow.triggerJobFunction("worker", args, {
61
+ * await tailor.workflow.startJobFunction("worker", args, {
62
62
  * executionPolicyKey: executionPolicies.premium.key,
63
63
  * });
64
- * await tailor.workflow.triggerJobFunction("worker", args, {
64
+ * await tailor.workflow.startJobFunction("worker", args, {
65
65
  * executionPolicyKey: executionPolicies["tenant-api"].keyFor(input.tenantId),
66
66
  * });
67
67
  */
@@ -1,7 +1,7 @@
1
1
  import { TypeLevelError } from "../../types/helpers.mjs";
2
2
  import { DefinedFieldMetadata, FieldMetadata, FieldValidateInput, TailorField as TailorField$1, TailorFieldType } from "./field.types.mjs";
3
3
  import "./field.mjs";
4
- import { FieldParseArgs, FieldParseInternalArgs } from "./field-runtime.mjs";
4
+ import { FieldParseArgs } from "../../runtime/field-parse.mjs";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
  //#region src/configure/types/type.d.ts
7
7
  type AnyBuilderMethod = any;
@@ -12,7 +12,6 @@ type TailorAnyField = Omit<TailorField$1<AnyBuilderMethod, AnyBuilderMethod, Fie
12
12
  typeName: AnyBuilderMethod;
13
13
  validate: AnyBuilderMethod;
14
14
  parse: AnyBuilderMethod;
15
- _parseInternal: AnyBuilderMethod;
16
15
  };
17
16
  type IsAny<T> = 0 extends 1 & T ? true : false;
18
17
  type WithFieldDescription<Defined> = Defined & {
@@ -70,13 +69,6 @@ interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadat
70
69
  * @returns Validation result
71
70
  */
72
71
  parse(args: FieldParseArgs): StandardSchemaV1.Result<Output>;
73
- /**
74
- * Internal parse method that tracks field path for nested validation
75
- * @private
76
- * @param args - Parse arguments
77
- * @returns Validation result
78
- */
79
- _parseInternal(args: FieldParseInternalArgs): StandardSchemaV1.Result<Output>;
80
72
  }
81
73
  //#endregion
82
74
  export { TailorAnyField, TailorField };
@@ -1,11 +1,17 @@
1
- import { c as runRegisteredJob, l as runRegisteredWorkflow } from "./registry-CYBRvfaU.mjs";
1
+ import { c as runRegisteredJob, l as runRegisteredWorkflow } from "./registry-CXi7rJq7.mjs";
2
2
 
3
3
  //#region src/vitest/workflow-runtime.ts
4
4
  function createDefaultWorkflowRuntime() {
5
+ const startJobFunction = (name, args) => runRegisteredJob(name, args);
6
+ const startWorkflow = (name, args) => runRegisteredWorkflow(name, args);
7
+ const resumeWorkflowExecution = async (executionId) => executionId;
5
8
  return {
6
- triggerJobFunction: (name, args) => runRegisteredJob(name, args),
7
- triggerWorkflow: (name, args) => runRegisteredWorkflow(name, args),
8
- resumeWorkflow: async (executionId) => executionId,
9
+ startJobFunction,
10
+ triggerJobFunction: startJobFunction,
11
+ startWorkflow,
12
+ triggerWorkflow: startWorkflow,
13
+ resumeWorkflowExecution,
14
+ resumeWorkflow: resumeWorkflowExecution,
9
15
  wait: (key) => {
10
16
  throw new Error(`No wait handler for "${key}". Acquire mockWorkflow() and call setWaitHandler(...).`);
11
17
  },
@@ -106,4 +112,4 @@ function cleanupPlatformGlobals(global) {
106
112
 
107
113
  //#endregion
108
114
  export { cleanupPlatformGlobals as n, installPlatformGlobals as r, RUNTIME_FLAG_KEY as t };
109
- //# sourceMappingURL=globals-CvizbGLY.mjs.map
115
+ //# sourceMappingURL=globals-B-n_3uYu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globals-B-n_3uYu.mjs","names":[],"sources":["../src/vitest/workflow-runtime.ts","../src/vitest/globals.ts"],"sourcesContent":["// Default `tailor.workflow` runner installed by the `tailor-runtime` environment.\n// Must stay free of `vitest` (`vi`): it loads via `./globals` in the environment\n// realm where `vi` is unavailable, hence relative imports only (no `@/` alias).\nimport { runRegisteredJob, runRegisteredWorkflow } from \"../configure/services/workflow/registry\";\nimport type { StartJobFunctionOptions, StartWorkflowOptions } from \"../runtime/workflow\";\n\nexport interface DefaultWorkflowRuntime {\n startJobFunction: (name: string, args?: unknown, options?: StartJobFunctionOptions) => unknown;\n triggerJobFunction: (name: string, args?: unknown, options?: StartJobFunctionOptions) => unknown;\n startWorkflow: (name: string, args?: unknown, options?: StartWorkflowOptions) => Promise<string>;\n triggerWorkflow: (\n name: string,\n args?: unknown,\n options?: StartWorkflowOptions,\n ) => Promise<string>;\n resumeWorkflowExecution: (executionId: string) => Promise<string>;\n resumeWorkflow: (executionId: string) => Promise<string>;\n wait: (key: string, payload?: unknown) => unknown;\n resolve: (\n executionId: string,\n key: string,\n callback: (payload: unknown) => unknown,\n ) => Promise<void>;\n}\n\nexport function createDefaultWorkflowRuntime(): DefaultWorkflowRuntime {\n const startJobFunction: DefaultWorkflowRuntime[\"startJobFunction\"] = (name, args) =>\n runRegisteredJob(name, args);\n const startWorkflow: DefaultWorkflowRuntime[\"startWorkflow\"] = (name, args) =>\n runRegisteredWorkflow(name, args);\n const resumeWorkflowExecution: DefaultWorkflowRuntime[\"resumeWorkflowExecution\"] = async (\n executionId,\n ) => executionId;\n return {\n startJobFunction,\n triggerJobFunction: startJobFunction,\n startWorkflow,\n triggerWorkflow: startWorkflow,\n resumeWorkflowExecution,\n resumeWorkflow: resumeWorkflowExecution,\n wait: (key: string): unknown => {\n throw new Error(\n `No wait handler for \"${key}\". Acquire mockWorkflow() and call setWaitHandler(...).`,\n );\n },\n resolve: async (): Promise<void> => {\n throw new Error(\n \"No resolve handler. Acquire mockWorkflow() and call setResolveHandler(...).\",\n );\n },\n };\n}\n","/**\n * Base platform globals for the tailor-runtime test environment.\n *\n * This module is intentionally free of any `vitest` (`vi`) dependency so it can\n * be imported from the Vitest *environment* module (which runs in a realm where\n * `vi` is not available). It installs only the always-present structural pieces:\n *\n * - `globalThis.tailor` / `globalThis.tailordb` container objects\n * - `globalThis.tailor.context.getInvoker` default stub\n * - the platform error classes (`TailorErrors`, `TailorErrorMessage`,\n * `TailorDBFileError`)\n * - the `__tailorRuntimeActive` sentinel flag\n *\n * The per-namespace mock behavior (TailorDB client, workflow, secretmanager, …)\n * is installed on demand by the `xMock()` factories in `./mock`, which run in\n * test context where `vi` *is* available.\n */\n\nimport { createDefaultWorkflowRuntime } from \"./workflow-runtime\";\nimport type { ContextInvoker } from \"../runtime/context\";\nimport type { TailorDBFileErrorCode } from \"../runtime/file\";\n\n// Sentinel set when the tailor-runtime environment is active. setup.ts reads it\n// to decide whether to run its blocked-globals lifecycle and config-secret\n// loading.\nexport const RUNTIME_FLAG_KEY = \"__tailorRuntimeActive\";\n\n// ---------------------------------------------------------------------------\n// Error class mocks\n// ---------------------------------------------------------------------------\n\ninterface TailorErrorItem {\n message: string;\n path: (string | number)[];\n}\n\nclass TailorErrorsMock extends Error {\n errors: TailorErrorItem[];\n\n constructor(errors: TailorErrorItem[]) {\n if (!Array.isArray(errors)) {\n throw new TypeError(\"TailorErrors: errors must be an array\");\n }\n const validated = errors.map((e, i) => {\n if (typeof e.message !== \"string\") {\n throw new TypeError(`TailorErrors: errors[${i}].message must be a string`);\n }\n if (!Array.isArray(e.path)) {\n throw new TypeError(`TailorErrors: errors[${i}].path must be an array`);\n }\n return { message: e.message, path: e.path };\n });\n // Match the PF runtime's TailorErrors serialization, which prefixes the\n // JSON payload with \"TailorErrors: \". Other SDK code (e.g. apply\n // integration fixtures) strips this prefix before JSON.parse.\n super(`TailorErrors: ${JSON.stringify({ errors: validated })}`);\n this.name = \"TailorErrors\";\n this.errors = validated;\n }\n}\n\nclass TailorErrorMessageMock extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"TailorErrorMessage\";\n }\n}\n\nclass TailorDBFileErrorMock extends Error {\n code?: TailorDBFileErrorCode;\n override cause: unknown;\n\n constructor(message: string, code?: TailorDBFileErrorCode, cause?: unknown) {\n super(message);\n this.name = \"TailorDBFileError\";\n this.code = code;\n this.cause = cause;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Base install / cleanup\n// ---------------------------------------------------------------------------\n\n// Stub-only injection. SDK consumers configure invokers at the body level\n// (resolver/executor/workflow `.body()` `invoker` arg) or, for bundled tests,\n// via `vi.spyOn(globalThis.tailor.context, \"getInvoker\")`.\nfunction defaultGetInvoker(): ContextInvoker | null {\n return null;\n}\n\n/**\n * Install the always-present base platform globals (containers, context stub,\n * error classes, runtime flag). Per-namespace mocks are layered on top by the\n * `xMock()` factories in `./mock`.\n * @param global - The global object to install into (typically `globalThis`)\n */\nexport function installPlatformGlobals(global: typeof globalThis): void {\n const g = global as Record<string, unknown>;\n\n g[RUNTIME_FLAG_KEY] = true;\n\n // Containers. Namespace mocks (secretmanager, …) are added to these by the\n // corresponding `xMock()` on acquisition. `workflow` carries a default runner\n // so `.trigger()` runs the real job chain locally without `mockWorkflow()`;\n // `mockWorkflow()` overlays and restores it.\n g.tailor = {\n context: { getInvoker: defaultGetInvoker },\n workflow: createDefaultWorkflowRuntime(),\n };\n g.tailordb = {};\n\n g.TailorErrors = TailorErrorsMock;\n g.TailorErrorMessage = TailorErrorMessageMock;\n g.TailorDBFileError = TailorDBFileErrorMock;\n}\n\n/**\n * Remove the base platform globals (and anything the namespace mocks layered on\n * top, since they live under the same containers).\n * @param global - The global object to clean up (typically `globalThis`)\n */\nexport function cleanupPlatformGlobals(global: typeof globalThis): void {\n const g = global as Record<string, unknown>;\n delete g.tailordb;\n delete g.tailor;\n delete g.TailorErrors;\n delete g.TailorErrorMessage;\n delete g.TailorDBFileError;\n delete g[RUNTIME_FLAG_KEY];\n}\n"],"mappings":";;;AAyBA,SAAgB,+BAAuD;CACrE,MAAM,oBAAgE,MAAM,SAC1E,iBAAiB,MAAM,IAAI;CAC7B,MAAM,iBAA0D,MAAM,SACpE,sBAAsB,MAAM,IAAI;CAClC,MAAM,0BAA6E,OACjF,gBACG;CACL,OAAO;EACL;EACA,oBAAoB;EACpB;EACA,iBAAiB;EACjB;EACA,gBAAgB;EAChB,OAAO,QAAyB;GAC9B,MAAM,IAAI,MACR,wBAAwB,IAAI,wDAC9B;EACF;EACA,SAAS,YAA2B;GAClC,MAAM,IAAI,MACR,6EACF;EACF;CACF;AACF;;;;;;;;;;;;;;;;;;;;;AC1BA,MAAa,mBAAmB;AAWhC,IAAM,mBAAN,cAA+B,MAAM;CACnC;CAEA,YAAY,QAA2B;EACrC,IAAI,CAAC,MAAM,QAAQ,MAAM,GACvB,MAAM,IAAI,UAAU,uCAAuC;EAE7D,MAAM,YAAY,OAAO,KAAK,GAAG,MAAM;GACrC,IAAI,OAAO,EAAE,YAAY,UACvB,MAAM,IAAI,UAAU,wBAAwB,EAAE,2BAA2B;GAE3E,IAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,GACvB,MAAM,IAAI,UAAU,wBAAwB,EAAE,wBAAwB;GAExE,OAAO;IAAE,SAAS,EAAE;IAAS,MAAM,EAAE;GAAK;EAC5C,CAAC;EAID,MAAM,iBAAiB,KAAK,UAAU,EAAE,QAAQ,UAAU,CAAC,GAAG;EAC9D,KAAK,OAAO;EACZ,KAAK,SAAS;CAChB;AACF;AAEA,IAAM,yBAAN,cAAqC,MAAM;CACzC,YAAY,SAAiB;EAC3B,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;AAEA,IAAM,wBAAN,cAAoC,MAAM;CACxC;CACA,AAAS;CAET,YAAY,SAAiB,MAA8B,OAAiB;EAC1E,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,QAAQ;CACf;AACF;AASA,SAAS,oBAA2C;CAClD,OAAO;AACT;;;;;;;AAQA,SAAgB,uBAAuB,QAAiC;CACtE,MAAM,IAAI;CAEV,EAAE,oBAAoB;CAMtB,EAAE,SAAS;EACT,SAAS,EAAE,YAAY,kBAAkB;EACzC,UAAU,6BAA6B;CACzC;CACA,EAAE,WAAW,CAAC;CAEd,EAAE,eAAe;CACjB,EAAE,qBAAqB;CACvB,EAAE,oBAAoB;AACxB;;;;;;AAOA,SAAgB,uBAAuB,QAAiC;CACtE,MAAM,IAAI;CACV,OAAO,EAAE;CACT,OAAO,EAAE;CACT,OAAO,EAAE;CACT,OAAO,EAAE;CACT,OAAO,EAAE;CACT,OAAO,EAAE;AACX"}
@@ -125,9 +125,10 @@ function dispatchTriggerJob(name, args, options) {
125
125
  }
126
126
  function dispatchTriggerWorkflow(name, args, options) {
127
127
  const workflow = currentPlatformWorkflow();
128
- return workflow ? workflow.triggerWorkflow(name, args, options) : runRegisteredWorkflow(name, args);
128
+ if (!workflow) return runRegisteredWorkflow(name, args);
129
+ return arguments.length >= 3 ? workflow.triggerWorkflow(name, args, options) : workflow.triggerWorkflow(name, args);
129
130
  }
130
131
 
131
132
  //#endregion
132
133
  export { getRegisteredWorkflow as a, runRegisteredJob as c, getRegisteredJob as i, runRegisteredWorkflow as l, dispatchTriggerJob as n, registerJob as o, dispatchTriggerWorkflow as r, registerWorkflow as s, TRIGGER_DEFAULT as t, platformSerialize as u };
133
- //# sourceMappingURL=registry-CYBRvfaU.mjs.map
134
+ //# sourceMappingURL=registry-CXi7rJq7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-CXi7rJq7.mjs","names":[],"sources":["../src/utils/test/platform-serialize.ts","../src/configure/services/workflow/registry.ts"],"sourcesContent":["/**\n * Validate and serialize a value as it would cross the Platform JSON boundary.\n *\n * Mirrors the runtime checks the platform performs on workflow arguments,\n * wait payloads, and trigger inputs so that local tests fail in the same\n * places production fails.\n *\n * Throws on:\n * - `NaN` / `Infinity` / `-Infinity` (`JSON.stringify` would silently emit `null`)\n * - `BigInt` (TypeError is thrown by `JSON.stringify`; we emit a clearer message)\n * - Non-plain objects (class instances, including `Date`, `Map`, `Set`, `Error`,\n * and user-defined DTOs whose prototype is not `Object.prototype`)\n *\n * The replacer reads `this[key]` so the check sees the original value before\n * any `toJSON` conversion (e.g. `Date.prototype.toJSON`).\n * @param value - Value to validate and round-trip\n * @returns The JSON-normalized value (undefined/function properties stripped, etc.)\n */\nexport function platformSerialize<T>(value: T): T {\n // Top-level undefined is allowed (jobs may take no input).\n if (value === undefined) return undefined as T;\n\n // Root function/symbol stringify to `undefined`; throw a specific message here.\n if (typeof value === \"function\") {\n throw new TypeError(\"platformSerialize: function is not JSON-serializable at <root>\");\n }\n if (typeof value === \"symbol\") {\n throw new TypeError(\"platformSerialize: Symbol is not JSON-serializable at <root>\");\n }\n\n const serialized = JSON.stringify(value, function (key, val) {\n if (typeof val === \"number\" && !Number.isFinite(val)) {\n throw new TypeError(\n `platformSerialize: non-finite number at ${formatPath(key)}: ${String(val)}`,\n );\n }\n if (typeof val === \"bigint\") {\n throw new TypeError(\n `platformSerialize: BigInt is not JSON-serializable at ${formatPath(key)}`,\n );\n }\n // Look at the pre-toJSON value so Date/Map/Set/etc. can be detected.\n const raw = (this as Record<string, unknown>)[key];\n if (raw !== null && typeof raw === \"object\" && !Array.isArray(raw)) {\n const proto = Object.getPrototypeOf(raw);\n if (proto !== Object.prototype && proto !== null) {\n const ctor = (raw as { constructor?: { name?: string } }).constructor?.name ?? \"anonymous\";\n throw new TypeError(\n `platformSerialize: non-plain object at ${formatPath(key)} (${ctor} instance)`,\n );\n }\n }\n return val;\n });\n\n // `JSON.stringify` returns `undefined` when the root collapses (e.g. a `toJSON`\n // returning `undefined`); parsing that would throw opaquely.\n // JSON.stringify returns undefined for non-serializable values\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n if (serialized === undefined) {\n throw new TypeError(\"platformSerialize: value is not JSON-serializable at <root>\");\n }\n\n return JSON.parse(serialized) as T;\n}\n\nfunction formatPath(key: string): string {\n return key === \"\" ? \"<root>\" : `\"${key}\"`;\n}\n","import { platformSerialize } from \"#/utils/test/platform-serialize\";\nimport { buildJobContext } from \"./test-env-key\";\nimport type { TailorEnv, TailorInvoker } from \"#/runtime/types\";\nimport type { StartJobFunctionOptions, StartWorkflowOptions } from \"#/runtime/workflow\";\n\n/**\n * Body signature shared by workflow jobs at registry-write time.\n * The user's `createWorkflowJob`/`createWorkflow` body uses concrete types,\n * but the registry erases them for storage.\n */\nexport type RegisteredJobBody = (\n args: unknown,\n context: { env: TailorEnv; invoker?: TailorInvoker },\n) => unknown | Promise<unknown>;\n\nexport interface RegisteredWorkflow {\n mainJobName: string;\n}\n\nconst JOB_REGISTRY_KEY: unique symbol = Symbol.for(\"tailor-platform/sdk:job-registry\");\nconst WORKFLOW_REGISTRY_KEY: unique symbol = Symbol.for(\"tailor-platform/sdk:workflow-registry\");\n\ntype PlatformWorkflow = {\n startWorkflow: (name: string, args?: unknown, options?: StartWorkflowOptions) => Promise<string>;\n triggerWorkflow: (\n name: string,\n args?: unknown,\n options?: StartWorkflowOptions,\n ) => Promise<string>;\n startJobFunction: (name: string, args?: unknown, options?: StartJobFunctionOptions) => unknown;\n triggerJobFunction: (name: string, args?: unknown, options?: StartJobFunctionOptions) => unknown;\n};\n\ntype GlobalWithRegistry = typeof globalThis & {\n [JOB_REGISTRY_KEY]?: Map<string, RegisteredJobBody>;\n [WORKFLOW_REGISTRY_KEY]?: Map<string, RegisteredWorkflow>;\n tailor?: { workflow?: PlatformWorkflow };\n};\n\nfunction jobs(): Map<string, RegisteredJobBody> {\n const g = globalThis as GlobalWithRegistry;\n let map = g[JOB_REGISTRY_KEY];\n if (!map) {\n map = new Map();\n g[JOB_REGISTRY_KEY] = map;\n }\n return map;\n}\n\nfunction workflows(): Map<string, RegisteredWorkflow> {\n const g = globalThis as GlobalWithRegistry;\n let map = g[WORKFLOW_REGISTRY_KEY];\n if (!map) {\n map = new Map();\n g[WORKFLOW_REGISTRY_KEY] = map;\n }\n return map;\n}\n\n/**\n * Register a job body keyed by job name. Called as a side effect by\n * `createWorkflowJob` so the vitest mock can execute the body when\n * `globalThis.tailor.workflow.triggerJobFunction(name, args)` is invoked.\n *\n * In production builds the bundler rewrites `.trigger()` calls so this registry\n * is never read; the gated write is dropped as dead code.\n * @param name - Job name\n * @param body - Job body function\n */\nexport function registerJob(name: string, body: RegisteredJobBody): void {\n jobs().set(name, body);\n}\n\n/**\n * Look up a registered job body by name.\n * @param name - Job name\n * @returns The registered body, or undefined when no job is registered\n */\nexport function getRegisteredJob(name: string): RegisteredJobBody | undefined {\n return jobs().get(name);\n}\n\n/**\n * Register a workflow's main job name so the mock can run the workflow locally.\n * @param name - Workflow name\n * @param mainJobName - Name of the workflow's main job\n */\nexport function registerWorkflow(name: string, mainJobName: string): void {\n workflows().set(name, { mainJobName });\n}\n\n/**\n * Look up a registered workflow by name.\n * @param name - Workflow name\n * @returns The registered workflow, or undefined\n */\nexport function getRegisteredWorkflow(name: string): RegisteredWorkflow | undefined {\n return workflows().get(name);\n}\n\nfunction currentPlatformWorkflow(): PlatformWorkflow | undefined {\n // globalThis may not have the tailor property at runtime\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n return (globalThis as GlobalWithRegistry).tailor?.workflow;\n}\n\n// A valid placeholder UUID, so callers that validate the execution id behave the\n// same locally as against the platform.\nexport const TRIGGER_DEFAULT = \"00000000-0000-4000-8000-000000000000\";\n\nfunction serializeReturn(out: unknown): unknown {\n return out instanceof Promise ? out.then((v) => platformSerialize(v)) : platformSerialize(out);\n}\n\n// Runs the registered body across the platform JSON boundary. Shared by the\n// `tailor-runtime` default runner and the no-shim `.trigger()` fallback below.\nexport function runRegisteredJob(name: string, args?: unknown): unknown {\n const body = getRegisteredJob(name);\n const out = body ? body(platformSerialize(args), buildJobContext()) : null;\n return serializeReturn(out);\n}\n\nexport async function runRegisteredWorkflow(name: string, args?: unknown): Promise<string> {\n const workflow = getRegisteredWorkflow(name);\n if (workflow) await runRegisteredJob(workflow.mainJobName, args);\n return TRIGGER_DEFAULT;\n}\n\n// `.trigger()` routes through the installed `tailor.workflow` shim, falling back\n// to running the registered body/workflow locally when none is installed.\n// Preserve arity: the shim sees a 2-argument call when the caller supplied no\n// options, and a 3-argument call otherwise, mirroring the bundler rewrite so\n// mocks observe the same shape in local execution and in bundled workflows.\nexport function dispatchTriggerJob(\n name: string,\n args?: unknown,\n options?: StartJobFunctionOptions,\n): unknown {\n const workflow = currentPlatformWorkflow();\n if (!workflow) return runRegisteredJob(name, args);\n // oxlint-disable-next-line prefer-rest-params\n return arguments.length >= 3\n ? workflow.triggerJobFunction(name, args, options)\n : workflow.triggerJobFunction(name, args);\n}\n\n// Accepts `unknown` because the SDK-side `.trigger()` accepts a wider options\n// shape than the platform surface (e.g. `authInvoker` may be a machine-user\n// name string that the bundler normalizes at build time). Local execution\n// forwards the value verbatim; only the bundled path enforces the platform\n// contract.\nexport function dispatchTriggerWorkflow(\n name: string,\n args?: unknown,\n options?: unknown,\n): Promise<string> {\n const workflow = currentPlatformWorkflow();\n if (!workflow) return runRegisteredWorkflow(name, args);\n // oxlint-disable-next-line prefer-rest-params\n return arguments.length >= 3\n ? workflow.triggerWorkflow(name, args, options as StartWorkflowOptions | undefined)\n : workflow.triggerWorkflow(name, args);\n}\n"],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ import { TailorUser } from "./types.mjs";
2
+ import "../configure/types/field.types.mjs";
3
+ import { StandardSchemaV1 } from "@standard-schema/spec";
4
+ //#region src/runtime/field-parse.d.ts
5
+ type FieldParseArgs = {
6
+ value: unknown;
7
+ data: unknown;
8
+ user: TailorUser;
9
+ };
10
+ //#endregion
11
+ export { FieldParseArgs };
@@ -1,4 +1,4 @@
1
- import { AuthInvoker, TriggerWorkflowOptions } from "./workflow.mjs";
1
+ import { AuthInvoker, StartWorkflowOptions, TriggerWorkflowOptions } from "./workflow.mjs";
2
2
  import { ContextInvoker } from "./context.mjs";
3
3
  import { TailorDBFileErrorCode } from "./file.mjs";
4
4
  import { IconvInstance } from "./iconv.mjs";
@@ -17,6 +17,7 @@ type TailorIdpUser = User;
17
17
  type TailorIdpUserQuery = UserQuery;
18
18
  type TailorWorkflowAuthInvoker = AuthInvoker;
19
19
  type TailorWorkflowTriggerWorkflowOptions = TriggerWorkflowOptions;
20
+ type TailorWorkflowStartWorkflowOptions = StartWorkflowOptions;
20
21
  declare global {
21
22
  namespace tailordb {
22
23
  type QueryResult<T> = TailordbQueryResult<T>;
@@ -75,6 +76,8 @@ declare global {
75
76
  }
76
77
  namespace workflow {
77
78
  type AuthInvoker = TailorWorkflowAuthInvoker;
79
+ type StartWorkflowOptions = TailorWorkflowStartWorkflowOptions;
80
+ /** @deprecated Use `StartWorkflowOptions` instead. */
78
81
  type TriggerWorkflowOptions = TailorWorkflowTriggerWorkflowOptions;
79
82
  }
80
83
  namespace context {
@@ -2,7 +2,7 @@ import { s as iconv_exports } from "../iconv-D2vi8G36.mjs";
2
2
  import { r as secretmanager_exports } from "../secretmanager-BVxw3ih_.mjs";
3
3
  import { t as authconnection_exports } from "../authconnection-BGQM8FZI.mjs";
4
4
  import { n as idp_exports } from "../idp-Bx25ZBdN.mjs";
5
- import { o as workflow_exports } from "../workflow-DSwnYPPP.mjs";
5
+ import { l as workflow_exports } from "../workflow-CkIDJpdg.mjs";
6
6
  import { t as context_exports } from "../context-Bd266-ru.mjs";
7
7
  import { a as file_exports } from "../file-_oUZo76X.mjs";
8
8
  import { t as aigateway_exports } from "../aigateway-B3oZZE6v.mjs";
@@ -1,5 +1,5 @@
1
1
  declare namespace workflow_d_exports {
2
- export { AuthInvoker, ExecutionPolicyKey, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, triggerJobFunction, triggerWorkflow, wait };
2
+ export { AuthInvoker, ExecutionPolicyKey, StartJobFunctionOptions, StartWorkflowOptions, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, resumeWorkflowExecution, startJobFunction, startWorkflow, triggerJobFunction, triggerWorkflow, wait };
3
3
  }
4
4
  /**
5
5
  * Workflow utilities.
@@ -7,10 +7,16 @@ declare namespace workflow_d_exports {
7
7
  * Thin typed wrapper around the platform-provided `tailor.workflow` runtime API.
8
8
  * At runtime this delegates to `globalThis.tailor.workflow`. Use `mockWorkflow`
9
9
  * from `@tailor-platform/sdk/vitest` to mock these calls in unit tests.
10
+ *
11
+ * The canonical names (`startWorkflow`, `startJobFunction`,
12
+ * `resumeWorkflowExecution`) mirror the public `tailor.v1` RPC vocabulary.
13
+ * The pre-alignment names (`triggerWorkflow`, `triggerJobFunction`,
14
+ * `resumeWorkflow`) are kept as frozen aliases that reference the same platform
15
+ * implementations, so existing code continues to work unchanged.
10
16
  * @example
11
17
  * import { workflow } from "@tailor-platform/sdk/runtime";
12
18
  *
13
- * const executionId = await workflow.triggerWorkflow("myWorkflow", { data: "value" });
19
+ * const executionId = await workflow.startWorkflow("myWorkflow", { data: "value" });
14
20
  */
15
21
  /**
16
22
  * Specifies the machine user that should be used to execute the workflow.
@@ -22,11 +28,16 @@ interface AuthInvoker {
22
28
  /** The name of the machine user to use for workflow execution */
23
29
  machineUserName: string;
24
30
  }
25
- /** Options for {@link triggerWorkflow}. */
26
- interface TriggerWorkflowOptions {
31
+ /** Options for {@link startWorkflow}. */
32
+ interface StartWorkflowOptions {
27
33
  /** Optional authentication invoker to specify which machine user should execute the workflow */
28
34
  authInvoker?: AuthInvoker;
29
35
  }
36
+ /**
37
+ * Frozen alias for {@link StartWorkflowOptions}. Kept for backward compatibility.
38
+ * @deprecated Use {@link StartWorkflowOptions} instead.
39
+ */
40
+ type TriggerWorkflowOptions = StartWorkflowOptions;
30
41
  declare const executionPolicyKeyBrand: unique symbol;
31
42
  /**
32
43
  * A concrete runtime key produced by an execution policy instance — either an
@@ -37,14 +48,19 @@ declare const executionPolicyKeyBrand: unique symbol;
37
48
  type ExecutionPolicyKey = string & {
38
49
  readonly [executionPolicyKeyBrand]: never;
39
50
  };
40
- /** Options for {@link triggerJobFunction}. */
41
- interface TriggerJobFunctionOptions {
51
+ /** Options for {@link startJobFunction}. */
52
+ interface StartJobFunctionOptions {
42
53
  /**
43
54
  * Execution policy key matched by the platform against the policies
44
55
  * declared with `defineWorkflowExecutionPolicies` in `tailor.config.ts`.
45
56
  */
46
57
  executionPolicyKey?: ExecutionPolicyKey;
47
58
  }
59
+ /**
60
+ * Frozen alias for {@link StartJobFunctionOptions}. Kept for backward compatibility.
61
+ * @deprecated Use {@link StartJobFunctionOptions} instead.
62
+ */
63
+ type TriggerJobFunctionOptions = StartJobFunctionOptions;
48
64
  /**
49
65
  * Platform API surface for `tailor.workflow`. Describes the shape the platform
50
66
  * runtime injects on `globalThis.tailor.workflow`.
@@ -55,26 +71,53 @@ interface TriggerJobFunctionOptions {
55
71
  */
56
72
  interface TailorWorkflowAPI {
57
73
  /**
58
- * Triggers a workflow and returns its execution ID.
74
+ * Starts a workflow and returns its execution ID.
75
+ *
76
+ * Canonical name that mirrors the `tailor.v1` RPC vocabulary.
77
+ * {@link triggerWorkflow} is a frozen alias that resolves to the same
78
+ * platform implementation.
59
79
  * @param workflowName - Workflow name as defined in tailor.config
60
80
  * @param args - Arguments forwarded to the workflow's main job
61
- * @param options - Optional trigger options (e.g. `authInvoker`)
62
- * @returns The execution ID of the triggered workflow
81
+ * @param options - Optional start options (e.g. `authInvoker`)
82
+ * @returns The execution ID of the started workflow
83
+ */
84
+ startWorkflow(workflowName: string, args?: any, options?: StartWorkflowOptions): Promise<string>;
85
+ /**
86
+ * Frozen alias for {@link startWorkflow}. Kept for backward compatibility.
87
+ * @deprecated Use {@link startWorkflow} instead.
63
88
  */
64
89
  triggerWorkflow(workflowName: string, args?: any, options?: TriggerWorkflowOptions): Promise<string>;
65
90
  /**
66
91
  * Resumes a failed or pending-retry workflow execution and returns its execution ID.
92
+ *
93
+ * Canonical name that mirrors the `tailor.v1` RPC vocabulary.
94
+ * {@link resumeWorkflow} is a frozen alias that resolves to the same
95
+ * platform implementation.
67
96
  * @param executionId - The execution to resume
68
97
  * @returns The execution ID of the resumed workflow
69
98
  */
99
+ resumeWorkflowExecution(executionId: string): Promise<string>;
100
+ /**
101
+ * Frozen alias for {@link resumeWorkflowExecution}. Kept for backward compatibility.
102
+ * @deprecated Use {@link resumeWorkflowExecution} instead.
103
+ */
70
104
  resumeWorkflow(executionId: string): Promise<string>;
71
105
  /**
72
- * Triggers a job function and returns its result.
106
+ * Starts a job function and returns its result.
107
+ *
108
+ * Canonical name that mirrors the `tailor.v1` RPC vocabulary.
109
+ * {@link triggerJobFunction} is a frozen alias that resolves to the same
110
+ * platform implementation.
73
111
  * @param jobName - Job name as defined in the workflow
74
112
  * @param args - Arguments forwarded to the job
75
- * @param options - Optional trigger options (e.g. `executionPolicyKey`)
113
+ * @param options - Optional start options (e.g. `executionPolicyKey`)
76
114
  * @returns The job's return value
77
115
  */
116
+ startJobFunction(jobName: string, args?: any, options?: StartJobFunctionOptions): any;
117
+ /**
118
+ * Frozen alias for {@link startJobFunction}. Kept for backward compatibility.
119
+ * @deprecated Use {@link startJobFunction} instead.
120
+ */
78
121
  triggerJobFunction(jobName: string, args?: any, options?: TriggerJobFunctionOptions): any;
79
122
  /**
80
123
  * Suspends the current workflow execution and waits for an external signal to resume.
@@ -93,19 +136,40 @@ interface TailorWorkflowAPI {
93
136
  resolve(executionId: string, key: string, callback: (waitPayload: any) => any): Promise<void>;
94
137
  }
95
138
  /**
96
- * See {@link TailorWorkflowAPI.triggerWorkflow}.
139
+ * See {@link TailorWorkflowAPI.startWorkflow}.
140
+ * @param args - Forwarded to {@link TailorWorkflowAPI.startWorkflow}
141
+ * @returns The execution ID of the started workflow
142
+ */
143
+ declare const startWorkflow: TailorWorkflowAPI["startWorkflow"];
144
+ /**
145
+ * Frozen alias for {@link startWorkflow}. Kept for backward compatibility.
146
+ * @deprecated Use {@link startWorkflow} instead.
97
147
  * @param args - Forwarded to {@link TailorWorkflowAPI.triggerWorkflow}
98
148
  * @returns The execution ID of the triggered workflow
99
149
  */
100
150
  declare const triggerWorkflow: TailorWorkflowAPI["triggerWorkflow"];
101
151
  /**
102
- * See {@link TailorWorkflowAPI.resumeWorkflow}.
152
+ * See {@link TailorWorkflowAPI.resumeWorkflowExecution}.
153
+ * @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflowExecution}
154
+ * @returns The execution ID of the resumed workflow
155
+ */
156
+ declare const resumeWorkflowExecution: TailorWorkflowAPI["resumeWorkflowExecution"];
157
+ /**
158
+ * Frozen alias for {@link resumeWorkflowExecution}. Kept for backward compatibility.
159
+ * @deprecated Use {@link resumeWorkflowExecution} instead.
103
160
  * @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflow}
104
161
  * @returns The execution ID of the resumed workflow
105
162
  */
106
163
  declare const resumeWorkflow: TailorWorkflowAPI["resumeWorkflow"];
107
164
  /**
108
- * See {@link TailorWorkflowAPI.triggerJobFunction}.
165
+ * See {@link TailorWorkflowAPI.startJobFunction}.
166
+ * @param args - Forwarded to {@link TailorWorkflowAPI.startJobFunction}
167
+ * @returns The job's return value
168
+ */
169
+ declare const startJobFunction: TailorWorkflowAPI["startJobFunction"];
170
+ /**
171
+ * Frozen alias for {@link startJobFunction}. Kept for backward compatibility.
172
+ * @deprecated Use {@link startJobFunction} instead.
109
173
  * @param args - Forwarded to {@link TailorWorkflowAPI.triggerJobFunction}
110
174
  * @returns The job's return value
111
175
  */
@@ -123,4 +187,4 @@ declare const wait: TailorWorkflowAPI["wait"];
123
187
  */
124
188
  declare const resolve: TailorWorkflowAPI["resolve"];
125
189
  //#endregion
126
- export { AuthInvoker, ExecutionPolicyKey, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, triggerJobFunction, triggerWorkflow, wait, workflow_d_exports };
190
+ export { AuthInvoker, ExecutionPolicyKey, StartJobFunctionOptions, StartWorkflowOptions, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, resumeWorkflowExecution, startJobFunction, startWorkflow, triggerJobFunction, triggerWorkflow, wait, workflow_d_exports };
@@ -1,3 +1,3 @@
1
- import { a as wait, i as triggerWorkflow, n as resumeWorkflow, r as triggerJobFunction, t as resolve } from "../workflow-DSwnYPPP.mjs";
1
+ import { a as startWorkflow, c as wait, i as startJobFunction, n as resumeWorkflow, o as triggerJobFunction, r as resumeWorkflowExecution, s as triggerWorkflow, t as resolve } from "../workflow-CkIDJpdg.mjs";
2
2
 
3
- export { resolve, resumeWorkflow, triggerJobFunction, triggerWorkflow, wait };
3
+ export { resolve, resumeWorkflow, resumeWorkflowExecution, startJobFunction, startWorkflow, triggerJobFunction, triggerWorkflow, wait };
@@ -1,8 +1,8 @@
1
- import { t as db } from "./schema-U6DxoZ8D.mjs";
1
+ import { t as db } from "./schema-CYrle8JZ.mjs";
2
2
  import { $ as CreateAuthIDPConfigRequestSchema, A as CreatePipelineResolverRequestSchema, At as TenantProviderConfig_TenantProviderType, B as IdPPermissionOperator, Bt as CreateAIGatewayRequestSchema, C as UpdateStaticWebsiteRequestSchema, Ct as AuthOAuth2Client_ClientType, D as CreateSecretManagerVaultRequestSchema, Dt as AuthSCIMAttribute_Uniqueness, E as CreateSecretManagerSecretRequestSchema, Et as AuthSCIMAttribute_Type, F as PipelineResolver_OperationType, Ft as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, G as CreateExecutorExecutorRequestSchema, Gt as ConditionSchema, H as FunctionExecution_Status, I as CreateIdPServiceRequestSchema, It as UpdateApplicationRequestSchema, J as ExecutorJobStatus, Jt as PageDirection, K as UpdateExecutorExecutorRequestSchema, Kt as Condition_Operator, L as UpdateIdPServiceRequestSchema, M as UpdatePipelineResolverRequestSchema, N as UpdatePipelineServiceRequestSchema, O as UpdateSecretManagerSecretRequestSchema, Ot as AuthSCIMConfig_AuthorizationType, Pt as CreateApplicationRequestSchema, Q as CreateAuthHookRequestSchema, Rt as ApplicationSchemaUpdateAttemptStatus, S as CreateStaticWebsiteRequestSchema, St as AuthInvokerSchema, Tt as AuthSCIMAttribute_Mutability, V as IdPPermissionPermit, Vt as UpdateAIGatewayRequestSchema, X as ExecutorTriggerType, Y as ExecutorTargetType, Z as CreateAuthConnectionRequestSchema, _ as TailorDBGQLPermission_Permit, a as CreateWorkflowRequestSchema, at as CreateTenantConfigRequestSchema, b as TailorDBType_PermitAction, bt as AuthHookPoint, ct as UpdateAuthHookRequestSchema, d as CreateTailorDBServiceRequestSchema, dt as UpdateAuthOAuth2ClientRequestSchema, et as CreateAuthMachineUserRequestSchema, f as CreateTailorDBTypeRequestSchema, ft as UpdateAuthSCIMConfigRequestSchema, g as TailorDBGQLPermission_Operator, gt as UpdateUserProfileConfigRequestSchema, h as TailorDBGQLPermission_Action, ht as UpdateTenantConfigRequestSchema, i as CreateWorkflowJobFunctionRequestSchema, it as CreateAuthServiceRequestSchema, j as CreatePipelineServiceRequestSchema, jt as UserProfileProviderConfig_UserProfileProviderType, l as WorkflowExecution_Status, lt as UpdateAuthIDPConfigRequestSchema, mt as UpdateAuthServiceRequestSchema, nt as CreateAuthSCIMConfigRequestSchema, o as UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, ot as CreateUserProfileConfigRequestSchema, p as UpdateTailorDBTypeRequestSchema, pt as UpdateAuthSCIMResourceRequestSchema, qt as FilterSchema, r as CreateWorkflowJobFunctionExecutionPolicyRequestSchema, rt as CreateAuthSCIMResourceRequestSchema, s as UpdateWorkflowRequestSchema, st as UpdateAuthConnectionRequestSchema, t as WorkspacePlatformUserRole, tt as CreateAuthOAuth2ClientRequestSchema, u as WorkflowJobExecution_Status, ut as UpdateAuthMachineUserRequestSchema, v as TailorDBType_Permission_Operator, vt as AuthConnection_Status, wt as AuthOAuth2Client_GrantType, x as AddCustomDomainRequestSchema, xt as AuthIDPConfig_AuthType, y as TailorDBType_Permission_Permit, yt as AuthConnection_Type, z as IdPLang, zt as Subgraph_ServiceType } from "./workspace_resource_pb-Db3fv68L.mjs";
3
3
  import { t as assertDefined } from "./assert-DBxo8jPo.mjs";
4
4
  import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-BwS4ppwO.mjs";
5
- import { A as fetchAllTolerant, B as initOperatorClient, C as createBundleCache, E as hashFile, F as getConsoleBaseUrl, G as byName, H as normalizeBaseUrl, I as getOAuth2ClientId, K as LOG_LEVELS, L as getOrNull, M as fetchPaged, O as defaultPlatformBaseUrl, R as getPlatformBaseUrl, S as hasGenerationHooks, T as hashContent, U as rememberPlatformConfigForToken, V as isDefaultPlatform, W as resolveStaticWebsiteUrls, _ as platformBundleDefinePlugin, d as buildExecutorArgsExpr, f as buildResolverOperationHookExpr, g as stringifyFunction, h as TailorDBTypeSchema, i as resolverBundleKey, j as fetchMachineUserToken, k as fetchAll, l as HTTP_METHODS, m as assertUniqueTailorDBTypeNamesWithExternal, n as generatePluginFilesIfNeeded, o as WorkflowJobFunctionExecutionPolicySchema, p as assertUniqueLocalTailorDBTypeNames, r as loadApplication, t as defineApplication, w as getDistDir, x as getPluginGenerationDependencies, z as initOAuth2Client } from "./application-CUxVA7Fs.mjs";
5
+ import { A as fetchAllTolerant, B as initOperatorClient, C as createBundleCache, E as hashFile, F as getConsoleBaseUrl, G as byName, H as normalizeBaseUrl, I as getOAuth2ClientId, K as LOG_LEVELS, L as getOrNull, M as fetchPaged, O as defaultPlatformBaseUrl, R as getPlatformBaseUrl, S as hasGenerationHooks, T as hashContent, U as rememberPlatformConfigForToken, V as isDefaultPlatform, W as resolveStaticWebsiteUrls, _ as platformBundleDefinePlugin, d as buildExecutorArgsExpr, f as buildResolverOperationHookExpr, g as stringifyFunction, h as TailorDBTypeSchema, i as resolverBundleKey, j as fetchMachineUserToken, k as fetchAll, l as HTTP_METHODS, m as assertUniqueTailorDBTypeNamesWithExternal, n as generatePluginFilesIfNeeded, o as WorkflowJobFunctionExecutionPolicySchema, p as assertUniqueLocalTailorDBTypeNames, r as loadApplication, t as defineApplication, w as getDistDir, x as getPluginGenerationDependencies, z as initOAuth2Client } from "./application-fjqb-Gh8.mjs";
6
6
  import { o as loadFilesWithIgnores, s as functionSchema, t as createExecutorService } from "./service-D12iQGcS.mjs";
7
7
  import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-j9QBF0cB.mjs";
8
8
  import { t as multiline } from "./multiline-sfHpTZZK.mjs";
@@ -18690,7 +18690,7 @@ async function generate(options) {
18690
18690
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
18691
18691
  let pluginManager;
18692
18692
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
18693
- const { defineApplication } = await import("./application-Dp_-ioiP.mjs");
18693
+ const { defineApplication } = await import("./application-BB6BlUfk.mjs");
18694
18694
  const application = defineApplication({
18695
18695
  config,
18696
18696
  pluginManager
@@ -20776,4 +20776,4 @@ function isDeno() {
20776
20776
 
20777
20777
  //#endregion
20778
20778
  export { listFolders as $, deploymentArgs as $n, handleOptionalToRequiredError as $t, generate as A, generateUserTypes as An, startCommand as At, remove as B, loadConsoleBaseUrl as Bn, deploy as Bt, waitWorkflowExecution as C, formatDiffSummary as Cn, listCommand$8 as Ct, listWorkflows as D, resourceTrn as Dn, jobsCommand as Dt, listCommand$2 as E, getNamespacesWithMigrations as En, getExecutorWaitFailureMessage as Et, openInConfiguredEditor as F, deleteUserTokens as Fn, getWorkflowExecution as Ft, treeCommand as G, readPlatformConfig as Gn, createWorkspace$1 as Gt, updateCommand$1 as H, loadStoredUserTokens as Hn, listCommand$9 as Ht, show as I, fetchLatestToken as In, listWorkflowExecutions as It, getCommand$1 as J, writePlatformConfig as Jn, ensureConfigId as Jt, listCommand$3 as K, resolveUserTokenKey as Kn, formatKeyValueTable as Kt, showCommand as L, hasAnyUserTokenEntry as Ln, functionExecutionStatusToString as Lt, generateMigrationScript as M, apiCall as Mn, getCommand$5 as Mt, writeDbTypesFile as N, assertWritable as Nn, getWorkflow as Nt, truncate as O, sdkNameLabelKey as On, listExecutorJobs as Ot, getConfiguredEditorCommand as P, loadConfig as Pn, executionsCommand as Pt, listCommand$4 as Q, confirmationArgs as Qn, MIGRATION_LABEL_KEY as Qt, extractOwnedNamespaces as R, hasUserTokenEntry as Rn, getCommand$6 as Rt, waitCommand as S, parseMigrationNumberArg as Sn, triggerExecutor as St, resumeWorkflow as T, hasChanges as Tn, getExecutorJob as Tt, updateOrganization as U, loadWorkspaceId as Un, listWorkspaces as Ut, removeCommand$1 as V, loadMachineUserName as Vn, deployFromCLI as Vt, organizationTree as W, platformConfigFromProfile as Wn, createCommand$1 as Wt, updateCommand$2 as X, commonArgs as Xn, waitForExecution as Xt, getOrganization as Y, defineAppCommand as Yn, executeScript as Yt, updateFolder as Z, configArg as Zn, bundleMigrationScript as Zt, deleteWorkspace as _, getNextMigrationNumber as _n, getCommand$4 as _t, updateUser as a, DIFF_FILE_NAME as an, toPageDirection as ar, createFolder as at, getAppHealth as b, reconstructSnapshotFromMigrations as bn, webhookCommand as bt, listCommand as c, SCHEMA_FILE_NAME as cn, getCommand$3 as ct, inviteUser as d, compareSnapshots as dn, tokenCommand as dt, parseMigrationLabelNumber as en, isVerbose as er, getCommand$2 as et, restoreCommand as f, createSnapshotFromLocalTypes as fn, listCommand$6 as ft, deleteCommand as g, getMigrationFiles as gn, listFunctionRegistries as gt, getWorkspace as h, getMigrationFilePath as hn, listCommand$7 as ht, updateCommand as i, DB_TYPES_FILE_NAME as in, resolveMachineUserInputSource as ir, createCommand as it, generateCommand as j, prompt as jn, startWorkflow as jt, truncateCommand as k, PluginManager as kn, watchExecutorJob as kt, listUsers as l, assertValidMigrationFiles as ln, getOAuth2Client as lt, getCommand as m, getMigrationDirPath as mn, generate$1 as mt, query as n, generateAllTypeManifestsFromSnapshot as nn, pagedLogArgs as nr, deleteCommand$1 as nt, removeCommand as o, INITIAL_SCHEMA_NUMBER as on, workspaceArgs as or, listCommand$5 as ot, restoreWorkspace as p, getLatestMigrationNumber as pn, listMachineUsers as pt, listOrganizations as q, saveUserTokens as qn, workspaceNameSchema as qt, queryCommand as r, protoGqlPermission as rn, paginationArgs as rr, deleteFolder as rt, removeUser as s, MIGRATE_FILE_NAME as sn, listOAuth2Clients as st, isNativeTypeScriptRuntime as t, compareSnapshotWithRemote as tn, multiConfigArg as tr, getFolder as tt, inviteCommand as u, compareLocalTypesWithSnapshot as un, getMachineUserToken as ut, listApps as v, isValidMigrationNumber as vn, getFunctionRegistry as vt, resumeCommand as w, formatMigrationDiff as wn, listExecutors as wt, healthCommand as x, formatMigrationNumber as xn, triggerCommand as xt, listCommand$1 as y, loadDiff as yn, listWebhookExecutors as yt, logBetaWarning as z, loadAccessToken as zn, getExecutor as zt };
20779
- //# sourceMappingURL=runtime-BD2vYJFT.mjs.map
20779
+ //# sourceMappingURL=runtime-CjMeYuPA.mjs.map