@tailor-platform/sdk 1.10.0 → 1.11.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 +16 -0
- package/dist/{application-R26DC-sK.mjs → application-BKBo5tGD.mjs} +4 -1
- package/dist/application-BKBo5tGD.mjs.map +1 -0
- package/dist/application-a12-7TT3.mjs +4 -0
- package/dist/cli/index.mjs +25 -19
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +58 -1
- package/dist/cli/lib.mjs +3 -3
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/configure/index.d.mts +1 -1
- package/dist/{index-DnoS_Mi4.d.mts → index-D8zIUsWi.d.mts} +9 -9
- package/dist/{update-C877GWkA.mjs → update-D0muqqOP.mjs} +544 -173
- package/dist/update-D0muqqOP.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +1 -1
- package/docs/cli/executor.md +183 -52
- package/package.json +1 -1
- package/dist/application-COnpGp0d.mjs +0 -4
- package/dist/application-R26DC-sK.mjs.map +0 -1
- package/dist/update-C877GWkA.mjs.map +0 -1
package/dist/cli/lib.d.mts
CHANGED
|
@@ -17588,6 +17588,21 @@ interface ExecutorJobAttemptInfo {
|
|
|
17588
17588
|
finishedAt: string;
|
|
17589
17589
|
operationReference: string;
|
|
17590
17590
|
}
|
|
17591
|
+
interface ExecutorListInfo {
|
|
17592
|
+
name: string;
|
|
17593
|
+
triggerType: string;
|
|
17594
|
+
targetType: string;
|
|
17595
|
+
disabled: boolean;
|
|
17596
|
+
}
|
|
17597
|
+
interface ExecutorInfo {
|
|
17598
|
+
name: string;
|
|
17599
|
+
description: string;
|
|
17600
|
+
triggerType: string;
|
|
17601
|
+
targetType: string;
|
|
17602
|
+
disabled: boolean;
|
|
17603
|
+
triggerConfig: string;
|
|
17604
|
+
targetConfig: string;
|
|
17605
|
+
}
|
|
17591
17606
|
//#endregion
|
|
17592
17607
|
//#region src/cli/executor/jobs.d.ts
|
|
17593
17608
|
interface ListExecutorJobsOptions {
|
|
@@ -17649,6 +17664,48 @@ declare function getExecutorJob(options: GetExecutorJobOptions): Promise<Executo
|
|
|
17649
17664
|
*/
|
|
17650
17665
|
declare function watchExecutorJob(options: WatchExecutorJobOptions): Promise<WatchExecutorJobResult>;
|
|
17651
17666
|
//#endregion
|
|
17667
|
+
//#region src/cli/executor/list.d.ts
|
|
17668
|
+
interface ListExecutorsOptions {
|
|
17669
|
+
workspaceId?: string;
|
|
17670
|
+
profile?: string;
|
|
17671
|
+
}
|
|
17672
|
+
/**
|
|
17673
|
+
* List executors in the workspace and return CLI-friendly info.
|
|
17674
|
+
* @param options - Executor listing options
|
|
17675
|
+
* @returns List of executors
|
|
17676
|
+
*/
|
|
17677
|
+
declare function listExecutors(options?: ListExecutorsOptions): Promise<ExecutorListInfo[]>;
|
|
17678
|
+
//#endregion
|
|
17679
|
+
//#region src/cli/executor/get.d.ts
|
|
17680
|
+
interface GetExecutorOptions {
|
|
17681
|
+
name: string;
|
|
17682
|
+
workspaceId?: string;
|
|
17683
|
+
profile?: string;
|
|
17684
|
+
}
|
|
17685
|
+
/**
|
|
17686
|
+
* Get an executor by name and return CLI-friendly info.
|
|
17687
|
+
* @param options - Executor lookup options
|
|
17688
|
+
* @returns Executor information
|
|
17689
|
+
*/
|
|
17690
|
+
declare function getExecutor(options: GetExecutorOptions): Promise<ExecutorInfo>;
|
|
17691
|
+
//#endregion
|
|
17692
|
+
//#region src/cli/executor/webhook.d.ts
|
|
17693
|
+
interface WebhookExecutorInfo {
|
|
17694
|
+
name: string;
|
|
17695
|
+
webhookUrl: string;
|
|
17696
|
+
disabled: boolean;
|
|
17697
|
+
}
|
|
17698
|
+
interface ListWebhookExecutorsOptions {
|
|
17699
|
+
workspaceId?: string;
|
|
17700
|
+
profile?: string;
|
|
17701
|
+
}
|
|
17702
|
+
/**
|
|
17703
|
+
* List executors with incoming webhook triggers and return CLI-friendly info.
|
|
17704
|
+
* @param options - Listing options
|
|
17705
|
+
* @returns List of webhook executors with URLs
|
|
17706
|
+
*/
|
|
17707
|
+
declare function listWebhookExecutors(options?: ListWebhookExecutorsOptions): Promise<WebhookExecutorInfo[]>;
|
|
17708
|
+
//#endregion
|
|
17652
17709
|
//#region src/cli/context.d.ts
|
|
17653
17710
|
type LoadWorkspaceIdOptions = {
|
|
17654
17711
|
workspaceId?: string;
|
|
@@ -18071,5 +18128,5 @@ declare function waitForExecution(client: OperatorClient, workspaceId: string, e
|
|
|
18071
18128
|
*/
|
|
18072
18129
|
declare function executeScript(options: ScriptExecutionOptions): Promise<ScriptExecutionResult>;
|
|
18073
18130
|
//#endregion
|
|
18074
|
-
export { type AggregateArgs, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type ApplyOptions, type AuthInvoker, type BreakingChangeInfo, type CodeGenerator, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteWorkspaceOptions, type DependencyKind, type ExecutionWaitResult, type Executor, type ExecutorGenerator, type ExecutorInput, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type FullCodeGenerator, type FullInput, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListUsersOptions, type ListWorkflowExecutionsOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadedConfig, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationDiff, type MigrationInfo, type NamespaceWithMigrations, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type RemoveOptions, type RemoveUserOptions, type Resolver, type ResolverGenerator, type ResolverInput, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type SeedBundleResult, type ShowOptions, type SnapshotFieldConfig, type SnapshotType, type StartWorkflowOptions, type StartWorkflowResultWithWait, type TailorDBGenerator, type TailorDBInput, type TailorDBResolverGenerator, type TailorDBType, type TriggerExecutorOptions, type TriggerExecutorResult, type TruncateOptions, type UpdateUserOptions, type UserInfo, type WaitOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WorkflowExecutionInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkspaceDetails, type WorkspaceInfo, apiCall, apply, bundleSeedScript, compareLocalTypesWithSnapshot, compareSnapshots, createSnapshotFromLocalTypes, createWorkspace, deleteWorkspace, executeScript, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutorJob, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, listApps, listExecutorJobs, listMachineUsers, listOAuth2Clients, listUsers, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, show, startWorkflow, triggerExecutor, truncate, updateUser, waitForExecution, watchExecutorJob };
|
|
18131
|
+
export { type AggregateArgs, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type ApplyOptions, type AuthInvoker, type BreakingChangeInfo, type CodeGenerator, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteWorkspaceOptions, type DependencyKind, type ExecutionWaitResult, type Executor, type ExecutorGenerator, type ExecutorInfo, type ExecutorInput, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type ExecutorListInfo, type FullCodeGenerator, type FullInput, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobOptions, type GetExecutorOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsOptions, type ListExecutorsOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListUsersOptions, type ListWebhookExecutorsOptions, type ListWorkflowExecutionsOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadedConfig, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationDiff, type MigrationInfo, type NamespaceWithMigrations, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type RemoveOptions, type RemoveUserOptions, type Resolver, type ResolverGenerator, type ResolverInput, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type SeedBundleResult, type ShowOptions, type SnapshotFieldConfig, type SnapshotType, type StartWorkflowOptions, type StartWorkflowResultWithWait, type TailorDBGenerator, type TailorDBInput, type TailorDBResolverGenerator, type TailorDBType, type TriggerExecutorOptions, type TriggerExecutorResult, type TruncateOptions, type UpdateUserOptions, type UserInfo, type WaitOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkspaceDetails, type WorkspaceInfo, apiCall, apply, bundleSeedScript, compareLocalTypesWithSnapshot, compareSnapshots, createSnapshotFromLocalTypes, createWorkspace, deleteWorkspace, executeScript, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, listApps, listExecutorJobs, listExecutors, listMachineUsers, listOAuth2Clients, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, show, startWorkflow, triggerExecutor, truncate, updateUser, waitForExecution, watchExecutorJob };
|
|
18075
18132
|
//# sourceMappingURL=lib.d.mts.map
|
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-CIV_ash9.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { u as logger } from "../application-
|
|
2
|
+
import { At as getNextMigrationNumber, B as getMachineUserToken, Bt as loadConfig, Ct as compareSnapshots, D as truncate, Dt as getMigrationDirPath, E as listWorkflows, Et as getLatestMigrationNumber, Ft as formatMigrationDiff, Gt as loadAccessToken, Ht as apiCall, It as hasChanges, K as listWebhookExecutors, Kt as loadWorkspaceId, L as listOAuth2Clients, Lt as getNamespacesWithMigrations, M as show, Nt as reconstructSnapshotFromMigrations, Ot as getMigrationFilePath, P as remove, Pt as formatDiffSummary, Q as getExecutorJob, Qt as initOperatorClient, St as compareLocalTypesWithSnapshot, U as listMachineUsers, Vt as getDistDir, W as generate, Y as triggerExecutor, Z as listExecutors, _t as DB_TYPES_FILE_NAME, at as getWorkflow, bt as MIGRATE_FILE_NAME, c as inviteUser, ct as listWorkflowExecutions, dt as apply, et as listExecutorJobs, f as listWorkspaces, g as deleteWorkspace, ht as MIGRATION_LABEL_KEY, i as removeUser, k as generate$1, kt as getMigrationFiles, m as getWorkspace, mt as waitForExecution, n as updateUser, o as listUsers, pt as executeScript, rt as startWorkflow, st as getWorkflowExecution, tt as watchExecutorJob, u as restoreWorkspace, ut as getExecutor, v as createWorkspace, vt as DIFF_FILE_NAME, w as resumeWorkflow, wt as createSnapshotFromLocalTypes, x as getAppHealth, xt as SCHEMA_FILE_NAME, y as listApps, yt as INITIAL_SCHEMA_NUMBER, z as getOAuth2Client, zt as generateUserTypes } from "../update-D0muqqOP.mjs";
|
|
3
|
+
import { u as logger } from "../application-BKBo5tGD.mjs";
|
|
4
4
|
import { createRequire, register } from "node:module";
|
|
5
5
|
import * as fs$1 from "node:fs";
|
|
6
6
|
import * as path from "pathe";
|
|
@@ -156,5 +156,5 @@ async function bundleSeedScript(namespace, typeNames) {
|
|
|
156
156
|
register("tsx", import.meta.url, { data: {} });
|
|
157
157
|
|
|
158
158
|
//#endregion
|
|
159
|
-
export { DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, SCHEMA_FILE_NAME, apiCall, apply, bundleSeedScript, compareLocalTypesWithSnapshot, compareSnapshots, createSnapshotFromLocalTypes, createWorkspace, deleteWorkspace, executeScript, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutorJob, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, listApps, listExecutorJobs, listMachineUsers, listOAuth2Clients, listUsers, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, show, startWorkflow, triggerExecutor, truncate, updateUser, waitForExecution, watchExecutorJob };
|
|
159
|
+
export { DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, SCHEMA_FILE_NAME, apiCall, apply, bundleSeedScript, compareLocalTypesWithSnapshot, compareSnapshots, createSnapshotFromLocalTypes, createWorkspace, deleteWorkspace, executeScript, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, listApps, listExecutorJobs, listExecutors, listMachineUsers, listOAuth2Clients, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, show, startWorkflow, triggerExecutor, truncate, updateUser, waitForExecution, watchExecutorJob };
|
|
160
160
|
//# sourceMappingURL=lib.mjs.map
|
package/dist/cli/lib.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.mjs","names":["fs"],"sources":["../../src/cli/bundler/seed/seed-bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport ml from \"multiline-ts\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"@/cli/utils/dist-dir\";\nimport { logger } from \"@/cli/utils/logger\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst REQUIRED_PACKAGES = [\"kysely\", \"@tailor-platform/function-kysely-tailordb\"] as const;\n\nlet dependencyCheckDone = false;\n\n/**\n * Check if required packages for seed bundling are installed.\n * Logs a warning if any are missing.\n */\nfunction checkSeedDependencies(): void {\n if (dependencyCheckDone) return;\n dependencyCheckDone = true;\n\n const require = createRequire(path.resolve(process.cwd(), \"package.json\"));\n const missing: string[] = [];\n\n for (const pkg of REQUIRED_PACKAGES) {\n try {\n require.resolve(pkg);\n } catch {\n missing.push(pkg);\n }\n }\n\n if (missing.length > 0) {\n logger.warn(\n `Missing optional dependencies for seed bundling: ${missing.join(\", \")}. ` +\n `Install them in your project: pnpm add -D ${missing.join(\" \")}`,\n );\n }\n}\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely } from \"kysely\";\n import { TailordbDialect } from \"@tailor-platform/function-kysely-tailordb\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, number>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<string, number> = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = 0;\n\n try {\n for (let i = 0; i < records.length; i += BATCH_SIZE) {\n const batch = records.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName] += batch.length;\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length}\\`);\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n): Promise<SeedBundleResult> {\n // Check for required dependencies (only once per session)\n checkSeedDependencies();\n\n // Output directory in .tailor-sdk (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n const outputPath = path.join(outputDir, `seed_${namespace}.js`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig();\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking\n await rolldown.build(\n rolldown.defineConfig({\n input: entryPath,\n output: {\n file: outputPath,\n format: \"esm\",\n sourcemap: false,\n minify: false,\n inlineDynamicImports: true,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n logLevel: \"silent\",\n }) as rolldown.BuildOptions,\n );\n\n // Read bundled output\n const bundledCode = fs.readFileSync(outputPath, \"utf-8\");\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./apply/index\";\nexport type { ApplyOptions } from \"./apply/index\";\nexport { generate } from \"./generator/index\";\nexport type { GenerateOptions } from \"./generator/options\";\nexport { loadConfig, type LoadedConfig } from \"./config-loader\";\nexport { generateUserTypes } from \"./type-generator\";\nexport type {\n CodeGenerator,\n TailorDBGenerator,\n ResolverGenerator,\n ExecutorGenerator,\n TailorDBResolverGenerator,\n FullCodeGenerator,\n TailorDBInput,\n ResolverInput,\n ExecutorInput,\n FullInput,\n AggregateArgs,\n GeneratorResult,\n DependencyKind,\n} from \"./generator/types\";\nexport type { TailorDBType } from \"@/parser/service/tailordb/types\";\nexport type { Resolver } from \"@/parser/service/resolver\";\nexport type { Executor } from \"@/parser/service/executor\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./show\";\nexport { remove, type RemoveOptions } from \"./remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./workspace/user/remove\";\nexport type { UserInfo } from \"./workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./workspace/app/list\";\nexport { getAppHealth, type HealthOptions as GetAppHealthOptions } from \"./workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./workspace/app/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./workflow/list\";\nexport { getWorkflow, type GetWorkflowOptions } from \"./workflow/get\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n} from \"./workflow/executions\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorOptions,\n type TriggerExecutorResult,\n} from \"./executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n watchExecutorJob,\n type ListExecutorJobsOptions,\n type GetExecutorJobOptions,\n type WatchExecutorJobOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./executor/jobs\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n} from \"./executor/transform\";\nexport { loadAccessToken, loadWorkspaceId } from \"./context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./api\";\nexport { truncate, type TruncateOptions } from \"./tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type SnapshotType,\n type SnapshotFieldConfig,\n type MigrationInfo,\n} from \"./tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./tailordb/migrate/types\";\n\n// Seed exports\nexport { bundleSeedScript, type SeedBundleResult } from \"./bundler/seed/seed-bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ExecutionWaitResult,\n} from \"./utils/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./client\";\nexport type { AuthInvoker } from \"@tailor-proto/tailor/v1/auth_resource_pb\";\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAM,oBAAoB,CAAC,UAAU,4CAA4C;AAEjF,IAAI,sBAAsB;;;;;AAM1B,SAAS,wBAA8B;AACrC,KAAI,oBAAqB;AACzB,uBAAsB;CAEtB,MAAM,UAAU,cAAc,KAAK,QAAQ,QAAQ,KAAK,EAAE,eAAe,CAAC;CAC1E,MAAM,UAAoB,EAAE;AAE5B,MAAK,MAAM,OAAO,kBAChB,KAAI;AACF,UAAQ,QAAQ,IAAI;SACd;AACN,UAAQ,KAAK,IAAI;;AAIrB,KAAI,QAAQ,SAAS,EACnB,QAAO,KACL,oDAAoD,QAAQ,KAAK,KAAK,CAAC,8CACxB,QAAQ,KAAK,IAAI,GACjE;;AAIL,MAAM,aAAa;;;;;;AAOnB,SAAS,0BAA0B,WAA2B;AAC5D,QAAO,EAAY;;;;;;;;;;;;;;;;;;;;;;;0BAuBK,UAAU;;;2BAGT,OAAO,WAAW,CAAC;;;;;2BAKnB,UAAU;;;;;;;;;;;6BAWR,UAAU;;;;;6BAKV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;AAyBvC,eAAsB,iBACpB,WACA,WAC2B;AAE3B,wBAAuB;CAGvB,MAAM,YAAY,KAAK,QAAQ,YAAY,EAAE,OAAO;AACpD,MAAG,UAAU,WAAW,EAAE,WAAW,MAAM,CAAC;CAG5C,MAAM,YAAY,KAAK,KAAK,WAAW,QAAQ,UAAU,WAAW;CACpE,MAAM,aAAa,KAAK,KAAK,WAAW,QAAQ,UAAU,KAAK;CAG/D,MAAM,eAAe,0BAA0B,UAAU;AACzD,MAAG,cAAc,WAAW,aAAa;CAEzC,IAAI;AACJ,KAAI;AACF,aAAW,MAAM,iBAAiB;SAC5B;AACN,aAAW;;AAIb,OAAM,SAAS,MACb,SAAS,aAAa;EACpB,OAAO;EACP,QAAQ;GACN,MAAM;GACN,QAAQ;GACR,WAAW;GACX,QAAQ;GACR,sBAAsB;GACtB,SAAS,EACP,UAAU,YACX;GACF;EACD,UAAU,CAAC,WAAW;EACtB,SAAS,EACP,gBAAgB,CAAC,QAAQ,SAAS,EACnC;EACD;EACA,WAAW;GACT,mBAAmB;GACnB,aAAa;GACb,0BAA0B;GAC3B;EACD,UAAU;EACX,CAAC,CACH;AAKD,QAAO;EACL;EACA,aAJkBA,KAAG,aAAa,YAAY,QAAQ;EAKtD,eAAe;EAChB;;;;;AC7LH,SAAS,OAAO,OAAO,KAAK,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"lib.mjs","names":["fs"],"sources":["../../src/cli/bundler/seed/seed-bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport ml from \"multiline-ts\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"@/cli/utils/dist-dir\";\nimport { logger } from \"@/cli/utils/logger\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst REQUIRED_PACKAGES = [\"kysely\", \"@tailor-platform/function-kysely-tailordb\"] as const;\n\nlet dependencyCheckDone = false;\n\n/**\n * Check if required packages for seed bundling are installed.\n * Logs a warning if any are missing.\n */\nfunction checkSeedDependencies(): void {\n if (dependencyCheckDone) return;\n dependencyCheckDone = true;\n\n const require = createRequire(path.resolve(process.cwd(), \"package.json\"));\n const missing: string[] = [];\n\n for (const pkg of REQUIRED_PACKAGES) {\n try {\n require.resolve(pkg);\n } catch {\n missing.push(pkg);\n }\n }\n\n if (missing.length > 0) {\n logger.warn(\n `Missing optional dependencies for seed bundling: ${missing.join(\", \")}. ` +\n `Install them in your project: pnpm add -D ${missing.join(\" \")}`,\n );\n }\n}\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely } from \"kysely\";\n import { TailordbDialect } from \"@tailor-platform/function-kysely-tailordb\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, number>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<string, number> = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = 0;\n\n try {\n for (let i = 0; i < records.length; i += BATCH_SIZE) {\n const batch = records.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName] += batch.length;\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length}\\`);\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n): Promise<SeedBundleResult> {\n // Check for required dependencies (only once per session)\n checkSeedDependencies();\n\n // Output directory in .tailor-sdk (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n const outputPath = path.join(outputDir, `seed_${namespace}.js`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig();\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking\n await rolldown.build(\n rolldown.defineConfig({\n input: entryPath,\n output: {\n file: outputPath,\n format: \"esm\",\n sourcemap: false,\n minify: false,\n inlineDynamicImports: true,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n logLevel: \"silent\",\n }) as rolldown.BuildOptions,\n );\n\n // Read bundled output\n const bundledCode = fs.readFileSync(outputPath, \"utf-8\");\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./apply/index\";\nexport type { ApplyOptions } from \"./apply/index\";\nexport { generate } from \"./generator/index\";\nexport type { GenerateOptions } from \"./generator/options\";\nexport { loadConfig, type LoadedConfig } from \"./config-loader\";\nexport { generateUserTypes } from \"./type-generator\";\nexport type {\n CodeGenerator,\n TailorDBGenerator,\n ResolverGenerator,\n ExecutorGenerator,\n TailorDBResolverGenerator,\n FullCodeGenerator,\n TailorDBInput,\n ResolverInput,\n ExecutorInput,\n FullInput,\n AggregateArgs,\n GeneratorResult,\n DependencyKind,\n} from \"./generator/types\";\nexport type { TailorDBType } from \"@/parser/service/tailordb/types\";\nexport type { Resolver } from \"@/parser/service/resolver\";\nexport type { Executor } from \"@/parser/service/executor\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./show\";\nexport { remove, type RemoveOptions } from \"./remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./workspace/user/remove\";\nexport type { UserInfo } from \"./workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./workspace/app/list\";\nexport { getAppHealth, type HealthOptions as GetAppHealthOptions } from \"./workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./workspace/app/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./workflow/list\";\nexport { getWorkflow, type GetWorkflowOptions } from \"./workflow/get\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n} from \"./workflow/executions\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorOptions,\n type TriggerExecutorResult,\n} from \"./executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n watchExecutorJob,\n type ListExecutorJobsOptions,\n type GetExecutorJobOptions,\n type WatchExecutorJobOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./executor/list\";\nexport { getExecutor, type GetExecutorOptions } from \"./executor/get\";\nexport {\n listWebhookExecutors,\n type ListWebhookExecutorsOptions,\n type WebhookExecutorInfo,\n} from \"./executor/webhook\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n ExecutorListInfo,\n ExecutorInfo,\n} from \"./executor/transform\";\nexport { loadAccessToken, loadWorkspaceId } from \"./context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./api\";\nexport { truncate, type TruncateOptions } from \"./tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type SnapshotType,\n type SnapshotFieldConfig,\n type MigrationInfo,\n} from \"./tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./tailordb/migrate/types\";\n\n// Seed exports\nexport { bundleSeedScript, type SeedBundleResult } from \"./bundler/seed/seed-bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ExecutionWaitResult,\n} from \"./utils/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./client\";\nexport type { AuthInvoker } from \"@tailor-proto/tailor/v1/auth_resource_pb\";\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAM,oBAAoB,CAAC,UAAU,4CAA4C;AAEjF,IAAI,sBAAsB;;;;;AAM1B,SAAS,wBAA8B;AACrC,KAAI,oBAAqB;AACzB,uBAAsB;CAEtB,MAAM,UAAU,cAAc,KAAK,QAAQ,QAAQ,KAAK,EAAE,eAAe,CAAC;CAC1E,MAAM,UAAoB,EAAE;AAE5B,MAAK,MAAM,OAAO,kBAChB,KAAI;AACF,UAAQ,QAAQ,IAAI;SACd;AACN,UAAQ,KAAK,IAAI;;AAIrB,KAAI,QAAQ,SAAS,EACnB,QAAO,KACL,oDAAoD,QAAQ,KAAK,KAAK,CAAC,8CACxB,QAAQ,KAAK,IAAI,GACjE;;AAIL,MAAM,aAAa;;;;;;AAOnB,SAAS,0BAA0B,WAA2B;AAC5D,QAAO,EAAY;;;;;;;;;;;;;;;;;;;;;;;0BAuBK,UAAU;;;2BAGT,OAAO,WAAW,CAAC;;;;;2BAKnB,UAAU;;;;;;;;;;;6BAWR,UAAU;;;;;6BAKV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;AAyBvC,eAAsB,iBACpB,WACA,WAC2B;AAE3B,wBAAuB;CAGvB,MAAM,YAAY,KAAK,QAAQ,YAAY,EAAE,OAAO;AACpD,MAAG,UAAU,WAAW,EAAE,WAAW,MAAM,CAAC;CAG5C,MAAM,YAAY,KAAK,KAAK,WAAW,QAAQ,UAAU,WAAW;CACpE,MAAM,aAAa,KAAK,KAAK,WAAW,QAAQ,UAAU,KAAK;CAG/D,MAAM,eAAe,0BAA0B,UAAU;AACzD,MAAG,cAAc,WAAW,aAAa;CAEzC,IAAI;AACJ,KAAI;AACF,aAAW,MAAM,iBAAiB;SAC5B;AACN,aAAW;;AAIb,OAAM,SAAS,MACb,SAAS,aAAa;EACpB,OAAO;EACP,QAAQ;GACN,MAAM;GACN,QAAQ;GACR,WAAW;GACX,QAAQ;GACR,sBAAsB;GACtB,SAAS,EACP,UAAU,YACX;GACF;EACD,UAAU,CAAC,WAAW;EACtB,SAAS,EACP,gBAAgB,CAAC,QAAQ,SAAS,EACnC;EACD;EACA,WAAW;GACT,mBAAmB;GACnB,aAAa;GACb,0BAA0B;GAC3B;EACD,UAAU;EACX,CAAC,CACH;AAKD,QAAO;EACL;EACA,aAJkBA,KAAG,aAAa,YAAY,QAAQ;EAKtD,eAAe;EAChB;;;;;AC7LH,SAAS,OAAO,OAAO,KAAK,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
2
|
import { $ as TailorDBInstance, A as AuthOwnConfig, At as unauthenticatedTailorUser, B as SCIMAttribute, D as AuthConfig, Dt as AttributeList, F as IdProviderConfig, G as SCIMResource, H as SCIMAttributeType, I as OAuth2ClientGrantType, J as UserAttributeListKey, K as TenantProviderConfig, L as OAuth2ClientInput, M as BuiltinIdP, N as DefinedAuth, O as AuthExternalConfig, Ot as AttributeMap, P as IDToken, Q as TailorDBField, R as OIDC, U as SCIMAuthorization, V as SCIMAttributeMapping, W as SCIMConfig, X as UsernameFieldKey, Y as UserAttributeMap, Z as ValueOperand, _t as ResolverExternalConfig, a as IdPExternalConfig, at as unsafeAllowAllGqlPermission, bt as ResolverServiceInput, c as WorkflowServiceConfig, d as defineStaticWebSite, et as TailorDBType, g as ExecutorServiceInput, gt as Resolver, h as ExecutorServiceConfig, ht as QueryType, i as IdPConfig, it as TailorTypePermission, j as AuthServiceInput, kt as TailorUser, l as WorkflowServiceInput, mt as TailorField, nt as PermissionCondition, ot as unsafeAllowAllTypePermission, q as UserAttributeKey, rt as TailorTypeGqlPermission, tt as db, u as StaticWebsiteConfig, wt as Env, yt as ResolverServiceConfig, z as SAML } from "../index-DcOTucF6.mjs";
|
|
3
|
-
import { A as idpUserDeletedTrigger, B as WorkflowOperation, C as RecordUpdatedArgs, D as authAccessTokenRefreshedTrigger, E as authAccessTokenIssuedTrigger, F as resolverExecutedTrigger, G as WorkflowJob, H as WorkflowConfig, I as FunctionOperation, J as WorkflowJobOutput, K as WorkflowJobContext, L as GqlOperation, M as recordCreatedTrigger, N as recordDeletedTrigger, O as authAccessTokenRevokedTrigger, P as recordUpdatedTrigger, Q as defineAuth, R as Operation, S as RecordTrigger, T as ResolverExecutedTrigger, U as createWorkflow, V as Workflow, W as WORKFLOW_TEST_ENV_KEY, X as createResolver, Y as createWorkflowJob, Z as AuthInvoker, _ as AuthAccessTokenTrigger, a as defineGenerators, b as RecordCreatedArgs, c as Trigger, d as IncomingWebhookTrigger, f as incomingWebhookTrigger, g as AuthAccessTokenArgs, h as scheduleTrigger, i as defineConfig, j as idpUserUpdatedTrigger, k as idpUserCreatedTrigger, l as IncomingWebhookArgs, m as ScheduleTrigger, n as output, o as defineIdp, p as ScheduleArgs, q as WorkflowJobInput, r as t, s as createExecutor, t as infer, u as IncomingWebhookRequest, v as IdpUserArgs, w as ResolverExecutedArgs, x as RecordDeletedArgs, y as IdpUserTrigger, z as WebhookOperation } from "../index-
|
|
3
|
+
import { A as idpUserDeletedTrigger, B as WorkflowOperation, C as RecordUpdatedArgs, D as authAccessTokenRefreshedTrigger, E as authAccessTokenIssuedTrigger, F as resolverExecutedTrigger, G as WorkflowJob, H as WorkflowConfig, I as FunctionOperation, J as WorkflowJobOutput, K as WorkflowJobContext, L as GqlOperation, M as recordCreatedTrigger, N as recordDeletedTrigger, O as authAccessTokenRevokedTrigger, P as recordUpdatedTrigger, Q as defineAuth, R as Operation, S as RecordTrigger, T as ResolverExecutedTrigger, U as createWorkflow, V as Workflow, W as WORKFLOW_TEST_ENV_KEY, X as createResolver, Y as createWorkflowJob, Z as AuthInvoker, _ as AuthAccessTokenTrigger, a as defineGenerators, b as RecordCreatedArgs, c as Trigger, d as IncomingWebhookTrigger, f as incomingWebhookTrigger, g as AuthAccessTokenArgs, h as scheduleTrigger, i as defineConfig, j as idpUserUpdatedTrigger, k as idpUserCreatedTrigger, l as IncomingWebhookArgs, m as ScheduleTrigger, n as output, o as defineIdp, p as ScheduleArgs, q as WorkflowJobInput, r as t, s as createExecutor, t as infer, u as IncomingWebhookRequest, v as IdpUserArgs, w as ResolverExecutedArgs, x as RecordDeletedArgs, y as IdpUserTrigger, z as WebhookOperation } from "../index-D8zIUsWi.mjs";
|
|
4
4
|
export { AttributeList, AttributeMap, AuthAccessTokenArgs, AuthAccessTokenTrigger, AuthConfig, AuthExternalConfig, AuthInvoker, AuthOwnConfig, AuthServiceInput, BuiltinIdP, DefinedAuth, Env, ExecutorServiceConfig, ExecutorServiceInput, FunctionOperation, GqlOperation, IDToken, IdPConfig, IdPExternalConfig, IdProviderConfig, IdpUserArgs, IdpUserTrigger, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleArgs, ScheduleTrigger, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProviderConfig, Trigger, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, WORKFLOW_TEST_ENV_KEY, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowJobInput, WorkflowJobOutput, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, createExecutor, createResolver, createWorkflow, createWorkflowJob, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
2
|
import { $ as TailorDBInstance, C as ScheduleTriggerInput, Ct as output$1, Et as TailorActor, J as UserAttributeListKey, Mt as AllowedValuesOutput, N as DefinedAuth, S as ResolverExecutedTrigger$1, St as JsonCompatible, T as WorkflowOperation$1, Tt as TailorEnv, Y as UserAttributeMap, _ as FunctionOperation$1, b as IncomingWebhookTrigger$1, ct as DefinedFieldMetadata, dt as FieldOutput, et as TailorDBType, f as AuthAccessTokenTrigger$1, ft as TailorFieldType, j as AuthServiceInput, jt as AllowedValues, k as AuthInvoker$1, kt as TailorUser, lt as FieldMetadata, m as ExecutorInput, mt as TailorField, n as GeneratorConfig, o as IdPInput, pt as TailorAnyField, r as AppConfig, s as IdpDefinitionBrand, st as ArrayFieldOutput, ut as FieldOptions, v as GqlOperation$1, vt as ResolverInput, w as WebhookOperation$1, x as RecordTrigger$1, xt as InferFieldsOutput, y as IdpUserTrigger$1 } from "./index-DcOTucF6.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as zod0 from "zod";
|
|
4
4
|
import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
|
|
5
|
-
import * as
|
|
5
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
6
6
|
import { Client } from "@urql/core";
|
|
7
7
|
import { StandardCRON } from "ts-cron-validator";
|
|
8
8
|
|
|
@@ -499,12 +499,12 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
|
|
|
499
499
|
id: string;
|
|
500
500
|
description: string;
|
|
501
501
|
dependencies: ("executor" | "tailordb" | "resolver")[];
|
|
502
|
-
aggregate:
|
|
503
|
-
processType?:
|
|
504
|
-
processResolver?:
|
|
505
|
-
processExecutor?:
|
|
506
|
-
processTailorDBNamespace?:
|
|
507
|
-
processResolverNamespace?:
|
|
502
|
+
aggregate: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod0.ZodAny>;
|
|
503
|
+
processType?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
504
|
+
processResolver?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
505
|
+
processExecutor?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
506
|
+
processTailorDBNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
507
|
+
processResolverNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
508
508
|
})[];
|
|
509
509
|
//#endregion
|
|
510
510
|
//#region src/configure/index.d.ts
|
|
@@ -579,4 +579,4 @@ declare namespace t {
|
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
export { idpUserDeletedTrigger as A, WorkflowOperation as B, RecordUpdatedArgs as C, authAccessTokenRefreshedTrigger as D, authAccessTokenIssuedTrigger as E, resolverExecutedTrigger as F, WorkflowJob as G, WorkflowConfig as H, FunctionOperation as I, WorkflowJobOutput as J, WorkflowJobContext as K, GqlOperation as L, recordCreatedTrigger as M, recordDeletedTrigger as N, authAccessTokenRevokedTrigger as O, recordUpdatedTrigger as P, defineAuth as Q, Operation as R, RecordTrigger as S, ResolverExecutedTrigger as T, createWorkflow as U, Workflow as V, WORKFLOW_TEST_ENV_KEY as W, createResolver as X, createWorkflowJob as Y, AuthInvoker as Z, AuthAccessTokenTrigger as _, defineGenerators as a, RecordCreatedArgs as b, Trigger as c, IncomingWebhookTrigger as d, incomingWebhookTrigger as f, AuthAccessTokenArgs as g, scheduleTrigger as h, defineConfig as i, idpUserUpdatedTrigger as j, idpUserCreatedTrigger as k, IncomingWebhookArgs as l, ScheduleTrigger as m, output as n, defineIdp as o, ScheduleArgs as p, WorkflowJobInput as q, t as r, createExecutor as s, infer as t, IncomingWebhookRequest as u, IdpUserArgs as v, ResolverExecutedArgs as w, RecordDeletedArgs as x, IdpUserTrigger as y, WebhookOperation as z };
|
|
582
|
-
//# sourceMappingURL=index-
|
|
582
|
+
//# sourceMappingURL=index-D8zIUsWi.d.mts.map
|