@tailor-platform/sdk 0.16.3 → 0.18.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 +29 -0
- package/README.md +75 -8
- package/dist/cli/api.d.mts +35 -31
- package/dist/cli/api.mjs +2 -2
- package/dist/cli/api.mjs.map +1 -1
- package/dist/cli/index.mjs +51 -75
- package/dist/cli/index.mjs.map +1 -1
- package/dist/configure/index.d.mts +3 -3
- package/dist/{index-Bin7-j3v.d.mts → index-BWqIQ4iC.d.mts} +2 -2
- package/dist/job-CL8myeqs.mjs.map +1 -1
- package/dist/{resume-kyHIaNvK.mjs → resume-ChDChtAZ.mjs} +200 -137
- package/dist/{resume-kyHIaNvK.mjs.map → resume-ChDChtAZ.mjs.map} +1 -1
- package/dist/{types-Da_WnvA0.d.mts → types-DgaCdTug.d.mts} +21 -13
- package/dist/utils/test/index.d.mts +9 -3
- package/dist/utils/test/index.mjs +8 -6
- package/dist/utils/test/index.mjs.map +1 -1
- package/docs/cli/application.md +136 -0
- package/docs/cli/auth.md +110 -0
- package/docs/cli/secret.md +125 -0
- package/docs/cli/user.md +183 -0
- package/docs/cli/workflow.md +144 -0
- package/docs/cli/workspace.md +122 -0
- package/docs/cli-reference.md +80 -801
- package/docs/configuration.md +62 -32
- package/docs/generator/builtin.md +194 -0
- package/docs/generator/custom.md +150 -0
- package/docs/generator/index.md +56 -0
- package/docs/quickstart.md +9 -4
- package/docs/services/auth.md +244 -0
- package/docs/services/executor.md +304 -0
- package/docs/services/idp.md +106 -0
- package/docs/services/resolver.md +213 -0
- package/docs/services/secret.md +116 -0
- package/docs/services/staticwebsite.md +132 -0
- package/docs/services/tailordb.md +325 -0
- package/docs/services/workflow.md +176 -0
- package/docs/testing.md +3 -1
- package/package.json +9 -8
- package/docs/core-concepts.md +0 -609
|
@@ -26,12 +26,13 @@ import { MethodOptions_IdempotencyLevel, ValueSchema, file_google_protobuf_descr
|
|
|
26
26
|
import { Code, ConnectError, createClient } from "@connectrpc/connect";
|
|
27
27
|
import { createConnectTransport } from "@connectrpc/connect-node";
|
|
28
28
|
import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv2";
|
|
29
|
-
import { table } from "table";
|
|
30
29
|
import { create, fromJson } from "@bufbuild/protobuf";
|
|
31
30
|
import chalk from "chalk";
|
|
32
31
|
import { spawn } from "node:child_process";
|
|
33
32
|
import chokidar from "chokidar";
|
|
34
33
|
import * as madgeModule from "madge";
|
|
34
|
+
import { formatDistanceToNowStrict } from "date-fns";
|
|
35
|
+
import { getBorderCharacters, table } from "table";
|
|
35
36
|
import { validate } from "uuid";
|
|
36
37
|
import ora from "ora";
|
|
37
38
|
|
|
@@ -230,7 +231,15 @@ const OAuth2ClientSchema = z.object({
|
|
|
230
231
|
z.literal("confidential"),
|
|
231
232
|
z.literal("public"),
|
|
232
233
|
z.literal("browser")
|
|
233
|
-
]).optional()
|
|
234
|
+
]).optional(),
|
|
235
|
+
accessTokenLifetimeSeconds: z.number().int().min(60, "Minimum access token lifetime is 60 seconds").max(86400, "Maximum access token lifetime is 1 day (86400 seconds)").optional().transform((val) => val ? {
|
|
236
|
+
seconds: BigInt(val),
|
|
237
|
+
nanos: 0
|
|
238
|
+
} : void 0),
|
|
239
|
+
refreshTokenLifetimeSeconds: z.number().int().min(60, "Minimum refresh token lifetime is 60 seconds").max(604800, "Maximum refresh token lifetime is 7 days (604800 seconds)").optional().transform((val) => val ? {
|
|
240
|
+
seconds: BigInt(val),
|
|
241
|
+
nanos: 0
|
|
242
|
+
} : void 0)
|
|
234
243
|
});
|
|
235
244
|
const SCIMAuthorizationSchema = z.object({
|
|
236
245
|
type: z.union([z.literal("oauth2"), z.literal("bearer")]),
|
|
@@ -534,7 +543,7 @@ var ResolverService = class {
|
|
|
534
543
|
var require_package$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/eslint/package.json": ((exports, module) => {
|
|
535
544
|
module.exports = {
|
|
536
545
|
"name": "eslint",
|
|
537
|
-
"version": "9.39.
|
|
546
|
+
"version": "9.39.2",
|
|
538
547
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
|
539
548
|
"description": "An AST-based pattern checker for JavaScript.",
|
|
540
549
|
"type": "commonjs",
|
|
@@ -630,7 +639,7 @@ var require_package$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/eslint/
|
|
|
630
639
|
"@eslint/config-helpers": "^0.4.2",
|
|
631
640
|
"@eslint/core": "^0.17.0",
|
|
632
641
|
"@eslint/eslintrc": "^3.3.1",
|
|
633
|
-
"@eslint/js": "9.39.
|
|
642
|
+
"@eslint/js": "9.39.2",
|
|
634
643
|
"@eslint/plugin-kit": "^0.4.1",
|
|
635
644
|
"@humanfs/node": "^0.16.6",
|
|
636
645
|
"@humanwhocodes/module-importer": "^1.0.1",
|
|
@@ -1064,7 +1073,7 @@ var require_browser = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src
|
|
|
1064
1073
|
/**
|
|
1065
1074
|
* This is the web browser implementation of `debug()`.
|
|
1066
1075
|
*/
|
|
1067
|
-
exports.formatArgs = formatArgs$
|
|
1076
|
+
exports.formatArgs = formatArgs$1;
|
|
1068
1077
|
exports.save = save$1;
|
|
1069
1078
|
exports.load = load$1;
|
|
1070
1079
|
exports.useColors = useColors$1;
|
|
@@ -1177,7 +1186,7 @@ var require_browser = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src
|
|
|
1177
1186
|
*
|
|
1178
1187
|
* @api public
|
|
1179
1188
|
*/
|
|
1180
|
-
function formatArgs$
|
|
1189
|
+
function formatArgs$1(args) {
|
|
1181
1190
|
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
1182
1191
|
if (!this.useColors) return;
|
|
1183
1192
|
const c = "color: " + this.color;
|
|
@@ -1349,7 +1358,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/no
|
|
|
1349
1358
|
*/
|
|
1350
1359
|
exports.init = init;
|
|
1351
1360
|
exports.log = log;
|
|
1352
|
-
exports.formatArgs = formatArgs
|
|
1361
|
+
exports.formatArgs = formatArgs;
|
|
1353
1362
|
exports.save = save;
|
|
1354
1363
|
exports.load = load;
|
|
1355
1364
|
exports.useColors = useColors;
|
|
@@ -1476,7 +1485,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/no
|
|
|
1476
1485
|
*
|
|
1477
1486
|
* @api public
|
|
1478
1487
|
*/
|
|
1479
|
-
function formatArgs
|
|
1488
|
+
function formatArgs(args) {
|
|
1480
1489
|
const { namespace: name$2, useColors: useColors$2 } = this;
|
|
1481
1490
|
if (useColors$2) {
|
|
1482
1491
|
const c = this.color;
|
|
@@ -79561,6 +79570,15 @@ var require_warning_service = /* @__PURE__ */ __commonJS({ "../../node_modules/e
|
|
|
79561
79570
|
emitPoorConcurrencyWarning(notice) {
|
|
79562
79571
|
this.emitWarning(`You may ${notice} to improve performance.`, "ESLintPoorConcurrencyWarning");
|
|
79563
79572
|
}
|
|
79573
|
+
/**
|
|
79574
|
+
* Emits a warning when eslint-env configuration comments are found.
|
|
79575
|
+
* @param {string} filename The name of the file being linted.
|
|
79576
|
+
* @param {number} line The line number of the comment.
|
|
79577
|
+
* @returns {void}
|
|
79578
|
+
*/
|
|
79579
|
+
emitESLintEnvWarning(filename, line) {
|
|
79580
|
+
this.emitWarning(`/* eslint-env */ comments are no longer recognized when linting with flat config and will be reported as errors as of v10.0.0. Replace them with /* global */ comments or define globals in your config file. See https://eslint.org/docs/latest/use/configure/migration-guide#eslint-env-configuration-comments for details. Found in ${filename} at line ${line}.`, "ESLintEnvWarning");
|
|
79581
|
+
}
|
|
79564
79582
|
};
|
|
79565
79583
|
module.exports = { WarningService: WarningService$3 };
|
|
79566
79584
|
}) });
|
|
@@ -82868,6 +82886,10 @@ var require_linter$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/eslint/l
|
|
|
82868
82886
|
});
|
|
82869
82887
|
});
|
|
82870
82888
|
} else {
|
|
82889
|
+
if (config.language === jslang$1) for (const comment of sourceCode.getInlineConfigNodes()) {
|
|
82890
|
+
const { label } = commentParser.parseDirective(comment.value);
|
|
82891
|
+
if (label === "eslint-env") slots.warningService.emitESLintEnvWarning(options.filename, comment.loc.start.line);
|
|
82892
|
+
}
|
|
82871
82893
|
const inlineConfigResult = sourceCode.applyInlineConfig?.();
|
|
82872
82894
|
if (inlineConfigResult) {
|
|
82873
82895
|
inlineConfigResult.problems.forEach((problem) => {
|
|
@@ -135529,7 +135551,7 @@ var init_lib = __esm({ "../../node_modules/@eslint/eslintrc/lib/index.js": (() =
|
|
|
135529
135551
|
var require_package = /* @__PURE__ */ __commonJS({ "../../node_modules/@eslint/js/package.json": ((exports, module) => {
|
|
135530
135552
|
module.exports = {
|
|
135531
135553
|
"name": "@eslint/js",
|
|
135532
|
-
"version": "9.39.
|
|
135554
|
+
"version": "9.39.2",
|
|
135533
135555
|
"description": "ESLint JavaScript language implementation",
|
|
135534
135556
|
"funding": "https://eslint.org/donate",
|
|
135535
135557
|
"main": "./src/index.js",
|
|
@@ -143181,9 +143203,10 @@ const file_tailor_v1_secret_manager_resource = /* @__PURE__ */ fileDesc("Cid0YWl
|
|
|
143181
143203
|
/**
|
|
143182
143204
|
* Describes the file tailor/v1/auth_resource.proto.
|
|
143183
143205
|
*/
|
|
143184
|
-
const file_tailor_v1_auth_resource = /* @__PURE__ */ fileDesc("
|
|
143206
|
+
const file_tailor_v1_auth_resource = /* @__PURE__ */ fileDesc("Ch10YWlsb3IvdjEvYXV0aF9yZXNvdXJjZS5wcm90bxIJdGFpbG9yLnYxIjYKC0F1dGhTZXJ2aWNlEicKCW5hbWVzcGFjZRgBIAEoCzIULnRhaWxvci52MS5OYW1lc3BhY2UitAYKDUF1dGhJRFBDb25maWcSNgoEbmFtZRgBIAEoCUIoukglciMyIV5bYS16MC05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V0aDJDbGllbnQuQ2xpZW50VHlwZUINukgK2AEBggEEEAEgABJKChVhY2Nlc3NfdG9rZW5fbGlmZXRpbWUYCSABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25CELpIDaoBCiIECICjBTICCDwSSwoWcmVmcmVzaF90b2tlbl9saWZldGltZRgKIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbkIQukgNqgEKIgQIgPUkMgIIPCJoCglHcmFudFR5cGUSGgoWR1JBTlRfVFlQRV9VTlNQRUNJRklFRBAAEiEKHUdSQU5UX1RZUEVfQVVUSE9SSVpBVElPTl9DT0RFEAESHAoYR1JBTlRfVFlQRV9SRUZSRVNIX1RPS0VOEAIieAoKQ2xpZW50VHlwZRIbChdDTElFTlRfVFlQRV9VTlNQRUNJRklFRBAAEhwKGENMSUVOVF9UWVBFX0NPTkZJREVOVElBTBABEhYKEkNMSUVOVF9UWVBFX1BVQkxJQxACEhcKE0NMSUVOVF9UWVBFX0JST1dTRVIQAypOCghQQVRTY29wZRIZChVQQVRfU0NPUEVfVU5TUEVDSUZJRUQQABISCg5QQVRfU0NPUEVfUkVBRBABEhMKD1BBVF9TQ09QRV9XUklURRACYgZwcm90bzM", [
|
|
143185
143207
|
file_buf_validate_validate,
|
|
143186
143208
|
file_google_api_field_behavior,
|
|
143209
|
+
file_google_protobuf_duration,
|
|
143187
143210
|
file_google_protobuf_struct,
|
|
143188
143211
|
file_google_protobuf_timestamp,
|
|
143189
143212
|
file_tailor_v1_resource,
|
|
@@ -144265,7 +144288,7 @@ var TypeProcessor = class {
|
|
|
144265
144288
|
const isArray$4 = fieldConfig.array === true;
|
|
144266
144289
|
const isNullable = fieldConfig.required !== true;
|
|
144267
144290
|
let finalType = baseTypeResult.type;
|
|
144268
|
-
if (isArray$4) finalType = `${baseTypeResult.type}[]`;
|
|
144291
|
+
if (isArray$4) finalType = fieldConfig.type === "enum" ? `(${baseTypeResult.type})[]` : `${baseTypeResult.type}[]`;
|
|
144269
144292
|
if (isNullable) finalType = `${finalType} | null`;
|
|
144270
144293
|
if (fieldConfig.serial) {
|
|
144271
144294
|
usedUtilityTypes.Serial = true;
|
|
@@ -144648,25 +144671,28 @@ const SeedGeneratorID = "@tailor-platform/seed";
|
|
|
144648
144671
|
/**
|
|
144649
144672
|
* Generates the exec.mjs script content (Node.js executable)
|
|
144650
144673
|
*/
|
|
144651
|
-
function generateExecScript(machineUserName,
|
|
144674
|
+
function generateExecScript(machineUserName, relativeConfigPath) {
|
|
144652
144675
|
return ml`
|
|
144653
144676
|
import { execSync } from "node:child_process";
|
|
144654
|
-
import {
|
|
144677
|
+
import { join } from "node:path";
|
|
144678
|
+
import { show, getMachineUserToken } from "@tailor-platform/sdk/cli";
|
|
144679
|
+
|
|
144680
|
+
const configDir = import.meta.dirname;
|
|
144681
|
+
const configPath = join(configDir, "${relativeConfigPath}");
|
|
144655
144682
|
|
|
144656
144683
|
console.log("Starting seed data generation...");
|
|
144657
144684
|
|
|
144658
|
-
const appInfo = await show();
|
|
144685
|
+
const appInfo = await show({ configPath });
|
|
144659
144686
|
const endpoint = \`\${appInfo.url}/query\`;
|
|
144660
144687
|
|
|
144661
|
-
const tokenInfo = await
|
|
144688
|
+
const tokenInfo = await getMachineUserToken({ name: "${machineUserName}", configPath });
|
|
144662
144689
|
const headers = JSON.stringify({ Authorization: \`Bearer \${tokenInfo.accessToken}\` });
|
|
144663
144690
|
|
|
144664
|
-
// Build command with platform-specific quoting
|
|
144665
144691
|
const headersArg = process.platform === "win32"
|
|
144666
|
-
? \`"\${headers.replace(/"/g, '\\\\"')}"\`
|
|
144667
|
-
: \`'\${headers}'\`;
|
|
144692
|
+
? \`"\${headers.replace(/"/g, '\\\\"')}"\`
|
|
144693
|
+
: \`'\${headers}'\`;
|
|
144668
144694
|
|
|
144669
|
-
const cmd = \`npx gql-ingest -c
|
|
144695
|
+
const cmd = \`npx gql-ingest -c "\${configDir}" -e "\${endpoint}" --headers \${headersArg}\`;
|
|
144670
144696
|
console.log("Running:", cmd);
|
|
144671
144697
|
|
|
144672
144698
|
try {
|
|
@@ -144693,7 +144719,7 @@ function createSeedGenerator(options) {
|
|
|
144693
144719
|
processTailorDBNamespace: ({ types: types$2 }) => types$2,
|
|
144694
144720
|
processExecutor: (_executor) => void 0,
|
|
144695
144721
|
processResolver: (_args) => void 0,
|
|
144696
|
-
aggregate: ({ input }) => {
|
|
144722
|
+
aggregate: ({ input, configPath }) => {
|
|
144697
144723
|
const entityDependencies = {};
|
|
144698
144724
|
const files = [];
|
|
144699
144725
|
for (const nsResult of input.tailordb) {
|
|
@@ -144755,10 +144781,13 @@ function createSeedGenerator(options) {
|
|
|
144755
144781
|
${Object.entries(dependencies).map(([type, deps]) => `${type}: [${deps.join(", ")}]`).join("\n ")}
|
|
144756
144782
|
`
|
|
144757
144783
|
});
|
|
144758
|
-
if (options.machineUserName)
|
|
144759
|
-
|
|
144760
|
-
|
|
144761
|
-
|
|
144784
|
+
if (options.machineUserName) {
|
|
144785
|
+
const relativeConfigPath = path$1.relative(outputDir, configPath).replaceAll("\\", "/");
|
|
144786
|
+
files.push({
|
|
144787
|
+
path: path$1.join(outputDir, "exec.mjs"),
|
|
144788
|
+
content: generateExecScript(options.machineUserName, relativeConfigPath)
|
|
144789
|
+
});
|
|
144790
|
+
}
|
|
144762
144791
|
}
|
|
144763
144792
|
return { files };
|
|
144764
144793
|
}
|
|
@@ -144952,36 +144981,11 @@ const withCommonArgs = (handler) => async ({ args }) => {
|
|
|
144952
144981
|
}
|
|
144953
144982
|
process.exit(0);
|
|
144954
144983
|
};
|
|
144955
|
-
const
|
|
144956
|
-
|
|
144957
|
-
|
|
144958
|
-
|
|
144959
|
-
alias: "f",
|
|
144960
|
-
default: "table"
|
|
144984
|
+
const jsonArgs = { json: {
|
|
144985
|
+
type: "boolean",
|
|
144986
|
+
description: "Output as JSON",
|
|
144987
|
+
default: false
|
|
144961
144988
|
} };
|
|
144962
|
-
function parseFormat(format$2) {
|
|
144963
|
-
const parsed = formatSchema.safeParse(format$2);
|
|
144964
|
-
if (!parsed.success) throw new Error(`Format "${format$2}" is invalid. Must be one of: ${formatSchema.options.join(", ")}`);
|
|
144965
|
-
return parsed.data;
|
|
144966
|
-
}
|
|
144967
|
-
function printWithFormat(data$1, format$2) {
|
|
144968
|
-
switch (format$2) {
|
|
144969
|
-
case "table":
|
|
144970
|
-
if (Array.isArray(data$1)) data$1.forEach((item) => {
|
|
144971
|
-
const t = table(Object.entries(item), { singleLine: true });
|
|
144972
|
-
process.stdout.write(t);
|
|
144973
|
-
});
|
|
144974
|
-
else {
|
|
144975
|
-
const t = table(Object.entries(data$1), { singleLine: true });
|
|
144976
|
-
process.stdout.write(t);
|
|
144977
|
-
}
|
|
144978
|
-
break;
|
|
144979
|
-
case "json":
|
|
144980
|
-
console.log(JSON.stringify(data$1));
|
|
144981
|
-
break;
|
|
144982
|
-
default: throw new Error(`Format "${format$2}" is invalid.`);
|
|
144983
|
-
}
|
|
144984
|
-
}
|
|
144985
144989
|
|
|
144986
144990
|
//#endregion
|
|
144987
144991
|
//#region src/cli/apply/services/label.ts
|
|
@@ -146004,22 +146008,25 @@ async function planOAuth2Clients(client, workspaceId, auths, deletedServices) {
|
|
|
146004
146008
|
return changeSet;
|
|
146005
146009
|
}
|
|
146006
146010
|
function protoOAuth2Client(oauth2ClientName, oauth2Client) {
|
|
146011
|
+
const parsed = OAuth2ClientSchema.parse(oauth2Client);
|
|
146007
146012
|
return {
|
|
146008
146013
|
name: oauth2ClientName,
|
|
146009
|
-
description:
|
|
146010
|
-
grantTypes:
|
|
146014
|
+
description: parsed.description,
|
|
146015
|
+
grantTypes: parsed.grantTypes?.map((grantType) => {
|
|
146011
146016
|
switch (grantType) {
|
|
146012
146017
|
case "authorization_code": return AuthOAuth2Client_GrantType.AUTHORIZATION_CODE;
|
|
146013
146018
|
case "refresh_token": return AuthOAuth2Client_GrantType.REFRESH_TOKEN;
|
|
146014
146019
|
default: throw new Error(`Unknown OAuth2 client grant type: ${grantType}`);
|
|
146015
146020
|
}
|
|
146016
146021
|
}),
|
|
146017
|
-
redirectUris:
|
|
146022
|
+
redirectUris: parsed.redirectURIs,
|
|
146018
146023
|
clientType: {
|
|
146019
146024
|
confidential: AuthOAuth2Client_ClientType.CONFIDENTIAL,
|
|
146020
146025
|
public: AuthOAuth2Client_ClientType.PUBLIC,
|
|
146021
146026
|
browser: AuthOAuth2Client_ClientType.BROWSER
|
|
146022
|
-
}[
|
|
146027
|
+
}[parsed.clientType ?? "confidential"],
|
|
146028
|
+
accessTokenLifetime: parsed.accessTokenLifetimeSeconds,
|
|
146029
|
+
refreshTokenLifetime: parsed.refreshTokenLifetimeSeconds
|
|
146023
146030
|
};
|
|
146024
146031
|
}
|
|
146025
146032
|
async function planSCIMConfigs(client, workspaceId, auths, deletedServices) {
|
|
@@ -148427,7 +148434,8 @@ var GenerationManager = class {
|
|
|
148427
148434
|
const result = await gen.aggregate({
|
|
148428
148435
|
input,
|
|
148429
148436
|
executorInputs: Object.values(results.executorResults),
|
|
148430
|
-
baseDir: path$1.join(this.baseDir, gen.id)
|
|
148437
|
+
baseDir: path$1.join(this.baseDir, gen.id),
|
|
148438
|
+
configPath: this.configPath ?? "tailor.config.ts"
|
|
148431
148439
|
});
|
|
148432
148440
|
await Promise.all(result.files.map(async (file) => {
|
|
148433
148441
|
fs$1.mkdirSync(path$1.dirname(file.path), { recursive: true });
|
|
@@ -148540,6 +148548,43 @@ const generateCommand = defineCommand({
|
|
|
148540
148548
|
})
|
|
148541
148549
|
});
|
|
148542
148550
|
|
|
148551
|
+
//#endregion
|
|
148552
|
+
//#region src/cli/format.ts
|
|
148553
|
+
function humanizeRelativeTime(isoString) {
|
|
148554
|
+
const date$1 = new Date(isoString);
|
|
148555
|
+
if (Number.isNaN(date$1.getTime())) return isoString;
|
|
148556
|
+
return formatDistanceToNowStrict(date$1, { addSuffix: true });
|
|
148557
|
+
}
|
|
148558
|
+
function printData(data$1, json = false) {
|
|
148559
|
+
if (json) {
|
|
148560
|
+
console.log(JSON.stringify(data$1));
|
|
148561
|
+
return;
|
|
148562
|
+
}
|
|
148563
|
+
if (!Array.isArray(data$1)) {
|
|
148564
|
+
const t$1 = table(Object.entries(data$1), {
|
|
148565
|
+
singleLine: true,
|
|
148566
|
+
border: getBorderCharacters("norc")
|
|
148567
|
+
});
|
|
148568
|
+
process.stdout.write(t$1);
|
|
148569
|
+
return;
|
|
148570
|
+
}
|
|
148571
|
+
if (data$1.length === 0) return;
|
|
148572
|
+
const headers = Array.from(new Set(data$1.flatMap((item) => Object.keys(item))));
|
|
148573
|
+
const rows = data$1.map((item) => headers.map((header) => {
|
|
148574
|
+
const value$1 = item[header];
|
|
148575
|
+
if (value$1 === null || value$1 === void 0) return "";
|
|
148576
|
+
if ((header === "createdAt" || header === "updatedAt") && typeof value$1 === "string") return humanizeRelativeTime(value$1);
|
|
148577
|
+
return String(value$1);
|
|
148578
|
+
}));
|
|
148579
|
+
const t = table([headers, ...rows], {
|
|
148580
|
+
border: getBorderCharacters("norc"),
|
|
148581
|
+
drawHorizontalLine: (lineIndex, rowCount) => {
|
|
148582
|
+
return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;
|
|
148583
|
+
}
|
|
148584
|
+
});
|
|
148585
|
+
process.stdout.write(t);
|
|
148586
|
+
}
|
|
148587
|
+
|
|
148543
148588
|
//#endregion
|
|
148544
148589
|
//#region src/cli/show.ts
|
|
148545
148590
|
function applicationInfo(app) {
|
|
@@ -148579,7 +148624,7 @@ const showCommand = defineCommand({
|
|
|
148579
148624
|
},
|
|
148580
148625
|
args: {
|
|
148581
148626
|
...commonArgs,
|
|
148582
|
-
...
|
|
148627
|
+
...jsonArgs,
|
|
148583
148628
|
"workspace-id": {
|
|
148584
148629
|
type: "string",
|
|
148585
148630
|
description: "Workspace ID",
|
|
@@ -148598,13 +148643,12 @@ const showCommand = defineCommand({
|
|
|
148598
148643
|
}
|
|
148599
148644
|
},
|
|
148600
148645
|
run: withCommonArgs(async (args) => {
|
|
148601
|
-
const format$2 = parseFormat(args.format);
|
|
148602
148646
|
const appInfo = await show({
|
|
148603
148647
|
workspaceId: args["workspace-id"],
|
|
148604
148648
|
profile: args.profile,
|
|
148605
148649
|
configPath: args.config
|
|
148606
148650
|
});
|
|
148607
|
-
|
|
148651
|
+
printData(appInfo, args.json);
|
|
148608
148652
|
})
|
|
148609
148653
|
});
|
|
148610
148654
|
|
|
@@ -148733,7 +148777,7 @@ const validateRegion = async (region, client) => {
|
|
|
148733
148777
|
const availableRegions = await client.listAvailableWorkspaceRegions({});
|
|
148734
148778
|
if (!availableRegions.regions.includes(region)) throw new Error(`Region must be one of: ${availableRegions.regions.join(", ")}.`);
|
|
148735
148779
|
};
|
|
148736
|
-
async function
|
|
148780
|
+
async function createWorkspace(options) {
|
|
148737
148781
|
const accessToken = await loadAccessToken();
|
|
148738
148782
|
const client = await initOperatorClient(accessToken);
|
|
148739
148783
|
validateName(options.name);
|
|
@@ -148757,7 +148801,7 @@ const createCommand = defineCommand({
|
|
|
148757
148801
|
},
|
|
148758
148802
|
args: {
|
|
148759
148803
|
...commonArgs,
|
|
148760
|
-
...
|
|
148804
|
+
...jsonArgs,
|
|
148761
148805
|
name: {
|
|
148762
148806
|
type: "string",
|
|
148763
148807
|
description: "Workspace name",
|
|
@@ -148788,28 +148832,43 @@ const createCommand = defineCommand({
|
|
|
148788
148832
|
}
|
|
148789
148833
|
},
|
|
148790
148834
|
run: withCommonArgs(async (args) => {
|
|
148791
|
-
const
|
|
148792
|
-
const workspace = await workspaceCreate({
|
|
148835
|
+
const workspace = await createWorkspace({
|
|
148793
148836
|
name: args.name,
|
|
148794
148837
|
region: args.region,
|
|
148795
148838
|
deleteProtection: args["delete-protection"],
|
|
148796
148839
|
organizationId: args["organization-id"],
|
|
148797
148840
|
folderId: args["folder-id"]
|
|
148798
148841
|
});
|
|
148799
|
-
if (
|
|
148800
|
-
|
|
148842
|
+
if (!args.json) consola$1.success(`Workspace "${args.name}" created successfully.`);
|
|
148843
|
+
printData(workspace, args.json);
|
|
148801
148844
|
})
|
|
148802
148845
|
});
|
|
148803
148846
|
|
|
148804
148847
|
//#endregion
|
|
148805
148848
|
//#region src/cli/workspace/list.ts
|
|
148806
|
-
|
|
148849
|
+
const limitSchema = z.coerce.number().int().positive().optional();
|
|
148850
|
+
async function listWorkspaces(options) {
|
|
148851
|
+
const limit = options?.limit;
|
|
148852
|
+
const hasLimit = limit !== void 0;
|
|
148807
148853
|
const accessToken = await loadAccessToken();
|
|
148808
148854
|
const client = await initOperatorClient(accessToken);
|
|
148809
|
-
|
|
148810
|
-
|
|
148811
|
-
|
|
148812
|
-
|
|
148855
|
+
const results = [];
|
|
148856
|
+
let pageToken = "";
|
|
148857
|
+
while (true) {
|
|
148858
|
+
if (hasLimit && results.length >= limit) break;
|
|
148859
|
+
const remaining = hasLimit ? limit - results.length : void 0;
|
|
148860
|
+
const pageSize = remaining !== void 0 && remaining > 0 ? remaining : void 0;
|
|
148861
|
+
const { workspaces, nextPageToken } = await client.listWorkspaces({
|
|
148862
|
+
pageToken,
|
|
148863
|
+
...pageSize !== void 0 ? { pageSize } : {}
|
|
148864
|
+
});
|
|
148865
|
+
const mapped = workspaces.map(workspaceInfo);
|
|
148866
|
+
if (remaining !== void 0 && mapped.length > remaining) results.push(...mapped.slice(0, remaining));
|
|
148867
|
+
else results.push(...mapped);
|
|
148868
|
+
if (!nextPageToken) break;
|
|
148869
|
+
pageToken = nextPageToken;
|
|
148870
|
+
}
|
|
148871
|
+
return results;
|
|
148813
148872
|
}
|
|
148814
148873
|
const listCommand$3 = defineCommand({
|
|
148815
148874
|
meta: {
|
|
@@ -148818,12 +148877,25 @@ const listCommand$3 = defineCommand({
|
|
|
148818
148877
|
},
|
|
148819
148878
|
args: {
|
|
148820
148879
|
...commonArgs,
|
|
148821
|
-
...
|
|
148880
|
+
...jsonArgs,
|
|
148881
|
+
limit: {
|
|
148882
|
+
type: "string",
|
|
148883
|
+
description: "Maximum number of workspaces to list"
|
|
148884
|
+
}
|
|
148822
148885
|
},
|
|
148823
148886
|
run: withCommonArgs(async (args) => {
|
|
148824
|
-
|
|
148825
|
-
|
|
148826
|
-
|
|
148887
|
+
let limit;
|
|
148888
|
+
try {
|
|
148889
|
+
limit = limitSchema.parse(args.limit);
|
|
148890
|
+
} catch {
|
|
148891
|
+
throw new Error(`--limit must be a positive integer, got '${args.limit}'`);
|
|
148892
|
+
}
|
|
148893
|
+
const workspaces = await listWorkspaces({ limit });
|
|
148894
|
+
const formattedWorkspaces = args.json ? workspaces : workspaces.map(({ updatedAt: _, createdAt,...rest }) => ({
|
|
148895
|
+
...rest,
|
|
148896
|
+
createdAt: humanizeRelativeTime(createdAt)
|
|
148897
|
+
}));
|
|
148898
|
+
printData(formattedWorkspaces, args.json);
|
|
148827
148899
|
})
|
|
148828
148900
|
});
|
|
148829
148901
|
|
|
@@ -148838,7 +148910,7 @@ async function loadOptions(options) {
|
|
|
148838
148910
|
workspaceId: options.workspaceId
|
|
148839
148911
|
};
|
|
148840
148912
|
}
|
|
148841
|
-
async function
|
|
148913
|
+
async function deleteWorkspace(options) {
|
|
148842
148914
|
const { client, workspaceId } = await loadOptions(options);
|
|
148843
148915
|
await client.deleteWorkspace({ workspaceId });
|
|
148844
148916
|
}
|
|
@@ -148892,7 +148964,7 @@ function machineUserInfo(user) {
|
|
|
148892
148964
|
updatedAt: user.updatedAt ? timestampDate(user.updatedAt).toISOString() : "N/A"
|
|
148893
148965
|
};
|
|
148894
148966
|
}
|
|
148895
|
-
async function
|
|
148967
|
+
async function listMachineUsers(options) {
|
|
148896
148968
|
const accessToken = await loadAccessToken({
|
|
148897
148969
|
useProfile: true,
|
|
148898
148970
|
profile: options?.profile
|
|
@@ -148924,7 +148996,7 @@ const listCommand$2 = defineCommand({
|
|
|
148924
148996
|
},
|
|
148925
148997
|
args: {
|
|
148926
148998
|
...commonArgs,
|
|
148927
|
-
...
|
|
148999
|
+
...jsonArgs,
|
|
148928
149000
|
"workspace-id": {
|
|
148929
149001
|
type: "string",
|
|
148930
149002
|
description: "Workspace ID",
|
|
@@ -148943,19 +149015,18 @@ const listCommand$2 = defineCommand({
|
|
|
148943
149015
|
}
|
|
148944
149016
|
},
|
|
148945
149017
|
run: withCommonArgs(async (args) => {
|
|
148946
|
-
const
|
|
148947
|
-
const machineUsers = await machineUserList({
|
|
149018
|
+
const machineUsers = await listMachineUsers({
|
|
148948
149019
|
workspaceId: args["workspace-id"],
|
|
148949
149020
|
profile: args.profile,
|
|
148950
149021
|
configPath: args.config
|
|
148951
149022
|
});
|
|
148952
|
-
|
|
149023
|
+
printData(machineUsers, args.json);
|
|
148953
149024
|
})
|
|
148954
149025
|
});
|
|
148955
149026
|
|
|
148956
149027
|
//#endregion
|
|
148957
149028
|
//#region src/cli/machineuser/token.ts
|
|
148958
|
-
async function
|
|
149029
|
+
async function getMachineUserToken(options) {
|
|
148959
149030
|
const accessToken = await loadAccessToken({
|
|
148960
149031
|
useProfile: true,
|
|
148961
149032
|
profile: options.profile
|
|
@@ -148993,7 +149064,7 @@ const tokenCommand = defineCommand({
|
|
|
148993
149064
|
},
|
|
148994
149065
|
args: {
|
|
148995
149066
|
...commonArgs,
|
|
148996
|
-
...
|
|
149067
|
+
...jsonArgs,
|
|
148997
149068
|
"workspace-id": {
|
|
148998
149069
|
type: "string",
|
|
148999
149070
|
description: "Workspace ID",
|
|
@@ -149017,8 +149088,7 @@ const tokenCommand = defineCommand({
|
|
|
149017
149088
|
}
|
|
149018
149089
|
},
|
|
149019
149090
|
run: withCommonArgs(async (args) => {
|
|
149020
|
-
const
|
|
149021
|
-
const token = await machineUserToken({
|
|
149091
|
+
const token = await getMachineUserToken({
|
|
149022
149092
|
name: args.name,
|
|
149023
149093
|
workspaceId: args["workspace-id"],
|
|
149024
149094
|
profile: args.profile,
|
|
@@ -149029,7 +149099,7 @@ const tokenCommand = defineCommand({
|
|
|
149029
149099
|
token_type: token.tokenType,
|
|
149030
149100
|
expires_at: token.expiresAt
|
|
149031
149101
|
};
|
|
149032
|
-
|
|
149102
|
+
printData(tokenInfo, args.json);
|
|
149033
149103
|
})
|
|
149034
149104
|
});
|
|
149035
149105
|
|
|
@@ -149066,7 +149136,7 @@ function toOAuth2ClientCredentials(client) {
|
|
|
149066
149136
|
|
|
149067
149137
|
//#endregion
|
|
149068
149138
|
//#region src/cli/oauth2client/get.ts
|
|
149069
|
-
async function
|
|
149139
|
+
async function getOAuth2Client(options) {
|
|
149070
149140
|
const accessToken = await loadAccessToken({
|
|
149071
149141
|
useProfile: true,
|
|
149072
149142
|
profile: options.profile
|
|
@@ -149101,7 +149171,7 @@ const getCommand$1 = defineCommand({
|
|
|
149101
149171
|
},
|
|
149102
149172
|
args: {
|
|
149103
149173
|
...commonArgs,
|
|
149104
|
-
...
|
|
149174
|
+
...jsonArgs,
|
|
149105
149175
|
name: {
|
|
149106
149176
|
type: "positional",
|
|
149107
149177
|
description: "OAuth2 client name",
|
|
@@ -149125,20 +149195,19 @@ const getCommand$1 = defineCommand({
|
|
|
149125
149195
|
}
|
|
149126
149196
|
},
|
|
149127
149197
|
run: withCommonArgs(async (args) => {
|
|
149128
|
-
const
|
|
149129
|
-
const credentials = await oauth2ClientGet({
|
|
149198
|
+
const credentials = await getOAuth2Client({
|
|
149130
149199
|
name: args.name,
|
|
149131
149200
|
workspaceId: args["workspace-id"],
|
|
149132
149201
|
profile: args.profile,
|
|
149133
149202
|
configPath: args.config
|
|
149134
149203
|
});
|
|
149135
|
-
|
|
149204
|
+
printData(credentials, args.json);
|
|
149136
149205
|
})
|
|
149137
149206
|
});
|
|
149138
149207
|
|
|
149139
149208
|
//#endregion
|
|
149140
149209
|
//#region src/cli/oauth2client/list.ts
|
|
149141
|
-
async function
|
|
149210
|
+
async function listOAuth2Clients(options) {
|
|
149142
149211
|
const accessToken = await loadAccessToken({
|
|
149143
149212
|
useProfile: true,
|
|
149144
149213
|
profile: options?.profile
|
|
@@ -149170,7 +149239,7 @@ const listCommand$1 = defineCommand({
|
|
|
149170
149239
|
},
|
|
149171
149240
|
args: {
|
|
149172
149241
|
...commonArgs,
|
|
149173
|
-
...
|
|
149242
|
+
...jsonArgs,
|
|
149174
149243
|
"workspace-id": {
|
|
149175
149244
|
type: "string",
|
|
149176
149245
|
description: "Workspace ID",
|
|
@@ -149189,13 +149258,12 @@ const listCommand$1 = defineCommand({
|
|
|
149189
149258
|
}
|
|
149190
149259
|
},
|
|
149191
149260
|
run: withCommonArgs(async (args) => {
|
|
149192
|
-
const
|
|
149193
|
-
const oauth2Clients = await oauth2ClientList({
|
|
149261
|
+
const oauth2Clients = await listOAuth2Clients({
|
|
149194
149262
|
workspaceId: args["workspace-id"],
|
|
149195
149263
|
profile: args.profile,
|
|
149196
149264
|
configPath: args.config
|
|
149197
149265
|
});
|
|
149198
|
-
|
|
149266
|
+
printData(oauth2Clients, args.json);
|
|
149199
149267
|
})
|
|
149200
149268
|
});
|
|
149201
149269
|
|
|
@@ -149263,7 +149331,7 @@ function toWorkflowExecutionInfo(execution) {
|
|
|
149263
149331
|
|
|
149264
149332
|
//#endregion
|
|
149265
149333
|
//#region src/cli/workflow/list.ts
|
|
149266
|
-
async function
|
|
149334
|
+
async function listWorkflows(options) {
|
|
149267
149335
|
const accessToken = await loadAccessToken({
|
|
149268
149336
|
useProfile: true,
|
|
149269
149337
|
profile: options?.profile
|
|
@@ -149288,7 +149356,7 @@ const listCommand = defineCommand({
|
|
|
149288
149356
|
},
|
|
149289
149357
|
args: {
|
|
149290
149358
|
...commonArgs,
|
|
149291
|
-
...
|
|
149359
|
+
...jsonArgs,
|
|
149292
149360
|
"workspace-id": {
|
|
149293
149361
|
type: "string",
|
|
149294
149362
|
description: "Workspace ID",
|
|
@@ -149301,12 +149369,11 @@ const listCommand = defineCommand({
|
|
|
149301
149369
|
}
|
|
149302
149370
|
},
|
|
149303
149371
|
run: withCommonArgs(async (args) => {
|
|
149304
|
-
const
|
|
149305
|
-
const workflows = await workflowList({
|
|
149372
|
+
const workflows = await listWorkflows({
|
|
149306
149373
|
workspaceId: args["workspace-id"],
|
|
149307
149374
|
profile: args.profile
|
|
149308
149375
|
});
|
|
149309
|
-
if (
|
|
149376
|
+
if (args.json) console.log(JSON.stringify(workflows));
|
|
149310
149377
|
else {
|
|
149311
149378
|
if (workflows.length === 0) {
|
|
149312
149379
|
console.log("No workflows found.");
|
|
@@ -149322,7 +149389,7 @@ const listCommand = defineCommand({
|
|
|
149322
149389
|
w$1.name,
|
|
149323
149390
|
w$1.mainJob,
|
|
149324
149391
|
w$1.jobFunctions.toString(),
|
|
149325
|
-
w$1.updatedAt
|
|
149392
|
+
humanizeRelativeTime(w$1.updatedAt)
|
|
149326
149393
|
]);
|
|
149327
149394
|
process.stdout.write(table([headers, ...rows]));
|
|
149328
149395
|
}
|
|
@@ -149335,7 +149402,7 @@ const UUID_REGEX$1 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{
|
|
|
149335
149402
|
function isUUID$1(value$1) {
|
|
149336
149403
|
return UUID_REGEX$1.test(value$1);
|
|
149337
149404
|
}
|
|
149338
|
-
async function
|
|
149405
|
+
async function getWorkflow(options) {
|
|
149339
149406
|
const accessToken = await loadAccessToken({
|
|
149340
149407
|
useProfile: true,
|
|
149341
149408
|
profile: options.profile
|
|
@@ -149372,7 +149439,7 @@ const getCommand = defineCommand({
|
|
|
149372
149439
|
},
|
|
149373
149440
|
args: {
|
|
149374
149441
|
...commonArgs,
|
|
149375
|
-
...
|
|
149442
|
+
...jsonArgs,
|
|
149376
149443
|
nameOrId: {
|
|
149377
149444
|
type: "positional",
|
|
149378
149445
|
description: "Workflow name or ID",
|
|
@@ -149390,13 +149457,12 @@ const getCommand = defineCommand({
|
|
|
149390
149457
|
}
|
|
149391
149458
|
},
|
|
149392
149459
|
run: withCommonArgs(async (args) => {
|
|
149393
|
-
const
|
|
149394
|
-
const workflow = await workflowGet({
|
|
149460
|
+
const workflow = await getWorkflow({
|
|
149395
149461
|
nameOrId: args.nameOrId,
|
|
149396
149462
|
workspaceId: args["workspace-id"],
|
|
149397
149463
|
profile: args.profile
|
|
149398
149464
|
});
|
|
149399
|
-
|
|
149465
|
+
printData(workflow, args.json);
|
|
149400
149466
|
})
|
|
149401
149467
|
});
|
|
149402
149468
|
|
|
@@ -149501,7 +149567,7 @@ async function resolveWorkflowId(client, workspaceId, nameOrId) {
|
|
|
149501
149567
|
if (!workflow) throw new Error(`Workflow '${nameOrId}' not found.`);
|
|
149502
149568
|
return workflow.id;
|
|
149503
149569
|
}
|
|
149504
|
-
async function
|
|
149570
|
+
async function startWorkflow(options) {
|
|
149505
149571
|
const accessToken = await loadAccessToken({
|
|
149506
149572
|
useProfile: true,
|
|
149507
149573
|
profile: options.profile
|
|
@@ -149553,7 +149619,7 @@ const startCommand = defineCommand({
|
|
|
149553
149619
|
},
|
|
149554
149620
|
args: {
|
|
149555
149621
|
...commonArgs,
|
|
149556
|
-
...
|
|
149622
|
+
...jsonArgs,
|
|
149557
149623
|
nameOrId: {
|
|
149558
149624
|
type: "positional",
|
|
149559
149625
|
description: "Workflow name or ID",
|
|
@@ -149598,9 +149664,8 @@ const startCommand = defineCommand({
|
|
|
149598
149664
|
}
|
|
149599
149665
|
},
|
|
149600
149666
|
run: withCommonArgs(async (args) => {
|
|
149601
|
-
const format$2 = parseFormat(args.format);
|
|
149602
149667
|
const interval = parseDuration(args.interval);
|
|
149603
|
-
const { executionId, wait } = await
|
|
149668
|
+
const { executionId, wait } = await startWorkflow({
|
|
149604
149669
|
nameOrId: args.nameOrId,
|
|
149605
149670
|
machineUser: args.machineuser,
|
|
149606
149671
|
arg: args.arg,
|
|
@@ -149609,11 +149674,11 @@ const startCommand = defineCommand({
|
|
|
149609
149674
|
configPath: args.config,
|
|
149610
149675
|
interval
|
|
149611
149676
|
});
|
|
149612
|
-
if (
|
|
149677
|
+
if (!args.json) consola.info(`Execution ID: ${executionId}`);
|
|
149613
149678
|
if (args.wait) {
|
|
149614
149679
|
const result = await wait();
|
|
149615
|
-
|
|
149616
|
-
} else
|
|
149680
|
+
printData(result, args.json);
|
|
149681
|
+
} else printData({ executionId }, args.json);
|
|
149617
149682
|
})
|
|
149618
149683
|
});
|
|
149619
149684
|
|
|
@@ -149646,7 +149711,7 @@ function parseStatus(status) {
|
|
|
149646
149711
|
default: throw new Error(`Invalid status: ${status}. Valid values: PENDING, PENDING_RESUME, RUNNING, SUCCESS, FAILED`);
|
|
149647
149712
|
}
|
|
149648
149713
|
}
|
|
149649
|
-
async function
|
|
149714
|
+
async function listWorkflowExecutions(options) {
|
|
149650
149715
|
const accessToken = await loadAccessToken({
|
|
149651
149716
|
useProfile: true,
|
|
149652
149717
|
profile: options?.profile
|
|
@@ -149687,7 +149752,7 @@ async function workflowExecutionsList(options) {
|
|
|
149687
149752
|
return [executions, nextPageToken];
|
|
149688
149753
|
})).map(toWorkflowExecutionInfo);
|
|
149689
149754
|
}
|
|
149690
|
-
async function
|
|
149755
|
+
async function getWorkflowExecution(options) {
|
|
149691
149756
|
const accessToken = await loadAccessToken({
|
|
149692
149757
|
useProfile: true,
|
|
149693
149758
|
profile: options.profile
|
|
@@ -149766,8 +149831,8 @@ function parseDuration$1(duration) {
|
|
|
149766
149831
|
default: throw new Error(`Unknown duration unit: ${unit}`);
|
|
149767
149832
|
}
|
|
149768
149833
|
}
|
|
149769
|
-
async function waitWithSpinner(waitFn, interval,
|
|
149770
|
-
const spinner =
|
|
149834
|
+
async function waitWithSpinner(waitFn, interval, json) {
|
|
149835
|
+
const spinner = !json ? ora().start("Waiting...") : null;
|
|
149771
149836
|
const updateInterval = setInterval(() => {
|
|
149772
149837
|
if (spinner) spinner.text = `Polling... (${formatTime(/* @__PURE__ */ new Date())})`;
|
|
149773
149838
|
}, interval);
|
|
@@ -149823,7 +149888,7 @@ const executionsCommand = defineCommand({
|
|
|
149823
149888
|
},
|
|
149824
149889
|
args: {
|
|
149825
149890
|
...commonArgs,
|
|
149826
|
-
...
|
|
149891
|
+
...jsonArgs,
|
|
149827
149892
|
executionId: {
|
|
149828
149893
|
type: "positional",
|
|
149829
149894
|
description: "Execution ID (if provided, shows details)",
|
|
@@ -149866,35 +149931,34 @@ const executionsCommand = defineCommand({
|
|
|
149866
149931
|
}
|
|
149867
149932
|
},
|
|
149868
149933
|
run: withCommonArgs(async (args) => {
|
|
149869
|
-
const format$2 = parseFormat(args.format);
|
|
149870
149934
|
if (args.executionId) {
|
|
149871
149935
|
const interval = parseDuration$1(args.interval);
|
|
149872
|
-
const { execution, wait } = await
|
|
149936
|
+
const { execution, wait } = await getWorkflowExecution({
|
|
149873
149937
|
executionId: args.executionId,
|
|
149874
149938
|
workspaceId: args["workspace-id"],
|
|
149875
149939
|
profile: args.profile,
|
|
149876
149940
|
interval,
|
|
149877
149941
|
logs: args.logs
|
|
149878
149942
|
});
|
|
149879
|
-
if (
|
|
149880
|
-
const result = args.wait ? await waitWithSpinner(wait, interval,
|
|
149881
|
-
if (args.logs &&
|
|
149882
|
-
else
|
|
149943
|
+
if (!args.json) consola.info(`Execution ID: ${execution.id}`);
|
|
149944
|
+
const result = args.wait ? await waitWithSpinner(wait, interval, args.json) : execution;
|
|
149945
|
+
if (args.logs && !args.json) printExecutionWithLogs(result);
|
|
149946
|
+
else printData(result, args.json);
|
|
149883
149947
|
} else {
|
|
149884
|
-
const executions = await
|
|
149948
|
+
const executions = await listWorkflowExecutions({
|
|
149885
149949
|
workspaceId: args["workspace-id"],
|
|
149886
149950
|
profile: args.profile,
|
|
149887
149951
|
workflowName: args["workflow-name"],
|
|
149888
149952
|
status: args.status
|
|
149889
149953
|
});
|
|
149890
|
-
|
|
149954
|
+
printData(executions, args.json);
|
|
149891
149955
|
}
|
|
149892
149956
|
})
|
|
149893
149957
|
});
|
|
149894
149958
|
|
|
149895
149959
|
//#endregion
|
|
149896
149960
|
//#region src/cli/workflow/resume.ts
|
|
149897
|
-
async function
|
|
149961
|
+
async function resumeWorkflow(options) {
|
|
149898
149962
|
const accessToken = await loadAccessToken({
|
|
149899
149963
|
useProfile: true,
|
|
149900
149964
|
profile: options.profile
|
|
@@ -149934,7 +149998,7 @@ const resumeCommand = defineCommand({
|
|
|
149934
149998
|
},
|
|
149935
149999
|
args: {
|
|
149936
150000
|
...commonArgs,
|
|
149937
|
-
...
|
|
150001
|
+
...jsonArgs,
|
|
149938
150002
|
executionId: {
|
|
149939
150003
|
type: "positional",
|
|
149940
150004
|
description: "Failed execution ID",
|
|
@@ -149962,25 +150026,24 @@ const resumeCommand = defineCommand({
|
|
|
149962
150026
|
}
|
|
149963
150027
|
},
|
|
149964
150028
|
run: withCommonArgs(async (args) => {
|
|
149965
|
-
const format$2 = parseFormat(args.format);
|
|
149966
150029
|
const interval = parseDuration(args.interval);
|
|
149967
|
-
const { executionId, wait } = await
|
|
150030
|
+
const { executionId, wait } = await resumeWorkflow({
|
|
149968
150031
|
executionId: args.executionId,
|
|
149969
150032
|
workspaceId: args["workspace-id"],
|
|
149970
150033
|
profile: args.profile,
|
|
149971
150034
|
interval
|
|
149972
150035
|
});
|
|
149973
|
-
if (
|
|
150036
|
+
if (!args.json) {
|
|
149974
150037
|
const { default: consola$2 } = await import("consola");
|
|
149975
150038
|
consola$2.info(`Execution ID: ${executionId}`);
|
|
149976
150039
|
}
|
|
149977
150040
|
if (args.wait) {
|
|
149978
150041
|
const result = await wait();
|
|
149979
|
-
|
|
149980
|
-
} else
|
|
150042
|
+
printData(result, args.json);
|
|
150043
|
+
} else printData({ executionId }, args.json);
|
|
149981
150044
|
})
|
|
149982
150045
|
});
|
|
149983
150046
|
|
|
149984
150047
|
//#endregion
|
|
149985
|
-
export { PATScope, apply, applyCommand, commonArgs, createCommand, deleteCommand, executionsCommand, fetchAll, fetchLatestToken, fetchUserInfo,
|
|
149986
|
-
//# sourceMappingURL=resume-
|
|
150048
|
+
export { PATScope, apply, applyCommand, commonArgs, createCommand, createWorkspace, deleteCommand, deleteWorkspace, executionsCommand, fetchAll, fetchLatestToken, fetchUserInfo, generate, generateCommand, generateUserTypes, getCommand, getCommand$1, getMachineUserToken, getOAuth2Client, getWorkflow, getWorkflowExecution, initOAuth2Client, initOperatorClient, jsonArgs, listCommand, listCommand$1, listCommand$2, listCommand$3, listMachineUsers, listOAuth2Clients, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, printData, readPackageJson, readPlatformConfig, remove, removeCommand, resumeCommand, resumeWorkflow, show, showCommand, startCommand, startWorkflow, tokenCommand, withCommonArgs, writePlatformConfig };
|
|
150049
|
+
//# sourceMappingURL=resume-ChDChtAZ.mjs.map
|