@tailor-platform/sdk 0.16.3 → 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 +17 -0
- package/README.md +75 -8
- package/dist/cli/api.d.mts +5 -1
- package/dist/cli/api.mjs +1 -1
- package/dist/cli/index.mjs +51 -75
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{resume-kyHIaNvK.mjs → resume-B2ba5opn.mjs} +141 -103
- package/dist/{resume-kyHIaNvK.mjs.map → resume-B2ba5opn.mjs.map} +1 -1
- package/dist/utils/test/index.d.mts +8 -2
- 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/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
|
|
|
@@ -1064,7 +1065,7 @@ var require_browser = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src
|
|
|
1064
1065
|
/**
|
|
1065
1066
|
* This is the web browser implementation of `debug()`.
|
|
1066
1067
|
*/
|
|
1067
|
-
exports.formatArgs = formatArgs$
|
|
1068
|
+
exports.formatArgs = formatArgs$1;
|
|
1068
1069
|
exports.save = save$1;
|
|
1069
1070
|
exports.load = load$1;
|
|
1070
1071
|
exports.useColors = useColors$1;
|
|
@@ -1177,7 +1178,7 @@ var require_browser = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src
|
|
|
1177
1178
|
*
|
|
1178
1179
|
* @api public
|
|
1179
1180
|
*/
|
|
1180
|
-
function formatArgs$
|
|
1181
|
+
function formatArgs$1(args) {
|
|
1181
1182
|
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
1182
1183
|
if (!this.useColors) return;
|
|
1183
1184
|
const c = "color: " + this.color;
|
|
@@ -1349,7 +1350,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/no
|
|
|
1349
1350
|
*/
|
|
1350
1351
|
exports.init = init;
|
|
1351
1352
|
exports.log = log;
|
|
1352
|
-
exports.formatArgs = formatArgs
|
|
1353
|
+
exports.formatArgs = formatArgs;
|
|
1353
1354
|
exports.save = save;
|
|
1354
1355
|
exports.load = load;
|
|
1355
1356
|
exports.useColors = useColors;
|
|
@@ -1476,7 +1477,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/no
|
|
|
1476
1477
|
*
|
|
1477
1478
|
* @api public
|
|
1478
1479
|
*/
|
|
1479
|
-
function formatArgs
|
|
1480
|
+
function formatArgs(args) {
|
|
1480
1481
|
const { namespace: name$2, useColors: useColors$2 } = this;
|
|
1481
1482
|
if (useColors$2) {
|
|
1482
1483
|
const c = this.color;
|
|
@@ -144648,25 +144649,28 @@ const SeedGeneratorID = "@tailor-platform/seed";
|
|
|
144648
144649
|
/**
|
|
144649
144650
|
* Generates the exec.mjs script content (Node.js executable)
|
|
144650
144651
|
*/
|
|
144651
|
-
function generateExecScript(machineUserName,
|
|
144652
|
+
function generateExecScript(machineUserName, relativeConfigPath) {
|
|
144652
144653
|
return ml`
|
|
144653
144654
|
import { execSync } from "node:child_process";
|
|
144655
|
+
import { join } from "node:path";
|
|
144654
144656
|
import { show, machineUserToken } from "@tailor-platform/sdk/cli";
|
|
144655
144657
|
|
|
144658
|
+
const configDir = import.meta.dirname;
|
|
144659
|
+
const configPath = join(configDir, "${relativeConfigPath}");
|
|
144660
|
+
|
|
144656
144661
|
console.log("Starting seed data generation...");
|
|
144657
144662
|
|
|
144658
|
-
const appInfo = await show();
|
|
144663
|
+
const appInfo = await show({ configPath });
|
|
144659
144664
|
const endpoint = \`\${appInfo.url}/query\`;
|
|
144660
144665
|
|
|
144661
|
-
const tokenInfo = await machineUserToken({ name: "${machineUserName}" });
|
|
144666
|
+
const tokenInfo = await machineUserToken({ name: "${machineUserName}", configPath });
|
|
144662
144667
|
const headers = JSON.stringify({ Authorization: \`Bearer \${tokenInfo.accessToken}\` });
|
|
144663
144668
|
|
|
144664
|
-
// Build command with platform-specific quoting
|
|
144665
144669
|
const headersArg = process.platform === "win32"
|
|
144666
|
-
? \`"\${headers.replace(/"/g, '\\\\"')}"\`
|
|
144667
|
-
: \`'\${headers}'\`;
|
|
144670
|
+
? \`"\${headers.replace(/"/g, '\\\\"')}"\`
|
|
144671
|
+
: \`'\${headers}'\`;
|
|
144668
144672
|
|
|
144669
|
-
const cmd = \`npx gql-ingest -c
|
|
144673
|
+
const cmd = \`npx gql-ingest -c "\${configDir}" -e "\${endpoint}" --headers \${headersArg}\`;
|
|
144670
144674
|
console.log("Running:", cmd);
|
|
144671
144675
|
|
|
144672
144676
|
try {
|
|
@@ -144693,7 +144697,7 @@ function createSeedGenerator(options) {
|
|
|
144693
144697
|
processTailorDBNamespace: ({ types: types$2 }) => types$2,
|
|
144694
144698
|
processExecutor: (_executor) => void 0,
|
|
144695
144699
|
processResolver: (_args) => void 0,
|
|
144696
|
-
aggregate: ({ input }) => {
|
|
144700
|
+
aggregate: ({ input, configPath }) => {
|
|
144697
144701
|
const entityDependencies = {};
|
|
144698
144702
|
const files = [];
|
|
144699
144703
|
for (const nsResult of input.tailordb) {
|
|
@@ -144755,10 +144759,13 @@ function createSeedGenerator(options) {
|
|
|
144755
144759
|
${Object.entries(dependencies).map(([type, deps]) => `${type}: [${deps.join(", ")}]`).join("\n ")}
|
|
144756
144760
|
`
|
|
144757
144761
|
});
|
|
144758
|
-
if (options.machineUserName)
|
|
144759
|
-
|
|
144760
|
-
|
|
144761
|
-
|
|
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
|
+
}
|
|
144762
144769
|
}
|
|
144763
144770
|
return { files };
|
|
144764
144771
|
}
|
|
@@ -144952,36 +144959,11 @@ const withCommonArgs = (handler) => async ({ args }) => {
|
|
|
144952
144959
|
}
|
|
144953
144960
|
process.exit(0);
|
|
144954
144961
|
};
|
|
144955
|
-
const
|
|
144956
|
-
|
|
144957
|
-
|
|
144958
|
-
|
|
144959
|
-
alias: "f",
|
|
144960
|
-
default: "table"
|
|
144962
|
+
const jsonArgs = { json: {
|
|
144963
|
+
type: "boolean",
|
|
144964
|
+
description: "Output as JSON",
|
|
144965
|
+
default: false
|
|
144961
144966
|
} };
|
|
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
144967
|
|
|
144986
144968
|
//#endregion
|
|
144987
144969
|
//#region src/cli/apply/services/label.ts
|
|
@@ -148427,7 +148409,8 @@ var GenerationManager = class {
|
|
|
148427
148409
|
const result = await gen.aggregate({
|
|
148428
148410
|
input,
|
|
148429
148411
|
executorInputs: Object.values(results.executorResults),
|
|
148430
|
-
baseDir: path$1.join(this.baseDir, gen.id)
|
|
148412
|
+
baseDir: path$1.join(this.baseDir, gen.id),
|
|
148413
|
+
configPath: this.configPath ?? "tailor.config.ts"
|
|
148431
148414
|
});
|
|
148432
148415
|
await Promise.all(result.files.map(async (file) => {
|
|
148433
148416
|
fs$1.mkdirSync(path$1.dirname(file.path), { recursive: true });
|
|
@@ -148540,6 +148523,43 @@ const generateCommand = defineCommand({
|
|
|
148540
148523
|
})
|
|
148541
148524
|
});
|
|
148542
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
|
+
|
|
148543
148563
|
//#endregion
|
|
148544
148564
|
//#region src/cli/show.ts
|
|
148545
148565
|
function applicationInfo(app) {
|
|
@@ -148579,7 +148599,7 @@ const showCommand = defineCommand({
|
|
|
148579
148599
|
},
|
|
148580
148600
|
args: {
|
|
148581
148601
|
...commonArgs,
|
|
148582
|
-
...
|
|
148602
|
+
...jsonArgs,
|
|
148583
148603
|
"workspace-id": {
|
|
148584
148604
|
type: "string",
|
|
148585
148605
|
description: "Workspace ID",
|
|
@@ -148598,13 +148618,12 @@ const showCommand = defineCommand({
|
|
|
148598
148618
|
}
|
|
148599
148619
|
},
|
|
148600
148620
|
run: withCommonArgs(async (args) => {
|
|
148601
|
-
const format$2 = parseFormat(args.format);
|
|
148602
148621
|
const appInfo = await show({
|
|
148603
148622
|
workspaceId: args["workspace-id"],
|
|
148604
148623
|
profile: args.profile,
|
|
148605
148624
|
configPath: args.config
|
|
148606
148625
|
});
|
|
148607
|
-
|
|
148626
|
+
printData(appInfo, args.json);
|
|
148608
148627
|
})
|
|
148609
148628
|
});
|
|
148610
148629
|
|
|
@@ -148757,7 +148776,7 @@ const createCommand = defineCommand({
|
|
|
148757
148776
|
},
|
|
148758
148777
|
args: {
|
|
148759
148778
|
...commonArgs,
|
|
148760
|
-
...
|
|
148779
|
+
...jsonArgs,
|
|
148761
148780
|
name: {
|
|
148762
148781
|
type: "string",
|
|
148763
148782
|
description: "Workspace name",
|
|
@@ -148788,7 +148807,6 @@ const createCommand = defineCommand({
|
|
|
148788
148807
|
}
|
|
148789
148808
|
},
|
|
148790
148809
|
run: withCommonArgs(async (args) => {
|
|
148791
|
-
const format$2 = parseFormat(args.format);
|
|
148792
148810
|
const workspace = await workspaceCreate({
|
|
148793
148811
|
name: args.name,
|
|
148794
148812
|
region: args.region,
|
|
@@ -148796,20 +148814,36 @@ const createCommand = defineCommand({
|
|
|
148796
148814
|
organizationId: args["organization-id"],
|
|
148797
148815
|
folderId: args["folder-id"]
|
|
148798
148816
|
});
|
|
148799
|
-
if (
|
|
148800
|
-
|
|
148817
|
+
if (!args.json) consola$1.success(`Workspace "${args.name}" created successfully.`);
|
|
148818
|
+
printData(workspace, args.json);
|
|
148801
148819
|
})
|
|
148802
148820
|
});
|
|
148803
148821
|
|
|
148804
148822
|
//#endregion
|
|
148805
148823
|
//#region src/cli/workspace/list.ts
|
|
148806
|
-
|
|
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;
|
|
148807
148828
|
const accessToken = await loadAccessToken();
|
|
148808
148829
|
const client = await initOperatorClient(accessToken);
|
|
148809
|
-
|
|
148810
|
-
|
|
148811
|
-
|
|
148812
|
-
|
|
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;
|
|
148813
148847
|
}
|
|
148814
148848
|
const listCommand$3 = defineCommand({
|
|
148815
148849
|
meta: {
|
|
@@ -148818,12 +148852,25 @@ const listCommand$3 = defineCommand({
|
|
|
148818
148852
|
},
|
|
148819
148853
|
args: {
|
|
148820
148854
|
...commonArgs,
|
|
148821
|
-
...
|
|
148855
|
+
...jsonArgs,
|
|
148856
|
+
limit: {
|
|
148857
|
+
type: "string",
|
|
148858
|
+
description: "Maximum number of workspaces to list"
|
|
148859
|
+
}
|
|
148822
148860
|
},
|
|
148823
148861
|
run: withCommonArgs(async (args) => {
|
|
148824
|
-
|
|
148825
|
-
|
|
148826
|
-
|
|
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);
|
|
148827
148874
|
})
|
|
148828
148875
|
});
|
|
148829
148876
|
|
|
@@ -148924,7 +148971,7 @@ const listCommand$2 = defineCommand({
|
|
|
148924
148971
|
},
|
|
148925
148972
|
args: {
|
|
148926
148973
|
...commonArgs,
|
|
148927
|
-
...
|
|
148974
|
+
...jsonArgs,
|
|
148928
148975
|
"workspace-id": {
|
|
148929
148976
|
type: "string",
|
|
148930
148977
|
description: "Workspace ID",
|
|
@@ -148943,13 +148990,12 @@ const listCommand$2 = defineCommand({
|
|
|
148943
148990
|
}
|
|
148944
148991
|
},
|
|
148945
148992
|
run: withCommonArgs(async (args) => {
|
|
148946
|
-
const format$2 = parseFormat(args.format);
|
|
148947
148993
|
const machineUsers = await machineUserList({
|
|
148948
148994
|
workspaceId: args["workspace-id"],
|
|
148949
148995
|
profile: args.profile,
|
|
148950
148996
|
configPath: args.config
|
|
148951
148997
|
});
|
|
148952
|
-
|
|
148998
|
+
printData(machineUsers, args.json);
|
|
148953
148999
|
})
|
|
148954
149000
|
});
|
|
148955
149001
|
|
|
@@ -148993,7 +149039,7 @@ const tokenCommand = defineCommand({
|
|
|
148993
149039
|
},
|
|
148994
149040
|
args: {
|
|
148995
149041
|
...commonArgs,
|
|
148996
|
-
...
|
|
149042
|
+
...jsonArgs,
|
|
148997
149043
|
"workspace-id": {
|
|
148998
149044
|
type: "string",
|
|
148999
149045
|
description: "Workspace ID",
|
|
@@ -149017,7 +149063,6 @@ const tokenCommand = defineCommand({
|
|
|
149017
149063
|
}
|
|
149018
149064
|
},
|
|
149019
149065
|
run: withCommonArgs(async (args) => {
|
|
149020
|
-
const format$2 = parseFormat(args.format);
|
|
149021
149066
|
const token = await machineUserToken({
|
|
149022
149067
|
name: args.name,
|
|
149023
149068
|
workspaceId: args["workspace-id"],
|
|
@@ -149029,7 +149074,7 @@ const tokenCommand = defineCommand({
|
|
|
149029
149074
|
token_type: token.tokenType,
|
|
149030
149075
|
expires_at: token.expiresAt
|
|
149031
149076
|
};
|
|
149032
|
-
|
|
149077
|
+
printData(tokenInfo, args.json);
|
|
149033
149078
|
})
|
|
149034
149079
|
});
|
|
149035
149080
|
|
|
@@ -149101,7 +149146,7 @@ const getCommand$1 = defineCommand({
|
|
|
149101
149146
|
},
|
|
149102
149147
|
args: {
|
|
149103
149148
|
...commonArgs,
|
|
149104
|
-
...
|
|
149149
|
+
...jsonArgs,
|
|
149105
149150
|
name: {
|
|
149106
149151
|
type: "positional",
|
|
149107
149152
|
description: "OAuth2 client name",
|
|
@@ -149125,14 +149170,13 @@ const getCommand$1 = defineCommand({
|
|
|
149125
149170
|
}
|
|
149126
149171
|
},
|
|
149127
149172
|
run: withCommonArgs(async (args) => {
|
|
149128
|
-
const format$2 = parseFormat(args.format);
|
|
149129
149173
|
const credentials = await oauth2ClientGet({
|
|
149130
149174
|
name: args.name,
|
|
149131
149175
|
workspaceId: args["workspace-id"],
|
|
149132
149176
|
profile: args.profile,
|
|
149133
149177
|
configPath: args.config
|
|
149134
149178
|
});
|
|
149135
|
-
|
|
149179
|
+
printData(credentials, args.json);
|
|
149136
149180
|
})
|
|
149137
149181
|
});
|
|
149138
149182
|
|
|
@@ -149170,7 +149214,7 @@ const listCommand$1 = defineCommand({
|
|
|
149170
149214
|
},
|
|
149171
149215
|
args: {
|
|
149172
149216
|
...commonArgs,
|
|
149173
|
-
...
|
|
149217
|
+
...jsonArgs,
|
|
149174
149218
|
"workspace-id": {
|
|
149175
149219
|
type: "string",
|
|
149176
149220
|
description: "Workspace ID",
|
|
@@ -149189,13 +149233,12 @@ const listCommand$1 = defineCommand({
|
|
|
149189
149233
|
}
|
|
149190
149234
|
},
|
|
149191
149235
|
run: withCommonArgs(async (args) => {
|
|
149192
|
-
const format$2 = parseFormat(args.format);
|
|
149193
149236
|
const oauth2Clients = await oauth2ClientList({
|
|
149194
149237
|
workspaceId: args["workspace-id"],
|
|
149195
149238
|
profile: args.profile,
|
|
149196
149239
|
configPath: args.config
|
|
149197
149240
|
});
|
|
149198
|
-
|
|
149241
|
+
printData(oauth2Clients, args.json);
|
|
149199
149242
|
})
|
|
149200
149243
|
});
|
|
149201
149244
|
|
|
@@ -149288,7 +149331,7 @@ const listCommand = defineCommand({
|
|
|
149288
149331
|
},
|
|
149289
149332
|
args: {
|
|
149290
149333
|
...commonArgs,
|
|
149291
|
-
...
|
|
149334
|
+
...jsonArgs,
|
|
149292
149335
|
"workspace-id": {
|
|
149293
149336
|
type: "string",
|
|
149294
149337
|
description: "Workspace ID",
|
|
@@ -149301,12 +149344,11 @@ const listCommand = defineCommand({
|
|
|
149301
149344
|
}
|
|
149302
149345
|
},
|
|
149303
149346
|
run: withCommonArgs(async (args) => {
|
|
149304
|
-
const format$2 = parseFormat(args.format);
|
|
149305
149347
|
const workflows = await workflowList({
|
|
149306
149348
|
workspaceId: args["workspace-id"],
|
|
149307
149349
|
profile: args.profile
|
|
149308
149350
|
});
|
|
149309
|
-
if (
|
|
149351
|
+
if (args.json) console.log(JSON.stringify(workflows));
|
|
149310
149352
|
else {
|
|
149311
149353
|
if (workflows.length === 0) {
|
|
149312
149354
|
console.log("No workflows found.");
|
|
@@ -149322,7 +149364,7 @@ const listCommand = defineCommand({
|
|
|
149322
149364
|
w$1.name,
|
|
149323
149365
|
w$1.mainJob,
|
|
149324
149366
|
w$1.jobFunctions.toString(),
|
|
149325
|
-
w$1.updatedAt
|
|
149367
|
+
humanizeRelativeTime(w$1.updatedAt)
|
|
149326
149368
|
]);
|
|
149327
149369
|
process.stdout.write(table([headers, ...rows]));
|
|
149328
149370
|
}
|
|
@@ -149372,7 +149414,7 @@ const getCommand = defineCommand({
|
|
|
149372
149414
|
},
|
|
149373
149415
|
args: {
|
|
149374
149416
|
...commonArgs,
|
|
149375
|
-
...
|
|
149417
|
+
...jsonArgs,
|
|
149376
149418
|
nameOrId: {
|
|
149377
149419
|
type: "positional",
|
|
149378
149420
|
description: "Workflow name or ID",
|
|
@@ -149390,13 +149432,12 @@ const getCommand = defineCommand({
|
|
|
149390
149432
|
}
|
|
149391
149433
|
},
|
|
149392
149434
|
run: withCommonArgs(async (args) => {
|
|
149393
|
-
const format$2 = parseFormat(args.format);
|
|
149394
149435
|
const workflow = await workflowGet({
|
|
149395
149436
|
nameOrId: args.nameOrId,
|
|
149396
149437
|
workspaceId: args["workspace-id"],
|
|
149397
149438
|
profile: args.profile
|
|
149398
149439
|
});
|
|
149399
|
-
|
|
149440
|
+
printData(workflow, args.json);
|
|
149400
149441
|
})
|
|
149401
149442
|
});
|
|
149402
149443
|
|
|
@@ -149553,7 +149594,7 @@ const startCommand = defineCommand({
|
|
|
149553
149594
|
},
|
|
149554
149595
|
args: {
|
|
149555
149596
|
...commonArgs,
|
|
149556
|
-
...
|
|
149597
|
+
...jsonArgs,
|
|
149557
149598
|
nameOrId: {
|
|
149558
149599
|
type: "positional",
|
|
149559
149600
|
description: "Workflow name or ID",
|
|
@@ -149598,7 +149639,6 @@ const startCommand = defineCommand({
|
|
|
149598
149639
|
}
|
|
149599
149640
|
},
|
|
149600
149641
|
run: withCommonArgs(async (args) => {
|
|
149601
|
-
const format$2 = parseFormat(args.format);
|
|
149602
149642
|
const interval = parseDuration(args.interval);
|
|
149603
149643
|
const { executionId, wait } = await workflowStart({
|
|
149604
149644
|
nameOrId: args.nameOrId,
|
|
@@ -149609,11 +149649,11 @@ const startCommand = defineCommand({
|
|
|
149609
149649
|
configPath: args.config,
|
|
149610
149650
|
interval
|
|
149611
149651
|
});
|
|
149612
|
-
if (
|
|
149652
|
+
if (!args.json) consola.info(`Execution ID: ${executionId}`);
|
|
149613
149653
|
if (args.wait) {
|
|
149614
149654
|
const result = await wait();
|
|
149615
|
-
|
|
149616
|
-
} else
|
|
149655
|
+
printData(result, args.json);
|
|
149656
|
+
} else printData({ executionId }, args.json);
|
|
149617
149657
|
})
|
|
149618
149658
|
});
|
|
149619
149659
|
|
|
@@ -149766,8 +149806,8 @@ function parseDuration$1(duration) {
|
|
|
149766
149806
|
default: throw new Error(`Unknown duration unit: ${unit}`);
|
|
149767
149807
|
}
|
|
149768
149808
|
}
|
|
149769
|
-
async function waitWithSpinner(waitFn, interval,
|
|
149770
|
-
const spinner =
|
|
149809
|
+
async function waitWithSpinner(waitFn, interval, json) {
|
|
149810
|
+
const spinner = !json ? ora().start("Waiting...") : null;
|
|
149771
149811
|
const updateInterval = setInterval(() => {
|
|
149772
149812
|
if (spinner) spinner.text = `Polling... (${formatTime(/* @__PURE__ */ new Date())})`;
|
|
149773
149813
|
}, interval);
|
|
@@ -149823,7 +149863,7 @@ const executionsCommand = defineCommand({
|
|
|
149823
149863
|
},
|
|
149824
149864
|
args: {
|
|
149825
149865
|
...commonArgs,
|
|
149826
|
-
...
|
|
149866
|
+
...jsonArgs,
|
|
149827
149867
|
executionId: {
|
|
149828
149868
|
type: "positional",
|
|
149829
149869
|
description: "Execution ID (if provided, shows details)",
|
|
@@ -149866,7 +149906,6 @@ const executionsCommand = defineCommand({
|
|
|
149866
149906
|
}
|
|
149867
149907
|
},
|
|
149868
149908
|
run: withCommonArgs(async (args) => {
|
|
149869
|
-
const format$2 = parseFormat(args.format);
|
|
149870
149909
|
if (args.executionId) {
|
|
149871
149910
|
const interval = parseDuration$1(args.interval);
|
|
149872
149911
|
const { execution, wait } = await workflowExecutionGet({
|
|
@@ -149876,10 +149915,10 @@ const executionsCommand = defineCommand({
|
|
|
149876
149915
|
interval,
|
|
149877
149916
|
logs: args.logs
|
|
149878
149917
|
});
|
|
149879
|
-
if (
|
|
149880
|
-
const result = args.wait ? await waitWithSpinner(wait, interval,
|
|
149881
|
-
if (args.logs &&
|
|
149882
|
-
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);
|
|
149883
149922
|
} else {
|
|
149884
149923
|
const executions = await workflowExecutionsList({
|
|
149885
149924
|
workspaceId: args["workspace-id"],
|
|
@@ -149887,7 +149926,7 @@ const executionsCommand = defineCommand({
|
|
|
149887
149926
|
workflowName: args["workflow-name"],
|
|
149888
149927
|
status: args.status
|
|
149889
149928
|
});
|
|
149890
|
-
|
|
149929
|
+
printData(executions, args.json);
|
|
149891
149930
|
}
|
|
149892
149931
|
})
|
|
149893
149932
|
});
|
|
@@ -149934,7 +149973,7 @@ const resumeCommand = defineCommand({
|
|
|
149934
149973
|
},
|
|
149935
149974
|
args: {
|
|
149936
149975
|
...commonArgs,
|
|
149937
|
-
...
|
|
149976
|
+
...jsonArgs,
|
|
149938
149977
|
executionId: {
|
|
149939
149978
|
type: "positional",
|
|
149940
149979
|
description: "Failed execution ID",
|
|
@@ -149962,7 +150001,6 @@ const resumeCommand = defineCommand({
|
|
|
149962
150001
|
}
|
|
149963
150002
|
},
|
|
149964
150003
|
run: withCommonArgs(async (args) => {
|
|
149965
|
-
const format$2 = parseFormat(args.format);
|
|
149966
150004
|
const interval = parseDuration(args.interval);
|
|
149967
150005
|
const { executionId, wait } = await workflowResume({
|
|
149968
150006
|
executionId: args.executionId,
|
|
@@ -149970,17 +150008,17 @@ const resumeCommand = defineCommand({
|
|
|
149970
150008
|
profile: args.profile,
|
|
149971
150009
|
interval
|
|
149972
150010
|
});
|
|
149973
|
-
if (
|
|
150011
|
+
if (!args.json) {
|
|
149974
150012
|
const { default: consola$2 } = await import("consola");
|
|
149975
150013
|
consola$2.info(`Execution ID: ${executionId}`);
|
|
149976
150014
|
}
|
|
149977
150015
|
if (args.wait) {
|
|
149978
150016
|
const result = await wait();
|
|
149979
|
-
|
|
149980
|
-
} else
|
|
150017
|
+
printData(result, args.json);
|
|
150018
|
+
} else printData({ executionId }, args.json);
|
|
149981
150019
|
})
|
|
149982
150020
|
});
|
|
149983
150021
|
|
|
149984
150022
|
//#endregion
|
|
149985
|
-
export { PATScope, apply, applyCommand, commonArgs, createCommand, deleteCommand, executionsCommand, fetchAll, fetchLatestToken, fetchUserInfo,
|
|
149986
|
-
//# 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
|