@tailor-platform/sdk 2.23.0 → 2.25.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 +89 -0
- package/dist/application-ChqHuhZW.mjs +1 -0
- package/dist/application-DS0XKBtK.mjs +200 -0
- package/dist/application-DS0XKBtK.mjs.map +1 -0
- package/dist/cli/cache/bundle-cache.d.mts +1 -0
- package/dist/cli/commands/deploy/deployment-target.d.mts +1 -0
- package/dist/cli/commands/machineuser/list.d.mts +1 -0
- package/dist/cli/commands/show.d.mts +13 -1
- package/dist/cli/lib.d.mts +2 -2
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +43 -43
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/services/application.d.mts +1 -0
- package/dist/cli/services/workflow/bundler.d.mts +2 -1
- package/dist/cli/shared/forbidden-runtime-globals.d.mts +1 -0
- package/dist/cli/shared/start-context.d.mts +1 -0
- package/dist/cli/ts-hook.mjs +3 -3
- package/dist/completion/zsh-worker.zsh +3 -3
- package/dist/configure/config/types.d.mts +42 -2
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +1 -1
- package/dist/configure/index.mjs.map +1 -1
- package/dist/plugin/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +97 -0
- package/dist/register-ts-hook-DPAW0Z4M.mjs +924 -0
- package/dist/register-ts-hook-DPAW0Z4M.mjs.map +1 -0
- package/dist/vitest/mocks/file.d.mts +1 -1
- package/docs/cli/application.md +23 -0
- package/docs/cli/secret.md +24 -16
- package/docs/cli-reference.md +25 -13
- package/docs/configuration.md +28 -3
- package/docs/github-actions.md +236 -56
- package/docs/migration/v3.md +46 -0
- package/docs/multi-environment.md +3 -1
- package/docs/plugin/custom.md +76 -1
- package/docs/plugin/frontend.md +124 -0
- package/docs/plugin/index.md +24 -2
- package/docs/services/auth.md +2 -0
- package/docs/services/secret.md +5 -4
- package/docs/services/staticwebsite.md +2 -0
- package/docs/services/tailordb-migration.md +1 -1
- package/docs/services/workflow.md +3 -0
- package/package.json +8 -8
- package/dist/application-BtZ8hmx9.mjs +0 -1
- package/dist/application-m2G91kKI.mjs +0 -199
- package/dist/application-m2G91kKI.mjs.map +0 -1
- package/dist/register-ts-hook-ztnEFW6n.mjs +0 -922
- package/dist/register-ts-hook-ztnEFW6n.mjs.map +0 -1
|
@@ -8,6 +8,7 @@ import "../shared/tsconfig-paths-plugin.mjs";
|
|
|
8
8
|
import "./http-adapter/bundler.mjs";
|
|
9
9
|
import "./http-adapter/service.mjs";
|
|
10
10
|
import "./resolver/service.mjs";
|
|
11
|
+
import "../shared/start-context.mjs";
|
|
11
12
|
import "./workflow/bundler.mjs";
|
|
12
13
|
import "./workflow/service.mjs";
|
|
13
14
|
import "../shared/client.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../configure/config/types.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./tsconfig-paths-plugin.mjs";
|
package/dist/cli/ts-hook.mjs
CHANGED
|
@@ -43,7 +43,7 @@ function resolveEffectiveConfig(configFilePath, content, visited) {
|
|
|
43
43
|
const base = resolvePath(baseDir, extendsField);
|
|
44
44
|
const extendsPath = base.endsWith(".json") ? base : base + ".json";
|
|
45
45
|
try {
|
|
46
|
-
const sub = JSON.parse(readFileSync(extendsPath, "utf-8"));
|
|
46
|
+
const sub = JSON.parse(readFileSync(extendsPath, { encoding: "utf-8" }));
|
|
47
47
|
inherited = resolveEffectiveConfig(extendsPath, sub, visited);
|
|
48
48
|
} catch (e) {
|
|
49
49
|
if (e?.code !== "ENOENT" && !(e instanceof SyntaxError)) throw e;
|
|
@@ -92,7 +92,7 @@ function loadTsconfigPaths(startDir, cacheGeneration) {
|
|
|
92
92
|
while (dir !== prev) {
|
|
93
93
|
try {
|
|
94
94
|
const configFilePath = join(dir, "tsconfig.json");
|
|
95
|
-
const content = JSON.parse(readFileSync(configFilePath, "utf-8"));
|
|
95
|
+
const content = JSON.parse(readFileSync(configFilePath, { encoding: "utf-8" }));
|
|
96
96
|
collectPathsInto(paths, configFilePath, content, new Set());
|
|
97
97
|
break;
|
|
98
98
|
} catch (e) {
|
|
@@ -371,7 +371,7 @@ export function loadSync(url, context, nextLoad) {
|
|
|
371
371
|
parsedUrl.search = "";
|
|
372
372
|
parsedUrl.hash = "";
|
|
373
373
|
const filePath = fileURLToPath(parsedUrl);
|
|
374
|
-
const source = readFileSync(filePath, "utf-8");
|
|
374
|
+
const source = readFileSync(filePath, { encoding: "utf-8" });
|
|
375
375
|
const { code } = transformSync(source, { mode: "transform", filename: filePath });
|
|
376
376
|
return { format: "module", shortCircuit: true, source: `${code}\n//# sourceURL=${url}` };
|
|
377
377
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# politty-completion-version: 1
|
|
2
|
-
# politty-bin-sig:
|
|
2
|
+
# politty-bin-sig: 1791177533
|
|
3
3
|
# politty-bin-path: /home/runner/work/sdk/sdk/node_modules/.bin/tailor
|
|
4
4
|
# program: tailor
|
|
5
5
|
# shell: zsh
|
|
@@ -2887,7 +2887,7 @@ __tailor_worker_complete_secret_create() {
|
|
|
2887
2887
|
__tailor_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
|
|
2888
2888
|
__tailor_worker_not_used "--vault-name" "--vaultName" "-V" "--V" && _opts+=("--vault-name:Vault name")
|
|
2889
2889
|
__tailor_worker_not_used "--name" "-n" "--n" && _opts+=("--name:Secret name")
|
|
2890
|
-
__tailor_worker_not_used "--value" "-v" "--v" && _opts+=("--value:Secret value")
|
|
2890
|
+
__tailor_worker_not_used "--value" "-v" "--v" && _opts+=("--value:Secret value (read from standard input when omitted)")
|
|
2891
2891
|
__tailor_worker_not_used "--yes" "-y" "--y" && _opts+=("--yes:Skip confirmation prompts")
|
|
2892
2892
|
if (( ! _any_opt_used )); then
|
|
2893
2893
|
_opts+=("--help:Show help")
|
|
@@ -2909,7 +2909,7 @@ __tailor_worker_complete_secret_update() {
|
|
|
2909
2909
|
__tailor_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
|
|
2910
2910
|
__tailor_worker_not_used "--vault-name" "--vaultName" "-V" "--V" && _opts+=("--vault-name:Vault name")
|
|
2911
2911
|
__tailor_worker_not_used "--name" "-n" "--n" && _opts+=("--name:Secret name")
|
|
2912
|
-
__tailor_worker_not_used "--value" "-v" "--v" && _opts+=("--value:Secret value")
|
|
2912
|
+
__tailor_worker_not_used "--value" "-v" "--v" && _opts+=("--value:Secret value (read from standard input when omitted)")
|
|
2913
2913
|
__tailor_worker_not_used "--yes" "-y" "--y" && _opts+=("--yes:Skip confirmation prompts")
|
|
2914
2914
|
if (( ! _any_opt_used )); then
|
|
2915
2915
|
_opts+=("--help:Show help")
|
|
@@ -10,6 +10,43 @@ import { LogLevelEnum } from "../../types/app-config.generated.mjs";
|
|
|
10
10
|
//#region src/configure/config/types.d.ts
|
|
11
11
|
export type LogLevel = LogLevelEnum;
|
|
12
12
|
export type LogLevelInput = LogLevel | (string & {});
|
|
13
|
+
/**
|
|
14
|
+
* Node-only globals that installed packages may reference without failing
|
|
15
|
+
* `deploy`, keyed by package name (e.g. `"@ai-sdk/gateway"`). List the globals, or set
|
|
16
|
+
* `true` to allow every one of them — including any the package only starts
|
|
17
|
+
* referencing in a later version.
|
|
18
|
+
*/
|
|
19
|
+
export type AllowedRuntimeGlobals = Record<string, true | string[]>;
|
|
20
|
+
/** Options for how `defineConfig()` bundles functions. */
|
|
21
|
+
export interface BuildOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Enable inline sourcemaps in bundled functions for better error stack traces.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
inlineSourcemap?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Controls which `console.*` and `logger.*` (from `@tailor-platform/sdk/runtime`)
|
|
29
|
+
* calls remain in bundled functions. `logger.setAttributes` has no severity and
|
|
30
|
+
* is never dropped.
|
|
31
|
+
* @default "DEBUG"
|
|
32
|
+
*/
|
|
33
|
+
logLevel?: LogLevelInput;
|
|
34
|
+
/**
|
|
35
|
+
* Lets `deploy` continue when an installed package bundled into a resolver,
|
|
36
|
+
* executor, or workflow references a Node-only global such as `process` or
|
|
37
|
+
* `Buffer`, which the Tailor Platform runtime does not define. Allow a global
|
|
38
|
+
* only after confirming that the package's code referencing it never runs for
|
|
39
|
+
* your use, since that code throws a `ReferenceError` at runtime. Only code
|
|
40
|
+
* from installed packages is affected: a reference from the project's own
|
|
41
|
+
* code always fails the build.
|
|
42
|
+
* @example
|
|
43
|
+
* allowedRuntimeGlobals: {
|
|
44
|
+
* "@ai-sdk/gateway": ["Buffer"],
|
|
45
|
+
* "some-trusted-package": true,
|
|
46
|
+
* }
|
|
47
|
+
*/
|
|
48
|
+
allowedRuntimeGlobals?: AllowedRuntimeGlobals;
|
|
49
|
+
}
|
|
13
50
|
/** Value an `env` entry resolves to at runtime. */
|
|
14
51
|
export type EnvValue = string | number | boolean;
|
|
15
52
|
/**
|
|
@@ -148,14 +185,17 @@ export interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdP
|
|
|
148
185
|
/**
|
|
149
186
|
* Enable inline sourcemaps in bundled functions for better error stack traces.
|
|
150
187
|
* @default true
|
|
188
|
+
* @deprecated since 2.24.0 — use `buildOptions.inlineSourcemap` instead. codemod: v3/define-config-build-options
|
|
151
189
|
*/
|
|
152
190
|
inlineSourcemap?: boolean;
|
|
153
191
|
/**
|
|
154
192
|
* Controls which `console.*` and `logger.*` (from `@tailor-platform/sdk/runtime`)
|
|
155
|
-
* calls remain in bundled functions.
|
|
156
|
-
* is never dropped.
|
|
193
|
+
* calls remain in bundled functions.
|
|
157
194
|
* @default "DEBUG"
|
|
195
|
+
* @deprecated since 2.24.0 — use `buildOptions.logLevel` instead. codemod: v3/define-config-build-options
|
|
158
196
|
*/
|
|
159
197
|
logLevel?: LogLevelInput;
|
|
198
|
+
/** Options for how resolvers, executors, workflow jobs, and other functions are bundled. */
|
|
199
|
+
buildOptions?: BuildOptions;
|
|
160
200
|
}
|
|
161
201
|
//#endregion
|
|
@@ -7,7 +7,7 @@ import { BuiltinIdP, IDToken, IdProvider, OAuth2ClientInput, OIDC, SAML, SCIMAtt
|
|
|
7
7
|
import { AuthConfig, AuthConnectionTokenResult, AuthExternalConfig, AuthOwnConfig, AuthServiceInput, BeforeLoginClaims, BeforeLoginHookArgs, DefinedAuth, FederatedIdentity, FederatedIdentityClaims, FederatedIdentityProvider, MachineUserName, MachineUserNameRegistry, OAuth2ClientGrantType, SCIMAttributeType, UserAttributeKey, UserAttributeListKey, UserAttributes, UsernameFieldKey, ValueOperand } from "./services/auth/types.mjs";
|
|
8
8
|
import { AllowedValues, AllowedValuesOutput } from "./types/field.mjs";
|
|
9
9
|
import { Resolver } from "../types/resolver.generated.mjs";
|
|
10
|
-
import { ExecutorReadyContext, GeneratorResult, NamespacePluginOutput, Plugin, PluginConfigs, PluginExecutorContext, PluginExecutorContextBase, PluginFieldExtensions, PluginGeneratedExecutor, PluginGeneratedExecutorWithFile, PluginGeneratedResolver, PluginGeneratedTable, PluginNamespaceProcessContext, PluginOutput, PluginTableProcessContext, ResolverNamespaceData, ResolverReadyContext, TablePluginOutput, TailorDBNamespaceData, TailorDBReadyContext, TailorDBTableForPlugin } from "../plugin/types.mjs";
|
|
10
|
+
import { DeployedApplication, DeployedContext, DeployedHookResult, DeployedOAuth2Client, DeployedStaticWebsite, ExecutorReadyContext, GeneratorResult, NamespacePluginOutput, Plugin, PluginConfigs, PluginExecOptions, PluginExecResult, PluginExecutorContext, PluginExecutorContextBase, PluginFieldExtensions, PluginGeneratedExecutor, PluginGeneratedExecutorWithFile, PluginGeneratedResolver, PluginGeneratedTable, PluginLogger, PluginNamespaceProcessContext, PluginOutput, PluginOutputValue, PluginTableProcessContext, PublishStaticWebsiteResult, PublishableStaticWebsite, ResolverNamespaceData, ResolverReadyContext, TablePluginOutput, TailorDBNamespaceData, TailorDBReadyContext, TailorDBTableForPlugin } from "../plugin/types.mjs";
|
|
11
11
|
import { PermissionCondition, TailorTypeGqlPermission, TailorTypePermission, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission } from "./services/tailordb/permission.mjs";
|
|
12
12
|
import { TailorAnyDBField, TailorAnyDBType, TailorDBField, TailorDBInstance, TailorDBType, db } from "./services/tailordb/schema.mjs";
|
|
13
13
|
import { AuthNamespaceName, AuthNamespaceNameRegistry } from "./types/auth-namespace-name.mjs";
|
|
@@ -170,4 +170,4 @@ export declare namespace t {
|
|
|
170
170
|
type infer<T> = TailorOutput<T>;
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
|
-
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 AuthNamespaceName, type AuthNamespaceNameRegistry, 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 IsAutoFilledDBField, type IsReadOnlyDBField, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, ParameterizedWaitPointInstance, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginFieldExtensions, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedTable, type PluginNamespaceProcessContext, type PluginOutput, type PluginTableProcessContext, 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 SecretNameFor, type SecretVaultName, type SecretVaultNameRegistry, type SecretsConfig, type StaticWebsiteConfig, type TablePluginOutput, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, type TailorDBTableForPlugin, TailorDBTrigger, type TailorDBType, type TailorField, type TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, 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, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
173
|
+
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 AuthNamespaceName, type AuthNamespaceNameRegistry, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type ConnectionName, type ConnectionNameRegistry, type DefinedAuth, type DeployedApplication, type DeployedContext, type DeployedHookResult, type DeployedOAuth2Client, type DeployedStaticWebsite, 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 IsAutoFilledDBField, type IsReadOnlyDBField, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, ParameterizedWaitPointInstance, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecOptions, type PluginExecResult, type PluginExecutorContext, type PluginExecutorContextBase, type PluginFieldExtensions, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedTable, type PluginLogger, type PluginNamespaceProcessContext, type PluginOutput, type PluginOutputValue, type PluginTableProcessContext, type PublishStaticWebsiteResult, type PublishableStaticWebsite, 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 SecretNameFor, type SecretVaultName, type SecretVaultNameRegistry, type SecretsConfig, type StaticWebsiteConfig, type TablePluginOutput, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, type TailorDBTableForPlugin, TailorDBTrigger, type TailorDBType, type TailorField, type TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, 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, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
package/dist/configure/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ function defineAuth(e,t){return{...t,name:e}}const g={create:[{conditions:[],per
|
|
|
3
3
|
function createResolver(e){let t=(e=>typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`)(e.output)?e.output:h.object(e.output);return r({...e,output:t},`resolver`)}/* @__NO_SIDE_EFFECTS__ */
|
|
4
4
|
function createExecutor(e){return r(e,`executor`)}const v={created:`tailordb.type_record.created`,updated:`tailordb.type_record.updated`,deleted:`tailordb.type_record.deleted`};function recordCreatedTrigger(e){let{type:t,condition:n}=e;return{kind:`tailordb`,events:[`tailordb.type_record.created`],tableName:t.name,condition:n,__args:{}}}function recordUpdatedTrigger(e){let{type:t,condition:n}=e;return{kind:`tailordb`,events:[`tailordb.type_record.updated`],tableName:t.name,condition:n,__args:{}}}function recordDeletedTrigger(e){let{type:t,condition:n}=e;return{kind:`tailordb`,events:[`tailordb.type_record.deleted`],tableName:t.name,condition:n,__args:{}}}function recordTrigger(e){let{type:t,events:n,condition:r}=e;return{kind:`tailordb`,events:n.map(e=>v[e]),tableName:t.name,condition:r,__args:{}}}function resolverExecutedTrigger(e){let{resolver:t,condition:n}=e;return{kind:`resolverExecuted`,resolverName:t.name,condition:n,__args:{}}}const y={created:`idp.user.created`,updated:`idp.user.updated`,deleted:`idp.user.deleted`};function idpUserCreatedTrigger(e){return{kind:`idpUser`,events:[`idp.user.created`],...e?.idp==null?{}:{idp:e.idp},__args:{}}}function idpUserUpdatedTrigger(e){return{kind:`idpUser`,events:[`idp.user.updated`],...e?.idp==null?{}:{idp:e.idp},__args:{}}}function idpUserDeletedTrigger(e){return{kind:`idpUser`,events:[`idp.user.deleted`],...e?.idp==null?{}:{idp:e.idp},__args:{}}}function idpUserTrigger(e){let{events:t,idp:n}=e;return{kind:`idpUser`,events:t.map(e=>y[e]),...n==null?{}:{idp:n},__args:{}}}const b={issued:`auth.access_token.issued`,refreshed:`auth.access_token.refreshed`,revoked:`auth.access_token.revoked`};function authAccessTokenIssuedTrigger(){return{kind:`authAccessToken`,events:[`auth.access_token.issued`],__args:{}}}function authAccessTokenRefreshedTrigger(){return{kind:`authAccessToken`,events:[`auth.access_token.refreshed`],__args:{}}}function authAccessTokenRevokedTrigger(){return{kind:`authAccessToken`,events:[`auth.access_token.revoked`],__args:{}}}function authAccessTokenTrigger(e){let{events:t}=e;return{kind:`authAccessToken`,events:t.map(e=>b[e]),__args:{}}}const x={started:`workflow.workflow_execution.started`,completed:`workflow.workflow_execution.completed`,retried:`workflow.workflow_execution.retried`,resumed:`workflow.workflow_execution.resumed`,wait_started:`workflow.workflow_execution.wait_started`,wait_resolved:`workflow.workflow_execution.wait_resolved`};function workflowExecutionTriggerConfig(e,t){return{kind:`workflowExecution`,events:e,workflowName:t.workflow.name,condition:t.condition,__args:{}}}function workflowExecutionStartedTrigger(e){return workflowExecutionTriggerConfig([`workflow.workflow_execution.started`],e)}function workflowExecutionCompletedTrigger(e){return workflowExecutionTriggerConfig([`workflow.workflow_execution.completed`],e)}function workflowExecutionRetriedTrigger(e){return workflowExecutionTriggerConfig([`workflow.workflow_execution.retried`],e)}function workflowExecutionResumedTrigger(e){return workflowExecutionTriggerConfig([`workflow.workflow_execution.resumed`],e)}function workflowExecutionWaitStartedTrigger(e){return workflowExecutionTriggerConfig([`workflow.workflow_execution.wait_started`],e)}function workflowExecutionWaitResolvedTrigger(e){return workflowExecutionTriggerConfig([`workflow.workflow_execution.wait_resolved`],e)}function workflowExecutionTrigger(e){let{events:t,workflow:n,condition:r}=e;return workflowExecutionTriggerConfig(t.map(e=>x[e]),{workflow:n,condition:r})}const S={started:`workflow.workflow_execution.job_execution.started`,completed:`workflow.workflow_execution.job_execution.completed`,wait_started:`workflow.workflow_execution.job_execution.wait_started`,wait_resolved:`workflow.workflow_execution.job_execution.wait_resolved`};function workflowJobExecutionTriggerConfig(e,t){return{kind:`workflowJobExecution`,events:e,workflowName:t.workflow.name,condition:t.condition,__args:{}}}function workflowJobExecutionStartedTrigger(e){return workflowJobExecutionTriggerConfig([`workflow.workflow_execution.job_execution.started`],e)}function workflowJobExecutionCompletedTrigger(e){return workflowJobExecutionTriggerConfig([`workflow.workflow_execution.job_execution.completed`],e)}function workflowJobExecutionWaitStartedTrigger(e){return workflowJobExecutionTriggerConfig([`workflow.workflow_execution.job_execution.wait_started`],e)}function workflowJobExecutionWaitResolvedTrigger(e){return workflowJobExecutionTriggerConfig([`workflow.workflow_execution.job_execution.wait_resolved`],e)}function workflowJobExecutionTrigger(e){let{events:t,workflow:n,condition:r}=e;return workflowJobExecutionTriggerConfig(t.map(e=>S[e]),{workflow:n,condition:r})}function scheduleTrigger(e){let{cron:t,timezone:n}=e;return{kind:`schedule`,cron:t,timezone:n,__args:{}}}function incomingWebhookTrigger(e){let t=typeof e?.response==`function`?{body:e.response}:e?.response;return{kind:`incomingWebhook`,...t?{response:t}:{},__args:{}}}const C=/^[a-z0-9][a-z0-9_:.-]{0,62}[a-z0-9]$/;function createExecutionPolicyInstance(e,t,n,i,a,o,s){let c=i===`prefix`,l={name:e,key:t,matchType:i,...n&&{concurrencyPolicy:n},...c&&{keyFor:e=>{let t=`${l.key}${a}${e}`;if(!C.test(t))throw Error(`Invalid execution policy key "${t}" built by keyFor("${e}"): must match [a-z0-9_:.-] (2-64 chars; must start and end with [a-z0-9]).`);return t}}};return{instance:r(l,`execution-policy`),setName:o?e=>{l.name=e}:void 0,setKey:s?e=>{l.key=e}:void 0}}/* @__NO_SIDE_EFFECTS__ */
|
|
5
5
|
function defineWorkflowExecutionPolicy(e,t){return createExecutionPolicyInstance(e,t?.key??e,t?.concurrencyPolicy,t?.matchType??`exact`,t?.separator??`.`,!1,!1).instance}/* @__NO_SIDE_EFFECTS__ */
|
|
6
|
-
function defineWorkflowExecutionPolicies(e,t){let n=t?.separator??`.`,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=e(e=>{let t=e?.name,a=e?.key,{instance:o,setName:s,setKey:c}=createExecutionPolicyInstance(t??`__pending__`,a??t??`__pending__`,e?.concurrencyPolicy,e?.matchType??`exact`,n,t===void 0,a===void 0&&t===void 0);return s&&r.set(o,s),c&&i.set(o,c),o});for(let e of Object.keys(a)){let t=a[e];r.get(t)?.(e),i.get(t)?.(e)}return a}function createWorkflowJob(e){let t=e.body,n=process.env.__TAILOR_PLATFORM_BUNDLE?t:(e,n)=>s(n.invoker,()=>t(e,n));process.env.__TAILOR_PLATFORM_BUNDLE||i(e.name,n);let o=process.env.__TAILOR_PLATFORM_BUNDLE?()=>{throw Error(`.start() on workflow job "${e.name}" is rewritten at build time and is unavailable in the bundle`)}:function(t,n){return arguments.length>=2?a(e.name,t,n):a(e.name,t)};return r({name:e.name,start:o,body:n,...e.publishEvents===void 0?{}:{publishEvents:e.publishEvents}},`workflow-job`)}const w=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;function parseKey(e){let t=e.split(`-`);return{segments:t,paramNames:t.filter(p).map(e=>e.slice(1))}}function composeKey(e,t,n){let r=t.segments.map(t=>{if(!p(t))return t;let r=t.slice(1),i=n[r];if(typeof i!=`string`)throw Error(`Wait point "${e}" needs a string for parameter "${r}" but received ${i===void 0?`undefined`:typeof i}.`);if(!w.test(i))throw Error(`Wait point "${e}" cannot use ${JSON.stringify(i)} for parameter "${r}": values may only contain [a-z0-9-] and cannot be empty or start or end with "-".`);return i}).join(`-`);if(r.length>63)throw Error(`Wait point key "${r}" built from "${e}" is ${r.length} characters; the limit is 63.`);if(!d.test(r))throw Error(`Wait point key "${r}" built from "${e}" must match ${f}.`);return r}function createBoundWaitPoint(e,t){return{wait(n){return Promise.resolve(e.wait(t(),n))},async resolve(n,r){await e.resolve(t(),n,r)}}}function createWaitPointInstance(e){let t=e,n=l(),i=r(createBoundWaitPoint(n,()=>t),`wait-point`);return u(i,n),{instance:i,setKey:e=>{t=e}}}function createParameterizedWaitPointInstance(e,t,n){let i=l(),unbound=()=>{throw Error(n===`define`?`Wait point key "${e}" has $params, so it identifies no single suspension on its own. Bind them first: waitPoint.with({ ... }).wait(...).`:`Wait point key "${e}" has $params, which createWaitPoint cannot type. Declare it through createWaitPoints instead: createWaitPoints((define) => ({ myWaitPoint: define.for("${e}")<Payload, Result>() })).`)},a=r({with(n){let r=composeKey(e,t,n);return c(createBoundWaitPoint(i,()=>r),r)},wait:unbound,resolve:unbound},`wait-point`);return u(a,i),a}function createKeyedWaitPoint(e,t){m({key:e,declaredBy:t});let n=parseKey(e);return n.paramNames.length>0?createParameterizedWaitPointInstance(e,n,t):createWaitPointInstance(e).instance}function createWaitPoint(e){return createKeyedWaitPoint(e,`createWaitPoint`)}function createWaitPoints(e){let t=/* @__PURE__ */ new Map,n=e(Object.assign(()=>{let{instance:e,setKey:n}=createWaitPointInstance(`__pending__`);return t.set(e,n),e},{for:e=>{let t=createKeyedWaitPoint(e,`define`);return()=>t}}));for(let e of Object.keys(n)){let r=t.get(n[e]);r&&(m({key:e,declaredBy:`property`}),r(e))}return n}function createWorkflow(e){return r({...e,start:process.env.__TAILOR_PLATFORM_BUNDLE?async()=>{throw Error(
|
|
6
|
+
function defineWorkflowExecutionPolicies(e,t){let n=t?.separator??`.`,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=e(e=>{let t=e?.name,a=e?.key,{instance:o,setName:s,setKey:c}=createExecutionPolicyInstance(t??`__pending__`,a??t??`__pending__`,e?.concurrencyPolicy,e?.matchType??`exact`,n,t===void 0,a===void 0&&t===void 0);return s&&r.set(o,s),c&&i.set(o,c),o});for(let e of Object.keys(a)){let t=a[e];r.get(t)?.(e),i.get(t)?.(e)}return a}function createWorkflowJob(e){let t=e.body,n=process.env.__TAILOR_PLATFORM_BUNDLE?t:(e,n)=>s(n.invoker,()=>t(e,n));process.env.__TAILOR_PLATFORM_BUNDLE||i(e.name,n);let o=process.env.__TAILOR_PLATFORM_BUNDLE?()=>{throw Error(`.start() on workflow job "${e.name}" is rewritten at build time and is unavailable in the bundle`)}:function(t,n){return arguments.length>=2?a(e.name,t,n):a(e.name,t)};return r({name:e.name,start:o,body:n,...e.publishEvents===void 0?{}:{publishEvents:e.publishEvents}},`workflow-job`)}const w=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;function parseKey(e){let t=e.split(`-`);return{segments:t,paramNames:t.filter(p).map(e=>e.slice(1))}}function composeKey(e,t,n){let r=t.segments.map(t=>{if(!p(t))return t;let r=t.slice(1),i=n[r];if(typeof i!=`string`)throw Error(`Wait point "${e}" needs a string for parameter "${r}" but received ${i===void 0?`undefined`:typeof i}.`);if(!w.test(i))throw Error(`Wait point "${e}" cannot use ${JSON.stringify(i)} for parameter "${r}": values may only contain [a-z0-9-] and cannot be empty or start or end with "-".`);return i}).join(`-`);if(r.length>63)throw Error(`Wait point key "${r}" built from "${e}" is ${r.length} characters; the limit is 63.`);if(!d.test(r))throw Error(`Wait point key "${r}" built from "${e}" must match ${f}.`);return r}function createBoundWaitPoint(e,t){return{wait(n){return Promise.resolve(e.wait(t(),n))},async resolve(n,r){await e.resolve(t(),n,r)}}}function createWaitPointInstance(e){let t=e,n=l(),i=r(createBoundWaitPoint(n,()=>t),`wait-point`);return u(i,n),{instance:i,setKey:e=>{t=e}}}function createParameterizedWaitPointInstance(e,t,n){let i=l(),unbound=()=>{throw Error(n===`define`?`Wait point key "${e}" has $params, so it identifies no single suspension on its own. Bind them first: waitPoint.with({ ... }).wait(...).`:`Wait point key "${e}" has $params, which createWaitPoint cannot type. Declare it through createWaitPoints instead: createWaitPoints((define) => ({ myWaitPoint: define.for("${e}")<Payload, Result>() })).`)},a=r({with(n){let r=composeKey(e,t,n);return c(createBoundWaitPoint(i,()=>r),r)},wait:unbound,resolve:unbound},`wait-point`);return u(a,i),a}function createKeyedWaitPoint(e,t){m({key:e,declaredBy:t});let n=parseKey(e);return n.paramNames.length>0?createParameterizedWaitPointInstance(e,n,t):createWaitPointInstance(e).instance}function createWaitPoint(e){return createKeyedWaitPoint(e,`createWaitPoint`)}function createWaitPoints(e){let t=/* @__PURE__ */ new Map,n=e(Object.assign(()=>{let{instance:e,setKey:n}=createWaitPointInstance(`__pending__`);return t.set(e,n),e},{for:e=>{let t=createKeyedWaitPoint(e,`define`);return()=>t}}));for(let e of Object.keys(n)){let r=t.get(n[e]);r&&(m({key:e,declaredBy:`property`}),r(e))}return n}function createWorkflow(e){return r({...e,start:process.env.__TAILOR_PLATFORM_BUNDLE?async()=>{throw Error(`.start() on workflow "${e.name}" is rewritten at build time and is unavailable in the bundle`)}:async function(t,n){return arguments.length>=2?await o(e.name,t,n):await o(e.name,t)}},`workflow`)}/* @__NO_SIDE_EFFECTS__ */
|
|
7
7
|
function defineStaticWebSite(e,t){return{...t,name:e,get url(){return`${e}:url`}}}/* @__NO_SIDE_EFFECTS__ */
|
|
8
8
|
function defineAIGateway(e,t){return{...t,name:e}}const T={create:[{conditions:[],permit:!0}],read:[{conditions:[],permit:!0}],update:[{conditions:[],permit:!0}],delete:[{conditions:[],permit:!0}],sendPasswordResetEmail:[{conditions:[],permit:!0}],unenrollMfa:[{conditions:[],permit:!0}]};/* @__NO_SIDE_EFFECTS__ */
|
|
9
9
|
function defineIdp(e,t){return{...t,name:e,provider(t,n){return{name:t,kind:`BuiltInIdP`,namespace:e,clientName:n}}}}/* @__NO_SIDE_EFFECTS__ */
|