@tailor-platform/sdk 2.0.0-next.0 → 2.0.0-next.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 +105 -0
- package/dist/application-DB2r36Et.mjs +3 -0
- package/dist/{application-76hhIhnJ.mjs → application-DqS1yBg3.mjs} +217 -131
- package/dist/application-DqS1yBg3.mjs.map +1 -0
- package/dist/{assert-CKfwrmCV.mjs → assert-DBxo8jPo.mjs} +1 -2
- package/dist/{assert-CKfwrmCV.mjs.map → assert-DBxo8jPo.mjs.map} +1 -1
- package/dist/{authconnection-D8SJGMpj.mjs → authconnection-D2MhtTN5.mjs} +2 -3
- package/dist/{authconnection-D8SJGMpj.mjs.map → authconnection-D2MhtTN5.mjs.map} +1 -1
- package/dist/{authconnection-BIYzEh2p.d.mts → authconnection-DvUQAjQS.d.mts} +1 -1
- package/dist/{brand-DlnJ375c.mjs → brand-Eo4pLXPJ.mjs} +1 -2
- package/dist/{brand-DlnJ375c.mjs.map → brand-Eo4pLXPJ.mjs.map} +1 -1
- package/dist/cli/index.mjs +78 -131
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +619 -751
- package/dist/cli/lib.mjs +9 -10
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/{client-C68VWo4g.mjs → client-Dbohmtkv.mjs} +1 -2
- package/dist/{client-CobIRHl-.mjs → client-z_oHGVNy.mjs} +10 -7
- package/dist/client-z_oHGVNy.mjs.map +1 -0
- package/dist/completion/zsh-worker.zsh +4029 -0
- package/dist/configure/index.d.mts +8 -7
- package/dist/configure/index.mjs +27 -28
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{context-s0lxhu8_.mjs → context-Bd266-ru.mjs} +2 -3
- package/dist/{context-s0lxhu8_.mjs.map → context-Bd266-ru.mjs.map} +1 -1
- package/dist/{context-CUBwSBq4.d.mts → context-BuuIb8CC.d.mts} +1 -1
- package/dist/{crashreport-BhD0y14F.mjs → crashreport-BsjAkFWw.mjs} +19 -10
- package/dist/{crashreport-BhD0y14F.mjs.map → crashreport-BsjAkFWw.mjs.map} +1 -1
- package/dist/{crashreport-D1wKBJ8N.mjs → crashreport-pr6Rhvza.mjs} +1 -2
- package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
- package/dist/enum-constants-j9QBF0cB.mjs.map +1 -0
- package/dist/{errors-EsY4XO6O.mjs → errors-Dtf2WPaW.mjs} +1 -2
- package/dist/{errors-EsY4XO6O.mjs.map → errors-Dtf2WPaW.mjs.map} +1 -1
- package/dist/{field-C4zdJLW5.mjs → field-DOsJCPFa.mjs} +1 -2
- package/dist/field-DOsJCPFa.mjs.map +1 -0
- package/dist/{file-BzK8z3X-.d.mts → file-BB8Vs9O_.d.mts} +1 -1
- package/dist/{file-B58Dm-2P.mjs → file-_oUZo76X.mjs} +2 -3
- package/dist/{file-B58Dm-2P.mjs.map → file-_oUZo76X.mjs.map} +1 -1
- package/dist/{file-utils-BHPxPXmn.mjs → file-utils-DcyIPFQh.mjs} +2 -3
- package/dist/{file-utils-BHPxPXmn.mjs.map → file-utils-DcyIPFQh.mjs.map} +1 -1
- package/dist/{globals-ByrCoDip.mjs → globals-Crz8o65k.mjs} +53 -5
- package/dist/globals-Crz8o65k.mjs.map +1 -0
- package/dist/http-adapter.generated-WgMnb7Sb.d.mts +580 -0
- package/dist/{iconv-kwrmd1U_.d.mts → iconv-Co-TOPuH.d.mts} +1 -1
- package/dist/{iconv-DreIffeM.mjs → iconv-D2vi8G36.mjs} +2 -3
- package/dist/{iconv-DreIffeM.mjs.map → iconv-D2vi8G36.mjs.map} +1 -1
- package/dist/{idp-Ch95ag8h.mjs → idp-BDbK5gjm.mjs} +2 -3
- package/dist/{idp-Ch95ag8h.mjs.map → idp-BDbK5gjm.mjs.map} +1 -1
- package/dist/{idp-BlBPtXJ-.d.mts → idp-DrhVrLmV.d.mts} +1 -1
- package/dist/{index-CQZVJ5SX.d.mts → index-5vPyRu1y.d.mts} +2 -2
- package/dist/{index-CfRFkXIO.d.mts → index-B7AKc18V.d.mts} +2 -2
- package/dist/{index-CLxubakC.d.mts → index-BlpzXncY.d.mts} +38 -247
- package/dist/{index-DRhMpdnA.d.mts → index-CK7u9isy.d.mts} +8 -8
- package/dist/{index-DUupuPhZ.d.mts → index-CNYe5lnW.d.mts} +2 -2
- package/dist/{index-CPRnOjjt.d.mts → index-DjUdWlzf.d.mts} +2 -2
- package/dist/index-ZePLwxw7.d.mts +208 -0
- package/dist/{interceptor-DOqRkCya.mjs → interceptor-D-q1rvRl.mjs} +1 -2
- package/dist/{interceptor-DOqRkCya.mjs.map → interceptor-D-q1rvRl.mjs.map} +1 -1
- package/dist/{job-BpsFXPbi.mjs → job-fuc3j1Ma.mjs} +9 -10
- package/dist/job-fuc3j1Ma.mjs.map +1 -0
- package/dist/kysely/index.mjs +0 -1
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/{kysely-type-D1e0Vwkd.mjs → kysely-type-DR8uzZTA.mjs} +2 -3
- package/dist/kysely-type-DR8uzZTA.mjs.map +1 -0
- package/dist/{logger-DpJyJvNz.mjs → logger-CxF-Ex5d.mjs} +1 -2
- package/dist/{logger-DpJyJvNz.mjs.map → logger-CxF-Ex5d.mjs.map} +1 -1
- package/dist/{mock-DMgIygjE.mjs → mock-BjFj5o1I.mjs} +9 -11
- package/dist/mock-BjFj5o1I.mjs.map +1 -0
- package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
- package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
- package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
- package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
- package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -2
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.mjs +1 -2
- package/dist/plugin/index.d.mts +1 -3
- package/dist/plugin/index.mjs +0 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/registry-DdsYlL_P.mjs +51 -0
- package/dist/registry-DdsYlL_P.mjs.map +1 -0
- package/dist/{repl-editor-CJG3sz7A.mjs → repl-editor-DmGr9zMw.mjs} +2 -3
- package/dist/{repl-editor-CJG3sz7A.mjs.map → repl-editor-DmGr9zMw.mjs.map} +1 -1
- package/dist/{chunk-BkoGK1jX.mjs → rolldown-runtime-DXywRVcq.mjs} +0 -1
- package/dist/runtime/authconnection.d.mts +1 -1
- package/dist/runtime/authconnection.mjs +1 -2
- package/dist/runtime/context.d.mts +1 -1
- package/dist/runtime/context.mjs +1 -2
- package/dist/runtime/file.d.mts +1 -1
- package/dist/runtime/file.mjs +1 -2
- package/dist/runtime/globals.d.mts +6 -39
- package/dist/runtime/globals.mjs +0 -1
- package/dist/runtime/iconv.d.mts +1 -1
- package/dist/runtime/iconv.mjs +1 -2
- package/dist/runtime/idp.d.mts +1 -1
- package/dist/runtime/idp.mjs +1 -2
- package/dist/runtime/index.d.mts +8 -8
- package/dist/runtime/index.mjs +7 -8
- package/dist/runtime/secretmanager.d.mts +1 -1
- package/dist/runtime/secretmanager.mjs +1 -2
- package/dist/runtime/workflow.d.mts +1 -1
- package/dist/runtime/workflow.mjs +1 -2
- package/dist/{runtime-C7qTBDD2.mjs → runtime-n9NCkjee.mjs} +301 -317
- package/dist/runtime-n9NCkjee.mjs.map +1 -0
- package/dist/{schema-1msIhXwA.mjs → schema-BhkpP5Hw.mjs} +3 -4
- package/dist/schema-BhkpP5Hw.mjs.map +1 -0
- package/dist/{secret-file-CWzF8rry.mjs → secret-file-DBqZhjFQ.mjs} +1 -2
- package/dist/{secret-file-CWzF8rry.mjs.map → secret-file-DBqZhjFQ.mjs.map} +1 -1
- package/dist/{secretmanager-CKLB3wAQ.d.mts → secretmanager-B3n4KHfm.d.mts} +1 -1
- package/dist/{secretmanager-B9h-U_8U.mjs → secretmanager-BVxw3ih_.mjs} +2 -3
- package/dist/{secretmanager-B9h-U_8U.mjs.map → secretmanager-BVxw3ih_.mjs.map} +1 -1
- package/dist/seed/index.mjs +0 -1
- package/dist/seed/index.mjs.map +1 -1
- package/dist/{seed-BH2FbrPV.mjs → seed-jf3008-h.mjs} +5 -16
- package/dist/seed-jf3008-h.mjs.map +1 -0
- package/dist/{service-wI3Hvrgx.mjs → service-CCL8ruDf.mjs} +3 -4
- package/dist/service-CCL8ruDf.mjs.map +1 -0
- package/dist/service-D6yonf2I.mjs +3 -0
- package/dist/{service-DMohAx8a2.mjs → service-DU1mVzri.mjs} +3 -4
- package/dist/service-DU1mVzri.mjs.map +1 -0
- package/dist/{telemetry-BQbbVo2t.mjs → telemetry-CdqJEzkj.mjs} +2 -3
- package/dist/{telemetry-BQbbVo2t.mjs.map → telemetry-CdqJEzkj.mjs.map} +1 -1
- package/dist/telemetry-ClwW5ohF.mjs +3 -0
- package/dist/test-env-key-D9kM6ETE.mjs +49 -0
- package/dist/test-env-key-D9kM6ETE.mjs.map +1 -0
- package/dist/type-source-DH_LH20p.mjs +13 -0
- package/dist/type-source-DH_LH20p.mjs.map +1 -0
- package/dist/{types-CmzfQP_m.mjs → types-B2RpYyA_.mjs} +2 -3
- package/dist/types-B2RpYyA_.mjs.map +1 -0
- package/dist/types-ClhIrW_C.mjs +4 -0
- package/dist/{tailordb-BlBGmQK-.d.mts → types-DCUhgpyI.d.mts} +142 -221
- package/dist/{plugin-C_FyVSdl.d.mts → types-DhO_VEZd.d.mts} +119 -179
- package/dist/types-DwDgacni.d.mts +338 -0
- package/dist/utils/test/index.d.mts +4 -3
- package/dist/utils/test/index.mjs +1 -2
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -2
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.d.mts +42 -5
- package/dist/vitest/index.mjs +133 -4
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/setup.mjs +2 -3
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/{workflow-CMamswkK.d.mts → workflow-BbKvGLQg.d.mts} +1 -1
- package/dist/{workflow--aPbA8Uq.mjs → workflow-DgemCAz3.mjs} +2 -3
- package/dist/{workflow--aPbA8Uq.mjs.map → workflow-DgemCAz3.mjs.map} +1 -1
- package/dist/workflow.generated-DtQwEo-x.d.mts +671 -0
- package/docs/cli/application.md +0 -2
- package/docs/cli/completion.md +3 -0
- package/docs/cli/crashreport.md +0 -2
- package/docs/cli/function.md +1 -1
- package/docs/cli/user.md +3 -3
- package/docs/cli/workspace.md +3 -3
- package/docs/configuration.md +0 -2
- package/docs/plugin/custom.md +2 -2
- package/docs/plugin/index.md +1 -1
- package/docs/runtime.md +3 -3
- package/docs/services/aigateway.md +97 -0
- package/docs/services/auth.md +19 -2
- package/docs/services/executor.md +0 -2
- package/docs/services/resolver.md +2 -4
- package/docs/services/tailordb.md +1 -1
- package/docs/services/workflow.md +13 -15
- package/docs/testing.md +18 -11
- package/package.json +13 -12
- package/dist/actor-J2gJ0eK5.d.mts +0 -24
- package/dist/application-76hhIhnJ.mjs.map +0 -1
- package/dist/application-av2raLs6.mjs +0 -4
- package/dist/cli/skills.d.mts +0 -1
- package/dist/cli/skills.mjs +0 -22
- package/dist/cli/skills.mjs.map +0 -1
- package/dist/client-CobIRHl-.mjs.map +0 -1
- package/dist/enum-constants-C7DaWeQo.mjs.map +0 -1
- package/dist/env-B-g-qgE4.d.mts +0 -7
- package/dist/field-C4zdJLW5.mjs.map +0 -1
- package/dist/globals-ByrCoDip.mjs.map +0 -1
- package/dist/job-BpsFXPbi.mjs.map +0 -1
- package/dist/kysely-type-D1e0Vwkd.mjs.map +0 -1
- package/dist/mock-DMgIygjE.mjs.map +0 -1
- package/dist/package-json-wzO6nV9O.mjs +0 -4
- package/dist/registry-D0uB0OrK.mjs +0 -178
- package/dist/registry-D0uB0OrK.mjs.map +0 -1
- package/dist/runtime-C7qTBDD2.mjs.map +0 -1
- package/dist/schema-1msIhXwA.mjs.map +0 -1
- package/dist/seed-BH2FbrPV.mjs.map +0 -1
- package/dist/service-BHQIerYh.mjs +0 -4
- package/dist/service-DMohAx8a2.mjs.map +0 -1
- package/dist/service-wI3Hvrgx.mjs.map +0 -1
- package/dist/telemetry-w92bvGdC.mjs +0 -4
- package/dist/types-2Be3wSMc.mjs +0 -5
- package/dist/types-CmzfQP_m.mjs.map +0 -1
- package/dist/workflow.generated-Bf1tWylx.d.mts +0 -1416
- package/docs/generator/builtin.md +0 -257
- package/docs/generator/custom.md +0 -147
- package/docs/generator/index.md +0 -66
package/dist/cli/index.mjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crashreport-BhD0y14F.mjs";
|
|
2
|
+
import { Et as AuthInvokerSchema, L as CustomDomainStatus, Nt as PATScope, Q as FunctionExecution_Type, _ 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-z_oHGVNy.mjs";
|
|
3
|
+
import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
|
|
4
|
+
import { n as logger, r as styles } from "../logger-CxF-Ex5d.mjs";
|
|
5
|
+
import { $ as listCommand$10, $t as INITIAL_SCHEMA_NUMBER, An as commonArgs, At as startCommand, B as logBetaWarning, C as listCommand$13, Cn as PluginManager, Dt as jobsCommand, E as resumeCommand, En as apiCommand, F as writeDbTypesFile, Fn as pagedLogArgs, Gt as MIGRATION_LABEL_KEY, H as removeCommand$1, Ht as executeScript, I as getConfiguredEditorCommand, In as paginationArgs, Jt as compareSnapshotWithRemote, K as treeCommand, Kt as handleOptionalToRequiredError, L as openInConfiguredEditor, Ln as toPageDirection, Lt as functionExecutionStatusToString, Mn as confirmationArgs, Mt as getCommand$6, N as generateCommand$1, Nn as deploymentArgs, O as listCommand$12, On as assertWritable, P as generateMigrationScript, Pn as isVerbose, Pt as executionsCommand, Rn as workspaceArgs, Rt as formatKeyValueTable, Sn as sdkNameLabelKey, St as triggerCommand, T as healthCommand, Tn as prompt, U as updateCommand$3, Vt as deploy, Xt as protoGqlPermission, Y as getCommand$5, Yt as generateAllTypeManifestsFromSnapshot, Z as updateCommand$2, _n as formatMigrationDiff, an as createSnapshotFromLocalTypes, at as createCommand$3, b as createCommand$4, bn as ensureConfigId, c as listCommand$14, cn as getMigrationFilePath, dn as isValidMigrationNumber, f as restoreCommand, fn as loadDiff, ft as tokenCommand, g as getCommand$7, gt as listCommand$7, hn as parseMigrationNumberArg, ht as generate, i as updateCommand$4, j as truncateCommand, jn as configArg, kn as defineAppCommand, ln as getMigrationFiles, lt as getCommand$3, m as listCommand$15, mn as formatMigrationNumber, nn as assertValidMigrationFiles, o as removeCommand, on as getLatestMigrationNumber, pn as reconstructSnapshotFromMigrations, pt as listCommand$8, q as listCommand$11, qt as parseMigrationLabelNumber, r as queryCommand, rn as compareLocalTypesWithSnapshot, rt as deleteCommand$3, st as listCommand$9, t as isNativeTypeScriptRuntime, tt as getCommand$4, u as inviteCommand, v as deleteCommand$4, vn as hasChanges, vt as getCommand$2, wn as generateUserTypes, wt as listCommand$6, xn as resourceTrn, xt as webhookCommand, yn as getNamespacesWithMigrations, z as showCommand, zt as getCommand$1 } from "../runtime-n9NCkjee.mjs";
|
|
6
|
+
import { A as loadAccessToken, C as getDistDir, D as deleteUserTokens, E as loadConfig, F as removeLegacyUserAlias, I as resolveTokens, L as saveUserTokens, M as loadMachineUserName, N as loadWorkspaceId, O as fetchLatestToken, P as readPlatformConfig, R as writePlatformConfig, _ as composeFunctionTreeshakeOptions, g as platformBundleDefinePlugin, i as resolveInlineSourcemap, k as findConfigUserKey, l as INVOKER_EXPR, o as WorkflowJobSchema, s as ResolverSchema, t as defineApplication, v as createLogLevelTreeshakeOptions, w as hashContent$1, y as resolveBundleLogLevel } from "../application-DqS1yBg3.mjs";
|
|
7
|
+
import { n as ExecutorSchema } from "../service-CCL8ruDf.mjs";
|
|
8
|
+
import { t as multiline } from "../multiline-sfHpTZZK.mjs";
|
|
9
|
+
import { t as readPackageJson } from "../package-json-8b0O9TlX.mjs";
|
|
10
|
+
import { n as isCLIError } from "../errors-Dtf2WPaW.mjs";
|
|
11
|
+
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crashreport-BsjAkFWw.mjs";
|
|
12
|
+
import { t as isPluginGeneratedType } from "../type-source-DH_LH20p.mjs";
|
|
14
13
|
import { arg, defineCommand, runCommand, runMain } from "politty";
|
|
15
14
|
import { withCompletionCommand } from "politty/completion";
|
|
16
15
|
import { z } from "zod";
|
|
@@ -453,7 +452,6 @@ function parseCrashLogFile(content) {
|
|
|
453
452
|
//#region src/cli/commands/crashreport/index.ts
|
|
454
453
|
const crashReportCommand = defineCommand({
|
|
455
454
|
name: "crashreport",
|
|
456
|
-
aliases: ["crash-report"],
|
|
457
455
|
description: "Manage crash reports.",
|
|
458
456
|
subCommands: {
|
|
459
457
|
list: listCommand$5,
|
|
@@ -468,7 +466,6 @@ const crashReportCommand = defineCommand({
|
|
|
468
466
|
//#region src/cli/commands/deploy/index.ts
|
|
469
467
|
const deployCommand$1 = defineAppCommand({
|
|
470
468
|
name: "deploy",
|
|
471
|
-
aliases: ["apply"],
|
|
472
469
|
description: "Deploy your application by applying the Tailor configuration.",
|
|
473
470
|
args: z.object({
|
|
474
471
|
...deploymentArgs,
|
|
@@ -484,7 +481,7 @@ const deployCommand$1 = defineAppCommand({
|
|
|
484
481
|
}).strict(),
|
|
485
482
|
run: async (args) => {
|
|
486
483
|
await assertWritable({ profile: args.profile });
|
|
487
|
-
const { initTelemetry } = await import("../telemetry-
|
|
484
|
+
const { initTelemetry } = await import("../telemetry-ClwW5ohF.mjs");
|
|
488
485
|
await initTelemetry();
|
|
489
486
|
await deploy({
|
|
490
487
|
workspaceId: args["workspace-id"],
|
|
@@ -572,32 +569,24 @@ function scriptNameToRegistryName(scriptName, executionType) {
|
|
|
572
569
|
/**
|
|
573
570
|
* Download a deployed function script.
|
|
574
571
|
*
|
|
575
|
-
* Returns the bundled script content
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
*
|
|
579
|
-
* non-sourcemap display.
|
|
572
|
+
* Returns the bundled script content. Returns null when the download
|
|
573
|
+
* fails (script removed, network error, etc.) or when no content
|
|
574
|
+
* chunks are received; errors are swallowed so callers can fall back
|
|
575
|
+
* to a non-sourcemap display.
|
|
580
576
|
* @param options - Download options
|
|
581
|
-
* @returns Script content
|
|
577
|
+
* @returns Script content, or null on failure / empty response
|
|
582
578
|
*/
|
|
583
579
|
async function downloadFunctionScript(options) {
|
|
584
580
|
const { client, workspaceId, name, contentHash } = options;
|
|
585
581
|
try {
|
|
586
582
|
const chunks = [];
|
|
587
|
-
let registryUpdatedAt = null;
|
|
588
583
|
for await (const response of client.downloadFunctionRegistryScript({
|
|
589
584
|
workspaceId,
|
|
590
585
|
name,
|
|
591
586
|
contentHash
|
|
592
|
-
})) if (response.payload.case === "
|
|
593
|
-
const updatedAt = response.payload.value.function?.updatedAt;
|
|
594
|
-
if (updatedAt) registryUpdatedAt = timestampDate(updatedAt);
|
|
595
|
-
} else if (response.payload.case === "chunk") chunks.push(response.payload.value);
|
|
587
|
+
})) if (response.payload.case === "chunk") chunks.push(response.payload.value);
|
|
596
588
|
if (chunks.length === 0) return null;
|
|
597
|
-
return {
|
|
598
|
-
code: Buffer.concat(chunks).toString("utf-8"),
|
|
599
|
-
registryUpdatedAt
|
|
600
|
-
};
|
|
589
|
+
return { code: Buffer.concat(chunks).toString("utf-8") };
|
|
601
590
|
} catch (error) {
|
|
602
591
|
logger.debug(`Failed to download function script "${options.name}": ${error}`);
|
|
603
592
|
return null;
|
|
@@ -966,13 +955,12 @@ function printFunctionExecutionDetail(options) {
|
|
|
966
955
|
/**
|
|
967
956
|
* Download a deployed function script for sourcemap mapping. Logs a
|
|
968
957
|
* debug message on failure but never throws. Error display falls back
|
|
969
|
-
* to a plain-text format when the script cannot be retrieved
|
|
970
|
-
* the current registry entry is stale relative to the execution.
|
|
958
|
+
* to a plain-text format when the script cannot be retrieved.
|
|
971
959
|
*
|
|
972
960
|
* When `executionContentHash` is non-empty, the download is pinned to
|
|
973
961
|
* that exact bundle so mapping stays correct across redeploys. When
|
|
974
|
-
* empty
|
|
975
|
-
*
|
|
962
|
+
* empty, mapping is skipped because the exact bundle cannot be
|
|
963
|
+
* identified.
|
|
976
964
|
*
|
|
977
965
|
* `FunctionExecution.scriptName` does not match the function registry
|
|
978
966
|
* name directly; `scriptNameToRegistryName` translates between the two
|
|
@@ -983,50 +971,37 @@ function printFunctionExecutionDetail(options) {
|
|
|
983
971
|
* @param options.scriptName - Script name (matches FunctionExecution.scriptName)
|
|
984
972
|
* @param options.executionType - Execution type used to discriminate registry name translation
|
|
985
973
|
* @param options.executionContentHash - Content hash of the bundle that ran; pins the download when non-empty
|
|
986
|
-
* @
|
|
987
|
-
* @returns Bundled script content, or null when unavailable / stale
|
|
974
|
+
* @returns Bundled script content, or null when unavailable
|
|
988
975
|
*/
|
|
989
976
|
async function downloadScriptForMapping(options) {
|
|
990
|
-
const { client, workspaceId, scriptName, executionType, executionContentHash
|
|
977
|
+
const { client, workspaceId, scriptName, executionType, executionContentHash } = options;
|
|
991
978
|
const registryName = scriptNameToRegistryName(scriptName, executionType);
|
|
992
979
|
if (registryName == null) {
|
|
993
980
|
logger.debug(`Script "${scriptName}" is not a deployed registry script (e.g. test-run or seed); skipping sourcemap mapping.`);
|
|
994
981
|
return null;
|
|
995
982
|
}
|
|
996
|
-
if (executionContentHash
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
workspaceId,
|
|
1000
|
-
name: registryName,
|
|
1001
|
-
contentHash: executionContentHash
|
|
1002
|
-
});
|
|
1003
|
-
if (pinned == null) {
|
|
1004
|
-
logger.debug(`Could not download pinned script "${scriptName}" (registry: "${registryName}", contentHash: "${executionContentHash}") for stack trace mapping; showing raw stack trace.`);
|
|
1005
|
-
return null;
|
|
1006
|
-
}
|
|
1007
|
-
return pinned.code;
|
|
983
|
+
if (executionContentHash === "") {
|
|
984
|
+
logger.debug(`Function execution "${scriptName}" has no contentHash; skipping sourcemap mapping because the exact bundle cannot be identified.`);
|
|
985
|
+
return null;
|
|
1008
986
|
}
|
|
1009
|
-
const
|
|
987
|
+
const pinned = await downloadFunctionScript({
|
|
1010
988
|
client,
|
|
1011
989
|
workspaceId,
|
|
1012
|
-
name: registryName
|
|
990
|
+
name: registryName,
|
|
991
|
+
contentHash: executionContentHash
|
|
1013
992
|
});
|
|
1014
|
-
if (
|
|
1015
|
-
logger.debug(`Could not download script "${scriptName}" (registry: "${registryName}") for stack trace mapping; showing raw stack trace.`);
|
|
993
|
+
if (pinned == null) {
|
|
994
|
+
logger.debug(`Could not download pinned script "${scriptName}" (registry: "${registryName}", contentHash: "${executionContentHash}") for stack trace mapping; showing raw stack trace.`);
|
|
1016
995
|
return null;
|
|
1017
996
|
}
|
|
1018
|
-
|
|
1019
|
-
logger.debug(`Registry script "${registryName}" was updated at ${result.registryUpdatedAt.toISOString()} after execution started at ${executionStartedAt.toISOString()}; skipping sourcemap mapping to avoid stale source locations.`);
|
|
1020
|
-
return null;
|
|
1021
|
-
}
|
|
1022
|
-
return result.code;
|
|
997
|
+
return pinned.code;
|
|
1023
998
|
}
|
|
1024
999
|
const logsCommand = defineAppCommand({
|
|
1025
1000
|
name: "logs",
|
|
1026
1001
|
description: "List or get function execution logs.",
|
|
1027
1002
|
notes: `When viewing a specific execution that failed, the command displays error details with the stack trace mapped back to your original source files (clickable file links and code snippets, matching \`function test-run\` output).
|
|
1028
1003
|
|
|
1029
|
-
Stack traces
|
|
1004
|
+
Stack traces are mapped only when the execution includes a content hash for the exact build that ran. If the content hash is missing or the build is no longer available, the command falls back to a plain-text error display.`,
|
|
1030
1005
|
examples: [
|
|
1031
1006
|
{
|
|
1032
1007
|
cmd: "",
|
|
@@ -1074,8 +1049,7 @@ Stack traces stay accurate even after later redeploys, because the trace is reso
|
|
|
1074
1049
|
workspaceId,
|
|
1075
1050
|
scriptName: detail.scriptName,
|
|
1076
1051
|
executionType: execution.type,
|
|
1077
|
-
executionContentHash: execution.contentHash
|
|
1078
|
-
executionStartedAt: detail.startedAt
|
|
1052
|
+
executionContentHash: execution.contentHash
|
|
1079
1053
|
}) : null
|
|
1080
1054
|
});
|
|
1081
1055
|
} else {
|
|
@@ -1284,7 +1258,7 @@ async function detectFunctionType(options) {
|
|
|
1284
1258
|
const rawInput = module.default.input;
|
|
1285
1259
|
let inputSchema;
|
|
1286
1260
|
if (rawInput) {
|
|
1287
|
-
const { t } = await import("../types-
|
|
1261
|
+
const { t } = await import("../types-ClhIrW_C.mjs");
|
|
1288
1262
|
inputSchema = t.object(rawInput);
|
|
1289
1263
|
}
|
|
1290
1264
|
return {
|
|
@@ -1474,7 +1448,7 @@ When a \`.js\` file is provided, detection and bundling are skipped and the file
|
|
|
1474
1448
|
if (!detected.hasInput) {
|
|
1475
1449
|
logger.warn("--arg is ignored because this resolver has no input schema. Define \"input\" in your resolver to use --arg.");
|
|
1476
1450
|
args.arg = void 0;
|
|
1477
|
-
} else if (detected.inputSchema)
|
|
1451
|
+
} else if (detected.inputSchema) JSON.parse(args.arg);
|
|
1478
1452
|
}
|
|
1479
1453
|
logger.info("Bundling...");
|
|
1480
1454
|
({bundledCode, scriptName} = await bundleForTestRun({
|
|
@@ -1600,42 +1574,6 @@ async function resolveMachineUser(options) {
|
|
|
1600
1574
|
attributeList
|
|
1601
1575
|
};
|
|
1602
1576
|
}
|
|
1603
|
-
/**
|
|
1604
|
-
* Resolve resolver arg format: detect and unwrap deprecated {"input":{...}} wrapper.
|
|
1605
|
-
* Tries new format (arg = input fields) first via schema parse.
|
|
1606
|
-
* If that fails and arg looks like old format, tries unwrapping.
|
|
1607
|
-
* @param argStr - JSON string of the arg
|
|
1608
|
-
* @param inputSchema - Pre-built schema object from detect (has .parse())
|
|
1609
|
-
* @param machineUser - Resolved machine user info
|
|
1610
|
-
* @param workspaceId - Workspace ID
|
|
1611
|
-
* @returns Resolved JSON string (unwrapped if old format)
|
|
1612
|
-
*/
|
|
1613
|
-
function resolveResolverArg(argStr, inputSchema, machineUser, workspaceId) {
|
|
1614
|
-
const parsed = JSON.parse(argStr);
|
|
1615
|
-
const user = {
|
|
1616
|
-
id: machineUser.id,
|
|
1617
|
-
type: "machine_user",
|
|
1618
|
-
workspaceId,
|
|
1619
|
-
attributes: machineUser.attributes ?? null,
|
|
1620
|
-
attributeList: machineUser.attributeList
|
|
1621
|
-
};
|
|
1622
|
-
if (!inputSchema.parse({
|
|
1623
|
-
value: parsed,
|
|
1624
|
-
data: parsed,
|
|
1625
|
-
user
|
|
1626
|
-
}).issues) return argStr;
|
|
1627
|
-
if (Object.keys(parsed).length === 1 && parsed.input != null && typeof parsed.input === "object" && !Array.isArray(parsed.input)) {
|
|
1628
|
-
if (!inputSchema.parse({
|
|
1629
|
-
value: parsed.input,
|
|
1630
|
-
data: parsed.input,
|
|
1631
|
-
user
|
|
1632
|
-
}).issues) {
|
|
1633
|
-
logger.warn("[DEPRECATED] Wrapping args with \"input\" key (e.g. {\"input\":{...}}) is deprecated. Pass input fields directly (e.g. {\"a\":1}). The \"input\" wrapper will be removed in v2.");
|
|
1634
|
-
return JSON.stringify(parsed.input);
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
return argStr;
|
|
1638
|
-
}
|
|
1639
1577
|
|
|
1640
1578
|
//#endregion
|
|
1641
1579
|
//#region src/cli/commands/function/index.ts
|
|
@@ -1669,7 +1607,7 @@ const generateCommand = defineAppCommand({
|
|
|
1669
1607
|
})
|
|
1670
1608
|
}).strict(),
|
|
1671
1609
|
run: async (args) => {
|
|
1672
|
-
const { initTelemetry } = await import("../telemetry-
|
|
1610
|
+
const { initTelemetry } = await import("../telemetry-ClwW5ohF.mjs");
|
|
1673
1611
|
await initTelemetry();
|
|
1674
1612
|
await generate({
|
|
1675
1613
|
configPath: args.config,
|
|
@@ -1748,11 +1686,12 @@ const startAuthServer = async () => {
|
|
|
1748
1686
|
});
|
|
1749
1687
|
const userInfo = await fetchUserInfo(tokens.accessToken);
|
|
1750
1688
|
const pfConfig = await readPlatformConfig();
|
|
1751
|
-
await saveUserTokens(pfConfig, userInfo.
|
|
1689
|
+
await saveUserTokens(pfConfig, userInfo.sub, {
|
|
1752
1690
|
accessToken: tokens.accessToken,
|
|
1753
1691
|
refreshToken: tokens.refreshToken ?? void 0
|
|
1754
|
-
}, new Date(assertDefined(tokens.expiresAt, "token response missing expiresAt")).toISOString());
|
|
1755
|
-
pfConfig.
|
|
1692
|
+
}, new Date(assertDefined(tokens.expiresAt, "token response missing expiresAt")).toISOString(), { email: userInfo.email });
|
|
1693
|
+
await removeLegacyUserAlias(pfConfig, userInfo.email, userInfo.sub);
|
|
1694
|
+
pfConfig.current_user = userInfo.sub;
|
|
1756
1695
|
writePlatformConfig(pfConfig);
|
|
1757
1696
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
1758
1697
|
res.end(JSON.stringify({
|
|
@@ -1806,7 +1745,6 @@ const loginCommand = defineAppCommand({
|
|
|
1806
1745
|
description: "Login to Tailor Platform.",
|
|
1807
1746
|
args: z.xor([z.object({}).strict().describe("User Login"), z.object({
|
|
1808
1747
|
"machine-user": arg(z.literal(true), {
|
|
1809
|
-
hiddenAlias: "machineuser",
|
|
1810
1748
|
description: "Login as a platform machine user.",
|
|
1811
1749
|
required: true
|
|
1812
1750
|
}),
|
|
@@ -1977,7 +1915,7 @@ const createCommand$2 = defineAppCommand({
|
|
|
1977
1915
|
}),
|
|
1978
1916
|
user: arg(z.string(), {
|
|
1979
1917
|
alias: "u",
|
|
1980
|
-
description: "User email"
|
|
1918
|
+
description: "User email address or machine user client ID"
|
|
1981
1919
|
}),
|
|
1982
1920
|
"workspace-id": arg(z.string(), {
|
|
1983
1921
|
alias: "w",
|
|
@@ -1994,7 +1932,8 @@ const createCommand$2 = defineAppCommand({
|
|
|
1994
1932
|
if (args["machine-user-override"] === "deny" && !args["machine-user"]) throw new Error("--machine-user-override deny requires --machine-user.");
|
|
1995
1933
|
const config = await readPlatformConfig();
|
|
1996
1934
|
if (config.profiles[args.name]) throw new Error(`Profile "${args.name}" already exists.`);
|
|
1997
|
-
const
|
|
1935
|
+
const { accessToken: token, user: resolvedUser } = await fetchLatestToken(config, args.user);
|
|
1936
|
+
const client = await initOperatorClient(token);
|
|
1998
1937
|
if (!(await fetchAll(async (pageToken, maxPageSize) => {
|
|
1999
1938
|
const { workspaces, nextPageToken } = await client.listWorkspaces({
|
|
2000
1939
|
pageToken,
|
|
@@ -2003,7 +1942,7 @@ const createCommand$2 = defineAppCommand({
|
|
|
2003
1942
|
return [workspaces, nextPageToken];
|
|
2004
1943
|
})).find((ws) => ws.id === args["workspace-id"])) throw new Error(`Workspace "${args["workspace-id"]}" not found.`);
|
|
2005
1944
|
config.profiles[args.name] = {
|
|
2006
|
-
user:
|
|
1945
|
+
user: resolvedUser,
|
|
2007
1946
|
workspace_id: args["workspace-id"],
|
|
2008
1947
|
...args.permission === "read" ? { readonly: true } : {},
|
|
2009
1948
|
...args["machine-user"] ? { machine_user: args["machine-user"] } : {},
|
|
@@ -2013,7 +1952,7 @@ const createCommand$2 = defineAppCommand({
|
|
|
2013
1952
|
if (!args.json) logger.success(`Profile "${args.name}" created successfully.`);
|
|
2014
1953
|
const profileInfo = {
|
|
2015
1954
|
name: args.name,
|
|
2016
|
-
user:
|
|
1955
|
+
user: resolvedUser,
|
|
2017
1956
|
workspaceId: args["workspace-id"],
|
|
2018
1957
|
permission: args.permission,
|
|
2019
1958
|
...args["machine-user"] ? {
|
|
@@ -2090,7 +2029,7 @@ const updateCommand$1 = defineAppCommand({
|
|
|
2090
2029
|
}),
|
|
2091
2030
|
user: arg(z.string().optional(), {
|
|
2092
2031
|
alias: "u",
|
|
2093
|
-
description: "New user email"
|
|
2032
|
+
description: "New user email address or machine user client ID"
|
|
2094
2033
|
}),
|
|
2095
2034
|
"workspace-id": arg(z.string().optional(), {
|
|
2096
2035
|
alias: "w",
|
|
@@ -2112,6 +2051,7 @@ const updateCommand$1 = defineAppCommand({
|
|
|
2112
2051
|
const newUser = args.user || oldUser;
|
|
2113
2052
|
const oldWorkspaceId = profile.workspace_id;
|
|
2114
2053
|
const newWorkspaceId = args["workspace-id"] || oldWorkspaceId;
|
|
2054
|
+
let resolvedUser = newUser;
|
|
2115
2055
|
const finalMachineUser = args["machine-user"] === "" ? void 0 : args["machine-user"] ?? profile.machine_user;
|
|
2116
2056
|
const finalOverride = args["machine-user-override"] === "allow" ? void 0 : args["machine-user-override"] ?? profile.machine_user_override;
|
|
2117
2057
|
if ((args["machine-user"] !== void 0 || args["machine-user-override"] !== void 0) && finalOverride === "deny" && !finalMachineUser) {
|
|
@@ -2119,7 +2059,9 @@ const updateCommand$1 = defineAppCommand({
|
|
|
2119
2059
|
throw new Error(`Cannot clear the machine user while machine-user-override is "deny". Also pass --machine-user-override allow.`);
|
|
2120
2060
|
}
|
|
2121
2061
|
if (args.user !== void 0 || args["workspace-id"] !== void 0) {
|
|
2122
|
-
const
|
|
2062
|
+
const refreshed = await fetchLatestToken(config, newUser);
|
|
2063
|
+
resolvedUser = refreshed.user;
|
|
2064
|
+
const client = await initOperatorClient(refreshed.accessToken);
|
|
2123
2065
|
if (!(await fetchAll(async (pageToken, maxPageSize) => {
|
|
2124
2066
|
const { workspaces, nextPageToken } = await client.listWorkspaces({
|
|
2125
2067
|
pageToken,
|
|
@@ -2128,7 +2070,7 @@ const updateCommand$1 = defineAppCommand({
|
|
|
2128
2070
|
return [workspaces, nextPageToken];
|
|
2129
2071
|
})).find((ws) => ws.id === newWorkspaceId)) throw new Error(`Workspace "${newWorkspaceId}" not found.`);
|
|
2130
2072
|
}
|
|
2131
|
-
profile.user =
|
|
2073
|
+
profile.user = resolvedUser;
|
|
2132
2074
|
profile.workspace_id = newWorkspaceId;
|
|
2133
2075
|
if (args.permission === "read") profile.readonly = true;
|
|
2134
2076
|
else if (args.permission === "write") delete profile.readonly;
|
|
@@ -2140,7 +2082,7 @@ const updateCommand$1 = defineAppCommand({
|
|
|
2140
2082
|
if (!args.json) logger.success(`Profile "${args.name}" updated successfully`);
|
|
2141
2083
|
const profileInfo = {
|
|
2142
2084
|
name: args.name,
|
|
2143
|
-
user:
|
|
2085
|
+
user: resolvedUser,
|
|
2144
2086
|
workspaceId: newWorkspaceId,
|
|
2145
2087
|
permission: profile.readonly === true ? "read" : "write",
|
|
2146
2088
|
...profile.machine_user ? {
|
|
@@ -2707,7 +2649,7 @@ function findTarget(lock, kind, workspaceName) {
|
|
|
2707
2649
|
|
|
2708
2650
|
//#endregion
|
|
2709
2651
|
//#region src/cli/commands/setup/github/branch.workflow.yml
|
|
2710
|
-
var branch_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n # __PULL_REQUEST_START__\n pull_request:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n # __PULL_REQUEST_END__\n push:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n workflow_dispatch:\n # __DISPATCH_INPUTS_START__\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n # __DISPATCH_INPUTS_END__\n\npermissions:\n contents: read\n\njobs:\n # __PLAN_JOB_START__\n tailor-plan:\n if: >-\n github.event_name == 'pull_request' ||\n (github.event_name == 'workflow_dispatch' && inputs['dry-run'])\n runs-on: ubuntu-latest\n timeout-minutes: 30\n environment: __ENVIRONMENT__\n permissions:\n contents: read\n pull-requests: write\n concurrency:\n group: tailor-plan-__WORKSPACE_NAME__-${{ github.event.pull_request.number || github.run_id }}\n cancel-in-progress: true\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n # __SETUP_STEPS__\n - id: tailor-generate\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk generate\n - id: tailor-generate-check\n run: |\n git add -A\n if ! git diff --cached --quiet; then\n git --no-pager diff --cached --stat\n echo \"::error::Generated files are out of date. Run 'tailor-sdk generate' locally and commit the result.\"\n exit 1\n fi\n - id: tailor-plan\n # Fork PRs cannot read secrets; the checks above still run for them.\n if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork\n uses: tailor-platform/actions/plan@4d0f160b6b5cc2f02594776665471497c297181e # v1.2.0\n with:\n workspace-id: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n label: __WORKSPACE_NAME__\n # __WORKING_DIRECTORY__\n platform-client-id: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n platform-client-secret: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n github-token: ${{ secrets.GITHUB_TOKEN }}\n # __PLAN_JOB_END__\n tailor-deploy:\n # __DEPLOY_IF__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n permissions:\n contents: read\n environment: __ENVIRONMENT__\n concurrency:\n group: tailor-deploy-__WORKSPACE_NAME__\n cancel-in-progress: false\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n # __SETUP_STEPS__\n - id: tailor-apply\n uses: tailor-platform/actions/deploy@4d0f160b6b5cc2f02594776665471497c297181e # v1.2.0\n with:\n workspace-id: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n # __WORKING_DIRECTORY__\n platform-client-id: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n platform-client-secret: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n";
|
|
2652
|
+
var branch_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n # __PULL_REQUEST_START__\n pull_request:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n # __PULL_REQUEST_END__\n push:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n workflow_dispatch:\n # __DISPATCH_INPUTS_START__\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n # __DISPATCH_INPUTS_END__\n\npermissions:\n contents: read\n\njobs:\n # __PLAN_JOB_START__\n tailor-plan:\n if: >-\n github.event_name == 'pull_request' ||\n (github.event_name == 'workflow_dispatch' && inputs['dry-run'])\n runs-on: ubuntu-latest\n timeout-minutes: 30\n environment: __ENVIRONMENT__\n permissions:\n contents: read\n pull-requests: write\n concurrency:\n group: tailor-plan-__WORKSPACE_NAME__-${{ github.event.pull_request.number || github.run_id }}\n cancel-in-progress: true\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n with:\n fetch-depth: 0\n - id: tailor-merge-base\n if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork\n env:\n BASE_REF: ${{ github.base_ref }}\n run: |\n git config user.name \"github-actions[bot]\"\n git config user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\n git fetch origin \"$BASE_REF:refs/remotes/origin/$BASE_REF\"\n git merge --no-edit \"origin/$BASE_REF\"\n # __SETUP_STEPS__\n - id: tailor-generate\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk generate\n - id: tailor-generate-check\n run: |\n git add -A\n if ! git diff --cached --quiet; then\n git --no-pager diff --cached --stat\n echo \"::error::Generated files are out of date. Run 'tailor-sdk generate' locally and commit the result.\"\n exit 1\n fi\n - id: tailor-mask-credentials\n # Fork PRs cannot read secrets; the checks above still run for them.\n if: >-\n (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) &&\n vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n run: |\n echo \"::add-mask::$CLIENT_ID\"\n echo \"::add-mask::$CLIENT_SECRET\"\n env:\n CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-login\n if: >-\n (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) &&\n vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk login --machine-user\n env:\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-plan\n if: >-\n (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) &&\n vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n # __WORKING_DIRECTORY__\n run: |\n if [ -z \"$TAILOR_PLATFORM_WORKSPACE_ID\" ]; then\n echo \"exit-code=\" >> \"$GITHUB_OUTPUT\"\n exit 0\n fi\n\n set +e\n OUTPUT=$(__PM_EXEC__ tailor-sdk deploy --dry-run --yes 2>&1)\n EXIT_CODE=$?\n set -e\n\n MAX_OUTPUT=60000\n if [ \"${#OUTPUT}\" -gt \"$MAX_OUTPUT\" ]; then\n LOG_STOP_TOKEN=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)\n echo \"::group::Full Tailor Platform plan output\"\n echo \"::stop-commands::$LOG_STOP_TOKEN\"\n printf '%s\\n' \"$OUTPUT\"\n echo \"::$LOG_STOP_TOKEN::\"\n echo \"::endgroup::\"\n OUTPUT_TAIL=\"${OUTPUT: -$MAX_OUTPUT}\"\n OUTPUT=$(printf '%s\\n\\n%s' \"[output truncated to the last $MAX_OUTPUT characters - see the workflow logs for the full plan]\" \"$OUTPUT_TAIL\")\n fi\n\n EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)\n {\n echo \"exit-code=$EXIT_CODE\"\n echo \"output<<$EOF\"\n echo \"$OUTPUT\"\n echo \"$EOF\"\n } >> \"$GITHUB_OUTPUT\"\n env:\n TAILOR_PLATFORM_WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n - id: tailor-plan-summary\n if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork\n run: |\n if [ -n \"$LABEL\" ]; then\n KEY=\"$LABEL\"\n elif [ -n \"$WORKSPACE_ID\" ]; then\n KEY=\"$WORKSPACE_ID\"\n else\n KEY=\"workspace\"\n fi\n\n if [ -z \"$WORKSPACE_ID\" ]; then\n {\n echo \"## Tailor Platform Plan ($KEY)\"\n echo \"\"\n echo \"Workspace is not provisioned yet. Set TAILOR_PLATFORM_WORKSPACE_ID after provisioning the workspace.\"\n } >> \"$GITHUB_STEP_SUMMARY\"\n exit 0\n fi\n\n if [ \"$DRY_RUN_EXIT_CODE\" = \"0\" ]; then\n STATUS=\"PASS\"\n else\n STATUS=\"FAIL\"\n fi\n\n {\n echo \"## $STATUS Tailor Platform Plan ($KEY)\"\n echo \"\"\n echo \"<details>\"\n echo \"<summary>Plan output (exit code: $DRY_RUN_EXIT_CODE)</summary>\"\n echo \"\"\n echo '```'\n echo \"$DRY_RUN_OUTPUT\"\n echo '```'\n echo \"\"\n echo \"</details>\"\n } >> \"$GITHUB_STEP_SUMMARY\"\n env:\n WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n LABEL: __WORKSPACE_NAME__\n DRY_RUN_OUTPUT: ${{ steps.tailor-plan.outputs.output }}\n DRY_RUN_EXIT_CODE: ${{ steps.tailor-plan.outputs.exit-code }}\n - id: tailor-plan-comment\n if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork\n uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9\n env:\n WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n LABEL: __WORKSPACE_NAME__\n DRY_RUN_OUTPUT: ${{ steps.tailor-plan.outputs.output }}\n DRY_RUN_EXIT_CODE: ${{ steps.tailor-plan.outputs.exit-code }}\n with:\n github-token: ${{ secrets.GITHUB_TOKEN }}\n script: |\n const workspaceId = process.env.WORKSPACE_ID;\n const label = process.env.LABEL;\n const key = label || workspaceId || 'workspace';\n const marker = `<!-- tailor-plan: ${key} -->`;\n\n let body;\n if (!workspaceId) {\n body = [\n marker,\n `## Tailor Platform Plan (${key})`,\n '',\n 'Workspace is not provisioned yet. Set TAILOR_PLATFORM_WORKSPACE_ID after provisioning the workspace.',\n '',\n ].join('\\n');\n } else {\n const exitCode = process.env.DRY_RUN_EXIT_CODE;\n let output = process.env.DRY_RUN_OUTPUT;\n const MAX_OUTPUT = 60000;\n if (output.length > MAX_OUTPUT) {\n const note = `[output truncated to the last ${MAX_OUTPUT} characters - see the job's step summary for the full plan]\\n\\n`;\n output = note + output.slice(output.length - MAX_OUTPUT);\n }\n const status = exitCode === '0' ? 'PASS' : 'FAIL';\n body = [\n marker,\n `## ${status} Tailor Platform Plan (${key})`,\n '',\n '<details>',\n `<summary>Plan output (exit code: ${exitCode})</summary>`,\n '',\n '```',\n output,\n '```',\n '',\n '</details>',\n '',\n ].join('\\n');\n }\n\n const comments = await github.paginate(github.rest.issues.listComments, {\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n per_page: 100,\n });\n const existingComment = comments.find(comment =>\n comment.body?.includes(marker) &&\n comment.user?.type === 'Bot' &&\n comment.user?.login === 'github-actions[bot]'\n );\n if (existingComment) {\n await github.rest.issues.updateComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n comment_id: existingComment.id,\n body,\n });\n } else {\n await github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body,\n });\n }\n - id: tailor-plan-fail\n if: >-\n (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) &&\n vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n run: |\n if [ \"$DRY_RUN_EXIT_CODE\" != \"0\" ]; then\n echo \"::error::Plan dry-run failed with exit code $DRY_RUN_EXIT_CODE\"\n exit \"$DRY_RUN_EXIT_CODE\"\n fi\n env:\n DRY_RUN_EXIT_CODE: ${{ steps.tailor-plan.outputs.exit-code }}\n # __PLAN_JOB_END__\n tailor-deploy:\n # __DEPLOY_IF__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n permissions:\n contents: read\n environment: __ENVIRONMENT__\n concurrency:\n group: tailor-deploy-__WORKSPACE_NAME__\n cancel-in-progress: false\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n # __SETUP_STEPS__\n - id: tailor-validate-workspace\n env:\n WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n run: |\n if [ -z \"$WORKSPACE_ID\" ]; then\n echo \"::error::Workspace is not provisioned: TAILOR_PLATFORM_WORKSPACE_ID is empty. Provision the workspace and set the variable.\"\n exit 1\n fi\n - id: tailor-mask-credentials\n run: |\n echo \"::add-mask::$CLIENT_ID\"\n echo \"::add-mask::$CLIENT_SECRET\"\n env:\n CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-login\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk login --machine-user\n env:\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-generate\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk generate\n env:\n TAILOR_PLATFORM_WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n - id: tailor-deploy\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk deploy --yes\n env:\n TAILOR_PLATFORM_WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n";
|
|
2711
2653
|
|
|
2712
2654
|
//#endregion
|
|
2713
2655
|
//#region src/cli/commands/setup/github/setup-bun.yml
|
|
@@ -2727,7 +2669,7 @@ var setup_yarn_default = "- id: tailor-setup-node\n uses: actions/setup-node@48
|
|
|
2727
2669
|
|
|
2728
2670
|
//#endregion
|
|
2729
2671
|
//#region src/cli/commands/setup/github/tag.workflow.yml
|
|
2730
|
-
var tag_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n push:\n tags: [\"__TAG_PATTERN__\"]\n workflow_dispatch:\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n\npermissions:\n contents: read\n\njobs:\n # __TAG_GUARD_JOB_START__\n tailor-tag-guard:\n runs-on: ubuntu-latest\n timeout-minutes: 10\n permissions:\n contents: read\n outputs:\n on-branch: ${{ steps.tailor-tag-guard.outputs.on-branch }}\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n with:\n fetch-depth: 0\n - id: tailor-tag-guard\n env:\n TARGET_BRANCH: \"__BRANCH__\"\n run: |\n git fetch origin \"$TARGET_BRANCH\"\n if git merge-base --is-ancestor \"$GITHUB_SHA\" \"origin/$TARGET_BRANCH\"; then\n echo \"on-branch=true\" >> \"$GITHUB_OUTPUT\"\n else\n # A tag outside the target branch is not an error — just skip.\n echo \"on-branch=false\" >> \"$GITHUB_OUTPUT\"\n echo \"::notice::Tag $GITHUB_REF_NAME is not reachable from $TARGET_BRANCH; skipping deploy.\"\n fi\n # __TAG_GUARD_JOB_END__\n tailor-plan:\n # __PLAN_NEEDS__\n # __PLAN_IF__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n environment: __ENVIRONMENT__\n permissions:\n contents: read\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n # __SETUP_STEPS__\n - id: tailor-generate\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk generate\n - id: tailor-generate-check\n run: |\n git add -A\n if ! git diff --cached --quiet; then\n git --no-pager diff --cached --stat\n echo \"::error::Generated files are out of date. Run 'tailor-sdk generate' locally and commit the result.\"\n exit 1\n fi\n - id: tailor-
|
|
2672
|
+
var tag_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n push:\n tags: [\"__TAG_PATTERN__\"]\n workflow_dispatch:\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n\npermissions:\n contents: read\n\njobs:\n # __TAG_GUARD_JOB_START__\n tailor-tag-guard:\n runs-on: ubuntu-latest\n timeout-minutes: 10\n permissions:\n contents: read\n outputs:\n on-branch: ${{ steps.tailor-tag-guard.outputs.on-branch }}\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n with:\n fetch-depth: 0\n - id: tailor-tag-guard\n env:\n TARGET_BRANCH: \"__BRANCH__\"\n run: |\n git fetch origin \"$TARGET_BRANCH\"\n if git merge-base --is-ancestor \"$GITHUB_SHA\" \"origin/$TARGET_BRANCH\"; then\n echo \"on-branch=true\" >> \"$GITHUB_OUTPUT\"\n else\n # A tag outside the target branch is not an error — just skip.\n echo \"on-branch=false\" >> \"$GITHUB_OUTPUT\"\n echo \"::notice::Tag $GITHUB_REF_NAME is not reachable from $TARGET_BRANCH; skipping deploy.\"\n fi\n # __TAG_GUARD_JOB_END__\n tailor-plan:\n # __PLAN_NEEDS__\n # __PLAN_IF__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n environment: __ENVIRONMENT__\n permissions:\n contents: read\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n # __SETUP_STEPS__\n - id: tailor-generate\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk generate\n - id: tailor-generate-check\n run: |\n git add -A\n if ! git diff --cached --quiet; then\n git --no-pager diff --cached --stat\n echo \"::error::Generated files are out of date. Run 'tailor-sdk generate' locally and commit the result.\"\n exit 1\n fi\n - id: tailor-mask-credentials\n if: vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n run: |\n echo \"::add-mask::$CLIENT_ID\"\n echo \"::add-mask::$CLIENT_SECRET\"\n env:\n CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-login\n if: vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk login --machine-user\n env:\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-plan\n if: vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n # __WORKING_DIRECTORY__\n run: |\n if [ -z \"$TAILOR_PLATFORM_WORKSPACE_ID\" ]; then\n echo \"exit-code=\" >> \"$GITHUB_OUTPUT\"\n exit 0\n fi\n\n set +e\n OUTPUT=$(__PM_EXEC__ tailor-sdk deploy --dry-run --yes 2>&1)\n EXIT_CODE=$?\n set -e\n\n MAX_OUTPUT=60000\n if [ \"${#OUTPUT}\" -gt \"$MAX_OUTPUT\" ]; then\n LOG_STOP_TOKEN=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)\n echo \"::group::Full Tailor Platform plan output\"\n echo \"::stop-commands::$LOG_STOP_TOKEN\"\n printf '%s\\n' \"$OUTPUT\"\n echo \"::$LOG_STOP_TOKEN::\"\n echo \"::endgroup::\"\n OUTPUT_TAIL=\"${OUTPUT: -$MAX_OUTPUT}\"\n OUTPUT=$(printf '%s\\n\\n%s' \"[output truncated to the last $MAX_OUTPUT characters - see the workflow logs for the full plan]\" \"$OUTPUT_TAIL\")\n fi\n\n EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)\n {\n echo \"exit-code=$EXIT_CODE\"\n echo \"output<<$EOF\"\n echo \"$OUTPUT\"\n echo \"$EOF\"\n } >> \"$GITHUB_OUTPUT\"\n env:\n TAILOR_PLATFORM_WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n - id: tailor-plan-summary\n run: |\n if [ -n \"$LABEL\" ]; then\n KEY=\"$LABEL\"\n elif [ -n \"$WORKSPACE_ID\" ]; then\n KEY=\"$WORKSPACE_ID\"\n else\n KEY=\"workspace\"\n fi\n\n if [ -z \"$WORKSPACE_ID\" ]; then\n {\n echo \"## Tailor Platform Plan ($KEY)\"\n echo \"\"\n echo \"Workspace is not provisioned yet. Set TAILOR_PLATFORM_WORKSPACE_ID after provisioning the workspace.\"\n } >> \"$GITHUB_STEP_SUMMARY\"\n exit 0\n fi\n\n if [ \"$DRY_RUN_EXIT_CODE\" = \"0\" ]; then\n STATUS=\"PASS\"\n else\n STATUS=\"FAIL\"\n fi\n\n {\n echo \"## $STATUS Tailor Platform Plan ($KEY)\"\n echo \"\"\n echo \"<details>\"\n echo \"<summary>Plan output (exit code: $DRY_RUN_EXIT_CODE)</summary>\"\n echo \"\"\n echo '```'\n echo \"$DRY_RUN_OUTPUT\"\n echo '```'\n echo \"\"\n echo \"</details>\"\n } >> \"$GITHUB_STEP_SUMMARY\"\n env:\n WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n LABEL: __WORKSPACE_NAME__\n DRY_RUN_OUTPUT: ${{ steps.tailor-plan.outputs.output }}\n DRY_RUN_EXIT_CODE: ${{ steps.tailor-plan.outputs.exit-code }}\n - id: tailor-plan-fail\n if: vars.TAILOR_PLATFORM_WORKSPACE_ID != ''\n run: |\n if [ \"$DRY_RUN_EXIT_CODE\" != \"0\" ]; then\n echo \"::error::Plan dry-run failed with exit code $DRY_RUN_EXIT_CODE\"\n exit \"$DRY_RUN_EXIT_CODE\"\n fi\n env:\n DRY_RUN_EXIT_CODE: ${{ steps.tailor-plan.outputs.exit-code }}\n\n tailor-deploy:\n needs: tailor-plan\n if: ${{ !(github.event_name == 'workflow_dispatch' && inputs['dry-run']) }}\n environment: __ENVIRONMENT__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n permissions:\n contents: read\n concurrency:\n group: tailor-deploy-__WORKSPACE_NAME__\n cancel-in-progress: false\n steps:\n - id: tailor-checkout\n uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3\n # __SETUP_STEPS__\n - id: tailor-validate-workspace\n env:\n WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n run: |\n if [ -z \"$WORKSPACE_ID\" ]; then\n echo \"::error::Workspace is not provisioned: TAILOR_PLATFORM_WORKSPACE_ID is empty. Provision the workspace and set the variable.\"\n exit 1\n fi\n - id: tailor-mask-credentials\n run: |\n echo \"::add-mask::$CLIENT_ID\"\n echo \"::add-mask::$CLIENT_SECRET\"\n env:\n CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-login\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk login --machine-user\n env:\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n - id: tailor-generate\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk generate\n env:\n TAILOR_PLATFORM_WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n - id: tailor-deploy\n # __WORKING_DIRECTORY__\n run: __PM_EXEC__ tailor-sdk deploy --yes\n env:\n TAILOR_PLATFORM_WORKSPACE_ID: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n";
|
|
2731
2673
|
|
|
2732
2674
|
//#endregion
|
|
2733
2675
|
//#region src/cli/commands/setup/github/templates.ts
|
|
@@ -2818,8 +2760,8 @@ function renderBranchWorkflow(params) {
|
|
|
2818
2760
|
out = line(out, "PATHS", params.workingDirectory ? `paths: ["${params.workingDirectory}/**"]` : void 0);
|
|
2819
2761
|
out = applyCommon(out, params).replaceAll("__BRANCH__", () => branch);
|
|
2820
2762
|
const generatedIds = [];
|
|
2821
|
-
if (plan) generatedIds.push("tailor-plan", "tailor-plan/tailor-checkout", ...setupIds("tailor-plan", packageManager), "tailor-plan/tailor-generate", "tailor-plan/tailor-generate-check", "tailor-plan/tailor-plan");
|
|
2822
|
-
generatedIds.push("tailor-deploy", "tailor-deploy/tailor-checkout", ...setupIds("tailor-deploy", packageManager), "tailor-deploy/tailor-
|
|
2763
|
+
if (plan) generatedIds.push("tailor-plan", "tailor-plan/tailor-checkout", "tailor-plan/tailor-merge-base", ...setupIds("tailor-plan", packageManager), "tailor-plan/tailor-generate", "tailor-plan/tailor-generate-check", "tailor-plan/tailor-mask-credentials", "tailor-plan/tailor-login", "tailor-plan/tailor-plan", "tailor-plan/tailor-plan-summary", "tailor-plan/tailor-plan-comment", "tailor-plan/tailor-plan-fail");
|
|
2764
|
+
generatedIds.push("tailor-deploy", "tailor-deploy/tailor-checkout", ...setupIds("tailor-deploy", packageManager), "tailor-deploy/tailor-validate-workspace", "tailor-deploy/tailor-mask-credentials", "tailor-deploy/tailor-login", "tailor-deploy/tailor-generate", "tailor-deploy/tailor-deploy");
|
|
2823
2765
|
return {
|
|
2824
2766
|
content: out,
|
|
2825
2767
|
generatedIds
|
|
@@ -2844,7 +2786,7 @@ function renderTagWorkflow(params) {
|
|
|
2844
2786
|
if (hasGuard) out = out.replaceAll("__BRANCH__", () => branch);
|
|
2845
2787
|
const generatedIds = [];
|
|
2846
2788
|
if (hasGuard) generatedIds.push("tailor-tag-guard", "tailor-tag-guard/tailor-checkout", "tailor-tag-guard/tailor-tag-guard");
|
|
2847
|
-
generatedIds.push("tailor-plan", "tailor-plan/tailor-checkout", ...setupIds("tailor-plan", packageManager), "tailor-plan/tailor-generate", "tailor-plan/tailor-generate-check", "tailor-plan/tailor-plan", "tailor-deploy", "tailor-deploy/tailor-checkout", ...setupIds("tailor-deploy", packageManager), "tailor-deploy/tailor-
|
|
2789
|
+
generatedIds.push("tailor-plan", "tailor-plan/tailor-checkout", ...setupIds("tailor-plan", packageManager), "tailor-plan/tailor-generate", "tailor-plan/tailor-generate-check", "tailor-plan/tailor-mask-credentials", "tailor-plan/tailor-login", "tailor-plan/tailor-plan", "tailor-plan/tailor-plan-summary", "tailor-plan/tailor-plan-fail", "tailor-deploy", "tailor-deploy/tailor-checkout", ...setupIds("tailor-deploy", packageManager), "tailor-deploy/tailor-validate-workspace", "tailor-deploy/tailor-mask-credentials", "tailor-deploy/tailor-login", "tailor-deploy/tailor-generate", "tailor-deploy/tailor-deploy");
|
|
2848
2790
|
return {
|
|
2849
2791
|
content: out,
|
|
2850
2792
|
generatedIds
|
|
@@ -3067,7 +3009,7 @@ async function setupGitHub(options) {
|
|
|
3067
3009
|
kind: resolved.kind,
|
|
3068
3010
|
workspaceName: resolved.workspaceName,
|
|
3069
3011
|
file: resolved.file,
|
|
3070
|
-
templateVersion:
|
|
3012
|
+
templateVersion: 2,
|
|
3071
3013
|
inputs: resolved.inputs,
|
|
3072
3014
|
generatedIds: resolved.render.generatedIds,
|
|
3073
3015
|
ejectedIds: existing?.ejectedIds ?? [],
|
|
@@ -4807,7 +4749,7 @@ async function fetchRemoteTypes(client, workspaceId, namespace) {
|
|
|
4807
4749
|
async function assertMigrationsReproduceLocalTypes(loaded, target) {
|
|
4808
4750
|
const { config, plugins } = loaded;
|
|
4809
4751
|
const pluginManager = plugins.length > 0 ? new PluginManager(plugins) : void 0;
|
|
4810
|
-
const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-
|
|
4752
|
+
const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-DB2r36Et.mjs");
|
|
4811
4753
|
const application = defineApplication({
|
|
4812
4754
|
config,
|
|
4813
4755
|
pluginManager
|
|
@@ -4819,7 +4761,7 @@ async function assertMigrationsReproduceLocalTypes(loaded, target) {
|
|
|
4819
4761
|
await service.processNamespacePlugins();
|
|
4820
4762
|
}
|
|
4821
4763
|
const pluginExecutorFiles = generatePluginFilesIfNeeded(pluginManager, application.tailorDBServices, config.path);
|
|
4822
|
-
const executorService = application.executorService ?? (pluginExecutorFiles.length > 0 ? (await import("../service-
|
|
4764
|
+
const executorService = application.executorService ?? (pluginExecutorFiles.length > 0 ? (await import("../service-D6yonf2I.mjs")).createExecutorService({ config: { files: [] } }) : void 0);
|
|
4823
4765
|
await executorService?.loadExecutors();
|
|
4824
4766
|
if (pluginExecutorFiles.length > 0) await executorService?.loadPluginExecutorFiles([...pluginExecutorFiles]);
|
|
4825
4767
|
const executorUsedTypes = /* @__PURE__ */ new Set();
|
|
@@ -5094,9 +5036,9 @@ const upgradeCommand = defineAppCommand({
|
|
|
5094
5036
|
})
|
|
5095
5037
|
}).strict(),
|
|
5096
5038
|
run: async (args) => {
|
|
5097
|
-
const { initTelemetry } = await import("../telemetry-
|
|
5039
|
+
const { initTelemetry } = await import("../telemetry-ClwW5ohF.mjs");
|
|
5098
5040
|
await initTelemetry();
|
|
5099
|
-
const { upgrade } = await import("../service-
|
|
5041
|
+
const { upgrade } = await import("../service-DU1mVzri.mjs");
|
|
5100
5042
|
await upgrade({
|
|
5101
5043
|
from: args.from,
|
|
5102
5044
|
dryRun: args["dry-run"],
|
|
@@ -5237,7 +5179,8 @@ const createCommand = defineAppCommand({
|
|
|
5237
5179
|
No user logged in.
|
|
5238
5180
|
Please login first using 'tailor-sdk login' command.
|
|
5239
5181
|
`);
|
|
5240
|
-
const
|
|
5182
|
+
const { accessToken: token } = await fetchLatestToken(config, config.current_user);
|
|
5183
|
+
const client = await initOperatorClient(token);
|
|
5241
5184
|
const scopes = getScopesFromWriteFlag(args.write);
|
|
5242
5185
|
const result = await client.createPersonalAccessToken({
|
|
5243
5186
|
name: args.name,
|
|
@@ -5264,7 +5207,8 @@ const deleteCommand = defineAppCommand({
|
|
|
5264
5207
|
No user logged in.
|
|
5265
5208
|
Please login first using 'tailor-sdk login' command.
|
|
5266
5209
|
`);
|
|
5267
|
-
|
|
5210
|
+
const { accessToken: token } = await fetchLatestToken(config, config.current_user);
|
|
5211
|
+
await (await initOperatorClient(token)).deletePersonalAccessToken({ name: args.name });
|
|
5268
5212
|
logger.success(`Personal access token "${args.name}" deleted successfully.`);
|
|
5269
5213
|
}
|
|
5270
5214
|
});
|
|
@@ -5282,7 +5226,8 @@ const listCommand = defineAppCommand({
|
|
|
5282
5226
|
No user logged in.
|
|
5283
5227
|
Please login first using 'tailor-sdk login' command.
|
|
5284
5228
|
`);
|
|
5285
|
-
const
|
|
5229
|
+
const { accessToken: token } = await fetchLatestToken(config, config.current_user);
|
|
5230
|
+
const client = await initOperatorClient(token);
|
|
5286
5231
|
const pageDirection = toPageDirection(args.order);
|
|
5287
5232
|
const pats = await fetchPaged(async (pageToken, pageSize) => {
|
|
5288
5233
|
const { personalAccessTokens, nextPageToken } = await client.listPersonalAccessTokens({
|
|
@@ -5335,7 +5280,8 @@ const updateCommand = defineAppCommand({
|
|
|
5335
5280
|
No user logged in.
|
|
5336
5281
|
Please login first using 'tailor-sdk login' command.
|
|
5337
5282
|
`);
|
|
5338
|
-
const
|
|
5283
|
+
const { accessToken: token } = await fetchLatestToken(config, config.current_user);
|
|
5284
|
+
const client = await initOperatorClient(token);
|
|
5339
5285
|
await client.deletePersonalAccessToken({ name: args.name });
|
|
5340
5286
|
const scopes = getScopesFromWriteFlag(args.write);
|
|
5341
5287
|
const result = await client.createPersonalAccessToken({
|
|
@@ -5370,15 +5316,16 @@ const switchCommand = defineAppCommand({
|
|
|
5370
5316
|
description: "Set current user.",
|
|
5371
5317
|
args: z.object({ user: arg(z.string(), {
|
|
5372
5318
|
positional: true,
|
|
5373
|
-
description: "User email"
|
|
5319
|
+
description: "User email address or machine user client ID"
|
|
5374
5320
|
}) }).strict(),
|
|
5375
5321
|
run: async (args) => {
|
|
5376
5322
|
const config = await readPlatformConfig();
|
|
5377
|
-
|
|
5323
|
+
const user = findConfigUserKey(config, args.user);
|
|
5324
|
+
if (!user) throw new Error(multiline`
|
|
5378
5325
|
User "${args.user}" not found.
|
|
5379
5326
|
Please login first using 'tailor-sdk login' command to register this user.
|
|
5380
5327
|
`);
|
|
5381
|
-
config.current_user =
|
|
5328
|
+
config.current_user = user;
|
|
5382
5329
|
writePlatformConfig(config);
|
|
5383
5330
|
logger.success(`Current user set to "${args.user}" successfully.`);
|
|
5384
5331
|
}
|
|
@@ -5522,11 +5469,11 @@ runMain(mainCommand, {
|
|
|
5522
5469
|
if (isVerbose() && error.stack) logger.debug(`\nStack trace:\n${error.stack}`);
|
|
5523
5470
|
} else logger.error(`Unknown error: ${error}`);
|
|
5524
5471
|
if (!isCLIError(error) && (!(error instanceof Error) || error instanceof TypeError || error instanceof RangeError)) {
|
|
5525
|
-
const { reportCrash } = await import("../crashreport-
|
|
5472
|
+
const { reportCrash } = await import("../crashreport-pr6Rhvza.mjs");
|
|
5526
5473
|
await reportCrash(error, "handledError");
|
|
5527
5474
|
}
|
|
5528
5475
|
}
|
|
5529
|
-
const { shutdownTelemetry } = await import("../telemetry-
|
|
5476
|
+
const { shutdownTelemetry } = await import("../telemetry-ClwW5ohF.mjs");
|
|
5530
5477
|
await shutdownTelemetry();
|
|
5531
5478
|
}
|
|
5532
5479
|
});
|