@tailor-platform/sdk 1.82.0 → 1.84.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 +40 -0
- package/dist/application-5FOWIxFQ.mjs +3 -0
- package/dist/{application-CVeA53ok.mjs → application-CnCljDwk.mjs} +15 -10
- package/dist/application-CnCljDwk.mjs.map +1 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +1 -0
- 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/snapshot.d.mts +1 -1
- package/dist/cli/index.mjs +65 -10
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +1 -1
- package/dist/cli/lib.mjs +2 -2
- package/dist/cli/shared/client.d.mts +28 -3
- package/dist/cli/skills.d.mts +1 -1
- package/dist/completion/zsh-worker.zsh +35 -22
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +173 -5
- 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/execution-policy.d.mts +2 -2
- package/dist/configure/services/workflow/job.d.mts +9 -0
- package/dist/configure/services/workflow/workflow.d.mts +10 -0
- package/dist/{globals-DUqEetIh.mjs → globals-DraXTdqg.mjs} +6 -5
- package/dist/globals-DraXTdqg.mjs.map +1 -0
- package/dist/{register-typescript-runtime-O7zQNif0.mjs → register-typescript-runtime-BCvWR3HC.mjs} +518 -123
- package/dist/register-typescript-runtime-BCvWR3HC.mjs.map +1 -0
- package/dist/{registry-CXi7rJq7.mjs → registry-Ct0Wgxp1.mjs} +3 -3
- package/dist/registry-Ct0Wgxp1.mjs.map +1 -0
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/workflow.d.mts +39 -21
- package/dist/runtime/workflow.mjs +2 -2
- 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/utils/test/index.mjs +18 -12
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/utils/test/mock.d.mts +2 -2
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.mjs +30 -24
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/file.d.mts +1 -1
- package/dist/vitest/mocks/workflow.d.mts +20 -15
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workflow-CkIDJpdg.mjs → workflow-B2mwc7aT.mjs} +17 -9
- package/dist/workflow-B2mwc7aT.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 +14 -12
- package/docs/cli-reference.md +15 -15
- package/docs/runtime.md +1 -1
- package/docs/services/executor.md +83 -3
- package/docs/services/idp.md +3 -3
- package/docs/services/tailordb-migration.md +18 -5
- package/docs/services/workflow.md +28 -2
- package/docs/testing.md +1 -1
- package/package.json +16 -16
- package/dist/application-CP0W2sQo.mjs +0 -3
- package/dist/application-CVeA53ok.mjs.map +0 -1
- package/dist/globals-DUqEetIh.mjs.map +0 -1
- package/dist/register-typescript-runtime-O7zQNif0.mjs.map +0 -1
- package/dist/registry-CXi7rJq7.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/workflow-CkIDJpdg.mjs.map +0 -1
- package/dist/workspace_resource_pb-UGK1SSn_.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AddOrganizationTeamMemberRequestSchema, AddOrganizationTeamMemberResponseSchema, CreateOrganizationFolderRequestSchema, CreateOrganizationFolderResponseSchema, CreateOrganizationTeamRequestSchema, CreateOrganizationTeamResponseSchema, CreateWorkspaceRequestSchema, CreateWorkspaceResponseSchema, DeleteOrganizationFolderIPRestrictionRequestSchema, DeleteOrganizationFolderIPRestrictionResponseSchema, DeleteOrganizationFolderRequestSchema, DeleteOrganizationFolderResponseSchema, DeleteOrganizationIPRestrictionRequestSchema, DeleteOrganizationIPRestrictionResponseSchema, DeleteOrganizationTeamRequestSchema, DeleteOrganizationTeamResponseSchema, DeleteWorkspaceRequestSchema, DeleteWorkspaceResponseSchema, GetOrganizationAccessRequestSchema, GetOrganizationAccessResponseSchema, GetOrganizationFolderAccessRequestSchema, GetOrganizationFolderAccessResponseSchema, GetOrganizationFolderIPRestrictionRequestSchema, GetOrganizationFolderIPRestrictionResponseSchema, GetOrganizationFolderRequestSchema, GetOrganizationFolderResponseSchema, GetOrganizationIPRestrictionRequestSchema, GetOrganizationIPRestrictionResponseSchema, GetOrganizationRequestSchema, GetOrganizationResponseSchema, GetOrganizationTeamMemberRequestSchema, GetOrganizationTeamMemberResponseSchema, GetOrganizationTeamRequestSchema, GetOrganizationTeamResponseSchema, GetPlatformAccountPlanRequestSchema, GetPlatformAccountPlanResponseSchema, GetWorkspacePlatformUserRequestSchema, GetWorkspacePlatformUserResponseSchema, GetWorkspaceRequestSchema, GetWorkspaceResponseSchema, GetWorkspaceRoleRequestSchema, GetWorkspaceRoleResponseSchema, GrantOrganizationAccessRequestSchema, GrantOrganizationAccessResponseSchema, GrantOrganizationFolderAccessRequestSchema, GrantOrganizationFolderAccessResponseSchema, InviteWorkspacePlatformUserRequestSchema, InviteWorkspacePlatformUserResponseSchema, ListAvailableWorkspacePlatformUserRolesRequestSchema, ListAvailableWorkspacePlatformUserRolesResponseSchema, ListAvailableWorkspaceRegionsRequestSchema, ListAvailableWorkspaceRegionsResponseSchema, ListOrganizationAccessesRequestSchema, ListOrganizationAccessesResponseSchema, ListOrganizationFolderAccessesRequestSchema, ListOrganizationFolderAccessesResponseSchema, ListOrganizationFoldersRequestSchema, ListOrganizationFoldersResponseSchema, ListOrganizationTeamMembersRequestSchema, ListOrganizationTeamMembersResponseSchema, ListOrganizationTeamsRequestSchema, ListOrganizationTeamsResponseSchema, ListOrganizationWorkspacesRequestSchema, ListOrganizationWorkspacesResponseSchema, ListOrganizationsRequestSchema, ListOrganizationsResponseSchema, ListUserOrganizationsRequestSchema, ListUserOrganizationsResponseSchema, ListWorkspacePlatformUsersRequestSchema, ListWorkspacePlatformUsersResponseSchema, ListWorkspacesRequestSchema, ListWorkspacesResponseSchema, RemoveOrganizationTeamMemberRequestSchema, RemoveOrganizationTeamMemberResponseSchema, RemoveWorkspacePlatformUserRequestSchema, RemoveWorkspacePlatformUserResponseSchema, RestoreWorkspaceRequestSchema, RestoreWorkspaceResponseSchema, RevokeOrganizationAccessRequestSchema, RevokeOrganizationAccessResponseSchema, RevokeOrganizationFolderAccessRequestSchema, RevokeOrganizationFolderAccessResponseSchema, UpdateOrganizationAccessRequestSchema, UpdateOrganizationAccessResponseSchema, UpdateOrganizationFolderAccessRequestSchema, UpdateOrganizationFolderAccessResponseSchema, UpdateOrganizationFolderRequestSchema, UpdateOrganizationFolderResponseSchema, UpdateOrganizationRequestSchema, UpdateOrganizationResponseSchema, UpdateOrganizationTeamMemberRequestSchema, UpdateOrganizationTeamMemberResponseSchema, UpdateOrganizationTeamRequestSchema, UpdateOrganizationTeamResponseSchema, UpdateWorkspacePlatformUserRequestSchema, UpdateWorkspacePlatformUserResponseSchema, UpdateWorkspaceRequestSchema, UpdateWorkspaceResponseSchema, UpsertOrganizationFolderIPRestrictionRequestSchema, UpsertOrganizationFolderIPRestrictionResponseSchema, UpsertOrganizationIPRestrictionRequestSchema, UpsertOrganizationIPRestrictionResponseSchema } from "./workspace_pb.mjs";
|
|
2
|
-
import { CreateApplicationRequestSchema, CreateApplicationResponseSchema, DeleteApplicationRequestSchema, DeleteApplicationResponseSchema, GetApplicationRequestSchema, GetApplicationResponseSchema, GetApplicationSchemaHealthRequestSchema, GetApplicationSchemaHealthResponseSchema, ListApplicationsRequestSchema, ListApplicationsResponseSchema, UpdateApplicationRequestSchema, UpdateApplicationResponseSchema } from "./application_pb.mjs";
|
|
2
|
+
import { CloneApplicationDataRequestSchema, CloneApplicationDataResponseSchema, CreateApplicationRequestSchema, CreateApplicationResponseSchema, DeleteApplicationRequestSchema, DeleteApplicationResponseSchema, GetApplicationRequestSchema, GetApplicationResponseSchema, GetApplicationSchemaHealthRequestSchema, GetApplicationSchemaHealthResponseSchema, GetCloneApplicationDataOperationRequestSchema, GetCloneApplicationDataOperationResponseSchema, ListApplicationsRequestSchema, ListApplicationsResponseSchema, UpdateApplicationRequestSchema, UpdateApplicationResponseSchema } from "./application_pb.mjs";
|
|
3
3
|
import { CreateAIGatewayRequestSchema, CreateAIGatewayResponseSchema, DeleteAIGatewayRequestSchema, DeleteAIGatewayResponseSchema, GetAIGatewayRequestSchema, GetAIGatewayResponseSchema, ListAIGatewaysRequestSchema, ListAIGatewaysResponseSchema, UpdateAIGatewayRequestSchema, UpdateAIGatewayResponseSchema } from "./aigateway_pb.mjs";
|
|
4
4
|
import { ComposeTailorDBSDLRequestSchema, ComposeTailorDBSDLResponseSchema, CreateTailorDBGQLPermissionRequestSchema, CreateTailorDBGQLPermissionResponseSchema, CreateTailorDBServiceRequestSchema, CreateTailorDBServiceResponseSchema, CreateTailorDBTypeRequestSchema, CreateTailorDBTypeResponseSchema, DeleteTailorDBGQLPermissionRequestSchema, DeleteTailorDBGQLPermissionResponseSchema, DeleteTailorDBServiceRequestSchema, DeleteTailorDBServiceResponseSchema, DeleteTailorDBTypeRequestSchema, DeleteTailorDBTypeResponseSchema, GetTailorDBGQLPermissionRequestSchema, GetTailorDBGQLPermissionResponseSchema, GetTailorDBServiceRequestSchema, GetTailorDBServiceResponseSchema, GetTailorDBTypeRequestSchema, GetTailorDBTypeResponseSchema, ListTailorDBGQLPermissionsRequestSchema, ListTailorDBGQLPermissionsResponseSchema, ListTailorDBServicesRequestSchema, ListTailorDBServicesResponseSchema, ListTailorDBTypesRequestSchema, ListTailorDBTypesResponseSchema, TruncateTailorDBTypeRequestSchema, TruncateTailorDBTypeResponseSchema, TruncateTailorDBTypesRequestSchema, TruncateTailorDBTypesResponseSchema, UpdateTailorDBGQLPermissionRequestSchema, UpdateTailorDBGQLPermissionResponseSchema, UpdateTailorDBServiceRequestSchema, UpdateTailorDBServiceResponseSchema, UpdateTailorDBTypeRequestSchema, UpdateTailorDBTypeResponseSchema } from "./tailordb_pb.mjs";
|
|
5
5
|
import { ComposePipelineSDLRequestSchema, ComposePipelineSDLResponseSchema, CreatePipelineResolverRequestSchema, CreatePipelineResolverResponseSchema, CreatePipelineServiceRequestSchema, CreatePipelineServiceResponseSchema, DeletePipelineResolverRequestSchema, DeletePipelineResolverResponseSchema, DeletePipelineServiceRequestSchema, DeletePipelineServiceResponseSchema, GetPipelineResolverExecutionResultRequestSchema, GetPipelineResolverExecutionResultResponseSchema, GetPipelineResolverRequestSchema, GetPipelineResolverResponseSchema, GetPipelineServiceRequestSchema, GetPipelineServiceResponseSchema, ListPipelineResolverExecutionResultsRequestSchema, ListPipelineResolverExecutionResultsResponseSchema, ListPipelineResolversRequestSchema, ListPipelineResolversResponseSchema, ListPipelineServicesRequestSchema, ListPipelineServicesResponseSchema, RestartPipelineResolverRequestSchema, RestartPipelineResolverResponseSchema, UpdatePipelineResolverRequestSchema, UpdatePipelineResolverResponseSchema, UpdatePipelineServiceRequestSchema, UpdatePipelineServiceResponseSchema } from "./pipeline_pb.mjs";
|
|
@@ -8,12 +8,12 @@ import { CreateExecutorExecutorRequestSchema, CreateExecutorExecutorResponseSche
|
|
|
8
8
|
import { CreateSecretManagerSecretRequestSchema, CreateSecretManagerSecretResponseSchema, CreateSecretManagerVaultRequestSchema, CreateSecretManagerVaultResponseSchema, DeleteSecretManagerSecretRequestSchema, DeleteSecretManagerSecretResponseSchema, DeleteSecretManagerVaultRequestSchema, DeleteSecretManagerVaultResponseSchema, GetSecretManagerSecretRequestSchema, GetSecretManagerSecretResponseSchema, GetSecretManagerVaultRequestSchema, GetSecretManagerVaultResponseSchema, ListSecretManagerSecretsRequestSchema, ListSecretManagerSecretsResponseSchema, ListSecretManagerVaultsRequestSchema, ListSecretManagerVaultsResponseSchema, UpdateSecretManagerSecretRequestSchema, UpdateSecretManagerSecretResponseSchema } from "./secret_manager_pb.mjs";
|
|
9
9
|
import { CreateAuthConnectionRequestSchema, CreateAuthConnectionResponseSchema, CreateAuthHookRequestSchema, CreateAuthHookResponseSchema, CreateAuthIDPConfigRequestSchema, CreateAuthIDPConfigResponseSchema, CreateAuthMachineUserRequestSchema, CreateAuthMachineUserResponseSchema, CreateAuthOAuth2ClientRequestSchema, CreateAuthOAuth2ClientResponseSchema, CreateAuthSCIMConfigRequestSchema, CreateAuthSCIMConfigResponseSchema, CreateAuthSCIMResourceRequestSchema, CreateAuthSCIMResourceResponseSchema, CreateAuthServiceRequestSchema, CreateAuthServiceResponseSchema, CreateControlplaneMachineUserRequestSchema, CreateControlplaneMachineUserResponseSchema, CreatePersonalAccessTokenRequestSchema, CreatePersonalAccessTokenResponseSchema, CreateTenantConfigRequestSchema, CreateTenantConfigResponseSchema, CreateUserProfileConfigRequestSchema, CreateUserProfileConfigResponseSchema, DeleteAuthConnectionRequestSchema, DeleteAuthConnectionResponseSchema, DeleteAuthHookRequestSchema, DeleteAuthHookResponseSchema, DeleteAuthIDPConfigRequestSchema, DeleteAuthIDPConfigResponseSchema, DeleteAuthMachineUserRequestSchema, DeleteAuthMachineUserResponseSchema, DeleteAuthOAuth2ClientRequestSchema, DeleteAuthOAuth2ClientResponseSchema, DeleteAuthSCIMConfigRequestSchema, DeleteAuthSCIMConfigResponseSchema, DeleteAuthSCIMResourceRequestSchema, DeleteAuthSCIMResourceResponseSchema, DeleteAuthServiceRequestSchema, DeleteAuthServiceResponseSchema, DeleteControlplaneMachineUserRequestSchema, DeleteControlplaneMachineUserResponseSchema, DeletePersonalAccessTokenRequestSchema, DeletePersonalAccessTokenResponseSchema, DeleteTenantConfigRequestSchema, DeleteTenantConfigResponseSchema, DeleteUserProfileConfigRequestSchema, DeleteUserProfileConfigResponseSchema, ExchangeAuthConnectionAuthorizationCodeRequestSchema, ExchangeAuthConnectionAuthorizationCodeResponseSchema, GetAuthHookRequestSchema, GetAuthHookResponseSchema, GetAuthIDPConfigRequestSchema, GetAuthIDPConfigResponseSchema, GetAuthMachineUserRequestSchema, GetAuthMachineUserResponseSchema, GetAuthOAuth2ClientRequestSchema, GetAuthOAuth2ClientResponseSchema, GetAuthSCIMConfigRequestSchema, GetAuthSCIMConfigResponseSchema, GetAuthSCIMResourceRequestSchema, GetAuthSCIMResourceResponseSchema, GetAuthSCIMResourcesRequestSchema, GetAuthSCIMResourcesResponseSchema, GetAuthServiceRequestSchema, GetAuthServiceResponseSchema, GetControlplaneMachineUserByNameRequestSchema, GetControlplaneMachineUserByNameResponseSchema, GetControlplaneMachineUserRequestSchema, GetControlplaneMachineUserResponseSchema, GetTenantConfigRequestSchema, GetTenantConfigResponseSchema, GetUserProfileConfigRequestSchema, GetUserProfileConfigResponseSchema, ListAuthConnectionsRequestSchema, ListAuthConnectionsResponseSchema, ListAuthIDPConfigsRequestSchema, ListAuthIDPConfigsResponseSchema, ListAuthMachineUsersRequestSchema, ListAuthMachineUsersResponseSchema, ListAuthOAuth2ClientsRequestSchema, ListAuthOAuth2ClientsResponseSchema, ListAuthServicesRequestSchema, ListAuthServicesResponseSchema, ListControlplaneMachineUsersRequestSchema, ListControlplaneMachineUsersResponseSchema, ListPersonalAccessTokensRequestSchema, ListPersonalAccessTokensResponseSchema, RegisterAuthConnectionSessionRequestSchema, RegisterAuthConnectionSessionResponseSchema, RevokeAuthConnectionRequestSchema, RevokeAuthConnectionResponseSchema, UpdateAuthConnectionRequestSchema, UpdateAuthConnectionResponseSchema, UpdateAuthHookRequestSchema, UpdateAuthHookResponseSchema, UpdateAuthIDPConfigRequestSchema, UpdateAuthIDPConfigResponseSchema, UpdateAuthMachineUserRequestSchema, UpdateAuthMachineUserResponseSchema, UpdateAuthOAuth2ClientRequestSchema, UpdateAuthOAuth2ClientResponseSchema, UpdateAuthSCIMConfigRequestSchema, UpdateAuthSCIMConfigResponseSchema, UpdateAuthSCIMResourceRequestSchema, UpdateAuthSCIMResourceResponseSchema, UpdateAuthServiceRequestSchema, UpdateAuthServiceResponseSchema, UpdateControlplaneMachineUserRequestSchema, UpdateControlplaneMachineUserResponseSchema, UpdateTenantConfigRequestSchema, UpdateTenantConfigResponseSchema, UpdateUserProfileConfigRequestSchema, UpdateUserProfileConfigResponseSchema } from "./auth_pb.mjs";
|
|
10
10
|
import { ListControlplaneActivityLogsRequestSchema, ListControlplaneActivityLogsResponseSchema, ListDataplaneEventsRequestSchema, ListDataplaneEventsResponseSchema } from "./events_pb.mjs";
|
|
11
|
-
import { GetFunctionExecutionRequestSchema, GetFunctionExecutionResponseSchema, ListFunctionExecutionsRequestSchema, ListFunctionExecutionsResponseSchema, TestExecScriptRequestSchema, TestExecScriptResponseSchema } from "./function_pb.mjs";
|
|
11
|
+
import { ExecScriptRequestSchema, ExecScriptResponseSchema, GetFunctionExecutionRequestSchema, GetFunctionExecutionResponseSchema, ListFunctionExecutionsRequestSchema, ListFunctionExecutionsResponseSchema, TestExecScriptRequestSchema, TestExecScriptResponseSchema } from "./function_pb.mjs";
|
|
12
12
|
import { CreateFunctionRegistryRequestSchema, CreateFunctionRegistryResponseSchema, DeleteFunctionRegistryRequestSchema, DeleteFunctionRegistryResponseSchema, DownloadFunctionRegistryScriptRequestSchema, DownloadFunctionRegistryScriptResponseSchema, GetFunctionRegistryRequestSchema, GetFunctionRegistryResponseSchema, ListFunctionRegistriesRequestSchema, ListFunctionRegistriesResponseSchema, UpdateFunctionRegistryRequestSchema, UpdateFunctionRegistryResponseSchema } from "./function_registry_pb.mjs";
|
|
13
13
|
import { ListMeterAITokenUsagesRequestSchema, ListMeterAITokenUsagesResponseSchema, ListMeterEventCountsRequestSchema, ListMeterEventCountsResponseSchema, ListMeterExecutionCountsRequestSchema, ListMeterExecutionCountsResponseSchema, ListMeterRequestCountsRequestSchema, ListMeterRequestCountsResponseSchema } from "./meter_pb.mjs";
|
|
14
14
|
import { CreateIdPClientRequestSchema, CreateIdPClientResponseSchema, CreateIdPServiceRequestSchema, CreateIdPServiceResponseSchema, DeleteIdPClientRequestSchema, DeleteIdPClientResponseSchema, DeleteIdPServiceRequestSchema, DeleteIdPServiceResponseSchema, GetIdPClientRequestSchema, GetIdPClientResponseSchema, GetIdPServiceRequestSchema, GetIdPServiceResponseSchema, ListIdPClientsRequestSchema, ListIdPClientsResponseSchema, ListIdPServicesRequestSchema, ListIdPServicesResponseSchema, UpdateIdPServiceRequestSchema, UpdateIdPServiceResponseSchema } from "./idp_pb.mjs";
|
|
15
15
|
import { AddCustomDomainRequestSchema, AddCustomDomainResponseSchema, CreateDeploymentRequestSchema, CreateDeploymentResponseSchema, CreateStaticWebsiteRequestSchema, CreateStaticWebsiteResponseSchema, DeleteStaticWebsiteRequestSchema, DeleteStaticWebsiteResponseSchema, GetCustomDomainRequestSchema, GetCustomDomainResponseSchema, GetStaticWebsiteRequestSchema, GetStaticWebsiteResponseSchema, ListCustomDomainsRequestSchema, ListCustomDomainsResponseSchema, ListStaticWebsitesRequestSchema, ListStaticWebsitesResponseSchema, PublishDeploymentRequestSchema, PublishDeploymentResponseSchema, RemoveCustomDomainRequestSchema, RemoveCustomDomainResponseSchema, UpdateStaticWebsiteRequestSchema, UpdateStaticWebsiteResponseSchema, UploadFileRequestSchema, UploadFileResponseSchema } from "./staticwebsite_pb.mjs";
|
|
16
|
-
import { CreateWorkflowJobFunctionExecutionPolicyRequestSchema, CreateWorkflowJobFunctionExecutionPolicyResponseSchema, CreateWorkflowJobFunctionRequestSchema, CreateWorkflowJobFunctionResponseSchema, CreateWorkflowRequestSchema, CreateWorkflowResponseSchema, DeleteWorkflowJobFunctionExecutionPolicyRequestSchema, DeleteWorkflowJobFunctionExecutionPolicyResponseSchema, DeleteWorkflowJobFunctionRequestSchema, DeleteWorkflowJobFunctionResponseSchema, DeleteWorkflowRequestSchema, DeleteWorkflowResponseSchema, GetWorkflowByNameRequestSchema, GetWorkflowByNameResponseSchema, GetWorkflowExecutionRequestSchema, GetWorkflowExecutionResponseSchema, GetWorkflowJobFunctionByNameRequestSchema, GetWorkflowJobFunctionByNameResponseSchema, GetWorkflowJobFunctionExecutionPolicyByKeyRequestSchema, GetWorkflowJobFunctionExecutionPolicyByKeyResponseSchema, GetWorkflowJobFunctionExecutionPolicyRequestSchema, GetWorkflowJobFunctionExecutionPolicyResponseSchema, GetWorkflowJobFunctionRequestSchema, GetWorkflowJobFunctionResponseSchema, GetWorkflowRequestSchema, GetWorkflowResponseSchema, ListWorkflowExecutionsRequestSchema, ListWorkflowExecutionsResponseSchema, ListWorkflowJobFunctionExecutionPoliciesRequestSchema, ListWorkflowJobFunctionExecutionPoliciesResponseSchema, ListWorkflowJobFunctionsRequestSchema, ListWorkflowJobFunctionsResponseSchema, ListWorkflowsRequestSchema, ListWorkflowsResponseSchema, TestResumeWorkflowRequestSchema, TestResumeWorkflowResponseSchema, TestStartWorkflowRequestSchema, TestStartWorkflowResponseSchema, UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, UpdateWorkflowJobFunctionExecutionPolicyResponseSchema, UpdateWorkflowJobFunctionRequestSchema, UpdateWorkflowJobFunctionResponseSchema, UpdateWorkflowRequestSchema, UpdateWorkflowResponseSchema } from "./workflow_pb.mjs";
|
|
16
|
+
import { CreateWorkflowJobFunctionExecutionPolicyRequestSchema, CreateWorkflowJobFunctionExecutionPolicyResponseSchema, CreateWorkflowJobFunctionRequestSchema, CreateWorkflowJobFunctionResponseSchema, CreateWorkflowRequestSchema, CreateWorkflowResponseSchema, DeleteWorkflowJobFunctionExecutionPolicyRequestSchema, DeleteWorkflowJobFunctionExecutionPolicyResponseSchema, DeleteWorkflowJobFunctionRequestSchema, DeleteWorkflowJobFunctionResponseSchema, DeleteWorkflowRequestSchema, DeleteWorkflowResponseSchema, GetWorkflowByNameRequestSchema, GetWorkflowByNameResponseSchema, GetWorkflowExecutionRequestSchema, GetWorkflowExecutionResponseSchema, GetWorkflowJobFunctionByNameRequestSchema, GetWorkflowJobFunctionByNameResponseSchema, GetWorkflowJobFunctionExecutionPolicyByKeyRequestSchema, GetWorkflowJobFunctionExecutionPolicyByKeyResponseSchema, GetWorkflowJobFunctionExecutionPolicyRequestSchema, GetWorkflowJobFunctionExecutionPolicyResponseSchema, GetWorkflowJobFunctionRequestSchema, GetWorkflowJobFunctionResponseSchema, GetWorkflowRequestSchema, GetWorkflowResponseSchema, ListWorkflowExecutionsRequestSchema, ListWorkflowExecutionsResponseSchema, ListWorkflowJobFunctionExecutionPoliciesRequestSchema, ListWorkflowJobFunctionExecutionPoliciesResponseSchema, ListWorkflowJobFunctionsRequestSchema, ListWorkflowJobFunctionsResponseSchema, ListWorkflowsRequestSchema, ListWorkflowsResponseSchema, ResumeWorkflowExecutionRequestSchema, ResumeWorkflowExecutionResponseSchema, StartWorkflowRequestSchema, StartWorkflowResponseSchema, TestResumeWorkflowRequestSchema, TestResumeWorkflowResponseSchema, TestStartWorkflowRequestSchema, TestStartWorkflowResponseSchema, UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, UpdateWorkflowJobFunctionExecutionPolicyResponseSchema, UpdateWorkflowJobFunctionRequestSchema, UpdateWorkflowJobFunctionResponseSchema, UpdateWorkflowRequestSchema, UpdateWorkflowResponseSchema } from "./workflow_pb.mjs";
|
|
17
17
|
import { GetMetadataRequestSchema, GetMetadataResponseSchema, SetMetadataRequestSchema, SetMetadataResponseSchema } from "./metadata_pb.mjs";
|
|
18
18
|
import { CreateOTLPExporterRequestSchema, CreateOTLPExporterResponseSchema, CreateResourceAttributesConfigRequestSchema, CreateResourceAttributesConfigResponseSchema, DeleteOTLPExporterRequestSchema, DeleteOTLPExporterResponseSchema, DeleteResourceAttributesConfigRequestSchema, DeleteResourceAttributesConfigResponseSchema, GetOTLPExporterRequestSchema, GetOTLPExporterResponseSchema, GetResourceAttributesConfigRequestSchema, GetResourceAttributesConfigResponseSchema, ListOTLPExportersRequestSchema, ListOTLPExportersResponseSchema, TestOTLPExporterRequestSchema, TestOTLPExporterResponseSchema, UpdateOTLPExporterRequestSchema, UpdateOTLPExporterResponseSchema, UpdateResourceAttributesConfigRequestSchema, UpdateResourceAttributesConfigResponseSchema } from "./telemetryrouter_pb.mjs";
|
|
19
19
|
import { GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
@@ -925,6 +925,39 @@ declare const OperatorService: GenService<{
|
|
|
925
925
|
input: typeof GetApplicationSchemaHealthRequestSchema;
|
|
926
926
|
output: typeof GetApplicationSchemaHealthResponseSchema;
|
|
927
927
|
};
|
|
928
|
+
/**
|
|
929
|
+
* CloneApplicationData clones data for an application from a source to a target.
|
|
930
|
+
* The RPC returns immediately and the clone runs asynchronously.
|
|
931
|
+
*
|
|
932
|
+
* [Errors]
|
|
933
|
+
* - Unauthenticated: token is missing, expired, or invalid
|
|
934
|
+
* - Unimplemented: feature flag is disabled
|
|
935
|
+
* - InvalidArgument: request is invalid
|
|
936
|
+
* - NotFound: workspace or application does not exist or cannot be accessed
|
|
937
|
+
* - FailedPrecondition: cross-region clone or namespace mismatch
|
|
938
|
+
*
|
|
939
|
+
* @generated from rpc tailor.v1.OperatorService.CloneApplicationData
|
|
940
|
+
*/
|
|
941
|
+
cloneApplicationData: {
|
|
942
|
+
methodKind: "unary";
|
|
943
|
+
input: typeof CloneApplicationDataRequestSchema;
|
|
944
|
+
output: typeof CloneApplicationDataResponseSchema;
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
947
|
+
* GetCloneApplicationDataOperation returns the status of a clone operation.
|
|
948
|
+
*
|
|
949
|
+
* [Errors]
|
|
950
|
+
* - Unauthenticated: token is missing, expired, or invalid
|
|
951
|
+
* - InvalidArgument: request is invalid
|
|
952
|
+
* - NotFound: operation does not exist
|
|
953
|
+
*
|
|
954
|
+
* @generated from rpc tailor.v1.OperatorService.GetCloneApplicationDataOperation
|
|
955
|
+
*/
|
|
956
|
+
getCloneApplicationDataOperation: {
|
|
957
|
+
methodKind: "unary";
|
|
958
|
+
input: typeof GetCloneApplicationDataOperationRequestSchema;
|
|
959
|
+
output: typeof GetCloneApplicationDataOperationResponseSchema;
|
|
960
|
+
};
|
|
928
961
|
/**
|
|
929
962
|
* CreateAIGateway creates a new AI Gateway in a given workspace.
|
|
930
963
|
*
|
|
@@ -2470,9 +2503,22 @@ declare const OperatorService: GenService<{
|
|
|
2470
2503
|
};
|
|
2471
2504
|
/**
|
|
2472
2505
|
* Function ---------------------------------------------------------
|
|
2473
|
-
*
|
|
2506
|
+
* ExecScript executes specified JavaScript code in which I/O operations are allowed and returns the result.
|
|
2507
|
+
*
|
|
2508
|
+
* @generated from rpc tailor.v1.OperatorService.ExecScript
|
|
2509
|
+
*/
|
|
2510
|
+
execScript: {
|
|
2511
|
+
methodKind: "unary";
|
|
2512
|
+
input: typeof ExecScriptRequestSchema;
|
|
2513
|
+
output: typeof ExecScriptResponseSchema;
|
|
2514
|
+
};
|
|
2515
|
+
/**
|
|
2516
|
+
* TestExecScript is the deprecated legacy alias of ExecScript, kept so tailorctl / Console callers can migrate on their own cadence.
|
|
2517
|
+
*
|
|
2518
|
+
* Deprecated: use ExecScript. Scheduled for removal ~N+2 releases after all callers migrate.
|
|
2474
2519
|
*
|
|
2475
2520
|
* @generated from rpc tailor.v1.OperatorService.TestExecScript
|
|
2521
|
+
* @deprecated
|
|
2476
2522
|
*/
|
|
2477
2523
|
testExecScript: {
|
|
2478
2524
|
methodKind: "unary";
|
|
@@ -3161,7 +3207,40 @@ declare const OperatorService: GenService<{
|
|
|
3161
3207
|
output: typeof ListWorkflowExecutionsResponseSchema;
|
|
3162
3208
|
};
|
|
3163
3209
|
/**
|
|
3164
|
-
*
|
|
3210
|
+
* StartWorkflow starts a workflow execution.
|
|
3211
|
+
*
|
|
3212
|
+
* [Errors]
|
|
3213
|
+
* - Unauthenticated: token is missing, expired, or invalid
|
|
3214
|
+
* - InvalidArgument: request is invalid
|
|
3215
|
+
* - NotFound: workflow does not exist or can not be accessed
|
|
3216
|
+
*
|
|
3217
|
+
* @generated from rpc tailor.v1.OperatorService.StartWorkflow
|
|
3218
|
+
*/
|
|
3219
|
+
startWorkflow: {
|
|
3220
|
+
methodKind: "unary";
|
|
3221
|
+
input: typeof StartWorkflowRequestSchema;
|
|
3222
|
+
output: typeof StartWorkflowResponseSchema;
|
|
3223
|
+
};
|
|
3224
|
+
/**
|
|
3225
|
+
* ResumeWorkflowExecution resumes a failed workflow execution.
|
|
3226
|
+
*
|
|
3227
|
+
* [Errors]
|
|
3228
|
+
* - Unauthenticated: token is missing, expired, or invalid
|
|
3229
|
+
* - InvalidArgument: request is invalid
|
|
3230
|
+
* - NotFound: execution does not exist or can not be accessed
|
|
3231
|
+
* - FailedPrecondition: execution is not in a resumable state
|
|
3232
|
+
*
|
|
3233
|
+
* @generated from rpc tailor.v1.OperatorService.ResumeWorkflowExecution
|
|
3234
|
+
*/
|
|
3235
|
+
resumeWorkflowExecution: {
|
|
3236
|
+
methodKind: "unary";
|
|
3237
|
+
input: typeof ResumeWorkflowExecutionRequestSchema;
|
|
3238
|
+
output: typeof ResumeWorkflowExecutionResponseSchema;
|
|
3239
|
+
};
|
|
3240
|
+
/**
|
|
3241
|
+
* TestStartWorkflow is the deprecated legacy alias of StartWorkflow, kept so tailorctl / Console callers can migrate on their own cadence.
|
|
3242
|
+
*
|
|
3243
|
+
* Deprecated: use StartWorkflow. Scheduled for removal ~N+2 releases after all callers migrate.
|
|
3165
3244
|
*
|
|
3166
3245
|
* [Errors]
|
|
3167
3246
|
* - Unauthenticated: token is missing, expired, or invalid
|
|
@@ -3169,6 +3248,7 @@ declare const OperatorService: GenService<{
|
|
|
3169
3248
|
* - NotFound: workflow does not exist or can not be accessed
|
|
3170
3249
|
*
|
|
3171
3250
|
* @generated from rpc tailor.v1.OperatorService.TestStartWorkflow
|
|
3251
|
+
* @deprecated
|
|
3172
3252
|
*/
|
|
3173
3253
|
testStartWorkflow: {
|
|
3174
3254
|
methodKind: "unary";
|
|
@@ -3176,7 +3256,9 @@ declare const OperatorService: GenService<{
|
|
|
3176
3256
|
output: typeof TestStartWorkflowResponseSchema;
|
|
3177
3257
|
};
|
|
3178
3258
|
/**
|
|
3179
|
-
* TestResumeWorkflow
|
|
3259
|
+
* TestResumeWorkflow is the deprecated legacy alias of ResumeWorkflowExecution, kept so tailorctl / Console callers can migrate on their own cadence.
|
|
3260
|
+
*
|
|
3261
|
+
* Deprecated: use ResumeWorkflowExecution. Scheduled for removal ~N+2 releases after all callers migrate.
|
|
3180
3262
|
*
|
|
3181
3263
|
* [Errors]
|
|
3182
3264
|
* - Unauthenticated: token is missing, expired, or invalid
|
|
@@ -3185,6 +3267,7 @@ declare const OperatorService: GenService<{
|
|
|
3185
3267
|
* - FailedPrecondition: execution is not in a resumable state
|
|
3186
3268
|
*
|
|
3187
3269
|
* @generated from rpc tailor.v1.OperatorService.TestResumeWorkflow
|
|
3270
|
+
* @deprecated
|
|
3188
3271
|
*/
|
|
3189
3272
|
testResumeWorkflow: {
|
|
3190
3273
|
methodKind: "unary";
|
|
@@ -77,9 +77,34 @@ declare type MetricsConfig = Message<"tailor.v1.MetricsConfig"> & {
|
|
|
77
77
|
*/
|
|
78
78
|
declare type LogsConfig = Message<"tailor.v1.LogsConfig"> & {
|
|
79
79
|
/**
|
|
80
|
+
* enabled toggles the logs signal for this exporter. Function logs are the
|
|
81
|
+
* default content of the logs signal.
|
|
82
|
+
*
|
|
80
83
|
* @generated from field: bool enabled = 1;
|
|
81
84
|
*/
|
|
82
85
|
enabled: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* access_logs opts this exporter into API request access logs, an additional
|
|
88
|
+
* category of the logs signal. Subordinate to enabled: an exporter receives
|
|
89
|
+
* access logs iff OTLPExporter.enabled && logs.enabled && logs.access_logs.include.
|
|
90
|
+
*
|
|
91
|
+
* @generated from field: tailor.v1.AccessLogsConfig access_logs = 2;
|
|
92
|
+
*/
|
|
93
|
+
accessLogs?: AccessLogsConfig;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* @generated from message tailor.v1.AccessLogsConfig
|
|
97
|
+
*/
|
|
98
|
+
declare type AccessLogsConfig = Message<"tailor.v1.AccessLogsConfig"> & {
|
|
99
|
+
/**
|
|
100
|
+
* include defaults to false; API request access logs are always collected at
|
|
101
|
+
* the gateway and streamed to the router, so this flag selects whether this
|
|
102
|
+
* exporter's destination receives them. Strictly opt-in because they carry a
|
|
103
|
+
* per-request ingest cost in the customer's backend.
|
|
104
|
+
*
|
|
105
|
+
* @generated from field: bool include = 1;
|
|
106
|
+
*/
|
|
107
|
+
include: boolean;
|
|
83
108
|
};
|
|
84
109
|
/**
|
|
85
110
|
* @generated from message tailor.v1.OTLPExporterAuthConfig
|
|
@@ -179,4 +204,4 @@ declare enum OTLPExporterProtocol {
|
|
|
179
204
|
OTLP_EXPORTER_PROTOCOL_HTTP = 2
|
|
180
205
|
}
|
|
181
206
|
//#endregion
|
|
182
|
-
export { LogsConfig, MetricsConfig, OTLPExporter, OTLPExporterApiKeyAuth, OTLPExporterAuthConfig, OTLPExporterBearerTokenAuth, OTLPExporterProtocol, ResourceAttributesConfig, TracesConfig };
|
|
207
|
+
export { AccessLogsConfig, LogsConfig, MetricsConfig, OTLPExporter, OTLPExporterApiKeyAuth, OTLPExporterAuthConfig, OTLPExporterBearerTokenAuth, OTLPExporterProtocol, ResourceAttributesConfig, TracesConfig };
|
|
@@ -34,6 +34,13 @@ declare type CreateWorkflowRequest = Message<"tailor.v1.CreateWorkflowRequest">
|
|
|
34
34
|
* @generated from field: optional tailor.v1.ConcurrencyPolicy concurrency_policy = 6;
|
|
35
35
|
*/
|
|
36
36
|
concurrencyPolicy?: ConcurrencyPolicy;
|
|
37
|
+
/**
|
|
38
|
+
* Enable publishing workflow-execution events
|
|
39
|
+
* (workflow.workflow_execution.*).
|
|
40
|
+
*
|
|
41
|
+
* @generated from field: bool publish_execution_events = 7;
|
|
42
|
+
*/
|
|
43
|
+
publishExecutionEvents: boolean;
|
|
37
44
|
};
|
|
38
45
|
/**
|
|
39
46
|
* Describes the message tailor.v1.CreateWorkflowRequest.
|
|
@@ -84,6 +91,13 @@ declare type UpdateWorkflowRequest = Message<"tailor.v1.UpdateWorkflowRequest">
|
|
|
84
91
|
* @generated from field: optional tailor.v1.ConcurrencyPolicy concurrency_policy = 6;
|
|
85
92
|
*/
|
|
86
93
|
concurrencyPolicy?: ConcurrencyPolicy;
|
|
94
|
+
/**
|
|
95
|
+
* Enable publishing workflow-execution events
|
|
96
|
+
* (workflow.workflow_execution.*).
|
|
97
|
+
*
|
|
98
|
+
* @generated from field: bool publish_execution_events = 7;
|
|
99
|
+
*/
|
|
100
|
+
publishExecutionEvents: boolean;
|
|
87
101
|
};
|
|
88
102
|
/**
|
|
89
103
|
* Describes the message tailor.v1.UpdateWorkflowRequest.
|
|
@@ -265,6 +279,13 @@ declare type CreateWorkflowJobFunctionRequest = Message<"tailor.v1.CreateWorkflo
|
|
|
265
279
|
* @generated from field: optional string script_ref = 4;
|
|
266
280
|
*/
|
|
267
281
|
scriptRef?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Enable publishing job-execution events
|
|
284
|
+
* (workflow.workflow_execution.job_execution.*).
|
|
285
|
+
*
|
|
286
|
+
* @generated from field: bool publish_execution_events = 5;
|
|
287
|
+
*/
|
|
288
|
+
publishExecutionEvents: boolean;
|
|
268
289
|
};
|
|
269
290
|
/**
|
|
270
291
|
* Describes the message tailor.v1.CreateWorkflowJobFunctionRequest.
|
|
@@ -307,6 +328,13 @@ declare type UpdateWorkflowJobFunctionRequest = Message<"tailor.v1.UpdateWorkflo
|
|
|
307
328
|
* @generated from field: optional string script_ref = 4;
|
|
308
329
|
*/
|
|
309
330
|
scriptRef?: string;
|
|
331
|
+
/**
|
|
332
|
+
* Enable publishing job-execution events
|
|
333
|
+
* (workflow.workflow_execution.job_execution.*).
|
|
334
|
+
*
|
|
335
|
+
* @generated from field: bool publish_execution_events = 5;
|
|
336
|
+
*/
|
|
337
|
+
publishExecutionEvents: boolean;
|
|
310
338
|
};
|
|
311
339
|
/**
|
|
312
340
|
* Describes the message tailor.v1.UpdateWorkflowJobFunctionRequest.
|
|
@@ -633,6 +661,78 @@ declare type TestResumeWorkflowResponse = Message<"tailor.v1.TestResumeWorkflowR
|
|
|
633
661
|
* Use `create(TestResumeWorkflowResponseSchema)` to create a new message.
|
|
634
662
|
*/
|
|
635
663
|
declare const TestResumeWorkflowResponseSchema: GenMessage<TestResumeWorkflowResponse>;
|
|
664
|
+
/**
|
|
665
|
+
* @generated from message tailor.v1.StartWorkflowRequest
|
|
666
|
+
*/
|
|
667
|
+
declare type StartWorkflowRequest = Message<"tailor.v1.StartWorkflowRequest"> & {
|
|
668
|
+
/**
|
|
669
|
+
* @generated from field: string workspace_id = 1;
|
|
670
|
+
*/
|
|
671
|
+
workspaceId: string;
|
|
672
|
+
/**
|
|
673
|
+
* @generated from field: string workflow_id = 2;
|
|
674
|
+
*/
|
|
675
|
+
workflowId: string;
|
|
676
|
+
/**
|
|
677
|
+
* @generated from field: tailor.v1.AuthInvoker auth_invoker = 3;
|
|
678
|
+
*/
|
|
679
|
+
authInvoker?: AuthInvoker;
|
|
680
|
+
/**
|
|
681
|
+
* @generated from field: optional string arg = 4;
|
|
682
|
+
*/
|
|
683
|
+
arg?: string;
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Describes the message tailor.v1.StartWorkflowRequest.
|
|
687
|
+
* Use `create(StartWorkflowRequestSchema)` to create a new message.
|
|
688
|
+
*/
|
|
689
|
+
declare const StartWorkflowRequestSchema: GenMessage<StartWorkflowRequest>;
|
|
690
|
+
/**
|
|
691
|
+
* @generated from message tailor.v1.StartWorkflowResponse
|
|
692
|
+
*/
|
|
693
|
+
declare type StartWorkflowResponse = Message<"tailor.v1.StartWorkflowResponse"> & {
|
|
694
|
+
/**
|
|
695
|
+
* @generated from field: string execution_id = 1;
|
|
696
|
+
*/
|
|
697
|
+
executionId: string;
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* Describes the message tailor.v1.StartWorkflowResponse.
|
|
701
|
+
* Use `create(StartWorkflowResponseSchema)` to create a new message.
|
|
702
|
+
*/
|
|
703
|
+
declare const StartWorkflowResponseSchema: GenMessage<StartWorkflowResponse>;
|
|
704
|
+
/**
|
|
705
|
+
* @generated from message tailor.v1.ResumeWorkflowExecutionRequest
|
|
706
|
+
*/
|
|
707
|
+
declare type ResumeWorkflowExecutionRequest = Message<"tailor.v1.ResumeWorkflowExecutionRequest"> & {
|
|
708
|
+
/**
|
|
709
|
+
* @generated from field: string workspace_id = 1;
|
|
710
|
+
*/
|
|
711
|
+
workspaceId: string;
|
|
712
|
+
/**
|
|
713
|
+
* @generated from field: string execution_id = 2;
|
|
714
|
+
*/
|
|
715
|
+
executionId: string;
|
|
716
|
+
};
|
|
717
|
+
/**
|
|
718
|
+
* Describes the message tailor.v1.ResumeWorkflowExecutionRequest.
|
|
719
|
+
* Use `create(ResumeWorkflowExecutionRequestSchema)` to create a new message.
|
|
720
|
+
*/
|
|
721
|
+
declare const ResumeWorkflowExecutionRequestSchema: GenMessage<ResumeWorkflowExecutionRequest>;
|
|
722
|
+
/**
|
|
723
|
+
* @generated from message tailor.v1.ResumeWorkflowExecutionResponse
|
|
724
|
+
*/
|
|
725
|
+
declare type ResumeWorkflowExecutionResponse = Message<"tailor.v1.ResumeWorkflowExecutionResponse"> & {
|
|
726
|
+
/**
|
|
727
|
+
* @generated from field: string execution_id = 1;
|
|
728
|
+
*/
|
|
729
|
+
executionId: string;
|
|
730
|
+
};
|
|
731
|
+
/**
|
|
732
|
+
* Describes the message tailor.v1.ResumeWorkflowExecutionResponse.
|
|
733
|
+
* Use `create(ResumeWorkflowExecutionResponseSchema)` to create a new message.
|
|
734
|
+
*/
|
|
735
|
+
declare const ResumeWorkflowExecutionResponseSchema: GenMessage<ResumeWorkflowExecutionResponse>;
|
|
636
736
|
/**
|
|
637
737
|
* @generated from message tailor.v1.CreateWorkflowJobFunctionExecutionPolicyRequest
|
|
638
738
|
*/
|
|
@@ -858,4 +958,4 @@ declare type ListWorkflowJobFunctionExecutionPoliciesResponse = Message<"tailor.
|
|
|
858
958
|
*/
|
|
859
959
|
declare const ListWorkflowJobFunctionExecutionPoliciesResponseSchema: GenMessage<ListWorkflowJobFunctionExecutionPoliciesResponse>;
|
|
860
960
|
//#endregion
|
|
861
|
-
export { CreateWorkflowJobFunctionExecutionPolicyRequest, CreateWorkflowJobFunctionExecutionPolicyRequestSchema, CreateWorkflowJobFunctionExecutionPolicyResponse, CreateWorkflowJobFunctionExecutionPolicyResponseSchema, CreateWorkflowJobFunctionRequest, CreateWorkflowJobFunctionRequestSchema, CreateWorkflowJobFunctionResponse, CreateWorkflowJobFunctionResponseSchema, CreateWorkflowRequest, CreateWorkflowRequestSchema, CreateWorkflowResponse, CreateWorkflowResponseSchema, DeleteWorkflowJobFunctionExecutionPolicyRequest, DeleteWorkflowJobFunctionExecutionPolicyRequestSchema, DeleteWorkflowJobFunctionExecutionPolicyResponse, DeleteWorkflowJobFunctionExecutionPolicyResponseSchema, DeleteWorkflowJobFunctionRequest, DeleteWorkflowJobFunctionRequestSchema, DeleteWorkflowJobFunctionResponse, DeleteWorkflowJobFunctionResponseSchema, DeleteWorkflowRequest, DeleteWorkflowRequestSchema, DeleteWorkflowResponse, DeleteWorkflowResponseSchema, GetWorkflowByNameRequest, GetWorkflowByNameRequestSchema, GetWorkflowByNameResponse, GetWorkflowByNameResponseSchema, GetWorkflowExecutionRequest, GetWorkflowExecutionRequestSchema, GetWorkflowExecutionResponse, GetWorkflowExecutionResponseSchema, GetWorkflowJobFunctionByNameRequest, GetWorkflowJobFunctionByNameRequestSchema, GetWorkflowJobFunctionByNameResponse, GetWorkflowJobFunctionByNameResponseSchema, GetWorkflowJobFunctionExecutionPolicyByKeyRequest, GetWorkflowJobFunctionExecutionPolicyByKeyRequestSchema, GetWorkflowJobFunctionExecutionPolicyByKeyResponse, GetWorkflowJobFunctionExecutionPolicyByKeyResponseSchema, GetWorkflowJobFunctionExecutionPolicyRequest, GetWorkflowJobFunctionExecutionPolicyRequestSchema, GetWorkflowJobFunctionExecutionPolicyResponse, GetWorkflowJobFunctionExecutionPolicyResponseSchema, GetWorkflowJobFunctionRequest, GetWorkflowJobFunctionRequestSchema, GetWorkflowJobFunctionResponse, GetWorkflowJobFunctionResponseSchema, GetWorkflowRequest, GetWorkflowRequestSchema, GetWorkflowResponse, GetWorkflowResponseSchema, ListWorkflowExecutionsRequest, ListWorkflowExecutionsRequestSchema, ListWorkflowExecutionsResponse, ListWorkflowExecutionsResponseSchema, ListWorkflowJobFunctionExecutionPoliciesRequest, ListWorkflowJobFunctionExecutionPoliciesRequestSchema, ListWorkflowJobFunctionExecutionPoliciesResponse, ListWorkflowJobFunctionExecutionPoliciesResponseSchema, ListWorkflowJobFunctionsRequest, ListWorkflowJobFunctionsRequestSchema, ListWorkflowJobFunctionsResponse, ListWorkflowJobFunctionsResponseSchema, ListWorkflowsRequest, ListWorkflowsRequestSchema, ListWorkflowsResponse, ListWorkflowsResponseSchema, TestResumeWorkflowRequest, TestResumeWorkflowRequestSchema, TestResumeWorkflowResponse, TestResumeWorkflowResponseSchema, TestStartWorkflowRequest, TestStartWorkflowRequestSchema, TestStartWorkflowResponse, TestStartWorkflowResponseSchema, UpdateWorkflowJobFunctionExecutionPolicyRequest, UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, UpdateWorkflowJobFunctionExecutionPolicyResponse, UpdateWorkflowJobFunctionExecutionPolicyResponseSchema, UpdateWorkflowJobFunctionRequest, UpdateWorkflowJobFunctionRequestSchema, UpdateWorkflowJobFunctionResponse, UpdateWorkflowJobFunctionResponseSchema, UpdateWorkflowRequest, UpdateWorkflowRequestSchema, UpdateWorkflowResponse, UpdateWorkflowResponseSchema };
|
|
961
|
+
export { CreateWorkflowJobFunctionExecutionPolicyRequest, CreateWorkflowJobFunctionExecutionPolicyRequestSchema, CreateWorkflowJobFunctionExecutionPolicyResponse, CreateWorkflowJobFunctionExecutionPolicyResponseSchema, CreateWorkflowJobFunctionRequest, CreateWorkflowJobFunctionRequestSchema, CreateWorkflowJobFunctionResponse, CreateWorkflowJobFunctionResponseSchema, CreateWorkflowRequest, CreateWorkflowRequestSchema, CreateWorkflowResponse, CreateWorkflowResponseSchema, DeleteWorkflowJobFunctionExecutionPolicyRequest, DeleteWorkflowJobFunctionExecutionPolicyRequestSchema, DeleteWorkflowJobFunctionExecutionPolicyResponse, DeleteWorkflowJobFunctionExecutionPolicyResponseSchema, DeleteWorkflowJobFunctionRequest, DeleteWorkflowJobFunctionRequestSchema, DeleteWorkflowJobFunctionResponse, DeleteWorkflowJobFunctionResponseSchema, DeleteWorkflowRequest, DeleteWorkflowRequestSchema, DeleteWorkflowResponse, DeleteWorkflowResponseSchema, GetWorkflowByNameRequest, GetWorkflowByNameRequestSchema, GetWorkflowByNameResponse, GetWorkflowByNameResponseSchema, GetWorkflowExecutionRequest, GetWorkflowExecutionRequestSchema, GetWorkflowExecutionResponse, GetWorkflowExecutionResponseSchema, GetWorkflowJobFunctionByNameRequest, GetWorkflowJobFunctionByNameRequestSchema, GetWorkflowJobFunctionByNameResponse, GetWorkflowJobFunctionByNameResponseSchema, GetWorkflowJobFunctionExecutionPolicyByKeyRequest, GetWorkflowJobFunctionExecutionPolicyByKeyRequestSchema, GetWorkflowJobFunctionExecutionPolicyByKeyResponse, GetWorkflowJobFunctionExecutionPolicyByKeyResponseSchema, GetWorkflowJobFunctionExecutionPolicyRequest, GetWorkflowJobFunctionExecutionPolicyRequestSchema, GetWorkflowJobFunctionExecutionPolicyResponse, GetWorkflowJobFunctionExecutionPolicyResponseSchema, GetWorkflowJobFunctionRequest, GetWorkflowJobFunctionRequestSchema, GetWorkflowJobFunctionResponse, GetWorkflowJobFunctionResponseSchema, GetWorkflowRequest, GetWorkflowRequestSchema, GetWorkflowResponse, GetWorkflowResponseSchema, ListWorkflowExecutionsRequest, ListWorkflowExecutionsRequestSchema, ListWorkflowExecutionsResponse, ListWorkflowExecutionsResponseSchema, ListWorkflowJobFunctionExecutionPoliciesRequest, ListWorkflowJobFunctionExecutionPoliciesRequestSchema, ListWorkflowJobFunctionExecutionPoliciesResponse, ListWorkflowJobFunctionExecutionPoliciesResponseSchema, ListWorkflowJobFunctionsRequest, ListWorkflowJobFunctionsRequestSchema, ListWorkflowJobFunctionsResponse, ListWorkflowJobFunctionsResponseSchema, ListWorkflowsRequest, ListWorkflowsRequestSchema, ListWorkflowsResponse, ListWorkflowsResponseSchema, ResumeWorkflowExecutionRequest, ResumeWorkflowExecutionRequestSchema, ResumeWorkflowExecutionResponse, ResumeWorkflowExecutionResponseSchema, StartWorkflowRequest, StartWorkflowRequestSchema, StartWorkflowResponse, StartWorkflowResponseSchema, TestResumeWorkflowRequest, TestResumeWorkflowRequestSchema, TestResumeWorkflowResponse, TestResumeWorkflowResponseSchema, TestStartWorkflowRequest, TestStartWorkflowRequestSchema, TestStartWorkflowResponse, TestStartWorkflowResponseSchema, UpdateWorkflowJobFunctionExecutionPolicyRequest, UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, UpdateWorkflowJobFunctionExecutionPolicyResponse, UpdateWorkflowJobFunctionExecutionPolicyResponseSchema, UpdateWorkflowJobFunctionRequest, UpdateWorkflowJobFunctionRequestSchema, UpdateWorkflowJobFunctionResponse, UpdateWorkflowJobFunctionResponseSchema, UpdateWorkflowRequest, UpdateWorkflowRequestSchema, UpdateWorkflowResponse, UpdateWorkflowResponseSchema };
|
|
@@ -32,6 +32,13 @@ declare type WorkflowJobFunction = Message<"tailor.v1.WorkflowJobFunction"> & {
|
|
|
32
32
|
* @generated from field: optional string script_ref = 6;
|
|
33
33
|
*/
|
|
34
34
|
scriptRef?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Enable publishing job-execution events
|
|
37
|
+
* (workflow.workflow_execution.job_execution.*). Default false (opt-in).
|
|
38
|
+
*
|
|
39
|
+
* @generated from field: bool publish_execution_events = 7;
|
|
40
|
+
*/
|
|
41
|
+
publishExecutionEvents: boolean;
|
|
35
42
|
};
|
|
36
43
|
/**
|
|
37
44
|
* WorkflowJobFunctionSummary is the lightweight projection of WorkflowJobFunction
|
|
@@ -59,6 +66,13 @@ declare type WorkflowJobFunctionSummary = Message<"tailor.v1.WorkflowJobFunction
|
|
|
59
66
|
* @generated from field: google.protobuf.Timestamp created_at = 5;
|
|
60
67
|
*/
|
|
61
68
|
createdAt?: Timestamp;
|
|
69
|
+
/**
|
|
70
|
+
* Enable publishing job-execution events
|
|
71
|
+
* (workflow.workflow_execution.job_execution.*). Default false (opt-in).
|
|
72
|
+
*
|
|
73
|
+
* @generated from field: bool publish_execution_events = 7;
|
|
74
|
+
*/
|
|
75
|
+
publishExecutionEvents: boolean;
|
|
62
76
|
};
|
|
63
77
|
/**
|
|
64
78
|
* @generated from message tailor.v1.ConcurrencyPolicy
|
|
@@ -130,11 +144,18 @@ declare type Workflow = Message<"tailor.v1.Workflow"> & {
|
|
|
130
144
|
* @generated from field: optional tailor.v1.ConcurrencyPolicy concurrency_policy = 8;
|
|
131
145
|
*/
|
|
132
146
|
concurrencyPolicy?: ConcurrencyPolicy;
|
|
147
|
+
/**
|
|
148
|
+
* Enable publishing workflow-execution events
|
|
149
|
+
* (workflow.workflow_execution.*). Default false (opt-in).
|
|
150
|
+
*
|
|
151
|
+
* @generated from field: bool publish_execution_events = 9;
|
|
152
|
+
*/
|
|
153
|
+
publishExecutionEvents: boolean;
|
|
133
154
|
};
|
|
134
155
|
/**
|
|
135
156
|
* WorkflowJobFunctionExecutionPolicy defines a runtime concurrency limit shared by
|
|
136
157
|
* any job function invocation that specifies a matching execution_policy_key in
|
|
137
|
-
*
|
|
158
|
+
* execJobFunction(). The same key can be referenced by multiple job functions
|
|
138
159
|
* across different workflows; they all share the same concurrency pool within the workspace.
|
|
139
160
|
*
|
|
140
161
|
* @generated from message tailor.v1.WorkflowJobFunctionExecutionPolicy
|
|
@@ -55,8 +55,28 @@ type AuthAccessTokenTrigger = {
|
|
|
55
55
|
/** Auth access token event types to trigger on */
|
|
56
56
|
events: ("auth.access_token.issued" | "auth.access_token.refreshed" | "auth.access_token.revoked")[];
|
|
57
57
|
};
|
|
58
|
-
type
|
|
59
|
-
|
|
58
|
+
type WorkflowExecutionTrigger = {
|
|
59
|
+
/** Workflow execution event trigger */
|
|
60
|
+
kind: "workflowExecution";
|
|
61
|
+
/** Workflow execution event types to trigger on */
|
|
62
|
+
events: ("workflow.workflow_execution.started" | "workflow.workflow_execution.completed" | "workflow.workflow_execution.retried" | "workflow.workflow_execution.resumed" | "workflow.workflow_execution.wait_started" | "workflow.workflow_execution.wait_resolved")[];
|
|
63
|
+
/** Workflow name to subscribe to. */
|
|
64
|
+
workflowName: string;
|
|
65
|
+
/** Condition function to filter events */
|
|
66
|
+
condition?: Function | undefined;
|
|
67
|
+
};
|
|
68
|
+
type WorkflowJobExecutionTrigger = {
|
|
69
|
+
/** Workflow job execution event trigger */
|
|
70
|
+
kind: "workflowJobExecution";
|
|
71
|
+
/** Workflow job execution event types to trigger on */
|
|
72
|
+
events: ("workflow.workflow_execution.job_execution.started" | "workflow.workflow_execution.job_execution.completed" | "workflow.workflow_execution.job_execution.wait_started" | "workflow.workflow_execution.job_execution.wait_resolved")[];
|
|
73
|
+
/** Workflow name to subscribe to. */
|
|
74
|
+
workflowName: string;
|
|
75
|
+
/** Condition function to filter events */
|
|
76
|
+
condition?: Function | undefined;
|
|
77
|
+
};
|
|
78
|
+
type TriggerInput = TailorDBTrigger | ResolverExecutedTrigger | ScheduleTriggerInput | IncomingWebhookTrigger | IdpUserTrigger | AuthAccessTokenTrigger | WorkflowExecutionTrigger | WorkflowJobExecutionTrigger;
|
|
79
|
+
type Trigger = TailorDBTrigger | ResolverExecutedTrigger | ScheduleTrigger | IncomingWebhookTrigger | IdpUserTrigger | AuthAccessTokenTrigger | WorkflowExecutionTrigger | WorkflowJobExecutionTrigger;
|
|
60
80
|
type FunctionOperation = {
|
|
61
81
|
kind: "function" | "jobFunction";
|
|
62
82
|
/** Function implementation */
|
|
@@ -185,4 +205,4 @@ type Executor = {
|
|
|
185
205
|
description?: string | undefined;
|
|
186
206
|
};
|
|
187
207
|
//#endregion
|
|
188
|
-
export { AuthAccessTokenTrigger, Executor, ExecutorInput, FunctionOperation, GqlOperation, IdpUserTrigger, IncomingWebhookTrigger, IncomingWebhookTriggerResponse, ResolverExecutedTrigger, ScheduleTrigger, ScheduleTriggerInput, TailorDBTrigger, Trigger, TriggerInput, WebhookOperation, WorkflowOperation };
|
|
208
|
+
export { AuthAccessTokenTrigger, Executor, ExecutorInput, FunctionOperation, GqlOperation, IdpUserTrigger, IncomingWebhookTrigger, IncomingWebhookTriggerResponse, ResolverExecutedTrigger, ScheduleTrigger, ScheduleTriggerInput, TailorDBTrigger, Trigger, TriggerInput, WebhookOperation, WorkflowExecutionTrigger, WorkflowJobExecutionTrigger, WorkflowOperation };
|
|
@@ -41,7 +41,7 @@ function setupTailordbMock(resolver = () => []) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Sets up a mock for `globalThis.tailor.workflow.
|
|
44
|
+
* Sets up a mock for `globalThis.tailor.workflow.execJobFunction` used in bundled workflow tests.
|
|
45
45
|
* `wait`/`resolve` are stubbed to throw a helpful error directing to `mockWorkflow`,
|
|
46
46
|
* so mistakenly calling wait without wait-point mocks produces a clear message instead of a TypeError.
|
|
47
47
|
* @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.
|
|
@@ -50,6 +50,13 @@ function setupTailordbMock(resolver = () => []) {
|
|
|
50
50
|
*/
|
|
51
51
|
function setupWorkflowMock(handler) {
|
|
52
52
|
const triggeredJobs = [];
|
|
53
|
+
const execJobFunction = (jobName, args) => {
|
|
54
|
+
triggeredJobs.push({
|
|
55
|
+
jobName,
|
|
56
|
+
args
|
|
57
|
+
});
|
|
58
|
+
return handler(jobName, args);
|
|
59
|
+
};
|
|
53
60
|
GlobalThis.tailor = {
|
|
54
61
|
...GlobalThis.tailor,
|
|
55
62
|
workflow: {
|
|
@@ -60,13 +67,9 @@ function setupWorkflowMock(handler) {
|
|
|
60
67
|
throw new Error("tailor.workflow.resolve is not mocked. Use mockWorkflow from @tailor-platform/sdk/vitest in tests.");
|
|
61
68
|
},
|
|
62
69
|
...GlobalThis.tailor?.workflow,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
args
|
|
67
|
-
});
|
|
68
|
-
return handler(jobName, args);
|
|
69
|
-
}
|
|
70
|
+
execJobFunction,
|
|
71
|
+
startJobFunction: execJobFunction,
|
|
72
|
+
triggerJobFunction: execJobFunction
|
|
70
73
|
}
|
|
71
74
|
};
|
|
72
75
|
return { triggeredJobs };
|
|
@@ -107,7 +110,7 @@ function setupTailorErrorsMock() {
|
|
|
107
110
|
}
|
|
108
111
|
/**
|
|
109
112
|
* Sets up mocks for `globalThis.tailor.workflow.wait` and `.resolve` used in bundled workflow tests.
|
|
110
|
-
* `
|
|
113
|
+
* `execJobFunction` is stubbed to throw a helpful error directing to `setupWorkflowMock()`,
|
|
111
114
|
* so mistakenly triggering a job without job mocks produces a clear message instead of silently returning undefined.
|
|
112
115
|
* @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.
|
|
113
116
|
* `setWaitHandler` / `setResolveHandler` cover wait/resolve, and `waitCalls` / `resolveCalls` give the same assertion shape.
|
|
@@ -119,12 +122,15 @@ function setupTailorErrorsMock() {
|
|
|
119
122
|
function setupWaitPointMock(config) {
|
|
120
123
|
const waitCalls = [];
|
|
121
124
|
const resolveCalls = [];
|
|
125
|
+
const throwUnmocked = () => {
|
|
126
|
+
throw new Error("tailor.workflow.execJobFunction is not mocked. Use setupWorkflowMock() in tests.");
|
|
127
|
+
};
|
|
122
128
|
GlobalThis.tailor = {
|
|
123
129
|
...GlobalThis.tailor,
|
|
124
130
|
workflow: {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
execJobFunction: throwUnmocked,
|
|
132
|
+
startJobFunction: throwUnmocked,
|
|
133
|
+
triggerJobFunction: throwUnmocked,
|
|
128
134
|
...GlobalThis.tailor?.workflow,
|
|
129
135
|
wait: (key, payload) => {
|
|
130
136
|
waitCalls.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/test/mock.ts","../../../src/utils/test/index.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { ContextInvoker } from \"#/runtime/context\";\nimport type { TailorInvoker } from \"#/runtime/types\";\nimport type { TriggerJobFunctionOptions } from \"#/runtime/workflow\";\n\ntype MainFunction = (args: Record<string, unknown>) => unknown | Promise<unknown>;\ntype QueryResolver = (query: string, params: unknown[]) => unknown[];\ntype JobHandler = (jobName: string, args: unknown) => unknown;\ntype WaitHandler = (key: string, payload: unknown) => unknown;\ntype ResolveHandler = (\n executionId: string,\n key: string,\n callback: (payload: unknown) => unknown,\n) => Promise<void> | void;\n\ninterface TailordbGlobal {\n tailordb?: {\n Client: new (config: { namespace?: string }) => {\n connect(): Promise<void> | void;\n end(): Promise<void> | void;\n queryObject(\n query: string,\n params?: unknown[],\n ): Promise<{ rows: unknown[] }> | { rows: unknown[] };\n };\n };\n tailor?: {\n workflow: {\n triggerJobFunction: (\n jobName: string,\n args: unknown,\n options?: TriggerJobFunctionOptions,\n ) => unknown;\n wait?: (key: string, payload?: unknown) => unknown;\n resolve?: (\n executionId: string,\n key: string,\n callback: (payload: unknown) => unknown,\n ) => Promise<void>;\n };\n context: {\n getInvoker: () => ContextInvoker | null;\n };\n };\n}\n\ninterface TailorErrorItem {\n message: string;\n path: (string | number)[];\n}\n\ninterface TailorErrorsGlobal {\n TailorErrors?: new (errors: TailorErrorItem[]) => Error;\n}\n\nconst GlobalThis = globalThis as TailordbGlobal & TailorErrorsGlobal;\n\n/**\n * Sets up a mock for `globalThis.tailordb.Client` used in bundled resolver/executor tests.\n * @deprecated Use `mockTailordb` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.\n * @param resolver - Optional function to resolve query results. Defaults to returning empty arrays.\n * @returns Object containing arrays of executed queries and created clients for assertions.\n */\nexport function setupTailordbMock(resolver: QueryResolver = () => []): {\n executedQueries: { query: string; params: unknown[] }[];\n createdClients: { namespace?: string; ended: boolean }[];\n} {\n const executedQueries: { query: string; params: unknown[] }[] = [];\n const createdClients: { namespace?: string; ended: boolean }[] = [];\n\n class MockTailordbClient {\n private record: { namespace?: string; ended: boolean };\n\n constructor({ namespace }: { namespace?: string }) {\n this.record = { namespace, ended: false };\n createdClients.push(this.record);\n }\n\n async connect(): Promise<void> {\n /* noop */\n }\n\n async end(): Promise<void> {\n this.record.ended = true;\n }\n\n async queryObject(query: string, params: unknown[] = []): Promise<{ rows: unknown[] }> {\n executedQueries.push({ query, params });\n return { rows: resolver(query, params) };\n }\n }\n\n GlobalThis.tailordb = {\n Client: MockTailordbClient,\n } as typeof GlobalThis.tailordb;\n\n return { executedQueries, createdClients };\n}\n\n/**\n * Sets up a mock for `globalThis.tailor.workflow.triggerJobFunction` used in bundled workflow tests.\n * `wait`/`resolve` are stubbed to throw a helpful error directing to `mockWorkflow`,\n * so mistakenly calling wait without wait-point mocks produces a clear message instead of a TypeError.\n * @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.\n * @param handler - Function that handles triggered job calls and returns results.\n * @returns Object containing an array of triggered jobs for assertions.\n */\nexport function setupWorkflowMock(handler: JobHandler): {\n triggeredJobs: { jobName: string; args: unknown }[];\n} {\n const triggeredJobs: { jobName: string; args: unknown }[] = [];\n\n GlobalThis.tailor = {\n ...GlobalThis.tailor,\n workflow: {\n wait: () => {\n throw new Error(\n \"tailor.workflow.wait is not mocked. Use mockWorkflow from @tailor-platform/sdk/vitest in tests.\",\n );\n },\n resolve: async () => {\n throw new Error(\n \"tailor.workflow.resolve is not mocked. Use mockWorkflow from @tailor-platform/sdk/vitest in tests.\",\n );\n },\n ...GlobalThis.tailor?.workflow,\n triggerJobFunction: (jobName: string, args: unknown) => {\n triggeredJobs.push({ jobName, args });\n return handler(jobName, args);\n },\n },\n } as typeof GlobalThis.tailor;\n\n return { triggeredJobs };\n}\n\n/**\n * Sets up a mock for `globalThis.tailor.context.getInvoker` used in bundled\n * resolver/executor/workflow tests.\n * @deprecated With the `tailor-runtime` environment from `@tailor-platform/sdk/vitest`, drive the invoker via `vi.spyOn(globalThis.tailor.context, \"getInvoker\").mockReturnValue(...)` for bundled tests, or pass `invoker` directly to `.body()` when unit-testing resolvers/executors/workflow jobs against the TypeScript source.\n * @param invoker - The `TailorInvoker` value to return, or `null` for anonymous.\n */\nexport function setupInvokerMock(invoker: TailorInvoker): void {\n const raw: ContextInvoker | null = invoker\n ? {\n id: invoker.id,\n type: invoker.type,\n workspaceId: invoker.workspaceId,\n attributes: invoker.attributeList as string[],\n attributeMap: invoker.attributes as Record<string, unknown>,\n }\n : null;\n\n GlobalThis.tailor = {\n ...GlobalThis.tailor,\n context: {\n getInvoker: () => raw,\n },\n } as typeof GlobalThis.tailor;\n}\n\n/**\n * Sets up a mock for `globalThis.TailorErrors` used in bundled resolver tests.\n * Mimics the PF runtime's TailorErrors class that serializes errors with the `TailorErrors: ` prefix.\n * @deprecated Use the `tailor-runtime` environment from `@tailor-platform/sdk/vitest` which auto-injects TailorErrors.\n */\nexport function setupTailorErrorsMock(): void {\n GlobalThis.TailorErrors = class TailorErrors extends Error {\n errors: TailorErrorItem[];\n\n constructor(errors: TailorErrorItem[]) {\n super(`TailorErrors: ${JSON.stringify({ errors })}`);\n this.name = \"TailorErrors\";\n this.errors = errors;\n }\n };\n}\n\n/**\n * Sets up mocks for `globalThis.tailor.workflow.wait` and `.resolve` used in bundled workflow tests.\n * `triggerJobFunction` is stubbed to throw a helpful error directing to `setupWorkflowMock()`,\n * so mistakenly triggering a job without job mocks produces a clear message instead of silently returning undefined.\n * @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.\n * `setWaitHandler` / `setResolveHandler` cover wait/resolve, and `waitCalls` / `resolveCalls` give the same assertion shape.\n * @param config - Optional handlers for wait and resolve calls.\n * @param config.onWait - Handler called when wait is invoked.\n * @param config.onResolve - Handler called when resolve is invoked.\n * @returns Object containing arrays of wait and resolve calls for assertions.\n */\nexport function setupWaitPointMock(config?: { onWait?: WaitHandler; onResolve?: ResolveHandler }): {\n waitCalls: { key: string; payload: unknown }[];\n resolveCalls: { executionId: string; key: string }[];\n} {\n const waitCalls: { key: string; payload: unknown }[] = [];\n const resolveCalls: { executionId: string; key: string }[] = [];\n\n GlobalThis.tailor = {\n ...GlobalThis.tailor,\n workflow: {\n triggerJobFunction: () => {\n throw new Error(\n \"tailor.workflow.triggerJobFunction is not mocked. Use setupWorkflowMock() in tests.\",\n );\n },\n ...GlobalThis.tailor?.workflow,\n wait: (key: string, payload?: unknown) => {\n waitCalls.push({ key, payload });\n return config?.onWait?.(key, payload);\n },\n resolve: async (\n executionId: string,\n key: string,\n callback: (payload: unknown) => unknown,\n ) => {\n resolveCalls.push({ executionId, key });\n await config?.onResolve?.(executionId, key, callback);\n },\n },\n } as typeof GlobalThis.tailor;\n\n return { waitCalls, resolveCalls };\n}\n\n/**\n * Creates a function that imports a bundled JS file and returns its `main` export.\n * Used to test bundled output from `apply --buildOnly`.\n * @param baseDir - Base directory where bundled files are located.\n * @returns An async function that takes a relative path and returns the `main` function.\n * @deprecated This is an SDK-internal testing helper. Bundling integrity is the SDK's responsibility,\n * not the application's — verify your code through unit tests against the TypeScript source and\n * E2E tests against a deployed application instead. This export will be removed in a future release.\n */\nexport function createImportMain(baseDir: string): (relativePath: string) => Promise<MainFunction> {\n return async (relativePath: string): Promise<MainFunction> => {\n const fileUrl = pathToFileURL(path.join(baseDir, relativePath));\n fileUrl.searchParams.set(\"v\", `${Date.now()}-${Math.random()}`);\n const module = await import(fileUrl.href);\n const main = module.main;\n if (typeof main !== \"function\") {\n throw new Error(`Expected \"main\" to be a function in ${relativePath}, got ${typeof main}`);\n }\n return main;\n };\n}\n","import type { output, TailorUser } from \"#/configure/index\";\nimport type { TailorDBType } from \"#/configure/services/tailordb/schema\";\nimport type { TailorField } from \"#/configure/types/type\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nexport { WORKFLOW_TEST_ENV_KEY } from \"#/configure/services/workflow/job\";\nexport {\n setupTailordbMock,\n setupTailorErrorsMock,\n setupWorkflowMock,\n setupInvokerMock,\n setupWaitPointMock,\n createImportMain,\n} from \"./mock\";\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n} as const satisfies TailorUser;\n\n/**\n * Creates a hook function that processes TailorDB type fields\n * - Uses existing id from data if provided, otherwise generates UUID for id fields\n * - Recursively processes nested types\n * - Executes hooks.create for fields with create hooks\n * @template T - The output type of the hook function\n * @param type - TailorDB type definition\n * @returns A function that transforms input data according to field hooks\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createTailorDBHook<T extends TailorDBType<any, any>>(type: T) {\n return (data: unknown) => {\n return Object.entries(type.fields).reduce(\n (hooked, [key, value]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const field = value as TailorField<any, any, any>;\n if (key === \"id\") {\n // Use existing id from data if provided, otherwise generate new UUID\n const existingId =\n data && typeof data === \"object\" ? (data as Record<string, unknown>)[key] : undefined;\n hooked[key] = existingId ?? crypto.randomUUID();\n } else if (field.type === \"nested\") {\n const nestedValue =\n data && typeof data === \"object\" ? (data as Record<string, unknown>)[key] : undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nestedHook = createTailorDBHook({ fields: field.fields } as any);\n if (field.metadata.array) {\n // For nested array fields, recurse per element and pass through non-array values\n // (e.g. null/undefined for optional fields) so validation sees the original value.\n hooked[key] = Array.isArray(nestedValue)\n ? nestedValue.map((item) => nestedHook(item))\n : nestedValue;\n } else {\n hooked[key] = nestedHook(nestedValue);\n }\n } else if (field.metadata.hooks?.create) {\n hooked[key] = field.metadata.hooks.create({\n value: (data as Record<string, unknown>)[key],\n data: data,\n user: unauthenticatedTailorUser,\n });\n if (hooked[key] instanceof Date) {\n hooked[key] = hooked[key].toISOString();\n }\n } else if (data && typeof data === \"object\") {\n hooked[key] = (data as Record<string, unknown>)[key];\n }\n return hooked;\n },\n {} as Record<string, unknown>,\n ) as Partial<output<T>>;\n };\n}\n\n/**\n * Creates the standard schema definition for lines-db\n * This returns the first argument for defineSchema with the ~standard section\n * @template T - The output type after validation\n * @param schemaType - TailorDB field schema for validation\n * @param hook - Hook function to transform data before validation\n * @returns Schema object with ~standard section for defineSchema\n */\nexport function createStandardSchema<T = Record<string, unknown>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schemaType: TailorField<any, T>,\n hook: (data: unknown) => Partial<T>,\n) {\n return {\n \"~standard\": {\n version: 1,\n vendor: \"@tailor-platform/sdk\",\n validate: (value: unknown) => {\n const hooked = hook(value);\n const result = schemaType.parse({\n value: hooked,\n data: hooked,\n user: unauthenticatedTailorUser,\n });\n if (result.issues) {\n return result;\n }\n return { value: hooked as T };\n },\n },\n } as const satisfies StandardSchemaV1<T>;\n}\n"],"mappings":";;;;;AAwDA,MAAM,aAAa;;;;;;;AAQnB,SAAgB,kBAAkB,iBAAgC,CAAC,GAGjE;CACA,MAAM,kBAA0D,CAAC;CACjE,MAAM,iBAA2D,CAAC;CAElE,MAAM,mBAAmB;EACvB,AAAQ;EAER,YAAY,EAAE,aAAqC;GACjD,KAAK,SAAS;IAAE;IAAW,OAAO;GAAM;GACxC,eAAe,KAAK,KAAK,MAAM;EACjC;EAEA,MAAM,UAAyB,CAE/B;EAEA,MAAM,MAAqB;GACzB,KAAK,OAAO,QAAQ;EACtB;EAEA,MAAM,YAAY,OAAe,SAAoB,CAAC,GAAiC;GACrF,gBAAgB,KAAK;IAAE;IAAO;GAAO,CAAC;GACtC,OAAO,EAAE,MAAM,SAAS,OAAO,MAAM,EAAE;EACzC;CACF;CAEA,WAAW,WAAW,EACpB,QAAQ,mBACV;CAEA,OAAO;EAAE;EAAiB;CAAe;AAC3C;;;;;;;;;AAUA,SAAgB,kBAAkB,SAEhC;CACA,MAAM,gBAAsD,CAAC;CAE7D,WAAW,SAAS;EAClB,GAAG,WAAW;EACd,UAAU;GACR,YAAY;IACV,MAAM,IAAI,MACR,iGACF;GACF;GACA,SAAS,YAAY;IACnB,MAAM,IAAI,MACR,oGACF;GACF;GACA,GAAG,WAAW,QAAQ;GACtB,qBAAqB,SAAiB,SAAkB;IACtD,cAAc,KAAK;KAAE;KAAS;IAAK,CAAC;IACpC,OAAO,QAAQ,SAAS,IAAI;GAC9B;EACF;CACF;CAEA,OAAO,EAAE,cAAc;AACzB;;;;;;;AAQA,SAAgB,iBAAiB,SAA8B;CAC7D,MAAM,MAA6B,UAC/B;EACE,IAAI,QAAQ;EACZ,MAAM,QAAQ;EACd,aAAa,QAAQ;EACrB,YAAY,QAAQ;EACpB,cAAc,QAAQ;CACxB,IACA;CAEJ,WAAW,SAAS;EAClB,GAAG,WAAW;EACd,SAAS,EACP,kBAAkB,IACpB;CACF;AACF;;;;;;AAOA,SAAgB,wBAA8B;CAC5C,WAAW,eAAe,MAAM,qBAAqB,MAAM;EACzD;EAEA,YAAY,QAA2B;GACrC,MAAM,iBAAiB,KAAK,UAAU,EAAE,OAAO,CAAC,GAAG;GACnD,KAAK,OAAO;GACZ,KAAK,SAAS;EAChB;CACF;AACF;;;;;;;;;;;;AAaA,SAAgB,mBAAmB,QAGjC;CACA,MAAM,YAAiD,CAAC;CACxD,MAAM,eAAuD,CAAC;CAE9D,WAAW,SAAS;EAClB,GAAG,WAAW;EACd,UAAU;GACR,0BAA0B;IACxB,MAAM,IAAI,MACR,qFACF;GACF;GACA,GAAG,WAAW,QAAQ;GACtB,OAAO,KAAa,YAAsB;IACxC,UAAU,KAAK;KAAE;KAAK;IAAQ,CAAC;IAC/B,OAAO,QAAQ,SAAS,KAAK,OAAO;GACtC;GACA,SAAS,OACP,aACA,KACA,aACG;IACH,aAAa,KAAK;KAAE;KAAa;IAAI,CAAC;IACtC,MAAM,QAAQ,YAAY,aAAa,KAAK,QAAQ;GACtD;EACF;CACF;CAEA,OAAO;EAAE;EAAW;CAAa;AACnC;;;;;;;;;;AAWA,SAAgB,iBAAiB,SAAkE;CACjG,OAAO,OAAO,iBAAgD;EAC5D,MAAM,UAAU,cAAc,KAAK,KAAK,SAAS,YAAY,CAAC;EAC9D,QAAQ,aAAa,IAAI,KAAK,GAAG,KAAK,IAAI,EAAE,GAAG,KAAK,OAAO,GAAG;EAE9D,MAAM,QAAO,MADQ,OAAO,QAAQ,MACjB,CAAC;EACpB,IAAI,OAAO,SAAS,YAClB,MAAM,IAAI,MAAM,uCAAuC,aAAa,QAAQ,OAAO,MAAM;EAE3F,OAAO;CACT;AACF;;;;;ACpOA,MAAa,4BAA4B;CACvC,IAAI;CACJ,MAAM;CACN,aAAa;CACb,YAAY;CACZ,eAAe,CAAC;AAClB;;;;;;;;;;AAYA,SAAgB,mBAAqD,MAAS;CAC5E,QAAQ,SAAkB;EACxB,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,CAAC,QAChC,QAAQ,CAAC,KAAK,WAAW;GAExB,MAAM,QAAQ;GACd,IAAI,QAAQ,MAIV,OAAO,QADL,QAAQ,OAAO,SAAS,WAAY,KAAiC,OAAO,WAClD,OAAO,WAAW;QACzC,IAAI,MAAM,SAAS,UAAU;IAClC,MAAM,cACJ,QAAQ,OAAO,SAAS,WAAY,KAAiC,OAAO;IAE9E,MAAM,aAAa,mBAAmB,EAAE,QAAQ,MAAM,OAAO,CAAQ;IACrE,IAAI,MAAM,SAAS,OAGjB,OAAO,OAAO,MAAM,QAAQ,WAAW,IACnC,YAAY,KAAK,SAAS,WAAW,IAAI,CAAC,IAC1C;SAEJ,OAAO,OAAO,WAAW,WAAW;GAExC,OAAO,IAAI,MAAM,SAAS,OAAO,QAAQ;IACvC,OAAO,OAAO,MAAM,SAAS,MAAM,OAAO;KACxC,OAAQ,KAAiC;KACnC;KACN,MAAM;IACR,CAAC;IACD,IAAI,OAAO,gBAAgB,MACzB,OAAO,OAAO,OAAO,IAAI,CAAC,YAAY;GAE1C,OAAO,IAAI,QAAQ,OAAO,SAAS,UACjC,OAAO,OAAQ,KAAiC;GAElD,OAAO;EACT,GACA,CAAC,CACH;CACF;AACF;;;;;;;;;AAUA,SAAgB,qBAEd,YACA,MACA;CACA,OAAO,EACL,aAAa;EACX,SAAS;EACT,QAAQ;EACR,WAAW,UAAmB;GAC5B,MAAM,SAAS,KAAK,KAAK;GACzB,MAAM,SAAS,WAAW,MAAM;IAC9B,OAAO;IACP,MAAM;IACN,MAAM;GACR,CAAC;GACD,IAAI,OAAO,QACT,OAAO;GAET,OAAO,EAAE,OAAO,OAAY;EAC9B;CACF,EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/test/mock.ts","../../../src/utils/test/index.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { ContextInvoker } from \"#/runtime/context\";\nimport type { TailorInvoker } from \"#/runtime/types\";\nimport type { ExecJobFunctionOptions } from \"#/runtime/workflow\";\n\ntype MainFunction = (args: Record<string, unknown>) => unknown | Promise<unknown>;\ntype QueryResolver = (query: string, params: unknown[]) => unknown[];\ntype JobHandler = (jobName: string, args: unknown) => unknown;\ntype WaitHandler = (key: string, payload: unknown) => unknown;\ntype ResolveHandler = (\n executionId: string,\n key: string,\n callback: (payload: unknown) => unknown,\n) => Promise<void> | void;\n\ninterface TailordbGlobal {\n tailordb?: {\n Client: new (config: { namespace?: string }) => {\n connect(): Promise<void> | void;\n end(): Promise<void> | void;\n queryObject(\n query: string,\n params?: unknown[],\n ): Promise<{ rows: unknown[] }> | { rows: unknown[] };\n };\n };\n tailor?: {\n workflow: {\n execJobFunction: (\n jobName: string,\n args: unknown,\n options?: ExecJobFunctionOptions,\n ) => unknown;\n startJobFunction: (\n jobName: string,\n args: unknown,\n options?: ExecJobFunctionOptions,\n ) => unknown;\n triggerJobFunction: (\n jobName: string,\n args: unknown,\n options?: ExecJobFunctionOptions,\n ) => unknown;\n wait?: (key: string, payload?: unknown) => unknown;\n resolve?: (\n executionId: string,\n key: string,\n callback: (payload: unknown) => unknown,\n ) => Promise<void>;\n };\n context: {\n getInvoker: () => ContextInvoker | null;\n };\n };\n}\n\ninterface TailorErrorItem {\n message: string;\n path: (string | number)[];\n}\n\ninterface TailorErrorsGlobal {\n TailorErrors?: new (errors: TailorErrorItem[]) => Error;\n}\n\nconst GlobalThis = globalThis as TailordbGlobal & TailorErrorsGlobal;\n\n/**\n * Sets up a mock for `globalThis.tailordb.Client` used in bundled resolver/executor tests.\n * @deprecated Use `mockTailordb` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.\n * @param resolver - Optional function to resolve query results. Defaults to returning empty arrays.\n * @returns Object containing arrays of executed queries and created clients for assertions.\n */\nexport function setupTailordbMock(resolver: QueryResolver = () => []): {\n executedQueries: { query: string; params: unknown[] }[];\n createdClients: { namespace?: string; ended: boolean }[];\n} {\n const executedQueries: { query: string; params: unknown[] }[] = [];\n const createdClients: { namespace?: string; ended: boolean }[] = [];\n\n class MockTailordbClient {\n private record: { namespace?: string; ended: boolean };\n\n constructor({ namespace }: { namespace?: string }) {\n this.record = { namespace, ended: false };\n createdClients.push(this.record);\n }\n\n async connect(): Promise<void> {\n /* noop */\n }\n\n async end(): Promise<void> {\n this.record.ended = true;\n }\n\n async queryObject(query: string, params: unknown[] = []): Promise<{ rows: unknown[] }> {\n executedQueries.push({ query, params });\n return { rows: resolver(query, params) };\n }\n }\n\n GlobalThis.tailordb = {\n Client: MockTailordbClient,\n } as typeof GlobalThis.tailordb;\n\n return { executedQueries, createdClients };\n}\n\n/**\n * Sets up a mock for `globalThis.tailor.workflow.execJobFunction` used in bundled workflow tests.\n * `wait`/`resolve` are stubbed to throw a helpful error directing to `mockWorkflow`,\n * so mistakenly calling wait without wait-point mocks produces a clear message instead of a TypeError.\n * @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.\n * @param handler - Function that handles triggered job calls and returns results.\n * @returns Object containing an array of triggered jobs for assertions.\n */\nexport function setupWorkflowMock(handler: JobHandler): {\n triggeredJobs: { jobName: string; args: unknown }[];\n} {\n const triggeredJobs: { jobName: string; args: unknown }[] = [];\n\n const execJobFunction = (jobName: string, args: unknown): unknown => {\n triggeredJobs.push({ jobName, args });\n return handler(jobName, args);\n };\n\n GlobalThis.tailor = {\n ...GlobalThis.tailor,\n workflow: {\n wait: () => {\n throw new Error(\n \"tailor.workflow.wait is not mocked. Use mockWorkflow from @tailor-platform/sdk/vitest in tests.\",\n );\n },\n resolve: async () => {\n throw new Error(\n \"tailor.workflow.resolve is not mocked. Use mockWorkflow from @tailor-platform/sdk/vitest in tests.\",\n );\n },\n ...GlobalThis.tailor?.workflow,\n execJobFunction,\n startJobFunction: execJobFunction,\n triggerJobFunction: execJobFunction,\n },\n } as typeof GlobalThis.tailor;\n\n return { triggeredJobs };\n}\n\n/**\n * Sets up a mock for `globalThis.tailor.context.getInvoker` used in bundled\n * resolver/executor/workflow tests.\n * @deprecated With the `tailor-runtime` environment from `@tailor-platform/sdk/vitest`, drive the invoker via `vi.spyOn(globalThis.tailor.context, \"getInvoker\").mockReturnValue(...)` for bundled tests, or pass `invoker` directly to `.body()` when unit-testing resolvers/executors/workflow jobs against the TypeScript source.\n * @param invoker - The `TailorInvoker` value to return, or `null` for anonymous.\n */\nexport function setupInvokerMock(invoker: TailorInvoker): void {\n const raw: ContextInvoker | null = invoker\n ? {\n id: invoker.id,\n type: invoker.type,\n workspaceId: invoker.workspaceId,\n attributes: invoker.attributeList as string[],\n attributeMap: invoker.attributes as Record<string, unknown>,\n }\n : null;\n\n GlobalThis.tailor = {\n ...GlobalThis.tailor,\n context: {\n getInvoker: () => raw,\n },\n } as typeof GlobalThis.tailor;\n}\n\n/**\n * Sets up a mock for `globalThis.TailorErrors` used in bundled resolver tests.\n * Mimics the PF runtime's TailorErrors class that serializes errors with the `TailorErrors: ` prefix.\n * @deprecated Use the `tailor-runtime` environment from `@tailor-platform/sdk/vitest` which auto-injects TailorErrors.\n */\nexport function setupTailorErrorsMock(): void {\n GlobalThis.TailorErrors = class TailorErrors extends Error {\n errors: TailorErrorItem[];\n\n constructor(errors: TailorErrorItem[]) {\n super(`TailorErrors: ${JSON.stringify({ errors })}`);\n this.name = \"TailorErrors\";\n this.errors = errors;\n }\n };\n}\n\n/**\n * Sets up mocks for `globalThis.tailor.workflow.wait` and `.resolve` used in bundled workflow tests.\n * `execJobFunction` is stubbed to throw a helpful error directing to `setupWorkflowMock()`,\n * so mistakenly triggering a job without job mocks produces a clear message instead of silently returning undefined.\n * @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.\n * `setWaitHandler` / `setResolveHandler` cover wait/resolve, and `waitCalls` / `resolveCalls` give the same assertion shape.\n * @param config - Optional handlers for wait and resolve calls.\n * @param config.onWait - Handler called when wait is invoked.\n * @param config.onResolve - Handler called when resolve is invoked.\n * @returns Object containing arrays of wait and resolve calls for assertions.\n */\nexport function setupWaitPointMock(config?: { onWait?: WaitHandler; onResolve?: ResolveHandler }): {\n waitCalls: { key: string; payload: unknown }[];\n resolveCalls: { executionId: string; key: string }[];\n} {\n const waitCalls: { key: string; payload: unknown }[] = [];\n const resolveCalls: { executionId: string; key: string }[] = [];\n\n const throwUnmocked = (): never => {\n throw new Error(\n \"tailor.workflow.execJobFunction is not mocked. Use setupWorkflowMock() in tests.\",\n );\n };\n\n GlobalThis.tailor = {\n ...GlobalThis.tailor,\n workflow: {\n execJobFunction: throwUnmocked,\n startJobFunction: throwUnmocked,\n triggerJobFunction: throwUnmocked,\n ...GlobalThis.tailor?.workflow,\n wait: (key: string, payload?: unknown) => {\n waitCalls.push({ key, payload });\n return config?.onWait?.(key, payload);\n },\n resolve: async (\n executionId: string,\n key: string,\n callback: (payload: unknown) => unknown,\n ) => {\n resolveCalls.push({ executionId, key });\n await config?.onResolve?.(executionId, key, callback);\n },\n },\n } as typeof GlobalThis.tailor;\n\n return { waitCalls, resolveCalls };\n}\n\n/**\n * Creates a function that imports a bundled JS file and returns its `main` export.\n * Used to test bundled output from `apply --buildOnly`.\n * @param baseDir - Base directory where bundled files are located.\n * @returns An async function that takes a relative path and returns the `main` function.\n * @deprecated This is an SDK-internal testing helper. Bundling integrity is the SDK's responsibility,\n * not the application's — verify your code through unit tests against the TypeScript source and\n * E2E tests against a deployed application instead. This export will be removed in a future release.\n */\nexport function createImportMain(baseDir: string): (relativePath: string) => Promise<MainFunction> {\n return async (relativePath: string): Promise<MainFunction> => {\n const fileUrl = pathToFileURL(path.join(baseDir, relativePath));\n fileUrl.searchParams.set(\"v\", `${Date.now()}-${Math.random()}`);\n const module = await import(fileUrl.href);\n const main = module.main;\n if (typeof main !== \"function\") {\n throw new Error(`Expected \"main\" to be a function in ${relativePath}, got ${typeof main}`);\n }\n return main;\n };\n}\n","import type { output, TailorUser } from \"#/configure/index\";\nimport type { TailorDBType } from \"#/configure/services/tailordb/schema\";\nimport type { TailorField } from \"#/configure/types/type\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nexport { WORKFLOW_TEST_ENV_KEY } from \"#/configure/services/workflow/job\";\nexport {\n setupTailordbMock,\n setupTailorErrorsMock,\n setupWorkflowMock,\n setupInvokerMock,\n setupWaitPointMock,\n createImportMain,\n} from \"./mock\";\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n} as const satisfies TailorUser;\n\n/**\n * Creates a hook function that processes TailorDB type fields\n * - Uses existing id from data if provided, otherwise generates UUID for id fields\n * - Recursively processes nested types\n * - Executes hooks.create for fields with create hooks\n * @template T - The output type of the hook function\n * @param type - TailorDB type definition\n * @returns A function that transforms input data according to field hooks\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createTailorDBHook<T extends TailorDBType<any, any>>(type: T) {\n return (data: unknown) => {\n return Object.entries(type.fields).reduce(\n (hooked, [key, value]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const field = value as TailorField<any, any, any>;\n if (key === \"id\") {\n // Use existing id from data if provided, otherwise generate new UUID\n const existingId =\n data && typeof data === \"object\" ? (data as Record<string, unknown>)[key] : undefined;\n hooked[key] = existingId ?? crypto.randomUUID();\n } else if (field.type === \"nested\") {\n const nestedValue =\n data && typeof data === \"object\" ? (data as Record<string, unknown>)[key] : undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nestedHook = createTailorDBHook({ fields: field.fields } as any);\n if (field.metadata.array) {\n // For nested array fields, recurse per element and pass through non-array values\n // (e.g. null/undefined for optional fields) so validation sees the original value.\n hooked[key] = Array.isArray(nestedValue)\n ? nestedValue.map((item) => nestedHook(item))\n : nestedValue;\n } else {\n hooked[key] = nestedHook(nestedValue);\n }\n } else if (field.metadata.hooks?.create) {\n hooked[key] = field.metadata.hooks.create({\n value: (data as Record<string, unknown>)[key],\n data: data,\n user: unauthenticatedTailorUser,\n });\n if (hooked[key] instanceof Date) {\n hooked[key] = hooked[key].toISOString();\n }\n } else if (data && typeof data === \"object\") {\n hooked[key] = (data as Record<string, unknown>)[key];\n }\n return hooked;\n },\n {} as Record<string, unknown>,\n ) as Partial<output<T>>;\n };\n}\n\n/**\n * Creates the standard schema definition for lines-db\n * This returns the first argument for defineSchema with the ~standard section\n * @template T - The output type after validation\n * @param schemaType - TailorDB field schema for validation\n * @param hook - Hook function to transform data before validation\n * @returns Schema object with ~standard section for defineSchema\n */\nexport function createStandardSchema<T = Record<string, unknown>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schemaType: TailorField<any, T>,\n hook: (data: unknown) => Partial<T>,\n) {\n return {\n \"~standard\": {\n version: 1,\n vendor: \"@tailor-platform/sdk\",\n validate: (value: unknown) => {\n const hooked = hook(value);\n const result = schemaType.parse({\n value: hooked,\n data: hooked,\n user: unauthenticatedTailorUser,\n });\n if (result.issues) {\n return result;\n }\n return { value: hooked as T };\n },\n },\n } as const satisfies StandardSchemaV1<T>;\n}\n"],"mappings":";;;;;AAkEA,MAAM,aAAa;;;;;;;AAQnB,SAAgB,kBAAkB,iBAAgC,CAAC,GAGjE;CACA,MAAM,kBAA0D,CAAC;CACjE,MAAM,iBAA2D,CAAC;CAElE,MAAM,mBAAmB;EACvB,AAAQ;EAER,YAAY,EAAE,aAAqC;GACjD,KAAK,SAAS;IAAE;IAAW,OAAO;GAAM;GACxC,eAAe,KAAK,KAAK,MAAM;EACjC;EAEA,MAAM,UAAyB,CAE/B;EAEA,MAAM,MAAqB;GACzB,KAAK,OAAO,QAAQ;EACtB;EAEA,MAAM,YAAY,OAAe,SAAoB,CAAC,GAAiC;GACrF,gBAAgB,KAAK;IAAE;IAAO;GAAO,CAAC;GACtC,OAAO,EAAE,MAAM,SAAS,OAAO,MAAM,EAAE;EACzC;CACF;CAEA,WAAW,WAAW,EACpB,QAAQ,mBACV;CAEA,OAAO;EAAE;EAAiB;CAAe;AAC3C;;;;;;;;;AAUA,SAAgB,kBAAkB,SAEhC;CACA,MAAM,gBAAsD,CAAC;CAE7D,MAAM,mBAAmB,SAAiB,SAA2B;EACnE,cAAc,KAAK;GAAE;GAAS;EAAK,CAAC;EACpC,OAAO,QAAQ,SAAS,IAAI;CAC9B;CAEA,WAAW,SAAS;EAClB,GAAG,WAAW;EACd,UAAU;GACR,YAAY;IACV,MAAM,IAAI,MACR,iGACF;GACF;GACA,SAAS,YAAY;IACnB,MAAM,IAAI,MACR,oGACF;GACF;GACA,GAAG,WAAW,QAAQ;GACtB;GACA,kBAAkB;GAClB,oBAAoB;EACtB;CACF;CAEA,OAAO,EAAE,cAAc;AACzB;;;;;;;AAQA,SAAgB,iBAAiB,SAA8B;CAC7D,MAAM,MAA6B,UAC/B;EACE,IAAI,QAAQ;EACZ,MAAM,QAAQ;EACd,aAAa,QAAQ;EACrB,YAAY,QAAQ;EACpB,cAAc,QAAQ;CACxB,IACA;CAEJ,WAAW,SAAS;EAClB,GAAG,WAAW;EACd,SAAS,EACP,kBAAkB,IACpB;CACF;AACF;;;;;;AAOA,SAAgB,wBAA8B;CAC5C,WAAW,eAAe,MAAM,qBAAqB,MAAM;EACzD;EAEA,YAAY,QAA2B;GACrC,MAAM,iBAAiB,KAAK,UAAU,EAAE,OAAO,CAAC,GAAG;GACnD,KAAK,OAAO;GACZ,KAAK,SAAS;EAChB;CACF;AACF;;;;;;;;;;;;AAaA,SAAgB,mBAAmB,QAGjC;CACA,MAAM,YAAiD,CAAC;CACxD,MAAM,eAAuD,CAAC;CAE9D,MAAM,sBAA6B;EACjC,MAAM,IAAI,MACR,kFACF;CACF;CAEA,WAAW,SAAS;EAClB,GAAG,WAAW;EACd,UAAU;GACR,iBAAiB;GACjB,kBAAkB;GAClB,oBAAoB;GACpB,GAAG,WAAW,QAAQ;GACtB,OAAO,KAAa,YAAsB;IACxC,UAAU,KAAK;KAAE;KAAK;IAAQ,CAAC;IAC/B,OAAO,QAAQ,SAAS,KAAK,OAAO;GACtC;GACA,SAAS,OACP,aACA,KACA,aACG;IACH,aAAa,KAAK;KAAE;KAAa;IAAI,CAAC;IACtC,MAAM,QAAQ,YAAY,aAAa,KAAK,QAAQ;GACtD;EACF;CACF;CAEA,OAAO;EAAE;EAAW;CAAa;AACnC;;;;;;;;;;AAWA,SAAgB,iBAAiB,SAAkE;CACjG,OAAO,OAAO,iBAAgD;EAC5D,MAAM,UAAU,cAAc,KAAK,KAAK,SAAS,YAAY,CAAC;EAC9D,QAAQ,aAAa,IAAI,KAAK,GAAG,KAAK,IAAI,EAAE,GAAG,KAAK,OAAO,GAAG;EAE9D,MAAM,QAAO,MADQ,OAAO,QAAQ,MACjB,CAAC;EACpB,IAAI,OAAO,SAAS,YAClB,MAAM,IAAI,MAAM,uCAAuC,aAAa,QAAQ,OAAO,MAAM;EAE3F,OAAO;CACT;AACF;;;;;ACtPA,MAAa,4BAA4B;CACvC,IAAI;CACJ,MAAM;CACN,aAAa;CACb,YAAY;CACZ,eAAe,CAAC;AAClB;;;;;;;;;;AAYA,SAAgB,mBAAqD,MAAS;CAC5E,QAAQ,SAAkB;EACxB,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,CAAC,QAChC,QAAQ,CAAC,KAAK,WAAW;GAExB,MAAM,QAAQ;GACd,IAAI,QAAQ,MAIV,OAAO,QADL,QAAQ,OAAO,SAAS,WAAY,KAAiC,OAAO,WAClD,OAAO,WAAW;QACzC,IAAI,MAAM,SAAS,UAAU;IAClC,MAAM,cACJ,QAAQ,OAAO,SAAS,WAAY,KAAiC,OAAO;IAE9E,MAAM,aAAa,mBAAmB,EAAE,QAAQ,MAAM,OAAO,CAAQ;IACrE,IAAI,MAAM,SAAS,OAGjB,OAAO,OAAO,MAAM,QAAQ,WAAW,IACnC,YAAY,KAAK,SAAS,WAAW,IAAI,CAAC,IAC1C;SAEJ,OAAO,OAAO,WAAW,WAAW;GAExC,OAAO,IAAI,MAAM,SAAS,OAAO,QAAQ;IACvC,OAAO,OAAO,MAAM,SAAS,MAAM,OAAO;KACxC,OAAQ,KAAiC;KACnC;KACN,MAAM;IACR,CAAC;IACD,IAAI,OAAO,gBAAgB,MACzB,OAAO,OAAO,OAAO,IAAI,CAAC,YAAY;GAE1C,OAAO,IAAI,QAAQ,OAAO,SAAS,UACjC,OAAO,OAAQ,KAAiC;GAElD,OAAO;EACT,GACA,CAAC,CACH;CACF;AACF;;;;;;;;;AAUA,SAAgB,qBAEd,YACA,MACA;CACA,OAAO,EACL,aAAa;EACX,SAAS;EACT,QAAQ;EACR,WAAW,UAAmB;GAC5B,MAAM,SAAS,KAAK,KAAK;GACzB,MAAM,SAAS,WAAW,MAAM;IAC9B,OAAO;IACP,MAAM;IACN,MAAM;GACR,CAAC;GACD,IAAI,OAAO,QACT,OAAO;GAET,OAAO,EAAE,OAAO,OAAY;EAC9B;CACF,EACF;AACF"}
|
|
@@ -22,7 +22,7 @@ declare function setupTailordbMock(resolver?: QueryResolver): {
|
|
|
22
22
|
}[];
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* Sets up a mock for `globalThis.tailor.workflow.
|
|
25
|
+
* Sets up a mock for `globalThis.tailor.workflow.execJobFunction` used in bundled workflow tests.
|
|
26
26
|
* `wait`/`resolve` are stubbed to throw a helpful error directing to `mockWorkflow`,
|
|
27
27
|
* so mistakenly calling wait without wait-point mocks produces a clear message instead of a TypeError.
|
|
28
28
|
* @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.
|
|
@@ -50,7 +50,7 @@ declare function setupInvokerMock(invoker: TailorInvoker): void;
|
|
|
50
50
|
declare function setupTailorErrorsMock(): void;
|
|
51
51
|
/**
|
|
52
52
|
* Sets up mocks for `globalThis.tailor.workflow.wait` and `.resolve` used in bundled workflow tests.
|
|
53
|
-
* `
|
|
53
|
+
* `execJobFunction` is stubbed to throw a helpful error directing to `setupWorkflowMock()`,
|
|
54
54
|
* so mistakenly triggering a job without job mocks produces a clear message instead of silently returning undefined.
|
|
55
55
|
* @deprecated Use `mockWorkflow` from `@tailor-platform/sdk/vitest` with the `tailor-runtime` environment instead.
|
|
56
56
|
* `setWaitHandler` / `setResolveHandler` cover wait/resolve, and `waitCalls` / `resolveCalls` give the same assertion shape.
|