@tailor-platform/sdk 2.0.0-next.10 → 2.0.0-next.11
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 +165 -0
- package/dist/{application-miwiXtB4.mjs → application-CM6hKnSK.mjs} +312 -89
- package/dist/application-CM6hKnSK.mjs.map +1 -0
- package/dist/application-CXNaUNhv.mjs +3 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +1 -1
- package/dist/cli/commands/deploy/application.d.mts +1 -1
- package/dist/cli/commands/deploy/auth.d.mts +1 -1
- package/dist/cli/commands/deploy/deploy.d.mts +1 -0
- package/dist/cli/commands/deploy/executor.d.mts +1 -1
- package/dist/cli/commands/deploy/function-registry.d.mts +1 -2
- package/dist/cli/commands/deploy/idp.d.mts +1 -1
- package/dist/cli/commands/deploy/label.d.mts +2 -0
- package/dist/cli/commands/deploy/resolver.d.mts +1 -1
- package/dist/cli/commands/deploy/staticwebsite.d.mts +1 -1
- package/dist/cli/commands/deploy/tailordb/index.d.mts +2 -1
- package/dist/cli/commands/deploy/types.d.mts +2 -1
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -2
- package/dist/cli/commands/deploy/workflow.d.mts +1 -1
- package/dist/cli/commands/executor/get.d.mts +1 -10
- package/dist/cli/commands/executor/jobs.d.mts +1 -38
- package/dist/cli/commands/executor/trigger.d.mts +1 -11
- package/dist/cli/commands/generate/seed/bundler.d.mts +2 -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/commands/workflow/executions.d.mts +1 -13
- package/dist/cli/commands/workflow/get.d.mts +1 -10
- package/dist/cli/commands/workflow/start.d.mts +2 -14
- package/dist/cli/lib.d.mts +7 -11
- package/dist/cli/lib.mjs +99 -42
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +318 -124
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
- package/dist/cli/services/workflow/bundler.d.mts +2 -1
- package/dist/cli/shared/client.d.mts +28 -3
- package/dist/cli/shared/config-loader.d.mts +11 -4
- package/dist/cli/shared/tsconfig-paths-plugin.d.mts +2 -0
- package/dist/cli/shared/type-generator.d.mts +4 -3
- package/dist/completion/zsh-worker.zsh +82 -22
- package/dist/configure/config/types.d.mts +26 -3
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +171 -3
- 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/idp/index.d.mts +1 -1
- package/dist/configure/services/index.d.mts +2 -2
- package/dist/configure/services/tailordb/index.d.mts +0 -1
- package/dist/configure/services/workflow/execution-policy.d.mts +1 -1
- package/dist/configure/services/workflow/execution-policy.types.d.mts +1 -1
- package/dist/configure/services/workflow/job.d.mts +11 -2
- package/dist/configure/services/workflow/workflow.d.mts +10 -0
- package/dist/{globals-DQotNuwK.mjs → globals-TfAVItuK.mjs} +1 -2
- package/dist/globals-TfAVItuK.mjs.map +1 -0
- package/dist/node-builtins-CmaL2Cbq.mjs +36 -0
- package/dist/node-builtins-CmaL2Cbq.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.mjs +115 -2
- package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -0
- package/dist/plugin/builtin/file-utils/index.mjs +149 -2
- package/dist/plugin/builtin/file-utils/index.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +274 -2
- package/dist/plugin/builtin/kysely-type/index.mjs.map +1 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +2 -0
- package/dist/{register-ts-hook-BAHMwxfG.mjs → register-ts-hook-LYV7zH-e.mjs} +2252 -797
- package/dist/register-ts-hook-LYV7zH-e.mjs.map +1 -0
- package/dist/registry-BIGVUrMB.mjs.map +1 -1
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/workflow.d.mts +2 -20
- package/dist/runtime/workflow.mjs +1 -1
- package/dist/{seed-LUVr7jHL.mjs → seed-B-yckgQY.mjs} +42 -3
- package/dist/seed-B-yckgQY.mjs.map +1 -0
- package/dist/service-M7OYziQP.mjs +3 -0
- package/dist/{service-BNtPsK9Q.mjs → service-k1xy_A5G.mjs} +29 -2
- package/dist/{service-BNtPsK9Q.mjs.map → service-k1xy_A5G.mjs.map} +1 -1
- 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/types/idp.generated.d.mts +1 -1
- package/dist/utils/test/index.d.mts +1 -2
- package/dist/utils/test/index.mjs +1 -173
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +2 -2
- package/dist/vitest/index.mjs +10 -52
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/workflow.d.mts +0 -9
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workflow-CsaQ9qK-.mjs → workflow-Bamae_Yc.mjs} +1 -9
- package/dist/workflow-Bamae_Yc.mjs.map +1 -0
- package/dist/{workspace_resource_pb-UGK1SSn_.mjs → workspace_resource_pb-DXnO2AT-.mjs} +7 -7
- package/dist/workspace_resource_pb-DXnO2AT-.mjs.map +1 -0
- package/docs/cli/tailordb.md +39 -7
- package/docs/cli-reference.md +11 -10
- package/docs/configuration.md +50 -0
- package/docs/migration/v2.md +306 -9
- package/docs/runtime.md +1 -1
- package/docs/services/executor.md +83 -3
- package/docs/services/idp.md +8 -6
- package/docs/services/resolver.md +6 -4
- package/docs/services/tailordb-migration.md +17 -6
- package/docs/services/tailordb.md +6 -4
- package/docs/services/workflow.md +33 -3
- package/package.json +19 -17
- package/dist/application-DArFTTJ9.mjs +0 -3
- package/dist/application-miwiXtB4.mjs.map +0 -1
- package/dist/enum-constants-j9QBF0cB.mjs +0 -116
- package/dist/enum-constants-j9QBF0cB.mjs.map +0 -1
- package/dist/file-utils-yEiIS4nJ.mjs +0 -150
- package/dist/file-utils-yEiIS4nJ.mjs.map +0 -1
- package/dist/globals-DQotNuwK.mjs.map +0 -1
- package/dist/kysely-type-DqIRgDYR.mjs +0 -275
- package/dist/kysely-type-DqIRgDYR.mjs.map +0 -1
- package/dist/register-ts-hook-BAHMwxfG.mjs.map +0 -1
- package/dist/seed-LUVr7jHL.mjs.map +0 -1
- package/dist/service-D5jn05ZI.mjs +0 -3
- package/dist/service_pb-BwZRiNug.mjs.map +0 -1
- package/dist/utils/test/mock.d.mts +0 -86
- package/dist/workflow-CsaQ9qK-.mjs.map +0 -1
- package/dist/workspace_resource_pb-UGK1SSn_.mjs.map +0 -1
|
@@ -9,6 +9,22 @@ import { LogLevelEnum } from "../../types/app-config.generated.mjs";
|
|
|
9
9
|
//#region src/configure/config/types.d.ts
|
|
10
10
|
type LogLevel = LogLevelEnum;
|
|
11
11
|
type LogLevelInput = LogLevel | (string & {});
|
|
12
|
+
/** Value an `env` entry resolves to at runtime. */
|
|
13
|
+
type EnvValue = string | number | boolean;
|
|
14
|
+
/**
|
|
15
|
+
* An `env` value that credential detection flags, allowed through together with
|
|
16
|
+
* the reason it is safe to deploy as plaintext.
|
|
17
|
+
*
|
|
18
|
+
* Booleans are excluded: `true` and `false` match no credential format and are
|
|
19
|
+
* far too short for the randomness heuristic, so they are never flagged.
|
|
20
|
+
*/
|
|
21
|
+
type AllowedSecretEnvValue = {
|
|
22
|
+
value: Exclude<EnvValue, boolean>;
|
|
23
|
+
/** Why this value is safe to deploy as plaintext even though it looks like a credential. */
|
|
24
|
+
allowSecretReason: string;
|
|
25
|
+
};
|
|
26
|
+
/** An entry of `defineConfig({ env })`. */
|
|
27
|
+
type EnvEntry = EnvValue | AllowedSecretEnvValue;
|
|
12
28
|
/** `files`/`ignores` patterns are resolved relative to this config's own directory, not the invocation directory. */
|
|
13
29
|
type ExecutorServiceConfig = {
|
|
14
30
|
files: string[];
|
|
@@ -53,7 +69,7 @@ type WorkflowServiceInput = WorkflowServiceConfig;
|
|
|
53
69
|
* - `aiGateways`: Array of AI Gateway configs, e.g. `[gateway]`
|
|
54
70
|
* - `db`, `resolver`, `executor`, `workflow`, `httpAdapter`: Service configs with file globs (resolved relative to this config file's own directory, not the invocation directory)
|
|
55
71
|
*/
|
|
56
|
-
interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[], AIGateways extends AIGatewayConfig[] = AIGatewayConfig[], Env extends Record<string,
|
|
72
|
+
interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[], AIGateways extends AIGatewayConfig[] = AIGatewayConfig[], Env extends Record<string, EnvEntry> = Record<string, EnvEntry>> {
|
|
57
73
|
/** Application name (required). */
|
|
58
74
|
name: string;
|
|
59
75
|
/**
|
|
@@ -66,7 +82,14 @@ interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[
|
|
|
66
82
|
* data is preserved.
|
|
67
83
|
*/
|
|
68
84
|
id?: string;
|
|
69
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Environment variables accessible via `context.env` in resolvers and via the second argument `{ env }` in workflow job bodies.
|
|
87
|
+
*
|
|
88
|
+
* A value that looks like a credential is rejected, since `env` is deployed
|
|
89
|
+
* as plaintext. When the detection is wrong about a value, wrap it as
|
|
90
|
+
* `{ value, allowSecretReason }` to allow it and record why it is safe. Real
|
|
91
|
+
* credentials belong in `defineSecretManager()`.
|
|
92
|
+
*/
|
|
70
93
|
env?: Env;
|
|
71
94
|
/** Allowed CORS origins. Must be an array of strings, e.g. `["https://example.com"]`. */
|
|
72
95
|
cors?: string[];
|
|
@@ -108,4 +131,4 @@ interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[
|
|
|
108
131
|
logLevel?: LogLevelInput;
|
|
109
132
|
}
|
|
110
133
|
//#endregion
|
|
111
|
-
export { AppConfig, ExecutorServiceConfig, ExecutorServiceInput, HttpAdapterServiceInput, LogLevel, LogLevelInput, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, WorkflowServiceConfig, WorkflowServiceInput };
|
|
134
|
+
export { AllowedSecretEnvValue, AppConfig, EnvEntry, EnvValue, ExecutorServiceConfig, ExecutorServiceInput, HttpAdapterServiceInput, LogLevel, LogLevelInput, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, WorkflowServiceConfig, WorkflowServiceInput };
|
|
@@ -32,7 +32,7 @@ import { QueryType } from "./services/resolver/types.mjs";
|
|
|
32
32
|
import { WorkflowJob, WorkflowJobContext, createWorkflowJob } from "./services/workflow/job.mjs";
|
|
33
33
|
import { Workflow, WorkflowConfig, createWorkflow } from "./services/workflow/workflow.mjs";
|
|
34
34
|
import { FunctionOperation, GqlOperation, Operation, WebhookOperation, WorkflowOperation } from "./services/executor/operation.mjs";
|
|
35
|
-
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";
|
|
35
|
+
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";
|
|
36
36
|
import { ScheduleArgs, ScheduleTrigger, scheduleTrigger } from "./services/executor/trigger/schedule.mjs";
|
|
37
37
|
import { IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, incomingWebhookTrigger } from "./services/executor/trigger/webhook.mjs";
|
|
38
38
|
import { Trigger } from "./services/executor/trigger/index.mjs";
|
|
@@ -132,4 +132,4 @@ declare namespace t {
|
|
|
132
132
|
type infer<T> = TailorOutput<T>;
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
|
-
export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type Attributes, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, 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 TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
|
|
135
|
+
export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type Attributes, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, 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 TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, 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, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
package/dist/configure/index.mjs
CHANGED
|
@@ -515,6 +515,173 @@ function authAccessTokenTrigger(options) {
|
|
|
515
515
|
__args: {}
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
+
const workflowExecutionEventMap = {
|
|
519
|
+
started: "workflow.workflow_execution.started",
|
|
520
|
+
completed: "workflow.workflow_execution.completed",
|
|
521
|
+
retried: "workflow.workflow_execution.retried",
|
|
522
|
+
resumed: "workflow.workflow_execution.resumed",
|
|
523
|
+
wait_started: "workflow.workflow_execution.wait_started",
|
|
524
|
+
wait_resolved: "workflow.workflow_execution.wait_resolved"
|
|
525
|
+
};
|
|
526
|
+
function workflowExecutionTriggerConfig(events, options) {
|
|
527
|
+
return {
|
|
528
|
+
kind: "workflowExecution",
|
|
529
|
+
events,
|
|
530
|
+
workflowName: options.workflow.name,
|
|
531
|
+
condition: options.condition,
|
|
532
|
+
__args: {}
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Create a trigger that fires when a workflow execution starts running.
|
|
537
|
+
* @param options - Trigger options
|
|
538
|
+
* @param options.workflow - Workflow to subscribe to
|
|
539
|
+
* @param options.condition - Condition function to filter events
|
|
540
|
+
* @returns Workflow execution started trigger
|
|
541
|
+
*/
|
|
542
|
+
function workflowExecutionStartedTrigger(options) {
|
|
543
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.started"], options);
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Create a trigger that fires when a workflow execution succeeds or fails.
|
|
547
|
+
* @param options - Trigger options
|
|
548
|
+
* @param options.workflow - Workflow to subscribe to
|
|
549
|
+
* @param options.condition - Condition function to filter events
|
|
550
|
+
* @returns Workflow execution completed trigger
|
|
551
|
+
*/
|
|
552
|
+
function workflowExecutionCompletedTrigger(options) {
|
|
553
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.completed"], options);
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Create a trigger that fires when a workflow execution is retried by its retry policy.
|
|
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 retried trigger
|
|
561
|
+
*/
|
|
562
|
+
function workflowExecutionRetriedTrigger(options) {
|
|
563
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.retried"], options);
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Create a trigger that fires when a failed workflow execution is manually resumed.
|
|
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 resumed trigger
|
|
571
|
+
*/
|
|
572
|
+
function workflowExecutionResumedTrigger(options) {
|
|
573
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.resumed"], options);
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Create a trigger that fires when a workflow execution starts waiting on a wait point.
|
|
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 wait started trigger
|
|
581
|
+
*/
|
|
582
|
+
function workflowExecutionWaitStartedTrigger(options) {
|
|
583
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.wait_started"], options);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Create a trigger that fires when a waiting workflow execution is released.
|
|
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 wait resolved trigger
|
|
591
|
+
*/
|
|
592
|
+
function workflowExecutionWaitResolvedTrigger(options) {
|
|
593
|
+
return workflowExecutionTriggerConfig(["workflow.workflow_execution.wait_resolved"], options);
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Create a trigger that fires on multiple workflow execution event types.
|
|
597
|
+
* @template K
|
|
598
|
+
* @param options - Trigger options with events array
|
|
599
|
+
* @param options.events - Workflow execution event kinds to subscribe to
|
|
600
|
+
* @param options.workflow - Workflow to subscribe to
|
|
601
|
+
* @param options.condition - Condition function to filter events
|
|
602
|
+
* @returns Workflow execution trigger
|
|
603
|
+
*/
|
|
604
|
+
function workflowExecutionTrigger(options) {
|
|
605
|
+
const { events, workflow, condition } = options;
|
|
606
|
+
return workflowExecutionTriggerConfig(events.map((k) => workflowExecutionEventMap[k]), {
|
|
607
|
+
workflow,
|
|
608
|
+
condition
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
const workflowJobExecutionEventMap = {
|
|
612
|
+
started: "workflow.workflow_execution.job_execution.started",
|
|
613
|
+
completed: "workflow.workflow_execution.job_execution.completed",
|
|
614
|
+
wait_started: "workflow.workflow_execution.job_execution.wait_started",
|
|
615
|
+
wait_resolved: "workflow.workflow_execution.job_execution.wait_resolved"
|
|
616
|
+
};
|
|
617
|
+
function workflowJobExecutionTriggerConfig(events, options) {
|
|
618
|
+
return {
|
|
619
|
+
kind: "workflowJobExecution",
|
|
620
|
+
events,
|
|
621
|
+
workflowName: options.workflow.name,
|
|
622
|
+
condition: options.condition,
|
|
623
|
+
__args: {}
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Create a trigger that fires when a job inside a workflow starts running.
|
|
628
|
+
* @param options - Trigger options
|
|
629
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
630
|
+
* @param options.condition - Condition function to filter events
|
|
631
|
+
* @returns Workflow job execution started trigger
|
|
632
|
+
*/
|
|
633
|
+
function workflowJobExecutionStartedTrigger(options) {
|
|
634
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.started"], options);
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Create a trigger that fires when a job inside a workflow succeeds or fails.
|
|
638
|
+
*
|
|
639
|
+
* A job released from a wait point reports `wait_resolved` instead of
|
|
640
|
+
* `completed`; subscribe to both to observe every way a job can end.
|
|
641
|
+
* @param options - Trigger options
|
|
642
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
643
|
+
* @param options.condition - Condition function to filter events
|
|
644
|
+
* @returns Workflow job execution completed trigger
|
|
645
|
+
*/
|
|
646
|
+
function workflowJobExecutionCompletedTrigger(options) {
|
|
647
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.completed"], options);
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Create a trigger that fires when a job inside a workflow starts waiting on a wait point.
|
|
651
|
+
* @param options - Trigger options
|
|
652
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
653
|
+
* @param options.condition - Condition function to filter events
|
|
654
|
+
* @returns Workflow job execution wait started trigger
|
|
655
|
+
*/
|
|
656
|
+
function workflowJobExecutionWaitStartedTrigger(options) {
|
|
657
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.wait_started"], options);
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Create a trigger that fires when a waiting job inside a workflow is released.
|
|
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 wait resolved trigger
|
|
665
|
+
*/
|
|
666
|
+
function workflowJobExecutionWaitResolvedTrigger(options) {
|
|
667
|
+
return workflowJobExecutionTriggerConfig(["workflow.workflow_execution.job_execution.wait_resolved"], options);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Create a trigger that fires on multiple workflow job execution event types.
|
|
671
|
+
* @template K
|
|
672
|
+
* @param options - Trigger options with events array
|
|
673
|
+
* @param options.events - Workflow job execution event kinds to subscribe to
|
|
674
|
+
* @param options.workflow - Workflow whose job executions to subscribe to
|
|
675
|
+
* @param options.condition - Condition function to filter events
|
|
676
|
+
* @returns Workflow job execution trigger
|
|
677
|
+
*/
|
|
678
|
+
function workflowJobExecutionTrigger(options) {
|
|
679
|
+
const { events, workflow, condition } = options;
|
|
680
|
+
return workflowJobExecutionTriggerConfig(events.map((k) => workflowJobExecutionEventMap[k]), {
|
|
681
|
+
workflow,
|
|
682
|
+
condition
|
|
683
|
+
});
|
|
684
|
+
}
|
|
518
685
|
|
|
519
686
|
//#endregion
|
|
520
687
|
//#region src/configure/services/executor/trigger/schedule.ts
|
|
@@ -605,7 +772,7 @@ function defineWorkflowExecutionPolicy(name, def) {
|
|
|
605
772
|
/**
|
|
606
773
|
* Define a group of workflow job function execution policies. Property names
|
|
607
774
|
* become the workspace-unique `name` and default `key` verbatim, matching the
|
|
608
|
-
* mental model of {@link
|
|
775
|
+
* mental model of {@link createWaitPoints}. Provide `name` / `key` explicitly
|
|
609
776
|
* to override the property-name default (for example, when the property name
|
|
610
777
|
* is not valid for the execution policy grammar or when the runtime key
|
|
611
778
|
* prefix needs to differ).
|
|
@@ -706,7 +873,8 @@ function createWorkflowJob(config) {
|
|
|
706
873
|
return brandValue({
|
|
707
874
|
name: config.name,
|
|
708
875
|
start,
|
|
709
|
-
body
|
|
876
|
+
body,
|
|
877
|
+
...config.publishEvents !== void 0 ? { publishEvents: config.publishEvents } : {}
|
|
710
878
|
}, "workflow-job");
|
|
711
879
|
}
|
|
712
880
|
|
|
@@ -1029,5 +1197,5 @@ function definePlugins(...configs) {
|
|
|
1029
1197
|
const t = t$1;
|
|
1030
1198
|
|
|
1031
1199
|
//#endregion
|
|
1032
|
-
export { authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
|
|
1200
|
+
export { authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
1033
1201
|
//# sourceMappingURL=index.mjs.map
|