@tailor-platform/sdk 1.31.0 → 1.32.1
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 +36 -0
- package/dist/application-Cwt_ifTT.mjs +12 -0
- package/dist/{application-CASjzt3W.mjs → application-p2GujXmg.mjs} +14 -16
- package/dist/{application-CASjzt3W.mjs.map → application-p2GujXmg.mjs.map} +1 -1
- package/dist/{brand-GZnI4eYb.mjs → brand-0SscafcY.mjs} +2 -1
- package/dist/{brand-GZnI4eYb.mjs.map → brand-0SscafcY.mjs.map} +1 -1
- package/dist/{chunk-DEt8GZDa.mjs → chunk-COzJYswC.mjs} +1 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +31 -33
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +7 -6
- package/dist/cli/lib.mjs +14 -13
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/skills.d.mts +1 -0
- package/dist/cli/skills.mjs +2 -1
- package/dist/cli/skills.mjs.map +1 -1
- package/dist/{client-DfdgRZlQ.mjs → client-D5P1myz0.mjs} +6 -5
- package/dist/{client-DfdgRZlQ.mjs.map → client-D5P1myz0.mjs.map} +1 -1
- package/dist/{client-B0wrLUVK.mjs → client-gpRgZl1b.mjs} +5 -4
- package/dist/configure/index.d.mts +5 -4
- package/dist/configure/index.mjs +5 -4
- package/dist/configure/index.mjs.map +1 -1
- package/dist/crash-report-Cm9vFmTN.mjs +7 -0
- package/dist/{crash-report-wNxS0IUJ.mjs → crash-report-DnwITWeV.mjs} +5 -4
- package/dist/{crash-report-wNxS0IUJ.mjs.map → crash-report-DnwITWeV.mjs.map} +1 -1
- package/dist/{enum-constants-D1nfn0qD.mjs → enum-constants-CkKARYb7.mjs} +2 -1
- package/dist/{enum-constants-D1nfn0qD.mjs.map → enum-constants-CkKARYb7.mjs.map} +1 -1
- package/dist/{env-BgdHfWDn.d.mts → env-BZLTIlIo.d.mts} +3 -2
- package/dist/{file-utils-Bctuzn3x.mjs → file-utils-D2TxR_kj.mjs} +2 -1
- package/dist/{file-utils-Bctuzn3x.mjs.map → file-utils-D2TxR_kj.mjs.map} +1 -1
- package/dist/{index-D4Y81vh1.d.mts → index-BQKAzTPA.d.mts} +3 -2
- package/dist/{index-RXv15__b.d.mts → index-BYk_9R3S.d.mts} +5 -4
- package/dist/{index-CxgBnxKM.d.mts → index-CgMytw2A.d.mts} +3 -2
- package/dist/{index-CdDzh-T2.d.mts → index-CoReoodF.d.mts} +3 -2
- package/dist/{index-FZMBoUWm.d.mts → index-vVGamLOw.d.mts} +3 -2
- package/dist/{interceptor-DgQNmwWJ.mjs → interceptor-1LL1gBsF.mjs} +3 -2
- package/dist/{interceptor-DgQNmwWJ.mjs.map → interceptor-1LL1gBsF.mjs.map} +1 -1
- package/dist/{job-DdfW7vH3.mjs → job-CPKYCk_e.mjs} +3 -2
- package/dist/{job-DdfW7vH3.mjs.map → job-CPKYCk_e.mjs.map} +1 -1
- package/dist/kysely/index.d.mts +1 -0
- package/dist/kysely/index.mjs +2 -1
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/{kysely-type-B_IecdK9.mjs → kysely-type-BK0b4Rqt.mjs} +2 -1
- package/dist/{kysely-type-B_IecdK9.mjs.map → kysely-type-BK0b4Rqt.mjs.map} +1 -1
- package/dist/{logger-CqezTedh.mjs → logger-qz-Y4sBV.mjs} +2 -1
- package/dist/{logger-CqezTedh.mjs.map → logger-qz-Y4sBV.mjs.map} +1 -1
- package/dist/package-json-88x7bPKC.mjs +5 -0
- package/dist/{package-json-D3x2nBPB.mjs → package-json-VqyFvGiP.mjs} +2 -1
- package/dist/{package-json-D3x2nBPB.mjs.map → package-json-VqyFvGiP.mjs.map} +1 -1
- package/dist/plugin/builtin/enum-constants/index.d.mts +2 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +3 -2
- package/dist/plugin/builtin/file-utils/index.d.mts +2 -1
- package/dist/plugin/builtin/file-utils/index.mjs +3 -2
- package/dist/plugin/builtin/kysely-type/index.d.mts +2 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +3 -2
- package/dist/plugin/builtin/seed/index.d.mts +2 -1
- package/dist/plugin/builtin/seed/index.mjs +3 -2
- package/dist/plugin/index.d.mts +3 -2
- package/dist/plugin/index.mjs +2 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/{plugin-DyVYXZWz.d.mts → plugin-IIDZW9GG.d.mts} +2 -1
- package/dist/{runtime-Ofe7nHEG.mjs → runtime-7DOyTTxR.mjs} +23 -23
- package/dist/runtime-7DOyTTxR.mjs.map +1 -0
- package/dist/{schema-CNWt2FKQ.mjs → schema-BITbkmq3.mjs} +3 -2
- package/dist/{schema-CNWt2FKQ.mjs.map → schema-BITbkmq3.mjs.map} +1 -1
- package/dist/seed/index.d.mts +1 -0
- package/dist/seed/index.mjs +2 -1
- package/dist/seed/index.mjs.map +1 -1
- package/dist/{seed-CWkIDWMb.mjs → seed-BXrSEJbv.mjs} +2 -1
- package/dist/{seed-CWkIDWMb.mjs.map → seed-BXrSEJbv.mjs.map} +1 -1
- package/dist/{telemetry-BSUlYTs-.mjs → telemetry-B4sp-dD2.mjs} +3 -2
- package/dist/{telemetry-BSUlYTs-.mjs.map → telemetry-B4sp-dD2.mjs.map} +1 -1
- package/dist/telemetry-DXIGGa6A.mjs +5 -0
- package/dist/utils/test/index.d.mts +9 -3
- package/dist/utils/test/index.mjs +19 -4
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/{workflow.generated-DMQ-cjyT.d.mts → workflow.generated-C2A5Ye0m.d.mts} +3 -2
- package/docs/generator/builtin.md +0 -8
- package/docs/services/resolver.md +13 -0
- package/package.json +12 -11
- package/dist/application-B2-PymMz.mjs +0 -11
- package/dist/crash-report-BMEhRxeg.mjs +0 -6
- package/dist/package-json-DiZWrkIA.mjs +0 -4
- package/dist/runtime-Ofe7nHEG.mjs.map +0 -1
- package/dist/telemetry-BtN2l0f1.mjs +0 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
//#region src/utils/brand.ts
|
|
2
3
|
const SDK_BRAND = Symbol.for("tailor-platform/sdk");
|
|
3
4
|
/**
|
|
@@ -33,4 +34,4 @@ function isSdkBranded(value, kind) {
|
|
|
33
34
|
|
|
34
35
|
//#endregion
|
|
35
36
|
export { isSdkBranded as n, brandValue as t };
|
|
36
|
-
//# sourceMappingURL=brand-
|
|
37
|
+
//# sourceMappingURL=brand-0SscafcY.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-
|
|
1
|
+
{"version":3,"file":"brand-0SscafcY.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 = \"tailordb-type\" | \"resolver\" | \"executor\" | \"workflow\" | \"workflow-job\";\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;;;;;;;;;AAYzE,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.d.mts
CHANGED
package/dist/cli/index.mjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { B as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import
|
|
2
|
+
|
|
3
|
+
import "../chunk-COzJYswC.mjs";
|
|
4
|
+
import "../schema-BITbkmq3.mjs";
|
|
5
|
+
import "../brand-0SscafcY.mjs";
|
|
6
|
+
import { n as logger, r as styles } from "../logger-qz-Y4sBV.mjs";
|
|
7
|
+
import { At as functionExecutionStatusToString, B as updateCommand$3, Ct as startCommand, D as resumeCommand, Dt as executionsCommand, E as healthCommand, Ft as executeScript, I as showCommand, J as updateCommand$2, Jt as formatMigrationNumber, K as getCommand$4, L as logBetaWarning, M as truncateCommand, Mt as getCommand$1, P as generateCommand$1, Pt as apply, Q as getCommand$3, Qt as getMigrationFiles, Rt as parseMigrationLabelNumber, Tt as getCommand$5, U as treeCommand, W as listCommand$10, X as listCommand$9, Zt as getMigrationFilePath, _ as getCommand$6, _n as isVerbose, _t as listCommand$6, a as updateCommand$4, bt as jobsCommand, cn as sdkNameLabelKey, d as inviteCommand, en as isValidMigrationNumber, et as deleteCommand$3, fn as apiCommand, ft as generate, gn as deploymentArgs, h as listCommand$14, hn as confirmationArgs, ht as triggerCommand, i as isCLIError, it as listCommand$8, jt as formatKeyValueTable, k as listCommand$11, l as listCommand$13, ln as trnPrefix, lt as tokenCommand, mn as commonArgs, mt as webhookCommand, nt as createCommand$3, on as getNamespacesWithMigrations, ot as getCommand$2, p as restoreCommand, pn as defineAppCommand, r as queryCommand, s as removeCommand, sn as prompt, t as isNativeTypeScriptRuntime, tn as loadDiff, ut as listCommand$7, vn as workspaceArgs, w as listCommand$12, x as createCommand$4, y as deleteCommand$4, z as removeCommand$1 } from "../runtime-7DOyTTxR.mjs";
|
|
8
|
+
import { B as PATScope, D as FunctionExecution_Type, N as AuthInvokerSchema, i as fetchAll, l as initOAuth2Client, m as userAgent, n as closeConnectionPool, o as fetchPlatformMachineUserToken, s as fetchUserInfo, u as initOperatorClient } from "../client-D5P1myz0.mjs";
|
|
9
|
+
import { t as readPackageJson } from "../package-json-VqyFvGiP.mjs";
|
|
10
|
+
import { C as resolveTokens, S as readPlatformConfig, T as writePlatformConfig, a as loadConfig, b as loadAccessToken, c as ExecutorSchema, g as getDistDir, i as resolveInlineSourcemap, o as WorkflowJobSchema, u as ResolverSchema, v as deleteUserTokens, w as saveUserTokens, x as loadWorkspaceId, y as fetchLatestToken } from "../application-p2GujXmg.mjs";
|
|
11
|
+
import "../seed-BXrSEJbv.mjs";
|
|
12
|
+
import "../file-utils-D2TxR_kj.mjs";
|
|
13
|
+
import "../kysely-type-BK0b4Rqt.mjs";
|
|
14
|
+
import "../telemetry-B4sp-dD2.mjs";
|
|
15
|
+
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crash-report-DnwITWeV.mjs";
|
|
15
16
|
import { createRequire } from "node:module";
|
|
16
17
|
import { arg, defineCommand, runCommand, runMain } from "politty";
|
|
17
18
|
import { withCompletionCommand } from "politty/completion";
|
|
@@ -51,7 +52,7 @@ const applyCommand = defineAppCommand({
|
|
|
51
52
|
"clean-cache": arg(z.boolean().optional(), { description: "Clean the bundle cache before building" })
|
|
52
53
|
}).strict(),
|
|
53
54
|
run: async (args) => {
|
|
54
|
-
const { initTelemetry } = await import("../telemetry-
|
|
55
|
+
const { initTelemetry } = await import("../telemetry-DXIGGa6A.mjs");
|
|
55
56
|
await initTelemetry();
|
|
56
57
|
await apply({
|
|
57
58
|
workspaceId: args["workspace-id"],
|
|
@@ -393,13 +394,10 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
|
|
|
393
394
|
});
|
|
394
395
|
|
|
395
396
|
if (result.issues) {
|
|
396
|
-
|
|
397
|
-
.
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
})
|
|
401
|
-
.join('\\n');
|
|
402
|
-
throw new Error(\`Failed to input validation:\\n\${errorMessages}\`);
|
|
397
|
+
throw new TailorErrors(result.issues.map(issue => ({
|
|
398
|
+
message: issue.message,
|
|
399
|
+
path: issue.path ?? [],
|
|
400
|
+
})));
|
|
403
401
|
}
|
|
404
402
|
}
|
|
405
403
|
|
|
@@ -806,7 +804,7 @@ const generateCommand = defineAppCommand({
|
|
|
806
804
|
})
|
|
807
805
|
}).strict(),
|
|
808
806
|
run: async (args) => {
|
|
809
|
-
const { initTelemetry } = await import("../telemetry-
|
|
807
|
+
const { initTelemetry } = await import("../telemetry-DXIGGa6A.mjs");
|
|
810
808
|
await initTelemetry();
|
|
811
809
|
await generate({
|
|
812
810
|
configPath: args.config,
|
|
@@ -1287,7 +1285,7 @@ async function checkVaultManaged(params) {
|
|
|
1287
1285
|
existingLabels: {}
|
|
1288
1286
|
};
|
|
1289
1287
|
let owner;
|
|
1290
|
-
let allLabels
|
|
1288
|
+
let allLabels;
|
|
1291
1289
|
try {
|
|
1292
1290
|
const { metadata } = await client.getMetadata({ trn });
|
|
1293
1291
|
allLabels = metadata?.labels ?? {};
|
|
@@ -1360,8 +1358,8 @@ const createSecretCommand = defineAppCommand({
|
|
|
1360
1358
|
});
|
|
1361
1359
|
} catch (error) {
|
|
1362
1360
|
if (error instanceof ConnectError) {
|
|
1363
|
-
if (error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found
|
|
1364
|
-
if (error.code === Code.AlreadyExists) throw new Error(`Secret "${args.name}" already exists
|
|
1361
|
+
if (error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found.`, { cause: error });
|
|
1362
|
+
if (error.code === Code.AlreadyExists) throw new Error(`Secret "${args.name}" already exists.`, { cause: error });
|
|
1365
1363
|
}
|
|
1366
1364
|
throw error;
|
|
1367
1365
|
}
|
|
@@ -1410,7 +1408,7 @@ const deleteSecretCommand = defineAppCommand({
|
|
|
1410
1408
|
secretmanagerSecretName: args.name
|
|
1411
1409
|
});
|
|
1412
1410
|
} catch (error) {
|
|
1413
|
-
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}"
|
|
1411
|
+
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`, { cause: error });
|
|
1414
1412
|
throw error;
|
|
1415
1413
|
}
|
|
1416
1414
|
if (managed.isManaged) await releaseVaultOwnership({
|
|
@@ -1470,7 +1468,7 @@ const listSecretCommand = defineAppCommand({
|
|
|
1470
1468
|
});
|
|
1471
1469
|
logger.out(secrets);
|
|
1472
1470
|
} catch (error) {
|
|
1473
|
-
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found
|
|
1471
|
+
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found.`, { cause: error });
|
|
1474
1472
|
throw error;
|
|
1475
1473
|
}
|
|
1476
1474
|
}
|
|
@@ -1514,7 +1512,7 @@ const updateSecretCommand = defineAppCommand({
|
|
|
1514
1512
|
secretmanagerSecretValue: args.value
|
|
1515
1513
|
});
|
|
1516
1514
|
} catch (error) {
|
|
1517
|
-
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}"
|
|
1515
|
+
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`, { cause: error });
|
|
1518
1516
|
throw error;
|
|
1519
1517
|
}
|
|
1520
1518
|
if (managed.isManaged) await releaseVaultOwnership({
|
|
@@ -1556,7 +1554,7 @@ const createCommand$1 = defineAppCommand({
|
|
|
1556
1554
|
secretmanagerVaultName: args.name
|
|
1557
1555
|
});
|
|
1558
1556
|
} catch (error) {
|
|
1559
|
-
if (error instanceof ConnectError && error.code === Code.AlreadyExists) throw new Error(`Vault "${args.name}" already exists
|
|
1557
|
+
if (error instanceof ConnectError && error.code === Code.AlreadyExists) throw new Error(`Vault "${args.name}" already exists.`, { cause: error });
|
|
1560
1558
|
throw error;
|
|
1561
1559
|
}
|
|
1562
1560
|
logger.success(`Vault: ${args.name} created`);
|
|
@@ -1599,7 +1597,7 @@ const deleteCommand$1 = defineAppCommand({
|
|
|
1599
1597
|
secretmanagerVaultName: args.name
|
|
1600
1598
|
});
|
|
1601
1599
|
} catch (error) {
|
|
1602
|
-
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args.name}" not found
|
|
1600
|
+
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args.name}" not found.`, { cause: error });
|
|
1603
1601
|
throw error;
|
|
1604
1602
|
}
|
|
1605
1603
|
if (managed.isManaged) logger.info("Remove this vault from defineSecretManager() in your config to prevent the next apply from re-creating it.");
|
|
@@ -2068,7 +2066,7 @@ const getCommand = defineAppCommand({
|
|
|
2068
2066
|
};
|
|
2069
2067
|
logger.out(info);
|
|
2070
2068
|
} catch (error) {
|
|
2071
|
-
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(notFoundErrorMessage);
|
|
2069
|
+
if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(notFoundErrorMessage, { cause: error });
|
|
2072
2070
|
throw error;
|
|
2073
2071
|
}
|
|
2074
2072
|
}
|
|
@@ -3246,11 +3244,11 @@ runMain(mainCommand, {
|
|
|
3246
3244
|
if (isVerbose() && error.stack) logger.debug(`\nStack trace:\n${error.stack}`);
|
|
3247
3245
|
} else logger.error(`Unknown error: ${error}`);
|
|
3248
3246
|
if (!isCLIError(error) && (!(error instanceof Error) || error instanceof TypeError || error instanceof RangeError)) {
|
|
3249
|
-
const { reportCrash } = await import("../crash-report-
|
|
3247
|
+
const { reportCrash } = await import("../crash-report-Cm9vFmTN.mjs");
|
|
3250
3248
|
await reportCrash(error, "handledError");
|
|
3251
3249
|
}
|
|
3252
3250
|
}
|
|
3253
|
-
const { shutdownTelemetry } = await import("../telemetry-
|
|
3251
|
+
const { shutdownTelemetry } = await import("../telemetry-DXIGGa6A.mjs");
|
|
3254
3252
|
await shutdownTelemetry();
|
|
3255
3253
|
}
|
|
3256
3254
|
});
|