@tailor-platform/sdk 1.58.0 → 1.59.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 +55 -0
- package/dist/{application-B59TaTk_.mjs → application-FnWOxBk7.mjs} +46 -27
- package/dist/application-FnWOxBk7.mjs.map +1 -0
- package/dist/application-VOdgMtOD.mjs +4 -0
- package/dist/{authconnection-TsdLYaLs.d.mts → authconnection-BIYzEh2p.d.mts} +2 -2
- package/dist/authconnection-D8SJGMpj.mjs.map +1 -1
- package/dist/cli/erd-viewer-assets/app.js +4 -4
- package/dist/cli/index.mjs +13 -12
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.mjs +4 -3
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/client-B-jRdlC_.mjs +4 -0
- package/dist/{client-62B-r3MN.mjs → client-W5P4NYYX.mjs} +117 -4
- package/dist/{client-62B-r3MN.mjs.map → client-W5P4NYYX.mjs.map} +1 -1
- package/dist/configure/index.d.mts +1 -1
- package/dist/configure/index.mjs +8 -8
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{crashreport-CCGpLUlP.mjs → crashreport-D3DvAzdg.mjs} +3 -3
- package/dist/crashreport-D3DvAzdg.mjs.map +1 -0
- package/dist/{crashreport-CXD_Kjk-.mjs → crashreport-lnVTnbB5.mjs} +1 -1
- package/dist/file-B58Dm-2P.mjs.map +1 -1
- package/dist/{file-VTJbbOL3.d.mts → file-BzK8z3X-.d.mts} +2 -2
- package/dist/globals-ByrCoDip.mjs +109 -0
- package/dist/globals-ByrCoDip.mjs.map +1 -0
- package/dist/iconv-DreIffeM.mjs.map +1 -1
- package/dist/{iconv-Chu6Hit2.d.mts → iconv-kwrmd1U_.d.mts} +2 -2
- package/dist/{idp-Di9N4FSJ.d.mts → idp-BlBPtXJ-.d.mts} +2 -2
- package/dist/idp-Ch95ag8h.mjs.map +1 -1
- package/dist/{index-BWoHfE-i.d.mts → index-Cr6ufjZ5.d.mts} +10 -8
- package/dist/{index-DTSQthwF.d.mts → index-DRhMpdnA.d.mts} +7 -7
- package/dist/{job-CEAJLiGp.mjs → job-BpsFXPbi.mjs} +8 -17
- package/dist/job-BpsFXPbi.mjs.map +1 -0
- package/dist/mock-Dpu__UeJ.mjs +805 -0
- package/dist/mock-Dpu__UeJ.mjs.map +1 -0
- package/dist/registry-D0uB0OrK.mjs +178 -0
- package/dist/registry-D0uB0OrK.mjs.map +1 -0
- package/dist/{repl-editor-ihh8koiR.mjs → repl-editor-Y9QJDL0K.mjs} +3 -9
- package/dist/{repl-editor-ihh8koiR.mjs.map → repl-editor-Y9QJDL0K.mjs.map} +1 -1
- package/dist/runtime/authconnection.d.mts +1 -1
- package/dist/runtime/file.d.mts +1 -1
- package/dist/runtime/globals.d.mts +5 -5
- package/dist/runtime/iconv.d.mts +1 -1
- package/dist/runtime/idp.d.mts +1 -1
- package/dist/runtime/index.d.mts +7 -7
- package/dist/runtime/secretmanager.d.mts +1 -1
- package/dist/runtime/workflow.d.mts +1 -1
- package/dist/{runtime-BC-FbQkg.mjs → runtime-CrUa8Z2k.mjs} +238 -273
- package/dist/runtime-CrUa8Z2k.mjs.map +1 -0
- package/dist/secretmanager-B9h-U_8U.mjs.map +1 -1
- package/dist/{secretmanager-BhpDmxwT.d.mts → secretmanager-CKLB3wAQ.d.mts} +2 -2
- package/dist/utils/test/index.d.mts +5 -5
- package/dist/utils/test/index.mjs +7 -7
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +3 -4
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.d.mts +167 -120
- package/dist/vitest/index.mjs +6 -6
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/setup.d.mts +1 -1
- package/dist/vitest/setup.mjs +4 -3
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/workflow--aPbA8Uq.mjs.map +1 -1
- package/dist/{workflow-dYYH7QFa.d.mts → workflow-CMamswkK.d.mts} +2 -2
- package/docs/configuration.md +1 -1
- package/docs/runtime.md +9 -12
- package/docs/testing.md +92 -85
- package/package.json +5 -5
- package/dist/application-B59TaTk_.mjs.map +0 -1
- package/dist/application-gO_pa5BO.mjs +0 -4
- package/dist/client-BWl3f1XS.mjs +0 -4
- package/dist/crashreport-CCGpLUlP.mjs.map +0 -1
- package/dist/job-CEAJLiGp.mjs.map +0 -1
- package/dist/mock-B6PI49C_.mjs +0 -844
- package/dist/mock-B6PI49C_.mjs.map +0 -1
- package/dist/runtime-BC-FbQkg.mjs.map +0 -1
- package/dist/test-env-key-CSnK4W1Y.mjs +0 -30
- package/dist/test-env-key-CSnK4W1Y.mjs.map +0 -1
|
@@ -6,7 +6,7 @@ declare namespace authconnection_d_exports {
|
|
|
6
6
|
*
|
|
7
7
|
* Thin typed wrapper around the platform-provided `tailor.authconnection` runtime API.
|
|
8
8
|
* At runtime this delegates to `globalThis.tailor.authconnection`. Use
|
|
9
|
-
* `
|
|
9
|
+
* `mockAuthconnection` from `@tailor-platform/sdk/vitest` to mock in unit tests.
|
|
10
10
|
* @example
|
|
11
11
|
* import { authconnection } from "@tailor-platform/sdk/runtime";
|
|
12
12
|
*
|
|
@@ -36,4 +36,4 @@ interface TailorAuthconnectionAPI {
|
|
|
36
36
|
declare const getConnectionToken: TailorAuthconnectionAPI["getConnectionToken"];
|
|
37
37
|
//#endregion
|
|
38
38
|
export { authconnection_d_exports as n, getConnectionToken as r, TailorAuthconnectionAPI as t };
|
|
39
|
-
//# sourceMappingURL=authconnection-
|
|
39
|
+
//# sourceMappingURL=authconnection-BIYzEh2p.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authconnection-D8SJGMpj.mjs","names":[],"sources":["../src/runtime/authconnection.ts"],"sourcesContent":["/**\n * Auth connection utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.authconnection` runtime API.\n * At runtime this delegates to `globalThis.tailor.authconnection`. Use\n * `
|
|
1
|
+
{"version":3,"file":"authconnection-D8SJGMpj.mjs","names":[],"sources":["../src/runtime/authconnection.ts"],"sourcesContent":["/**\n * Auth connection utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.authconnection` runtime API.\n * At runtime this delegates to `globalThis.tailor.authconnection`. Use\n * `mockAuthconnection` from `@tailor-platform/sdk/vitest` to mock in unit tests.\n * @example\n * import { authconnection } from \"@tailor-platform/sdk/runtime\";\n *\n * const token = await authconnection.getConnectionToken(\"my-connection\");\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Platform API surface for `tailor.authconnection`. Describes the shape the\n * platform runtime injects on `globalThis.tailor.authconnection`.\n *\n * Each method below is also re-exported as a top-level named export from this\n * module so callers can either `import * as authconnection from\n * \"@tailor-platform/sdk/runtime/authconnection\"` or pick individual methods.\n */\nexport interface TailorAuthconnectionAPI {\n /**\n * Returns the access token for the given auth connection.\n * @param connectionName - Auth connection name as defined in tailor.config\n * @returns Token payload (provider-specific shape)\n */\n getConnectionToken(connectionName: string): Promise<any>;\n}\n\nconst api = (): TailorAuthconnectionAPI =>\n (globalThis as { tailor: { authconnection: TailorAuthconnectionAPI } }).tailor.authconnection;\n\n/**\n * See {@link TailorAuthconnectionAPI.getConnectionToken}.\n * @param args - Forwarded to {@link TailorAuthconnectionAPI.getConnectionToken}\n * @returns Token payload (provider-specific shape)\n */\nexport const getConnectionToken: TailorAuthconnectionAPI[\"getConnectionToken\"] = (...args) =>\n api().getConnectionToken(...args);\n"],"mappings":";;;;;AA+BA,MAAM,YACH,WAAuE,OAAO;;;;;;AAOjF,MAAa,sBAAqE,GAAG,SACnF,IAAI,EAAE,mBAAmB,GAAG,IAAI"}
|
|
@@ -115,7 +115,7 @@ function writeHashState() {
|
|
|
115
115
|
if (selectedTable) params.set("table", selectedTable);
|
|
116
116
|
if (showMode !== DEFAULT_SHOW_MODE) params.set("show", showMode);
|
|
117
117
|
if (hiddenTableNames.size > 0) {
|
|
118
|
-
params.set("hidden", [...hiddenTableNames].
|
|
118
|
+
params.set("hidden", [...hiddenTableNames].toSorted((a, b) => a.localeCompare(b)).join(","));
|
|
119
119
|
}
|
|
120
120
|
params.set("z", viewport.z.toFixed(3));
|
|
121
121
|
try {
|
|
@@ -194,7 +194,7 @@ function computeRanks(tables, relations) {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
function computeLayout(nextSchema) {
|
|
197
|
-
const tables =
|
|
197
|
+
const tables = nextSchema.tables.toSorted((a, b) => a.name.localeCompare(b.name));
|
|
198
198
|
const ranks = computeRanks(tables, nextSchema.relations);
|
|
199
199
|
const layers = new Map();
|
|
200
200
|
for (const table of tables) {
|
|
@@ -204,8 +204,8 @@ function computeLayout(nextSchema) {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
const nodes = new Map();
|
|
207
|
-
for (const rank of [...layers.keys()].
|
|
208
|
-
const layerTables = layers.get(rank).
|
|
207
|
+
for (const rank of [...layers.keys()].toSorted((a, b) => a - b)) {
|
|
208
|
+
const layerTables = layers.get(rank).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
209
209
|
let y = 0;
|
|
210
210
|
for (const table of layerTables) {
|
|
211
211
|
const height = cardHeight(table);
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { J as PATScope, O as CustomDomainStatus, P as FunctionExecution_Type, V as AuthInvokerSchema, _ as userAgent, a as fetchAll, c as fetchPlatformMachineUserToken, d as initOAuth2Client, f as initOperatorClient, l as fetchUserInfo, r as closeConnectionPool, s as fetchPaged } from "../client-W5P4NYYX.mjs";
|
|
4
4
|
import { n as logger, r as styles } from "../logger-DpJyJvNz.mjs";
|
|
5
|
-
import { $ as listCommand$10, An as toPageDirection, At as startCommand, B as logBetaWarning, C as listCommand$13, Cn as commonArgs, Dn as isVerbose, Dt as jobsCommand, E as resumeCommand, En as deploymentArgs, F as writeDbTypesFile, Gt as parseMigrationLabelNumber, H as removeCommand$1, Ht as executeScript, I as getConfiguredEditorCommand, K as treeCommand, L as openInConfiguredEditor, Lt as functionExecutionStatusToString, Mt as getCommand$6, N as generateCommand$1, O as listCommand$12, On as pagedLogArgs, P as generateMigrationScript, Pt as executionsCommand, Rt as formatKeyValueTable, Sn as defineAppCommand, St as triggerCommand, T as healthCommand, Tn as confirmationArgs, U as updateCommand$3, Vt as deploy, Y as getCommand$5, Yt as INITIAL_SCHEMA_NUMBER, Z as updateCommand$2, _n as generateUserTypes, at as createCommand$3, b as createCommand$4, c as listCommand$14, cn as reconstructSnapshotFromMigrations, f as restoreCommand, ft as tokenCommand, g as getCommand$7, gn as PluginManager, gt as listCommand$7, hn as sdkNameLabelKey, ht as generate, i as updateCommand$4, in as getMigrationFiles, j as truncateCommand, jn as workspaceArgs, kn as paginationArgs, ln as formatMigrationNumber, lt as getCommand$3, m as listCommand$15, mn as resourceTrn, o as removeCommand, on as isValidMigrationNumber, pn as getNamespacesWithMigrations, pt as listCommand$8, q as listCommand$11, r as queryCommand, rn as getMigrationFilePath, rt as deleteCommand$3, sn as loadDiff, st as listCommand$9, t as isNativeTypeScriptRuntime, tt as getCommand$4, u as inviteCommand, v as deleteCommand$4, vn as prompt, vt as getCommand$2, wn as configArg, wt as listCommand$6, xn as assertWritable, xt as webhookCommand, yn as apiCommand, z as showCommand, zt as getCommand$1 } from "../runtime-
|
|
6
|
-
import { A as
|
|
5
|
+
import { $ as listCommand$10, An as toPageDirection, At as startCommand, B as logBetaWarning, C as listCommand$13, Cn as commonArgs, Dn as isVerbose, Dt as jobsCommand, E as resumeCommand, En as deploymentArgs, F as writeDbTypesFile, Gt as parseMigrationLabelNumber, H as removeCommand$1, Ht as executeScript, I as getConfiguredEditorCommand, K as treeCommand, L as openInConfiguredEditor, Lt as functionExecutionStatusToString, Mt as getCommand$6, N as generateCommand$1, O as listCommand$12, On as pagedLogArgs, P as generateMigrationScript, Pt as executionsCommand, Rt as formatKeyValueTable, Sn as defineAppCommand, St as triggerCommand, T as healthCommand, Tn as confirmationArgs, U as updateCommand$3, Vt as deploy, Y as getCommand$5, Yt as INITIAL_SCHEMA_NUMBER, Z as updateCommand$2, _n as generateUserTypes, at as createCommand$3, b as createCommand$4, c as listCommand$14, cn as reconstructSnapshotFromMigrations, f as restoreCommand, ft as tokenCommand, g as getCommand$7, gn as PluginManager, gt as listCommand$7, hn as sdkNameLabelKey, ht as generate, i as updateCommand$4, in as getMigrationFiles, j as truncateCommand, jn as workspaceArgs, kn as paginationArgs, ln as formatMigrationNumber, lt as getCommand$3, m as listCommand$15, mn as resourceTrn, o as removeCommand, on as isValidMigrationNumber, pn as getNamespacesWithMigrations, pt as listCommand$8, q as listCommand$11, r as queryCommand, rn as getMigrationFilePath, rt as deleteCommand$3, sn as loadDiff, st as listCommand$9, t as isNativeTypeScriptRuntime, tt as getCommand$4, u as inviteCommand, v as deleteCommand$4, vn as prompt, vt as getCommand$2, wn as configArg, wt as listCommand$6, xn as assertWritable, xt as webhookCommand, yn as apiCommand, z as showCommand, zt as getCommand$1 } from "../runtime-CrUa8Z2k.mjs";
|
|
6
|
+
import { A as readPlatformConfig, D as loadAccessToken, E as fetchLatestToken, M as saveUserTokens, N as writePlatformConfig, S as hashContent, T as deleteUserTokens, _ as composeFunctionTreeshakeOptions, a as WorkflowJobSchema, g as platformBundleDefinePlugin, i as resolveInlineSourcemap, j as resolveTokens, k as loadWorkspaceId, l as ExecutorSchema, o as ResolverSchema, t as defineApplication, u as INVOKER_EXPR, v as createLogLevelTreeshakeOptions, w as loadConfig, x as getDistDir, y as resolveBundleLogLevel } from "../application-FnWOxBk7.mjs";
|
|
7
7
|
import { t as multiline } from "../multiline-Cf9ODpr1.mjs";
|
|
8
8
|
import { r as isPluginGeneratedType } from "../seed-C0fE2sJB.mjs";
|
|
9
9
|
import { t as readPackageJson } from "../package-json-DcQApfPQ.mjs";
|
|
10
10
|
import { n as isCLIError } from "../errors-EsY4XO6O.mjs";
|
|
11
|
-
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crashreport-
|
|
11
|
+
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crashreport-D3DvAzdg.mjs";
|
|
12
12
|
import { arg, defineCommand, runCommand, runMain } from "politty";
|
|
13
13
|
import { withCompletionCommand } from "politty/completion";
|
|
14
14
|
import { z } from "zod";
|
|
@@ -312,8 +312,8 @@ const authconnectionCommand = defineCommand({
|
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/cli/commands/crashreport/list.ts
|
|
314
314
|
function orderAndLimitCrashReports(entries, options) {
|
|
315
|
-
const sorted = entries.filter((f) => f.endsWith(CRASH_LOG_EXTENSION)).
|
|
316
|
-
const ordered = options.order === "asc" ? sorted : sorted.
|
|
315
|
+
const sorted = entries.filter((f) => f.endsWith(CRASH_LOG_EXTENSION)).toSorted();
|
|
316
|
+
const ordered = options.order === "asc" ? sorted : sorted.toReversed();
|
|
317
317
|
return options.limit && options.limit > 0 ? ordered.slice(0, options.limit) : ordered;
|
|
318
318
|
}
|
|
319
319
|
function formatCrashReportFiles(files, localDir) {
|
|
@@ -1098,6 +1098,7 @@ async function bundleForTestRun(options) {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
return {
|
|
1100
1100
|
bundledCode: (await rolldown.build({
|
|
1101
|
+
plugins: [platformBundleDefinePlugin],
|
|
1101
1102
|
input: entryPath,
|
|
1102
1103
|
write: false,
|
|
1103
1104
|
output: {
|
|
@@ -3340,7 +3341,7 @@ function toTypeSource(source) {
|
|
|
3340
3341
|
};
|
|
3341
3342
|
}
|
|
3342
3343
|
function toRelationships(relationships) {
|
|
3343
|
-
return Object.entries(relationships).
|
|
3344
|
+
return Object.entries(relationships).toSorted(([a], [b]) => a.localeCompare(b)).map(([name, relationship]) => ({
|
|
3344
3345
|
name,
|
|
3345
3346
|
targetType: relationship.targetType,
|
|
3346
3347
|
targetField: relationship.targetField,
|
|
@@ -3350,7 +3351,7 @@ function toRelationships(relationships) {
|
|
|
3350
3351
|
}));
|
|
3351
3352
|
}
|
|
3352
3353
|
function toIndexes(type) {
|
|
3353
|
-
return Object.entries(type.indexes ?? {}).
|
|
3354
|
+
return Object.entries(type.indexes ?? {}).toSorted(([a], [b]) => a.localeCompare(b)).map(([name, index]) => ({
|
|
3354
3355
|
name,
|
|
3355
3356
|
fields: [...index.fields],
|
|
3356
3357
|
unique: index.unique === true
|
|
@@ -3463,7 +3464,7 @@ function buildRelations(types) {
|
|
|
3463
3464
|
const relation = toRelation(type.name, field);
|
|
3464
3465
|
if (relation) relations.push(relation);
|
|
3465
3466
|
}
|
|
3466
|
-
return relations.
|
|
3467
|
+
return relations.toSorted((a, b) => a.name.localeCompare(b.name));
|
|
3467
3468
|
}
|
|
3468
3469
|
/**
|
|
3469
3470
|
* Build the TailorDB ERD viewer schema for one namespace.
|
|
@@ -3472,7 +3473,7 @@ function buildRelations(types) {
|
|
|
3472
3473
|
*/
|
|
3473
3474
|
function buildTailorDbErdSchema(options) {
|
|
3474
3475
|
const { namespaceData } = options;
|
|
3475
|
-
const tables = Object.values(namespaceData.types).
|
|
3476
|
+
const tables = Object.values(namespaceData.types).toSorted((a, b) => a.name.localeCompare(b.name)).map((type) => toTable(type, namespaceData.sourceInfo.get(type.name)));
|
|
3476
3477
|
const schemaWithoutRevision = {
|
|
3477
3478
|
version: 1,
|
|
3478
3479
|
namespace: namespaceData.namespace,
|
|
@@ -4307,7 +4308,7 @@ async function collectMigrationStatuses(options) {
|
|
|
4307
4308
|
} catch {
|
|
4308
4309
|
currentMigration = 0;
|
|
4309
4310
|
}
|
|
4310
|
-
const pendingMigrations = getMigrationFiles(migrationsDir).map((f) => f.number).filter((n, i, arr) => arr.indexOf(n) === i).
|
|
4311
|
+
const pendingMigrations = getMigrationFiles(migrationsDir).map((f) => f.number).filter((n, i, arr) => arr.indexOf(n) === i).toSorted((a, b) => a - b).filter((n) => n > currentMigration).map((num) => {
|
|
4311
4312
|
const diffPath = getMigrationFilePath(migrationsDir, num, "diff");
|
|
4312
4313
|
let description;
|
|
4313
4314
|
if (fs$1.existsSync(diffPath)) try {
|
|
@@ -4854,7 +4855,7 @@ runMain(mainCommand, {
|
|
|
4854
4855
|
if (isVerbose() && error.stack) logger.debug(`\nStack trace:\n${error.stack}`);
|
|
4855
4856
|
} else logger.error(`Unknown error: ${error}`);
|
|
4856
4857
|
if (!isCLIError(error) && (!(error instanceof Error) || error instanceof TypeError || error instanceof RangeError)) {
|
|
4857
|
-
const { reportCrash } = await import("../crashreport-
|
|
4858
|
+
const { reportCrash } = await import("../crashreport-lnVTnbB5.mjs");
|
|
4858
4859
|
await reportCrash(error, "handledError");
|
|
4859
4860
|
}
|
|
4860
4861
|
}
|