@tailor-platform/sdk 1.59.0 → 1.60.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 +18 -0
- package/dist/application-FnWOxBk7.mjs.map +1 -1
- package/dist/authconnection-D8SJGMpj.mjs.map +1 -1
- package/dist/cli/index.mjs +45 -2
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +1 -1
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/skills.mjs.map +1 -1
- package/dist/client-W5P4NYYX.mjs.map +1 -1
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +1 -1
- package/dist/configure/index.mjs.map +1 -1
- package/dist/crashreport-D3DvAzdg.mjs.map +1 -1
- package/dist/enum-constants-C7DaWeQo.mjs.map +1 -1
- package/dist/file-B58Dm-2P.mjs.map +1 -1
- package/dist/file-utils-BHPxPXmn.mjs.map +1 -1
- package/dist/iconv-DreIffeM.mjs.map +1 -1
- package/dist/{index-Cr6ufjZ5.d.mts → index-CLxubakC.d.mts} +2 -2
- package/dist/interceptor-DOqRkCya.mjs.map +1 -1
- package/dist/kysely-type-D1e0Vwkd.mjs.map +1 -1
- package/dist/logger-DpJyJvNz.mjs.map +1 -1
- package/dist/mock-Dpu__UeJ.mjs.map +1 -1
- package/dist/multiline-Cf9ODpr1.mjs.map +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/registry-D0uB0OrK.mjs.map +1 -1
- package/dist/repl-editor-Y9QJDL0K.mjs.map +1 -1
- package/dist/{runtime-CrUa8Z2k.mjs → runtime-BvKGwZeF.mjs} +2 -2
- package/dist/{runtime-CrUa8Z2k.mjs.map → runtime-BvKGwZeF.mjs.map} +1 -1
- package/dist/{schema-DKsNhbav.mjs → schema-DYKNTu-n.mjs} +3 -3
- package/dist/{schema-DKsNhbav.mjs.map → schema-DYKNTu-n.mjs.map} +1 -1
- package/dist/secret-file-CWzF8rry.mjs.map +1 -1
- package/dist/secretmanager-B9h-U_8U.mjs.map +1 -1
- package/dist/seed-C0fE2sJB.mjs.map +1 -1
- package/dist/telemetry-BQbbVo2t.mjs.map +1 -1
- package/dist/types-BwGth3a1.mjs.map +1 -1
- package/dist/utils/test/index.d.mts +2 -2
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/workflow--aPbA8Uq.mjs.map +1 -1
- package/dist/{workflow.generated-CV77NlFp.d.mts → workflow.generated-Bf1tWylx.d.mts} +2 -2
- package/docs/cli/auth.md +40 -0
- package/docs/cli-reference.md +1 -0
- package/docs/services/auth.md +19 -1
- package/package.json +3 -3
|
@@ -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 * `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,
|
|
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,CAAC,CAAC,mBAAmB,GAAG,IAAI"}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
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-
|
|
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-BvKGwZeF.mjs";
|
|
6
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";
|
|
@@ -145,11 +145,16 @@ const authorizeAuthConnectionCommand = defineAppCommand({
|
|
|
145
145
|
clearTimeout(timeout);
|
|
146
146
|
});
|
|
147
147
|
server.on("error", (err) => {
|
|
148
|
+
clearTimeout(timeout);
|
|
149
|
+
const code = err.code;
|
|
150
|
+
const portHint = code === "EADDRINUSE" || code === "EACCES" ? `Try a different port with --port, or authorize via the Console instead:` : `Authorize via the Console instead:`;
|
|
151
|
+
logger.warn(`Could not start the local callback server on port ${args.port}${code ? ` (${code})` : ""}.\n${portHint}\n tailor-sdk authconnection open`);
|
|
148
152
|
reject(err);
|
|
149
153
|
});
|
|
150
154
|
server.listen(args.port, async () => {
|
|
151
155
|
const authorizeUrl = authUrl.toString();
|
|
152
|
-
logger.info(`Opening browser for authorization:\n\n${authorizeUrl}\n`);
|
|
156
|
+
logger.info(args["no-browser"] ? `Open this URL in your browser to authorize:\n\n${authorizeUrl}\n` : `Opening browser for authorization:\n\n${authorizeUrl}\n`);
|
|
157
|
+
logger.info("If this flow doesn't complete, you can authorize via the Console instead:\n tailor-sdk authconnection open");
|
|
153
158
|
if (!args["no-browser"]) try {
|
|
154
159
|
await open(authorizeUrl);
|
|
155
160
|
} catch {
|
|
@@ -253,6 +258,43 @@ const listAuthConnectionCommand = defineAppCommand({
|
|
|
253
258
|
}
|
|
254
259
|
});
|
|
255
260
|
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/cli/commands/authconnection/open.ts
|
|
263
|
+
const consoleBaseUrl$1 = "https://console.tailor.tech";
|
|
264
|
+
const openAuthConnectionCommand = defineAppCommand({
|
|
265
|
+
name: "open",
|
|
266
|
+
description: "Open the auth connections page in the Tailor Platform Console.",
|
|
267
|
+
args: z.object({ ...workspaceArgs }).strict(),
|
|
268
|
+
run: async (args) => {
|
|
269
|
+
const workspaceId = await loadWorkspaceId({
|
|
270
|
+
workspaceId: args["workspace-id"],
|
|
271
|
+
profile: args.profile
|
|
272
|
+
});
|
|
273
|
+
const consolePath = `/workspaces/${workspaceId}/settings/connections`;
|
|
274
|
+
const consoleUrl = new URL(consolePath, consoleBaseUrl$1).toString();
|
|
275
|
+
const jsonOutput = logger.jsonMode;
|
|
276
|
+
logger.info("Opening auth connections page in Tailor Platform Console...");
|
|
277
|
+
let opened = true;
|
|
278
|
+
try {
|
|
279
|
+
await open(consoleUrl);
|
|
280
|
+
} catch {
|
|
281
|
+
opened = false;
|
|
282
|
+
}
|
|
283
|
+
if (jsonOutput) {
|
|
284
|
+
logger.out({
|
|
285
|
+
consoleUrl,
|
|
286
|
+
workspaceId,
|
|
287
|
+
opened
|
|
288
|
+
});
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (opened) {
|
|
292
|
+
logger.out(`Console URL: ${consoleUrl}`);
|
|
293
|
+
logger.out(`Workspace ID: ${workspaceId}`);
|
|
294
|
+
} else logger.warn(`Failed to open browser automatically. Please open this URL manually:\n${consoleUrl}`);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
256
298
|
//#endregion
|
|
257
299
|
//#region src/cli/commands/authconnection/revoke.ts
|
|
258
300
|
const revokeAuthConnectionCommand = defineAppCommand({
|
|
@@ -301,6 +343,7 @@ const authconnectionCommand = defineCommand({
|
|
|
301
343
|
subCommands: {
|
|
302
344
|
authorize: authorizeAuthConnectionCommand,
|
|
303
345
|
list: listAuthConnectionCommand,
|
|
346
|
+
open: openAuthConnectionCommand,
|
|
304
347
|
revoke: revokeAuthConnectionCommand,
|
|
305
348
|
delete: deleteAuthConnectionCommand
|
|
306
349
|
},
|