@tailor-platform/sdk 1.74.1 → 1.75.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 (52) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/application-BJKNlv8c.mjs +3 -0
  3. package/dist/{application-BsH6tkZC.mjs → application-DYshsH-K.mjs} +20 -8
  4. package/dist/application-DYshsH-K.mjs.map +1 -0
  5. package/dist/brand-Eo4pLXPJ.mjs.map +1 -1
  6. package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -0
  7. package/dist/cli/index.mjs +4 -4
  8. package/dist/cli/lib.mjs +2 -2
  9. package/dist/completion/zsh-worker.zsh +9 -9
  10. package/dist/configure/config/types.d.mts +3 -1
  11. package/dist/configure/index.d.mts +3 -1
  12. package/dist/configure/index.mjs +111 -3
  13. package/dist/configure/index.mjs.map +1 -1
  14. package/dist/configure/services/index.d.mts +3 -1
  15. package/dist/configure/services/workflow/execution-policy.d.mts +71 -0
  16. package/dist/configure/services/workflow/execution-policy.types.d.mts +104 -0
  17. package/dist/configure/services/workflow/index.d.mts +3 -1
  18. package/dist/configure/services/workflow/job.d.mts +7 -3
  19. package/dist/{globals-B8XX5TRB.mjs → globals-CcU1ONiK.mjs} +2 -2
  20. package/dist/globals-CcU1ONiK.mjs.map +1 -0
  21. package/dist/{job-CtU73PGa.mjs → job-D-PbD1P3.mjs} +5 -3
  22. package/dist/job-D-PbD1P3.mjs.map +1 -0
  23. package/dist/{registry-BozuxbPp.mjs → registry-NfSW0BRo.mjs} +4 -3
  24. package/dist/registry-NfSW0BRo.mjs.map +1 -0
  25. package/dist/runtime/globals.d.mts +1 -1
  26. package/dist/runtime/index.d.mts +1 -1
  27. package/dist/runtime/workflow.d.mts +22 -3
  28. package/dist/{runtime-DV1EnfMs.mjs → runtime-CJ5usBOu.mjs} +230 -6
  29. package/dist/runtime-CJ5usBOu.mjs.map +1 -0
  30. package/dist/{service_pb-CIrhGwHk.mjs → service_pb-4unFyubn.mjs} +16 -6
  31. package/dist/{service_pb-CIrhGwHk.mjs.map → service_pb-4unFyubn.mjs.map} +1 -1
  32. package/dist/{service_pb-DjwIn4jO.mjs → service_pb-D-PXRoMg.mjs} +1 -1
  33. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +1 -1
  34. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +29 -9
  35. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +35 -1
  36. package/dist/utils/test/index.mjs +1 -1
  37. package/dist/utils/test/index.mjs.map +1 -1
  38. package/dist/vitest/environment.mjs +1 -1
  39. package/dist/vitest/index.mjs +15 -12
  40. package/dist/vitest/index.mjs.map +1 -1
  41. package/dist/vitest/mocks/workflow.d.mts +5 -3
  42. package/dist/vitest/setup.mjs +1 -1
  43. package/dist/workflow-DSwnYPPP.mjs.map +1 -1
  44. package/docs/configuration.md +24 -0
  45. package/docs/services/workflow.md +78 -0
  46. package/package.json +1 -1
  47. package/dist/application-BsH6tkZC.mjs.map +0 -1
  48. package/dist/application-CSUhZMb5.mjs +0 -3
  49. package/dist/globals-B8XX5TRB.mjs.map +0 -1
  50. package/dist/job-CtU73PGa.mjs.map +0 -1
  51. package/dist/registry-BozuxbPp.mjs.map +0 -1
  52. package/dist/runtime-DV1EnfMs.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"brand-Eo4pLXPJ.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind =\n | \"tailordb-type\"\n | \"resolver\"\n | \"executor\"\n | \"workflow\"\n | \"workflow-job\"\n | \"wait-point\"\n | \"http-adapter\";\n\n/**\n * Adds a non-enumerable SDK brand symbol to the given object (in-place).\n * The brand stores the kind so service loaders can distinguish between\n * different SDK object types (e.g. a type loader skips executors).\n * @param value - The object to brand\n * @param kind - The kind of SDK object\n * @returns The same object with the brand applied\n */\nexport function brandValue<T extends object>(value: T, kind: SdkBrandKind): T {\n Object.defineProperty(value, SDK_BRAND, {\n value: kind,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n return value;\n}\n\n/**\n * Checks whether the given value has been branded by the SDK.\n * When kind is specified, only returns true if the brand matches that kind.\n * Accepts a single kind or an array of kinds for multi-kind matching.\n * @param value - The value to check\n * @param kind - Optional kind or kinds to match against\n * @returns True if the value has the SDK brand symbol (and matches kind if specified)\n */\nexport function isSdkBranded(\n value: unknown,\n kind?: SdkBrandKind | readonly SdkBrandKind[],\n): boolean {\n if (value === null || typeof value !== \"object\" || !(SDK_BRAND in value)) return false;\n const stored = (value as Record<symbol, unknown>)[SDK_BRAND];\n // No kind filter → any brand matches. Legacy `true` brand → matches any kind.\n return (\n kind === undefined ||\n stored === true ||\n (Array.isArray(kind) ? kind.includes(stored as SdkBrandKind) : stored === kind)\n );\n}\n"],"mappings":";AAEA,MAAa,YAA2B,OAAO,IAAI,qBAAqB;;;;;;;;;AAmBxE,SAAgB,WAA6B,OAAU,MAAuB;CAC5E,OAAO,eAAe,OAAO,WAAW;EACtC,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;CACZ,CAAC;CACD,OAAO;AACT;;;;;;;;;AAUA,SAAgB,aACd,OACA,MACS;CACT,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,EAAE,aAAa,QAAQ,OAAO;CACjF,MAAM,SAAU,MAAkC;CAElD,OACE,SAAS,UACT,WAAW,SACV,MAAM,QAAQ,IAAI,IAAI,KAAK,SAAS,MAAsB,IAAI,WAAW;AAE9E"}
1
+ {"version":3,"file":"brand-Eo4pLXPJ.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind =\n | \"tailordb-type\"\n | \"resolver\"\n | \"executor\"\n | \"workflow\"\n | \"workflow-job\"\n | \"wait-point\"\n | \"execution-policy\"\n | \"http-adapter\";\n\n/**\n * Adds a non-enumerable SDK brand symbol to the given object (in-place).\n * The brand stores the kind so service loaders can distinguish between\n * different SDK object types (e.g. a type loader skips executors).\n * @param value - The object to brand\n * @param kind - The kind of SDK object\n * @returns The same object with the brand applied\n */\nexport function brandValue<T extends object>(value: T, kind: SdkBrandKind): T {\n Object.defineProperty(value, SDK_BRAND, {\n value: kind,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n return value;\n}\n\n/**\n * Checks whether the given value has been branded by the SDK.\n * When kind is specified, only returns true if the brand matches that kind.\n * Accepts a single kind or an array of kinds for multi-kind matching.\n * @param value - The value to check\n * @param kind - Optional kind or kinds to match against\n * @returns True if the value has the SDK brand symbol (and matches kind if specified)\n */\nexport function isSdkBranded(\n value: unknown,\n kind?: SdkBrandKind | readonly SdkBrandKind[],\n): boolean {\n if (value === null || typeof value !== \"object\" || !(SDK_BRAND in value)) return false;\n const stored = (value as Record<symbol, unknown>)[SDK_BRAND];\n // No kind filter → any brand matches. Legacy `true` brand → matches any kind.\n return (\n kind === undefined ||\n stored === true ||\n (Array.isArray(kind) ? kind.includes(stored as SdkBrandKind) : stored === kind)\n );\n}\n"],"mappings":";AAEA,MAAa,YAA2B,OAAO,IAAI,qBAAqB;;;;;;;;;AAoBxE,SAAgB,WAA6B,OAAU,MAAuB;CAC5E,OAAO,eAAe,OAAO,WAAW;EACtC,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;CACZ,CAAC;CACD,OAAO;AACT;;;;;;;;;AAUA,SAAgB,aACd,OACA,MACS;CACT,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,EAAE,aAAa,QAAQ,OAAO;CACjF,MAAM,SAAU,MAAkC;CAElD,OACE,SAAS,UACT,WAAW,SACV,MAAM,QAAQ,IAAI,IAAI,KAAK,SAAS,MAAsB,IAAI,WAAW;AAE9E"}
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { C as CustomDomainStatus, R as FunctionExecution_Type, mt as AuthInvokerSchema, xt as PATScope } from "../service_pb-CIrhGwHk.mjs";
2
+ import { B as FunctionExecution_Type, Ct as PATScope, T as CustomDomainStatus, gt as AuthInvokerSchema } from "../service_pb-4unFyubn.mjs";
3
3
  import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
4
4
  import { n as logger, r as styles } from "../logger-BEiZZ3qT.mjs";
5
- import { $t as compareSnapshotWithRemote, A as listCommand$12, An as apiCommand, Bn as pagedLogArgs, C as listCommand$13, Cn as hasChanges, Dn as PluginManager, Dt as listCommand$6, E as waitCommand, En as sdkNameLabelKey, F as generateCommand$1, Fn as configArg, G as removeCommand$1, Gt as deploy, H as extractOwnedNamespaces, Hn as toPageDirection, Ht as formatKeyValueTable, I as generateMigrationScript, In as confirmationArgs, It as getCommand$6, K as updateCommand$3, Kt as ensureConfigId, L as writeDbTypesFile, Ln as deploymentArgs, Mn as assertWritable, N as truncateCommand, Nn as defineAppCommand, O as resumeCommand, On as generateUserTypes, Pn as commonArgs, Pt as startCommand, Q as getCommand$5, Qt as parseMigrationLabelNumber, R as getConfiguredEditorCommand, Rn as isVerbose, Rt as executionsCommand, Sn as formatMigrationDiff, T as healthCommand, Tn as resourceTrn, Tt as triggerCommand, U as logBetaWarning, Un as workspaceArgs, Ut as getCommand$1, V as showCommand, Vn as paginationArgs, Vt as functionExecutionStatusToString, X as listCommand$11, Xt as MIGRATION_LABEL_KEY, Y as treeCommand, Zt as handleOptionalToRequiredError, _n as loadDiff, b as createCommand$4, bn as parseMigrationNumberArg, c as listCommand$14, cn as compareLocalTypesWithSnapshot, ct as createCommand$3, dn as getLatestMigrationNumber, en as generateAllTypeManifestsFromSnapshot, et as updateCommand$2, f as restoreCommand, ft as getCommand$3, g as getCommand$7, gn as isValidMigrationNumber, gt as listCommand$8, ht as tokenCommand, i as updateCommand$4, in as INITIAL_SCHEMA_NUMBER, it as getCommand$4, jt as jobsCommand, kn as prompt, m as listCommand$15, mn as getMigrationFiles, nt as listCommand$10, o as removeCommand, ot as deleteCommand$4, pn as getMigrationFilePath, qt as executeScript, r as queryCommand, sn as assertValidMigrationFiles, t as isNativeTypeScriptRuntime, tn as protoGqlPermission, u as inviteCommand, un as createSnapshotFromLocalTypes, ut as listCommand$9, v as deleteCommand$5, vn as reconstructSnapshotFromMigrations, vt as generate, wn as getNamespacesWithMigrations, wt as webhookCommand, xt as getCommand$2, yn as formatMigrationNumber, yt as listCommand$7, z as openInConfiguredEditor, zn as multiConfigArg } from "../runtime-DV1EnfMs.mjs";
6
- import { $ as getOrNull, A as hasUserTokenEntry, B as resolveUserTokenKey, C as getDistDir, D as deleteUserTokens, E as loadConfig, G as fetchAll, H as writePlatformConfig, I as loadStoredUserTokens, J as fetchPaged, K as fetchAllTolerant, L as loadWorkspaceId, N as loadConsoleBaseUrl, O as fetchLatestToken, P as loadMachineUserName, R as platformConfigFromProfile, U as closeConnectionPool, V as saveUserTokens, W as defaultPlatformBaseUrl, X as fetchUserInfo, Y as fetchPlatformMachineUserToken, _ as composeFunctionTreeshakeOptions, a as resolveInlineSourcemap, g as platformBundleDefinePlugin, j as loadAccessToken, k as hasAnyUserTokenEntry, l as INVOKER_EXPR, nt as initOperatorClient, o as WorkflowJobSchema, rt as isDefaultPlatform, s as ResolverSchema, t as defineApplication, tt as initOAuth2Client, v as createLogLevelTreeshakeOptions, w as hashContent$1, y as resolveBundleLogLevel, z as readPlatformConfig } from "../application-BsH6tkZC.mjs";
5
+ import { $t as compareSnapshotWithRemote, A as listCommand$12, An as apiCommand, Bn as pagedLogArgs, C as listCommand$13, Cn as hasChanges, Dn as PluginManager, Dt as listCommand$6, E as waitCommand, En as sdkNameLabelKey, F as generateCommand$1, Fn as configArg, G as removeCommand$1, Gt as deploy, H as extractOwnedNamespaces, Hn as toPageDirection, Ht as formatKeyValueTable, I as generateMigrationScript, In as confirmationArgs, It as getCommand$6, K as updateCommand$3, Kt as ensureConfigId, L as writeDbTypesFile, Ln as deploymentArgs, Mn as assertWritable, N as truncateCommand, Nn as defineAppCommand, O as resumeCommand, On as generateUserTypes, Pn as commonArgs, Pt as startCommand, Q as getCommand$5, Qt as parseMigrationLabelNumber, R as getConfiguredEditorCommand, Rn as isVerbose, Rt as executionsCommand, Sn as formatMigrationDiff, T as healthCommand, Tn as resourceTrn, Tt as triggerCommand, U as logBetaWarning, Un as workspaceArgs, Ut as getCommand$1, V as showCommand, Vn as paginationArgs, Vt as functionExecutionStatusToString, X as listCommand$11, Xt as MIGRATION_LABEL_KEY, Y as treeCommand, Zt as handleOptionalToRequiredError, _n as loadDiff, b as createCommand$4, bn as parseMigrationNumberArg, c as listCommand$14, cn as compareLocalTypesWithSnapshot, ct as createCommand$3, dn as getLatestMigrationNumber, en as generateAllTypeManifestsFromSnapshot, et as updateCommand$2, f as restoreCommand, ft as getCommand$3, g as getCommand$7, gn as isValidMigrationNumber, gt as listCommand$8, ht as tokenCommand, i as updateCommand$4, in as INITIAL_SCHEMA_NUMBER, it as getCommand$4, jt as jobsCommand, kn as prompt, m as listCommand$15, mn as getMigrationFiles, nt as listCommand$10, o as removeCommand, ot as deleteCommand$4, pn as getMigrationFilePath, qt as executeScript, r as queryCommand, sn as assertValidMigrationFiles, t as isNativeTypeScriptRuntime, tn as protoGqlPermission, u as inviteCommand, un as createSnapshotFromLocalTypes, ut as listCommand$9, v as deleteCommand$5, vn as reconstructSnapshotFromMigrations, vt as generate, wn as getNamespacesWithMigrations, wt as webhookCommand, xt as getCommand$2, yn as formatMigrationNumber, yt as listCommand$7, z as openInConfiguredEditor, zn as multiConfigArg } from "../runtime-CJ5usBOu.mjs";
6
+ import { A as hasAnyUserTokenEntry, B as readPlatformConfig, D as loadConfig, F as loadMachineUserName, G as defaultPlatformBaseUrl, H as saveUserTokens, K as fetchAll, L as loadStoredUserTokens, M as loadAccessToken, O as deleteUserTokens, P as loadConsoleBaseUrl, R as loadWorkspaceId, T as hashContent$1, U as writePlatformConfig, V as resolveUserTokenKey, W as closeConnectionPool, X as fetchPlatformMachineUserToken, Y as fetchPaged, Z as fetchUserInfo, _ as platformBundleDefinePlugin, a as resolveInlineSourcemap, b as resolveBundleLogLevel, c as ResolverSchema, et as getOrNull, it as isDefaultPlatform, j as hasUserTokenEntry, k as fetchLatestToken, nt as initOAuth2Client, q as fetchAllTolerant, rt as initOperatorClient, s as WorkflowJobSchema, t as defineApplication, u as INVOKER_EXPR, v as composeFunctionTreeshakeOptions, w as getDistDir, y as createLogLevelTreeshakeOptions, z as platformConfigFromProfile } from "../application-DYshsH-K.mjs";
7
7
  import { n as ExecutorSchema } from "../service-BCRJ-3NV.mjs";
8
8
  import { t as multiline } from "../multiline-sfHpTZZK.mjs";
9
9
  import { r as isPluginGeneratedType } from "../seed-fm0LeYP2.mjs";
@@ -6070,7 +6070,7 @@ async function fetchRemoteTypes(client, workspaceId, namespace) {
6070
6070
  async function assertMigrationsReproduceLocalTypes(loaded, target) {
6071
6071
  const { config, plugins } = loaded;
6072
6072
  const pluginManager = plugins.length > 0 ? new PluginManager(plugins) : void 0;
6073
- const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-CSUhZMb5.mjs");
6073
+ const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-BJKNlv8c.mjs");
6074
6074
  const application = defineApplication({
6075
6075
  config,
6076
6076
  pluginManager
package/dist/cli/lib.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
2
- import { $ as getOrganization, At as getExecutorWaitFailureMessage, B as show, Bt as listWorkflowExecutions, Cn as hasChanges, Ct as listWebhookExecutors, D as waitWorkflowExecution, Et as triggerExecutor, Ft as startWorkflow, Gt as deploy, J as organizationTree, Jt as waitForExecution, Lt as getWorkflow, M as truncate, Mt as listExecutorJobs, Nt as watchExecutorJob, On as generateUserTypes, Ot as listExecutors, P as generate$1, S as listApps, Sn as formatMigrationDiff, St as getFunctionRegistry, W as remove, Wt as getExecutor, Xt as MIGRATION_LABEL_KEY, Yt as bundleMigrationScript, Z as listOrganizations, _ as getWorkspace, _t as listMachineUsers, a as updateUser, an as MIGRATE_FILE_NAME, at as getFolder, bt as listFunctionRegistries, cn as compareLocalTypesWithSnapshot, d as inviteUser, dn as getLatestMigrationNumber, dt as listOAuth2Clients, fn as getMigrationDirPath, h as listWorkspaces, hn as getNextMigrationNumber, in as INITIAL_SCHEMA_NUMBER, j as listWorkflows, jn as apiCall, k as resumeWorkflow, kt as getExecutorJob, l as listUsers, ln as compareSnapshots, lt as createFolder, mn as getMigrationFiles, mt as getMachineUserToken, n as query, nn as DB_TYPES_FILE_NAME, on as SCHEMA_FILE_NAME, p as restoreWorkspace, pn as getMigrationFilePath, pt as getOAuth2Client, q as updateOrganization, qt as executeScript, rn as DIFF_FILE_NAME, rt as listFolders, s as removeUser, st as deleteFolder, t as isNativeTypeScriptRuntime, tt as updateFolder, un as createSnapshotFromLocalTypes, vn as reconstructSnapshotFromMigrations, vt as generate, w as getAppHealth, wn as getNamespacesWithMigrations, x as createWorkspace, xn as formatDiffSummary, y as deleteWorkspace, zt as getWorkflowExecution } from "../runtime-DV1EnfMs.mjs";
3
- import { C as getDistDir, E as loadConfig, L as loadWorkspaceId, g as platformBundleDefinePlugin, j as loadAccessToken, nt as initOperatorClient } from "../application-BsH6tkZC.mjs";
2
+ import { $ as getOrganization, At as getExecutorWaitFailureMessage, B as show, Bt as listWorkflowExecutions, Cn as hasChanges, Ct as listWebhookExecutors, D as waitWorkflowExecution, Et as triggerExecutor, Ft as startWorkflow, Gt as deploy, J as organizationTree, Jt as waitForExecution, Lt as getWorkflow, M as truncate, Mt as listExecutorJobs, Nt as watchExecutorJob, On as generateUserTypes, Ot as listExecutors, P as generate$1, S as listApps, Sn as formatMigrationDiff, St as getFunctionRegistry, W as remove, Wt as getExecutor, Xt as MIGRATION_LABEL_KEY, Yt as bundleMigrationScript, Z as listOrganizations, _ as getWorkspace, _t as listMachineUsers, a as updateUser, an as MIGRATE_FILE_NAME, at as getFolder, bt as listFunctionRegistries, cn as compareLocalTypesWithSnapshot, d as inviteUser, dn as getLatestMigrationNumber, dt as listOAuth2Clients, fn as getMigrationDirPath, h as listWorkspaces, hn as getNextMigrationNumber, in as INITIAL_SCHEMA_NUMBER, j as listWorkflows, jn as apiCall, k as resumeWorkflow, kt as getExecutorJob, l as listUsers, ln as compareSnapshots, lt as createFolder, mn as getMigrationFiles, mt as getMachineUserToken, n as query, nn as DB_TYPES_FILE_NAME, on as SCHEMA_FILE_NAME, p as restoreWorkspace, pn as getMigrationFilePath, pt as getOAuth2Client, q as updateOrganization, qt as executeScript, rn as DIFF_FILE_NAME, rt as listFolders, s as removeUser, st as deleteFolder, t as isNativeTypeScriptRuntime, tt as updateFolder, un as createSnapshotFromLocalTypes, vn as reconstructSnapshotFromMigrations, vt as generate, w as getAppHealth, wn as getNamespacesWithMigrations, x as createWorkspace, xn as formatDiffSummary, y as deleteWorkspace, zt as getWorkflowExecution } from "../runtime-CJ5usBOu.mjs";
3
+ import { D as loadConfig, M as loadAccessToken, R as loadWorkspaceId, _ as platformBundleDefinePlugin, rt as initOperatorClient, w as getDistDir } from "../application-DYshsH-K.mjs";
4
4
  import { n as enumConstantsPlugin } from "../enum-constants-j9QBF0cB.mjs";
5
5
  import { t as multiline } from "../multiline-sfHpTZZK.mjs";
6
6
  import { n as fileUtilsPlugin } from "../file-utils-DcyIPFQh.mjs";
@@ -1,5 +1,5 @@
1
1
  # politty-completion-version: 1
2
- # politty-bin-sig: 1783427674
2
+ # politty-bin-sig: 1783561224
3
3
  # politty-bin-path: /home/runner/work/sdk/sdk/node_modules/.bin/tailor-sdk
4
4
  # program: tailor-sdk
5
5
  # shell: zsh
@@ -45,7 +45,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
45
45
  $'CreateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
46
46
  $'CreateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
47
47
  $'CreateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
48
- $'CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
48
+ $'CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions\nexecutionPolicyName=:Set executionPolicyName'
49
49
  $'CreateWorkspace' $'workspaceName=:Set workspaceName\nworkspaceRegion=:Set workspaceRegion\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false'
50
50
  $'DeleteAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
51
51
  $'DeleteApplication' $'workspaceId=:Set workspaceId\napplicationName=:Set applicationName'
@@ -82,7 +82,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
82
82
  $'DeleteUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName'
83
83
  $'DeleteWorkflow' $'workspaceId=:Set workspaceId\nworkflowId=:Set workflowId'
84
84
  $'DeleteWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
85
- $'DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nid=:Set id'
85
+ $'DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
86
86
  $'DeleteWorkspace' $'workspaceId=:Set workspaceId'
87
87
  $'ExchangeAuthConnectionAuthorizationCode' $'workspaceId=:Set workspaceId\nconnectionName=:Set connectionName\nauthorizationCode=:Set authorizationCode\nredirectUri=:Set redirectUri'
88
88
  $'GetAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
@@ -134,7 +134,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
134
134
  $'GetWorkflowExecution' $'workspaceId=:Set workspaceId\nexecutionId=:Set executionId'
135
135
  $'GetWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionId=:Set jobFunctionId'
136
136
  $'GetWorkflowJobFunctionByName' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
137
- $'GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nid=:Set id'
137
+ $'GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
138
138
  $'GetWorkflowJobFunctionExecutionPolicyByKey' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey'
139
139
  $'GetWorkspace' $'workspaceId=:Set workspaceId'
140
140
  $'GetWorkspacePlatformUser' $'workspaceId=:Set workspaceId'
@@ -241,7 +241,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
241
241
  $'UpdateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
242
242
  $'UpdateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
243
243
  $'UpdateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
244
- $'UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
244
+ $'UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
245
245
  $'UpdateWorkspace' $'workspaceId=:Set workspaceId\nworkspaceName=:Set workspaceName\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false\nupdateMask=:Set updateMask'
246
246
  $'UpdateWorkspacePlatformUser' $'workspaceId=:Set workspaceId\nemail=:Set email\nrole=:Set role\nrole=WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED:WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED\nrole=WORKSPACE_PLATFORM_USER_ROLE_ADMIN:WORKSPACE_PLATFORM_USER_ROLE_ADMIN\nrole=WORKSPACE_PLATFORM_USER_ROLE_EDITOR:WORKSPACE_PLATFORM_USER_ROLE_EDITOR\nrole=WORKSPACE_PLATFORM_USER_ROLE_VIEWER:WORKSPACE_PLATFORM_USER_ROLE_VIEWER'
247
247
  $'UpsertOrganizationFolderIPRestriction' $'organizationId=:Set organizationId\nfolderId=:Set folderId'
@@ -283,7 +283,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
283
283
  $'tailor.v1.OperatorService/CreateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
284
284
  $'tailor.v1.OperatorService/CreateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
285
285
  $'tailor.v1.OperatorService/CreateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
286
- $'tailor.v1.OperatorService/CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
286
+ $'tailor.v1.OperatorService/CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions\nexecutionPolicyName=:Set executionPolicyName'
287
287
  $'tailor.v1.OperatorService/CreateWorkspace' $'workspaceName=:Set workspaceName\nworkspaceRegion=:Set workspaceRegion\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false'
288
288
  $'tailor.v1.OperatorService/DeleteAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
289
289
  $'tailor.v1.OperatorService/DeleteApplication' $'workspaceId=:Set workspaceId\napplicationName=:Set applicationName'
@@ -320,7 +320,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
320
320
  $'tailor.v1.OperatorService/DeleteUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName'
321
321
  $'tailor.v1.OperatorService/DeleteWorkflow' $'workspaceId=:Set workspaceId\nworkflowId=:Set workflowId'
322
322
  $'tailor.v1.OperatorService/DeleteWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
323
- $'tailor.v1.OperatorService/DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nid=:Set id'
323
+ $'tailor.v1.OperatorService/DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
324
324
  $'tailor.v1.OperatorService/DeleteWorkspace' $'workspaceId=:Set workspaceId'
325
325
  $'tailor.v1.OperatorService/ExchangeAuthConnectionAuthorizationCode' $'workspaceId=:Set workspaceId\nconnectionName=:Set connectionName\nauthorizationCode=:Set authorizationCode\nredirectUri=:Set redirectUri'
326
326
  $'tailor.v1.OperatorService/GetAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
@@ -372,7 +372,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
372
372
  $'tailor.v1.OperatorService/GetWorkflowExecution' $'workspaceId=:Set workspaceId\nexecutionId=:Set executionId'
373
373
  $'tailor.v1.OperatorService/GetWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionId=:Set jobFunctionId'
374
374
  $'tailor.v1.OperatorService/GetWorkflowJobFunctionByName' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
375
- $'tailor.v1.OperatorService/GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nid=:Set id'
375
+ $'tailor.v1.OperatorService/GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
376
376
  $'tailor.v1.OperatorService/GetWorkflowJobFunctionExecutionPolicyByKey' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey'
377
377
  $'tailor.v1.OperatorService/GetWorkspace' $'workspaceId=:Set workspaceId'
378
378
  $'tailor.v1.OperatorService/GetWorkspacePlatformUser' $'workspaceId=:Set workspaceId'
@@ -479,7 +479,7 @@ typeset -gA __tailor_sdk_worker_expand_api__field=(
479
479
  $'tailor.v1.OperatorService/UpdateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
480
480
  $'tailor.v1.OperatorService/UpdateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
481
481
  $'tailor.v1.OperatorService/UpdateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
482
- $'tailor.v1.OperatorService/UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
482
+ $'tailor.v1.OperatorService/UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
483
483
  $'tailor.v1.OperatorService/UpdateWorkspace' $'workspaceId=:Set workspaceId\nworkspaceName=:Set workspaceName\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false\nupdateMask=:Set updateMask'
484
484
  $'tailor.v1.OperatorService/UpdateWorkspacePlatformUser' $'workspaceId=:Set workspaceId\nemail=:Set email\nrole=:Set role\nrole=WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED:WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED\nrole=WORKSPACE_PLATFORM_USER_ROLE_ADMIN:WORKSPACE_PLATFORM_USER_ROLE_ADMIN\nrole=WORKSPACE_PLATFORM_USER_ROLE_EDITOR:WORKSPACE_PLATFORM_USER_ROLE_EDITOR\nrole=WORKSPACE_PLATFORM_USER_ROLE_VIEWER:WORKSPACE_PLATFORM_USER_ROLE_VIEWER'
485
485
  $'tailor.v1.OperatorService/UpsertOrganizationFolderIPRestriction' $'organizationId=:Set organizationId\nfolderId=:Set folderId'
@@ -4,6 +4,7 @@ import { AIGatewayConfig } from "../services/aigateway/types.mjs";
4
4
  import { IdPConfig } from "../services/idp/types.mjs";
5
5
  import { SecretsConfig } from "../services/secrets/types.mjs";
6
6
  import { StaticWebsiteConfig } from "../services/staticwebsite/types.mjs";
7
+ import { ExecutionPolicyInstance } from "../services/workflow/execution-policy.types.mjs";
7
8
  import { LogLevelEnum } from "../../types/app-config.generated.mjs";
8
9
 
9
10
  //#region src/configure/config/types.d.ts
@@ -32,7 +33,8 @@ type WorkflowServiceConfig = {
32
33
  files: string[];
33
34
  job_files?: string[];
34
35
  ignores?: string[];
35
- job_ignores?: string[];
36
+ job_ignores?: string[]; /** Workspace-level execution policies for workflow job functions. */
37
+ executionPolicies?: Record<string, ExecutionPolicyInstance>;
36
38
  };
37
39
  type WorkflowServiceInput = WorkflowServiceConfig;
38
40
  /**
@@ -16,6 +16,7 @@ import { IdPEmailConfig, IdPGqlOperations, IdPGqlOperationsInput } from "../type
16
16
  import { IdPConfig, IdPExternalConfig } from "./services/idp/types.mjs";
17
17
  import { SecretsConfig } from "./services/secrets/types.mjs";
18
18
  import { StaticWebsiteConfig } from "./services/staticwebsite/types.mjs";
19
+ import { ExecutionPolicyConcurrency, ExecutionPolicyDefInput, ExecutionPolicyExactInstance, ExecutionPolicyGroupOptions, ExecutionPolicyInstance, ExecutionPolicyWildcardInstance, ResolvedExecutionPolicyInstance } from "./services/workflow/execution-policy.types.mjs";
19
20
  import { ExecutorServiceConfig, ExecutorServiceInput, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, WorkflowServiceConfig, WorkflowServiceInput } from "./config/types.mjs";
20
21
  import { ConcurrencyPolicy, RetryPolicy } from "../types/workflow.generated.mjs";
21
22
  import { TailorAnyField, TailorField } from "./types/type.mjs";
@@ -36,6 +37,7 @@ import { ScheduleArgs, ScheduleTrigger, scheduleTrigger } from "./services/execu
36
37
  import { IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, incomingWebhookTrigger } from "./services/executor/trigger/webhook.mjs";
37
38
  import { Trigger } from "./services/executor/trigger/index.mjs";
38
39
  import { createExecutor } from "./services/executor/executor.mjs";
40
+ import { defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy } from "./services/workflow/execution-policy.mjs";
39
41
  import { WaitPointInstance, defineWaitPoint, defineWaitPoints } from "./services/workflow/wait-point.mjs";
40
42
  import { defineStaticWebSite } from "./services/staticwebsite/index.mjs";
41
43
  import { defineAIGateway } from "./services/aigateway/index.mjs";
@@ -123,4 +125,4 @@ declare namespace t {
123
125
  type infer<T> = TailorOutput<T>;
124
126
  }
125
127
  //#endregion
126
- export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type AttributeMap, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, AuthInvoker, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type ConnectionName, type ConnectionNameRegistry, type DefinedAuth, type Env, type ExecutorReadyContext, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, type GeneratorResult, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, type IdpName, type IdpNameRegistry, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedType, type PluginNamespaceProcessContext, type PluginOutput, type PluginProcessContext, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverNamespaceData, type ResolverReadyContext, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, TailorDBTrigger, type TailorDBType, type TailorDBTypeForPlugin, type TailorField, type TailorInvoker, type TailorTypeGqlPermission, type TailorTypePermission, type TailorUser, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WORKFLOW_TEST_ENV_KEY, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineGenerators, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWaitPoint, defineWaitPoints, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
128
+ export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type AttributeMap, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, AuthInvoker, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type ConnectionName, type ConnectionNameRegistry, type DefinedAuth, type Env, type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ExecutorReadyContext, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, type GeneratorResult, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, type IdpName, type IdpNameRegistry, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedType, type PluginNamespaceProcessContext, type PluginOutput, type PluginProcessContext, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type ResolvedExecutionPolicyInstance, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverNamespaceData, type ResolverReadyContext, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, TailorDBTrigger, type TailorDBType, type TailorDBTypeForPlugin, type TailorField, type TailorInvoker, type TailorTypeGqlPermission, type TailorTypePermission, type TailorUser, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WORKFLOW_TEST_ENV_KEY, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineGenerators, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWaitPoint, defineWaitPoints, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
@@ -1,8 +1,8 @@
1
1
  import { t as t$1 } from "../types-BwzB2okW.mjs";
2
2
  import { t as brandValue } from "../brand-Eo4pLXPJ.mjs";
3
3
  import { t as db } from "../schema-Dl_y0m9e.mjs";
4
- import { r as dispatchTriggerWorkflow, s as registerWorkflow, u as WORKFLOW_TEST_ENV_KEY } from "../registry-BozuxbPp.mjs";
5
- import { t as createWorkflowJob } from "../job-CtU73PGa.mjs";
4
+ import { r as dispatchTriggerWorkflow, s as registerWorkflow, u as WORKFLOW_TEST_ENV_KEY } from "../registry-NfSW0BRo.mjs";
5
+ import { t as createWorkflowJob } from "../job-D-PbD1P3.mjs";
6
6
 
7
7
  //#region src/configure/user.ts
8
8
  /** Represents an unauthenticated user in the Tailor platform. */
@@ -369,6 +369,114 @@ function incomingWebhookTrigger(options) {
369
369
  };
370
370
  }
371
371
 
372
+ //#endregion
373
+ //#region src/configure/services/workflow/execution-policy.ts
374
+ const EXECUTION_POLICY_EXACT_KEY_REGEX = /^[a-z0-9][a-z0-9_:.-]{0,62}[a-z0-9]$/;
375
+ function createExecutionPolicyInstance(initialName, initialKey, concurrencyPolicy, matchType, separator, allowNameSetter, allowKeySetter) {
376
+ const isPrefix = matchType === "prefix";
377
+ const raw = {
378
+ name: initialName,
379
+ key: initialKey,
380
+ matchType,
381
+ ...concurrencyPolicy && { concurrencyPolicy },
382
+ ...isPrefix && { keyFor: (suffix) => {
383
+ const key = `${raw.key}${separator}${suffix}`;
384
+ if (!EXECUTION_POLICY_EXACT_KEY_REGEX.test(key)) throw new Error(`Invalid execution policy key "${key}" built by keyFor("${suffix}"): must match [a-z0-9_:.-] (2-64 chars; must start and end with [a-z0-9]).`);
385
+ return key;
386
+ } }
387
+ };
388
+ return {
389
+ instance: brandValue(raw, "execution-policy"),
390
+ setName: allowNameSetter ? (n) => {
391
+ raw.name = n;
392
+ } : void 0,
393
+ setKey: allowKeySetter ? (k) => {
394
+ raw.key = k;
395
+ } : void 0
396
+ };
397
+ }
398
+ /**
399
+ * Define a single workflow job function execution policy.
400
+ *
401
+ * Use this when declaring a policy outside the
402
+ * {@link defineWorkflowExecutionPolicies} builder — for example, when the
403
+ * runtime key prefix needs to differ from the corresponding workspace-unique
404
+ * name.
405
+ *
406
+ * When `matchType: "prefix"` is set, the returned instance has `keyFor(suffix)`
407
+ * instead of a directly-usable `key` (see {@link ExecutionPolicyWildcardInstance}).
408
+ * @param name - Workspace-unique name. Must match `^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$`.
409
+ * @param def - Optional overrides for `key` (defaults to `name`), `matchType`, `separator` (the `keyFor` join character, defaults to `.`), and concurrency
410
+ * @returns An execution policy instance
411
+ * @example
412
+ * export const perTenant = defineWorkflowExecutionPolicy("tenant-api", {
413
+ * matchType: "prefix",
414
+ * concurrencyPolicy: { maxConcurrentExecutions: 3 },
415
+ * });
416
+ *
417
+ * perTenant.keyFor(tenantId); // "tenant-api.<tenantId>"
418
+ */
419
+ /* @__NO_SIDE_EFFECTS__ */
420
+ function defineWorkflowExecutionPolicy(name, def) {
421
+ return createExecutionPolicyInstance(name, def?.key ?? name, def?.concurrencyPolicy, def?.matchType ?? "exact", def?.separator ?? ".", false, false).instance;
422
+ }
423
+ /**
424
+ * Define a group of workflow job function execution policies. Property names
425
+ * become the workspace-unique `name` and default `key` verbatim, matching the
426
+ * mental model of {@link defineWaitPoints}. Provide `name` / `key` explicitly
427
+ * to override the property-name default (for example, when the property name
428
+ * is not valid for the execution policy grammar or when the runtime key
429
+ * prefix needs to differ).
430
+ *
431
+ * When `matchType: "prefix"` is set, the returned instance has `keyFor(suffix)`
432
+ * instead of a directly-usable `key` (see {@link ExecutionPolicyWildcardInstance}).
433
+ * `matchType` can be combined with an explicit `key`, or left to apply to
434
+ * the property-name-derived prefix.
435
+ *
436
+ * The return type mirrors the builder's return type so JSDoc on each property
437
+ * is preserved in IDE autocompletion.
438
+ * @param builder - Callback that receives a `define` factory and returns a record of policies
439
+ * @param options - Group-wide options; `separator` overrides the `.` `keyFor` uses to join the prefix and suffix for every prefix policy in the group
440
+ * @returns The same object returned by the builder (with `name` / `key` resolved on each instance)
441
+ * @example
442
+ * export const executionPolicies = defineWorkflowExecutionPolicies((define) => ({
443
+ * premium: define({ concurrencyPolicy: { maxConcurrentExecutions: 5 } }),
444
+ * "tenant-api": define({
445
+ * matchType: "prefix",
446
+ * concurrencyPolicy: { maxConcurrentExecutions: 3 },
447
+ * }),
448
+ * }));
449
+ *
450
+ * // In a workflow job function:
451
+ * await tailor.workflow.triggerJobFunction("worker", args, {
452
+ * executionPolicyKey: executionPolicies.premium.key,
453
+ * });
454
+ * await tailor.workflow.triggerJobFunction("worker", args, {
455
+ * executionPolicyKey: executionPolicies["tenant-api"].keyFor(input.tenantId),
456
+ * });
457
+ */
458
+ /* @__NO_SIDE_EFFECTS__ */
459
+ function defineWorkflowExecutionPolicies(builder, options) {
460
+ const separator = options?.separator ?? ".";
461
+ const nameSetters = /* @__PURE__ */ new Map();
462
+ const keySetters = /* @__PURE__ */ new Map();
463
+ const define = (def) => {
464
+ const explicitName = def?.name;
465
+ const explicitKey = def?.key;
466
+ const { instance, setName, setKey } = createExecutionPolicyInstance(explicitName ?? "__pending__", explicitKey ?? explicitName ?? "__pending__", def?.concurrencyPolicy, def?.matchType ?? "exact", separator, explicitName === void 0, explicitKey === void 0 && explicitName === void 0);
467
+ if (setName) nameSetters.set(instance, setName);
468
+ if (setKey) keySetters.set(instance, setKey);
469
+ return instance;
470
+ };
471
+ const result = builder(define);
472
+ for (const propName of Object.keys(result)) {
473
+ const instance = result[propName];
474
+ nameSetters.get(instance)?.(propName);
475
+ keySetters.get(instance)?.(propName);
476
+ }
477
+ return result;
478
+ }
479
+
372
480
  //#endregion
373
481
  //#region src/configure/services/workflow/wait-point.ts
374
482
  function getPlatformWorkflow() {
@@ -697,5 +805,5 @@ function definePlugins(...configs) {
697
805
  const t = t$1;
698
806
 
699
807
  //#endregion
700
- export { WORKFLOW_TEST_ENV_KEY, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineGenerators, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWaitPoint, defineWaitPoints, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
808
+ export { WORKFLOW_TEST_ENV_KEY, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineGenerators, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWaitPoint, defineWaitPoints, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
701
809
  //# sourceMappingURL=index.mjs.map