@tailor-platform/sdk 1.83.0 → 1.85.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 +58 -0
- package/dist/application-C-zsrNjn.mjs +3 -0
- package/dist/{application-Cp0FxIm2.mjs → application-m5tYtz0-.mjs} +246 -68
- package/dist/application-m5tYtz0-.mjs.map +1 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +2 -0
- package/dist/cli/commands/generate/seed/bundler.d.mts +2 -1
- package/dist/cli/commands/generate/service.d.mts +1 -1
- package/dist/cli/commands/generate/types.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -1
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +5 -0
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -1
- package/dist/cli/index.mjs +291 -29
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +1 -1
- package/dist/cli/lib.mjs +92 -36
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/shared/client.d.mts +28 -3
- package/dist/cli/skills.d.mts +1 -1
- package/dist/completion/zsh-worker.zsh +85 -22
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +170 -2
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/executor/index.d.mts +2 -2
- package/dist/configure/services/executor/trigger/event.d.mts +245 -2
- package/dist/configure/services/executor/trigger/index.d.mts +3 -3
- package/dist/configure/services/index.d.mts +2 -2
- package/dist/configure/services/tailordb/index.d.mts +0 -1
- package/dist/configure/services/workflow/job.d.mts +9 -0
- package/dist/configure/services/workflow/workflow.d.mts +10 -0
- package/dist/node-builtins-CmaL2Cbq.mjs +36 -0
- package/dist/node-builtins-CmaL2Cbq.mjs.map +1 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/{register-typescript-runtime-CCHyKeXO.mjs → register-typescript-runtime-nG-n9lPw.mjs} +752 -403
- package/dist/register-typescript-runtime-nG-n9lPw.mjs.map +1 -0
- package/dist/{seed-DFFigL8V.mjs → seed-6eTFj-3Q.mjs} +158 -41
- package/dist/seed-6eTFj-3Q.mjs.map +1 -0
- package/dist/{service-B0MaodSg.mjs → service-CPJWhTLn.mjs} +29 -2
- package/dist/service-CPJWhTLn.mjs.map +1 -0
- package/dist/service-Cigg_U-v.mjs +3 -0
- package/dist/{service_pb-BwZRiNug.mjs → service_pb-D5--My_M.mjs} +5 -5
- package/dist/service_pb-D5--My_M.mjs.map +1 -0
- package/dist/{service_pb-wRkxUta6.mjs → service_pb-i8CmnQP4.mjs} +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +106 -1
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +24 -1
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +49 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +89 -6
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +26 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +101 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +22 -1
- package/dist/types/executor.generated.d.mts +23 -3
- package/dist/vitest/index.mjs +3 -35
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/{workspace_resource_pb-UGK1SSn_.mjs → workspace_resource_pb-DXnO2AT-.mjs} +7 -7
- package/dist/workspace_resource_pb-DXnO2AT-.mjs.map +1 -0
- package/docs/cli/tailordb.md +36 -12
- package/docs/cli-reference.md +16 -15
- package/docs/generator/builtin.md +7 -0
- package/docs/services/executor.md +83 -3
- package/docs/services/idp.md +3 -3
- package/docs/services/tailordb-migration.md +24 -4
- package/docs/services/workflow.md +26 -0
- package/package.json +17 -18
- package/dist/application-CP7JKG9R.mjs +0 -3
- package/dist/application-Cp0FxIm2.mjs.map +0 -1
- package/dist/register-typescript-runtime-CCHyKeXO.mjs.map +0 -1
- package/dist/seed-DFFigL8V.mjs.map +0 -1
- package/dist/service-B0MaodSg.mjs.map +0 -1
- package/dist/service-KnAiVofD.mjs +0 -3
- package/dist/service_pb-BwZRiNug.mjs.map +0 -1
- package/dist/workspace_resource_pb-UGK1SSn_.mjs.map +0 -1
|
@@ -35,7 +35,7 @@ import { WORKFLOW_TEST_ENV_KEY } from "./services/workflow/test-env-key.mjs";
|
|
|
35
35
|
import { WorkflowJob, WorkflowJobContext, createWorkflowJob } from "./services/workflow/job.mjs";
|
|
36
36
|
import { Workflow, WorkflowConfig, createWorkflow } from "./services/workflow/workflow.mjs";
|
|
37
37
|
import { FunctionOperation, GqlOperation, Operation, WebhookOperation, WorkflowOperation } from "./services/executor/operation.mjs";
|
|
38
|
-
import { AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, ResolverExecutedArgs, ResolverExecutedTrigger, TailorDBTrigger, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger } from "./services/executor/trigger/event.mjs";
|
|
38
|
+
import { AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, ResolverExecutedArgs, ResolverExecutedTrigger, TailorDBTrigger, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger } from "./services/executor/trigger/event.mjs";
|
|
39
39
|
import { ScheduleArgs, ScheduleTrigger, scheduleTrigger } from "./services/executor/trigger/schedule.mjs";
|
|
40
40
|
import { IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, incomingWebhookTrigger } from "./services/executor/trigger/webhook.mjs";
|
|
41
41
|
import { Trigger } from "./services/executor/trigger/index.mjs";
|
|
@@ -127,4 +127,4 @@ declare namespace t {
|
|
|
127
127
|
type infer<T> = TailorOutput<T>;
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
|
-
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 ResolverPermission, type ResolverPermissionCondition, type ResolverPermissionPolicy, 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 };
|
|
130
|
+
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 ResolverPermission, type ResolverPermissionCondition, type ResolverPermissionPolicy, 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, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJob, WorkflowJobContext, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, 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, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
package/dist/configure/index.mjs
CHANGED
|
@@ -535,6 +535,173 @@ function authAccessTokenTrigger(options) {
|
|
|
535
535
|
__args: {}
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
|
+
const workflowExecutionEventMap = {
|
|
539
|
+
started: "workflow.workflow_execution.started",
|
|
540
|
+
completed: "workflow.workflow_execution.completed",
|
|
541
|
+
retried: "workflow.workflow_execution.retried",
|
|
542
|
+
resumed: "workflow.workflow_execution.resumed",
|
|
543
|
+
wait_started: "workflow.workflow_execution.wait_started",
|
|
544
|
+
wait_resolved: "workflow.workflow_execution.wait_resolved"
|
|
545
|
+
};
|
|
546
|
+
function workflowExecutionTriggerConfig(events, options) {
|
|
547
|
+
return {
|
|
548
|
+
kind: "workflowExecution",
|
|
549
|
+
events,
|
|
550
|
+
workflowName: options.workflow.name,
|
|
551
|
+
condition: options.condition,
|
|
552
|
+
__args: {}
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Create a trigger that fires when a workflow execution starts running.
|
|
557
|
+
* @param options - Trigger options
|
|
558
|
+
* @param options.workflow - Workflow to subscribe to
|
|
559
|
+
* @param options.condition - Condition function to filter events
|
|
560
|
+
* @returns Workflow execution started trigger
|
|
561
|
+
*/
|
|
562
|
+
function workflowExecutionStartedTrigger(options) {
|
|
563
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.started"], options);
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Create a trigger that fires when a workflow execution succeeds or fails.
|
|
567
|
+
* @param options - Trigger options
|
|
568
|
+
* @param options.workflow - Workflow to subscribe to
|
|
569
|
+
* @param options.condition - Condition function to filter events
|
|
570
|
+
* @returns Workflow execution completed trigger
|
|
571
|
+
*/
|
|
572
|
+
function workflowExecutionCompletedTrigger(options) {
|
|
573
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.completed"], options);
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Create a trigger that fires when a workflow execution is retried by its retry policy.
|
|
577
|
+
* @param options - Trigger options
|
|
578
|
+
* @param options.workflow - Workflow to subscribe to
|
|
579
|
+
* @param options.condition - Condition function to filter events
|
|
580
|
+
* @returns Workflow execution retried trigger
|
|
581
|
+
*/
|
|
582
|
+
function workflowExecutionRetriedTrigger(options) {
|
|
583
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.retried"], options);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Create a trigger that fires when a failed workflow execution is manually resumed.
|
|
587
|
+
* @param options - Trigger options
|
|
588
|
+
* @param options.workflow - Workflow to subscribe to
|
|
589
|
+
* @param options.condition - Condition function to filter events
|
|
590
|
+
* @returns Workflow execution resumed trigger
|
|
591
|
+
*/
|
|
592
|
+
function workflowExecutionResumedTrigger(options) {
|
|
593
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.resumed"], options);
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Create a trigger that fires when a workflow execution starts waiting on a wait point.
|
|
597
|
+
* @param options - Trigger options
|
|
598
|
+
* @param options.workflow - Workflow to subscribe to
|
|
599
|
+
* @param options.condition - Condition function to filter events
|
|
600
|
+
* @returns Workflow execution wait started trigger
|
|
601
|
+
*/
|
|
602
|
+
function workflowExecutionWaitStartedTrigger(options) {
|
|
603
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.wait_started"], options);
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Create a trigger that fires when a waiting workflow execution is released.
|
|
607
|
+
* @param options - Trigger options
|
|
608
|
+
* @param options.workflow - Workflow to subscribe to
|
|
609
|
+
* @param options.condition - Condition function to filter events
|
|
610
|
+
* @returns Workflow execution wait resolved trigger
|
|
611
|
+
*/
|
|
612
|
+
function workflowExecutionWaitResolvedTrigger(options) {
|
|
613
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.wait_resolved"], options);
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Create a trigger that fires on multiple workflow execution event types.
|
|
617
|
+
* @template K
|
|
618
|
+
* @param options - Trigger options with events array
|
|
619
|
+
* @param options.events - Workflow execution event kinds to subscribe to
|
|
620
|
+
* @param options.workflow - Workflow to subscribe to
|
|
621
|
+
* @param options.condition - Condition function to filter events
|
|
622
|
+
* @returns Workflow execution trigger
|
|
623
|
+
*/
|
|
624
|
+
function workflowExecutionTrigger(options) {
|
|
625
|
+
const { events, workflow, condition } = options;
|
|
626
|
+
return workflowExecutionTriggerConfig(events.map((k) => workflowExecutionEventMap[k]), {
|
|
627
|
+
workflow,
|
|
628
|
+
condition
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
const workflowJobExecutionEventMap = {
|
|
632
|
+
started: "workflow.workflow_execution.job_execution.started",
|
|
633
|
+
completed: "workflow.workflow_execution.job_execution.completed",
|
|
634
|
+
wait_started: "workflow.workflow_execution.job_execution.wait_started",
|
|
635
|
+
wait_resolved: "workflow.workflow_execution.job_execution.wait_resolved"
|
|
636
|
+
};
|
|
637
|
+
function workflowJobExecutionTriggerConfig(events, options) {
|
|
638
|
+
return {
|
|
639
|
+
kind: "workflowJobExecution",
|
|
640
|
+
events,
|
|
641
|
+
workflowName: options.workflow.name,
|
|
642
|
+
condition: options.condition,
|
|
643
|
+
__args: {}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Create a trigger that fires when a job inside a workflow starts running.
|
|
648
|
+
* @param options - Trigger options
|
|
649
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
650
|
+
* @param options.condition - Condition function to filter events
|
|
651
|
+
* @returns Workflow job execution started trigger
|
|
652
|
+
*/
|
|
653
|
+
function workflowJobExecutionStartedTrigger(options) {
|
|
654
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.started"], options);
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Create a trigger that fires when a job inside a workflow succeeds or fails.
|
|
658
|
+
*
|
|
659
|
+
* A job released from a wait point reports `wait_resolved` instead of
|
|
660
|
+
* `completed`; subscribe to both to observe every way a job can end.
|
|
661
|
+
* @param options - Trigger options
|
|
662
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
663
|
+
* @param options.condition - Condition function to filter events
|
|
664
|
+
* @returns Workflow job execution completed trigger
|
|
665
|
+
*/
|
|
666
|
+
function workflowJobExecutionCompletedTrigger(options) {
|
|
667
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.completed"], options);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Create a trigger that fires when a job inside a workflow starts waiting on a wait point.
|
|
671
|
+
* @param options - Trigger options
|
|
672
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
673
|
+
* @param options.condition - Condition function to filter events
|
|
674
|
+
* @returns Workflow job execution wait started trigger
|
|
675
|
+
*/
|
|
676
|
+
function workflowJobExecutionWaitStartedTrigger(options) {
|
|
677
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.wait_started"], options);
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Create a trigger that fires when a waiting job inside a workflow is released.
|
|
681
|
+
* @param options - Trigger options
|
|
682
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
683
|
+
* @param options.condition - Condition function to filter events
|
|
684
|
+
* @returns Workflow job execution wait resolved trigger
|
|
685
|
+
*/
|
|
686
|
+
function workflowJobExecutionWaitResolvedTrigger(options) {
|
|
687
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.wait_resolved"], options);
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Create a trigger that fires on multiple workflow job execution event types.
|
|
691
|
+
* @template K
|
|
692
|
+
* @param options - Trigger options with events array
|
|
693
|
+
* @param options.events - Workflow job execution event kinds to subscribe to
|
|
694
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
695
|
+
* @param options.condition - Condition function to filter events
|
|
696
|
+
* @returns Workflow job execution trigger
|
|
697
|
+
*/
|
|
698
|
+
function workflowJobExecutionTrigger(options) {
|
|
699
|
+
const { events, workflow, condition } = options;
|
|
700
|
+
return workflowJobExecutionTriggerConfig(events.map((k) => workflowJobExecutionEventMap[k]), {
|
|
701
|
+
workflow,
|
|
702
|
+
condition
|
|
703
|
+
});
|
|
704
|
+
}
|
|
538
705
|
|
|
539
706
|
//#endregion
|
|
540
707
|
//#region src/configure/services/executor/trigger/schedule.ts
|
|
@@ -725,7 +892,8 @@ function createWorkflowJob(config) {
|
|
|
725
892
|
return brandValue({
|
|
726
893
|
name: config.name,
|
|
727
894
|
trigger,
|
|
728
|
-
body
|
|
895
|
+
body,
|
|
896
|
+
...config.publishEvents !== void 0 ? { publishEvents: config.publishEvents } : {}
|
|
729
897
|
}, "workflow-job");
|
|
730
898
|
}
|
|
731
899
|
|
|
@@ -1059,5 +1227,5 @@ function definePlugins(...configs) {
|
|
|
1059
1227
|
const t = t$1;
|
|
1060
1228
|
|
|
1061
1229
|
//#endregion
|
|
1062
|
-
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 };
|
|
1230
|
+
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, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
1063
1231
|
//# sourceMappingURL=index.mjs.map
|