@tailor-platform/sdk 0.16.2 → 0.17.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 +23 -0
- package/README.md +75 -8
- package/dist/cli/api.d.mts +6 -2
- package/dist/cli/api.mjs +1 -1
- package/dist/cli/index.mjs +51 -75
- package/dist/cli/index.mjs.map +1 -1
- package/dist/configure/index.d.mts +2 -2
- package/dist/{index-DOA9RfBq.d.mts → index-Bin7-j3v.d.mts} +2 -2
- package/dist/{resume-Yw6OGEYO.mjs → resume-B2ba5opn.mjs} +165 -122
- package/dist/{resume-Yw6OGEYO.mjs.map → resume-B2ba5opn.mjs.map} +1 -1
- package/dist/{types-DUYX8rv-.d.mts → types-Da_WnvA0.d.mts} +15 -1
- 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 +36 -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 +225 -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 +305 -0
- package/docs/services/workflow.md +176 -0
- package/docs/testing.md +3 -1
- package/package.json +4 -3
- package/postinstall.mjs +1 -0
- 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
|
|
|
@@ -423,10 +424,9 @@ var ExecutorService = class {
|
|
|
423
424
|
await Promise.all(executorFiles.map((executorFile) => this.loadExecutorForFile(executorFile)));
|
|
424
425
|
return this.executors;
|
|
425
426
|
}
|
|
426
|
-
async loadExecutorForFile(executorFile
|
|
427
|
+
async loadExecutorForFile(executorFile) {
|
|
427
428
|
try {
|
|
428
|
-
const
|
|
429
|
-
const executorModule = await (timestamp === void 0 ? import(baseUrl) : import(`${baseUrl}?t=${timestamp.getTime()}`));
|
|
429
|
+
const executorModule = await import(pathToFileURL(executorFile).href);
|
|
430
430
|
const result = ExecutorSchema.safeParse(executorModule.default);
|
|
431
431
|
if (result.success) {
|
|
432
432
|
const relativePath = path$1.relative(process.cwd(), executorFile);
|
|
@@ -508,10 +508,9 @@ var ResolverService = class {
|
|
|
508
508
|
console.log("Found", styleText("cyanBright", resolverFiles.length.toString()), "resolver files for service", styleText("cyanBright", `"${this.namespace}"`));
|
|
509
509
|
await Promise.all(resolverFiles.map((resolverFile) => this.loadResolverForFile(resolverFile)));
|
|
510
510
|
}
|
|
511
|
-
async loadResolverForFile(resolverFile
|
|
511
|
+
async loadResolverForFile(resolverFile) {
|
|
512
512
|
try {
|
|
513
|
-
const
|
|
514
|
-
const resolverModule = await (timestamp === void 0 ? import(baseUrl) : import(`${baseUrl}?t=${timestamp.getTime()}`));
|
|
513
|
+
const resolverModule = await import(pathToFileURL(resolverFile).href);
|
|
515
514
|
const result = ResolverSchema.safeParse(resolverModule.default);
|
|
516
515
|
if (result.success) {
|
|
517
516
|
const relativePath = path$1.relative(process.cwd(), resolverFile);
|
|
@@ -1066,7 +1065,7 @@ var require_browser = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src
|
|
|
1066
1065
|
/**
|
|
1067
1066
|
* This is the web browser implementation of `debug()`.
|
|
1068
1067
|
*/
|
|
1069
|
-
exports.formatArgs = formatArgs$
|
|
1068
|
+
exports.formatArgs = formatArgs$1;
|
|
1070
1069
|
exports.save = save$1;
|
|
1071
1070
|
exports.load = load$1;
|
|
1072
1071
|
exports.useColors = useColors$1;
|
|
@@ -1179,7 +1178,7 @@ var require_browser = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src
|
|
|
1179
1178
|
*
|
|
1180
1179
|
* @api public
|
|
1181
1180
|
*/
|
|
1182
|
-
function formatArgs$
|
|
1181
|
+
function formatArgs$1(args) {
|
|
1183
1182
|
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
1184
1183
|
if (!this.useColors) return;
|
|
1185
1184
|
const c = "color: " + this.color;
|
|
@@ -1351,7 +1350,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/no
|
|
|
1351
1350
|
*/
|
|
1352
1351
|
exports.init = init;
|
|
1353
1352
|
exports.log = log;
|
|
1354
|
-
exports.formatArgs = formatArgs
|
|
1353
|
+
exports.formatArgs = formatArgs;
|
|
1355
1354
|
exports.save = save;
|
|
1356
1355
|
exports.load = load;
|
|
1357
1356
|
exports.useColors = useColors;
|
|
@@ -1478,7 +1477,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/no
|
|
|
1478
1477
|
*
|
|
1479
1478
|
* @api public
|
|
1480
1479
|
*/
|
|
1481
|
-
function formatArgs
|
|
1480
|
+
function formatArgs(args) {
|
|
1482
1481
|
const { namespace: name$2, useColors: useColors$2 } = this;
|
|
1483
1482
|
if (useColors$2) {
|
|
1484
1483
|
const c = this.color;
|
|
@@ -141591,17 +141590,16 @@ var TailorDBService = class {
|
|
|
141591
141590
|
this.parseTypes();
|
|
141592
141591
|
return this.types;
|
|
141593
141592
|
}
|
|
141594
|
-
async loadTypesForFile(typeFile
|
|
141595
|
-
const result = await this.loadTypeFile(typeFile
|
|
141593
|
+
async loadTypesForFile(typeFile) {
|
|
141594
|
+
const result = await this.loadTypeFile(typeFile);
|
|
141596
141595
|
this.parseTypes();
|
|
141597
141596
|
return result;
|
|
141598
141597
|
}
|
|
141599
|
-
async loadTypeFile(typeFile
|
|
141598
|
+
async loadTypeFile(typeFile) {
|
|
141600
141599
|
this.rawTypes[typeFile] = {};
|
|
141601
141600
|
const loadedTypes = {};
|
|
141602
141601
|
try {
|
|
141603
|
-
const
|
|
141604
|
-
const module$1 = await (timestamp === void 0 ? import(baseUrl) : import(`${baseUrl}?t=${timestamp.getTime()}`));
|
|
141602
|
+
const module$1 = await import(pathToFileURL(typeFile).href);
|
|
141605
141603
|
for (const exportName of Object.keys(module$1)) {
|
|
141606
141604
|
const exportedValue = module$1[exportName];
|
|
141607
141605
|
if (exportedValue && typeof exportedValue === "object" && exportedValue.constructor?.name === "TailorDBType" && typeof exportedValue.name === "string" && typeof exportedValue.fields === "object" && exportedValue.metadata && typeof exportedValue.metadata === "object") {
|
|
@@ -141705,6 +141703,10 @@ var TailorDBService = class {
|
|
|
141705
141703
|
//#endregion
|
|
141706
141704
|
//#region src/parser/service/idp/schema.ts
|
|
141707
141705
|
const IdPLangSchema$1 = z.enum(["en", "ja"]);
|
|
141706
|
+
const IdPUserAuthPolicySchema = z.object({
|
|
141707
|
+
useNonEmailIdentifier: z.boolean().default(false),
|
|
141708
|
+
allowSelfPasswordReset: z.boolean().default(false)
|
|
141709
|
+
});
|
|
141708
141710
|
const IdPSchema = z.object({
|
|
141709
141711
|
name: z.string(),
|
|
141710
141712
|
authorization: z.union([
|
|
@@ -141713,7 +141715,8 @@ const IdPSchema = z.object({
|
|
|
141713
141715
|
z.object({ cel: z.string() })
|
|
141714
141716
|
]),
|
|
141715
141717
|
clients: z.array(z.string()),
|
|
141716
|
-
lang: IdPLangSchema$1.optional()
|
|
141718
|
+
lang: IdPLangSchema$1.optional(),
|
|
141719
|
+
userAuthPolicy: IdPUserAuthPolicySchema.transform((input) => IdPUserAuthPolicySchema.parse(input ?? {})).optional()
|
|
141717
141720
|
}).brand("IdPConfig");
|
|
141718
141721
|
|
|
141719
141722
|
//#endregion
|
|
@@ -141926,7 +141929,7 @@ async function loadFileContent(filePath) {
|
|
|
141926
141929
|
const jobs = [];
|
|
141927
141930
|
let workflow = null;
|
|
141928
141931
|
try {
|
|
141929
|
-
const module$1 = await import(
|
|
141932
|
+
const module$1 = await import(pathToFileURL(filePath).href);
|
|
141930
141933
|
for (const [exportName, exportValue] of Object.entries(module$1)) {
|
|
141931
141934
|
if (exportName === "default") {
|
|
141932
141935
|
const workflowResult = WorkflowSchema.safeParse(exportValue);
|
|
@@ -142543,7 +142546,7 @@ function createTriggerTransformPlugin(triggerContext) {
|
|
|
142543
142546
|
//#endregion
|
|
142544
142547
|
//#region src/cli/bundler/executor/loader.ts
|
|
142545
142548
|
async function loadExecutor(executorFilePath) {
|
|
142546
|
-
const executor = (await import(
|
|
142549
|
+
const executor = (await import(pathToFileURL(executorFilePath).href)).default;
|
|
142547
142550
|
const parseResult = ExecutorSchema.safeParse(executor);
|
|
142548
142551
|
if (!parseResult.success) return null;
|
|
142549
142552
|
return parseResult.data;
|
|
@@ -142631,7 +142634,7 @@ async function bundleSingleExecutor(executor, outputDir, tsconfig, triggerContex
|
|
|
142631
142634
|
//#endregion
|
|
142632
142635
|
//#region src/cli/bundler/resolver/loader.ts
|
|
142633
142636
|
async function loadResolver(resolverFilePath) {
|
|
142634
|
-
const resolver = (await import(
|
|
142637
|
+
const resolver = (await import(pathToFileURL(resolverFilePath).href)).default;
|
|
142635
142638
|
const parseResult = ResolverSchema.safeParse(resolver);
|
|
142636
142639
|
if (!parseResult.success) return null;
|
|
142637
142640
|
return parseResult.data;
|
|
@@ -143179,7 +143182,7 @@ const file_tailor_v1_secret_manager_resource = /* @__PURE__ */ fileDesc("Cid0YWl
|
|
|
143179
143182
|
/**
|
|
143180
143183
|
* Describes the file tailor/v1/auth_resource.proto.
|
|
143181
143184
|
*/
|
|
143182
|
-
const file_tailor_v1_auth_resource = /* @__PURE__ */ fileDesc("
|
|
143185
|
+
const file_tailor_v1_auth_resource = /* @__PURE__ */ fileDesc("Ch10YWlsb3IvdjEvYXV0aF9yZXNvdXJjZS5wcm90bxIJdGFpbG9yLnYxIjYKC0F1dGhTZXJ2aWNlEicKCW5hbWVzcGFjZRgBIAEoCzIULnRhaWxvci52MS5OYW1lc3BhY2UikAcKDUF1dGhJRFBDb25maWcSNgoEbmFtZRgBIAEoCUIoukglciMyIV5bYS16MC05XVthLXowLTktXXsxLDYxfVthLXowLTldJBI0CglhdXRoX3R5cGUYAiABKA4yIS50YWlsb3IudjEuQXV0aElEUENvbmZpZy5BdXRoVHlwZRIvCgZjb25maWcYAyABKAsyHy50YWlsb3IudjEuQXV0aElEUENvbmZpZy5Db25maWcauAEKBkNvbmZpZxIzCgRvaWRjGAEgASgLMiMudGFpbG9yLnYxLkF1dGhJRFBDb25maWcuT0lEQ0NvbmZpZ0gAEjMKBHNhbWwYAiABKAsyIy50YWlsb3IudjEuQXV0aElEUENvbmZpZy5TQU1MQ29uZmlnSAASOgoIaWRfdG9rZW4YAyABKAsyJi50YWlsb3IudjEuQXV0aElEUENvbmZpZy5JRFRva2VuQ29uZmlnSABCCAoGY29uZmlnGpgBCgpPSURDQ29uZmlnEhUKDWNsaWVudF9pZF9rZXkYASABKAkSMQoRY2xpZW50X3NlY3JldF9rZXkYAiABKAsyFi50YWlsb3IudjEuU2Vj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VF9TQ09QRV9VTlNQRUNJRklFRBAAEhIKDlBBVF9TQ09QRV9SRUFEEAESEwoPUEFUX1NDT1BFX1dSSVRFEAJiBnByb3RvMw", [
|
|
143183
143186
|
file_buf_validate_validate,
|
|
143184
143187
|
file_google_api_field_behavior,
|
|
143185
143188
|
file_google_protobuf_struct,
|
|
@@ -143371,7 +143374,7 @@ const file_tailor_v1_function = /* @__PURE__ */ fileDesc("Chh0YWlsb3IvdjEvZnVuY3
|
|
|
143371
143374
|
/**
|
|
143372
143375
|
* Describes the file tailor/v1/idp_resource.proto.
|
|
143373
143376
|
*/
|
|
143374
|
-
const file_tailor_v1_idp_resource = /* @__PURE__ */ fileDesc("Chx0YWlsb3IvdjEvaWRwX3Jlc291cmNlLnByb3RvEgl0YWlsb3IudjEiwQEKCklkUFNlcnZpY2USJwoJbmFtZXNwYWNlGAEgASgLMhQudGFpbG9yLnYxLk5hbWVzcGFjZRIVCg1hdXRob3JpemF0aW9uGAIgASgJEhkKDHByb3ZpZGVyX3VybBgDIAEoCUID4EEDEjYKEHVzZXJfYXV0aF9wb2xpY3kYBCABKAsyHC50YWlsb3IudjEuSWRQVXNlckF1dGhQb2xpY3kSIAoEbGFuZxgFIAEoDjISLnRhaWxvci52MS5JZFBMYW5nIk0KCUlkUENsaWVudBIMCgRuYW1lGAEgASgJEhYKCWNsaWVudF9pZBgCIAEoCUID4EEDEhoKDWNsaWVudF9zZWNyZXQYAyABKAlCA+
|
|
143377
|
+
const file_tailor_v1_idp_resource = /* @__PURE__ */ fileDesc("Chx0YWlsb3IvdjEvaWRwX3Jlc291cmNlLnByb3RvEgl0YWlsb3IudjEiwQEKCklkUFNlcnZpY2USJwoJbmFtZXNwYWNlGAEgASgLMhQudGFpbG9yLnYxLk5hbWVzcGFjZRIVCg1hdXRob3JpemF0aW9uGAIgASgJEhkKDHByb3ZpZGVyX3VybBgDIAEoCUID4EEDEjYKEHVzZXJfYXV0aF9wb2xpY3kYBCABKAsyHC50YWlsb3IudjEuSWRQVXNlckF1dGhQb2xpY3kSIAoEbGFuZxgFIAEoDjISLnRhaWxvci52MS5JZFBMYW5nIk0KCUlkUENsaWVudBIMCgRuYW1lGAEgASgJEhYKCWNsaWVudF9pZBgCIAEoCUID4EEDEhoKDWNsaWVudF9zZWNyZXQYAyABKAlCA+BBAyJYChFJZFBVc2VyQXV0aFBvbGljeRIgChh1c2Vfbm9uX2VtYWlsX2lkZW50aWZpZXIYASABKAgSIQoZYWxsb3dfc2VsZl9wYXNzd29yZF9yZXNldBgCIAEoCCpICgdJZFBMYW5nEhkKFUlEX1BfTEFOR19VTlNQRUNJRklFRBAAEhAKDElEX1BfTEFOR19FThABEhAKDElEX1BfTEFOR19KQRACYgZwcm90bzM", [file_google_api_field_behavior, file_tailor_v1_resource]);
|
|
143375
143378
|
/**
|
|
143376
143379
|
* Describes the enum tailor.v1.IdPLang.
|
|
143377
143380
|
*/
|
|
@@ -144646,25 +144649,28 @@ const SeedGeneratorID = "@tailor-platform/seed";
|
|
|
144646
144649
|
/**
|
|
144647
144650
|
* Generates the exec.mjs script content (Node.js executable)
|
|
144648
144651
|
*/
|
|
144649
|
-
function generateExecScript(machineUserName,
|
|
144652
|
+
function generateExecScript(machineUserName, relativeConfigPath) {
|
|
144650
144653
|
return ml`
|
|
144651
144654
|
import { execSync } from "node:child_process";
|
|
144655
|
+
import { join } from "node:path";
|
|
144652
144656
|
import { show, machineUserToken } from "@tailor-platform/sdk/cli";
|
|
144653
144657
|
|
|
144658
|
+
const configDir = import.meta.dirname;
|
|
144659
|
+
const configPath = join(configDir, "${relativeConfigPath}");
|
|
144660
|
+
|
|
144654
144661
|
console.log("Starting seed data generation...");
|
|
144655
144662
|
|
|
144656
|
-
const appInfo = await show();
|
|
144663
|
+
const appInfo = await show({ configPath });
|
|
144657
144664
|
const endpoint = \`\${appInfo.url}/query\`;
|
|
144658
144665
|
|
|
144659
|
-
const tokenInfo = await machineUserToken({ name: "${machineUserName}" });
|
|
144666
|
+
const tokenInfo = await machineUserToken({ name: "${machineUserName}", configPath });
|
|
144660
144667
|
const headers = JSON.stringify({ Authorization: \`Bearer \${tokenInfo.accessToken}\` });
|
|
144661
144668
|
|
|
144662
|
-
// Build command with platform-specific quoting
|
|
144663
144669
|
const headersArg = process.platform === "win32"
|
|
144664
|
-
? \`"\${headers.replace(/"/g, '\\\\"')}"\`
|
|
144665
|
-
: \`'\${headers}'\`;
|
|
144670
|
+
? \`"\${headers.replace(/"/g, '\\\\"')}"\`
|
|
144671
|
+
: \`'\${headers}'\`;
|
|
144666
144672
|
|
|
144667
|
-
const cmd = \`npx gql-ingest -c
|
|
144673
|
+
const cmd = \`npx gql-ingest -c "\${configDir}" -e "\${endpoint}" --headers \${headersArg}\`;
|
|
144668
144674
|
console.log("Running:", cmd);
|
|
144669
144675
|
|
|
144670
144676
|
try {
|
|
@@ -144691,7 +144697,7 @@ function createSeedGenerator(options) {
|
|
|
144691
144697
|
processTailorDBNamespace: ({ types: types$2 }) => types$2,
|
|
144692
144698
|
processExecutor: (_executor) => void 0,
|
|
144693
144699
|
processResolver: (_args) => void 0,
|
|
144694
|
-
aggregate: ({ input }) => {
|
|
144700
|
+
aggregate: ({ input, configPath }) => {
|
|
144695
144701
|
const entityDependencies = {};
|
|
144696
144702
|
const files = [];
|
|
144697
144703
|
for (const nsResult of input.tailordb) {
|
|
@@ -144753,10 +144759,13 @@ function createSeedGenerator(options) {
|
|
|
144753
144759
|
${Object.entries(dependencies).map(([type, deps]) => `${type}: [${deps.join(", ")}]`).join("\n ")}
|
|
144754
144760
|
`
|
|
144755
144761
|
});
|
|
144756
|
-
if (options.machineUserName)
|
|
144757
|
-
|
|
144758
|
-
|
|
144759
|
-
|
|
144762
|
+
if (options.machineUserName) {
|
|
144763
|
+
const relativeConfigPath = path$1.relative(outputDir, configPath).replaceAll("\\", "/");
|
|
144764
|
+
files.push({
|
|
144765
|
+
path: path$1.join(outputDir, "exec.mjs"),
|
|
144766
|
+
content: generateExecScript(options.machineUserName, relativeConfigPath)
|
|
144767
|
+
});
|
|
144768
|
+
}
|
|
144760
144769
|
}
|
|
144761
144770
|
return { files };
|
|
144762
144771
|
}
|
|
@@ -144950,36 +144959,11 @@ const withCommonArgs = (handler) => async ({ args }) => {
|
|
|
144950
144959
|
}
|
|
144951
144960
|
process.exit(0);
|
|
144952
144961
|
};
|
|
144953
|
-
const
|
|
144954
|
-
|
|
144955
|
-
|
|
144956
|
-
|
|
144957
|
-
alias: "f",
|
|
144958
|
-
default: "table"
|
|
144962
|
+
const jsonArgs = { json: {
|
|
144963
|
+
type: "boolean",
|
|
144964
|
+
description: "Output as JSON",
|
|
144965
|
+
default: false
|
|
144959
144966
|
} };
|
|
144960
|
-
function parseFormat(format$2) {
|
|
144961
|
-
const parsed = formatSchema.safeParse(format$2);
|
|
144962
|
-
if (!parsed.success) throw new Error(`Format "${format$2}" is invalid. Must be one of: ${formatSchema.options.join(", ")}`);
|
|
144963
|
-
return parsed.data;
|
|
144964
|
-
}
|
|
144965
|
-
function printWithFormat(data$1, format$2) {
|
|
144966
|
-
switch (format$2) {
|
|
144967
|
-
case "table":
|
|
144968
|
-
if (Array.isArray(data$1)) data$1.forEach((item) => {
|
|
144969
|
-
const t = table(Object.entries(item), { singleLine: true });
|
|
144970
|
-
process.stdout.write(t);
|
|
144971
|
-
});
|
|
144972
|
-
else {
|
|
144973
|
-
const t = table(Object.entries(data$1), { singleLine: true });
|
|
144974
|
-
process.stdout.write(t);
|
|
144975
|
-
}
|
|
144976
|
-
break;
|
|
144977
|
-
case "json":
|
|
144978
|
-
console.log(JSON.stringify(data$1));
|
|
144979
|
-
break;
|
|
144980
|
-
default: throw new Error(`Format "${format$2}" is invalid.`);
|
|
144981
|
-
}
|
|
144982
|
-
}
|
|
144983
144967
|
|
|
144984
144968
|
//#endregion
|
|
144985
144969
|
//#region src/cli/apply/services/label.ts
|
|
@@ -145275,6 +145259,7 @@ async function planServices$3(client, workspaceId, appName, idps) {
|
|
|
145275
145259
|
break;
|
|
145276
145260
|
}
|
|
145277
145261
|
const lang = convertLang(idp.lang);
|
|
145262
|
+
const userAuthPolicy = idp.userAuthPolicy;
|
|
145278
145263
|
if (existing) {
|
|
145279
145264
|
if (!existing.label) unmanaged.push({
|
|
145280
145265
|
resourceType: "IdP service",
|
|
@@ -145291,7 +145276,8 @@ async function planServices$3(client, workspaceId, appName, idps) {
|
|
|
145291
145276
|
workspaceId,
|
|
145292
145277
|
namespaceName,
|
|
145293
145278
|
authorization,
|
|
145294
|
-
lang
|
|
145279
|
+
lang,
|
|
145280
|
+
userAuthPolicy
|
|
145295
145281
|
},
|
|
145296
145282
|
metaRequest
|
|
145297
145283
|
});
|
|
@@ -145302,7 +145288,8 @@ async function planServices$3(client, workspaceId, appName, idps) {
|
|
|
145302
145288
|
workspaceId,
|
|
145303
145289
|
namespaceName,
|
|
145304
145290
|
authorization,
|
|
145305
|
-
lang
|
|
145291
|
+
lang,
|
|
145292
|
+
userAuthPolicy
|
|
145306
145293
|
},
|
|
145307
145294
|
metaRequest
|
|
145308
145295
|
});
|
|
@@ -148422,7 +148409,8 @@ var GenerationManager = class {
|
|
|
148422
148409
|
const result = await gen.aggregate({
|
|
148423
148410
|
input,
|
|
148424
148411
|
executorInputs: Object.values(results.executorResults),
|
|
148425
|
-
baseDir: path$1.join(this.baseDir, gen.id)
|
|
148412
|
+
baseDir: path$1.join(this.baseDir, gen.id),
|
|
148413
|
+
configPath: this.configPath ?? "tailor.config.ts"
|
|
148426
148414
|
});
|
|
148427
148415
|
await Promise.all(result.files.map(async (file) => {
|
|
148428
148416
|
fs$1.mkdirSync(path$1.dirname(file.path), { recursive: true });
|
|
@@ -148535,6 +148523,43 @@ const generateCommand = defineCommand({
|
|
|
148535
148523
|
})
|
|
148536
148524
|
});
|
|
148537
148525
|
|
|
148526
|
+
//#endregion
|
|
148527
|
+
//#region src/cli/format.ts
|
|
148528
|
+
function humanizeRelativeTime(isoString) {
|
|
148529
|
+
const date$1 = new Date(isoString);
|
|
148530
|
+
if (Number.isNaN(date$1.getTime())) return isoString;
|
|
148531
|
+
return formatDistanceToNowStrict(date$1, { addSuffix: true });
|
|
148532
|
+
}
|
|
148533
|
+
function printData(data$1, json = false) {
|
|
148534
|
+
if (json) {
|
|
148535
|
+
console.log(JSON.stringify(data$1));
|
|
148536
|
+
return;
|
|
148537
|
+
}
|
|
148538
|
+
if (!Array.isArray(data$1)) {
|
|
148539
|
+
const t$1 = table(Object.entries(data$1), {
|
|
148540
|
+
singleLine: true,
|
|
148541
|
+
border: getBorderCharacters("norc")
|
|
148542
|
+
});
|
|
148543
|
+
process.stdout.write(t$1);
|
|
148544
|
+
return;
|
|
148545
|
+
}
|
|
148546
|
+
if (data$1.length === 0) return;
|
|
148547
|
+
const headers = Array.from(new Set(data$1.flatMap((item) => Object.keys(item))));
|
|
148548
|
+
const rows = data$1.map((item) => headers.map((header) => {
|
|
148549
|
+
const value$1 = item[header];
|
|
148550
|
+
if (value$1 === null || value$1 === void 0) return "";
|
|
148551
|
+
if ((header === "createdAt" || header === "updatedAt") && typeof value$1 === "string") return humanizeRelativeTime(value$1);
|
|
148552
|
+
return String(value$1);
|
|
148553
|
+
}));
|
|
148554
|
+
const t = table([headers, ...rows], {
|
|
148555
|
+
border: getBorderCharacters("norc"),
|
|
148556
|
+
drawHorizontalLine: (lineIndex, rowCount) => {
|
|
148557
|
+
return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;
|
|
148558
|
+
}
|
|
148559
|
+
});
|
|
148560
|
+
process.stdout.write(t);
|
|
148561
|
+
}
|
|
148562
|
+
|
|
148538
148563
|
//#endregion
|
|
148539
148564
|
//#region src/cli/show.ts
|
|
148540
148565
|
function applicationInfo(app) {
|
|
@@ -148574,7 +148599,7 @@ const showCommand = defineCommand({
|
|
|
148574
148599
|
},
|
|
148575
148600
|
args: {
|
|
148576
148601
|
...commonArgs,
|
|
148577
|
-
...
|
|
148602
|
+
...jsonArgs,
|
|
148578
148603
|
"workspace-id": {
|
|
148579
148604
|
type: "string",
|
|
148580
148605
|
description: "Workspace ID",
|
|
@@ -148593,13 +148618,12 @@ const showCommand = defineCommand({
|
|
|
148593
148618
|
}
|
|
148594
148619
|
},
|
|
148595
148620
|
run: withCommonArgs(async (args) => {
|
|
148596
|
-
const format$2 = parseFormat(args.format);
|
|
148597
148621
|
const appInfo = await show({
|
|
148598
148622
|
workspaceId: args["workspace-id"],
|
|
148599
148623
|
profile: args.profile,
|
|
148600
148624
|
configPath: args.config
|
|
148601
148625
|
});
|
|
148602
|
-
|
|
148626
|
+
printData(appInfo, args.json);
|
|
148603
148627
|
})
|
|
148604
148628
|
});
|
|
148605
148629
|
|
|
@@ -148752,7 +148776,7 @@ const createCommand = defineCommand({
|
|
|
148752
148776
|
},
|
|
148753
148777
|
args: {
|
|
148754
148778
|
...commonArgs,
|
|
148755
|
-
...
|
|
148779
|
+
...jsonArgs,
|
|
148756
148780
|
name: {
|
|
148757
148781
|
type: "string",
|
|
148758
148782
|
description: "Workspace name",
|
|
@@ -148783,7 +148807,6 @@ const createCommand = defineCommand({
|
|
|
148783
148807
|
}
|
|
148784
148808
|
},
|
|
148785
148809
|
run: withCommonArgs(async (args) => {
|
|
148786
|
-
const format$2 = parseFormat(args.format);
|
|
148787
148810
|
const workspace = await workspaceCreate({
|
|
148788
148811
|
name: args.name,
|
|
148789
148812
|
region: args.region,
|
|
@@ -148791,20 +148814,36 @@ const createCommand = defineCommand({
|
|
|
148791
148814
|
organizationId: args["organization-id"],
|
|
148792
148815
|
folderId: args["folder-id"]
|
|
148793
148816
|
});
|
|
148794
|
-
if (
|
|
148795
|
-
|
|
148817
|
+
if (!args.json) consola$1.success(`Workspace "${args.name}" created successfully.`);
|
|
148818
|
+
printData(workspace, args.json);
|
|
148796
148819
|
})
|
|
148797
148820
|
});
|
|
148798
148821
|
|
|
148799
148822
|
//#endregion
|
|
148800
148823
|
//#region src/cli/workspace/list.ts
|
|
148801
|
-
|
|
148824
|
+
const limitSchema = z.coerce.number().int().positive().optional();
|
|
148825
|
+
async function workspaceList(options) {
|
|
148826
|
+
const limit = options?.limit;
|
|
148827
|
+
const hasLimit = limit !== void 0;
|
|
148802
148828
|
const accessToken = await loadAccessToken();
|
|
148803
148829
|
const client = await initOperatorClient(accessToken);
|
|
148804
|
-
|
|
148805
|
-
|
|
148806
|
-
|
|
148807
|
-
|
|
148830
|
+
const results = [];
|
|
148831
|
+
let pageToken = "";
|
|
148832
|
+
while (true) {
|
|
148833
|
+
if (hasLimit && results.length >= limit) break;
|
|
148834
|
+
const remaining = hasLimit ? limit - results.length : void 0;
|
|
148835
|
+
const pageSize = remaining !== void 0 && remaining > 0 ? remaining : void 0;
|
|
148836
|
+
const { workspaces, nextPageToken } = await client.listWorkspaces({
|
|
148837
|
+
pageToken,
|
|
148838
|
+
...pageSize !== void 0 ? { pageSize } : {}
|
|
148839
|
+
});
|
|
148840
|
+
const mapped = workspaces.map(workspaceInfo);
|
|
148841
|
+
if (remaining !== void 0 && mapped.length > remaining) results.push(...mapped.slice(0, remaining));
|
|
148842
|
+
else results.push(...mapped);
|
|
148843
|
+
if (!nextPageToken) break;
|
|
148844
|
+
pageToken = nextPageToken;
|
|
148845
|
+
}
|
|
148846
|
+
return results;
|
|
148808
148847
|
}
|
|
148809
148848
|
const listCommand$3 = defineCommand({
|
|
148810
148849
|
meta: {
|
|
@@ -148813,12 +148852,25 @@ const listCommand$3 = defineCommand({
|
|
|
148813
148852
|
},
|
|
148814
148853
|
args: {
|
|
148815
148854
|
...commonArgs,
|
|
148816
|
-
...
|
|
148855
|
+
...jsonArgs,
|
|
148856
|
+
limit: {
|
|
148857
|
+
type: "string",
|
|
148858
|
+
description: "Maximum number of workspaces to list"
|
|
148859
|
+
}
|
|
148817
148860
|
},
|
|
148818
148861
|
run: withCommonArgs(async (args) => {
|
|
148819
|
-
|
|
148820
|
-
|
|
148821
|
-
|
|
148862
|
+
let limit;
|
|
148863
|
+
try {
|
|
148864
|
+
limit = limitSchema.parse(args.limit);
|
|
148865
|
+
} catch {
|
|
148866
|
+
throw new Error(`--limit must be a positive integer, got '${args.limit}'`);
|
|
148867
|
+
}
|
|
148868
|
+
const workspaces = await workspaceList({ limit });
|
|
148869
|
+
const formattedWorkspaces = args.json ? workspaces : workspaces.map(({ updatedAt: _, createdAt,...rest }) => ({
|
|
148870
|
+
...rest,
|
|
148871
|
+
createdAt: humanizeRelativeTime(createdAt)
|
|
148872
|
+
}));
|
|
148873
|
+
printData(formattedWorkspaces, args.json);
|
|
148822
148874
|
})
|
|
148823
148875
|
});
|
|
148824
148876
|
|
|
@@ -148919,7 +148971,7 @@ const listCommand$2 = defineCommand({
|
|
|
148919
148971
|
},
|
|
148920
148972
|
args: {
|
|
148921
148973
|
...commonArgs,
|
|
148922
|
-
...
|
|
148974
|
+
...jsonArgs,
|
|
148923
148975
|
"workspace-id": {
|
|
148924
148976
|
type: "string",
|
|
148925
148977
|
description: "Workspace ID",
|
|
@@ -148938,13 +148990,12 @@ const listCommand$2 = defineCommand({
|
|
|
148938
148990
|
}
|
|
148939
148991
|
},
|
|
148940
148992
|
run: withCommonArgs(async (args) => {
|
|
148941
|
-
const format$2 = parseFormat(args.format);
|
|
148942
148993
|
const machineUsers = await machineUserList({
|
|
148943
148994
|
workspaceId: args["workspace-id"],
|
|
148944
148995
|
profile: args.profile,
|
|
148945
148996
|
configPath: args.config
|
|
148946
148997
|
});
|
|
148947
|
-
|
|
148998
|
+
printData(machineUsers, args.json);
|
|
148948
148999
|
})
|
|
148949
149000
|
});
|
|
148950
149001
|
|
|
@@ -148988,7 +149039,7 @@ const tokenCommand = defineCommand({
|
|
|
148988
149039
|
},
|
|
148989
149040
|
args: {
|
|
148990
149041
|
...commonArgs,
|
|
148991
|
-
...
|
|
149042
|
+
...jsonArgs,
|
|
148992
149043
|
"workspace-id": {
|
|
148993
149044
|
type: "string",
|
|
148994
149045
|
description: "Workspace ID",
|
|
@@ -149012,7 +149063,6 @@ const tokenCommand = defineCommand({
|
|
|
149012
149063
|
}
|
|
149013
149064
|
},
|
|
149014
149065
|
run: withCommonArgs(async (args) => {
|
|
149015
|
-
const format$2 = parseFormat(args.format);
|
|
149016
149066
|
const token = await machineUserToken({
|
|
149017
149067
|
name: args.name,
|
|
149018
149068
|
workspaceId: args["workspace-id"],
|
|
@@ -149024,7 +149074,7 @@ const tokenCommand = defineCommand({
|
|
|
149024
149074
|
token_type: token.tokenType,
|
|
149025
149075
|
expires_at: token.expiresAt
|
|
149026
149076
|
};
|
|
149027
|
-
|
|
149077
|
+
printData(tokenInfo, args.json);
|
|
149028
149078
|
})
|
|
149029
149079
|
});
|
|
149030
149080
|
|
|
@@ -149096,7 +149146,7 @@ const getCommand$1 = defineCommand({
|
|
|
149096
149146
|
},
|
|
149097
149147
|
args: {
|
|
149098
149148
|
...commonArgs,
|
|
149099
|
-
...
|
|
149149
|
+
...jsonArgs,
|
|
149100
149150
|
name: {
|
|
149101
149151
|
type: "positional",
|
|
149102
149152
|
description: "OAuth2 client name",
|
|
@@ -149120,14 +149170,13 @@ const getCommand$1 = defineCommand({
|
|
|
149120
149170
|
}
|
|
149121
149171
|
},
|
|
149122
149172
|
run: withCommonArgs(async (args) => {
|
|
149123
|
-
const format$2 = parseFormat(args.format);
|
|
149124
149173
|
const credentials = await oauth2ClientGet({
|
|
149125
149174
|
name: args.name,
|
|
149126
149175
|
workspaceId: args["workspace-id"],
|
|
149127
149176
|
profile: args.profile,
|
|
149128
149177
|
configPath: args.config
|
|
149129
149178
|
});
|
|
149130
|
-
|
|
149179
|
+
printData(credentials, args.json);
|
|
149131
149180
|
})
|
|
149132
149181
|
});
|
|
149133
149182
|
|
|
@@ -149165,7 +149214,7 @@ const listCommand$1 = defineCommand({
|
|
|
149165
149214
|
},
|
|
149166
149215
|
args: {
|
|
149167
149216
|
...commonArgs,
|
|
149168
|
-
...
|
|
149217
|
+
...jsonArgs,
|
|
149169
149218
|
"workspace-id": {
|
|
149170
149219
|
type: "string",
|
|
149171
149220
|
description: "Workspace ID",
|
|
@@ -149184,13 +149233,12 @@ const listCommand$1 = defineCommand({
|
|
|
149184
149233
|
}
|
|
149185
149234
|
},
|
|
149186
149235
|
run: withCommonArgs(async (args) => {
|
|
149187
|
-
const format$2 = parseFormat(args.format);
|
|
149188
149236
|
const oauth2Clients = await oauth2ClientList({
|
|
149189
149237
|
workspaceId: args["workspace-id"],
|
|
149190
149238
|
profile: args.profile,
|
|
149191
149239
|
configPath: args.config
|
|
149192
149240
|
});
|
|
149193
|
-
|
|
149241
|
+
printData(oauth2Clients, args.json);
|
|
149194
149242
|
})
|
|
149195
149243
|
});
|
|
149196
149244
|
|
|
@@ -149283,7 +149331,7 @@ const listCommand = defineCommand({
|
|
|
149283
149331
|
},
|
|
149284
149332
|
args: {
|
|
149285
149333
|
...commonArgs,
|
|
149286
|
-
...
|
|
149334
|
+
...jsonArgs,
|
|
149287
149335
|
"workspace-id": {
|
|
149288
149336
|
type: "string",
|
|
149289
149337
|
description: "Workspace ID",
|
|
@@ -149296,12 +149344,11 @@ const listCommand = defineCommand({
|
|
|
149296
149344
|
}
|
|
149297
149345
|
},
|
|
149298
149346
|
run: withCommonArgs(async (args) => {
|
|
149299
|
-
const format$2 = parseFormat(args.format);
|
|
149300
149347
|
const workflows = await workflowList({
|
|
149301
149348
|
workspaceId: args["workspace-id"],
|
|
149302
149349
|
profile: args.profile
|
|
149303
149350
|
});
|
|
149304
|
-
if (
|
|
149351
|
+
if (args.json) console.log(JSON.stringify(workflows));
|
|
149305
149352
|
else {
|
|
149306
149353
|
if (workflows.length === 0) {
|
|
149307
149354
|
console.log("No workflows found.");
|
|
@@ -149317,7 +149364,7 @@ const listCommand = defineCommand({
|
|
|
149317
149364
|
w$1.name,
|
|
149318
149365
|
w$1.mainJob,
|
|
149319
149366
|
w$1.jobFunctions.toString(),
|
|
149320
|
-
w$1.updatedAt
|
|
149367
|
+
humanizeRelativeTime(w$1.updatedAt)
|
|
149321
149368
|
]);
|
|
149322
149369
|
process.stdout.write(table([headers, ...rows]));
|
|
149323
149370
|
}
|
|
@@ -149367,7 +149414,7 @@ const getCommand = defineCommand({
|
|
|
149367
149414
|
},
|
|
149368
149415
|
args: {
|
|
149369
149416
|
...commonArgs,
|
|
149370
|
-
...
|
|
149417
|
+
...jsonArgs,
|
|
149371
149418
|
nameOrId: {
|
|
149372
149419
|
type: "positional",
|
|
149373
149420
|
description: "Workflow name or ID",
|
|
@@ -149385,13 +149432,12 @@ const getCommand = defineCommand({
|
|
|
149385
149432
|
}
|
|
149386
149433
|
},
|
|
149387
149434
|
run: withCommonArgs(async (args) => {
|
|
149388
|
-
const format$2 = parseFormat(args.format);
|
|
149389
149435
|
const workflow = await workflowGet({
|
|
149390
149436
|
nameOrId: args.nameOrId,
|
|
149391
149437
|
workspaceId: args["workspace-id"],
|
|
149392
149438
|
profile: args.profile
|
|
149393
149439
|
});
|
|
149394
|
-
|
|
149440
|
+
printData(workflow, args.json);
|
|
149395
149441
|
})
|
|
149396
149442
|
});
|
|
149397
149443
|
|
|
@@ -149548,7 +149594,7 @@ const startCommand = defineCommand({
|
|
|
149548
149594
|
},
|
|
149549
149595
|
args: {
|
|
149550
149596
|
...commonArgs,
|
|
149551
|
-
...
|
|
149597
|
+
...jsonArgs,
|
|
149552
149598
|
nameOrId: {
|
|
149553
149599
|
type: "positional",
|
|
149554
149600
|
description: "Workflow name or ID",
|
|
@@ -149593,7 +149639,6 @@ const startCommand = defineCommand({
|
|
|
149593
149639
|
}
|
|
149594
149640
|
},
|
|
149595
149641
|
run: withCommonArgs(async (args) => {
|
|
149596
|
-
const format$2 = parseFormat(args.format);
|
|
149597
149642
|
const interval = parseDuration(args.interval);
|
|
149598
149643
|
const { executionId, wait } = await workflowStart({
|
|
149599
149644
|
nameOrId: args.nameOrId,
|
|
@@ -149604,11 +149649,11 @@ const startCommand = defineCommand({
|
|
|
149604
149649
|
configPath: args.config,
|
|
149605
149650
|
interval
|
|
149606
149651
|
});
|
|
149607
|
-
if (
|
|
149652
|
+
if (!args.json) consola.info(`Execution ID: ${executionId}`);
|
|
149608
149653
|
if (args.wait) {
|
|
149609
149654
|
const result = await wait();
|
|
149610
|
-
|
|
149611
|
-
} else
|
|
149655
|
+
printData(result, args.json);
|
|
149656
|
+
} else printData({ executionId }, args.json);
|
|
149612
149657
|
})
|
|
149613
149658
|
});
|
|
149614
149659
|
|
|
@@ -149761,8 +149806,8 @@ function parseDuration$1(duration) {
|
|
|
149761
149806
|
default: throw new Error(`Unknown duration unit: ${unit}`);
|
|
149762
149807
|
}
|
|
149763
149808
|
}
|
|
149764
|
-
async function waitWithSpinner(waitFn, interval,
|
|
149765
|
-
const spinner =
|
|
149809
|
+
async function waitWithSpinner(waitFn, interval, json) {
|
|
149810
|
+
const spinner = !json ? ora().start("Waiting...") : null;
|
|
149766
149811
|
const updateInterval = setInterval(() => {
|
|
149767
149812
|
if (spinner) spinner.text = `Polling... (${formatTime(/* @__PURE__ */ new Date())})`;
|
|
149768
149813
|
}, interval);
|
|
@@ -149818,7 +149863,7 @@ const executionsCommand = defineCommand({
|
|
|
149818
149863
|
},
|
|
149819
149864
|
args: {
|
|
149820
149865
|
...commonArgs,
|
|
149821
|
-
...
|
|
149866
|
+
...jsonArgs,
|
|
149822
149867
|
executionId: {
|
|
149823
149868
|
type: "positional",
|
|
149824
149869
|
description: "Execution ID (if provided, shows details)",
|
|
@@ -149861,7 +149906,6 @@ const executionsCommand = defineCommand({
|
|
|
149861
149906
|
}
|
|
149862
149907
|
},
|
|
149863
149908
|
run: withCommonArgs(async (args) => {
|
|
149864
|
-
const format$2 = parseFormat(args.format);
|
|
149865
149909
|
if (args.executionId) {
|
|
149866
149910
|
const interval = parseDuration$1(args.interval);
|
|
149867
149911
|
const { execution, wait } = await workflowExecutionGet({
|
|
@@ -149871,10 +149915,10 @@ const executionsCommand = defineCommand({
|
|
|
149871
149915
|
interval,
|
|
149872
149916
|
logs: args.logs
|
|
149873
149917
|
});
|
|
149874
|
-
if (
|
|
149875
|
-
const result = args.wait ? await waitWithSpinner(wait, interval,
|
|
149876
|
-
if (args.logs &&
|
|
149877
|
-
else
|
|
149918
|
+
if (!args.json) consola.info(`Execution ID: ${execution.id}`);
|
|
149919
|
+
const result = args.wait ? await waitWithSpinner(wait, interval, args.json) : execution;
|
|
149920
|
+
if (args.logs && !args.json) printExecutionWithLogs(result);
|
|
149921
|
+
else printData(result, args.json);
|
|
149878
149922
|
} else {
|
|
149879
149923
|
const executions = await workflowExecutionsList({
|
|
149880
149924
|
workspaceId: args["workspace-id"],
|
|
@@ -149882,7 +149926,7 @@ const executionsCommand = defineCommand({
|
|
|
149882
149926
|
workflowName: args["workflow-name"],
|
|
149883
149927
|
status: args.status
|
|
149884
149928
|
});
|
|
149885
|
-
|
|
149929
|
+
printData(executions, args.json);
|
|
149886
149930
|
}
|
|
149887
149931
|
})
|
|
149888
149932
|
});
|
|
@@ -149929,7 +149973,7 @@ const resumeCommand = defineCommand({
|
|
|
149929
149973
|
},
|
|
149930
149974
|
args: {
|
|
149931
149975
|
...commonArgs,
|
|
149932
|
-
...
|
|
149976
|
+
...jsonArgs,
|
|
149933
149977
|
executionId: {
|
|
149934
149978
|
type: "positional",
|
|
149935
149979
|
description: "Failed execution ID",
|
|
@@ -149957,7 +150001,6 @@ const resumeCommand = defineCommand({
|
|
|
149957
150001
|
}
|
|
149958
150002
|
},
|
|
149959
150003
|
run: withCommonArgs(async (args) => {
|
|
149960
|
-
const format$2 = parseFormat(args.format);
|
|
149961
150004
|
const interval = parseDuration(args.interval);
|
|
149962
150005
|
const { executionId, wait } = await workflowResume({
|
|
149963
150006
|
executionId: args.executionId,
|
|
@@ -149965,17 +150008,17 @@ const resumeCommand = defineCommand({
|
|
|
149965
150008
|
profile: args.profile,
|
|
149966
150009
|
interval
|
|
149967
150010
|
});
|
|
149968
|
-
if (
|
|
150011
|
+
if (!args.json) {
|
|
149969
150012
|
const { default: consola$2 } = await import("consola");
|
|
149970
150013
|
consola$2.info(`Execution ID: ${executionId}`);
|
|
149971
150014
|
}
|
|
149972
150015
|
if (args.wait) {
|
|
149973
150016
|
const result = await wait();
|
|
149974
|
-
|
|
149975
|
-
} else
|
|
150017
|
+
printData(result, args.json);
|
|
150018
|
+
} else printData({ executionId }, args.json);
|
|
149976
150019
|
})
|
|
149977
150020
|
});
|
|
149978
150021
|
|
|
149979
150022
|
//#endregion
|
|
149980
|
-
export { PATScope, apply, applyCommand, commonArgs, createCommand, deleteCommand, executionsCommand, fetchAll, fetchLatestToken, fetchUserInfo,
|
|
149981
|
-
//# sourceMappingURL=resume-
|
|
150023
|
+
export { PATScope, apply, applyCommand, commonArgs, createCommand, deleteCommand, executionsCommand, fetchAll, fetchLatestToken, fetchUserInfo, generate, generateCommand, generateUserTypes, getCommand, getCommand$1, initOAuth2Client, initOperatorClient, jsonArgs, listCommand, listCommand$1, listCommand$2, listCommand$3, loadAccessToken, loadConfig, loadWorkspaceId, machineUserList, machineUserToken, oauth2ClientGet, oauth2ClientList, printData, readPackageJson, readPlatformConfig, remove, removeCommand, resumeCommand, show, showCommand, startCommand, tokenCommand, withCommonArgs, workflowExecutionGet, workflowExecutionsList, workflowGet, workflowList, workflowResume, workflowStart, workspaceCreate, workspaceDelete, workspaceList, writePlatformConfig };
|
|
150024
|
+
//# sourceMappingURL=resume-B2ba5opn.mjs.map
|