@tailor-platform/sdk 1.14.1 → 1.14.2
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 +21 -0
- package/README.md +19 -0
- package/dist/application-BznueWxG.mjs +4 -0
- package/dist/{application-DnWZVbDO.mjs → application-DhwHYQ3H.mjs} +95 -44
- package/dist/application-DhwHYQ3H.mjs.map +1 -0
- package/dist/cli/index.mjs +4 -4
- package/dist/cli/lib.d.mts +12 -49
- package/dist/cli/lib.mjs +4 -4
- package/dist/cli/skills.d.mts +2 -0
- package/dist/cli/skills.mjs +51 -0
- package/dist/cli/skills.mjs.map +1 -0
- package/dist/configure/index.d.mts +4 -4
- package/dist/configure/index.mjs +2 -2
- package/dist/configure/index.mjs.map +1 -1
- package/dist/index-YzESrtj0.d.mts +396 -0
- package/dist/{index-BlUBAAvu.d.mts → index-q3n7wQOs.d.mts} +5 -4
- package/dist/{jiti-DuCiUfMj.mjs → jiti-BrELlEYT.mjs} +2 -2
- package/dist/{jiti-DuCiUfMj.mjs.map → jiti-BrELlEYT.mjs.map} +1 -1
- package/dist/{job-zGAXCidt.mjs → job-XiwGyFJt.mjs} +1 -1
- package/dist/{job-zGAXCidt.mjs.map → job-XiwGyFJt.mjs.map} +1 -1
- package/dist/plugin/index.d.mts +16 -2
- package/dist/plugin/index.mjs +208 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/{schema-BmKdDzr1.mjs → schema-DRYB-nzA.mjs} +1 -1
- package/dist/{schema-BmKdDzr1.mjs.map → schema-DRYB-nzA.mjs.map} +1 -1
- package/dist/{src-QNTCsO6J.mjs → src-DMROgdcL.mjs} +2 -2
- package/dist/{src-QNTCsO6J.mjs.map → src-DMROgdcL.mjs.map} +1 -1
- package/dist/{index-Bid18Opo.d.mts → types-DbvONSS-.d.mts} +570 -454
- package/dist/{types-r-ZratAg.mjs → types-b-ig8nW_.mjs} +1 -1
- package/dist/types-b-ig8nW_.mjs.map +1 -0
- package/dist/{update-2eb6jz9o.mjs → update-Dm8ERWHJ.mjs} +79 -90
- package/dist/update-Dm8ERWHJ.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +3 -3
- package/dist/utils/test/index.mjs +1 -1
- package/docs/plugin/custom.md +105 -49
- package/docs/plugin/index.md +2 -2
- package/package.json +5 -3
- package/skills/tailor-sdk/SKILL.md +34 -0
- package/dist/application-DM4zTgXU.mjs +0 -4
- package/dist/application-DnWZVbDO.mjs.map +0 -1
- package/dist/env-4RO7szrH.d.mts +0 -66
- package/dist/types-r-ZratAg.mjs.map +0 -1
- package/dist/update-2eb6jz9o.mjs.map +0 -1
- /package/dist/{chunk-C3Kl5s5P.mjs → chunk-GMkBE123.mjs} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../chunk-
|
|
3
|
-
import "../schema-
|
|
4
|
-
import { $ as jobsCommand, $t as initOperatorClient, A as generateCommand, At as getMigrationFiles, C as resumeCommand, Et as formatMigrationNumber, F as removeCommand$1, G as generateCommand$1, Gt as fetchLatestToken, H as listCommand$6, I as listCommand$7, J as triggerCommand, Jt as readPlatformConfig, Kt as loadAccessToken, Mt as isValidMigrationNumber, N as showCommand, Nt as loadDiff, O as truncateCommand, Qt as initOAuth2Client, R as getCommand$2, Rt as getNamespacesWithMigrations, S as healthCommand, T as listCommand$8, V as tokenCommand, Vt as loadConfig, Wt as apiCommand, X as listCommand$5, Xt as fetchAll, Yt as writePlatformConfig, Zt as fetchUserInfo, _ as createCommand$3, a as listCommand$10, an as jsonArgs, b as listCommand$9, d as listCommand$11, en as readPackageJson, ft as applyCommand, gt as parseMigrationLabelNumber, h as deleteCommand$3, in as deploymentArgs, it as getCommand$3, j as logBetaWarning, kt as getMigrationFilePath, l as restoreCommand, lt as getCommand$1, nn as commonArgs, nt as startCommand, on as withCommonArgs, ot as executionsCommand, p as getCommand$4, q as webhookCommand, qt as loadWorkspaceId, r as removeCommand, rn as confirmationArgs, s as inviteCommand, sn as workspaceArgs, t as updateCommand$2, tn as PATScope, zt as trnPrefix } from "../update-
|
|
5
|
-
import {
|
|
2
|
+
import "../chunk-GMkBE123.mjs";
|
|
3
|
+
import "../schema-DRYB-nzA.mjs";
|
|
4
|
+
import { $ as jobsCommand, $t as initOperatorClient, A as generateCommand, At as getMigrationFiles, C as resumeCommand, Et as formatMigrationNumber, F as removeCommand$1, G as generateCommand$1, Gt as fetchLatestToken, H as listCommand$6, I as listCommand$7, J as triggerCommand, Jt as readPlatformConfig, Kt as loadAccessToken, Mt as isValidMigrationNumber, N as showCommand, Nt as loadDiff, O as truncateCommand, Qt as initOAuth2Client, R as getCommand$2, Rt as getNamespacesWithMigrations, S as healthCommand, T as listCommand$8, V as tokenCommand, Vt as loadConfig, Wt as apiCommand, X as listCommand$5, Xt as fetchAll, Yt as writePlatformConfig, Zt as fetchUserInfo, _ as createCommand$3, a as listCommand$10, an as jsonArgs, b as listCommand$9, d as listCommand$11, en as readPackageJson, ft as applyCommand, gt as parseMigrationLabelNumber, h as deleteCommand$3, in as deploymentArgs, it as getCommand$3, j as logBetaWarning, kt as getMigrationFilePath, l as restoreCommand, lt as getCommand$1, nn as commonArgs, nt as startCommand, on as withCommonArgs, ot as executionsCommand, p as getCommand$4, q as webhookCommand, qt as loadWorkspaceId, r as removeCommand, rn as confirmationArgs, s as inviteCommand, sn as workspaceArgs, t as updateCommand$2, tn as PATScope, zt as trnPrefix } from "../update-Dm8ERWHJ.mjs";
|
|
5
|
+
import { m as styles, p as logger } from "../application-DhwHYQ3H.mjs";
|
|
6
6
|
import { createRequire, register } from "node:module";
|
|
7
7
|
import { arg, defineCommand, runCommand, runMain } from "politty";
|
|
8
8
|
import { withCompletionCommand } from "politty/completion";
|
package/dist/cli/lib.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
|
-
import {
|
|
2
|
+
import { F as Plugin, I as PluginAttachment, ct as Resolver, d as IdProviderConfig, n as TypeSourceInfoEntry, p as OAuth2ClientInput, t as TailorDBType } from "../types-DbvONSS-.mjs";
|
|
3
|
+
import { p as Executor, r as AppConfig, t as Generator } from "../index-YzESrtj0.mjs";
|
|
3
4
|
import "politty";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
import { OAuth2Client } from "@badgateway/oauth2-client";
|
|
@@ -11225,6 +11226,15 @@ declare type IdPUserAuthPolicy = Message<"tailor.v1.IdPUserAuthPolicy"> & {
|
|
|
11225
11226
|
* @generated from field: repeated string allowed_email_domains = 9;
|
|
11226
11227
|
*/
|
|
11227
11228
|
allowedEmailDomains: string[];
|
|
11229
|
+
|
|
11230
|
+
/**
|
|
11231
|
+
* allow_google_oauth enables "Sign in with Google" for this namespace.
|
|
11232
|
+
* When enabled, users can authenticate using their Google account.
|
|
11233
|
+
* Cannot be enabled when use_non_email_identifier is true.
|
|
11234
|
+
*
|
|
11235
|
+
* @generated from field: bool allow_google_oauth = 10;
|
|
11236
|
+
*/
|
|
11237
|
+
allowGoogleOauth: boolean;
|
|
11228
11238
|
};
|
|
11229
11239
|
/**
|
|
11230
11240
|
* IdPLang represents the IETF BCP 47 language subtag.
|
|
@@ -16902,53 +16912,6 @@ declare function initOperatorClient(accessToken: string): Promise<Client<_bufbui
|
|
|
16902
16912
|
};
|
|
16903
16913
|
}>>>;
|
|
16904
16914
|
//#endregion
|
|
16905
|
-
//#region src/parser/plugin-config/schema.d.ts
|
|
16906
|
-
/**
|
|
16907
|
-
* Creates a PluginConfigSchema for custom plugins
|
|
16908
|
-
* @returns Plugin config schema that validates and transforms PluginBase instances
|
|
16909
|
-
*/
|
|
16910
|
-
declare function createPluginConfigSchema(): z.core.$ZodBranded<z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
|
|
16911
|
-
id: z.ZodString;
|
|
16912
|
-
description: z.ZodString;
|
|
16913
|
-
importPath: z.ZodString;
|
|
16914
|
-
configSchema: z.ZodOptional<z.ZodAny>;
|
|
16915
|
-
pluginConfigSchema: z.ZodOptional<z.ZodAny>;
|
|
16916
|
-
pluginConfig: z.ZodOptional<z.ZodAny>;
|
|
16917
|
-
process: z.ZodOptional<z.ZodAny>;
|
|
16918
|
-
processNamespace: z.ZodOptional<z.ZodAny>;
|
|
16919
|
-
}, z.core.$loose>, z.ZodTuple<[z.ZodObject<{
|
|
16920
|
-
id: z.ZodString;
|
|
16921
|
-
description: z.ZodString;
|
|
16922
|
-
importPath: z.ZodString;
|
|
16923
|
-
configSchema: z.ZodOptional<z.ZodAny>;
|
|
16924
|
-
pluginConfigSchema: z.ZodOptional<z.ZodAny>;
|
|
16925
|
-
pluginConfig: z.ZodOptional<z.ZodAny>;
|
|
16926
|
-
process: z.ZodOptional<z.ZodAny>;
|
|
16927
|
-
processNamespace: z.ZodOptional<z.ZodAny>;
|
|
16928
|
-
}, z.core.$loose>, z.ZodUnknown], null>]>, z.ZodTransform<PluginBaseWithConfig<unknown> | PluginBaseNamespace<unknown>, {
|
|
16929
|
-
[x: string]: unknown;
|
|
16930
|
-
id: string;
|
|
16931
|
-
description: string;
|
|
16932
|
-
importPath: string;
|
|
16933
|
-
configSchema?: any;
|
|
16934
|
-
pluginConfigSchema?: any;
|
|
16935
|
-
pluginConfig?: any;
|
|
16936
|
-
process?: any;
|
|
16937
|
-
processNamespace?: any;
|
|
16938
|
-
} | [{
|
|
16939
|
-
[x: string]: unknown;
|
|
16940
|
-
id: string;
|
|
16941
|
-
description: string;
|
|
16942
|
-
importPath: string;
|
|
16943
|
-
configSchema?: any;
|
|
16944
|
-
pluginConfigSchema?: any;
|
|
16945
|
-
pluginConfig?: any;
|
|
16946
|
-
process?: any;
|
|
16947
|
-
processNamespace?: any;
|
|
16948
|
-
}, unknown]>>, "Plugin", "out">;
|
|
16949
|
-
type PluginConfigSchemaType = ReturnType<typeof createPluginConfigSchema>;
|
|
16950
|
-
type Plugin = z.output<PluginConfigSchemaType>;
|
|
16951
|
-
//#endregion
|
|
16952
16915
|
//#region src/cli/config-loader.d.ts
|
|
16953
16916
|
/**
|
|
16954
16917
|
* Loaded configuration with resolved path
|
|
@@ -17129,7 +17092,7 @@ interface GenerateUserTypesOptions {
|
|
|
17129
17092
|
/** Path to Tailor config file */
|
|
17130
17093
|
configPath: string;
|
|
17131
17094
|
/** Optional array of plugins to generate PluginConfigs for */
|
|
17132
|
-
plugins?:
|
|
17095
|
+
plugins?: Plugin[];
|
|
17133
17096
|
}
|
|
17134
17097
|
/**
|
|
17135
17098
|
* Generate user type definitions from the app config and write them to disk.
|
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../chunk-
|
|
2
|
-
import "../schema-
|
|
3
|
-
import { $t as initOperatorClient, At as getMigrationFiles, B as getMachineUserToken, Bt as generateUserTypes, Ct as compareLocalTypesWithSnapshot, D as truncate, Dt as getLatestMigrationNumber, E as listWorkflows, Ft as formatDiffSummary, Ht as getDistDir, It as formatMigrationDiff, K as listWebhookExecutors, Kt as loadAccessToken, L as listOAuth2Clients, Lt as hasChanges, M as show, Ot as getMigrationDirPath, P as remove, Pt as reconstructSnapshotFromMigrations, Q as getExecutorJob, Rt as getNamespacesWithMigrations, St as SCHEMA_FILE_NAME, Tt as createSnapshotFromLocalTypes, U as listMachineUsers, Ut as apiCall, Vt as loadConfig, W as generate, Y as triggerExecutor, Z as listExecutors, _t as bundleMigrationScript, at as getWorkflow, bt as INITIAL_SCHEMA_NUMBER, 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, jt as getNextMigrationNumber, k as generate$1, kt as getMigrationFilePath, m as getWorkspace, mt as waitForExecution, n as updateUser, o as listUsers, pt as executeScript, qt as loadWorkspaceId, rt as startWorkflow, st as getWorkflowExecution, tt as watchExecutorJob, u as restoreWorkspace, ut as getExecutor, v as createWorkspace, vt as DB_TYPES_FILE_NAME, w as resumeWorkflow, wt as compareSnapshots, x as getAppHealth, xt as MIGRATE_FILE_NAME, y as listApps, yt as DIFF_FILE_NAME, z as getOAuth2Client } from "../update-
|
|
4
|
-
import {
|
|
1
|
+
import "../chunk-GMkBE123.mjs";
|
|
2
|
+
import "../schema-DRYB-nzA.mjs";
|
|
3
|
+
import { $t as initOperatorClient, At as getMigrationFiles, B as getMachineUserToken, Bt as generateUserTypes, Ct as compareLocalTypesWithSnapshot, D as truncate, Dt as getLatestMigrationNumber, E as listWorkflows, Ft as formatDiffSummary, Ht as getDistDir, It as formatMigrationDiff, K as listWebhookExecutors, Kt as loadAccessToken, L as listOAuth2Clients, Lt as hasChanges, M as show, Ot as getMigrationDirPath, P as remove, Pt as reconstructSnapshotFromMigrations, Q as getExecutorJob, Rt as getNamespacesWithMigrations, St as SCHEMA_FILE_NAME, Tt as createSnapshotFromLocalTypes, U as listMachineUsers, Ut as apiCall, Vt as loadConfig, W as generate, Y as triggerExecutor, Z as listExecutors, _t as bundleMigrationScript, at as getWorkflow, bt as INITIAL_SCHEMA_NUMBER, 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, jt as getNextMigrationNumber, k as generate$1, kt as getMigrationFilePath, m as getWorkspace, mt as waitForExecution, n as updateUser, o as listUsers, pt as executeScript, qt as loadWorkspaceId, rt as startWorkflow, st as getWorkflowExecution, tt as watchExecutorJob, u as restoreWorkspace, ut as getExecutor, v as createWorkspace, vt as DB_TYPES_FILE_NAME, w as resumeWorkflow, wt as compareSnapshots, x as getAppHealth, xt as MIGRATE_FILE_NAME, y as listApps, yt as DIFF_FILE_NAME, z as getOAuth2Client } from "../update-Dm8ERWHJ.mjs";
|
|
4
|
+
import { p as logger } from "../application-DhwHYQ3H.mjs";
|
|
5
5
|
import { createRequire, register } from "node:module";
|
|
6
6
|
import * as fs$1 from "node:fs";
|
|
7
7
|
import * as path from "pathe";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
|
|
4
|
+
//#region src/cli/skills-installer.ts
|
|
5
|
+
const SKILL_NAME = "tailor-sdk";
|
|
6
|
+
const DEFAULT_SKILLS_SOURCE = "https://github.com/tailor-platform/sdk/tree/main/packages/sdk/skills";
|
|
7
|
+
const SKILLS_SOURCE_ENV_KEY = "TAILOR_SDK_SKILLS_SOURCE";
|
|
8
|
+
function resolveNpxCommand(platform = process.platform) {
|
|
9
|
+
return platform === "win32" ? "npx.cmd" : "npx";
|
|
10
|
+
}
|
|
11
|
+
function resolveSkillsSource(source) {
|
|
12
|
+
return source ?? process.env[SKILLS_SOURCE_ENV_KEY] ?? DEFAULT_SKILLS_SOURCE;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build CLI arguments for `skills add` with the fixed tailor-sdk skill target.
|
|
16
|
+
* @param additionalArgs - Additional options to pass through to `skills add`
|
|
17
|
+
* @param source - Optional skill source URL or path
|
|
18
|
+
* @returns CLI arguments for `npx skills add`
|
|
19
|
+
*/
|
|
20
|
+
function buildSkillsAddArgs(additionalArgs, source) {
|
|
21
|
+
return [
|
|
22
|
+
"skills",
|
|
23
|
+
"add",
|
|
24
|
+
resolveSkillsSource(source),
|
|
25
|
+
"--skill",
|
|
26
|
+
SKILL_NAME,
|
|
27
|
+
...additionalArgs
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Run `npx skills add` to install the tailor-sdk skill.
|
|
32
|
+
* @param options - Runtime options for skill installation
|
|
33
|
+
* @returns Process exit code from the spawned `npx` command
|
|
34
|
+
*/
|
|
35
|
+
async function runSkillsInstaller(options = {}) {
|
|
36
|
+
const args = buildSkillsAddArgs(options.additionalArgs ?? [], options.source);
|
|
37
|
+
const childProcess = (options.spawnFn ?? ((command, spawnArgs, spawnOptions) => spawn(command, spawnArgs, spawnOptions)))(resolveNpxCommand(), args, { stdio: "inherit" });
|
|
38
|
+
return await new Promise((resolve, reject) => {
|
|
39
|
+
childProcess.on("error", (error) => reject(error));
|
|
40
|
+
childProcess.on("close", (code) => resolve(code ?? 1));
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/cli/skills.ts
|
|
46
|
+
const exitCode = await runSkillsInstaller({ additionalArgs: process.argv.slice(2) });
|
|
47
|
+
process.exit(exitCode);
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { };
|
|
51
|
+
//# sourceMappingURL=skills.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.mjs","names":[],"sources":["../../src/cli/skills-installer.ts","../../src/cli/skills.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\n\nexport const SKILL_NAME = \"tailor-sdk\";\nexport const DEFAULT_SKILLS_SOURCE =\n \"https://github.com/tailor-platform/sdk/tree/main/packages/sdk/skills\";\nconst SKILLS_SOURCE_ENV_KEY = \"TAILOR_SDK_SKILLS_SOURCE\";\n\ninterface ChildProcessLike {\n on(event: \"close\", listener: (code: number | null) => void): ChildProcessLike;\n on(event: \"error\", listener: (error: Error) => void): ChildProcessLike;\n}\n\ntype SpawnLike = (\n command: string,\n args: string[],\n options: { stdio: \"inherit\" },\n) => ChildProcessLike;\n\ninterface RunSkillsInstallerOptions {\n additionalArgs?: string[];\n source?: string;\n spawnFn?: SpawnLike;\n}\n\nfunction resolveNpxCommand(platform: NodeJS.Platform = process.platform): string {\n return platform === \"win32\" ? \"npx.cmd\" : \"npx\";\n}\n\nfunction resolveSkillsSource(source?: string): string {\n return source ?? process.env[SKILLS_SOURCE_ENV_KEY] ?? DEFAULT_SKILLS_SOURCE;\n}\n\n/**\n * Build CLI arguments for `skills add` with the fixed tailor-sdk skill target.\n * @param additionalArgs - Additional options to pass through to `skills add`\n * @param source - Optional skill source URL or path\n * @returns CLI arguments for `npx skills add`\n */\nexport function buildSkillsAddArgs(additionalArgs: readonly string[], source?: string): string[] {\n return [\"skills\", \"add\", resolveSkillsSource(source), \"--skill\", SKILL_NAME, ...additionalArgs];\n}\n\n/**\n * Run `npx skills add` to install the tailor-sdk skill.\n * @param options - Runtime options for skill installation\n * @returns Process exit code from the spawned `npx` command\n */\nexport async function runSkillsInstaller(options: RunSkillsInstallerOptions = {}): Promise<number> {\n const args = buildSkillsAddArgs(options.additionalArgs ?? [], options.source);\n const spawnFn =\n options.spawnFn ??\n ((command: string, spawnArgs: string[], spawnOptions: { stdio: \"inherit\" }) =>\n spawn(command, spawnArgs, spawnOptions));\n\n const childProcess = spawnFn(resolveNpxCommand(), args, { stdio: \"inherit\" });\n\n return await new Promise<number>((resolve, reject) => {\n childProcess.on(\"error\", (error) => reject(error));\n childProcess.on(\"close\", (code) => resolve(code ?? 1));\n });\n}\n","#!/usr/bin/env node\n\nimport { runSkillsInstaller } from \"./skills-installer\";\n\nconst exitCode = await runSkillsInstaller({\n additionalArgs: process.argv.slice(2),\n});\n\nprocess.exit(exitCode);\n"],"mappings":";;;;AAEA,MAAa,aAAa;AAC1B,MAAa,wBACX;AACF,MAAM,wBAAwB;AAmB9B,SAAS,kBAAkB,WAA4B,QAAQ,UAAkB;AAC/E,QAAO,aAAa,UAAU,YAAY;;AAG5C,SAAS,oBAAoB,QAAyB;AACpD,QAAO,UAAU,QAAQ,IAAI,0BAA0B;;;;;;;;AASzD,SAAgB,mBAAmB,gBAAmC,QAA2B;AAC/F,QAAO;EAAC;EAAU;EAAO,oBAAoB,OAAO;EAAE;EAAW;EAAY,GAAG;EAAe;;;;;;;AAQjG,eAAsB,mBAAmB,UAAqC,EAAE,EAAmB;CACjG,MAAM,OAAO,mBAAmB,QAAQ,kBAAkB,EAAE,EAAE,QAAQ,OAAO;CAM7E,MAAM,gBAJJ,QAAQ,aACN,SAAiB,WAAqB,iBACtC,MAAM,SAAS,WAAW,aAAa,GAEd,mBAAmB,EAAE,MAAM,EAAE,OAAO,WAAW,CAAC;AAE7E,QAAO,MAAM,IAAI,SAAiB,SAAS,WAAW;AACpD,eAAa,GAAG,UAAU,UAAU,OAAO,MAAM,CAAC;AAClD,eAAa,GAAG,UAAU,SAAS,QAAQ,QAAQ,EAAE,CAAC;GACtD;;;;;ACvDJ,MAAM,WAAW,MAAM,mBAAmB,EACxC,gBAAgB,QAAQ,KAAK,MAAM,EAAE,EACtC,CAAC;AAEF,QAAQ,KAAK,SAAS"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { $ as defineAuth, A as idpUserCreatedTrigger, B as WebhookOperation, C as RecordTrigger, D as authAccessTokenIssuedTrigger, E as ResolverExecutedTrigger, F as recordUpdatedTrigger, G as WORKFLOW_TEST_ENV_KEY, H as Workflow, I as resolverExecutedTrigger, J as WorkflowJobInput, K as WorkflowJob, L as FunctionOperation, M as idpUserUpdatedTrigger, N as recordCreatedTrigger, O as authAccessTokenRefreshedTrigger, P as recordDeletedTrigger, Q as AuthInvoker, R as GqlOperation, S as RecordDeletedArgs, T as ResolverExecutedArgs, U as WorkflowConfig, V as WorkflowOperation, W as createWorkflow, X as createWorkflowJob, Y as WorkflowJobOutput, Z as createResolver, _ as AuthAccessTokenArgs, a as defineGenerators, b as IdpUserTrigger, c as createExecutor, d as IncomingWebhookRequest, f as IncomingWebhookTrigger, g as scheduleTrigger, h as ScheduleTrigger, i as defineConfig, j as idpUserDeletedTrigger, k as authAccessTokenRevokedTrigger, l as Trigger, m as ScheduleArgs, n as output, o as definePlugins, p as incomingWebhookTrigger, q as WorkflowJobContext, r as t, s as defineIdp, t as infer, u as IncomingWebhookArgs, v as AuthAccessTokenTrigger, w as RecordUpdatedArgs, x as RecordCreatedArgs, y as IdpUserArgs, z as Operation } from "../index-
|
|
5
|
-
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, NamespacePluginOutput, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition,
|
|
2
|
+
import { A as TailorDBField, B as PluginGeneratedExecutor, C as UserAttributeKey, D as ValueOperand, E as UsernameFieldKey, F as Plugin, G as PluginOutput, H as PluginGeneratedResolver, I as PluginAttachment, J as PermissionCondition, K as PluginProcessContext, L as PluginConfigs, M as TailorDBType, N as db, O as TailorAnyDBField, P as NamespacePluginOutput, Q as unsafeAllowAllTypePermission, R as PluginExecutorContext, S as TenantProviderConfig, St as unauthenticatedTailorUser, T as UserAttributeMap, U as PluginGeneratedType, V as PluginGeneratedExecutorWithFile, W as PluginNamespaceProcessContext, X as TailorTypePermission, Y as TailorTypeGqlPermission, Z as unsafeAllowAllGqlPermission, _ as SCIMAttributeMapping, b as SCIMConfig, bt as AttributeMap, c as BuiltinIdP, ct as Resolver, d as IdProviderConfig, dt as ResolverServiceConfig, f as OAuth2ClientGrantType, ft as ResolverServiceInput, g as SCIMAttribute, gt as Env, h as SAML, i as AuthExternalConfig, j as TailorDBInstance, k as TailorAnyDBType, l as DefinedAuth, lt as ResolverExternalConfig, m as OIDC, o as AuthOwnConfig, ot as TailorField, p as OAuth2ClientInput, q as TailorDBTypeForPlugin, r as AuthConfig, s as AuthServiceInput, st as QueryType, u as IDToken, v as SCIMAttributeType, w as UserAttributeListKey, x as SCIMResource, xt as TailorUser, y as SCIMAuthorization, yt as AttributeList, z as PluginExecutorContextBase } from "../types-DbvONSS-.mjs";
|
|
3
|
+
import { a as IdPExternalConfig, c as WorkflowServiceConfig, d as defineStaticWebSite, g as ExecutorServiceInput, h as ExecutorServiceConfig, i as IdPConfig, l as WorkflowServiceInput, u as StaticWebsiteConfig } from "../index-YzESrtj0.mjs";
|
|
4
|
+
import { $ as defineAuth, A as idpUserCreatedTrigger, B as WebhookOperation, C as RecordTrigger, D as authAccessTokenIssuedTrigger, E as ResolverExecutedTrigger, F as recordUpdatedTrigger, G as WORKFLOW_TEST_ENV_KEY, H as Workflow, I as resolverExecutedTrigger, J as WorkflowJobInput, K as WorkflowJob, L as FunctionOperation, M as idpUserUpdatedTrigger, N as recordCreatedTrigger, O as authAccessTokenRefreshedTrigger, P as recordDeletedTrigger, Q as AuthInvoker, R as GqlOperation, S as RecordDeletedArgs, T as ResolverExecutedArgs, U as WorkflowConfig, V as WorkflowOperation, W as createWorkflow, X as createWorkflowJob, Y as WorkflowJobOutput, Z as createResolver, _ as AuthAccessTokenArgs, a as defineGenerators, b as IdpUserTrigger, c as createExecutor, d as IncomingWebhookRequest, f as IncomingWebhookTrigger, g as scheduleTrigger, h as ScheduleTrigger, i as defineConfig, j as idpUserDeletedTrigger, k as authAccessTokenRevokedTrigger, l as Trigger, m as ScheduleArgs, n as output, o as definePlugins, p as incomingWebhookTrigger, q as WorkflowJobContext, r as t, s as defineIdp, t as infer, u as IncomingWebhookArgs, v as AuthAccessTokenTrigger, w as RecordUpdatedArgs, x as RecordCreatedArgs, y as IdpUserArgs, z as Operation } from "../index-q3n7wQOs.mjs";
|
|
5
|
+
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, NamespacePluginOutput, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, Plugin, PluginAttachment, PluginConfigs, PluginExecutorContext, PluginExecutorContextBase, PluginGeneratedExecutor, PluginGeneratedExecutorWithFile, PluginGeneratedResolver, PluginGeneratedType, PluginNamespaceProcessContext, PluginOutput, PluginProcessContext, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleArgs, ScheduleTrigger, StaticWebsiteConfig, TailorAnyDBField, TailorAnyDBType, TailorDBField, TailorDBInstance, TailorDBType, TailorDBTypeForPlugin, 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, definePlugins, defineStaticWebSite, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
package/dist/configure/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as t$1, n as unsafeAllowAllGqlPermission, r as unsafeAllowAllTypePermission, t as db } from "../schema-
|
|
2
|
-
import { n as createWorkflowJob, t as WORKFLOW_TEST_ENV_KEY } from "../job-
|
|
1
|
+
import { i as t$1, n as unsafeAllowAllGqlPermission, r as unsafeAllowAllTypePermission, t as db } from "../schema-DRYB-nzA.mjs";
|
|
2
|
+
import { n as createWorkflowJob, t as WORKFLOW_TEST_ENV_KEY } from "../job-XiwGyFJt.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/configure/types/user.ts
|
|
5
5
|
/** Represents an unauthenticated user in the Tailor platform. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["t","_t"],"sources":["../../src/configure/types/user.ts","../../src/configure/services/auth/index.ts","../../src/configure/services/resolver/resolver.ts","../../src/configure/services/executor/executor.ts","../../src/configure/services/executor/trigger/event.ts","../../src/configure/services/executor/trigger/schedule.ts","../../src/configure/services/executor/trigger/webhook.ts","../../src/configure/services/workflow/workflow.ts","../../src/configure/services/staticwebsite/index.ts","../../src/configure/services/idp/index.ts","../../src/configure/config.ts","../../src/configure/index.ts"],"sourcesContent":["// Interfaces for module augmentation\n// Users can extend these via: declare module \"@tailor-platform/sdk\" { interface AttributeMap { ... } }\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface AttributeMap {}\nexport interface AttributeList {\n __tuple?: []; // Marker for tuple type\n}\n\nexport type InferredAttributeMap = keyof AttributeMap extends never\n ? Record<string, string | string[] | boolean | boolean[] | undefined>\n : AttributeMap;\n\nexport type InferredAttributeList = AttributeList[\"__tuple\"] extends []\n ? string[]\n : AttributeList[\"__tuple\"];\n\n/** Represents a user in the Tailor platform. */\nexport type TailorUser = {\n /**\n * The ID of the user.\n * For unauthenticated users, this will be a nil UUID.\n */\n id: string;\n /**\n * The type of the user.\n * For unauthenticated users, this will be an empty string.\n */\n type: \"user\" | \"machine_user\" | \"\";\n /** The ID of the workspace the user belongs to. */\n workspaceId: string;\n /**\n * A map of the user's attributes.\n * For unauthenticated users, this will be null.\n */\n attributes: InferredAttributeMap | null;\n /**\n * A list of the user's attributes.\n * For unauthenticated users, this will be an empty array.\n */\n attributeList: InferredAttributeList;\n};\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser: TailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n};\n","import { type TailorDBInstance } from \"../tailordb/schema\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { DefinedFieldMetadata, FieldMetadata, TailorFieldType } from \"@/configure/types/types\";\nimport type {\n AuthInvoker as ParserAuthInvoker,\n AuthDefinitionBrand,\n AuthServiceInput,\n DefinedAuth,\n UserAttributeListKey,\n UserAttributeMap,\n} from \"@/parser/service/auth/types\";\n\ntype MachineUserAttributeFields = Record<\n string,\n TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>\n>;\n\ntype PlaceholderUser = TailorDBInstance<Record<string, never>, Record<string, never>>;\ntype PlaceholderAttributeMap = UserAttributeMap<PlaceholderUser>;\ntype PlaceholderAttributeList = UserAttributeListKey<PlaceholderUser>[];\n\ntype UserProfileAuthInput<\n User extends TailorDBInstance,\n AttributeMap extends UserAttributeMap<User>,\n AttributeList extends UserAttributeListKey<User>[],\n MachineUserNames extends string,\n> = Omit<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile: NonNullable<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>[\"userProfile\"]\n >;\n machineUserAttributes?: never;\n};\n\ntype MachineUserOnlyAuthInput<\n MachineUserNames extends string,\n MachineUserAttributes extends MachineUserAttributeFields,\n> = Omit<\n AuthServiceInput<\n PlaceholderUser,\n PlaceholderAttributeMap,\n PlaceholderAttributeList,\n MachineUserNames,\n MachineUserAttributes\n >,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile?: never;\n machineUserAttributes: MachineUserAttributes;\n};\n\nexport type {\n OIDC,\n SAML,\n IDToken,\n BuiltinIdP,\n IdProviderConfig,\n OAuth2ClientGrantType,\n OAuth2ClientInput as OAuth2Client,\n SCIMAuthorization,\n SCIMAttributeType,\n SCIMAttribute,\n SCIMAttributeMapping,\n SCIMResource,\n SCIMConfig,\n TenantProviderConfig,\n ValueOperand,\n UsernameFieldKey,\n UserAttributeKey,\n UserAttributeListKey,\n UserAttributeMap,\n AuthServiceInput,\n AuthConfig,\n AuthExternalConfig,\n AuthOwnConfig,\n DefinedAuth,\n} from \"@/parser/service/auth/types\";\n\n/**\n * Invoker type compatible with tailor.v1.AuthInvoker\n * - namespace: auth service name\n * - machineUserName: machine user name\n */\nexport type AuthInvoker<M extends string> = Omit<ParserAuthInvoker, \"machineUserName\"> & {\n machineUserName: M;\n};\n\n/**\n * Define an auth service for the Tailor SDK.\n * @template Name\n * @template User\n * @template AttributeMap\n * @template AttributeList\n * @template MachineUserNames\n * @template M\n * @param name - Auth service name\n * @param config - Auth service configuration\n * @returns Defined auth service\n */\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserNames extends string,\n>(\n name: Name,\n config: UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n): DefinedAuth<\n Name,\n UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config: MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n): DefinedAuth<\n Name,\n MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config:\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n) {\n const result = {\n ...config,\n name,\n invoker<M extends MachineUserNames>(machineUser: M) {\n return { namespace: name, machineUserName: machineUser } as const;\n },\n } as const satisfies (\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>\n ) & {\n name: string;\n invoker<M extends MachineUserNames>(machineUser: M): AuthInvoker<M>;\n };\n\n validateAuthConfig(result);\n\n return result as typeof result & AuthDefinitionBrand;\n}\n\nfunction validateAuthConfig(config: {\n userProfile?: unknown;\n machineUserAttributes?: unknown;\n}): void {\n const hasUserProfile = config.userProfile !== undefined;\n const hasMachineUserAttributes = config.machineUserAttributes !== undefined;\n\n if (hasUserProfile && hasMachineUserAttributes) {\n throw new Error(\"Provide either userProfile or machineUserAttributes, not both.\");\n }\n}\n","import { t } from \"@/configure/types/type\";\nimport type { TailorAnyField, TailorUser } from \"@/configure/types\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { InferFieldsOutput, output } from \"@/configure/types/helpers\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { ResolverInput } from \"@/parser/service/resolver/types\";\n\ntype Context<Input extends Record<string, TailorAnyField> | undefined> = {\n input: Input extends Record<string, TailorAnyField> ? InferFieldsOutput<Input> : never;\n user: TailorUser;\n env: TailorEnv;\n};\n\ntype OutputType<O> = O extends TailorAnyField\n ? output<O>\n : O extends Record<string, TailorAnyField>\n ? InferFieldsOutput<O>\n : never;\n\n/**\n * Normalized output type that preserves generic type information.\n * - If Output is already a TailorField, use it as-is\n * - If Output is a Record of fields, wrap it as a nested TailorField\n */\ntype NormalizedOutput<Output extends TailorAnyField | Record<string, TailorAnyField>> =\n Output extends TailorAnyField\n ? Output\n : TailorField<\n { type: \"nested\"; array: false },\n InferFieldsOutput<Extract<Output, Record<string, TailorAnyField>>>\n >;\n\ntype ResolverReturn<\n Input extends Record<string, TailorAnyField> | undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField>,\n> = Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: NormalizedOutput<Output>;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>;\n\n/**\n * Create a resolver definition for the Tailor SDK.\n * @template Input\n * @template Output\n * @param config - Resolver configuration\n * @returns Normalized resolver configuration\n */\nexport function createResolver<\n Input extends Record<string, TailorAnyField> | undefined = undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField> = TailorAnyField,\n>(\n config: Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: Output;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>,\n): ResolverReturn<Input, Output> {\n // Check if output is already a TailorField using duck typing.\n // TailorField has `type: string` (e.g., \"uuid\", \"string\"), while\n // Record<string, TailorField> either lacks `type` or has TailorField as value.\n const isTailorField = (obj: unknown): obj is TailorAnyField =>\n typeof obj === \"object\" &&\n obj !== null &&\n \"type\" in obj &&\n typeof (obj as { type: unknown }).type === \"string\";\n\n const normalizedOutput = isTailorField(config.output) ? config.output : t.object(config.output);\n\n return {\n ...config,\n output: normalizedOutput,\n } as ResolverReturn<Input, Output>;\n}\n\n// A loose config alias for userland use-cases\n// oxlint-disable-next-line no-explicit-any\nexport type ResolverConfig = ReturnType<typeof createResolver<any, any>>;\n","import type { Operation } from \"./operation\";\nimport type { Trigger } from \"./trigger\";\nimport type { AuthInvoker } from \"@/configure/services/auth\";\nimport type { Workflow } from \"@/configure/services/workflow/workflow\";\nimport type { ExecutorInput } from \"@/parser/service/executor/types\";\n\n/**\n * Extract mainJob's Input type from Workflow.\n */\ntype WorkflowInput<W extends Workflow> = Parameters<W[\"trigger\"]>[0];\n\ntype ExecutorBase<Args> = Omit<ExecutorInput, \"trigger\" | \"operation\"> & {\n trigger: Trigger<Args>;\n};\n\n/**\n * Executor type with conditional inference for workflow operations.\n * When operation.kind is \"workflow\", infers W from the workflow property\n * to ensure args type matches the workflow's mainJob input type.\n */\ntype Executor<Args, O> = O extends {\n kind: \"workflow\";\n workflow: infer W extends Workflow;\n}\n ? ExecutorBase<Args> & {\n operation: {\n kind: \"workflow\";\n workflow: W;\n args?: WorkflowInput<W> | ((args: Args) => WorkflowInput<W>);\n authInvoker?: AuthInvoker<string>;\n };\n }\n : ExecutorBase<Args> & {\n operation: O;\n };\n\n/**\n * Create an executor configuration for the Tailor SDK.\n * @template Args\n * @template O\n * @param config - Executor configuration\n * @returns The same executor configuration\n */\nexport function createExecutor<\n Args,\n O extends Operation<Args> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<Args, O>) {\n return config;\n}\n","import type { ResolverConfig } from \"@/configure/services/resolver/resolver\";\nimport type { TailorDBType } from \"@/configure/services/tailordb/schema\";\nimport type { TailorActor } from \"@/configure/types/actor\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { output } from \"@/configure/types/helpers\";\nimport type {\n RecordTrigger as ParserRecordTrigger,\n ResolverExecutedTrigger as ParserResolverExecutedTrigger,\n IdpUserTrigger as ParserIdpUserTrigger,\n AuthAccessTokenTrigger as ParserAuthAccessTokenTrigger,\n} from \"@/parser/service/executor/types\";\n\ninterface EventArgs {\n workspaceId: string;\n appNamespace: string;\n env: TailorEnv;\n actor: TailorActor | null;\n}\n\ninterface RecordArgs extends EventArgs {\n typeName: string;\n}\n\nexport interface RecordCreatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n}\n\nexport interface RecordUpdatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n oldRecord: output<T>;\n}\n\nexport interface RecordDeletedArgs<T extends TailorDBType> extends RecordArgs {\n oldRecord: output<T>;\n}\n\nexport type ResolverExecutedArgs<R extends ResolverConfig> = EventArgs & {\n resolverName: string;\n} & (\n | {\n success: true;\n result: output<R[\"output\"]>;\n error?: never;\n }\n | {\n success: false;\n result?: never;\n error: string;\n }\n );\n\nexport type RecordTrigger<Args> = ParserRecordTrigger & {\n __args: Args;\n};\n\ntype RecordTriggerOptions<T extends TailorDBType, Args> = {\n type: T;\n condition?: (args: Args) => boolean;\n};\n\n/**\n * Create a trigger that fires when a TailorDB record is created.\n * @template T\n * @param options - Trigger options\n * @returns Record created trigger\n */\nexport function recordCreatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordCreatedArgs<T>>,\n): RecordTrigger<RecordCreatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordCreated\",\n typeName: type.name,\n condition,\n __args: {} as RecordCreatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is updated.\n * @template T\n * @param options - Trigger options\n * @returns Record updated trigger\n */\nexport function recordUpdatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordUpdatedArgs<T>>,\n): RecordTrigger<RecordUpdatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordUpdated\",\n typeName: type.name,\n condition,\n __args: {} as RecordUpdatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is deleted.\n * @template T\n * @param options - Trigger options\n * @returns Record deleted trigger\n */\nexport function recordDeletedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordDeletedArgs<T>>,\n): RecordTrigger<RecordDeletedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordDeleted\",\n typeName: type.name,\n condition,\n __args: {} as RecordDeletedArgs<T>,\n };\n}\n\nexport type ResolverExecutedTrigger<Args> = ParserResolverExecutedTrigger & {\n __args: Args;\n};\n\ntype ResolverExecutedTriggerOptions<R extends ResolverConfig> = {\n resolver: R;\n condition?: (args: ResolverExecutedArgs<R>) => boolean;\n};\n\n/**\n * Create a trigger that fires when a resolver is executed.\n * @template R\n * @param options - Trigger options\n * @returns Resolver executed trigger\n */\nexport function resolverExecutedTrigger<R extends ResolverConfig>(\n options: ResolverExecutedTriggerOptions<R>,\n): ResolverExecutedTrigger<ResolverExecutedArgs<R>> {\n const { resolver, condition } = options;\n return {\n kind: \"resolverExecuted\",\n resolverName: resolver.name,\n condition,\n __args: {} as ResolverExecutedArgs<R>,\n };\n}\n\n// IdP User Event Triggers\nexport interface IdpUserArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type IdpUserTrigger<Args> = ParserIdpUserTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an IdP user is created.\n * @returns IdP user created trigger\n */\nexport function idpUserCreatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserCreated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is updated.\n * @returns IdP user updated trigger\n */\nexport function idpUserUpdatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserUpdated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is deleted.\n * @returns IdP user deleted trigger\n */\nexport function idpUserDeletedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserDeleted\",\n __args: {} as IdpUserArgs,\n };\n}\n\n// Auth Access Token Event Triggers\nexport interface AuthAccessTokenArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type AuthAccessTokenTrigger<Args> = ParserAuthAccessTokenTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an access token is issued.\n * @returns Auth access token issued trigger\n */\nexport function authAccessTokenIssuedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenIssued\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is refreshed.\n * @returns Auth access token refreshed trigger\n */\nexport function authAccessTokenRefreshedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRefreshed\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is revoked.\n * @returns Auth access token revoked trigger\n */\nexport function authAccessTokenRevokedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRevoked\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { ScheduleTriggerInput as ParserScheduleTriggerInput } from \"@/parser/service/executor/types\";\nimport type { StandardCRON } from \"ts-cron-validator\";\n\ntype Timezone =\n | \"UTC\"\n | \"Pacific/Midway\"\n | \"Pacific/Niue\"\n | \"Pacific/Pago_Pago\"\n | \"America/Adak\"\n | \"Pacific/Honolulu\"\n | \"Pacific/Rarotonga\"\n | \"Pacific/Tahiti\"\n | \"Pacific/Marquesas\"\n | \"America/Anchorage\"\n | \"America/Juneau\"\n | \"America/Metlakatla\"\n | \"America/Nome\"\n | \"America/Sitka\"\n | \"America/Yakutat\"\n | \"Pacific/Gambier\"\n | \"America/Los_Angeles\"\n | \"America/Tijuana\"\n | \"America/Vancouver\"\n | \"Pacific/Pitcairn\"\n | \"America/Boise\"\n | \"America/Cambridge_Bay\"\n | \"America/Chihuahua\"\n | \"America/Creston\"\n | \"America/Dawson\"\n | \"America/Dawson_Creek\"\n | \"America/Denver\"\n | \"America/Edmonton\"\n | \"America/Fort_Nelson\"\n | \"America/Hermosillo\"\n | \"America/Inuvik\"\n | \"America/Mazatlan\"\n | \"America/Ojinaga\"\n | \"America/Phoenix\"\n | \"America/Whitehorse\"\n | \"America/Yellowknife\"\n | \"America/Bahia_Banderas\"\n | \"America/Belize\"\n | \"America/Chicago\"\n | \"America/Costa_Rica\"\n | \"America/El_Salvador\"\n | \"America/Guatemala\"\n | \"America/Indiana/Knox\"\n | \"America/Indiana/Tell_City\"\n | \"America/Managua\"\n | \"America/Matamoros\"\n | \"America/Menominee\"\n | \"America/Merida\"\n | \"America/Mexico_City\"\n | \"America/Monterrey\"\n | \"America/North_Dakota/Beulah\"\n | \"America/North_Dakota/Center\"\n | \"America/North_Dakota/New_Salem\"\n | \"America/Rainy_River\"\n | \"America/Rankin_Inlet\"\n | \"America/Regina\"\n | \"America/Resolute\"\n | \"America/Swift_Current\"\n | \"America/Tegucigalpa\"\n | \"America/Winnipeg\"\n | \"Pacific/Easter\"\n | \"Pacific/Galapagos\"\n | \"America/Atikokan\"\n | \"America/Bogota\"\n | \"America/Cancun\"\n | \"America/Cayman\"\n | \"America/Detroit\"\n | \"America/Eirunepe\"\n | \"America/Grand_Turk\"\n | \"America/Guayaquil\"\n | \"America/Havana\"\n | \"America/Indiana/Indianapolis\"\n | \"America/Indiana/Marengo\"\n | \"America/Indiana/Petersburg\"\n | \"America/Indiana/Vevay\"\n | \"America/Indiana/Vincennes\"\n | \"America/Indiana/Winamac\"\n | \"America/Iqaluit\"\n | \"America/Jamaica\"\n | \"America/Kentucky/Louisville\"\n | \"America/Kentucky/Monticello\"\n | \"America/Lima\"\n | \"America/Nassau\"\n | \"America/New_York\"\n | \"America/Nipigon\"\n | \"America/Panama\"\n | \"America/Pangnirtung\"\n | \"America/Port-au-Prince\"\n | \"America/Rio_Branco\"\n | \"America/Thunder_Bay\"\n | \"America/Toronto\"\n | \"America/Anguilla\"\n | \"America/Antigua\"\n | \"America/Aruba\"\n | \"America/Asuncion\"\n | \"America/Barbados\"\n | \"America/Blanc-Sablon\"\n | \"America/Boa_Vista\"\n | \"America/Campo_Grande\"\n | \"America/Caracas\"\n | \"America/Cuiaba\"\n | \"America/Curacao\"\n | \"America/Dominica\"\n | \"America/Glace_Bay\"\n | \"America/Goose_Bay\"\n | \"America/Grenada\"\n | \"America/Guadeloupe\"\n | \"America/Guyana\"\n | \"America/Halifax\"\n | \"America/Kralendijk\"\n | \"America/La_Paz\"\n | \"America/Lower_Princes\"\n | \"America/Manaus\"\n | \"America/Marigot\"\n | \"America/Martinique\"\n | \"America/Moncton\"\n | \"America/Montserrat\"\n | \"America/Porto_Velho\"\n | \"America/Port_of_Spain\"\n | \"America/Puerto_Rico\"\n | \"America/Santiago\"\n | \"America/Santo_Domingo\"\n | \"America/St_Barthelemy\"\n | \"America/St_Kitts\"\n | \"America/St_Lucia\"\n | \"America/St_Thomas\"\n | \"America/St_Vincent\"\n | \"America/Thule\"\n | \"America/Tortola\"\n | \"Atlantic/Bermuda\"\n | \"America/St_Johns\"\n | \"America/Araguaina\"\n | \"America/Argentina/Buenos_Aires\"\n | \"America/Argentina/Catamarca\"\n | \"America/Argentina/Cordoba\"\n | \"America/Argentina/Jujuy\"\n | \"America/Argentina/La_Rioja\"\n | \"America/Argentina/Mendoza\"\n | \"America/Argentina/Rio_Gallegos\"\n | \"America/Argentina/Salta\"\n | \"America/Argentina/San_Juan\"\n | \"America/Argentina/San_Luis\"\n | \"America/Argentina/Tucuman\"\n | \"America/Argentina/Ushuaia\"\n | \"America/Bahia\"\n | \"America/Belem\"\n | \"America/Cayenne\"\n | \"America/Fortaleza\"\n | \"America/Godthab\"\n | \"America/Maceio\"\n | \"America/Miquelon\"\n | \"America/Montevideo\"\n | \"America/Paramaribo\"\n | \"America/Punta_Arenas\"\n | \"America/Recife\"\n | \"America/Santarem\"\n | \"America/Sao_Paulo\"\n | \"Antarctica/Palmer\"\n | \"Antarctica/Rothera\"\n | \"Atlantic/Stanley\"\n | \"America/Noronha\"\n | \"Atlantic/South_Georgia\"\n | \"America/Scoresbysund\"\n | \"Atlantic/Azores\"\n | \"Atlantic/Cape_Verde\"\n | \"Africa/Abidjan\"\n | \"Africa/Accra\"\n | \"Africa/Bamako\"\n | \"Africa/Banjul\"\n | \"Africa/Bissau\"\n | \"Africa/Casablanca\"\n | \"Africa/Conakry\"\n | \"Africa/Dakar\"\n | \"Africa/El_Aaiun\"\n | \"Africa/Freetown\"\n | \"Africa/Lome\"\n | \"Africa/Monrovia\"\n | \"Africa/Nouakchott\"\n | \"Africa/Ouagadougou\"\n | \"Africa/Sao_Tome\"\n | \"America/Danmarkshavn\"\n | \"Antarctica/Troll\"\n | \"Atlantic/Canary\"\n | \"Atlantic/Faroe\"\n | \"Atlantic/Madeira\"\n | \"Atlantic/Reykjavik\"\n | \"Atlantic/St_Helena\"\n | \"Europe/Dublin\"\n | \"Europe/Guernsey\"\n | \"Europe/Isle_of_Man\"\n | \"Europe/Jersey\"\n | \"Europe/Lisbon\"\n | \"Europe/London\"\n | \"Africa/Algiers\"\n | \"Africa/Bangui\"\n | \"Africa/Brazzaville\"\n | \"Africa/Ceuta\"\n | \"Africa/Douala\"\n | \"Africa/Kinshasa\"\n | \"Africa/Lagos\"\n | \"Africa/Libreville\"\n | \"Africa/Luanda\"\n | \"Africa/Malabo\"\n | \"Africa/Ndjamena\"\n | \"Africa/Niamey\"\n | \"Africa/Porto-Novo\"\n | \"Africa/Tunis\"\n | \"Africa/Windhoek\"\n | \"Arctic/Longyearbyen\"\n | \"Europe/Amsterdam\"\n | \"Europe/Andorra\"\n | \"Europe/Belgrade\"\n | \"Europe/Berlin\"\n | \"Europe/Bratislava\"\n | \"Europe/Brussels\"\n | \"Europe/Budapest\"\n | \"Europe/Copenhagen\"\n | \"Europe/Gibraltar\"\n | \"Europe/Ljubljana\"\n | \"Europe/Luxembourg\"\n | \"Europe/Madrid\"\n | \"Europe/Malta\"\n | \"Europe/Monaco\"\n | \"Europe/Oslo\"\n | \"Europe/Paris\"\n | \"Europe/Podgorica\"\n | \"Europe/Prague\"\n | \"Europe/Rome\"\n | \"Europe/San_Marino\"\n | \"Europe/Sarajevo\"\n | \"Europe/Skopje\"\n | \"Europe/Stockholm\"\n | \"Europe/Tirane\"\n | \"Europe/Vaduz\"\n | \"Europe/Vatican\"\n | \"Europe/Vienna\"\n | \"Europe/Warsaw\"\n | \"Europe/Zagreb\"\n | \"Europe/Zurich\"\n | \"Africa/Blantyre\"\n | \"Africa/Bujumbura\"\n | \"Africa/Cairo\"\n | \"Africa/Gaborone\"\n | \"Africa/Harare\"\n | \"Africa/Johannesburg\"\n | \"Africa/Juba\"\n | \"Africa/Khartoum\"\n | \"Africa/Kigali\"\n | \"Africa/Lubumbashi\"\n | \"Africa/Lusaka\"\n | \"Africa/Maputo\"\n | \"Africa/Maseru\"\n | \"Africa/Mbabane\"\n | \"Africa/Tripoli\"\n | \"Asia/Amman\"\n | \"Asia/Beirut\"\n | \"Asia/Damascus\"\n | \"Asia/Famagusta\"\n | \"Asia/Gaza\"\n | \"Asia/Hebron\"\n | \"Asia/Jerusalem\"\n | \"Asia/Nicosia\"\n | \"Europe/Athens\"\n | \"Europe/Bucharest\"\n | \"Europe/Chisinau\"\n | \"Europe/Helsinki\"\n | \"Europe/Kaliningrad\"\n | \"Europe/Kyiv\"\n | \"Europe/Mariehamn\"\n | \"Europe/Riga\"\n | \"Europe/Sofia\"\n | \"Europe/Tallinn\"\n | \"Europe/Uzhgorod\"\n | \"Europe/Vilnius\"\n | \"Europe/Zaporizhzhia\"\n | \"Africa/Addis_Ababa\"\n | \"Africa/Asmara\"\n | \"Africa/Dar_es_Salaam\"\n | \"Africa/Djibouti\"\n | \"Africa/Kampala\"\n | \"Africa/Mogadishu\"\n | \"Africa/Nairobi\"\n | \"Antarctica/Syowa\"\n | \"Asia/Aden\"\n | \"Asia/Baghdad\"\n | \"Asia/Bahrain\"\n | \"Asia/Kuwait\"\n | \"Asia/Qatar\"\n | \"Asia/Riyadh\"\n | \"Europe/Istanbul\"\n | \"Europe/Kirov\"\n | \"Europe/Minsk\"\n | \"Europe/Moscow\"\n | \"Europe/Simferopol\"\n | \"Europe/Volgograd\"\n | \"Indian/Antananarivo\"\n | \"Indian/Comoro\"\n | \"Indian/Mayotte\"\n | \"Asia/Tehran\"\n | \"Asia/Baku\"\n | \"Asia/Dubai\"\n | \"Asia/Muscat\"\n | \"Asia/Tbilisi\"\n | \"Asia/Yerevan\"\n | \"Europe/Astrakhan\"\n | \"Europe/Samara\"\n | \"Europe/Saratov\"\n | \"Europe/Ulyanovsk\"\n | \"Indian/Mahe\"\n | \"Indian/Mauritius\"\n | \"Indian/Reunion\"\n | \"Asia/Kabul\"\n | \"Antarctica/Mawson\"\n | \"Asia/Aqtau\"\n | \"Asia/Aqtobe\"\n | \"Asia/Ashgabat\"\n | \"Asia/Atyrau\"\n | \"Asia/Dushanbe\"\n | \"Asia/Karachi\"\n | \"Asia/Oral\"\n | \"Asia/Qyzylorda\"\n | \"Asia/Samarkand\"\n | \"Asia/Tashkent\"\n | \"Asia/Yekaterinburg\"\n | \"Indian/Kerguelen\"\n | \"Indian/Maldives\"\n | \"Asia/Colombo\"\n | \"Asia/Kolkata\"\n | \"Asia/Kathmandu\"\n | \"Antarctica/Vostok\"\n | \"Asia/Almaty\"\n | \"Asia/Bishkek\"\n | \"Asia/Dhaka\"\n | \"Asia/Omsk\"\n | \"Asia/Qostanay\"\n | \"Asia/Thimphu\"\n | \"Asia/Urumqi\"\n | \"Indian/Chagos\"\n | \"Asia/Yangon\"\n | \"Indian/Cocos\"\n | \"Antarctica/Davis\"\n | \"Asia/Bangkok\"\n | \"Asia/Barnaul\"\n | \"Asia/Hovd\"\n | \"Asia/Ho_Chi_Minh\"\n | \"Asia/Jakarta\"\n | \"Asia/Krasnoyarsk\"\n | \"Asia/Novokuznetsk\"\n | \"Asia/Novosibirsk\"\n | \"Asia/Phnom_Penh\"\n | \"Asia/Pontianak\"\n | \"Asia/Tomsk\"\n | \"Asia/Vientiane\"\n | \"Indian/Christmas\"\n | \"Asia/Brunei\"\n | \"Asia/Choibalsan\"\n | \"Asia/Hong_Kong\"\n | \"Asia/Irkutsk\"\n | \"Asia/Kuala_Lumpur\"\n | \"Asia/Kuching\"\n | \"Asia/Macau\"\n | \"Asia/Makassar\"\n | \"Asia/Manila\"\n | \"Asia/Shanghai\"\n | \"Asia/Singapore\"\n | \"Asia/Taipei\"\n | \"Asia/Ulaanbaatar\"\n | \"Australia/Perth\"\n | \"Australia/Eucla\"\n | \"Asia/Chita\"\n | \"Asia/Dili\"\n | \"Asia/Jayapura\"\n | \"Asia/Khandyga\"\n | \"Asia/Pyongyang\"\n | \"Asia/Seoul\"\n | \"Asia/Tokyo\"\n | \"Asia/Yakutsk\"\n | \"Pacific/Palau\"\n | \"Australia/Adelaide\"\n | \"Australia/Broken_Hill\"\n | \"Australia/Darwin\"\n | \"Antarctica/DumontDUrville\"\n | \"Antarctica/Macquarie\"\n | \"Asia/Ust-Nera\"\n | \"Asia/Vladivostok\"\n | \"Australia/Brisbane\"\n | \"Australia/Currie\"\n | \"Australia/Hobart\"\n | \"Australia/Lindeman\"\n | \"Australia/Melbourne\"\n | \"Australia/Sydney\"\n | \"Pacific/Chuuk\"\n | \"Pacific/Guam\"\n | \"Pacific/Port_Moresby\"\n | \"Pacific/Saipan\"\n | \"Australia/Lord_Howe\"\n | \"Antarctica/Casey\"\n | \"Asia/Magadan\"\n | \"Asia/Sakhalin\"\n | \"Asia/Srednekolymsk\"\n | \"Pacific/Bougainville\"\n | \"Pacific/Efate\"\n | \"Pacific/Guadalcanal\"\n | \"Pacific/Kosrae\"\n | \"Pacific/Norfolk\"\n | \"Pacific/Noumea\"\n | \"Pacific/Pohnpei\"\n | \"Antarctica/McMurdo\"\n | \"Asia/Anadyr\"\n | \"Asia/Kamchatka\"\n | \"Pacific/Auckland\"\n | \"Pacific/Fiji\"\n | \"Pacific/Funafuti\"\n | \"Pacific/Kwajalein\"\n | \"Pacific/Majuro\"\n | \"Pacific/Nauru\"\n | \"Pacific/Tarawa\"\n | \"Pacific/Wake\"\n | \"Pacific/Wallis\"\n | \"Pacific/Chatham\"\n | \"Pacific/Apia\"\n | \"Pacific/Enderbury\"\n | \"Pacific/Fakaofo\"\n | \"Pacific/Tongatapu\"\n | \"Pacific/Kiritimati\";\n\nexport type ScheduleTrigger<Args> = ParserScheduleTriggerInput & {\n __args: Args;\n};\n\nexport interface ScheduleArgs {\n env: TailorEnv;\n}\n\ninterface ScheduleTriggerOptions<T extends string> {\n cron: StandardCRON<T> extends never ? never : T;\n timezone?: Timezone;\n}\n\n/**\n * Create a schedule-based trigger using a CRON expression and optional timezone.\n * @template T\n * @param options - Schedule options\n * @returns Schedule trigger\n */\nexport function scheduleTrigger<T extends string>(\n options: ScheduleTriggerOptions<T>,\n): ScheduleTrigger<ScheduleArgs> {\n const { cron, timezone } = options;\n return {\n kind: \"schedule\",\n cron,\n timezone,\n __args: {} as ScheduleArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { IncomingWebhookTrigger as ParserIncomingWebhookTrigger } from \"@/parser/service/executor/types\";\n\nexport interface IncomingWebhookArgs<T extends IncomingWebhookRequest> {\n body: T[\"body\"];\n headers: T[\"headers\"];\n method: \"POST\" | \"GET\" | \"PUT\" | \"DELETE\";\n rawBody: string;\n env: TailorEnv;\n}\n\nexport interface IncomingWebhookRequest {\n body: Record<string, unknown>;\n headers: Record<string, string>;\n}\n\nexport type IncomingWebhookTrigger<Args> = ParserIncomingWebhookTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger for incoming webhook requests.\n * @template T\n * @returns Incoming webhook trigger\n */\nexport function incomingWebhookTrigger<T extends IncomingWebhookRequest>(): IncomingWebhookTrigger<\n IncomingWebhookArgs<T>\n> {\n return {\n kind: \"incomingWebhook\",\n __args: {} as IncomingWebhookArgs<T>,\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WorkflowJob } from \"./job\";\nimport type { AuthInvoker } from \"../auth\";\n\nexport interface WorkflowConfig<\n Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>,\n> {\n name: string;\n mainJob: Job;\n}\n\nexport interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n trigger: (\n args: Parameters<Job[\"trigger\"]>[0],\n options?: { authInvoker: AuthInvoker<string> },\n ) => Promise<string>;\n}\n\ninterface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n}\n\n/**\n * Create a workflow definition that can be triggered via the Tailor SDK.\n * In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().\n * @template Job\n * @param config - Workflow configuration\n * @returns Defined workflow\n */\nexport function createWorkflow<Job extends WorkflowJob<any, any, any>>(\n config: WorkflowDefinition<Job>,\n): Workflow<Job> {\n return {\n ...config,\n // For local execution, directly call mainJob.trigger()\n // In production, bundler transforms this to tailor.workflow.triggerWorkflow()\n trigger: async (args) => {\n await config.mainJob.trigger(...([args] as unknown as []));\n return \"00000000-0000-0000-0000-000000000000\";\n },\n };\n}\n","import type { StaticWebsiteInput } from \"@/parser/service/staticwebsite/types\";\n\ndeclare const staticWebsiteDefinitionBrand: unique symbol;\ntype StaticWebsiteDefinitionBrand = {\n readonly [staticWebsiteDefinitionBrand]: true;\n};\n\n/**\n * Define a static website configuration for the Tailor SDK.\n * @param name - Static website name\n * @param config - Static website configuration\n * @returns Defined static website\n */\nexport function defineStaticWebSite(name: string, config: Omit<StaticWebsiteInput, \"name\">) {\n const result = {\n ...config,\n name,\n get url() {\n return `${name}:url` as const;\n },\n } as const satisfies StaticWebsiteInput & { readonly url: string };\n\n return result as typeof result & StaticWebsiteDefinitionBrand;\n}\n\nexport type StaticWebsiteConfig = Omit<ReturnType<typeof defineStaticWebSite>, \"url\">;\n","import type { BuiltinIdP } from \"@/parser/service/auth/types\";\nimport type { IdPInput, IdpDefinitionBrand } from \"@/parser/service/idp/types\";\n\n/**\n * Define an IdP service configuration for the Tailor SDK.\n * @template TClients\n * @param name - IdP service name\n * @param config - IdP configuration\n * @returns Defined IdP service\n */\nexport function defineIdp<const TClients extends string[]>(\n name: string,\n config: Omit<IdPInput, \"name\" | \"clients\"> & { clients: TClients },\n) {\n const result = {\n ...config,\n name,\n provider(providerName: string, clientName: TClients[number]) {\n return {\n name: providerName,\n kind: \"BuiltInIdP\",\n namespace: name,\n clientName,\n } as const satisfies BuiltinIdP;\n },\n } as const satisfies IdPInput & {\n provider: (providerName: string, clientName: TClients[number]) => BuiltinIdP;\n };\n\n return result as typeof result & IdpDefinitionBrand;\n}\n\nexport type { IdPConfig, IdPExternalConfig } from \"@/parser/service/idp/types\";\n","import type { AppConfig } from \"@/parser/app-config/types\";\nimport type { GeneratorConfig } from \"@/parser/generator-config/types\";\nimport type { PluginConfig } from \"@/parser/plugin-config/types\";\n\n/**\n * Define a Tailor SDK application configuration with shallow exactness.\n * @template Config\n * @param config - Application configuration\n * @returns The same configuration object\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineConfig<\n const Config extends AppConfig &\n // type-fest's Exact works recursively and causes type errors, so we use a shallow version here.\n Record<Exclude<keyof Config, keyof AppConfig>, never>,\n>(config: Config) {\n return config;\n}\n\n/**\n * Define generators to be used with the Tailor SDK.\n * @param configs - Generator configurations\n * @returns Generator configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineGenerators(...configs: GeneratorConfig[]) {\n return configs;\n}\n\n/**\n * Define plugins to be used with the Tailor SDK.\n * Plugins can generate additional types, resolvers, and executors\n * based on existing TailorDB types.\n * @param configs - Plugin configurations\n * @returns Plugin configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function definePlugins(...configs: PluginConfig[]) {\n return configs;\n}\n","import { t as _t } from \"@/configure/types\";\nimport type * as helperTypes from \"@/configure/types/helpers\";\n\ntype TailorOutput<T> = helperTypes.output<T>;\n\nexport type infer<T> = TailorOutput<T>;\nexport type output<T> = TailorOutput<T>;\n\n// eslint-disable-next-line import/export\nexport const t = { ..._t };\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace t {\n export type output<T> = TailorOutput<T>;\n export type infer<T> = TailorOutput<T>;\n}\n\nexport {\n type TailorField,\n type TailorUser,\n unauthenticatedTailorUser,\n type AttributeMap,\n type AttributeList,\n type Env,\n} from \"@/configure/types\";\n\nexport * from \"@/configure/services\";\n\nexport { defineConfig, defineGenerators, definePlugins } from \"@/configure/config\";\n\n// Plugin types for custom plugin development\nexport type {\n PluginBase,\n PluginConfig,\n PluginConfigs,\n PluginNamespaceGeneratedTypeEntry,\n PluginOutput,\n NamespacePluginOutput,\n PluginProcessContext,\n PluginNamespaceProcessContext,\n PluginAttachment,\n PluginGeneratedType,\n PluginGeneratedResolver,\n PluginGeneratedExecutor,\n PluginGeneratedExecutorWithFile,\n PluginExecutorContext,\n PluginExecutorContextBase,\n TailorDBTypeForPlugin,\n} from \"@/parser/plugin-config/types\";\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["t","_t"],"sources":["../../src/configure/types/user.ts","../../src/configure/services/auth/index.ts","../../src/configure/services/resolver/resolver.ts","../../src/configure/services/executor/executor.ts","../../src/configure/services/executor/trigger/event.ts","../../src/configure/services/executor/trigger/schedule.ts","../../src/configure/services/executor/trigger/webhook.ts","../../src/configure/services/workflow/workflow.ts","../../src/configure/services/staticwebsite/index.ts","../../src/configure/services/idp/index.ts","../../src/configure/config.ts","../../src/configure/index.ts"],"sourcesContent":["// Interfaces for module augmentation\n// Users can extend these via: declare module \"@tailor-platform/sdk\" { interface AttributeMap { ... } }\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface AttributeMap {}\nexport interface AttributeList {\n __tuple?: []; // Marker for tuple type\n}\n\nexport type InferredAttributeMap = keyof AttributeMap extends never\n ? Record<string, string | string[] | boolean | boolean[] | undefined>\n : AttributeMap;\n\nexport type InferredAttributeList = AttributeList[\"__tuple\"] extends []\n ? string[]\n : AttributeList[\"__tuple\"];\n\n/** Represents a user in the Tailor platform. */\nexport type TailorUser = {\n /**\n * The ID of the user.\n * For unauthenticated users, this will be a nil UUID.\n */\n id: string;\n /**\n * The type of the user.\n * For unauthenticated users, this will be an empty string.\n */\n type: \"user\" | \"machine_user\" | \"\";\n /** The ID of the workspace the user belongs to. */\n workspaceId: string;\n /**\n * A map of the user's attributes.\n * For unauthenticated users, this will be null.\n */\n attributes: InferredAttributeMap | null;\n /**\n * A list of the user's attributes.\n * For unauthenticated users, this will be an empty array.\n */\n attributeList: InferredAttributeList;\n};\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser: TailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n};\n","import { type TailorDBInstance } from \"../tailordb/schema\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { DefinedFieldMetadata, FieldMetadata, TailorFieldType } from \"@/configure/types/types\";\nimport type {\n AuthInvoker as ParserAuthInvoker,\n AuthDefinitionBrand,\n AuthServiceInput,\n DefinedAuth,\n UserAttributeListKey,\n UserAttributeMap,\n} from \"@/parser/service/auth/types\";\n\ntype MachineUserAttributeFields = Record<\n string,\n TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>\n>;\n\ntype PlaceholderUser = TailorDBInstance<Record<string, never>, Record<string, never>>;\ntype PlaceholderAttributeMap = UserAttributeMap<PlaceholderUser>;\ntype PlaceholderAttributeList = UserAttributeListKey<PlaceholderUser>[];\n\ntype UserProfileAuthInput<\n User extends TailorDBInstance,\n AttributeMap extends UserAttributeMap<User>,\n AttributeList extends UserAttributeListKey<User>[],\n MachineUserNames extends string,\n> = Omit<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile: NonNullable<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>[\"userProfile\"]\n >;\n machineUserAttributes?: never;\n};\n\ntype MachineUserOnlyAuthInput<\n MachineUserNames extends string,\n MachineUserAttributes extends MachineUserAttributeFields,\n> = Omit<\n AuthServiceInput<\n PlaceholderUser,\n PlaceholderAttributeMap,\n PlaceholderAttributeList,\n MachineUserNames,\n MachineUserAttributes\n >,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile?: never;\n machineUserAttributes: MachineUserAttributes;\n};\n\nexport type {\n OIDC,\n SAML,\n IDToken,\n BuiltinIdP,\n IdProviderConfig,\n OAuth2ClientGrantType,\n OAuth2ClientInput as OAuth2Client,\n SCIMAuthorization,\n SCIMAttributeType,\n SCIMAttribute,\n SCIMAttributeMapping,\n SCIMResource,\n SCIMConfig,\n TenantProviderConfig,\n ValueOperand,\n UsernameFieldKey,\n UserAttributeKey,\n UserAttributeListKey,\n UserAttributeMap,\n AuthServiceInput,\n AuthConfig,\n AuthExternalConfig,\n AuthOwnConfig,\n DefinedAuth,\n} from \"@/parser/service/auth/types\";\n\n/**\n * Invoker type compatible with tailor.v1.AuthInvoker\n * - namespace: auth service name\n * - machineUserName: machine user name\n */\nexport type AuthInvoker<M extends string> = Omit<ParserAuthInvoker, \"machineUserName\"> & {\n machineUserName: M;\n};\n\n/**\n * Define an auth service for the Tailor SDK.\n * @template Name\n * @template User\n * @template AttributeMap\n * @template AttributeList\n * @template MachineUserNames\n * @template M\n * @param name - Auth service name\n * @param config - Auth service configuration\n * @returns Defined auth service\n */\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserNames extends string,\n>(\n name: Name,\n config: UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n): DefinedAuth<\n Name,\n UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config: MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n): DefinedAuth<\n Name,\n MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config:\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n) {\n const result = {\n ...config,\n name,\n invoker<M extends MachineUserNames>(machineUser: M) {\n return { namespace: name, machineUserName: machineUser } as const;\n },\n } as const satisfies (\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>\n ) & {\n name: string;\n invoker<M extends MachineUserNames>(machineUser: M): AuthInvoker<M>;\n };\n\n validateAuthConfig(result);\n\n return result as typeof result & AuthDefinitionBrand;\n}\n\nfunction validateAuthConfig(config: {\n userProfile?: unknown;\n machineUserAttributes?: unknown;\n}): void {\n const hasUserProfile = config.userProfile !== undefined;\n const hasMachineUserAttributes = config.machineUserAttributes !== undefined;\n\n if (hasUserProfile && hasMachineUserAttributes) {\n throw new Error(\"Provide either userProfile or machineUserAttributes, not both.\");\n }\n}\n","import { t } from \"@/configure/types/type\";\nimport type { TailorAnyField, TailorUser } from \"@/configure/types\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { InferFieldsOutput, output } from \"@/configure/types/helpers\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { ResolverInput } from \"@/parser/service/resolver/types\";\n\ntype Context<Input extends Record<string, TailorAnyField> | undefined> = {\n input: Input extends Record<string, TailorAnyField> ? InferFieldsOutput<Input> : never;\n user: TailorUser;\n env: TailorEnv;\n};\n\ntype OutputType<O> = O extends TailorAnyField\n ? output<O>\n : O extends Record<string, TailorAnyField>\n ? InferFieldsOutput<O>\n : never;\n\n/**\n * Normalized output type that preserves generic type information.\n * - If Output is already a TailorField, use it as-is\n * - If Output is a Record of fields, wrap it as a nested TailorField\n */\ntype NormalizedOutput<Output extends TailorAnyField | Record<string, TailorAnyField>> =\n Output extends TailorAnyField\n ? Output\n : TailorField<\n { type: \"nested\"; array: false },\n InferFieldsOutput<Extract<Output, Record<string, TailorAnyField>>>\n >;\n\ntype ResolverReturn<\n Input extends Record<string, TailorAnyField> | undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField>,\n> = Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: NormalizedOutput<Output>;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>;\n\n/**\n * Create a resolver definition for the Tailor SDK.\n * @template Input\n * @template Output\n * @param config - Resolver configuration\n * @returns Normalized resolver configuration\n */\nexport function createResolver<\n Input extends Record<string, TailorAnyField> | undefined = undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField> = TailorAnyField,\n>(\n config: Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: Output;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>,\n): ResolverReturn<Input, Output> {\n // Check if output is already a TailorField using duck typing.\n // TailorField has `type: string` (e.g., \"uuid\", \"string\"), while\n // Record<string, TailorField> either lacks `type` or has TailorField as value.\n const isTailorField = (obj: unknown): obj is TailorAnyField =>\n typeof obj === \"object\" &&\n obj !== null &&\n \"type\" in obj &&\n typeof (obj as { type: unknown }).type === \"string\";\n\n const normalizedOutput = isTailorField(config.output) ? config.output : t.object(config.output);\n\n return {\n ...config,\n output: normalizedOutput,\n } as ResolverReturn<Input, Output>;\n}\n\n// A loose config alias for userland use-cases\n// oxlint-disable-next-line no-explicit-any\nexport type ResolverConfig = ReturnType<typeof createResolver<any, any>>;\n","import type { Operation } from \"./operation\";\nimport type { Trigger } from \"./trigger\";\nimport type { AuthInvoker } from \"@/configure/services/auth\";\nimport type { Workflow } from \"@/configure/services/workflow/workflow\";\nimport type { ExecutorInput } from \"@/parser/service/executor/types\";\n\n/**\n * Extract mainJob's Input type from Workflow.\n */\ntype WorkflowInput<W extends Workflow> = Parameters<W[\"trigger\"]>[0];\n\ntype ExecutorBase<Args> = Omit<ExecutorInput, \"trigger\" | \"operation\"> & {\n trigger: Trigger<Args>;\n};\n\n/**\n * Executor type with conditional inference for workflow operations.\n * When operation.kind is \"workflow\", infers W from the workflow property\n * to ensure args type matches the workflow's mainJob input type.\n */\ntype Executor<Args, O> = O extends {\n kind: \"workflow\";\n workflow: infer W extends Workflow;\n}\n ? ExecutorBase<Args> & {\n operation: {\n kind: \"workflow\";\n workflow: W;\n args?: WorkflowInput<W> | ((args: Args) => WorkflowInput<W>);\n authInvoker?: AuthInvoker<string>;\n };\n }\n : ExecutorBase<Args> & {\n operation: O;\n };\n\n/**\n * Create an executor configuration for the Tailor SDK.\n * @template Args\n * @template O\n * @param config - Executor configuration\n * @returns The same executor configuration\n */\nexport function createExecutor<\n Args,\n O extends Operation<Args> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<Args, O>) {\n return config;\n}\n","import type { ResolverConfig } from \"@/configure/services/resolver/resolver\";\nimport type { TailorDBType } from \"@/configure/services/tailordb/schema\";\nimport type { TailorActor } from \"@/configure/types/actor\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { output } from \"@/configure/types/helpers\";\nimport type {\n RecordTrigger as ParserRecordTrigger,\n ResolverExecutedTrigger as ParserResolverExecutedTrigger,\n IdpUserTrigger as ParserIdpUserTrigger,\n AuthAccessTokenTrigger as ParserAuthAccessTokenTrigger,\n} from \"@/parser/service/executor/types\";\n\ninterface EventArgs {\n workspaceId: string;\n appNamespace: string;\n env: TailorEnv;\n actor: TailorActor | null;\n}\n\ninterface RecordArgs extends EventArgs {\n typeName: string;\n}\n\nexport interface RecordCreatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n}\n\nexport interface RecordUpdatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n oldRecord: output<T>;\n}\n\nexport interface RecordDeletedArgs<T extends TailorDBType> extends RecordArgs {\n oldRecord: output<T>;\n}\n\nexport type ResolverExecutedArgs<R extends ResolverConfig> = EventArgs & {\n resolverName: string;\n} & (\n | {\n success: true;\n result: output<R[\"output\"]>;\n error?: never;\n }\n | {\n success: false;\n result?: never;\n error: string;\n }\n );\n\nexport type RecordTrigger<Args> = ParserRecordTrigger & {\n __args: Args;\n};\n\ntype RecordTriggerOptions<T extends TailorDBType, Args> = {\n type: T;\n condition?: (args: Args) => boolean;\n};\n\n/**\n * Create a trigger that fires when a TailorDB record is created.\n * @template T\n * @param options - Trigger options\n * @returns Record created trigger\n */\nexport function recordCreatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordCreatedArgs<T>>,\n): RecordTrigger<RecordCreatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordCreated\",\n typeName: type.name,\n condition,\n __args: {} as RecordCreatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is updated.\n * @template T\n * @param options - Trigger options\n * @returns Record updated trigger\n */\nexport function recordUpdatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordUpdatedArgs<T>>,\n): RecordTrigger<RecordUpdatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordUpdated\",\n typeName: type.name,\n condition,\n __args: {} as RecordUpdatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is deleted.\n * @template T\n * @param options - Trigger options\n * @returns Record deleted trigger\n */\nexport function recordDeletedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordDeletedArgs<T>>,\n): RecordTrigger<RecordDeletedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordDeleted\",\n typeName: type.name,\n condition,\n __args: {} as RecordDeletedArgs<T>,\n };\n}\n\nexport type ResolverExecutedTrigger<Args> = ParserResolverExecutedTrigger & {\n __args: Args;\n};\n\ntype ResolverExecutedTriggerOptions<R extends ResolverConfig> = {\n resolver: R;\n condition?: (args: ResolverExecutedArgs<R>) => boolean;\n};\n\n/**\n * Create a trigger that fires when a resolver is executed.\n * @template R\n * @param options - Trigger options\n * @returns Resolver executed trigger\n */\nexport function resolverExecutedTrigger<R extends ResolverConfig>(\n options: ResolverExecutedTriggerOptions<R>,\n): ResolverExecutedTrigger<ResolverExecutedArgs<R>> {\n const { resolver, condition } = options;\n return {\n kind: \"resolverExecuted\",\n resolverName: resolver.name,\n condition,\n __args: {} as ResolverExecutedArgs<R>,\n };\n}\n\n// IdP User Event Triggers\nexport interface IdpUserArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type IdpUserTrigger<Args> = ParserIdpUserTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an IdP user is created.\n * @returns IdP user created trigger\n */\nexport function idpUserCreatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserCreated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is updated.\n * @returns IdP user updated trigger\n */\nexport function idpUserUpdatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserUpdated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is deleted.\n * @returns IdP user deleted trigger\n */\nexport function idpUserDeletedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserDeleted\",\n __args: {} as IdpUserArgs,\n };\n}\n\n// Auth Access Token Event Triggers\nexport interface AuthAccessTokenArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type AuthAccessTokenTrigger<Args> = ParserAuthAccessTokenTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an access token is issued.\n * @returns Auth access token issued trigger\n */\nexport function authAccessTokenIssuedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenIssued\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is refreshed.\n * @returns Auth access token refreshed trigger\n */\nexport function authAccessTokenRefreshedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRefreshed\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is revoked.\n * @returns Auth access token revoked trigger\n */\nexport function authAccessTokenRevokedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRevoked\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { ScheduleTriggerInput as ParserScheduleTriggerInput } from \"@/parser/service/executor/types\";\nimport type { StandardCRON } from \"ts-cron-validator\";\n\ntype Timezone =\n | \"UTC\"\n | \"Pacific/Midway\"\n | \"Pacific/Niue\"\n | \"Pacific/Pago_Pago\"\n | \"America/Adak\"\n | \"Pacific/Honolulu\"\n | \"Pacific/Rarotonga\"\n | \"Pacific/Tahiti\"\n | \"Pacific/Marquesas\"\n | \"America/Anchorage\"\n | \"America/Juneau\"\n | \"America/Metlakatla\"\n | \"America/Nome\"\n | \"America/Sitka\"\n | \"America/Yakutat\"\n | \"Pacific/Gambier\"\n | \"America/Los_Angeles\"\n | \"America/Tijuana\"\n | \"America/Vancouver\"\n | \"Pacific/Pitcairn\"\n | \"America/Boise\"\n | \"America/Cambridge_Bay\"\n | \"America/Chihuahua\"\n | \"America/Creston\"\n | \"America/Dawson\"\n | \"America/Dawson_Creek\"\n | \"America/Denver\"\n | \"America/Edmonton\"\n | \"America/Fort_Nelson\"\n | \"America/Hermosillo\"\n | \"America/Inuvik\"\n | \"America/Mazatlan\"\n | \"America/Ojinaga\"\n | \"America/Phoenix\"\n | \"America/Whitehorse\"\n | \"America/Yellowknife\"\n | \"America/Bahia_Banderas\"\n | \"America/Belize\"\n | \"America/Chicago\"\n | \"America/Costa_Rica\"\n | \"America/El_Salvador\"\n | \"America/Guatemala\"\n | \"America/Indiana/Knox\"\n | \"America/Indiana/Tell_City\"\n | \"America/Managua\"\n | \"America/Matamoros\"\n | \"America/Menominee\"\n | \"America/Merida\"\n | \"America/Mexico_City\"\n | \"America/Monterrey\"\n | \"America/North_Dakota/Beulah\"\n | \"America/North_Dakota/Center\"\n | \"America/North_Dakota/New_Salem\"\n | \"America/Rainy_River\"\n | \"America/Rankin_Inlet\"\n | \"America/Regina\"\n | \"America/Resolute\"\n | \"America/Swift_Current\"\n | \"America/Tegucigalpa\"\n | \"America/Winnipeg\"\n | \"Pacific/Easter\"\n | \"Pacific/Galapagos\"\n | \"America/Atikokan\"\n | \"America/Bogota\"\n | \"America/Cancun\"\n | \"America/Cayman\"\n | \"America/Detroit\"\n | \"America/Eirunepe\"\n | \"America/Grand_Turk\"\n | \"America/Guayaquil\"\n | \"America/Havana\"\n | \"America/Indiana/Indianapolis\"\n | \"America/Indiana/Marengo\"\n | \"America/Indiana/Petersburg\"\n | \"America/Indiana/Vevay\"\n | \"America/Indiana/Vincennes\"\n | \"America/Indiana/Winamac\"\n | \"America/Iqaluit\"\n | \"America/Jamaica\"\n | \"America/Kentucky/Louisville\"\n | \"America/Kentucky/Monticello\"\n | \"America/Lima\"\n | \"America/Nassau\"\n | \"America/New_York\"\n | \"America/Nipigon\"\n | \"America/Panama\"\n | \"America/Pangnirtung\"\n | \"America/Port-au-Prince\"\n | \"America/Rio_Branco\"\n | \"America/Thunder_Bay\"\n | \"America/Toronto\"\n | \"America/Anguilla\"\n | \"America/Antigua\"\n | \"America/Aruba\"\n | \"America/Asuncion\"\n | \"America/Barbados\"\n | \"America/Blanc-Sablon\"\n | \"America/Boa_Vista\"\n | \"America/Campo_Grande\"\n | \"America/Caracas\"\n | \"America/Cuiaba\"\n | \"America/Curacao\"\n | \"America/Dominica\"\n | \"America/Glace_Bay\"\n | \"America/Goose_Bay\"\n | \"America/Grenada\"\n | \"America/Guadeloupe\"\n | \"America/Guyana\"\n | \"America/Halifax\"\n | \"America/Kralendijk\"\n | \"America/La_Paz\"\n | \"America/Lower_Princes\"\n | \"America/Manaus\"\n | \"America/Marigot\"\n | \"America/Martinique\"\n | \"America/Moncton\"\n | \"America/Montserrat\"\n | \"America/Porto_Velho\"\n | \"America/Port_of_Spain\"\n | \"America/Puerto_Rico\"\n | \"America/Santiago\"\n | \"America/Santo_Domingo\"\n | \"America/St_Barthelemy\"\n | \"America/St_Kitts\"\n | \"America/St_Lucia\"\n | \"America/St_Thomas\"\n | \"America/St_Vincent\"\n | \"America/Thule\"\n | \"America/Tortola\"\n | \"Atlantic/Bermuda\"\n | \"America/St_Johns\"\n | \"America/Araguaina\"\n | \"America/Argentina/Buenos_Aires\"\n | \"America/Argentina/Catamarca\"\n | \"America/Argentina/Cordoba\"\n | \"America/Argentina/Jujuy\"\n | \"America/Argentina/La_Rioja\"\n | \"America/Argentina/Mendoza\"\n | \"America/Argentina/Rio_Gallegos\"\n | \"America/Argentina/Salta\"\n | \"America/Argentina/San_Juan\"\n | \"America/Argentina/San_Luis\"\n | \"America/Argentina/Tucuman\"\n | \"America/Argentina/Ushuaia\"\n | \"America/Bahia\"\n | \"America/Belem\"\n | \"America/Cayenne\"\n | \"America/Fortaleza\"\n | \"America/Godthab\"\n | \"America/Maceio\"\n | \"America/Miquelon\"\n | \"America/Montevideo\"\n | \"America/Paramaribo\"\n | \"America/Punta_Arenas\"\n | \"America/Recife\"\n | \"America/Santarem\"\n | \"America/Sao_Paulo\"\n | \"Antarctica/Palmer\"\n | \"Antarctica/Rothera\"\n | \"Atlantic/Stanley\"\n | \"America/Noronha\"\n | \"Atlantic/South_Georgia\"\n | \"America/Scoresbysund\"\n | \"Atlantic/Azores\"\n | \"Atlantic/Cape_Verde\"\n | \"Africa/Abidjan\"\n | \"Africa/Accra\"\n | \"Africa/Bamako\"\n | \"Africa/Banjul\"\n | \"Africa/Bissau\"\n | \"Africa/Casablanca\"\n | \"Africa/Conakry\"\n | \"Africa/Dakar\"\n | \"Africa/El_Aaiun\"\n | \"Africa/Freetown\"\n | \"Africa/Lome\"\n | \"Africa/Monrovia\"\n | \"Africa/Nouakchott\"\n | \"Africa/Ouagadougou\"\n | \"Africa/Sao_Tome\"\n | \"America/Danmarkshavn\"\n | \"Antarctica/Troll\"\n | \"Atlantic/Canary\"\n | \"Atlantic/Faroe\"\n | \"Atlantic/Madeira\"\n | \"Atlantic/Reykjavik\"\n | \"Atlantic/St_Helena\"\n | \"Europe/Dublin\"\n | \"Europe/Guernsey\"\n | \"Europe/Isle_of_Man\"\n | \"Europe/Jersey\"\n | \"Europe/Lisbon\"\n | \"Europe/London\"\n | \"Africa/Algiers\"\n | \"Africa/Bangui\"\n | \"Africa/Brazzaville\"\n | \"Africa/Ceuta\"\n | \"Africa/Douala\"\n | \"Africa/Kinshasa\"\n | \"Africa/Lagos\"\n | \"Africa/Libreville\"\n | \"Africa/Luanda\"\n | \"Africa/Malabo\"\n | \"Africa/Ndjamena\"\n | \"Africa/Niamey\"\n | \"Africa/Porto-Novo\"\n | \"Africa/Tunis\"\n | \"Africa/Windhoek\"\n | \"Arctic/Longyearbyen\"\n | \"Europe/Amsterdam\"\n | \"Europe/Andorra\"\n | \"Europe/Belgrade\"\n | \"Europe/Berlin\"\n | \"Europe/Bratislava\"\n | \"Europe/Brussels\"\n | \"Europe/Budapest\"\n | \"Europe/Copenhagen\"\n | \"Europe/Gibraltar\"\n | \"Europe/Ljubljana\"\n | \"Europe/Luxembourg\"\n | \"Europe/Madrid\"\n | \"Europe/Malta\"\n | \"Europe/Monaco\"\n | \"Europe/Oslo\"\n | \"Europe/Paris\"\n | \"Europe/Podgorica\"\n | \"Europe/Prague\"\n | \"Europe/Rome\"\n | \"Europe/San_Marino\"\n | \"Europe/Sarajevo\"\n | \"Europe/Skopje\"\n | \"Europe/Stockholm\"\n | \"Europe/Tirane\"\n | \"Europe/Vaduz\"\n | \"Europe/Vatican\"\n | \"Europe/Vienna\"\n | \"Europe/Warsaw\"\n | \"Europe/Zagreb\"\n | \"Europe/Zurich\"\n | \"Africa/Blantyre\"\n | \"Africa/Bujumbura\"\n | \"Africa/Cairo\"\n | \"Africa/Gaborone\"\n | \"Africa/Harare\"\n | \"Africa/Johannesburg\"\n | \"Africa/Juba\"\n | \"Africa/Khartoum\"\n | \"Africa/Kigali\"\n | \"Africa/Lubumbashi\"\n | \"Africa/Lusaka\"\n | \"Africa/Maputo\"\n | \"Africa/Maseru\"\n | \"Africa/Mbabane\"\n | \"Africa/Tripoli\"\n | \"Asia/Amman\"\n | \"Asia/Beirut\"\n | \"Asia/Damascus\"\n | \"Asia/Famagusta\"\n | \"Asia/Gaza\"\n | \"Asia/Hebron\"\n | \"Asia/Jerusalem\"\n | \"Asia/Nicosia\"\n | \"Europe/Athens\"\n | \"Europe/Bucharest\"\n | \"Europe/Chisinau\"\n | \"Europe/Helsinki\"\n | \"Europe/Kaliningrad\"\n | \"Europe/Kyiv\"\n | \"Europe/Mariehamn\"\n | \"Europe/Riga\"\n | \"Europe/Sofia\"\n | \"Europe/Tallinn\"\n | \"Europe/Uzhgorod\"\n | \"Europe/Vilnius\"\n | \"Europe/Zaporizhzhia\"\n | \"Africa/Addis_Ababa\"\n | \"Africa/Asmara\"\n | \"Africa/Dar_es_Salaam\"\n | \"Africa/Djibouti\"\n | \"Africa/Kampala\"\n | \"Africa/Mogadishu\"\n | \"Africa/Nairobi\"\n | \"Antarctica/Syowa\"\n | \"Asia/Aden\"\n | \"Asia/Baghdad\"\n | \"Asia/Bahrain\"\n | \"Asia/Kuwait\"\n | \"Asia/Qatar\"\n | \"Asia/Riyadh\"\n | \"Europe/Istanbul\"\n | \"Europe/Kirov\"\n | \"Europe/Minsk\"\n | \"Europe/Moscow\"\n | \"Europe/Simferopol\"\n | \"Europe/Volgograd\"\n | \"Indian/Antananarivo\"\n | \"Indian/Comoro\"\n | \"Indian/Mayotte\"\n | \"Asia/Tehran\"\n | \"Asia/Baku\"\n | \"Asia/Dubai\"\n | \"Asia/Muscat\"\n | \"Asia/Tbilisi\"\n | \"Asia/Yerevan\"\n | \"Europe/Astrakhan\"\n | \"Europe/Samara\"\n | \"Europe/Saratov\"\n | \"Europe/Ulyanovsk\"\n | \"Indian/Mahe\"\n | \"Indian/Mauritius\"\n | \"Indian/Reunion\"\n | \"Asia/Kabul\"\n | \"Antarctica/Mawson\"\n | \"Asia/Aqtau\"\n | \"Asia/Aqtobe\"\n | \"Asia/Ashgabat\"\n | \"Asia/Atyrau\"\n | \"Asia/Dushanbe\"\n | \"Asia/Karachi\"\n | \"Asia/Oral\"\n | \"Asia/Qyzylorda\"\n | \"Asia/Samarkand\"\n | \"Asia/Tashkent\"\n | \"Asia/Yekaterinburg\"\n | \"Indian/Kerguelen\"\n | \"Indian/Maldives\"\n | \"Asia/Colombo\"\n | \"Asia/Kolkata\"\n | \"Asia/Kathmandu\"\n | \"Antarctica/Vostok\"\n | \"Asia/Almaty\"\n | \"Asia/Bishkek\"\n | \"Asia/Dhaka\"\n | \"Asia/Omsk\"\n | \"Asia/Qostanay\"\n | \"Asia/Thimphu\"\n | \"Asia/Urumqi\"\n | \"Indian/Chagos\"\n | \"Asia/Yangon\"\n | \"Indian/Cocos\"\n | \"Antarctica/Davis\"\n | \"Asia/Bangkok\"\n | \"Asia/Barnaul\"\n | \"Asia/Hovd\"\n | \"Asia/Ho_Chi_Minh\"\n | \"Asia/Jakarta\"\n | \"Asia/Krasnoyarsk\"\n | \"Asia/Novokuznetsk\"\n | \"Asia/Novosibirsk\"\n | \"Asia/Phnom_Penh\"\n | \"Asia/Pontianak\"\n | \"Asia/Tomsk\"\n | \"Asia/Vientiane\"\n | \"Indian/Christmas\"\n | \"Asia/Brunei\"\n | \"Asia/Choibalsan\"\n | \"Asia/Hong_Kong\"\n | \"Asia/Irkutsk\"\n | \"Asia/Kuala_Lumpur\"\n | \"Asia/Kuching\"\n | \"Asia/Macau\"\n | \"Asia/Makassar\"\n | \"Asia/Manila\"\n | \"Asia/Shanghai\"\n | \"Asia/Singapore\"\n | \"Asia/Taipei\"\n | \"Asia/Ulaanbaatar\"\n | \"Australia/Perth\"\n | \"Australia/Eucla\"\n | \"Asia/Chita\"\n | \"Asia/Dili\"\n | \"Asia/Jayapura\"\n | \"Asia/Khandyga\"\n | \"Asia/Pyongyang\"\n | \"Asia/Seoul\"\n | \"Asia/Tokyo\"\n | \"Asia/Yakutsk\"\n | \"Pacific/Palau\"\n | \"Australia/Adelaide\"\n | \"Australia/Broken_Hill\"\n | \"Australia/Darwin\"\n | \"Antarctica/DumontDUrville\"\n | \"Antarctica/Macquarie\"\n | \"Asia/Ust-Nera\"\n | \"Asia/Vladivostok\"\n | \"Australia/Brisbane\"\n | \"Australia/Currie\"\n | \"Australia/Hobart\"\n | \"Australia/Lindeman\"\n | \"Australia/Melbourne\"\n | \"Australia/Sydney\"\n | \"Pacific/Chuuk\"\n | \"Pacific/Guam\"\n | \"Pacific/Port_Moresby\"\n | \"Pacific/Saipan\"\n | \"Australia/Lord_Howe\"\n | \"Antarctica/Casey\"\n | \"Asia/Magadan\"\n | \"Asia/Sakhalin\"\n | \"Asia/Srednekolymsk\"\n | \"Pacific/Bougainville\"\n | \"Pacific/Efate\"\n | \"Pacific/Guadalcanal\"\n | \"Pacific/Kosrae\"\n | \"Pacific/Norfolk\"\n | \"Pacific/Noumea\"\n | \"Pacific/Pohnpei\"\n | \"Antarctica/McMurdo\"\n | \"Asia/Anadyr\"\n | \"Asia/Kamchatka\"\n | \"Pacific/Auckland\"\n | \"Pacific/Fiji\"\n | \"Pacific/Funafuti\"\n | \"Pacific/Kwajalein\"\n | \"Pacific/Majuro\"\n | \"Pacific/Nauru\"\n | \"Pacific/Tarawa\"\n | \"Pacific/Wake\"\n | \"Pacific/Wallis\"\n | \"Pacific/Chatham\"\n | \"Pacific/Apia\"\n | \"Pacific/Enderbury\"\n | \"Pacific/Fakaofo\"\n | \"Pacific/Tongatapu\"\n | \"Pacific/Kiritimati\";\n\nexport type ScheduleTrigger<Args> = ParserScheduleTriggerInput & {\n __args: Args;\n};\n\nexport interface ScheduleArgs {\n env: TailorEnv;\n}\n\ninterface ScheduleTriggerOptions<T extends string> {\n cron: StandardCRON<T> extends never ? never : T;\n timezone?: Timezone;\n}\n\n/**\n * Create a schedule-based trigger using a CRON expression and optional timezone.\n * @template T\n * @param options - Schedule options\n * @returns Schedule trigger\n */\nexport function scheduleTrigger<T extends string>(\n options: ScheduleTriggerOptions<T>,\n): ScheduleTrigger<ScheduleArgs> {\n const { cron, timezone } = options;\n return {\n kind: \"schedule\",\n cron,\n timezone,\n __args: {} as ScheduleArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { IncomingWebhookTrigger as ParserIncomingWebhookTrigger } from \"@/parser/service/executor/types\";\n\nexport interface IncomingWebhookArgs<T extends IncomingWebhookRequest> {\n body: T[\"body\"];\n headers: T[\"headers\"];\n method: \"POST\" | \"GET\" | \"PUT\" | \"DELETE\";\n rawBody: string;\n env: TailorEnv;\n}\n\nexport interface IncomingWebhookRequest {\n body: Record<string, unknown>;\n headers: Record<string, string>;\n}\n\nexport type IncomingWebhookTrigger<Args> = ParserIncomingWebhookTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger for incoming webhook requests.\n * @template T\n * @returns Incoming webhook trigger\n */\nexport function incomingWebhookTrigger<T extends IncomingWebhookRequest>(): IncomingWebhookTrigger<\n IncomingWebhookArgs<T>\n> {\n return {\n kind: \"incomingWebhook\",\n __args: {} as IncomingWebhookArgs<T>,\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WorkflowJob } from \"./job\";\nimport type { AuthInvoker } from \"../auth\";\n\nexport interface WorkflowConfig<\n Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>,\n> {\n name: string;\n mainJob: Job;\n}\n\nexport interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n trigger: (\n args: Parameters<Job[\"trigger\"]>[0],\n options?: { authInvoker: AuthInvoker<string> },\n ) => Promise<string>;\n}\n\ninterface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n}\n\n/**\n * Create a workflow definition that can be triggered via the Tailor SDK.\n * In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().\n * @template Job\n * @param config - Workflow configuration\n * @returns Defined workflow\n */\nexport function createWorkflow<Job extends WorkflowJob<any, any, any>>(\n config: WorkflowDefinition<Job>,\n): Workflow<Job> {\n return {\n ...config,\n // For local execution, directly call mainJob.trigger()\n // In production, bundler transforms this to tailor.workflow.triggerWorkflow()\n trigger: async (args) => {\n await config.mainJob.trigger(...([args] as unknown as []));\n return \"00000000-0000-0000-0000-000000000000\";\n },\n };\n}\n","import type { StaticWebsiteInput } from \"@/parser/service/staticwebsite/types\";\n\ndeclare const staticWebsiteDefinitionBrand: unique symbol;\ntype StaticWebsiteDefinitionBrand = {\n readonly [staticWebsiteDefinitionBrand]: true;\n};\n\n/**\n * Define a static website configuration for the Tailor SDK.\n * @param name - Static website name\n * @param config - Static website configuration\n * @returns Defined static website\n */\nexport function defineStaticWebSite(name: string, config: Omit<StaticWebsiteInput, \"name\">) {\n const result = {\n ...config,\n name,\n get url() {\n return `${name}:url` as const;\n },\n } as const satisfies StaticWebsiteInput & { readonly url: string };\n\n return result as typeof result & StaticWebsiteDefinitionBrand;\n}\n\nexport type StaticWebsiteConfig = Omit<ReturnType<typeof defineStaticWebSite>, \"url\">;\n","import type { BuiltinIdP } from \"@/parser/service/auth/types\";\nimport type { IdPInput, IdpDefinitionBrand } from \"@/parser/service/idp/types\";\n\n/**\n * Define an IdP service configuration for the Tailor SDK.\n * @template TClients\n * @param name - IdP service name\n * @param config - IdP configuration\n * @returns Defined IdP service\n */\nexport function defineIdp<const TClients extends string[]>(\n name: string,\n config: Omit<IdPInput, \"name\" | \"clients\"> & { clients: TClients },\n) {\n const result = {\n ...config,\n name,\n provider(providerName: string, clientName: TClients[number]) {\n return {\n name: providerName,\n kind: \"BuiltInIdP\",\n namespace: name,\n clientName,\n } as const satisfies BuiltinIdP;\n },\n } as const satisfies IdPInput & {\n provider: (providerName: string, clientName: TClients[number]) => BuiltinIdP;\n };\n\n return result as typeof result & IdpDefinitionBrand;\n}\n\nexport type { IdPConfig, IdPExternalConfig } from \"@/parser/service/idp/types\";\n","import type { AppConfig } from \"@/parser/app-config/types\";\nimport type { GeneratorConfig } from \"@/parser/generator-config/types\";\nimport type { Plugin } from \"@/parser/plugin-config/types\";\n\n/**\n * Define a Tailor SDK application configuration with shallow exactness.\n * @template Config\n * @param config - Application configuration\n * @returns The same configuration object\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineConfig<\n const Config extends AppConfig &\n // type-fest's Exact works recursively and causes type errors, so we use a shallow version here.\n Record<Exclude<keyof Config, keyof AppConfig>, never>,\n>(config: Config) {\n return config;\n}\n\n/**\n * Define generators to be used with the Tailor SDK.\n * @param configs - Generator configurations\n * @returns Generator configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineGenerators(...configs: GeneratorConfig[]) {\n return configs;\n}\n\n/**\n * Define plugins to be used with the Tailor SDK.\n * Plugins can generate additional types, resolvers, and executors\n * based on existing TailorDB types.\n * @param configs - Plugin configurations\n * @returns Plugin configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function definePlugins(...configs: Plugin[]) {\n return configs;\n}\n","import { t as _t } from \"@/configure/types\";\nimport type * as helperTypes from \"@/configure/types/helpers\";\n\ntype TailorOutput<T> = helperTypes.output<T>;\n\nexport type infer<T> = TailorOutput<T>;\nexport type output<T> = TailorOutput<T>;\n\n// eslint-disable-next-line import/export\nexport const t = { ..._t };\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace t {\n export type output<T> = TailorOutput<T>;\n export type infer<T> = TailorOutput<T>;\n}\n\nexport {\n type TailorField,\n type TailorUser,\n unauthenticatedTailorUser,\n type AttributeMap,\n type AttributeList,\n type Env,\n} from \"@/configure/types\";\n\nexport * from \"@/configure/services\";\n\nexport { defineConfig, defineGenerators, definePlugins } from \"@/configure/config\";\n\n// Plugin types for custom plugin development\nexport type {\n Plugin,\n PluginConfigs,\n PluginOutput,\n NamespacePluginOutput,\n PluginProcessContext,\n PluginNamespaceProcessContext,\n PluginAttachment,\n PluginGeneratedType,\n PluginGeneratedResolver,\n PluginGeneratedExecutor,\n PluginGeneratedExecutorWithFile,\n PluginExecutorContext,\n PluginExecutorContextBase,\n TailorDBTypeForPlugin,\n} from \"@/parser/plugin-config/types\";\n"],"mappings":"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"}
|