@tailor-platform/sdk 1.36.0 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/dist/application-C1ipG5Q6.mjs +4 -0
- package/dist/{application-BwboBFcU.mjs → application-DhQrXEld.mjs} +60 -22
- package/dist/application-DhQrXEld.mjs.map +1 -0
- package/dist/{brand-0SscafcY.mjs → brand-D-d15jx3.mjs} +1 -1
- package/dist/{brand-0SscafcY.mjs.map → brand-D-d15jx3.mjs.map} +1 -1
- package/dist/cli/index.mjs +369 -128
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +6 -6
- package/dist/cli/lib.mjs +7 -7
- package/dist/{client-B6icVEv4.mjs → client-BWAbbA1C.mjs} +1 -1
- package/dist/{client-CN15WgW2.mjs → client-xzPXtc_e.mjs} +10 -4
- package/dist/{client-CN15WgW2.mjs.map → client-xzPXtc_e.mjs.map} +1 -1
- package/dist/configure/index.d.mts +4 -5
- package/dist/configure/index.mjs +8 -15
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{crash-report-CB1UtT3O.mjs → crash-report-BEAiCSCl.mjs} +1 -1
- package/dist/{crash-report-CdxPj_SW.mjs → crash-report-DXhPL8Ue.mjs} +4 -4
- package/dist/{crash-report-CdxPj_SW.mjs.map → crash-report-DXhPL8Ue.mjs.map} +1 -1
- package/dist/{enum-constants-DI85-fPE.mjs → enum-constants-Dx82rSjf.mjs} +1 -1
- package/dist/{enum-constants-DI85-fPE.mjs.map → enum-constants-Dx82rSjf.mjs.map} +1 -1
- package/dist/errors-D9f2UJpT.mjs +43 -0
- package/dist/errors-D9f2UJpT.mjs.map +1 -0
- package/dist/{file-utils-C4rXlOVt.mjs → file-utils-DeWpvq3T.mjs} +1 -1
- package/dist/{file-utils-C4rXlOVt.mjs.map → file-utils-DeWpvq3T.mjs.map} +1 -1
- package/dist/{index-DZN1QFLM.d.mts → index-CHo73Aat.d.mts} +2 -2
- package/dist/{index-CxSLivW7.d.mts → index-CIIXsk3E.d.mts} +2 -2
- package/dist/{index-C7vIBAg8.d.mts → index-Cln_TTZn.d.mts} +2 -2
- package/dist/{index-CYaunQeL.d.mts → index-Cs3fwmLu.d.mts} +33 -13
- package/dist/{index-DDCyefuU.d.mts → index-D_W9-Lvk.d.mts} +2 -2
- package/dist/{interceptor-f7slMkCC.mjs → interceptor-CzaH2Ur6.mjs} +1 -1
- package/dist/{interceptor-f7slMkCC.mjs.map → interceptor-CzaH2Ur6.mjs.map} +1 -1
- package/dist/{job-CPKYCk_e.mjs → job-DkAklmE4.mjs} +2 -2
- package/dist/{job-CPKYCk_e.mjs.map → job-DkAklmE4.mjs.map} +1 -1
- package/dist/{kysely-type-DtnNdHn3.mjs → kysely-type-CwtvQuxh.mjs} +1 -1
- package/dist/{kysely-type-DtnNdHn3.mjs.map → kysely-type-CwtvQuxh.mjs.map} +1 -1
- package/dist/{logger-qz-Y4sBV.mjs → logger-5_JMzHmw.mjs} +42 -3
- package/dist/logger-5_JMzHmw.mjs.map +1 -0
- package/dist/package-json--6dmp6-h.mjs +4 -0
- package/dist/{package-json-CfUqjJaQ.mjs → package-json-BHViVisJ.mjs} +1 -1
- package/dist/{package-json-CfUqjJaQ.mjs.map → package-json-BHViVisJ.mjs.map} +1 -1
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/index.d.mts +1 -2
- package/dist/{plugin-CiPUxkyN.d.mts → plugin-D84blivd.d.mts} +67 -11
- package/dist/{runtime-C7RRDaB3.mjs → runtime-ChpwtPut.mjs} +587 -144
- package/dist/runtime-ChpwtPut.mjs.map +1 -0
- package/dist/{schema-D27cW0Ca.mjs → schema-CnwUqPyM.mjs} +4 -361
- package/dist/schema-CnwUqPyM.mjs.map +1 -0
- package/dist/{seed-BZIFDG27.mjs → seed-DrbB1VXd.mjs} +1 -1
- package/dist/{seed-BZIFDG27.mjs.map → seed-DrbB1VXd.mjs.map} +1 -1
- package/dist/service-Bcp6JB3w.mjs +132 -0
- package/dist/service-Bcp6JB3w.mjs.map +1 -0
- package/dist/telemetry-4IOPW6wE.mjs +4 -0
- package/dist/{telemetry-CREcGK8y.mjs → telemetry-DwHuiNiR.mjs} +2 -2
- package/dist/{telemetry-CREcGK8y.mjs.map → telemetry-DwHuiNiR.mjs.map} +1 -1
- package/dist/types-B9ZMosul.mjs +372 -0
- package/dist/types-B9ZMosul.mjs.map +1 -0
- package/dist/types-C45jRrCM.mjs +4 -0
- package/dist/utils/test/index.d.mts +2 -2
- package/dist/utils/test/index.mjs +7 -3
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/{workflow.generated-8BeGQsVU.d.mts → workflow.generated-BRdcCWfC.d.mts} +2 -2
- package/docs/cli/function.md +42 -16
- package/docs/cli/upgrade.md +51 -0
- package/docs/cli/user.md +1 -1
- package/docs/cli/workflow.md +10 -10
- package/docs/cli-reference.md +23 -14
- package/docs/configuration.md +9 -7
- package/docs/services/auth.md +6 -5
- package/docs/services/executor.md +44 -12
- package/docs/services/resolver.md +6 -13
- package/docs/services/tailordb.md +20 -0
- package/docs/services/workflow.md +4 -3
- package/package.json +10 -10
- package/dist/application-BB5TqXWY.mjs +0 -4
- package/dist/application-BwboBFcU.mjs.map +0 -1
- package/dist/env-_ce3IYbl.d.mts +0 -30
- package/dist/logger-qz-Y4sBV.mjs.map +0 -1
- package/dist/package-json-D5Km1jjt.mjs +0 -4
- package/dist/runtime-C7RRDaB3.mjs.map +0 -1
- package/dist/schema-D27cW0Ca.mjs.map +0 -1
- package/dist/telemetry-C508zIi1.mjs +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-5_JMzHmw.mjs","names":[],"sources":["../src/cli/shared/parse-boolean.ts","../src/cli/shared/logger.ts"],"sourcesContent":["const TRUTHY_VALUES = new Set([\"true\", \"t\", \"yes\", \"y\", \"on\", \"1\"]);\nconst FALSY_VALUES = new Set([\"false\", \"f\", \"no\", \"n\", \"off\", \"0\"]);\n\n/**\n * Parse a string value as a boolean.\n *\n * Recognized values (case-insensitive, trimmed) follow Python's\n * `distutils.util.strtobool` convention:\n * - truthy: `true, t, yes, y, on, 1`\n * - falsy: `false, f, no, n, off, 0`\n *\n * Undefined, empty strings, and unrecognized values return `undefined` so\n * that callers can fall back to their own defaults.\n * @param value - The input string (e.g. an environment variable or CLI flag value)\n * @returns `true`, `false`, or `undefined` when the value is unset or unrecognized\n */\nexport function parseBoolean(value: string | undefined): boolean | undefined {\n if (value === undefined) return undefined;\n const normalized = value.trim().toLowerCase();\n if (normalized === \"\") return undefined;\n if (TRUTHY_VALUES.has(normalized)) return true;\n if (FALSY_VALUES.has(normalized)) return false;\n return undefined;\n}\n","import { formatWithOptions, type InspectOptions } from \"node:util\";\nimport chalk from \"chalk\";\nimport { formatDistanceToNowStrict } from \"date-fns\";\nimport { getBorderCharacters, table } from \"table\";\nimport { parseBoolean } from \"./parse-boolean\";\n\n/**\n * Error thrown when a prompt is attempted in a CI environment\n */\nexport class CIPromptError extends Error {\n constructor(message?: string) {\n super(\n message ??\n \"Interactive prompts are not available in CI environments. Use --yes flag to skip confirmation prompts.\",\n );\n this.name = \"CIPromptError\";\n }\n}\n\n/**\n * Semantic style functions for inline text styling\n */\nexport const styles = {\n // Status colors\n success: chalk.green,\n error: chalk.red,\n warning: chalk.yellow,\n info: chalk.cyan,\n\n // Action colors (for change sets)\n create: chalk.green,\n update: chalk.yellow,\n delete: chalk.red,\n unchanged: chalk.gray,\n\n // Emphasis\n bold: chalk.bold,\n dim: chalk.gray,\n highlight: chalk.cyanBright,\n successBright: chalk.greenBright,\n errorBright: chalk.redBright,\n\n // Resource types\n resourceType: chalk.bold,\n resourceName: chalk.cyan,\n\n // File paths\n path: chalk.cyan,\n\n // Values\n value: chalk.white,\n placeholder: chalk.gray.italic,\n};\n\n/**\n * Standardized symbols for CLI output\n */\nexport const symbols = {\n success: chalk.green(\"\\u2713\"),\n error: chalk.red(\"\\u2716\"),\n warning: chalk.yellow(\"\\u26a0\"),\n info: chalk.cyan(\"i\"),\n create: chalk.green(\"+\"),\n update: chalk.yellow(\"~\"),\n delete: chalk.red(\"-\"),\n replace: chalk.magenta(\"\\u00b1\"),\n bullet: chalk.gray(\"\\u2022\"),\n arrow: chalk.gray(\"\\u2192\"),\n};\n\n/**\n * Log output modes\n */\nexport type LogMode = \"default\" | \"stream\" | \"plain\";\n\nexport interface LogOptions {\n /** Output mode (default: \"default\") */\n mode?: LogMode;\n /** Number of spaces to indent the entire line (default: 0) */\n indent?: number;\n}\n\n/** Field transformer function. null excludes the field from table output. */\nexport type FieldTransformer = ((value: unknown, item: object) => string) | null;\n\nexport interface OutOptions {\n /** Table display field transform/exclude settings. Only applied in table mode (not JSON). */\n display?: Record<string, FieldTransformer>;\n\n /** Show null values in table output (default: false) */\n showNull?: boolean;\n}\n\n// In JSON mode, all logs go to stderr to keep stdout clean for JSON data\nlet _jsonMode = false;\n\n// Type icons for log output\nconst TYPE_ICONS: Record<string, string> = {\n info: \"ℹ\",\n success: \"✔\",\n warn: \"⚠\",\n error: \"✖\",\n debug: \"⚙\",\n trace: \"→\",\n log: \"\",\n};\n\n// Color functions for icon and message text\nconst TYPE_COLORS: Record<string, (text: string) => string> = {\n info: chalk.cyan,\n success: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n debug: chalk.gray,\n trace: chalk.gray,\n log: (text) => text,\n};\n\ninterface FormatLogLineOptions {\n mode: string;\n indent: number;\n type: string;\n message: string;\n timestamp?: string;\n}\n\n/**\n * Formats a log line with the appropriate prefix and indentation\n * @param opts - Formatting options\n * @returns Formatted log line\n */\nexport function formatLogLine(opts: FormatLogLineOptions): string {\n const { mode, indent, type, message, timestamp } = opts;\n const indentPrefix = indent > 0 ? \" \".repeat(indent) : \"\";\n const colorFn = TYPE_COLORS[type] || ((text: string) => text);\n\n // Plain mode: color only, no icon, no timestamp\n if (mode === \"plain\") {\n return `${indentPrefix}${colorFn(message)}\\n`;\n }\n\n // Default/Stream mode: with icon and color\n const icon = TYPE_ICONS[type] || \"\";\n const prefix = icon ? `${icon} ` : \"\";\n const coloredOutput = colorFn(`${prefix}${message}`);\n const timestampPrefix = timestamp ?? \"\";\n\n return `${indentPrefix}${timestampPrefix}${coloredOutput}\\n`;\n}\n\n/**\n * Writes a formatted log line to stderr.\n * @param type - Log type (info, success, warn, error, log)\n * @param message - Log message\n * @param opts - Log options (mode and indent)\n */\nfunction writeLog(type: string, message: string, opts?: LogOptions): void {\n const mode = opts?.mode ?? \"default\";\n const indent = opts?.indent ?? 0;\n const inspectOpts: InspectOptions = {\n breakLength: process.stdout.columns || 80,\n };\n const formattedMessage = formatWithOptions(inspectOpts, message);\n const timestamp = mode === \"stream\" ? `${new Date().toLocaleTimeString()} ` : \"\";\n const output = formatLogLine({ mode, indent, type, message: formattedMessage, timestamp });\n process.stderr.write(output);\n}\n\nexport const logger = {\n get jsonMode(): boolean {\n return _jsonMode;\n },\n set jsonMode(value: boolean) {\n _jsonMode = value;\n },\n\n info(message: string, opts?: LogOptions): void {\n writeLog(\"info\", message, opts);\n },\n\n success(message: string, opts?: LogOptions): void {\n writeLog(\"success\", message, opts);\n },\n\n warn(message: string, opts?: LogOptions): void {\n writeLog(\"warn\", message, opts);\n },\n\n error(message: string, opts?: LogOptions): void {\n writeLog(\"error\", message, opts);\n },\n\n log(message: string): void {\n writeLog(\"log\", message, { mode: \"plain\" });\n },\n\n newline(): void {\n process.stderr.write(\"\\n\");\n },\n\n debug(message: string): void {\n if (parseBoolean(process.env.DEBUG) === true) {\n writeLog(\"log\", styles.dim(message), { mode: \"plain\" });\n }\n },\n\n out(data: string | object | object[], options?: OutOptions): void {\n if (typeof data === \"string\") {\n process.stdout.write(data.endsWith(\"\\n\") ? data : data + \"\\n\");\n return;\n }\n\n if (this.jsonMode) {\n // eslint-disable-next-line no-restricted-syntax\n console.log(JSON.stringify(data));\n return;\n }\n\n const display = options?.display;\n\n // Helper to format a value for table display\n const formatValue = (value: unknown, pretty = false): string => {\n if (options?.showNull && value === null) return \"NULL\";\n if (value === null || value === undefined) return \"N/A\";\n if (value instanceof Date) {\n return formatDistanceToNowStrict(value, { addSuffix: true });\n }\n if (typeof value === \"object\") {\n return pretty ? JSON.stringify(value, null, 2) : JSON.stringify(value);\n }\n return String(value);\n };\n\n // Helper to check if field should be excluded\n const isExcluded = (key: string): boolean => {\n return display !== undefined && key in display && display[key] === null;\n };\n\n // Helper to apply transformer or default formatting\n const transformValue = (key: string, value: unknown, item: object, pretty = false): string => {\n if (display && key in display) {\n const transformer = display[key];\n if (transformer) {\n return transformer(value, item);\n }\n }\n return formatValue(value, pretty);\n };\n\n if (!Array.isArray(data)) {\n const entries = Object.entries(data).filter(([key]) => !isExcluded(key));\n const formattedEntries = entries.map(([key, value]) => [\n key,\n transformValue(key, value, data, true),\n ]);\n const t = table(formattedEntries, {\n singleLine: false,\n border: getBorderCharacters(\"norc\"),\n });\n process.stdout.write(t);\n return;\n }\n\n if (data.length === 0) {\n return;\n }\n\n const allHeaders = Array.from(new Set(data.flatMap((item) => Object.keys(item))));\n const headers = allHeaders.filter((h) => !isExcluded(h));\n const rows = data.map((item) =>\n headers.map((header) =>\n transformValue(header, (item as Record<string, unknown>)[header], item),\n ),\n );\n\n const t = table([headers, ...rows], {\n border: getBorderCharacters(\"norc\"),\n drawHorizontalLine: (lineIndex, rowCount) => {\n return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;\n },\n });\n process.stdout.write(t);\n },\n};\n"],"mappings":";;;;;;;AAAA,MAAM,gBAAgB,IAAI,IAAI;CAAC;CA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WAAW,CACrD,KACA,eAAe,KAAK,OAAO,MAAM,KAAK,CACvC,CAAC,EACgC;IAChC,YAAY;IACZ,QAAQ,oBAAoB,OAAO;IACpC,CAAC;AACF,WAAQ,OAAO,MAAM,EAAE;AACvB;;AAGF,MAAI,KAAK,WAAW,EAClB;EAIF,MAAM,UADa,MAAM,KAAK,IAAI,IAAI,KAAK,SAAS,SAAS,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CACtD,QAAQ,MAAM,CAAC,WAAW,EAAE,CAAC;EAOxD,MAAM,IAAI,MAAM,CAAC,SAAS,GANb,KAAK,KAAK,SACrB,QAAQ,KAAK,WACX,eAAe,QAAS,KAAiC,SAAS,KAAK,CACxE,CACF,CAEiC,EAAE;GAClC,QAAQ,oBAAoB,OAAO;GACnC,qBAAqB,WAAW,aAAa;AAC3C,WAAO,cAAc,KAAK,cAAc,KAAK,cAAc;;GAE9D,CAAC;AACF,UAAQ,OAAO,MAAM,EAAE;;CAE1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-
|
|
1
|
+
{"version":3,"file":"package-json-BHViVisJ.mjs","names":[],"sources":["../src/cli/shared/package-json.ts"],"sourcesContent":["import { readPackageJSON, type PackageJson } from \"pkg-types\";\n\nlet packageJson: PackageJson | null = null;\n\n/**\n * Read and cache the package.json of the SDK package.\n * @returns Parsed package.json contents\n */\nexport async function readPackageJson() {\n if (packageJson) {\n return packageJson;\n }\n packageJson = await readPackageJSON(import.meta.url);\n return packageJson;\n}\n"],"mappings":";;;;AAEA,IAAI,cAAkC;;;;;AAMtC,eAAsB,kBAAkB;AACtC,KAAI,YACF,QAAO;AAET,eAAc,MAAM,gBAAgB,OAAO,KAAK,IAAI;AACpD,QAAO"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@tailor-platform/function-types" />
|
|
2
|
-
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-
|
|
2
|
+
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-CHo73Aat.mjs";
|
|
3
3
|
export { EnumConstantsGeneratorID, enumConstantsPlugin };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../enum-constants-
|
|
2
|
+
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../enum-constants-Dx82rSjf.mjs";
|
|
3
3
|
|
|
4
4
|
export { EnumConstantsGeneratorID, enumConstantsPlugin };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@tailor-platform/function-types" />
|
|
2
|
-
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-
|
|
2
|
+
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-D_W9-Lvk.mjs";
|
|
3
3
|
export { FileUtilsGeneratorID, fileUtilsPlugin };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@tailor-platform/function-types" />
|
|
2
|
-
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-
|
|
2
|
+
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-Cln_TTZn.mjs";
|
|
3
3
|
export { KyselyGeneratorID, kyselyTypePlugin };
|
package/dist/plugin/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="@tailor-platform/function-types" />
|
|
2
|
-
import { B as TailorAnyDBType } from "../plugin-
|
|
3
|
-
import { n as TailorEnv, r as TailorActor } from "../env-_ce3IYbl.mjs";
|
|
2
|
+
import { B as TailorAnyDBType, dt as TailorEnv, ft as TailorActor } from "../plugin-D84blivd.mjs";
|
|
4
3
|
|
|
5
4
|
//#region src/plugin/with-context.d.ts
|
|
6
5
|
/**
|
|
@@ -30,10 +30,11 @@ declare const BaseGeneratorConfigSchema: z.ZodUnion<readonly [z.ZodTuple<[z.ZodL
|
|
|
30
30
|
}, z.core.$strip>]>;
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/types/auth.generated.d.ts
|
|
33
|
-
type
|
|
33
|
+
type AuthInvokerObject = {
|
|
34
34
|
/** Auth namespace */namespace: string; /** Machine user name for authentication */
|
|
35
35
|
machineUserName: string;
|
|
36
36
|
};
|
|
37
|
+
type AuthInvoker = AuthInvokerObject;
|
|
37
38
|
type OIDC = {
|
|
38
39
|
/** Identity provider name */name: string;
|
|
39
40
|
kind: "OIDC"; /** OAuth2 client ID */
|
|
@@ -195,7 +196,11 @@ type ScheduleTriggerInput = {
|
|
|
195
196
|
timezone?: string | undefined;
|
|
196
197
|
};
|
|
197
198
|
type IncomingWebhookTrigger = {
|
|
198
|
-
kind: "incomingWebhook";
|
|
199
|
+
kind: "incomingWebhook"; /** Response configuration */
|
|
200
|
+
response?: {
|
|
201
|
+
body?: Function | undefined;
|
|
202
|
+
statusCode?: number | undefined;
|
|
203
|
+
} | undefined;
|
|
199
204
|
};
|
|
200
205
|
type IdpUserTrigger = {
|
|
201
206
|
/** IdP user event trigger */kind: "idpUser"; /** IdP user event types to trigger on */
|
|
@@ -208,7 +213,7 @@ type AuthAccessTokenTrigger = {
|
|
|
208
213
|
type FunctionOperation = {
|
|
209
214
|
kind: "function" | "jobFunction"; /** Function implementation */
|
|
210
215
|
body: Function; /** Auth invoker for the function execution */
|
|
211
|
-
authInvoker?: {
|
|
216
|
+
authInvoker?: string | {
|
|
212
217
|
namespace: string;
|
|
213
218
|
machineUserName: string;
|
|
214
219
|
} | undefined;
|
|
@@ -218,7 +223,7 @@ type GqlOperation = {
|
|
|
218
223
|
query: string; /** Target application name for the GraphQL query */
|
|
219
224
|
appName?: string | undefined; /** Function to compute GraphQL variables */
|
|
220
225
|
variables?: Function | undefined; /** Auth invoker for the GraphQL execution */
|
|
221
|
-
authInvoker?: {
|
|
226
|
+
authInvoker?: string | {
|
|
222
227
|
namespace: string;
|
|
223
228
|
machineUserName: string;
|
|
224
229
|
} | undefined;
|
|
@@ -240,7 +245,7 @@ type WorkflowOperation = {
|
|
|
240
245
|
args?: Function | {
|
|
241
246
|
[x: string]: unknown;
|
|
242
247
|
} | undefined;
|
|
243
|
-
authInvoker?: {
|
|
248
|
+
authInvoker?: string | {
|
|
244
249
|
namespace: string;
|
|
245
250
|
machineUserName: string;
|
|
246
251
|
} | undefined;
|
|
@@ -262,6 +267,10 @@ type ExecutorInput = {
|
|
|
262
267
|
timezone?: string | undefined;
|
|
263
268
|
} | {
|
|
264
269
|
kind: "incomingWebhook";
|
|
270
|
+
response?: {
|
|
271
|
+
body?: Function | undefined;
|
|
272
|
+
statusCode?: number | undefined;
|
|
273
|
+
} | undefined;
|
|
265
274
|
} | {
|
|
266
275
|
kind: "idpUser";
|
|
267
276
|
events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
|
|
@@ -291,6 +300,10 @@ type Executor = {
|
|
|
291
300
|
timezone: string;
|
|
292
301
|
} | {
|
|
293
302
|
kind: "incomingWebhook";
|
|
303
|
+
response?: {
|
|
304
|
+
body?: Function | undefined;
|
|
305
|
+
statusCode?: number | undefined;
|
|
306
|
+
} | undefined;
|
|
294
307
|
} | {
|
|
295
308
|
kind: "idpUser";
|
|
296
309
|
events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
|
|
@@ -304,14 +317,14 @@ type Executor = {
|
|
|
304
317
|
args?: Function | {
|
|
305
318
|
[x: string]: unknown;
|
|
306
319
|
} | undefined;
|
|
307
|
-
authInvoker?: {
|
|
320
|
+
authInvoker?: string | {
|
|
308
321
|
namespace: string;
|
|
309
322
|
machineUserName: string;
|
|
310
323
|
} | undefined;
|
|
311
324
|
} | {
|
|
312
325
|
kind: "function" | "jobFunction";
|
|
313
326
|
body: Function;
|
|
314
|
-
authInvoker?: {
|
|
327
|
+
authInvoker?: string | {
|
|
315
328
|
namespace: string;
|
|
316
329
|
machineUserName: string;
|
|
317
330
|
} | undefined;
|
|
@@ -320,7 +333,7 @@ type Executor = {
|
|
|
320
333
|
query: string;
|
|
321
334
|
appName?: string | undefined;
|
|
322
335
|
variables?: Function | undefined;
|
|
323
|
-
authInvoker?: {
|
|
336
|
+
authInvoker?: string | {
|
|
324
337
|
namespace: string;
|
|
325
338
|
machineUserName: string;
|
|
326
339
|
} | undefined;
|
|
@@ -371,7 +384,7 @@ type Resolver = {
|
|
|
371
384
|
[x: string]: any;
|
|
372
385
|
} | undefined; /** Enable publishing events from this resolver */
|
|
373
386
|
publishEvents?: boolean | undefined; /** Machine user to execute this resolver as */
|
|
374
|
-
authInvoker?: {
|
|
387
|
+
authInvoker?: string | {
|
|
375
388
|
namespace: string;
|
|
376
389
|
machineUserName: string;
|
|
377
390
|
} | undefined;
|
|
@@ -438,6 +451,42 @@ type TailorUser = {
|
|
|
438
451
|
/** Represents an unauthenticated user in the Tailor platform. */
|
|
439
452
|
declare const unauthenticatedTailorUser: TailorUser;
|
|
440
453
|
//#endregion
|
|
454
|
+
//#region src/configure/types/actor.d.ts
|
|
455
|
+
/** User type enum values from the Tailor Platform server. */
|
|
456
|
+
type TailorActorType = "USER_TYPE_USER" | "USER_TYPE_MACHINE_USER" | "USER_TYPE_UNSPECIFIED";
|
|
457
|
+
/** Represents an actor in event triggers. */
|
|
458
|
+
type TailorActor = {
|
|
459
|
+
/** The ID of the workspace the user belongs to. */workspaceId: string; /** The ID of the user. */
|
|
460
|
+
userId: string;
|
|
461
|
+
/**
|
|
462
|
+
* A map of the user's attributes.
|
|
463
|
+
* Maps from server's `attributeMap` field.
|
|
464
|
+
*/
|
|
465
|
+
attributes: InferredAttributeMap | null;
|
|
466
|
+
/**
|
|
467
|
+
* A list of the user's attributes.
|
|
468
|
+
* Maps from server's `attributes` field.
|
|
469
|
+
*/
|
|
470
|
+
attributeList: InferredAttributeList; /** The type of the user. */
|
|
471
|
+
userType: TailorActorType;
|
|
472
|
+
};
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region src/configure/types/env.d.ts
|
|
475
|
+
interface Env {}
|
|
476
|
+
/** Represents environment variables in the Tailor platform. */
|
|
477
|
+
type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/configure/types/machine-user.d.ts
|
|
480
|
+
interface MachineUserNameRegistry {}
|
|
481
|
+
/**
|
|
482
|
+
* Machine user name.
|
|
483
|
+
*
|
|
484
|
+
* When `tailor.d.ts` is generated (via `tailor-sdk apply`/`generate`), this is narrowed
|
|
485
|
+
* to the union of defined machine user names. When no machine users are registered yet,
|
|
486
|
+
* falls back to `string` to avoid blocking editing before the first generate run.
|
|
487
|
+
*/
|
|
488
|
+
type MachineUserName = keyof MachineUserNameRegistry extends never ? string : keyof MachineUserNameRegistry & string;
|
|
489
|
+
//#endregion
|
|
441
490
|
//#region src/configure/types/helpers.d.ts
|
|
442
491
|
type Prettify<T> = { [K in keyof T as string extends K ? never : K]: T[K] } & {};
|
|
443
492
|
type DeepWritable<T> = T extends Date | RegExp | Function ? T : T extends object ? { -readonly [P in keyof T]: DeepWritable<T[P]> } & {} : T;
|
|
@@ -449,6 +498,9 @@ type InferFieldsOutput<F extends Record<string, {
|
|
|
449
498
|
_output: any;
|
|
450
499
|
[key: string]: any;
|
|
451
500
|
}>> = DeepWritable<Prettify<NullableToOptional<{ [K in keyof F]: output<F[K]> }>>>;
|
|
501
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
502
|
+
[key: string]: JsonValue;
|
|
503
|
+
};
|
|
452
504
|
/**
|
|
453
505
|
* A looser version of JsonValue that accepts interfaces.
|
|
454
506
|
* TypeScript interfaces don't have index signatures by default,
|
|
@@ -1656,6 +1708,10 @@ type ConnectionNames<Config> = Config extends {
|
|
|
1656
1708
|
} ? K & string : string;
|
|
1657
1709
|
type DefinedAuth<Name extends string, Config, MachineUserNames extends string> = Config & {
|
|
1658
1710
|
name: Name;
|
|
1711
|
+
/**
|
|
1712
|
+
* @deprecated Pass the machine user name directly as a string instead, e.g. `authInvoker: "machine-user-name"`.
|
|
1713
|
+
* Using this function pulls config-layer (Node-only) dependencies into runtime bundles.
|
|
1714
|
+
*/
|
|
1659
1715
|
invoker<M extends MachineUserNames>(machineUser: M): AuthInvokerWithName<M>;
|
|
1660
1716
|
getConnectionToken<C extends ConnectionNames<Config>>(connectionName: C): Promise<AuthConnectionTokenResult>;
|
|
1661
1717
|
} & AuthDefinitionBrand;
|
|
@@ -2069,5 +2125,5 @@ interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
|
|
|
2069
2125
|
onExecutorReady?(context: ExecutorReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
|
|
2070
2126
|
}
|
|
2071
2127
|
//#endregion
|
|
2072
|
-
export { FieldOptions as $, BeforeLoginHookArgs as A,
|
|
2073
|
-
//# sourceMappingURL=plugin-
|
|
2128
|
+
export { FieldOptions as $, BeforeLoginHookArgs as A, IdpUserTrigger as At, TailorAnyDBType as B, IdProvider as Bt, TailorDBType as C, ResolverInput as Ct, AuthExternalConfig as D, ExecutorInput as Dt, AuthConnectionTokenResult as E, Executor as Et, UserAttributeListKey as F, WebhookOperation as Ft, PermissionCondition as G, SCIMAttributeMapping as Gt, TailorDBInstance as H, OIDC as Ht, UserAttributeMap as I, WorkflowOperation as It, unsafeAllowAllGqlPermission as J, SCIMResource as Jt, TailorTypeGqlPermission as K, SCIMAuthorization as Kt, UsernameFieldKey as L, AuthInvoker as Lt, OAuth2ClientGrantType as M, ResolverExecutedTrigger as Mt, SCIMAttributeType as N, ScheduleTriggerInput as Nt, AuthOwnConfig as O, FunctionOperation as Ot, UserAttributeKey as P, TailorDBTrigger as Pt, FieldMetadata as Q, ValueOperand as R, BuiltinIdP as Rt, TailorDBServiceInput as S, Resolver as St, AuthConfig as T, AuthAccessTokenTrigger as Tt, TailorDBType$1 as U, SAML as Ut, TailorDBField as V, OAuth2ClientInput as Vt, db as W, SCIMAttribute as Wt, ArrayFieldOutput as X, unsafeAllowAllTypePermission as Y, TenantProvider as Yt, DefinedFieldMetadata as Z, GeneratorResult as _, unauthenticatedTailorUser as _t, PluginExecutorContext as a, JsonCompatible as at, TailorDBNamespaceData as b, AuthConnectionConfig as bt, PluginGeneratedExecutorWithFile as c, MachineUserName as ct, PluginNamespaceProcessContext as d, TailorEnv as dt, FieldOutput$1 as et, PluginOutput as f, TailorActor as ft, ExecutorReadyContext as g, TailorUser as gt, TypePluginOutput as h, InferredAttributeMap as ht, PluginConfigs as i, InferFieldsOutput as it, DefinedAuth as j, IncomingWebhookTrigger as jt, AuthServiceInput as k, GqlOperation as kt, PluginGeneratedResolver as l, MachineUserNameRegistry as lt, TailorDBTypeForPlugin as m, AttributeMap as mt, Plugin as n, TailorAnyField as nt, PluginExecutorContextBase as o, JsonValue as ot, PluginProcessContext as p, AttributeList as pt, TailorTypePermission as q, SCIMConfig as qt, PluginAttachment as r, TailorField as rt, PluginGeneratedExecutor as s, output as st, NamespacePluginOutput as t, TailorFieldType as tt, PluginGeneratedType as u, Env as ut, ResolverNamespaceData as v, AllowedValues as vt, TypeSourceInfoEntry as w, GeneratorConfig as wt, TailorDBReadyContext as x, AuthConnectionOAuth2Config as xt, ResolverReadyContext as y, AllowedValuesOutput as yt, TailorAnyDBField as z, IDToken as zt };
|
|
2129
|
+
//# sourceMappingURL=plugin-D84blivd.d.mts.map
|