@tailor-platform/sdk 1.53.0 → 1.54.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 +45 -0
- package/dist/{actor-DwAh0Dij.d.mts → actor-Cjae_LGD.d.mts} +2 -2
- package/dist/{application-DF74unzA.mjs → application-BfGje3iZ.mjs} +12 -5
- package/dist/application-BfGje3iZ.mjs.map +1 -0
- package/dist/application-BsipSxp3.mjs +4 -0
- package/dist/cli/index.mjs +2 -2
- package/dist/cli/lib.d.mts +8 -7
- package/dist/cli/lib.mjs +2 -2
- package/dist/configure/index.d.mts +3 -3
- package/dist/{index-UySZfxON.d.mts → index-BTLgs0DP.d.mts} +4 -4
- package/dist/{index-BL5LQnBX.d.mts → index-Cf1Lo_XT.d.mts} +2 -2
- package/dist/{index-BIbKrme4.d.mts → index-CyyoHrPK.d.mts} +2 -2
- package/dist/{index-BCJtNXKo.d.mts → index-DrYHpTja.d.mts} +2 -2
- package/dist/{index-DW6gAGmC.d.mts → index-qQYMbkT-.d.mts} +2 -2
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/index.d.mts +2 -2
- package/dist/{runtime-D-3AE1x-.mjs → runtime-CQRrqhlV.mjs} +27 -11
- package/dist/runtime-CQRrqhlV.mjs.map +1 -0
- package/dist/{tailor-db-field-Y_zEoGu1.d.mts → tailor-db-field-D0qg8s4U.d.mts} +4 -2
- package/dist/utils/test/index.d.mts +3 -3
- package/dist/vitest/index.d.mts +41 -5
- package/dist/vitest/index.mjs +124 -1
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/{workflow.generated-BIY41La-.d.mts → workflow.generated-dBixCwUo.d.mts} +2 -2
- package/docs/configuration.md +10 -0
- package/docs/services/auth.md +3 -2
- package/docs/services/tailordb-migration.md +18 -1
- package/docs/testing.md +53 -0
- package/package.json +4 -4
- package/dist/application-Cmz1Y7X_.mjs +0 -4
- package/dist/application-DF74unzA.mjs.map +0 -1
- package/dist/runtime-D-3AE1x-.mjs.map +0 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { G as PATScope, R as AuthInvokerSchema, c as fetchUserInfo, d as initOperatorClient, h as userAgent, i as fetchAll, j as FunctionExecution_Type, n as closeConnectionPool, o as fetchPaged, s as fetchPlatformMachineUserToken, u as initOAuth2Client } from "../client-CGO7gniI.mjs";
|
|
4
4
|
import { n as logger, r as styles } from "../logger-DpJyJvNz.mjs";
|
|
5
|
-
import { $ as listCommand$10, An as workspaceArgs, At as startCommand, B as logBetaWarning, C as listCommand$13, Cn as configArg, Dn as pagedLogArgs, Dt as jobsCommand, E as resumeCommand, En as isVerbose, F as writeDbTypesFile, Gt as parseMigrationLabelNumber, H as removeCommand$1, Ht as executeScript, I as getConfiguredEditorCommand, K as treeCommand, L as openInConfiguredEditor, Lt as functionExecutionStatusToString, Mt as getCommand$6, N as generateCommand$1, O as listCommand$12, On as paginationArgs, P as generateMigrationScript, Pt as executionsCommand, Rt as formatKeyValueTable, Sn as commonArgs, St as triggerCommand, T as healthCommand, Tn as deploymentArgs, U as updateCommand$3, Vt as deploy, Y as getCommand$5, Yt as INITIAL_SCHEMA_NUMBER, Z as updateCommand$2, _n as prompt, an as getMigrationFiles, at as createCommand$3, b as createCommand$4, bn as assertWritable, c as listCommand$14, cn as loadDiff, f as restoreCommand, ft as tokenCommand, g as getCommand$7, gt as listCommand$7, hn as trnPrefix, ht as generate, i as updateCommand$4, in as getMigrationFilePath, j as truncateCommand, kn as toPageDirection, ln as reconstructSnapshotFromMigrations, lt as getCommand$3, m as listCommand$15, mn as sdkNameLabelKey, o as removeCommand, pn as getNamespacesWithMigrations, pt as listCommand$8, q as listCommand$11, r as queryCommand, rt as deleteCommand$3, sn as isValidMigrationNumber, st as listCommand$9, t as isNativeTypeScriptRuntime, tn as formatMigrationNumber, tt as getCommand$4, u as inviteCommand, v as deleteCommand$4, vn as apiCommand, vt as getCommand$2, wn as confirmationArgs, wt as listCommand$6, xn as defineAppCommand, xt as webhookCommand, z as showCommand, zt as getCommand$1 } from "../runtime-
|
|
6
|
-
import { D as saveUserTokens, E as resolveTokens, O as writePlatformConfig, S as loadAccessToken, T as readPlatformConfig, _ as getDistDir, a as WorkflowJobSchema, b as deleteUserTokens, c as ExecutorSchema, i as resolveInlineSourcemap, l as INVOKER_EXPR, o as ResolverSchema, w as loadWorkspaceId, x as fetchLatestToken, y as loadConfig } from "../application-
|
|
5
|
+
import { $ as listCommand$10, An as workspaceArgs, At as startCommand, B as logBetaWarning, C as listCommand$13, Cn as configArg, Dn as pagedLogArgs, Dt as jobsCommand, E as resumeCommand, En as isVerbose, F as writeDbTypesFile, Gt as parseMigrationLabelNumber, H as removeCommand$1, Ht as executeScript, I as getConfiguredEditorCommand, K as treeCommand, L as openInConfiguredEditor, Lt as functionExecutionStatusToString, Mt as getCommand$6, N as generateCommand$1, O as listCommand$12, On as paginationArgs, P as generateMigrationScript, Pt as executionsCommand, Rt as formatKeyValueTable, Sn as commonArgs, St as triggerCommand, T as healthCommand, Tn as deploymentArgs, U as updateCommand$3, Vt as deploy, Y as getCommand$5, Yt as INITIAL_SCHEMA_NUMBER, Z as updateCommand$2, _n as prompt, an as getMigrationFiles, at as createCommand$3, b as createCommand$4, bn as assertWritable, c as listCommand$14, cn as loadDiff, f as restoreCommand, ft as tokenCommand, g as getCommand$7, gt as listCommand$7, hn as trnPrefix, ht as generate, i as updateCommand$4, in as getMigrationFilePath, j as truncateCommand, kn as toPageDirection, ln as reconstructSnapshotFromMigrations, lt as getCommand$3, m as listCommand$15, mn as sdkNameLabelKey, o as removeCommand, pn as getNamespacesWithMigrations, pt as listCommand$8, q as listCommand$11, r as queryCommand, rt as deleteCommand$3, sn as isValidMigrationNumber, st as listCommand$9, t as isNativeTypeScriptRuntime, tn as formatMigrationNumber, tt as getCommand$4, u as inviteCommand, v as deleteCommand$4, vn as apiCommand, vt as getCommand$2, wn as confirmationArgs, wt as listCommand$6, xn as defineAppCommand, xt as webhookCommand, z as showCommand, zt as getCommand$1 } from "../runtime-CQRrqhlV.mjs";
|
|
6
|
+
import { D as saveUserTokens, E as resolveTokens, O as writePlatformConfig, S as loadAccessToken, T as readPlatformConfig, _ as getDistDir, a as WorkflowJobSchema, b as deleteUserTokens, c as ExecutorSchema, i as resolveInlineSourcemap, l as INVOKER_EXPR, o as ResolverSchema, w as loadWorkspaceId, x as fetchLatestToken, y as loadConfig } from "../application-BfGje3iZ.mjs";
|
|
7
7
|
import { t as multiline } from "../multiline-Cf9ODpr1.mjs";
|
|
8
8
|
import { t as readPackageJson } from "../package-json-DcQApfPQ.mjs";
|
|
9
9
|
import { n as isCLIError } from "../errors-EsY4XO6O.mjs";
|
package/dist/cli/lib.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { N as TailorDBType, P as TypeSourceInfoEntry, Q as Resolver, _t as IdProvider, ct as IncomingWebhookTrigger, o as Plugin, rt as Executor, s as PluginAttachment, ut as ScheduleTriggerInput, vt as OAuth2ClientInput } from "../tailor-db-field-
|
|
2
|
-
import { r as AppConfig } from "../workflow.generated-
|
|
3
|
-
import { n as kyselyTypePlugin } from "../index-
|
|
4
|
-
import { n as enumConstantsPlugin } from "../index-
|
|
5
|
-
import { n as fileUtilsPlugin } from "../index-
|
|
6
|
-
import { n as seedPlugin } from "../index-
|
|
1
|
+
import { N as TailorDBType, P as TypeSourceInfoEntry, Q as Resolver, _t as IdProvider, ct as IncomingWebhookTrigger, o as Plugin, rt as Executor, s as PluginAttachment, ut as ScheduleTriggerInput, vt as OAuth2ClientInput } from "../tailor-db-field-D0qg8s4U.mjs";
|
|
2
|
+
import { r as AppConfig } from "../workflow.generated-dBixCwUo.mjs";
|
|
3
|
+
import { n as kyselyTypePlugin } from "../index-CyyoHrPK.mjs";
|
|
4
|
+
import { n as enumConstantsPlugin } from "../index-qQYMbkT-.mjs";
|
|
5
|
+
import { n as fileUtilsPlugin } from "../index-Cf1Lo_XT.mjs";
|
|
6
|
+
import { n as seedPlugin } from "../index-DrYHpTja.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { JsonObject, Message } from "@bufbuild/protobuf";
|
|
9
9
|
import { GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
@@ -19365,9 +19365,10 @@ interface MigrationBundleResult {
|
|
|
19365
19365
|
* @param {string} sourceFile - Path to the migration script file
|
|
19366
19366
|
* @param {string} namespace - TailorDB namespace
|
|
19367
19367
|
* @param {number} migrationNumber - Migration number
|
|
19368
|
+
* @param {Record<string, string | number | boolean>} env - Environment variables to inject into the migration context
|
|
19368
19369
|
* @returns {Promise<MigrationBundleResult>} Bundled migration result
|
|
19369
19370
|
*/
|
|
19370
|
-
declare function bundleMigrationScript(sourceFile: string, namespace: string, migrationNumber: number): Promise<MigrationBundleResult>;
|
|
19371
|
+
declare function bundleMigrationScript(sourceFile: string, namespace: string, migrationNumber: number, env?: Record<string, string | number | boolean>): Promise<MigrationBundleResult>;
|
|
19371
19372
|
//#endregion
|
|
19372
19373
|
//#region src/cli/shared/script-executor.d.ts
|
|
19373
19374
|
/**
|
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { d as initOperatorClient } from "../client-CGO7gniI.mjs";
|
|
3
|
-
import { $t as compareSnapshots, A as truncate, Bt as getExecutor, Ct as triggerExecutor, D as resumeWorkflow, Et as getExecutorJob, Ft as getWorkflowExecution, G as organizationTree, Ht as executeScript, It as listWorkflowExecutions, J as listOrganizations, Jt as DIFF_FILE_NAME, Kt as bundleMigrationScript, M as generate$1, Nt as getWorkflow, Ot as listExecutorJobs, Q as updateFolder, Qt as compareLocalTypesWithSnapshot, R as show, S as listApps, Tt as listExecutors, Ut as waitForExecution, V as remove, Vt as deploy, W as updateOrganization, Wt as MIGRATION_LABEL_KEY, X as getOrganization, Xt as MIGRATE_FILE_NAME, Yt as INITIAL_SCHEMA_NUMBER, Zt as SCHEMA_FILE_NAME, _ as getWorkspace, _t as listFunctionRegistries, a as updateUser, an as getMigrationFiles, bt as listWebhookExecutors, ct as listOAuth2Clients, d as inviteUser, dn as formatMigrationDiff, dt as getMachineUserToken, en as createSnapshotFromLocalTypes, et as listFolders, fn as hasChanges, gn as generateUserTypes, h as listWorkspaces, ht as generate, in as getMigrationFilePath, it as deleteFolder, jt as startWorkflow, k as listWorkflows, kt as watchExecutorJob, l as listUsers, ln as reconstructSnapshotFromMigrations, mt as listMachineUsers, n as query, nn as getLatestMigrationNumber, nt as getFolder, on as getNextMigrationNumber, ot as createFolder, p as restoreWorkspace, pn as getNamespacesWithMigrations, qt as DB_TYPES_FILE_NAME, rn as getMigrationDirPath, s as removeUser, t as isNativeTypeScriptRuntime, un as formatDiffSummary, ut as getOAuth2Client, w as getAppHealth, x as createWorkspace, y as deleteWorkspace, yn as apiCall, yt as getFunctionRegistry } from "../runtime-
|
|
4
|
-
import { S as loadAccessToken, _ as getDistDir, w as loadWorkspaceId, y as loadConfig } from "../application-
|
|
3
|
+
import { $t as compareSnapshots, A as truncate, Bt as getExecutor, Ct as triggerExecutor, D as resumeWorkflow, Et as getExecutorJob, Ft as getWorkflowExecution, G as organizationTree, Ht as executeScript, It as listWorkflowExecutions, J as listOrganizations, Jt as DIFF_FILE_NAME, Kt as bundleMigrationScript, M as generate$1, Nt as getWorkflow, Ot as listExecutorJobs, Q as updateFolder, Qt as compareLocalTypesWithSnapshot, R as show, S as listApps, Tt as listExecutors, Ut as waitForExecution, V as remove, Vt as deploy, W as updateOrganization, Wt as MIGRATION_LABEL_KEY, X as getOrganization, Xt as MIGRATE_FILE_NAME, Yt as INITIAL_SCHEMA_NUMBER, Zt as SCHEMA_FILE_NAME, _ as getWorkspace, _t as listFunctionRegistries, a as updateUser, an as getMigrationFiles, bt as listWebhookExecutors, ct as listOAuth2Clients, d as inviteUser, dn as formatMigrationDiff, dt as getMachineUserToken, en as createSnapshotFromLocalTypes, et as listFolders, fn as hasChanges, gn as generateUserTypes, h as listWorkspaces, ht as generate, in as getMigrationFilePath, it as deleteFolder, jt as startWorkflow, k as listWorkflows, kt as watchExecutorJob, l as listUsers, ln as reconstructSnapshotFromMigrations, mt as listMachineUsers, n as query, nn as getLatestMigrationNumber, nt as getFolder, on as getNextMigrationNumber, ot as createFolder, p as restoreWorkspace, pn as getNamespacesWithMigrations, qt as DB_TYPES_FILE_NAME, rn as getMigrationDirPath, s as removeUser, t as isNativeTypeScriptRuntime, un as formatDiffSummary, ut as getOAuth2Client, w as getAppHealth, x as createWorkspace, y as deleteWorkspace, yn as apiCall, yt as getFunctionRegistry } from "../runtime-CQRrqhlV.mjs";
|
|
4
|
+
import { S as loadAccessToken, _ as getDistDir, w as loadWorkspaceId, y as loadConfig } from "../application-BfGje3iZ.mjs";
|
|
5
5
|
import { n as enumConstantsPlugin } from "../enum-constants-C7DaWeQo.mjs";
|
|
6
6
|
import { t as multiline } from "../multiline-Cf9ODpr1.mjs";
|
|
7
7
|
import { n as fileUtilsPlugin } from "../file-utils-BHPxPXmn.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@tailor-platform/sdk/runtime/globals" />
|
|
2
|
-
import { B as BeforeLoginHookArgs, C as ResolverReadyContext, Ct as SCIMAuthorization, Et as TenantProvider, F as AuthConfig, G as UserAttributeListKey, H as OAuth2ClientGrantType, Ht as TailorUser, I as AuthConnectionTokenResult, J as ValueOperand, K as UserAttributeMap, L as AuthExternalConfig, Lt as AttributeList, Q as Resolver, R as AuthOwnConfig, Rt as AttributeMap, S as ResolverNamespaceData, St as SCIMAttributeMapping, T as TailorDBReadyContext, Tt as SCIMResource, U as SCIMAttributeType, Ut as unauthenticatedTailorUser, V as DefinedAuth, Vt as TailorInvoker, W as UserAttributeKey, X as AuthConnectionConfig, Z as AuthConnectionOAuth2Config, _ as PluginProcessContext, _t as IdProvider, a as NamespacePluginOutput, b as ExecutorReadyContext, bt as SAML, c as PluginConfigs, d as PluginGeneratedExecutor, f as PluginGeneratedExecutorWithFile, g as PluginOutput, gt as IDToken, h as PluginNamespaceProcessContext, ht as BuiltinIdP, l as PluginExecutorContext, m as PluginGeneratedType, o as Plugin, p as PluginGeneratedResolver, q as UsernameFieldKey, s as PluginAttachment, u as PluginExecutorContextBase, v as TailorDBTypeForPlugin, vt as OAuth2ClientInput, w as TailorDBNamespaceData, wt as SCIMConfig, x as GeneratorResult, xt as SCIMAttribute, y as TypePluginOutput, yt as OIDC, z as AuthServiceInput } from "../tailor-db-field-
|
|
3
|
-
import { A as PermissionCondition, D as TailorDBInstance, E as TailorDBField, M as TailorTypePermission, N as unsafeAllowAllGqlPermission, O as TailorDBType, P as unsafeAllowAllTypePermission, S as IdPGqlOperationsInput, T as TailorAnyDBType, _ as IdPExternalConfig, a as ExecutorServiceInput, b as IdPEmailConfig, c as ResolverServiceInput, d as StaticWebsiteConfig, g as IdPConfig, i as ExecutorServiceConfig, j as TailorTypeGqlPermission, k as db, l as WorkflowServiceConfig, m as SecretsConfig, n as RetryPolicy, o as ResolverExternalConfig, s as ResolverServiceConfig, t as ConcurrencyPolicy, u as WorkflowServiceInput, w as TailorAnyDBField, x as IdPGqlOperations } from "../workflow.generated-
|
|
4
|
-
import { $ as recordDeletedTrigger, A as AuthAccessTokenRefreshedArgs, B as RecordUpdatedArgs, C as IncomingWebhookTriggerOptions, Ct as MachineUserNameRegistry, D as scheduleTrigger, E as ScheduleTrigger, F as IdpUserDeletedArgs, G as authAccessTokenRefreshedTrigger, H as ResolverExecutedTrigger, I as IdpUserTrigger, J as idpUserCreatedTrigger, K as authAccessTokenRevokedTrigger, L as IdpUserUpdatedArgs, M as AuthAccessTokenTrigger, N as IdpUserArgs, O as AuthAccessTokenArgs, P as IdpUserCreatedArgs, Q as recordCreatedTrigger, R as RecordCreatedArgs, S as IncomingWebhookTrigger, St as MachineUserName, T as ScheduleArgs, U as TailorDBTrigger, V as ResolverExecutedArgs, W as authAccessTokenIssuedTrigger, X as idpUserTrigger, Y as idpUserDeletedTrigger, Z as idpUserUpdatedTrigger, _ as Trigger, _t as AuthInvoker, a as defineGenerators, at as Operation, b as IncomingWebhookResponse, bt as IdpNameRegistry, c as defineIdp, ct as Workflow, d as unsafeAllowAllIdPPermission, dt as WORKFLOW_TEST_ENV_KEY, et as recordTrigger, f as defineStaticWebSite, ft as WorkflowJob, g as createExecutor, gt as createResolver, h as defineWaitPoints, ht as QueryType, i as defineConfig, it as GqlOperation, j as AuthAccessTokenRevokedArgs, k as AuthAccessTokenIssuedArgs, l as IdPPermission, lt as WorkflowConfig, m as defineWaitPoint, mt as createWorkflowJob, n as output, nt as resolverExecutedTrigger, o as definePlugins, ot as WebhookOperation, p as WaitPointInstance, pt as WorkflowJobContext, q as authAccessTokenTrigger, r as t, rt as FunctionOperation, s as defineSecretManager, st as WorkflowOperation, t as __Infer, tt as recordUpdatedTrigger, u as IdPPermissionCondition, ut as createWorkflow, v as IncomingWebhookArgs, vt as defineAuth, w as incomingWebhookTrigger, x as IncomingWebhookResponseConfig, xt as TailorField, y as IncomingWebhookRequest, yt as IdpName, z as RecordDeletedArgs } from "../index-UySZfxON.mjs";
|
|
2
|
+
import { B as BeforeLoginHookArgs, C as ResolverReadyContext, Ct as SCIMAuthorization, Et as TenantProvider, F as AuthConfig, G as UserAttributeListKey, H as OAuth2ClientGrantType, Ht as TailorUser, I as AuthConnectionTokenResult, J as ValueOperand, K as UserAttributeMap, L as AuthExternalConfig, Lt as AttributeList, Q as Resolver, R as AuthOwnConfig, Rt as AttributeMap, S as ResolverNamespaceData, St as SCIMAttributeMapping, T as TailorDBReadyContext, Tt as SCIMResource, U as SCIMAttributeType, Ut as unauthenticatedTailorUser, V as DefinedAuth, Vt as TailorInvoker, W as UserAttributeKey, X as AuthConnectionConfig, Z as AuthConnectionOAuth2Config, _ as PluginProcessContext, _t as IdProvider, a as NamespacePluginOutput, b as ExecutorReadyContext, bt as SAML, c as PluginConfigs, d as PluginGeneratedExecutor, f as PluginGeneratedExecutorWithFile, g as PluginOutput, gt as IDToken, h as PluginNamespaceProcessContext, ht as BuiltinIdP, l as PluginExecutorContext, m as PluginGeneratedType, o as Plugin, p as PluginGeneratedResolver, q as UsernameFieldKey, s as PluginAttachment, u as PluginExecutorContextBase, v as TailorDBTypeForPlugin, vt as OAuth2ClientInput, w as TailorDBNamespaceData, wt as SCIMConfig, x as GeneratorResult, xt as SCIMAttribute, y as TypePluginOutput, yt as OIDC, z as AuthServiceInput } from "../tailor-db-field-D0qg8s4U.mjs";
|
|
3
|
+
import { A as PermissionCondition, D as TailorDBInstance, E as TailorDBField, M as TailorTypePermission, N as unsafeAllowAllGqlPermission, O as TailorDBType, P as unsafeAllowAllTypePermission, S as IdPGqlOperationsInput, T as TailorAnyDBType, _ as IdPExternalConfig, a as ExecutorServiceInput, b as IdPEmailConfig, c as ResolverServiceInput, d as StaticWebsiteConfig, g as IdPConfig, i as ExecutorServiceConfig, j as TailorTypeGqlPermission, k as db, l as WorkflowServiceConfig, m as SecretsConfig, n as RetryPolicy, o as ResolverExternalConfig, s as ResolverServiceConfig, t as ConcurrencyPolicy, u as WorkflowServiceInput, w as TailorAnyDBField, x as IdPGqlOperations } from "../workflow.generated-dBixCwUo.mjs";
|
|
5
4
|
import { t as Env } from "../env-B-g-qgE4.mjs";
|
|
5
|
+
import { $ as recordDeletedTrigger, A as AuthAccessTokenRefreshedArgs, B as RecordUpdatedArgs, C as IncomingWebhookTriggerOptions, Ct as MachineUserNameRegistry, D as scheduleTrigger, E as ScheduleTrigger, F as IdpUserDeletedArgs, G as authAccessTokenRefreshedTrigger, H as ResolverExecutedTrigger, I as IdpUserTrigger, J as idpUserCreatedTrigger, K as authAccessTokenRevokedTrigger, L as IdpUserUpdatedArgs, M as AuthAccessTokenTrigger, N as IdpUserArgs, O as AuthAccessTokenArgs, P as IdpUserCreatedArgs, Q as recordCreatedTrigger, R as RecordCreatedArgs, S as IncomingWebhookTrigger, St as MachineUserName, T as ScheduleArgs, U as TailorDBTrigger, V as ResolverExecutedArgs, W as authAccessTokenIssuedTrigger, X as idpUserTrigger, Y as idpUserDeletedTrigger, Z as idpUserUpdatedTrigger, _ as Trigger, _t as AuthInvoker, a as defineGenerators, at as Operation, b as IncomingWebhookResponse, bt as IdpNameRegistry, c as defineIdp, ct as Workflow, d as unsafeAllowAllIdPPermission, dt as WORKFLOW_TEST_ENV_KEY, et as recordTrigger, f as defineStaticWebSite, ft as WorkflowJob, g as createExecutor, gt as createResolver, h as defineWaitPoints, ht as QueryType, i as defineConfig, it as GqlOperation, j as AuthAccessTokenRevokedArgs, k as AuthAccessTokenIssuedArgs, l as IdPPermission, lt as WorkflowConfig, m as defineWaitPoint, mt as createWorkflowJob, n as output, nt as resolverExecutedTrigger, o as definePlugins, ot as WebhookOperation, p as WaitPointInstance, pt as WorkflowJobContext, q as authAccessTokenTrigger, r as t, rt as FunctionOperation, s as defineSecretManager, st as WorkflowOperation, t as __Infer, tt as recordUpdatedTrigger, u as IdPPermissionCondition, ut as createWorkflow, v as IncomingWebhookArgs, vt as defineAuth, w as incomingWebhookTrigger, x as IncomingWebhookResponseConfig, xt as TailorField, y as IncomingWebhookRequest, yt as IdpName, z as RecordDeletedArgs } from "../index-BTLgs0DP.mjs";
|
|
6
6
|
export { type AttributeList, type AttributeMap, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, AuthInvoker, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type DefinedAuth, type Env, type ExecutorReadyContext, type ExecutorServiceConfig, type ExecutorServiceInput, FunctionOperation, type GeneratorResult, GqlOperation, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, type IdpName, type IdpNameRegistry, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedType, type PluginNamespaceProcessContext, type PluginOutput, type PluginProcessContext, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverNamespaceData, type ResolverReadyContext, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, TailorDBTrigger, type TailorDBType, type TailorDBTypeForPlugin, type TailorField, type TailorInvoker, type TailorTypeGqlPermission, type TailorTypePermission, type TailorUser, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WORKFLOW_TEST_ENV_KEY, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createResolver, createWorkflow, createWorkflowJob, db, defineAuth, defineConfig, defineGenerators, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWaitPoint, defineWaitPoints, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as ResolverInput, At as FieldMetadata, Bt as InferredAttributeMap, Dt as ArrayFieldOutput, Ft as FieldValidateInput, G as UserAttributeListKey, Gt as JsonCompatible, Ht as TailorUser, Jt as output$1, K as UserAttributeMap, Kt as JsonValue, Mt as FieldOutput, Nt as TailorFieldType, Ot as DefinedFieldMetadata, Q as Resolver, V as DefinedAuth, Vt as TailorInvoker, Wt as InferFieldsOutput, Y as TailorField$1, at as FunctionOperation$1, ct as IncomingWebhookTrigger$1, dt as TailorDBTrigger$1, et as GeneratorConfig, ft as WebhookOperation$1, it as ExecutorInput, jt as FieldOptions, lt as ResolverExecutedTrigger$1, mt as AuthInvoker$1, nt as AuthAccessTokenTrigger$1, o as Plugin, ot as GqlOperation$1, pt as WorkflowOperation$1, qt as Prettify, st as IdpUserTrigger$1, tt as BaseGeneratorConfig, ut as ScheduleTriggerInput, z as AuthServiceInput } from "./tailor-db-field-
|
|
2
|
-
import { C as IdPInput, D as TailorDBInstance, F as AllowedValues, I as AllowedValuesOutput, O as TailorDBType, f as StaticWebsiteDefinitionBrand, h as SecretsDefinitionBrand, n as RetryPolicy, p as StaticWebsiteInput, r as AppConfig, t as ConcurrencyPolicy, v as IdPUserField, y as IdpDefinitionBrand } from "./workflow.generated-
|
|
1
|
+
import { $ as ResolverInput, At as FieldMetadata, Bt as InferredAttributeMap, Dt as ArrayFieldOutput, Ft as FieldValidateInput, G as UserAttributeListKey, Gt as JsonCompatible, Ht as TailorUser, Jt as output$1, K as UserAttributeMap, Kt as JsonValue, Mt as FieldOutput, Nt as TailorFieldType, Ot as DefinedFieldMetadata, Q as Resolver, V as DefinedAuth, Vt as TailorInvoker, Wt as InferFieldsOutput, Y as TailorField$1, at as FunctionOperation$1, ct as IncomingWebhookTrigger$1, dt as TailorDBTrigger$1, et as GeneratorConfig, ft as WebhookOperation$1, it as ExecutorInput, jt as FieldOptions, lt as ResolverExecutedTrigger$1, mt as AuthInvoker$1, nt as AuthAccessTokenTrigger$1, o as Plugin, ot as GqlOperation$1, pt as WorkflowOperation$1, qt as Prettify, st as IdpUserTrigger$1, tt as BaseGeneratorConfig, ut as ScheduleTriggerInput, z as AuthServiceInput } from "./tailor-db-field-D0qg8s4U.mjs";
|
|
2
|
+
import { C as IdPInput, D as TailorDBInstance, F as AllowedValues, I as AllowedValuesOutput, O as TailorDBType, f as StaticWebsiteDefinitionBrand, h as SecretsDefinitionBrand, n as RetryPolicy, p as StaticWebsiteInput, r as AppConfig, t as ConcurrencyPolicy, v as IdPUserField, y as IdpDefinitionBrand } from "./workflow.generated-dBixCwUo.mjs";
|
|
3
3
|
import { n as TailorEnv } from "./env-B-g-qgE4.mjs";
|
|
4
|
-
import { t as TailorActor } from "./actor-
|
|
4
|
+
import { t as TailorActor } from "./actor-Cjae_LGD.mjs";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
import { Client } from "@urql/core";
|
|
7
7
|
import { StandardCRON } from "ts-cron-validator";
|
|
@@ -1122,4 +1122,4 @@ declare namespace t {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
//#endregion
|
|
1124
1124
|
export { recordDeletedTrigger as $, AuthAccessTokenRefreshedArgs as A, RecordUpdatedArgs as B, IncomingWebhookTriggerOptions as C, MachineUserNameRegistry as Ct, scheduleTrigger as D, ScheduleTrigger as E, IdpUserDeletedArgs as F, authAccessTokenRefreshedTrigger as G, ResolverExecutedTrigger as H, IdpUserTrigger as I, idpUserCreatedTrigger as J, authAccessTokenRevokedTrigger as K, IdpUserUpdatedArgs as L, AuthAccessTokenTrigger as M, IdpUserArgs as N, AuthAccessTokenArgs as O, IdpUserCreatedArgs as P, recordCreatedTrigger as Q, RecordCreatedArgs as R, IncomingWebhookTrigger as S, MachineUserName as St, ScheduleArgs as T, TailorDBTrigger as U, ResolverExecutedArgs as V, authAccessTokenIssuedTrigger as W, idpUserTrigger as X, idpUserDeletedTrigger as Y, idpUserUpdatedTrigger as Z, Trigger as _, AuthInvoker as _t, defineGenerators as a, Operation as at, IncomingWebhookResponse as b, IdpNameRegistry as bt, defineIdp as c, Workflow as ct, unsafeAllowAllIdPPermission as d, WORKFLOW_TEST_ENV_KEY as dt, recordTrigger as et, defineStaticWebSite as f, WorkflowJob as ft, createExecutor as g, createResolver as gt, defineWaitPoints as h, QueryType as ht, defineConfig as i, GqlOperation as it, AuthAccessTokenRevokedArgs as j, AuthAccessTokenIssuedArgs as k, IdPPermission as l, WorkflowConfig as lt, defineWaitPoint as m, createWorkflowJob as mt, output as n, resolverExecutedTrigger as nt, definePlugins as o, WebhookOperation as ot, WaitPointInstance as p, WorkflowJobContext as pt, authAccessTokenTrigger as q, t as r, FunctionOperation as rt, defineSecretManager as s, WorkflowOperation as st, infer as t, recordUpdatedTrigger as tt, IdPPermissionCondition as u, createWorkflow as ut, IncomingWebhookArgs as v, defineAuth as vt, incomingWebhookTrigger as w, IncomingWebhookResponseConfig as x, TailorField as xt, IncomingWebhookRequest as y, IdpName as yt, RecordDeletedArgs as z };
|
|
1125
|
-
//# sourceMappingURL=index-
|
|
1125
|
+
//# sourceMappingURL=index-BTLgs0DP.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as Plugin } from "./tailor-db-field-
|
|
1
|
+
import { o as Plugin } from "./tailor-db-field-D0qg8s4U.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/file-utils/index.d.ts
|
|
4
4
|
/** Unique identifier for the file utilities generator plugin. */
|
|
@@ -15,4 +15,4 @@ type FileUtilsPluginOptions = {
|
|
|
15
15
|
declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { fileUtilsPlugin as n, FileUtilsGeneratorID as t };
|
|
18
|
-
//# sourceMappingURL=index-
|
|
18
|
+
//# sourceMappingURL=index-Cf1Lo_XT.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as Plugin } from "./tailor-db-field-
|
|
1
|
+
import { o as Plugin } from "./tailor-db-field-D0qg8s4U.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/kysely-type/index.d.ts
|
|
4
4
|
/** Unique identifier for the Kysely type generator plugin. */
|
|
@@ -15,4 +15,4 @@ type KyselyTypePluginOptions = {
|
|
|
15
15
|
declare function kyselyTypePlugin(options: KyselyTypePluginOptions): Plugin<unknown, KyselyTypePluginOptions>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { kyselyTypePlugin as n, KyselyGeneratorID as t };
|
|
18
|
-
//# sourceMappingURL=index-
|
|
18
|
+
//# sourceMappingURL=index-CyyoHrPK.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as Plugin } from "./tailor-db-field-
|
|
1
|
+
import { o as Plugin } from "./tailor-db-field-D0qg8s4U.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/seed/index.d.ts
|
|
4
4
|
/** Unique identifier for the seed generator plugin. */
|
|
@@ -44,4 +44,4 @@ type SeedPluginOptions = {
|
|
|
44
44
|
declare function seedPlugin(options: SeedPluginOptions): Plugin<unknown, SeedPluginOptions>;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { seedPlugin as n, SeedGeneratorID as t };
|
|
47
|
-
//# sourceMappingURL=index-
|
|
47
|
+
//# sourceMappingURL=index-DrYHpTja.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as Plugin } from "./tailor-db-field-
|
|
1
|
+
import { o as Plugin } from "./tailor-db-field-D0qg8s4U.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/enum-constants/index.d.ts
|
|
4
4
|
/** Unique identifier for the enum constants generator plugin. */
|
|
@@ -15,4 +15,4 @@ type EnumConstantsPluginOptions = {
|
|
|
15
15
|
declare function enumConstantsPlugin(options: EnumConstantsPluginOptions): Plugin<unknown, EnumConstantsPluginOptions>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { enumConstantsPlugin as n, EnumConstantsGeneratorID as t };
|
|
18
|
-
//# sourceMappingURL=index-
|
|
18
|
+
//# sourceMappingURL=index-qQYMbkT-.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-
|
|
1
|
+
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-qQYMbkT-.mjs";
|
|
2
2
|
export { EnumConstantsGeneratorID, enumConstantsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-
|
|
1
|
+
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-Cf1Lo_XT.mjs";
|
|
2
2
|
export { FileUtilsGeneratorID, fileUtilsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-
|
|
1
|
+
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-CyyoHrPK.mjs";
|
|
2
2
|
export { KyselyGeneratorID, kyselyTypePlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-
|
|
1
|
+
import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-DrYHpTja.mjs";
|
|
2
2
|
export { SeedGeneratorID, seedPlugin };
|
package/dist/plugin/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as TailorAnyDBType } from "../tailor-db-field-
|
|
1
|
+
import { n as TailorAnyDBType } from "../tailor-db-field-D0qg8s4U.mjs";
|
|
2
2
|
import { n as TailorEnv } from "../env-B-g-qgE4.mjs";
|
|
3
|
-
import { t as TailorActor } from "../actor-
|
|
3
|
+
import { t as TailorActor } from "../actor-Cjae_LGD.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/plugin/with-context.d.ts
|
|
6
6
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as db } from "./schema-CQrYG_55.mjs";
|
|
3
3
|
import { $ as FilterSchema, A as FunctionExecution_Status, B as AuthOAuth2Client_GrantType, C as TailorDBType_Permission_Operator, D as IdPLang, E as PipelineResolver_OperationType, F as AuthConnection_Type, H as AuthSCIMAttribute_Type, I as AuthHookPoint, J as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, K as TenantProviderConfig_TenantProviderType, L as AuthIDPConfig_AuthType, M as ExecutorJobStatus, N as ExecutorTargetType, O as IdPPermissionOperator, P as ExecutorTriggerType, Q as Condition_Operator, R as AuthInvokerSchema, S as TailorDBGQLPermission_Permit, T as TailorDBType_PermitAction, U as AuthSCIMAttribute_Uniqueness, V as AuthSCIMAttribute_Mutability, W as AuthSCIMConfig_AuthorizationType, X as Subgraph_ServiceType, Y as ApplicationSchemaUpdateAttemptStatus, Z as ConditionSchema, _ as WorkspacePlatformUserRole, a as fetchMachineUserToken, b as TailorDBGQLPermission_Action, d as initOperatorClient, et as PageDirection, g as OperatorService, h as userAgent, i as fetchAll, k as IdPPermissionPermit, m as resolveStaticWebsiteUrls, o as fetchPaged, p as platformBaseUrl, q as UserProfileProviderConfig_UserProfileProviderType, v as WorkflowExecution_Status, w as TailorDBType_Permission_Permit, x as TailorDBGQLPermission_Operator, y as WorkflowJobExecution_Status, z as AuthOAuth2Client_ClientType } from "./client-CGO7gniI.mjs";
|
|
4
4
|
import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-DpJyJvNz.mjs";
|
|
5
|
-
import { C as loadConfigPath, O as writePlatformConfig, S as loadAccessToken, T as readPlatformConfig, _ as getDistDir, d as buildResolverOperationHookExpr, f as OAuth2ClientSchema, g as createBundleCache, h as loadFilesWithIgnores, m as stringifyFunction, n as generatePluginFilesIfNeeded, p as TailorDBTypeSchema, r as loadApplication, s as createExecutorService, t as defineApplication, u as buildExecutorArgsExpr, v as hashFile, w as loadWorkspaceId, y as loadConfig } from "./application-
|
|
5
|
+
import { C as loadConfigPath, O as writePlatformConfig, S as loadAccessToken, T as readPlatformConfig, _ as getDistDir, d as buildResolverOperationHookExpr, f as OAuth2ClientSchema, g as createBundleCache, h as loadFilesWithIgnores, m as stringifyFunction, n as generatePluginFilesIfNeeded, p as TailorDBTypeSchema, r as loadApplication, s as createExecutorService, t as defineApplication, u as buildExecutorArgsExpr, v as hashFile, w as loadWorkspaceId, y as loadConfig } from "./application-BfGje3iZ.mjs";
|
|
6
6
|
import { t as multiline } from "./multiline-Cf9ODpr1.mjs";
|
|
7
7
|
import { t as readPackageJson } from "./package-json-DcQApfPQ.mjs";
|
|
8
8
|
import { n as isCLIError, t as createCLIError } from "./errors-EsY4XO6O.mjs";
|
|
@@ -7442,9 +7442,10 @@ function applyPreMigrationFieldAdjustments(fields, typeChanges) {
|
|
|
7442
7442
|
* @param {string} sourceFile - Path to the migration script file
|
|
7443
7443
|
* @param {string} namespace - TailorDB namespace
|
|
7444
7444
|
* @param {number} migrationNumber - Migration number
|
|
7445
|
+
* @param {Record<string, string | number | boolean>} env - Environment variables to inject into the migration context
|
|
7445
7446
|
* @returns {Promise<MigrationBundleResult>} Bundled migration result
|
|
7446
7447
|
*/
|
|
7447
|
-
async function bundleMigrationScript(sourceFile, namespace, migrationNumber) {
|
|
7448
|
+
async function bundleMigrationScript(sourceFile, namespace, migrationNumber, env = {}) {
|
|
7448
7449
|
const outputDir = path.resolve(getDistDir(), "migrations");
|
|
7449
7450
|
fs$1.mkdirSync(outputDir, { recursive: true });
|
|
7450
7451
|
const entryPath = path.join(outputDir, `migration_${namespace}_${migrationNumber}.entry.js`);
|
|
@@ -7460,9 +7461,10 @@ async function bundleMigrationScript(sourceFile, namespace, migrationNumber) {
|
|
|
7460
7461
|
}
|
|
7461
7462
|
|
|
7462
7463
|
export async function main(input) {
|
|
7464
|
+
const env = ${JSON.stringify(env)};
|
|
7463
7465
|
const db = getDB("${namespace}");
|
|
7464
7466
|
await db.transaction().execute(async (trx) => {
|
|
7465
|
-
await _migrationMain(trx);
|
|
7467
|
+
await _migrationMain(trx, { env });
|
|
7466
7468
|
});
|
|
7467
7469
|
return { success: true };
|
|
7468
7470
|
}
|
|
@@ -7831,12 +7833,12 @@ async function detectPendingMigrations(client, workspaceId, namespacesWithMigrat
|
|
|
7831
7833
|
* @returns {Promise<ExecutionResult>} Execution result
|
|
7832
7834
|
*/
|
|
7833
7835
|
async function executeSingleMigration(options, migration) {
|
|
7834
|
-
const { client, workspaceId, authInvoker } = options;
|
|
7836
|
+
const { client, workspaceId, authInvoker, env } = options;
|
|
7835
7837
|
const result = await executeScript({
|
|
7836
7838
|
client,
|
|
7837
7839
|
workspaceId,
|
|
7838
7840
|
name: `migration-${migration.namespace}-${formatMigrationNumber(migration.number)}.js`,
|
|
7839
|
-
code: (await bundleMigrationScript(migration.scriptPath, migration.namespace, migration.number)).bundledCode,
|
|
7841
|
+
code: (await bundleMigrationScript(migration.scriptPath, migration.namespace, migration.number, env)).bundledCode,
|
|
7840
7842
|
invoker: authInvoker
|
|
7841
7843
|
});
|
|
7842
7844
|
return {
|
|
@@ -7889,7 +7891,8 @@ async function executeMigrations(context, migrations) {
|
|
|
7889
7891
|
const options = {
|
|
7890
7892
|
client: context.client,
|
|
7891
7893
|
workspaceId: context.workspaceId,
|
|
7892
|
-
authInvoker
|
|
7894
|
+
authInvoker,
|
|
7895
|
+
env: context.env
|
|
7893
7896
|
};
|
|
7894
7897
|
logger.info(`Using machine user: ${styles.bold(machineUserName)} for namespace '${namespace}'`);
|
|
7895
7898
|
for (const migration of namespaceMigrations) {
|
|
@@ -8130,7 +8133,8 @@ function buildMigrationContextForScripts(client, migrationContext, migrationsReq
|
|
|
8130
8133
|
workspaceId: migrationContext.workspaceId,
|
|
8131
8134
|
authNamespace: authService.config.name,
|
|
8132
8135
|
machineUsers: authService.config.machineUsers ? Object.keys(authService.config.machineUsers) : void 0,
|
|
8133
|
-
dbConfig: dbConfigMap
|
|
8136
|
+
dbConfig: dbConfigMap,
|
|
8137
|
+
env: migrationContext.config.env ?? {}
|
|
8134
8138
|
};
|
|
8135
8139
|
}
|
|
8136
8140
|
/**
|
|
@@ -13819,6 +13823,7 @@ function generateDbTypesFromSnapshot(snapshot, diff) {
|
|
|
13819
13823
|
" */",
|
|
13820
13824
|
"",
|
|
13821
13825
|
`import { ${imports.join(", ")} } from "@tailor-platform/sdk/kysely";`,
|
|
13826
|
+
"import type { Env } from \"@tailor-platform/sdk\";",
|
|
13822
13827
|
"",
|
|
13823
13828
|
...utilityTypeDeclarations,
|
|
13824
13829
|
"",
|
|
@@ -13826,7 +13831,12 @@ function generateDbTypesFromSnapshot(snapshot, diff) {
|
|
|
13826
13831
|
...typeDefinitions,
|
|
13827
13832
|
"}",
|
|
13828
13833
|
"",
|
|
13829
|
-
"export type Transaction = KyselyTransaction<Database>;"
|
|
13834
|
+
"export type Transaction = KyselyTransaction<Database>;",
|
|
13835
|
+
"",
|
|
13836
|
+
"/** Context passed as the second argument to the migration's `main` function. */",
|
|
13837
|
+
"export type MigrationContext = {",
|
|
13838
|
+
" env: keyof Env extends never ? Record<string, string | number | boolean> : Env;",
|
|
13839
|
+
"};"
|
|
13830
13840
|
].join("\n") + "\n";
|
|
13831
13841
|
}
|
|
13832
13842
|
/**
|
|
@@ -13844,11 +13854,17 @@ function generateEmptyDbTypes(namespace) {
|
|
|
13844
13854
|
" */",
|
|
13845
13855
|
"",
|
|
13846
13856
|
"import { type Transaction as KyselyTransaction } from \"@tailor-platform/sdk/kysely\";",
|
|
13857
|
+
"import type { Env } from \"@tailor-platform/sdk\";",
|
|
13847
13858
|
"",
|
|
13848
13859
|
"// eslint-disable-next-line @typescript-eslint/no-empty-object-type",
|
|
13849
13860
|
"interface Database {}",
|
|
13850
13861
|
"",
|
|
13851
|
-
"export type Transaction = KyselyTransaction<Database>;"
|
|
13862
|
+
"export type Transaction = KyselyTransaction<Database>;",
|
|
13863
|
+
"",
|
|
13864
|
+
"/** Context passed as the second argument to the migration's `main` function. */",
|
|
13865
|
+
"export type MigrationContext = {",
|
|
13866
|
+
" env: keyof Env extends never ? Record<string, string | number | boolean> : Env;",
|
|
13867
|
+
"};"
|
|
13852
13868
|
].join("\n") + "\n";
|
|
13853
13869
|
}
|
|
13854
13870
|
/**
|
|
@@ -14246,7 +14262,7 @@ async function generate(options) {
|
|
|
14246
14262
|
if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
|
|
14247
14263
|
let pluginManager;
|
|
14248
14264
|
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
14249
|
-
const { defineApplication } = await import("./application-
|
|
14265
|
+
const { defineApplication } = await import("./application-BsipSxp3.mjs");
|
|
14250
14266
|
const application = defineApplication({
|
|
14251
14267
|
config,
|
|
14252
14268
|
pluginManager
|
|
@@ -16433,4 +16449,4 @@ function isDeno() {
|
|
|
16433
16449
|
|
|
16434
16450
|
//#endregion
|
|
16435
16451
|
export { listCommand$5 as $, compareSnapshots as $t, truncate as A, workspaceArgs as An, startCommand as At, logBetaWarning as B, getExecutor as Bt, listCommand$2 as C, configArg as Cn, triggerExecutor as Ct, resumeWorkflow as D, pagedLogArgs as Dn, jobsCommand as Dt, resumeCommand as E, isVerbose as En, getExecutorJob as Et, writeDbTypesFile as F, getWorkflowExecution as Ft, organizationTree as G, parseMigrationLabelNumber as Gt, removeCommand$1 as H, executeScript as Ht, getConfiguredEditorCommand as I, listWorkflowExecutions as It, listOrganizations as J, DIFF_FILE_NAME as Jt, treeCommand as K, bundleMigrationScript as Kt, openInConfiguredEditor as L, functionExecutionStatusToString as Lt, generate as M, getCommand$5 as Mt, generateCommand as N, getWorkflow as Nt, listCommand$3 as O, paginationArgs as On, listExecutorJobs as Ot, generateMigrationScript as P, executionsCommand as Pt, updateFolder as Q, compareLocalTypesWithSnapshot as Qt, show as R, formatKeyValueTable as Rt, listApps as S, commonArgs as Sn, triggerCommand as St, healthCommand as T, deploymentArgs as Tn, listExecutors as Tt, updateCommand$1 as U, waitForExecution$1 as Ut, remove as V, deploy as Vt, updateOrganization as W, MIGRATION_LABEL_KEY as Wt, getOrganization as X, MIGRATE_FILE_NAME as Xt, getCommand$1 as Y, INITIAL_SCHEMA_NUMBER as Yt, updateCommand$2 as Z, SCHEMA_FILE_NAME as Zt, getWorkspace as _, prompt as _n, listFunctionRegistries as _t, updateUser as a, getMigrationFiles as an, createCommand$1 as at, createCommand as b, assertWritable as bn, listWebhookExecutors as bt, listCommand as c, loadDiff as cn, listOAuth2Clients as ct, inviteUser as d, formatMigrationDiff as dn, getMachineUserToken as dt, createSnapshotFromLocalTypes as en, listFolders as et, restoreCommand as f, hasChanges as fn, tokenCommand as ft, getCommand as g, generateUserTypes as gn, listCommand$8 as gt, listWorkspaces as h, trnPrefix as hn, generate$1 as ht, updateCommand as i, getMigrationFilePath as in, deleteFolder as it, truncateCommand as j, startWorkflow as jt, listWorkflows as k, toPageDirection as kn, watchExecutorJob as kt, listUsers as l, reconstructSnapshotFromMigrations as ln, getCommand$3 as lt, listCommand$1 as m, sdkNameLabelKey as mn, listMachineUsers as mt, query as n, getLatestMigrationNumber as nn, getFolder as nt, removeCommand as o, getNextMigrationNumber as on, createFolder as ot, restoreWorkspace as p, getNamespacesWithMigrations as pn, listCommand$7 as pt, listCommand$4 as q, DB_TYPES_FILE_NAME as qt, queryCommand as r, getMigrationDirPath as rn, deleteCommand$1 as rt, removeUser as s, isValidMigrationNumber as sn, listCommand$6 as st, isNativeTypeScriptRuntime as t, formatMigrationNumber as tn, getCommand$2 as tt, inviteCommand as u, formatDiffSummary as un, getOAuth2Client as ut, deleteCommand as v, apiCommand as vn, getCommand$4 as vt, getAppHealth as w, confirmationArgs as wn, listCommand$9 as wt, createWorkspace as x, defineAppCommand as xn, webhookCommand as xt, deleteWorkspace as y, apiCall as yn, getFunctionRegistry as yt, showCommand as z, getCommand$6 as zt };
|
|
16436
|
-
//# sourceMappingURL=runtime-
|
|
16452
|
+
//# sourceMappingURL=runtime-CQRrqhlV.mjs.map
|