@tailor-platform/sdk 1.74.1 → 1.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/{application-BsH6tkZC.mjs → application-BUfYmf0O.mjs} +291 -15
- package/dist/application-BUfYmf0O.mjs.map +1 -0
- package/dist/application-DbvD5UUz.mjs +3 -0
- package/dist/brand-Eo4pLXPJ.mjs.map +1 -1
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -0
- package/dist/cli/index.mjs +218 -66
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.mjs +2 -2
- package/dist/cli/query/index.d.mts +4 -0
- package/dist/completion/zsh-worker.zsh +10 -10
- package/dist/configure/config/types.d.mts +3 -1
- package/dist/configure/index.d.mts +3 -1
- package/dist/configure/index.mjs +112 -4
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/index.d.mts +3 -1
- package/dist/configure/services/tailordb/schema.d.mts +28 -15
- package/dist/configure/services/workflow/execution-policy.d.mts +71 -0
- package/dist/configure/services/workflow/execution-policy.types.d.mts +104 -0
- package/dist/configure/services/workflow/index.d.mts +3 -1
- package/dist/configure/services/workflow/job.d.mts +7 -3
- package/dist/{globals-B8XX5TRB.mjs → globals-CcU1ONiK.mjs} +2 -2
- package/dist/globals-CcU1ONiK.mjs.map +1 -0
- package/dist/{job-CtU73PGa.mjs → job-D-PbD1P3.mjs} +5 -3
- package/dist/job-D-PbD1P3.mjs.map +1 -0
- package/dist/{registry-BozuxbPp.mjs → registry-NfSW0BRo.mjs} +4 -3
- package/dist/registry-NfSW0BRo.mjs.map +1 -0
- package/dist/resource_pb-BRv7AMXK.mjs +49 -0
- package/dist/resource_pb-BRv7AMXK.mjs.map +1 -0
- package/dist/runtime/globals.d.mts +1 -1
- package/dist/runtime/index.d.mts +1 -1
- package/dist/runtime/workflow.d.mts +22 -3
- package/dist/{runtime-DV1EnfMs.mjs → runtime-_vUgjiqT.mjs} +253 -254
- package/dist/runtime-_vUgjiqT.mjs.map +1 -0
- package/dist/{schema-Dl_y0m9e.mjs → schema-DrVyN-LP.mjs} +60 -36
- package/dist/schema-DrVyN-LP.mjs.map +1 -0
- package/dist/{service_pb-DjwIn4jO.mjs → service_pb-B2FF59sP.mjs} +1 -1
- package/dist/{service_pb-CIrhGwHk.mjs → service_pb-B5w9rjPY.mjs} +17 -50
- package/dist/service_pb-B5w9rjPY.mjs.map +1 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +29 -9
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +35 -1
- package/dist/utils/test/index.mjs +1 -1
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.mjs +15 -12
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/workflow.d.mts +5 -3
- package/dist/vitest/setup.mjs +1 -1
- package/dist/workflow-DSwnYPPP.mjs.map +1 -1
- package/docs/cli/auth.md +3 -3
- package/docs/cli/setup.md +8 -8
- package/docs/configuration.md +24 -0
- package/docs/services/tailordb.md +20 -0
- package/docs/services/workflow.md +78 -0
- package/package.json +1 -1
- package/dist/application-BsH6tkZC.mjs.map +0 -1
- package/dist/application-CSUhZMb5.mjs +0 -3
- package/dist/globals-B8XX5TRB.mjs.map +0 -1
- package/dist/job-CtU73PGa.mjs.map +0 -1
- package/dist/registry-BozuxbPp.mjs.map +0 -1
- package/dist/runtime-DV1EnfMs.mjs.map +0 -1
- package/dist/schema-Dl_y0m9e.mjs.map +0 -1
- package/dist/service_pb-CIrhGwHk.mjs.map +0 -1
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { D as loadConfig, M as loadAccessToken, R as loadWorkspaceId, _ as platformBundleDefinePlugin, rt as initOperatorClient, w as getDistDir } from "../application-BUfYmf0O.mjs";
|
|
3
|
+
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-_vUgjiqT.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";
|
|
@@ -10,6 +10,10 @@ declare const queryOptionsSchema: z.ZodObject<{
|
|
|
10
10
|
gql: "gql";
|
|
11
11
|
}>;
|
|
12
12
|
machineUser: z.ZodOptional<z.ZodString>;
|
|
13
|
+
machineUserSource: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
env: "env";
|
|
15
|
+
option: "option";
|
|
16
|
+
}>>;
|
|
13
17
|
query: z.ZodString;
|
|
14
18
|
}, z.core.$strip>;
|
|
15
19
|
type QueryOptions = z.input<typeof queryOptionsSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# politty-completion-version: 1
|
|
2
|
-
# politty-bin-sig:
|
|
2
|
+
# politty-bin-sig: 1783647457
|
|
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\
|
|
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\
|
|
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\
|
|
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\
|
|
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\
|
|
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\
|
|
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'
|
|
@@ -2623,7 +2623,7 @@ __tailor_sdk_worker_complete_setup_coordinate() {
|
|
|
2623
2623
|
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
2624
2624
|
local -a _opts=()
|
|
2625
2625
|
__tailor_sdk_worker_not_used "--name" "-n" "--n" && _opts+=("--name:Coordinator name (used in the generated workflow file name and job names)")
|
|
2626
|
-
_opts+=("--action:Composite action to include
|
|
2626
|
+
_opts+=("--action:Composite action to include. Repeat for separate deploy steps, or use commas to deploy actions as one multi-config group. tailor- prefix optional.")
|
|
2627
2627
|
__tailor_sdk_worker_not_used "--branch" && _opts+=("--branch:Branch target\: deploy trigger branch (defaults to the detected default branch)")
|
|
2628
2628
|
__tailor_sdk_worker_not_used "--tag" && _opts+=("--tag:Generate a tag target coordinator")
|
|
2629
2629
|
__tailor_sdk_worker_not_used "--environment" && _opts+=("--environment:GitHub Environment for the plan/deploy jobs")
|
|
@@ -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 };
|
package/dist/configure/index.mjs
CHANGED
|
@@ -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
|
-
import { t as db } from "../schema-
|
|
4
|
-
import { r as dispatchTriggerWorkflow, s as registerWorkflow, u as WORKFLOW_TEST_ENV_KEY } from "../registry-
|
|
5
|
-
import { t as createWorkflowJob } from "../job-
|
|
3
|
+
import { t as db } from "../schema-DrVyN-LP.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
|