@tailor-platform/sdk 1.40.1 → 1.43.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 +44 -0
- package/README.md +23 -0
- package/dist/{actor-B2oEmlTc.d.mts → actor-DzCuoMlP.d.mts} +2 -2
- package/dist/{application-EvhIIVg0.mjs → application-DQpD_kHR.mjs} +87 -8
- package/dist/application-DQpD_kHR.mjs.map +1 -0
- package/dist/application-DUcmoFdc.mjs +4 -0
- package/dist/brand-Ll48SMXe.mjs.map +1 -1
- package/dist/cli/index.mjs +31 -26
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +49 -7
- package/dist/cli/lib.mjs +3 -3
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/configure/index.d.mts +5 -5
- package/dist/configure/index.mjs +83 -3
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{index-Chvw1Eod.d.mts → index-0Dk-fDWi.d.mts} +2 -2
- package/dist/{index-CiNNNpuH.d.mts → index-BEEL1-6Z.d.mts} +2 -2
- package/dist/{index-D_ezppY7.d.mts → index-Br4XCvX1.d.mts} +103 -86
- package/dist/{index-BtXZdz-F.d.mts → index-DdsUV-aA.d.mts} +2 -2
- package/dist/{index-reFAYSX7.d.mts → index-ZZYEd_0R.d.mts} +2 -2
- package/dist/{job-p6zf8Qpg.mjs → job-BOvKyNdT.mjs} +15 -9
- package/dist/job-BOvKyNdT.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/index.d.mts +2 -2
- package/dist/{runtime-B9R1TzLD.mjs → runtime-Bn68JXnL.mjs} +195 -77
- package/dist/runtime-Bn68JXnL.mjs.map +1 -0
- package/dist/{tailor-db-field-CoFKRCYW.d.mts → tailor-db-field-D_z185oq.d.mts} +36 -6
- package/dist/utils/test/index.d.mts +36 -3
- package/dist/utils/test/index.mjs +78 -9
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/{workflow.generated-Btz6srLR.d.mts → workflow.generated-CDCnZNkH.d.mts} +2 -2
- package/docs/cli/function.md +83 -1
- package/docs/cli-reference.md +3 -1
- package/docs/services/executor.md +4 -0
- package/docs/services/idp.md +16 -0
- package/docs/services/resolver.md +4 -2
- package/docs/services/workflow.md +117 -3
- package/docs/testing.md +95 -7
- package/package.json +17 -17
- package/dist/application-CE2s_a6w.mjs +0 -4
- package/dist/application-EvhIIVg0.mjs.map +0 -1
- package/dist/job-p6zf8Qpg.mjs.map +0 -1
- package/dist/runtime-B9R1TzLD.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-Ll48SMXe.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind
|
|
1
|
+
{"version":3,"file":"brand-Ll48SMXe.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind =\n | \"tailordb-type\"\n | \"resolver\"\n | \"executor\"\n | \"workflow\"\n | \"workflow-job\"\n | \"wait-point\";\n\n/**\n * Adds a non-enumerable SDK brand symbol to the given object (in-place).\n * The brand stores the kind so service loaders can distinguish between\n * different SDK object types (e.g. a type loader skips executors).\n * @param value - The object to brand\n * @param kind - The kind of SDK object\n * @returns The same object with the brand applied\n */\nexport function brandValue<T extends object>(value: T, kind: SdkBrandKind): T {\n Object.defineProperty(value, SDK_BRAND, {\n value: kind,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n return value;\n}\n\n/**\n * Checks whether the given value has been branded by the SDK.\n * When kind is specified, only returns true if the brand matches that kind.\n * Accepts a single kind or an array of kinds for multi-kind matching.\n * @param value - The value to check\n * @param kind - Optional kind or kinds to match against\n * @returns True if the value has the SDK brand symbol (and matches kind if specified)\n */\nexport function isSdkBranded(\n value: unknown,\n kind?: SdkBrandKind | readonly SdkBrandKind[],\n): boolean {\n if (value === null || typeof value !== \"object\" || !(SDK_BRAND in value)) return false;\n const stored = (value as Record<symbol, unknown>)[SDK_BRAND];\n // No kind filter → any brand matches. Legacy `true` brand → matches any kind.\n return (\n kind === undefined ||\n stored === true ||\n (Array.isArray(kind) ? kind.includes(stored as SdkBrandKind) : stored === kind)\n );\n}\n"],"mappings":";;AAEA,MAAa,YAA2B,OAAO,IAAI,sBAAsB;;;;;;;;;AAkBzE,SAAgB,WAA6B,OAAU,MAAuB;AAC5E,QAAO,eAAe,OAAO,WAAW;EACtC,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;EACX,CAAC;AACF,QAAO;;;;;;;;;;AAWT,SAAgB,aACd,OACA,MACS;AACT,KAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,EAAE,aAAa,OAAQ,QAAO;CACjF,MAAM,SAAU,MAAkC;AAElD,QACE,SAAS,UACT,WAAW,SACV,MAAM,QAAQ,KAAK,GAAG,KAAK,SAAS,OAAuB,GAAG,WAAW"}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { G as PATScope, R as AuthInvokerSchema, c as fetchUserInfo, d as initOperatorClient, h as userAgent, i as fetchAll, j as FunctionExecution_Type, n as closeConnectionPool, o as fetchPaged, s as fetchPlatformMachineUserToken, u as initOAuth2Client } from "../client-CcV6Jjds.mjs";
|
|
4
4
|
import { n as logger, r as styles } from "../logger-DTNAMYGy.mjs";
|
|
5
|
-
import { $ as deleteCommand$3,
|
|
5
|
+
import { $ as deleteCommand$3, At as executionsCommand, C as listCommand$13, Cn as toPageDirection, Ct as jobsCommand, E as resumeCommand, Et as startCommand, F as showCommand, Ft as getCommand$1, G as getCommand$5, H as treeCommand, I as logBetaWarning, Lt as apply, N as generateCommand$1, Nt as functionExecutionStatusToString, O as listCommand$12, Ot as getCommand$6, Pt as formatKeyValueTable, R as removeCommand$1, Rt as executeScript, Sn as paginationArgs, T as healthCommand, U as listCommand$11, Vt as parseMigrationLabelNumber, Y as listCommand$10, Z as getCommand$4, Zt as formatMigrationNumber, _n as commonArgs, _t as webhookCommand, at as getCommand$3, b as createCommand$4, bn as isVerbose, bt as listCommand$6, c as listCommand$14, ct as tokenCommand, dn as sdkNameLabelKey, dt as generate, en as getMigrationFilePath, f as restoreCommand, fn as trnPrefix, ft as listCommand$7, g as getCommand$7, gn as defineAppCommand, hn as apiCommand, i as updateCommand$4, in as loadDiff, j as truncateCommand, ln as getNamespacesWithMigrations, lt as listCommand$8, m as listCommand$15, mt as getCommand$2, o as removeCommand, q as updateCommand$2, r as queryCommand, rn as isValidMigrationNumber, rt as listCommand$9, t as isNativeTypeScriptRuntime, tn as getMigrationFiles, tt as createCommand$3, u as inviteCommand, un as prompt, v as deleteCommand$4, vn as confirmationArgs, vt as triggerCommand, wn as workspaceArgs, xn as pagedLogArgs, yn as deploymentArgs, z as updateCommand$3 } from "../runtime-Bn68JXnL.mjs";
|
|
6
6
|
import { t as readPackageJson } from "../package-json-CWp8s9dE.mjs";
|
|
7
|
-
import { C as
|
|
7
|
+
import { C as loadWorkspaceId, D as writePlatformConfig, E as saveUserTokens, S as loadAccessToken, T as resolveTokens, _ as getDistDir, a as WorkflowJobSchema, b as deleteUserTokens, c as ExecutorSchema, i as resolveInlineSourcemap, l as INVOKER_EXPR, o as ResolverSchema, w as readPlatformConfig, x as fetchLatestToken, y as loadConfig } from "../application-DQpD_kHR.mjs";
|
|
8
8
|
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crash-report-CUbm1ErM.mjs";
|
|
9
9
|
import { n as isCLIError } from "../errors-ChWX5ZG8.mjs";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
@@ -1056,6 +1056,7 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
|
|
|
1056
1056
|
const _user = ${userExpr};
|
|
1057
1057
|
|
|
1058
1058
|
const $tailor_resolver_body = async (context) => {
|
|
1059
|
+
const _invoker = ${INVOKER_EXPR};
|
|
1059
1060
|
if (_internalResolver.input) {
|
|
1060
1061
|
const result = t.object(_internalResolver.input).parse({
|
|
1061
1062
|
value: context,
|
|
@@ -1071,7 +1072,7 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
|
|
|
1071
1072
|
}
|
|
1072
1073
|
}
|
|
1073
1074
|
|
|
1074
|
-
const enrichedContext = { input: context, env: _env, user: _user };
|
|
1075
|
+
const enrichedContext = { input: context, env: _env, user: _user, invoker: _invoker };
|
|
1075
1076
|
return _internalResolver.body(enrichedContext);
|
|
1076
1077
|
};
|
|
1077
1078
|
|
|
@@ -1087,7 +1088,8 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
|
|
|
1087
1088
|
const _actor = ${actorExpr};
|
|
1088
1089
|
|
|
1089
1090
|
const __executor_function = async (args) => {
|
|
1090
|
-
|
|
1091
|
+
const _invoker = ${INVOKER_EXPR};
|
|
1092
|
+
return _internalExecutor.operation.body({ ...args, env: _env, actor: _actor, invoker: _invoker });
|
|
1091
1093
|
};
|
|
1092
1094
|
|
|
1093
1095
|
export { __executor_function as main };
|
|
@@ -1101,7 +1103,8 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
|
|
|
1101
1103
|
const env = ${JSON.stringify(env)};
|
|
1102
1104
|
|
|
1103
1105
|
export async function main(input) {
|
|
1104
|
-
|
|
1106
|
+
const invoker = ${INVOKER_EXPR};
|
|
1107
|
+
return await ${exportName}.body(input, { env, invoker });
|
|
1105
1108
|
}
|
|
1106
1109
|
`;
|
|
1107
1110
|
}
|
|
@@ -1506,11 +1509,13 @@ const functionCommand = defineCommand({
|
|
|
1506
1509
|
name: "function",
|
|
1507
1510
|
description: "Manage functions",
|
|
1508
1511
|
subCommands: {
|
|
1512
|
+
get: getCommand$2,
|
|
1513
|
+
list: listCommand$7,
|
|
1509
1514
|
logs: logsCommand,
|
|
1510
1515
|
"test-run": testRunCommand
|
|
1511
1516
|
},
|
|
1512
1517
|
async run() {
|
|
1513
|
-
await runCommand(
|
|
1518
|
+
await runCommand(listCommand$7, []);
|
|
1514
1519
|
}
|
|
1515
1520
|
});
|
|
1516
1521
|
|
|
@@ -1731,11 +1736,11 @@ const machineuserCommand = defineCommand({
|
|
|
1731
1736
|
name: "machineuser",
|
|
1732
1737
|
description: "Manage machine users in your Tailor Platform application.",
|
|
1733
1738
|
subCommands: {
|
|
1734
|
-
list: listCommand$
|
|
1739
|
+
list: listCommand$8,
|
|
1735
1740
|
token: tokenCommand
|
|
1736
1741
|
},
|
|
1737
1742
|
async run() {
|
|
1738
|
-
await runCommand(listCommand$
|
|
1743
|
+
await runCommand(listCommand$8, []);
|
|
1739
1744
|
}
|
|
1740
1745
|
});
|
|
1741
1746
|
|
|
@@ -1745,11 +1750,11 @@ const oauth2clientCommand = defineCommand({
|
|
|
1745
1750
|
name: "oauth2client",
|
|
1746
1751
|
description: "Manage OAuth2 clients in your Tailor Platform application.",
|
|
1747
1752
|
subCommands: {
|
|
1748
|
-
list: listCommand$
|
|
1749
|
-
get: getCommand$
|
|
1753
|
+
list: listCommand$9,
|
|
1754
|
+
get: getCommand$3
|
|
1750
1755
|
},
|
|
1751
1756
|
async run() {
|
|
1752
|
-
await runCommand(listCommand$
|
|
1757
|
+
await runCommand(listCommand$9, []);
|
|
1753
1758
|
}
|
|
1754
1759
|
});
|
|
1755
1760
|
|
|
@@ -1789,8 +1794,8 @@ const folderCommand = defineCommand({
|
|
|
1789
1794
|
subCommands: {
|
|
1790
1795
|
create: createCommand$3,
|
|
1791
1796
|
delete: deleteCommand$3,
|
|
1792
|
-
get: getCommand$
|
|
1793
|
-
list: listCommand$
|
|
1797
|
+
get: getCommand$4,
|
|
1798
|
+
list: listCommand$10,
|
|
1794
1799
|
update: updateCommand$2
|
|
1795
1800
|
}
|
|
1796
1801
|
});
|
|
@@ -1802,13 +1807,13 @@ const organizationCommand = defineCommand({
|
|
|
1802
1807
|
description: "Manage Tailor Platform organizations.",
|
|
1803
1808
|
subCommands: {
|
|
1804
1809
|
folder: folderCommand,
|
|
1805
|
-
get: getCommand$
|
|
1806
|
-
list: listCommand$
|
|
1810
|
+
get: getCommand$5,
|
|
1811
|
+
list: listCommand$11,
|
|
1807
1812
|
tree: treeCommand,
|
|
1808
1813
|
update: updateCommand$3
|
|
1809
1814
|
},
|
|
1810
1815
|
async run() {
|
|
1811
|
-
await runCommand(listCommand$
|
|
1816
|
+
await runCommand(listCommand$11, []);
|
|
1812
1817
|
}
|
|
1813
1818
|
});
|
|
1814
1819
|
|
|
@@ -4020,14 +4025,14 @@ const workflowCommand = defineCommand({
|
|
|
4020
4025
|
name: "workflow",
|
|
4021
4026
|
description: "Manage workflows and workflow executions.",
|
|
4022
4027
|
subCommands: {
|
|
4023
|
-
list: listCommand$
|
|
4024
|
-
get: getCommand$
|
|
4028
|
+
list: listCommand$12,
|
|
4029
|
+
get: getCommand$6,
|
|
4025
4030
|
start: startCommand,
|
|
4026
4031
|
executions: executionsCommand,
|
|
4027
4032
|
resume: resumeCommand
|
|
4028
4033
|
},
|
|
4029
4034
|
async run() {
|
|
4030
|
-
await runCommand(listCommand$
|
|
4035
|
+
await runCommand(listCommand$12, []);
|
|
4031
4036
|
}
|
|
4032
4037
|
});
|
|
4033
4038
|
|
|
@@ -4038,10 +4043,10 @@ const appCommand = defineCommand({
|
|
|
4038
4043
|
description: "Manage workspace applications",
|
|
4039
4044
|
subCommands: {
|
|
4040
4045
|
health: healthCommand,
|
|
4041
|
-
list: listCommand$
|
|
4046
|
+
list: listCommand$13
|
|
4042
4047
|
},
|
|
4043
4048
|
async run() {
|
|
4044
|
-
await runCommand(listCommand$
|
|
4049
|
+
await runCommand(listCommand$13, []);
|
|
4045
4050
|
}
|
|
4046
4051
|
});
|
|
4047
4052
|
|
|
@@ -4052,12 +4057,12 @@ const userCommand = defineCommand({
|
|
|
4052
4057
|
description: "Manage workspace users",
|
|
4053
4058
|
subCommands: {
|
|
4054
4059
|
invite: inviteCommand,
|
|
4055
|
-
list: listCommand$
|
|
4060
|
+
list: listCommand$14,
|
|
4056
4061
|
remove: removeCommand,
|
|
4057
4062
|
update: updateCommand$4
|
|
4058
4063
|
},
|
|
4059
4064
|
async run() {
|
|
4060
|
-
await runCommand(listCommand$
|
|
4065
|
+
await runCommand(listCommand$14, []);
|
|
4061
4066
|
}
|
|
4062
4067
|
});
|
|
4063
4068
|
|
|
@@ -4070,13 +4075,13 @@ const workspaceCommand = defineCommand({
|
|
|
4070
4075
|
app: appCommand,
|
|
4071
4076
|
create: createCommand$4,
|
|
4072
4077
|
delete: deleteCommand$4,
|
|
4073
|
-
get: getCommand$
|
|
4074
|
-
list: listCommand$
|
|
4078
|
+
get: getCommand$7,
|
|
4079
|
+
list: listCommand$15,
|
|
4075
4080
|
restore: restoreCommand,
|
|
4076
4081
|
user: userCommand
|
|
4077
4082
|
},
|
|
4078
4083
|
async run() {
|
|
4079
|
-
await runCommand(listCommand$
|
|
4084
|
+
await runCommand(listCommand$15, []);
|
|
4080
4085
|
}
|
|
4081
4086
|
});
|
|
4082
4087
|
|