@tailor-platform/sdk 1.6.1 → 1.6.2
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 +6 -0
- package/README.md +1 -1
- package/dist/application-3rIUD7cq.mjs +5 -0
- package/dist/{application-ByT5pepr.mjs → application-4cO5Zvfo.mjs} +2 -2
- package/dist/{application-ByT5pepr.mjs.map → application-4cO5Zvfo.mjs.map} +1 -1
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.mjs +281 -417
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +2 -8
- package/dist/cli/lib.mjs +2 -2
- package/dist/configure/index.d.mts +2 -2
- package/dist/{index-DEUmmYtB.d.mts → index-Dg8SBgrV.d.mts} +4 -9
- package/dist/{index-lFUelrvN.d.mts → index-DjdAxcQn.d.mts} +8 -3
- package/dist/{list-DU6Y_JM5.mjs → list-Cgj8IR2N.mjs} +240 -416
- package/dist/list-Cgj8IR2N.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +2 -2
- package/docs/quickstart.md +1 -1
- package/docs/testing.md +1 -1
- package/package.json +2 -2
- package/dist/application-dwcUabL3.mjs +0 -5
- package/dist/list-DU6Y_JM5.mjs.map +0 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "../chunk-CIV_ash9.mjs";
|
|
3
3
|
import "../auth-0Zh4xp4z.mjs";
|
|
4
|
-
import { $ as getMigrationFiles, B as parseMigrationLabelNumber, Ct as PATScope, D as listCommand$6, Dt as jsonArgs, E as removeCommand, Et as deploymentArgs, I as generateCommand$1, M as tokenCommand, N as listCommand$5, Ot as withCommonArgs, Q as getMigrationFilePath, R as applyCommand, S as logBetaWarning, St as readPackageJson, Tt as confirmationArgs, Y as formatMigrationNumber, _t as writePlatformConfig, a as createCommand$3, bt as initOAuth2Client, ct as trnPrefix, d as listCommand$7, ft as apiCommand, gt as readPlatformConfig, h as executionsCommand, ht as loadWorkspaceId, k as getCommand$1, kt as workspaceArgs, l as startCommand, mt as loadAccessToken, nt as loadDiff, p as getCommand$2, pt as fetchLatestToken, r as deleteCommand$3, s as resumeCommand, st as getNamespacesWithMigrations, t as listCommand$8, tt as isValidMigrationNumber, ut as loadConfig, vt as fetchAll, w as showCommand, wt as commonArgs, x as generateCommand, xt as initOperatorClient, y as truncateCommand, yt as fetchUserInfo } from "../list-
|
|
5
|
-
import { d as styles, u as logger } from "../application-
|
|
4
|
+
import { $ as getMigrationFiles, B as parseMigrationLabelNumber, Ct as PATScope, D as listCommand$6, Dt as jsonArgs, E as removeCommand, Et as deploymentArgs, I as generateCommand$1, M as tokenCommand, N as listCommand$5, Ot as withCommonArgs, Q as getMigrationFilePath, R as applyCommand, S as logBetaWarning, St as readPackageJson, Tt as confirmationArgs, Y as formatMigrationNumber, _t as writePlatformConfig, a as createCommand$3, bt as initOAuth2Client, ct as trnPrefix, d as listCommand$7, ft as apiCommand, gt as readPlatformConfig, h as executionsCommand, ht as loadWorkspaceId, k as getCommand$1, kt as workspaceArgs, l as startCommand, mt as loadAccessToken, nt as loadDiff, p as getCommand$2, pt as fetchLatestToken, r as deleteCommand$3, s as resumeCommand, st as getNamespacesWithMigrations, t as listCommand$8, tt as isValidMigrationNumber, ut as loadConfig, vt as fetchAll, w as showCommand, wt as commonArgs, x as generateCommand, xt as initOperatorClient, y as truncateCommand, yt as fetchUserInfo } from "../list-Cgj8IR2N.mjs";
|
|
5
|
+
import { d as styles, u as logger } from "../application-4cO5Zvfo.mjs";
|
|
6
6
|
import { createRequire, register } from "node:module";
|
|
7
|
-
import { defineCommand, runCommand, runMain } from "
|
|
7
|
+
import { arg, defineCommand, runCommand, runMain } from "politty";
|
|
8
|
+
import { z } from "zod";
|
|
8
9
|
import * as fs$1 from "node:fs";
|
|
9
10
|
import * as path from "pathe";
|
|
10
11
|
import { generateCodeVerifier } from "@badgateway/oauth2-client";
|
|
@@ -35,24 +36,19 @@ const detectPackageManager = () => {
|
|
|
35
36
|
return name;
|
|
36
37
|
};
|
|
37
38
|
const initCommand = defineCommand({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
args: {
|
|
39
|
+
name: "init",
|
|
40
|
+
description: "Initialize a new project using create-sdk",
|
|
41
|
+
args: z.object({
|
|
43
42
|
...commonArgs,
|
|
44
|
-
name: {
|
|
45
|
-
|
|
46
|
-
description: "Project name"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
alias: "t"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
43
|
+
name: arg(z.string().optional(), {
|
|
44
|
+
positional: true,
|
|
45
|
+
description: "Project name"
|
|
46
|
+
}),
|
|
47
|
+
template: arg(z.string().optional(), {
|
|
48
|
+
alias: "t",
|
|
49
|
+
description: "Template name"
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
56
52
|
run: withCommonArgs(async (args) => {
|
|
57
53
|
const packageJson$1 = await readPackageJson();
|
|
58
54
|
const version = packageJson$1.version && packageJson$1.version !== "0.0.0" ? packageJson$1.version : "latest";
|
|
@@ -145,11 +141,9 @@ const startAuthServer = async () => {
|
|
|
145
141
|
});
|
|
146
142
|
};
|
|
147
143
|
const loginCommand = defineCommand({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
args: commonArgs,
|
|
144
|
+
name: "login",
|
|
145
|
+
description: "Login to Tailor Platform",
|
|
146
|
+
args: z.object({ ...commonArgs }),
|
|
153
147
|
run: withCommonArgs(async () => {
|
|
154
148
|
await startAuthServer();
|
|
155
149
|
logger.success("Successfully logged in to Tailor Platform.");
|
|
@@ -159,11 +153,9 @@ const loginCommand = defineCommand({
|
|
|
159
153
|
//#endregion
|
|
160
154
|
//#region src/cli/logout.ts
|
|
161
155
|
const logoutCommand = defineCommand({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
args: commonArgs,
|
|
156
|
+
name: "logout",
|
|
157
|
+
description: "Logout from Tailor Platform",
|
|
158
|
+
args: z.object({ ...commonArgs }),
|
|
167
159
|
run: withCommonArgs(async () => {
|
|
168
160
|
const pfConfig = readPlatformConfig();
|
|
169
161
|
const tokens = pfConfig.current_user ? pfConfig.users[pfConfig.current_user] : void 0;
|
|
@@ -186,32 +178,28 @@ const logoutCommand = defineCommand({
|
|
|
186
178
|
//#endregion
|
|
187
179
|
//#region src/cli/machineuser/index.ts
|
|
188
180
|
const machineuserCommand = defineCommand({
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
description: "Manage machine users"
|
|
192
|
-
},
|
|
181
|
+
name: "machineuser",
|
|
182
|
+
description: "Manage machine users",
|
|
193
183
|
subCommands: {
|
|
194
184
|
list: listCommand$5,
|
|
195
185
|
token: tokenCommand
|
|
196
186
|
},
|
|
197
187
|
async run() {
|
|
198
|
-
await runCommand(listCommand$5,
|
|
188
|
+
await runCommand(listCommand$5, []);
|
|
199
189
|
}
|
|
200
190
|
});
|
|
201
191
|
|
|
202
192
|
//#endregion
|
|
203
193
|
//#region src/cli/oauth2client/index.ts
|
|
204
194
|
const oauth2clientCommand = defineCommand({
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
description: "Manage OAuth2 clients"
|
|
208
|
-
},
|
|
195
|
+
name: "oauth2client",
|
|
196
|
+
description: "Manage OAuth2 clients",
|
|
209
197
|
subCommands: {
|
|
210
198
|
get: getCommand$1,
|
|
211
199
|
list: listCommand$6
|
|
212
200
|
},
|
|
213
201
|
async run() {
|
|
214
|
-
await runCommand(listCommand$6,
|
|
202
|
+
await runCommand(listCommand$6, []);
|
|
215
203
|
}
|
|
216
204
|
});
|
|
217
205
|
|
|
@@ -219,14 +207,12 @@ const oauth2clientCommand = defineCommand({
|
|
|
219
207
|
//#region src/cli/open.ts
|
|
220
208
|
const consoleBaseUrl = "https://console.tailor.tech";
|
|
221
209
|
const openCommand = defineCommand({
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
args: {
|
|
210
|
+
name: "open",
|
|
211
|
+
description: "Open Tailor Platform Console for the application",
|
|
212
|
+
args: z.object({
|
|
227
213
|
...commonArgs,
|
|
228
214
|
...deploymentArgs
|
|
229
|
-
},
|
|
215
|
+
}),
|
|
230
216
|
run: withCommonArgs(async (args) => {
|
|
231
217
|
const workspaceId = loadWorkspaceId({
|
|
232
218
|
workspaceId: args["workspace-id"],
|
|
@@ -251,31 +237,24 @@ const openCommand = defineCommand({
|
|
|
251
237
|
//#endregion
|
|
252
238
|
//#region src/cli/profile/create.ts
|
|
253
239
|
const createCommand$2 = defineCommand({
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
args: {
|
|
240
|
+
name: "create",
|
|
241
|
+
description: "Create new profile",
|
|
242
|
+
args: z.object({
|
|
259
243
|
...commonArgs,
|
|
260
244
|
...jsonArgs,
|
|
261
|
-
name: {
|
|
262
|
-
|
|
263
|
-
description: "Profile name"
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
alias: "
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
description: "Workspace ID",
|
|
275
|
-
required: true,
|
|
276
|
-
alias: "w"
|
|
277
|
-
}
|
|
278
|
-
},
|
|
245
|
+
name: arg(z.string(), {
|
|
246
|
+
positional: true,
|
|
247
|
+
description: "Profile name"
|
|
248
|
+
}),
|
|
249
|
+
user: arg(z.string(), {
|
|
250
|
+
alias: "u",
|
|
251
|
+
description: "User email"
|
|
252
|
+
}),
|
|
253
|
+
"workspace-id": arg(z.string(), {
|
|
254
|
+
alias: "w",
|
|
255
|
+
description: "Workspace ID"
|
|
256
|
+
})
|
|
257
|
+
}),
|
|
279
258
|
run: withCommonArgs(async (args) => {
|
|
280
259
|
const config = readPlatformConfig();
|
|
281
260
|
if (config.profiles[args.name]) throw new Error(`Profile "${args.name}" already exists.`);
|
|
@@ -302,18 +281,15 @@ const createCommand$2 = defineCommand({
|
|
|
302
281
|
//#endregion
|
|
303
282
|
//#region src/cli/profile/delete.ts
|
|
304
283
|
const deleteCommand$2 = defineCommand({
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
args: {
|
|
284
|
+
name: "delete",
|
|
285
|
+
description: "Delete profile",
|
|
286
|
+
args: z.object({
|
|
310
287
|
...commonArgs,
|
|
311
|
-
name: {
|
|
312
|
-
|
|
313
|
-
description: "Profile name"
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
},
|
|
288
|
+
name: arg(z.string(), {
|
|
289
|
+
positional: true,
|
|
290
|
+
description: "Profile name"
|
|
291
|
+
})
|
|
292
|
+
}),
|
|
317
293
|
run: withCommonArgs(async (args) => {
|
|
318
294
|
const config = readPlatformConfig();
|
|
319
295
|
if (!config.profiles[args.name]) throw new Error(`Profile "${args.name}" not found.`);
|
|
@@ -326,14 +302,12 @@ const deleteCommand$2 = defineCommand({
|
|
|
326
302
|
//#endregion
|
|
327
303
|
//#region src/cli/profile/list.ts
|
|
328
304
|
const listCommand$4 = defineCommand({
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
},
|
|
333
|
-
args: {
|
|
305
|
+
name: "list",
|
|
306
|
+
description: "List all profiles",
|
|
307
|
+
args: z.object({
|
|
334
308
|
...commonArgs,
|
|
335
309
|
...jsonArgs
|
|
336
|
-
},
|
|
310
|
+
}),
|
|
337
311
|
run: withCommonArgs(async () => {
|
|
338
312
|
const config = readPlatformConfig();
|
|
339
313
|
const profiles = Object.entries(config.profiles);
|
|
@@ -356,29 +330,24 @@ const listCommand$4 = defineCommand({
|
|
|
356
330
|
//#endregion
|
|
357
331
|
//#region src/cli/profile/update.ts
|
|
358
332
|
const updateCommand$1 = defineCommand({
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
args: {
|
|
333
|
+
name: "update",
|
|
334
|
+
description: "Update profile properties",
|
|
335
|
+
args: z.object({
|
|
364
336
|
...commonArgs,
|
|
365
337
|
...jsonArgs,
|
|
366
|
-
name: {
|
|
367
|
-
|
|
368
|
-
description: "Profile name"
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
alias: "w"
|
|
380
|
-
}
|
|
381
|
-
},
|
|
338
|
+
name: arg(z.string(), {
|
|
339
|
+
positional: true,
|
|
340
|
+
description: "Profile name"
|
|
341
|
+
}),
|
|
342
|
+
user: arg(z.string().optional(), {
|
|
343
|
+
alias: "u",
|
|
344
|
+
description: "New user email"
|
|
345
|
+
}),
|
|
346
|
+
"workspace-id": arg(z.string().optional(), {
|
|
347
|
+
alias: "w",
|
|
348
|
+
description: "New workspace ID"
|
|
349
|
+
})
|
|
350
|
+
}),
|
|
382
351
|
run: withCommonArgs(async (args) => {
|
|
383
352
|
const config = readPlatformConfig();
|
|
384
353
|
if (!config.profiles[args.name]) throw new Error(`Profile "${args.name}" not found.`);
|
|
@@ -409,10 +378,8 @@ const updateCommand$1 = defineCommand({
|
|
|
409
378
|
//#endregion
|
|
410
379
|
//#region src/cli/profile/index.ts
|
|
411
380
|
const profileCommand = defineCommand({
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
description: "Manage workspace profiles (user + workspace combinations)"
|
|
415
|
-
},
|
|
381
|
+
name: "profile",
|
|
382
|
+
description: "Manage workspace profiles (user + workspace combinations)",
|
|
416
383
|
subCommands: {
|
|
417
384
|
create: createCommand$2,
|
|
418
385
|
delete: deleteCommand$2,
|
|
@@ -420,7 +387,7 @@ const profileCommand = defineCommand({
|
|
|
420
387
|
update: updateCommand$1
|
|
421
388
|
},
|
|
422
389
|
async run() {
|
|
423
|
-
await runCommand(listCommand$4,
|
|
390
|
+
await runCommand(listCommand$4, []);
|
|
424
391
|
}
|
|
425
392
|
});
|
|
426
393
|
|
|
@@ -429,49 +396,41 @@ const profileCommand = defineCommand({
|
|
|
429
396
|
/**
|
|
430
397
|
* Arguments for specify secret key
|
|
431
398
|
*/
|
|
432
|
-
const vaultArgs = { "vault-name": {
|
|
433
|
-
type: "string",
|
|
434
|
-
description: "Vault name",
|
|
399
|
+
const vaultArgs = { "vault-name": arg(z.string(), {
|
|
435
400
|
alias: "V",
|
|
436
|
-
|
|
437
|
-
} };
|
|
401
|
+
description: "Vault name"
|
|
402
|
+
}) };
|
|
438
403
|
/**
|
|
439
404
|
* Arguments for specify secret key
|
|
440
405
|
*/
|
|
441
406
|
const secretIdentifyArgs = {
|
|
442
407
|
...vaultArgs,
|
|
443
|
-
name: {
|
|
444
|
-
type: "string",
|
|
445
|
-
description: "Secret name",
|
|
408
|
+
name: arg(z.string(), {
|
|
446
409
|
alias: "n",
|
|
447
|
-
|
|
448
|
-
}
|
|
410
|
+
description: "Secret name"
|
|
411
|
+
})
|
|
449
412
|
};
|
|
450
413
|
/**
|
|
451
414
|
* Arguments for specify secret key
|
|
452
415
|
*/
|
|
453
416
|
const secretValueArgs = {
|
|
454
417
|
...secretIdentifyArgs,
|
|
455
|
-
value: {
|
|
456
|
-
type: "string",
|
|
457
|
-
description: "Secret value",
|
|
418
|
+
value: arg(z.string(), {
|
|
458
419
|
alias: "v",
|
|
459
|
-
|
|
460
|
-
}
|
|
420
|
+
description: "Secret value"
|
|
421
|
+
})
|
|
461
422
|
};
|
|
462
423
|
|
|
463
424
|
//#endregion
|
|
464
425
|
//#region src/cli/secret/create.ts
|
|
465
426
|
const createSecretCommand = defineCommand({
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
},
|
|
470
|
-
args: {
|
|
427
|
+
name: "create",
|
|
428
|
+
description: "Create a secret in a vault",
|
|
429
|
+
args: z.object({
|
|
471
430
|
...commonArgs,
|
|
472
431
|
...workspaceArgs,
|
|
473
432
|
...secretValueArgs
|
|
474
|
-
},
|
|
433
|
+
}),
|
|
475
434
|
run: withCommonArgs(async (args) => {
|
|
476
435
|
const client = await initOperatorClient(await loadAccessToken({
|
|
477
436
|
useProfile: true,
|
|
@@ -502,16 +461,14 @@ const createSecretCommand = defineCommand({
|
|
|
502
461
|
//#endregion
|
|
503
462
|
//#region src/cli/secret/delete.ts
|
|
504
463
|
const deleteSecretCommand = defineCommand({
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
},
|
|
509
|
-
args: {
|
|
464
|
+
name: "delete",
|
|
465
|
+
description: "Delete a secret in a vault",
|
|
466
|
+
args: z.object({
|
|
510
467
|
...commonArgs,
|
|
511
468
|
...workspaceArgs,
|
|
512
469
|
...secretIdentifyArgs,
|
|
513
470
|
...confirmationArgs
|
|
514
|
-
},
|
|
471
|
+
}),
|
|
515
472
|
run: withCommonArgs(async (args) => {
|
|
516
473
|
const client = await initOperatorClient(await loadAccessToken({
|
|
517
474
|
useProfile: true,
|
|
@@ -574,16 +531,14 @@ async function secretList(options) {
|
|
|
574
531
|
})).map(secretInfo);
|
|
575
532
|
}
|
|
576
533
|
const listSecretCommand = defineCommand({
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
},
|
|
581
|
-
args: {
|
|
534
|
+
name: "list",
|
|
535
|
+
description: "List secrets in a vault",
|
|
536
|
+
args: z.object({
|
|
582
537
|
...commonArgs,
|
|
583
538
|
...jsonArgs,
|
|
584
539
|
...workspaceArgs,
|
|
585
540
|
...vaultArgs
|
|
586
|
-
},
|
|
541
|
+
}),
|
|
587
542
|
run: withCommonArgs(async (args) => {
|
|
588
543
|
try {
|
|
589
544
|
const secrets = await secretList({
|
|
@@ -602,15 +557,13 @@ const listSecretCommand = defineCommand({
|
|
|
602
557
|
//#endregion
|
|
603
558
|
//#region src/cli/secret/update.ts
|
|
604
559
|
const updateSecretCommand = defineCommand({
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
},
|
|
609
|
-
args: {
|
|
560
|
+
name: "update",
|
|
561
|
+
description: "Update a secret in a vault",
|
|
562
|
+
args: z.object({
|
|
610
563
|
...commonArgs,
|
|
611
564
|
...workspaceArgs,
|
|
612
565
|
...secretValueArgs
|
|
613
|
-
},
|
|
566
|
+
}),
|
|
614
567
|
run: withCommonArgs(async (args) => {
|
|
615
568
|
const client = await initOperatorClient(await loadAccessToken({
|
|
616
569
|
useProfile: true,
|
|
@@ -637,24 +590,21 @@ const updateSecretCommand = defineCommand({
|
|
|
637
590
|
|
|
638
591
|
//#endregion
|
|
639
592
|
//#region src/cli/secret/vault/args.ts
|
|
640
|
-
const nameArgs = { name: {
|
|
641
|
-
|
|
642
|
-
description: "Vault name"
|
|
643
|
-
|
|
644
|
-
} };
|
|
593
|
+
const nameArgs = { name: arg(z.string(), {
|
|
594
|
+
positional: true,
|
|
595
|
+
description: "Vault name"
|
|
596
|
+
}) };
|
|
645
597
|
|
|
646
598
|
//#endregion
|
|
647
599
|
//#region src/cli/secret/vault/create.ts
|
|
648
600
|
const createCommand$1 = defineCommand({
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
},
|
|
653
|
-
args: {
|
|
601
|
+
name: "create",
|
|
602
|
+
description: "Create a Secret Manager vault",
|
|
603
|
+
args: z.object({
|
|
654
604
|
...commonArgs,
|
|
655
605
|
...workspaceArgs,
|
|
656
606
|
...nameArgs
|
|
657
|
-
},
|
|
607
|
+
}),
|
|
658
608
|
run: withCommonArgs(async (args) => {
|
|
659
609
|
const client = await initOperatorClient(await loadAccessToken({
|
|
660
610
|
useProfile: true,
|
|
@@ -680,16 +630,14 @@ const createCommand$1 = defineCommand({
|
|
|
680
630
|
//#endregion
|
|
681
631
|
//#region src/cli/secret/vault/delete.ts
|
|
682
632
|
const deleteCommand$1 = defineCommand({
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
},
|
|
687
|
-
args: {
|
|
633
|
+
name: "delete",
|
|
634
|
+
description: "Delete a Secret Manager vault",
|
|
635
|
+
args: z.object({
|
|
688
636
|
...commonArgs,
|
|
689
637
|
...workspaceArgs,
|
|
690
638
|
...nameArgs,
|
|
691
639
|
...confirmationArgs
|
|
692
|
-
},
|
|
640
|
+
}),
|
|
693
641
|
run: withCommonArgs(async (args) => {
|
|
694
642
|
const client = await initOperatorClient(await loadAccessToken({
|
|
695
643
|
useProfile: true,
|
|
@@ -750,15 +698,13 @@ async function vaultList(options) {
|
|
|
750
698
|
})).map(vaultInfo);
|
|
751
699
|
}
|
|
752
700
|
const listCommand$3 = defineCommand({
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
},
|
|
757
|
-
args: {
|
|
701
|
+
name: "list",
|
|
702
|
+
description: "List Secret Manager vaults",
|
|
703
|
+
args: z.object({
|
|
758
704
|
...commonArgs,
|
|
759
705
|
...jsonArgs,
|
|
760
706
|
...workspaceArgs
|
|
761
|
-
},
|
|
707
|
+
}),
|
|
762
708
|
run: withCommonArgs(async (args) => {
|
|
763
709
|
const vaults = await vaultList({
|
|
764
710
|
workspaceId: args["workspace-id"],
|
|
@@ -771,27 +717,23 @@ const listCommand$3 = defineCommand({
|
|
|
771
717
|
//#endregion
|
|
772
718
|
//#region src/cli/secret/vault/index.ts
|
|
773
719
|
const vaultCommand = defineCommand({
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
description: "Manage Secret Manager vaults"
|
|
777
|
-
},
|
|
720
|
+
name: "vault",
|
|
721
|
+
description: "Manage Secret Manager vaults",
|
|
778
722
|
subCommands: {
|
|
779
723
|
create: createCommand$1,
|
|
780
724
|
delete: deleteCommand$1,
|
|
781
725
|
list: listCommand$3
|
|
782
726
|
},
|
|
783
727
|
async run() {
|
|
784
|
-
await runCommand(listCommand$3,
|
|
728
|
+
await runCommand(listCommand$3, []);
|
|
785
729
|
}
|
|
786
730
|
});
|
|
787
731
|
|
|
788
732
|
//#endregion
|
|
789
733
|
//#region src/cli/secret/index.ts
|
|
790
734
|
const secretCommand = defineCommand({
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
description: "Manage secrets and vaults"
|
|
794
|
-
},
|
|
735
|
+
name: "secret",
|
|
736
|
+
description: "Manage secrets and vaults",
|
|
795
737
|
subCommands: {
|
|
796
738
|
create: createSecretCommand,
|
|
797
739
|
delete: deleteSecretCommand,
|
|
@@ -800,7 +742,7 @@ const secretCommand = defineCommand({
|
|
|
800
742
|
vault: vaultCommand
|
|
801
743
|
},
|
|
802
744
|
async run() {
|
|
803
|
-
await runCommand(vaultCommand,
|
|
745
|
+
await runCommand(vaultCommand, []);
|
|
804
746
|
}
|
|
805
747
|
});
|
|
806
748
|
|
|
@@ -962,27 +904,21 @@ function logSkippedFiles(skippedFiles) {
|
|
|
962
904
|
for (const file of skippedFiles) logger.log(` - ${file}`);
|
|
963
905
|
}
|
|
964
906
|
const deployCommand = defineCommand({
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
},
|
|
969
|
-
args: {
|
|
907
|
+
name: "deploy",
|
|
908
|
+
description: "Deploy a static website",
|
|
909
|
+
args: z.object({
|
|
970
910
|
...commonArgs,
|
|
971
911
|
...jsonArgs,
|
|
972
912
|
...workspaceArgs,
|
|
973
|
-
name: {
|
|
974
|
-
type: "string",
|
|
975
|
-
description: "Static website name",
|
|
913
|
+
name: arg(z.string(), {
|
|
976
914
|
alias: "n",
|
|
977
|
-
|
|
978
|
-
},
|
|
979
|
-
dir: {
|
|
980
|
-
type: "string",
|
|
981
|
-
description: "Path to the static website files",
|
|
915
|
+
description: "Static website name"
|
|
916
|
+
}),
|
|
917
|
+
dir: arg(z.string(), {
|
|
982
918
|
alias: "d",
|
|
983
|
-
|
|
984
|
-
}
|
|
985
|
-
},
|
|
919
|
+
description: "Path to the static website files"
|
|
920
|
+
})
|
|
921
|
+
}),
|
|
986
922
|
run: withCommonArgs(async (args) => {
|
|
987
923
|
logger.info(`Deploying static website "${args.name}" from directory: ${args.dir}`);
|
|
988
924
|
const client = await initOperatorClient(await loadAccessToken({
|
|
@@ -1013,20 +949,17 @@ const deployCommand = defineCommand({
|
|
|
1013
949
|
//#endregion
|
|
1014
950
|
//#region src/cli/staticwebsite/get.ts
|
|
1015
951
|
const getCommand = defineCommand({
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
},
|
|
1020
|
-
args: {
|
|
952
|
+
name: "get",
|
|
953
|
+
description: "Get static website details",
|
|
954
|
+
args: z.object({
|
|
1021
955
|
...commonArgs,
|
|
1022
956
|
...jsonArgs,
|
|
1023
957
|
...workspaceArgs,
|
|
1024
|
-
name: {
|
|
1025
|
-
|
|
1026
|
-
description: "Static website name"
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
},
|
|
958
|
+
name: arg(z.string(), {
|
|
959
|
+
positional: true,
|
|
960
|
+
description: "Static website name"
|
|
961
|
+
})
|
|
962
|
+
}),
|
|
1030
963
|
run: withCommonArgs(async (args) => {
|
|
1031
964
|
const client = await initOperatorClient(await loadAccessToken({
|
|
1032
965
|
useProfile: true,
|
|
@@ -1089,15 +1022,13 @@ async function listStaticWebsites(options) {
|
|
|
1089
1022
|
}));
|
|
1090
1023
|
}
|
|
1091
1024
|
const listCommand$2 = defineCommand({
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
},
|
|
1096
|
-
args: {
|
|
1025
|
+
name: "list",
|
|
1026
|
+
description: "List static websites",
|
|
1027
|
+
args: z.object({
|
|
1097
1028
|
...commonArgs,
|
|
1098
1029
|
...jsonArgs,
|
|
1099
1030
|
...workspaceArgs
|
|
1100
|
-
},
|
|
1031
|
+
}),
|
|
1101
1032
|
run: withCommonArgs(async (args) => {
|
|
1102
1033
|
const websites = await listStaticWebsites({
|
|
1103
1034
|
workspaceId: args["workspace-id"],
|
|
@@ -1122,17 +1053,15 @@ const listCommand$2 = defineCommand({
|
|
|
1122
1053
|
//#endregion
|
|
1123
1054
|
//#region src/cli/staticwebsite/index.ts
|
|
1124
1055
|
const staticwebsiteCommand = defineCommand({
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
description: "Manage static websites"
|
|
1128
|
-
},
|
|
1056
|
+
name: "staticwebsite",
|
|
1057
|
+
description: "Manage static websites",
|
|
1129
1058
|
subCommands: {
|
|
1130
1059
|
deploy: deployCommand,
|
|
1131
1060
|
get: getCommand,
|
|
1132
1061
|
list: listCommand$2
|
|
1133
1062
|
},
|
|
1134
1063
|
async run() {
|
|
1135
|
-
await runCommand(listCommand$2,
|
|
1064
|
+
await runCommand(listCommand$2, []);
|
|
1136
1065
|
}
|
|
1137
1066
|
});
|
|
1138
1067
|
|
|
@@ -1478,26 +1407,21 @@ async function prepareErdBuilds(options) {
|
|
|
1478
1407
|
return targets;
|
|
1479
1408
|
}
|
|
1480
1409
|
const erdExportCommand = defineCommand({
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
},
|
|
1485
|
-
args: {
|
|
1410
|
+
name: "export",
|
|
1411
|
+
description: "Export Liam ERD dist from applied TailorDB schema (beta)",
|
|
1412
|
+
args: z.object({
|
|
1486
1413
|
...commonArgs,
|
|
1487
1414
|
...deploymentArgs,
|
|
1488
1415
|
...jsonArgs,
|
|
1489
|
-
namespace: {
|
|
1490
|
-
|
|
1491
|
-
description: "TailorDB namespace name (optional if only one namespace is defined in config)"
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
output: {
|
|
1495
|
-
type: "string",
|
|
1496
|
-
description: "Output directory path for tbls-compatible ERD JSON (writes to <outputDir>/<namespace>/schema.json)",
|
|
1416
|
+
namespace: arg(z.string().optional(), {
|
|
1417
|
+
alias: "n",
|
|
1418
|
+
description: "TailorDB namespace name (optional if only one namespace is defined in config)"
|
|
1419
|
+
}),
|
|
1420
|
+
output: arg(z.string().default(DEFAULT_ERD_BASE_DIR), {
|
|
1497
1421
|
alias: "o",
|
|
1498
|
-
|
|
1499
|
-
}
|
|
1500
|
-
},
|
|
1422
|
+
description: "Output directory path for tbls-compatible ERD JSON (writes to <outputDir>/<namespace>/schema.json)"
|
|
1423
|
+
})
|
|
1424
|
+
}),
|
|
1501
1425
|
run: withCommonArgs(async (args) => {
|
|
1502
1426
|
const { client, workspaceId, config } = await initErdContext(args);
|
|
1503
1427
|
const outputDir = path.resolve(process.cwd(), String(args.output));
|
|
@@ -1525,20 +1449,17 @@ const erdExportCommand = defineCommand({
|
|
|
1525
1449
|
//#endregion
|
|
1526
1450
|
//#region src/cli/tailordb/erd/deploy.ts
|
|
1527
1451
|
const erdDeployCommand = defineCommand({
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
},
|
|
1532
|
-
args: {
|
|
1452
|
+
name: "deploy",
|
|
1453
|
+
description: "Deploy ERD static website for TailorDB namespace(s) (beta)",
|
|
1454
|
+
args: z.object({
|
|
1533
1455
|
...commonArgs,
|
|
1534
1456
|
...deploymentArgs,
|
|
1535
1457
|
...jsonArgs,
|
|
1536
|
-
namespace: {
|
|
1537
|
-
|
|
1538
|
-
description: "TailorDB namespace name (optional - deploys all namespaces with erdSite if omitted)"
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
},
|
|
1458
|
+
namespace: arg(z.string().optional(), {
|
|
1459
|
+
alias: "n",
|
|
1460
|
+
description: "TailorDB namespace name (optional - deploys all namespaces with erdSite if omitted)"
|
|
1461
|
+
})
|
|
1462
|
+
}),
|
|
1542
1463
|
run: withCommonArgs(async (args) => {
|
|
1543
1464
|
const { client, workspaceId, config } = await initErdContext(args);
|
|
1544
1465
|
const buildResults = await prepareErdBuilds({
|
|
@@ -1616,19 +1537,16 @@ async function runServeDist(results) {
|
|
|
1616
1537
|
});
|
|
1617
1538
|
}
|
|
1618
1539
|
const erdServeCommand = defineCommand({
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
},
|
|
1623
|
-
args: {
|
|
1540
|
+
name: "serve",
|
|
1541
|
+
description: "Generate and serve ERD (liam build + `serve dist`) (beta)",
|
|
1542
|
+
args: z.object({
|
|
1624
1543
|
...commonArgs,
|
|
1625
1544
|
...deploymentArgs,
|
|
1626
|
-
namespace: {
|
|
1627
|
-
|
|
1628
|
-
description: "TailorDB namespace name (uses first namespace in config if not specified)"
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
},
|
|
1545
|
+
namespace: arg(z.string().optional(), {
|
|
1546
|
+
alias: "n",
|
|
1547
|
+
description: "TailorDB namespace name (uses first namespace in config if not specified)"
|
|
1548
|
+
})
|
|
1549
|
+
}),
|
|
1632
1550
|
run: withCommonArgs(async (args) => {
|
|
1633
1551
|
const { client, workspaceId, config } = await initErdContext(args);
|
|
1634
1552
|
await runServeDist(await prepareErdBuilds({
|
|
@@ -1643,10 +1561,8 @@ const erdServeCommand = defineCommand({
|
|
|
1643
1561
|
//#endregion
|
|
1644
1562
|
//#region src/cli/tailordb/erd/index.ts
|
|
1645
1563
|
const erdCommand = defineCommand({
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
description: "ERD utilities for TailorDB (beta)"
|
|
1649
|
-
},
|
|
1564
|
+
name: "erd",
|
|
1565
|
+
description: "ERD utilities for TailorDB (beta)",
|
|
1650
1566
|
subCommands: {
|
|
1651
1567
|
export: erdExportCommand,
|
|
1652
1568
|
serve: erdServeCommand,
|
|
@@ -1729,41 +1645,29 @@ async function set(options) {
|
|
|
1729
1645
|
logger.success(`Migration checkpoint set to ${styles.bold(formatMigrationNumber(migrationNumber))} for namespace ${styles.bold(targetNamespace)}`);
|
|
1730
1646
|
}
|
|
1731
1647
|
const setCommand = defineCommand({
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
},
|
|
1736
|
-
args: {
|
|
1648
|
+
name: "set",
|
|
1649
|
+
description: "Set migration checkpoint to a specific number",
|
|
1650
|
+
args: z.object({
|
|
1737
1651
|
...commonArgs,
|
|
1738
|
-
...workspaceArgs,
|
|
1739
1652
|
...deploymentArgs,
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
},
|
|
1745
|
-
namespace: {
|
|
1746
|
-
|
|
1747
|
-
description: "Target TailorDB namespace (required if multiple namespaces exist)"
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
yes: {
|
|
1751
|
-
type: "boolean",
|
|
1752
|
-
description: "Skip confirmation prompt",
|
|
1753
|
-
alias: "y",
|
|
1754
|
-
default: false
|
|
1755
|
-
}
|
|
1756
|
-
},
|
|
1653
|
+
...confirmationArgs,
|
|
1654
|
+
number: arg(z.string(), {
|
|
1655
|
+
positional: true,
|
|
1656
|
+
description: "Migration number to set (e.g., 0001 or 1)"
|
|
1657
|
+
}),
|
|
1658
|
+
namespace: arg(z.string().optional(), {
|
|
1659
|
+
alias: "n",
|
|
1660
|
+
description: "Target TailorDB namespace (required if multiple namespaces exist)"
|
|
1661
|
+
})
|
|
1662
|
+
}),
|
|
1757
1663
|
run: withCommonArgs(async (args) => {
|
|
1758
|
-
const number = args._[0];
|
|
1759
|
-
if (!number) throw new Error("Migration number is required. Usage: tailor-sdk tailordb migration set <number>");
|
|
1760
1664
|
await set({
|
|
1761
|
-
configPath:
|
|
1762
|
-
number:
|
|
1763
|
-
namespace:
|
|
1764
|
-
yes:
|
|
1765
|
-
workspaceId:
|
|
1766
|
-
profile:
|
|
1665
|
+
configPath: args.config,
|
|
1666
|
+
number: args.number,
|
|
1667
|
+
namespace: args.namespace,
|
|
1668
|
+
yes: args.yes,
|
|
1669
|
+
workspaceId: args["workspace-id"],
|
|
1670
|
+
profile: args.profile
|
|
1767
1671
|
});
|
|
1768
1672
|
})
|
|
1769
1673
|
});
|
|
@@ -1819,26 +1723,22 @@ async function status(options) {
|
|
|
1819
1723
|
logger.newline();
|
|
1820
1724
|
}
|
|
1821
1725
|
const statusCommand = defineCommand({
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
},
|
|
1826
|
-
args: {
|
|
1726
|
+
name: "status",
|
|
1727
|
+
description: "Show migration status for TailorDB namespaces",
|
|
1728
|
+
args: z.object({
|
|
1827
1729
|
...commonArgs,
|
|
1828
|
-
...workspaceArgs,
|
|
1829
1730
|
...deploymentArgs,
|
|
1830
|
-
namespace: {
|
|
1831
|
-
|
|
1832
|
-
description: "Target TailorDB namespace (shows all namespaces if not specified)"
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
},
|
|
1731
|
+
namespace: arg(z.string().optional(), {
|
|
1732
|
+
alias: "n",
|
|
1733
|
+
description: "Target TailorDB namespace (shows all namespaces if not specified)"
|
|
1734
|
+
})
|
|
1735
|
+
}),
|
|
1836
1736
|
run: withCommonArgs(async (args) => {
|
|
1837
1737
|
await status({
|
|
1838
|
-
configPath:
|
|
1839
|
-
namespace:
|
|
1840
|
-
workspaceId:
|
|
1841
|
-
profile:
|
|
1738
|
+
configPath: args.config,
|
|
1739
|
+
namespace: args.namespace,
|
|
1740
|
+
workspaceId: args["workspace-id"],
|
|
1741
|
+
profile: args.profile
|
|
1842
1742
|
});
|
|
1843
1743
|
})
|
|
1844
1744
|
});
|
|
@@ -1854,10 +1754,8 @@ const statusCommand = defineCommand({
|
|
|
1854
1754
|
* - status: Show migration status for TailorDB namespaces
|
|
1855
1755
|
*/
|
|
1856
1756
|
const migrationCommand = defineCommand({
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
description: "Manage TailorDB schema migrations (beta)"
|
|
1860
|
-
},
|
|
1757
|
+
name: "migration",
|
|
1758
|
+
description: "Manage TailorDB schema migrations (beta)",
|
|
1861
1759
|
subCommands: {
|
|
1862
1760
|
generate: generateCommand,
|
|
1863
1761
|
set: setCommand,
|
|
@@ -1868,10 +1766,8 @@ const migrationCommand = defineCommand({
|
|
|
1868
1766
|
//#endregion
|
|
1869
1767
|
//#region src/cli/tailordb/index.ts
|
|
1870
1768
|
const tailordbCommand = defineCommand({
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
description: "Manage TailorDB tables and data"
|
|
1874
|
-
},
|
|
1769
|
+
name: "tailordb",
|
|
1770
|
+
description: "Manage TailorDB tables and data",
|
|
1875
1771
|
subCommands: {
|
|
1876
1772
|
erd: erdCommand,
|
|
1877
1773
|
migration: migrationCommand,
|
|
@@ -1882,11 +1778,9 @@ const tailordbCommand = defineCommand({
|
|
|
1882
1778
|
//#endregion
|
|
1883
1779
|
//#region src/cli/user/current.ts
|
|
1884
1780
|
const currentCommand = defineCommand({
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
},
|
|
1889
|
-
args: commonArgs,
|
|
1781
|
+
name: "current",
|
|
1782
|
+
description: "Show current user",
|
|
1783
|
+
args: z.object({ ...commonArgs }),
|
|
1890
1784
|
run: withCommonArgs(async () => {
|
|
1891
1785
|
const config = readPlatformConfig();
|
|
1892
1786
|
if (!config.current_user) throw new Error(ml`
|
|
@@ -1904,14 +1798,12 @@ const currentCommand = defineCommand({
|
|
|
1904
1798
|
//#endregion
|
|
1905
1799
|
//#region src/cli/user/list.ts
|
|
1906
1800
|
const listCommand$1 = defineCommand({
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
},
|
|
1911
|
-
args: {
|
|
1801
|
+
name: "list",
|
|
1802
|
+
description: "List all users",
|
|
1803
|
+
args: z.object({
|
|
1912
1804
|
...commonArgs,
|
|
1913
1805
|
...jsonArgs
|
|
1914
|
-
},
|
|
1806
|
+
}),
|
|
1915
1807
|
run: withCommonArgs(async (args) => {
|
|
1916
1808
|
const config = readPlatformConfig();
|
|
1917
1809
|
const users = Object.keys(config.users);
|
|
@@ -1992,25 +1884,20 @@ function printCreatedToken(name, token, write, action) {
|
|
|
1992
1884
|
//#endregion
|
|
1993
1885
|
//#region src/cli/user/pat/create.ts
|
|
1994
1886
|
const createCommand = defineCommand({
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
},
|
|
1999
|
-
args: {
|
|
1887
|
+
name: "create",
|
|
1888
|
+
description: "Create new personal access token",
|
|
1889
|
+
args: z.object({
|
|
2000
1890
|
...commonArgs,
|
|
2001
1891
|
...jsonArgs,
|
|
2002
|
-
name: {
|
|
2003
|
-
|
|
2004
|
-
description: "Token name"
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
write: {
|
|
2008
|
-
type: "boolean",
|
|
2009
|
-
description: "Grant write permission (default: read-only)",
|
|
1892
|
+
name: arg(z.string(), {
|
|
1893
|
+
positional: true,
|
|
1894
|
+
description: "Token name"
|
|
1895
|
+
}),
|
|
1896
|
+
write: arg(z.boolean().default(false), {
|
|
2010
1897
|
alias: "W",
|
|
2011
|
-
default:
|
|
2012
|
-
}
|
|
2013
|
-
},
|
|
1898
|
+
description: "Grant write permission (default: read-only)"
|
|
1899
|
+
})
|
|
1900
|
+
}),
|
|
2014
1901
|
run: withCommonArgs(async (args) => {
|
|
2015
1902
|
const config = readPlatformConfig();
|
|
2016
1903
|
if (!config.current_user) throw new Error(ml`
|
|
@@ -2031,18 +1918,15 @@ const createCommand = defineCommand({
|
|
|
2031
1918
|
//#endregion
|
|
2032
1919
|
//#region src/cli/user/pat/delete.ts
|
|
2033
1920
|
const deleteCommand = defineCommand({
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
},
|
|
2038
|
-
args: {
|
|
1921
|
+
name: "delete",
|
|
1922
|
+
description: "Delete personal access token",
|
|
1923
|
+
args: z.object({
|
|
2039
1924
|
...commonArgs,
|
|
2040
|
-
name: {
|
|
2041
|
-
|
|
2042
|
-
description: "Token name"
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
},
|
|
1925
|
+
name: arg(z.string(), {
|
|
1926
|
+
positional: true,
|
|
1927
|
+
description: "Token name"
|
|
1928
|
+
})
|
|
1929
|
+
}),
|
|
2046
1930
|
run: withCommonArgs(async (args) => {
|
|
2047
1931
|
const config = readPlatformConfig();
|
|
2048
1932
|
if (!config.current_user) throw new Error(ml`
|
|
@@ -2057,14 +1941,12 @@ const deleteCommand = defineCommand({
|
|
|
2057
1941
|
//#endregion
|
|
2058
1942
|
//#region src/cli/user/pat/list.ts
|
|
2059
1943
|
const listCommand = defineCommand({
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
},
|
|
2064
|
-
args: {
|
|
1944
|
+
name: "list",
|
|
1945
|
+
description: "List all personal access tokens",
|
|
1946
|
+
args: z.object({
|
|
2065
1947
|
...commonArgs,
|
|
2066
1948
|
...jsonArgs
|
|
2067
|
-
},
|
|
1949
|
+
}),
|
|
2068
1950
|
run: withCommonArgs(async (args) => {
|
|
2069
1951
|
const config = readPlatformConfig();
|
|
2070
1952
|
if (!config.current_user) throw new Error(ml`
|
|
@@ -2100,25 +1982,20 @@ const listCommand = defineCommand({
|
|
|
2100
1982
|
//#endregion
|
|
2101
1983
|
//#region src/cli/user/pat/update.ts
|
|
2102
1984
|
const updateCommand = defineCommand({
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
},
|
|
2107
|
-
args: {
|
|
1985
|
+
name: "update",
|
|
1986
|
+
description: "Update personal access token (delete and recreate)",
|
|
1987
|
+
args: z.object({
|
|
2108
1988
|
...commonArgs,
|
|
2109
1989
|
...jsonArgs,
|
|
2110
|
-
name: {
|
|
2111
|
-
|
|
2112
|
-
description: "Token name"
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
write: {
|
|
2116
|
-
type: "boolean",
|
|
2117
|
-
description: "Grant write permission (if not specified, keeps read-only)",
|
|
1990
|
+
name: arg(z.string(), {
|
|
1991
|
+
positional: true,
|
|
1992
|
+
description: "Token name"
|
|
1993
|
+
}),
|
|
1994
|
+
write: arg(z.boolean().default(false), {
|
|
2118
1995
|
alias: "W",
|
|
2119
|
-
|
|
2120
|
-
}
|
|
2121
|
-
},
|
|
1996
|
+
description: "Grant write permission (if not specified, keeps read-only)"
|
|
1997
|
+
})
|
|
1998
|
+
}),
|
|
2122
1999
|
run: withCommonArgs(async (args) => {
|
|
2123
2000
|
const config = readPlatformConfig();
|
|
2124
2001
|
if (!config.current_user) throw new Error(ml`
|
|
@@ -2140,36 +2017,32 @@ const updateCommand = defineCommand({
|
|
|
2140
2017
|
//#endregion
|
|
2141
2018
|
//#region src/cli/user/pat/index.ts
|
|
2142
2019
|
const patCommand = defineCommand({
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
},
|
|
2020
|
+
name: "pat",
|
|
2021
|
+
description: "Manage personal access tokens",
|
|
2022
|
+
args: listCommand.args,
|
|
2147
2023
|
subCommands: {
|
|
2148
2024
|
create: createCommand,
|
|
2149
2025
|
delete: deleteCommand,
|
|
2150
2026
|
list: listCommand,
|
|
2151
2027
|
update: updateCommand
|
|
2152
2028
|
},
|
|
2153
|
-
async run(
|
|
2154
|
-
await
|
|
2029
|
+
async run(args) {
|
|
2030
|
+
await listCommand.run(args);
|
|
2155
2031
|
}
|
|
2156
2032
|
});
|
|
2157
2033
|
|
|
2158
2034
|
//#endregion
|
|
2159
2035
|
//#region src/cli/user/switch.ts
|
|
2160
2036
|
const switchCommand = defineCommand({
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
},
|
|
2165
|
-
args: {
|
|
2037
|
+
name: "switch",
|
|
2038
|
+
description: "Set current user",
|
|
2039
|
+
args: z.object({
|
|
2166
2040
|
...commonArgs,
|
|
2167
|
-
user: {
|
|
2168
|
-
|
|
2169
|
-
description: "User email"
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
},
|
|
2041
|
+
user: arg(z.string(), {
|
|
2042
|
+
positional: true,
|
|
2043
|
+
description: "User email"
|
|
2044
|
+
})
|
|
2045
|
+
}),
|
|
2173
2046
|
run: withCommonArgs(async (args) => {
|
|
2174
2047
|
const config = readPlatformConfig();
|
|
2175
2048
|
if (!config.users[args.user]) throw new Error(ml`
|
|
@@ -2185,10 +2058,8 @@ const switchCommand = defineCommand({
|
|
|
2185
2058
|
//#endregion
|
|
2186
2059
|
//#region src/cli/user/index.ts
|
|
2187
2060
|
const userCommand = defineCommand({
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
description: "Manage Tailor Platform users"
|
|
2191
|
-
},
|
|
2061
|
+
name: "user",
|
|
2062
|
+
description: "Manage Tailor Platform users",
|
|
2192
2063
|
subCommands: {
|
|
2193
2064
|
current: currentCommand,
|
|
2194
2065
|
list: listCommand$1,
|
|
@@ -2196,17 +2067,15 @@ const userCommand = defineCommand({
|
|
|
2196
2067
|
switch: switchCommand
|
|
2197
2068
|
},
|
|
2198
2069
|
async run() {
|
|
2199
|
-
await runCommand(listCommand$1,
|
|
2070
|
+
await runCommand(listCommand$1, []);
|
|
2200
2071
|
}
|
|
2201
2072
|
});
|
|
2202
2073
|
|
|
2203
2074
|
//#endregion
|
|
2204
2075
|
//#region src/cli/workflow/index.ts
|
|
2205
2076
|
const workflowCommand = defineCommand({
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
description: "Manage workflows"
|
|
2209
|
-
},
|
|
2077
|
+
name: "workflow",
|
|
2078
|
+
description: "Manage workflows",
|
|
2210
2079
|
subCommands: {
|
|
2211
2080
|
list: listCommand$7,
|
|
2212
2081
|
get: getCommand$2,
|
|
@@ -2215,24 +2084,22 @@ const workflowCommand = defineCommand({
|
|
|
2215
2084
|
resume: resumeCommand
|
|
2216
2085
|
},
|
|
2217
2086
|
async run() {
|
|
2218
|
-
await runCommand(listCommand$7,
|
|
2087
|
+
await runCommand(listCommand$7, []);
|
|
2219
2088
|
}
|
|
2220
2089
|
});
|
|
2221
2090
|
|
|
2222
2091
|
//#endregion
|
|
2223
2092
|
//#region src/cli/workspace/index.ts
|
|
2224
2093
|
const workspaceCommand = defineCommand({
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
description: "Manage Tailor Platform workspaces"
|
|
2228
|
-
},
|
|
2094
|
+
name: "workspace",
|
|
2095
|
+
description: "Manage Tailor Platform workspaces",
|
|
2229
2096
|
subCommands: {
|
|
2230
2097
|
create: createCommand$3,
|
|
2231
2098
|
delete: deleteCommand$3,
|
|
2232
2099
|
list: listCommand$8
|
|
2233
2100
|
},
|
|
2234
2101
|
async run() {
|
|
2235
|
-
await runCommand(listCommand$8,
|
|
2102
|
+
await runCommand(listCommand$8, []);
|
|
2236
2103
|
}
|
|
2237
2104
|
});
|
|
2238
2105
|
|
|
@@ -2241,11 +2108,8 @@ const workspaceCommand = defineCommand({
|
|
|
2241
2108
|
register("tsx", import.meta.url, { data: {} });
|
|
2242
2109
|
const packageJson = await readPackageJson();
|
|
2243
2110
|
const mainCommand = defineCommand({
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
version: packageJson.version,
|
|
2247
|
-
description: packageJson.description || "Tailor CLI for managing Tailor Platform SDK applications"
|
|
2248
|
-
},
|
|
2111
|
+
name: Object.keys(packageJson.bin ?? {})[0] || "tailor-sdk",
|
|
2112
|
+
description: packageJson.description || "Tailor CLI for managing Tailor Platform SDK applications",
|
|
2249
2113
|
subCommands: {
|
|
2250
2114
|
api: apiCommand,
|
|
2251
2115
|
apply: applyCommand,
|
|
@@ -2267,7 +2131,7 @@ const mainCommand = defineCommand({
|
|
|
2267
2131
|
workspace: workspaceCommand
|
|
2268
2132
|
}
|
|
2269
2133
|
});
|
|
2270
|
-
runMain(mainCommand);
|
|
2134
|
+
runMain(mainCommand, { version: packageJson.version });
|
|
2271
2135
|
|
|
2272
2136
|
//#endregion
|
|
2273
2137
|
export { mainCommand };
|