@clickraft/cli 0.8.2 → 0.8.3
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 +5 -1
- package/dist/cli.js +281 -280
- package/dist/cli.js.map +1 -1
- package/dist/index.js +281 -280
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/cli.js
CHANGED
|
@@ -5,11 +5,11 @@ import { readFileSync } from "fs";
|
|
|
5
5
|
import { dirname as dirname2, join as join2 } from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
|
|
8
|
-
//
|
|
9
|
-
import {
|
|
8
|
+
// ../sdk/dist/index.js
|
|
9
|
+
import { z } from "zod";
|
|
10
10
|
import { z as z2 } from "zod";
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import { z as z3 } from "zod";
|
|
12
|
+
import { z as z4 } from "zod";
|
|
13
13
|
var TOKEN_FIELD_PATTERN = /"(access_token|refresh_token|device_code|user_code|code_verifier|client_secret)"\s*:\s*"[^"]*"/gi;
|
|
14
14
|
var BARE_TOKEN_PATTERN = /\bck_(?:live|dev|test)_[A-Za-z0-9_-]+/gi;
|
|
15
15
|
function redactTokenLikeFields(input) {
|
|
@@ -20,6 +20,71 @@ function redactTokenLikeValue(token) {
|
|
|
20
20
|
if (token.length <= 12) return "[REDACTED]";
|
|
21
21
|
return `${token.slice(0, 8)}...[REDACTED]`;
|
|
22
22
|
}
|
|
23
|
+
var BalanceResponseSchema = z.object({
|
|
24
|
+
totalCredits: z.number(),
|
|
25
|
+
subscriptionCredits: z.number(),
|
|
26
|
+
purchasedCredits: z.number(),
|
|
27
|
+
promotionalCredits: z.number(),
|
|
28
|
+
rateLimit: z.object({
|
|
29
|
+
apiBurstPerMinute: z.number()
|
|
30
|
+
}).strict()
|
|
31
|
+
}).strict();
|
|
32
|
+
var BrandModelSummarySchema = z2.object({
|
|
33
|
+
id: z2.string().uuid(),
|
|
34
|
+
source: z2.enum(["system", "user"]),
|
|
35
|
+
slug: z2.string().nullable(),
|
|
36
|
+
name: z2.string(),
|
|
37
|
+
description: z2.string().nullable(),
|
|
38
|
+
thumbnailUrl: z2.string().nullable(),
|
|
39
|
+
tags: z2.array(z2.string()),
|
|
40
|
+
category: z2.string().nullable(),
|
|
41
|
+
isPremium: z2.boolean().nullable(),
|
|
42
|
+
isFeatured: z2.boolean().nullable(),
|
|
43
|
+
badgeText: z2.string().nullable(),
|
|
44
|
+
usageCount: z2.number().nullable(),
|
|
45
|
+
createdAt: z2.string()
|
|
46
|
+
}).strict();
|
|
47
|
+
var BrandModelsListResponseSchema = z2.object({
|
|
48
|
+
brandModels: z2.array(BrandModelSummarySchema)
|
|
49
|
+
}).strict();
|
|
50
|
+
var ProductImageSummarySchema = z3.object({
|
|
51
|
+
id: z3.string().uuid(),
|
|
52
|
+
url: z3.string(),
|
|
53
|
+
altText: z3.string().nullable(),
|
|
54
|
+
isPrimary: z3.boolean(),
|
|
55
|
+
sortOrder: z3.number().int()
|
|
56
|
+
});
|
|
57
|
+
var ProductSummarySchema = z3.object({
|
|
58
|
+
id: z3.string().uuid(),
|
|
59
|
+
title: z3.string(),
|
|
60
|
+
sourceType: z3.string(),
|
|
61
|
+
syncStatus: z3.enum(["synced", "pending", "stale", "error", "deleted_upstream"]).nullable(),
|
|
62
|
+
vendor: z3.string().nullable(),
|
|
63
|
+
productType: z3.string().nullable(),
|
|
64
|
+
tags: z3.array(z3.string()),
|
|
65
|
+
images: z3.array(ProductImageSummarySchema)
|
|
66
|
+
});
|
|
67
|
+
var ProductsListResponseSchema = z3.object({
|
|
68
|
+
items: z3.array(ProductSummarySchema),
|
|
69
|
+
nextCursor: z3.string().nullable()
|
|
70
|
+
});
|
|
71
|
+
var TokenRowSchema = z4.object({
|
|
72
|
+
id: z4.string().uuid(),
|
|
73
|
+
organizationId: z4.string().uuid(),
|
|
74
|
+
userId: z4.string().uuid(),
|
|
75
|
+
clientId: z4.string().nullable(),
|
|
76
|
+
tokenPrefix: z4.string(),
|
|
77
|
+
name: z4.string().nullable(),
|
|
78
|
+
scopes: z4.array(z4.string()),
|
|
79
|
+
lastUsedAt: z4.string().nullable(),
|
|
80
|
+
expiresAt: z4.string(),
|
|
81
|
+
createdAt: z4.string()
|
|
82
|
+
}).strict();
|
|
83
|
+
var TokensListResponseSchema = z4.array(TokenRowSchema);
|
|
84
|
+
|
|
85
|
+
// src/api/client.ts
|
|
86
|
+
import { request as undiciRequest } from "undici";
|
|
87
|
+
import { z as z6 } from "zod";
|
|
23
88
|
|
|
24
89
|
// src/errors/codes.ts
|
|
25
90
|
var LOGIN_HINT = "Run `clickraft login` to authenticate.";
|
|
@@ -554,15 +619,15 @@ function signalToAbortError(signal) {
|
|
|
554
619
|
}
|
|
555
620
|
|
|
556
621
|
// src/api/types.ts
|
|
557
|
-
import { z } from "zod";
|
|
558
|
-
var ServerSuccessSchema = (payload) =>
|
|
559
|
-
var ServerErrorBodySchema =
|
|
560
|
-
error:
|
|
561
|
-
code:
|
|
562
|
-
message:
|
|
563
|
-
correlationId:
|
|
564
|
-
retryAfter:
|
|
565
|
-
details:
|
|
622
|
+
import { z as z5 } from "zod";
|
|
623
|
+
var ServerSuccessSchema = (payload) => z5.object({ data: payload }).strict();
|
|
624
|
+
var ServerErrorBodySchema = z5.object({
|
|
625
|
+
error: z5.object({
|
|
626
|
+
code: z5.string().min(1),
|
|
627
|
+
message: z5.string(),
|
|
628
|
+
correlationId: z5.string().optional(),
|
|
629
|
+
retryAfter: z5.number().int().nonnegative().optional(),
|
|
630
|
+
details: z5.unknown().optional()
|
|
566
631
|
}).strict()
|
|
567
632
|
}).strict();
|
|
568
633
|
|
|
@@ -744,7 +809,7 @@ function parseSuccessBody(args) {
|
|
|
744
809
|
err
|
|
745
810
|
);
|
|
746
811
|
}
|
|
747
|
-
const envelope = ServerSuccessSchema(args.responseSchema ??
|
|
812
|
+
const envelope = ServerSuccessSchema(args.responseSchema ?? z6.unknown()).safeParse(parsed);
|
|
748
813
|
if (!envelope.success) {
|
|
749
814
|
const issues = formatSchemaIssues(envelope.error);
|
|
750
815
|
throw new ApiError(
|
|
@@ -985,9 +1050,6 @@ function buildPayload(args) {
|
|
|
985
1050
|
return payload;
|
|
986
1051
|
}
|
|
987
1052
|
|
|
988
|
-
// src/commands/balance.ts
|
|
989
|
-
import { z as z4 } from "zod";
|
|
990
|
-
|
|
991
1053
|
// src/auth/credentials.ts
|
|
992
1054
|
import {
|
|
993
1055
|
access,
|
|
@@ -1030,31 +1092,31 @@ function getCredentialsPath(ctx = {}) {
|
|
|
1030
1092
|
}
|
|
1031
1093
|
|
|
1032
1094
|
// src/auth/types.ts
|
|
1033
|
-
import { z as
|
|
1034
|
-
var DeviceAuthorizationRequestSchema =
|
|
1035
|
-
client_id:
|
|
1036
|
-
scope:
|
|
1095
|
+
import { z as z7 } from "zod";
|
|
1096
|
+
var DeviceAuthorizationRequestSchema = z7.object({
|
|
1097
|
+
client_id: z7.string(),
|
|
1098
|
+
scope: z7.string()
|
|
1037
1099
|
});
|
|
1038
|
-
var DeviceAuthorizationResponseSchema =
|
|
1039
|
-
device_code:
|
|
1040
|
-
user_code:
|
|
1041
|
-
verification_uri:
|
|
1042
|
-
verification_uri_complete:
|
|
1043
|
-
expires_in:
|
|
1044
|
-
interval:
|
|
1100
|
+
var DeviceAuthorizationResponseSchema = z7.object({
|
|
1101
|
+
device_code: z7.string(),
|
|
1102
|
+
user_code: z7.string().min(1),
|
|
1103
|
+
verification_uri: z7.string().url(),
|
|
1104
|
+
verification_uri_complete: z7.string().url().optional(),
|
|
1105
|
+
expires_in: z7.number().int().positive(),
|
|
1106
|
+
interval: z7.number().int().positive().default(5)
|
|
1045
1107
|
});
|
|
1046
|
-
var DeviceTokenPollRequestSchema =
|
|
1047
|
-
client_id:
|
|
1048
|
-
device_code:
|
|
1049
|
-
grant_type:
|
|
1108
|
+
var DeviceTokenPollRequestSchema = z7.object({
|
|
1109
|
+
client_id: z7.string(),
|
|
1110
|
+
device_code: z7.string(),
|
|
1111
|
+
grant_type: z7.literal("urn:ietf:params:oauth:grant-type:device_code")
|
|
1050
1112
|
});
|
|
1051
|
-
var TokenResponseSchema =
|
|
1052
|
-
access_token:
|
|
1053
|
-
token_type:
|
|
1054
|
-
expires_in:
|
|
1055
|
-
scope:
|
|
1113
|
+
var TokenResponseSchema = z7.object({
|
|
1114
|
+
access_token: z7.string(),
|
|
1115
|
+
token_type: z7.literal("Bearer"),
|
|
1116
|
+
expires_in: z7.number().int().positive(),
|
|
1117
|
+
scope: z7.string()
|
|
1056
1118
|
});
|
|
1057
|
-
var DeviceTokenPollErrorCodeSchema =
|
|
1119
|
+
var DeviceTokenPollErrorCodeSchema = z7.enum([
|
|
1058
1120
|
"authorization_pending",
|
|
1059
1121
|
"slow_down",
|
|
1060
1122
|
"access_denied",
|
|
@@ -1065,27 +1127,27 @@ var DeviceTokenPollErrorCodeSchema = z3.enum([
|
|
|
1065
1127
|
"unsupported_grant_type",
|
|
1066
1128
|
"invalid_scope"
|
|
1067
1129
|
]);
|
|
1068
|
-
var DeviceTokenPollErrorSchema =
|
|
1130
|
+
var DeviceTokenPollErrorSchema = z7.object({
|
|
1069
1131
|
error: DeviceTokenPollErrorCodeSchema,
|
|
1070
|
-
error_description:
|
|
1132
|
+
error_description: z7.string().optional()
|
|
1071
1133
|
});
|
|
1072
|
-
var CredentialsProfileSchema =
|
|
1073
|
-
apiBaseUrl:
|
|
1074
|
-
accessToken:
|
|
1075
|
-
tokenType:
|
|
1076
|
-
tokenPrefix:
|
|
1077
|
-
organizationId:
|
|
1078
|
-
organizationSlug:
|
|
1079
|
-
userId:
|
|
1080
|
-
scopes:
|
|
1081
|
-
expiresAt:
|
|
1082
|
-
issuedAt:
|
|
1083
|
-
clientId:
|
|
1134
|
+
var CredentialsProfileSchema = z7.object({
|
|
1135
|
+
apiBaseUrl: z7.string().url(),
|
|
1136
|
+
accessToken: z7.string(),
|
|
1137
|
+
tokenType: z7.literal("Bearer"),
|
|
1138
|
+
tokenPrefix: z7.string(),
|
|
1139
|
+
organizationId: z7.string().uuid(),
|
|
1140
|
+
organizationSlug: z7.string(),
|
|
1141
|
+
userId: z7.string().uuid(),
|
|
1142
|
+
scopes: z7.array(z7.string()),
|
|
1143
|
+
expiresAt: z7.string().datetime(),
|
|
1144
|
+
issuedAt: z7.string().datetime(),
|
|
1145
|
+
clientId: z7.string()
|
|
1084
1146
|
}).strict();
|
|
1085
|
-
var CredentialsFileSchema =
|
|
1086
|
-
version:
|
|
1087
|
-
defaultProfile:
|
|
1088
|
-
profiles:
|
|
1147
|
+
var CredentialsFileSchema = z7.object({
|
|
1148
|
+
version: z7.literal(1),
|
|
1149
|
+
defaultProfile: z7.string(),
|
|
1150
|
+
profiles: z7.record(z7.string(), CredentialsProfileSchema)
|
|
1089
1151
|
}).strict();
|
|
1090
1152
|
|
|
1091
1153
|
// src/auth/credentials.ts
|
|
@@ -1318,15 +1380,6 @@ function trim(value) {
|
|
|
1318
1380
|
}
|
|
1319
1381
|
|
|
1320
1382
|
// src/commands/balance.ts
|
|
1321
|
-
var BalanceResponseSchema = z4.object({
|
|
1322
|
-
totalCredits: z4.number(),
|
|
1323
|
-
subscriptionCredits: z4.number(),
|
|
1324
|
-
purchasedCredits: z4.number(),
|
|
1325
|
-
promotionalCredits: z4.number(),
|
|
1326
|
-
rateLimit: z4.object({
|
|
1327
|
-
apiBurstPerMinute: z4.number()
|
|
1328
|
-
}).strict()
|
|
1329
|
-
}).strict();
|
|
1330
1383
|
async function getBalance(options) {
|
|
1331
1384
|
const config = await loadConfig({
|
|
1332
1385
|
flagProfile: options.profile,
|
|
@@ -1352,25 +1405,7 @@ async function getBalance(options) {
|
|
|
1352
1405
|
}
|
|
1353
1406
|
|
|
1354
1407
|
// src/commands/brand-model/list.ts
|
|
1355
|
-
import
|
|
1356
|
-
var BrandModelSummarySchema = z5.object({
|
|
1357
|
-
id: z5.string().uuid(),
|
|
1358
|
-
source: z5.enum(["system", "user"]),
|
|
1359
|
-
slug: z5.string().nullable(),
|
|
1360
|
-
name: z5.string(),
|
|
1361
|
-
description: z5.string().nullable(),
|
|
1362
|
-
thumbnailUrl: z5.string().nullable(),
|
|
1363
|
-
tags: z5.array(z5.string()),
|
|
1364
|
-
category: z5.string().nullable(),
|
|
1365
|
-
isPremium: z5.boolean().nullable(),
|
|
1366
|
-
isFeatured: z5.boolean().nullable(),
|
|
1367
|
-
badgeText: z5.string().nullable(),
|
|
1368
|
-
usageCount: z5.number().nullable(),
|
|
1369
|
-
createdAt: z5.string()
|
|
1370
|
-
}).strict();
|
|
1371
|
-
var BrandModelsListResponseSchema = z5.object({
|
|
1372
|
-
brandModels: z5.array(BrandModelSummarySchema)
|
|
1373
|
-
}).strict();
|
|
1408
|
+
import "zod";
|
|
1374
1409
|
async function listBrandModels(options) {
|
|
1375
1410
|
const config = await loadConfig({
|
|
1376
1411
|
flagProfile: options.profile,
|
|
@@ -1396,35 +1431,35 @@ async function listBrandModels(options) {
|
|
|
1396
1431
|
}
|
|
1397
1432
|
|
|
1398
1433
|
// src/schemas/jobs.ts
|
|
1399
|
-
import { z as
|
|
1400
|
-
var ProductReferenceSchema =
|
|
1401
|
-
id:
|
|
1402
|
-
imageId:
|
|
1434
|
+
import { z as z9 } from "zod";
|
|
1435
|
+
var ProductReferenceSchema = z9.object({
|
|
1436
|
+
id: z9.string().uuid(),
|
|
1437
|
+
imageId: z9.string().uuid().optional()
|
|
1403
1438
|
}).strict();
|
|
1404
|
-
var GenerateCreateRequestSchema =
|
|
1405
|
-
modelSlug:
|
|
1406
|
-
input:
|
|
1407
|
-
prompt:
|
|
1408
|
-
referenceImageUrl:
|
|
1409
|
-
referenceImages:
|
|
1410
|
-
aspectRatio:
|
|
1411
|
-
resolution:
|
|
1412
|
-
durationSeconds:
|
|
1413
|
-
providerParams:
|
|
1439
|
+
var GenerateCreateRequestSchema = z9.object({
|
|
1440
|
+
modelSlug: z9.string().min(1).max(100),
|
|
1441
|
+
input: z9.object({
|
|
1442
|
+
prompt: z9.string().max(1e4).optional(),
|
|
1443
|
+
referenceImageUrl: z9.string().url().optional(),
|
|
1444
|
+
referenceImages: z9.array(z9.string().url()).max(8).optional(),
|
|
1445
|
+
aspectRatio: z9.string().regex(/^\d+:\d+$/).optional(),
|
|
1446
|
+
resolution: z9.string().regex(/^\d+x\d+$/).optional(),
|
|
1447
|
+
durationSeconds: z9.number().int().min(1).max(60).optional(),
|
|
1448
|
+
providerParams: z9.record(z9.string(), z9.unknown()).optional()
|
|
1414
1449
|
}).strict(),
|
|
1415
|
-
options:
|
|
1416
|
-
workflowId:
|
|
1417
|
-
nodeId:
|
|
1450
|
+
options: z9.object({
|
|
1451
|
+
workflowId: z9.string().uuid().optional(),
|
|
1452
|
+
nodeId: z9.string().optional()
|
|
1418
1453
|
}).strict().optional(),
|
|
1419
|
-
products:
|
|
1454
|
+
products: z9.array(ProductReferenceSchema).min(1).max(10).optional()
|
|
1420
1455
|
}).strict();
|
|
1421
|
-
var GenerateCreateResponseSchema =
|
|
1422
|
-
jobId:
|
|
1423
|
-
status:
|
|
1424
|
-
estimatedSeconds:
|
|
1425
|
-
creditsCharged:
|
|
1456
|
+
var GenerateCreateResponseSchema = z9.object({
|
|
1457
|
+
jobId: z9.string().uuid(),
|
|
1458
|
+
status: z9.enum(["queued", "processing", "completed", "failed"]),
|
|
1459
|
+
estimatedSeconds: z9.number().int().nonnegative().nullable(),
|
|
1460
|
+
creditsCharged: z9.number().int().nonnegative()
|
|
1426
1461
|
}).strict();
|
|
1427
|
-
var GenerationStatusSchema =
|
|
1462
|
+
var GenerationStatusSchema = z9.enum([
|
|
1428
1463
|
"queued",
|
|
1429
1464
|
"processing",
|
|
1430
1465
|
"uploading",
|
|
@@ -1440,18 +1475,18 @@ var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
|
1440
1475
|
function isTerminalStatus(status) {
|
|
1441
1476
|
return TERMINAL_STATUSES.has(status);
|
|
1442
1477
|
}
|
|
1443
|
-
var GenerationResultSchema =
|
|
1444
|
-
jobId:
|
|
1478
|
+
var GenerationResultSchema = z9.object({
|
|
1479
|
+
jobId: z9.string().uuid(),
|
|
1445
1480
|
status: GenerationStatusSchema,
|
|
1446
|
-
modelSlug:
|
|
1447
|
-
resultUrl:
|
|
1448
|
-
thumbnailUrl:
|
|
1449
|
-
errorCode:
|
|
1450
|
-
errorMessage:
|
|
1451
|
-
creditsCharged:
|
|
1452
|
-
creditsRefunded:
|
|
1453
|
-
startedAt:
|
|
1454
|
-
completedAt:
|
|
1481
|
+
modelSlug: z9.string(),
|
|
1482
|
+
resultUrl: z9.string().url().nullable(),
|
|
1483
|
+
thumbnailUrl: z9.string().url().nullable(),
|
|
1484
|
+
errorCode: z9.string().nullable(),
|
|
1485
|
+
errorMessage: z9.string().nullable(),
|
|
1486
|
+
creditsCharged: z9.number().int().nonnegative(),
|
|
1487
|
+
creditsRefunded: z9.boolean(),
|
|
1488
|
+
startedAt: z9.string().nullable(),
|
|
1489
|
+
completedAt: z9.string().nullable()
|
|
1455
1490
|
}).strict();
|
|
1456
1491
|
|
|
1457
1492
|
// src/commands/upload.ts
|
|
@@ -1461,19 +1496,19 @@ import { basename } from "path";
|
|
|
1461
1496
|
import { request as undiciRequest2 } from "undici";
|
|
1462
1497
|
|
|
1463
1498
|
// src/schemas/assets.ts
|
|
1464
|
-
import { z as
|
|
1499
|
+
import { z as z10 } from "zod";
|
|
1465
1500
|
var MAX_UPLOAD_SIZE_BYTES = 15 * 1024 * 1024;
|
|
1466
|
-
var UploadRequestSchema =
|
|
1467
|
-
filename:
|
|
1468
|
-
contentType:
|
|
1469
|
-
sizeBytes:
|
|
1470
|
-
contentHash:
|
|
1501
|
+
var UploadRequestSchema = z10.object({
|
|
1502
|
+
filename: z10.string().min(1).max(255),
|
|
1503
|
+
contentType: z10.string().regex(/^[\w-]+\/[\w+.-]+$/),
|
|
1504
|
+
sizeBytes: z10.number().int().positive().max(MAX_UPLOAD_SIZE_BYTES),
|
|
1505
|
+
contentHash: z10.string().regex(/^sha256:[0-9a-f]{64}$/)
|
|
1471
1506
|
}).strict();
|
|
1472
|
-
var UploadResponseSchema =
|
|
1473
|
-
assetId:
|
|
1474
|
-
uploadUrl:
|
|
1475
|
-
publicUrl:
|
|
1476
|
-
deduplicated:
|
|
1507
|
+
var UploadResponseSchema = z10.object({
|
|
1508
|
+
assetId: z10.string().uuid(),
|
|
1509
|
+
uploadUrl: z10.string().url(),
|
|
1510
|
+
publicUrl: z10.string().url(),
|
|
1511
|
+
deduplicated: z10.boolean()
|
|
1477
1512
|
}).strict();
|
|
1478
1513
|
|
|
1479
1514
|
// src/commands/upload.ts
|
|
@@ -2569,48 +2604,48 @@ function formatRevokeFailure(err, token) {
|
|
|
2569
2604
|
}
|
|
2570
2605
|
|
|
2571
2606
|
// src/schemas/models.ts
|
|
2572
|
-
import { z as
|
|
2573
|
-
var ModelSummarySchema =
|
|
2574
|
-
id:
|
|
2575
|
-
slug:
|
|
2576
|
-
displayName:
|
|
2577
|
-
description:
|
|
2578
|
-
shortDescription:
|
|
2579
|
-
providerSlug:
|
|
2580
|
-
providerName:
|
|
2581
|
-
modelType:
|
|
2582
|
-
category:
|
|
2583
|
-
costTier:
|
|
2584
|
-
creditCost:
|
|
2585
|
-
pricingStrategy:
|
|
2586
|
-
estimatedSeconds:
|
|
2587
|
-
typical:
|
|
2588
|
-
range:
|
|
2607
|
+
import { z as z11 } from "zod";
|
|
2608
|
+
var ModelSummarySchema = z11.object({
|
|
2609
|
+
id: z11.string().uuid(),
|
|
2610
|
+
slug: z11.string(),
|
|
2611
|
+
displayName: z11.string(),
|
|
2612
|
+
description: z11.string().nullable(),
|
|
2613
|
+
shortDescription: z11.string().nullable(),
|
|
2614
|
+
providerSlug: z11.string(),
|
|
2615
|
+
providerName: z11.string(),
|
|
2616
|
+
modelType: z11.string(),
|
|
2617
|
+
category: z11.string(),
|
|
2618
|
+
costTier: z11.string(),
|
|
2619
|
+
creditCost: z11.number(),
|
|
2620
|
+
pricingStrategy: z11.string(),
|
|
2621
|
+
estimatedSeconds: z11.object({
|
|
2622
|
+
typical: z11.number(),
|
|
2623
|
+
range: z11.array(z11.number())
|
|
2589
2624
|
}).passthrough().nullable(),
|
|
2590
|
-
status:
|
|
2591
|
-
modalities:
|
|
2592
|
-
input:
|
|
2593
|
-
output:
|
|
2625
|
+
status: z11.string(),
|
|
2626
|
+
modalities: z11.object({
|
|
2627
|
+
input: z11.array(z11.string()),
|
|
2628
|
+
output: z11.array(z11.string())
|
|
2594
2629
|
}).passthrough().nullable(),
|
|
2595
|
-
bestFor:
|
|
2596
|
-
badges:
|
|
2597
|
-
|
|
2598
|
-
type:
|
|
2599
|
-
label:
|
|
2600
|
-
color:
|
|
2601
|
-
expires_at:
|
|
2630
|
+
bestFor: z11.array(z11.string()),
|
|
2631
|
+
badges: z11.array(
|
|
2632
|
+
z11.object({
|
|
2633
|
+
type: z11.string(),
|
|
2634
|
+
label: z11.string(),
|
|
2635
|
+
color: z11.string(),
|
|
2636
|
+
expires_at: z11.string().nullable().optional()
|
|
2602
2637
|
}).strict()
|
|
2603
2638
|
),
|
|
2604
|
-
isFeatured:
|
|
2605
|
-
isDefault:
|
|
2606
|
-
docsUrl:
|
|
2607
|
-
llmContext:
|
|
2608
|
-
constraints:
|
|
2609
|
-
modelFamily:
|
|
2610
|
-
isFamilyPrimary:
|
|
2639
|
+
isFeatured: z11.boolean(),
|
|
2640
|
+
isDefault: z11.boolean(),
|
|
2641
|
+
docsUrl: z11.string().nullable(),
|
|
2642
|
+
llmContext: z11.string().nullable(),
|
|
2643
|
+
constraints: z11.record(z11.string(), z11.unknown()).nullable(),
|
|
2644
|
+
modelFamily: z11.string().nullable(),
|
|
2645
|
+
isFamilyPrimary: z11.boolean().nullable()
|
|
2611
2646
|
}).strict();
|
|
2612
|
-
var ModelsListResponseSchema =
|
|
2613
|
-
models:
|
|
2647
|
+
var ModelsListResponseSchema = z11.object({
|
|
2648
|
+
models: z11.array(ModelSummarySchema)
|
|
2614
2649
|
}).strict();
|
|
2615
2650
|
|
|
2616
2651
|
// src/commands/models/internal.ts
|
|
@@ -2647,23 +2682,23 @@ async function listModels(opts) {
|
|
|
2647
2682
|
}
|
|
2648
2683
|
|
|
2649
2684
|
// src/schemas/node-types.ts
|
|
2650
|
-
import { z as
|
|
2651
|
-
var NodeTypeSummarySchema =
|
|
2652
|
-
type:
|
|
2653
|
-
portCount:
|
|
2685
|
+
import { z as z12 } from "zod";
|
|
2686
|
+
var NodeTypeSummarySchema = z12.object({
|
|
2687
|
+
type: z12.string(),
|
|
2688
|
+
portCount: z12.number()
|
|
2654
2689
|
}).strict();
|
|
2655
|
-
var NodeTypePortSchema =
|
|
2656
|
-
handleId:
|
|
2657
|
-
direction:
|
|
2658
|
-
dataType:
|
|
2690
|
+
var NodeTypePortSchema = z12.object({
|
|
2691
|
+
handleId: z12.string(),
|
|
2692
|
+
direction: z12.enum(["input", "output"]),
|
|
2693
|
+
dataType: z12.string()
|
|
2659
2694
|
}).strict();
|
|
2660
|
-
var NodeTypeDetailSchema =
|
|
2661
|
-
type:
|
|
2662
|
-
ports:
|
|
2663
|
-
agentWritableFields:
|
|
2695
|
+
var NodeTypeDetailSchema = z12.object({
|
|
2696
|
+
type: z12.string(),
|
|
2697
|
+
ports: z12.array(NodeTypePortSchema),
|
|
2698
|
+
agentWritableFields: z12.array(z12.string())
|
|
2664
2699
|
}).strict();
|
|
2665
|
-
var NodeTypesListResponseSchema =
|
|
2666
|
-
nodeTypes:
|
|
2700
|
+
var NodeTypesListResponseSchema = z12.object({
|
|
2701
|
+
nodeTypes: z12.array(NodeTypeSummarySchema)
|
|
2667
2702
|
}).strict();
|
|
2668
2703
|
|
|
2669
2704
|
// src/commands/nodes/internal.ts
|
|
@@ -2705,28 +2740,7 @@ async function listNodes(opts) {
|
|
|
2705
2740
|
}
|
|
2706
2741
|
|
|
2707
2742
|
// src/commands/product/list.ts
|
|
2708
|
-
import
|
|
2709
|
-
var ProductImageSummarySchema = z10.object({
|
|
2710
|
-
id: z10.string().uuid(),
|
|
2711
|
-
url: z10.string(),
|
|
2712
|
-
altText: z10.string().nullable(),
|
|
2713
|
-
isPrimary: z10.boolean(),
|
|
2714
|
-
sortOrder: z10.number().int()
|
|
2715
|
-
});
|
|
2716
|
-
var ProductSummarySchema = z10.object({
|
|
2717
|
-
id: z10.string().uuid(),
|
|
2718
|
-
title: z10.string(),
|
|
2719
|
-
sourceType: z10.string(),
|
|
2720
|
-
syncStatus: z10.enum(["synced", "pending", "stale", "error", "deleted_upstream"]).nullable(),
|
|
2721
|
-
vendor: z10.string().nullable(),
|
|
2722
|
-
productType: z10.string().nullable(),
|
|
2723
|
-
tags: z10.array(z10.string()),
|
|
2724
|
-
images: z10.array(ProductImageSummarySchema)
|
|
2725
|
-
});
|
|
2726
|
-
var ProductsListResponseSchema = z10.object({
|
|
2727
|
-
items: z10.array(ProductSummarySchema),
|
|
2728
|
-
nextCursor: z10.string().nullable()
|
|
2729
|
-
});
|
|
2743
|
+
import "zod";
|
|
2730
2744
|
var DEFAULT_LIMIT = 50;
|
|
2731
2745
|
async function listProducts(options) {
|
|
2732
2746
|
const config = await loadConfig({
|
|
@@ -2856,33 +2870,33 @@ async function buildTemplateClient(opts) {
|
|
|
2856
2870
|
}
|
|
2857
2871
|
|
|
2858
2872
|
// src/schemas/templates.ts
|
|
2859
|
-
import { z as
|
|
2860
|
-
var DeclaredParamSchema =
|
|
2861
|
-
name:
|
|
2862
|
-
type:
|
|
2863
|
-
required:
|
|
2864
|
-
defaultValue:
|
|
2865
|
-
enumValues:
|
|
2866
|
-
description:
|
|
2873
|
+
import { z as z14 } from "zod";
|
|
2874
|
+
var DeclaredParamSchema = z14.object({
|
|
2875
|
+
name: z14.string(),
|
|
2876
|
+
type: z14.string(),
|
|
2877
|
+
required: z14.boolean(),
|
|
2878
|
+
defaultValue: z14.string().nullable().optional(),
|
|
2879
|
+
enumValues: z14.array(z14.string()).nullable().optional(),
|
|
2880
|
+
description: z14.string().nullable().optional()
|
|
2867
2881
|
}).strict();
|
|
2868
|
-
var TemplateSummarySchema =
|
|
2869
|
-
id:
|
|
2870
|
-
source:
|
|
2871
|
-
name:
|
|
2872
|
-
description:
|
|
2873
|
-
category:
|
|
2874
|
-
thumbnailUrl:
|
|
2875
|
-
tags:
|
|
2876
|
-
createdAt:
|
|
2882
|
+
var TemplateSummarySchema = z14.object({
|
|
2883
|
+
id: z14.string().uuid(),
|
|
2884
|
+
source: z14.enum(["own", "system"]),
|
|
2885
|
+
name: z14.string(),
|
|
2886
|
+
description: z14.string().nullable(),
|
|
2887
|
+
category: z14.string().nullable(),
|
|
2888
|
+
thumbnailUrl: z14.string().nullable(),
|
|
2889
|
+
tags: z14.array(z14.string()),
|
|
2890
|
+
createdAt: z14.string()
|
|
2877
2891
|
}).strict();
|
|
2878
2892
|
var TemplateDetailSchema = TemplateSummarySchema.extend({
|
|
2879
|
-
declaredParams:
|
|
2880
|
-
timesUsed:
|
|
2893
|
+
declaredParams: z14.array(DeclaredParamSchema),
|
|
2894
|
+
timesUsed: z14.number()
|
|
2881
2895
|
}).strict();
|
|
2882
|
-
var TemplatesListResponseSchema =
|
|
2883
|
-
templates:
|
|
2884
|
-
cursor:
|
|
2885
|
-
hasMore:
|
|
2896
|
+
var TemplatesListResponseSchema = z14.object({
|
|
2897
|
+
templates: z14.array(TemplateSummarySchema),
|
|
2898
|
+
cursor: z14.string().nullable(),
|
|
2899
|
+
hasMore: z14.boolean()
|
|
2886
2900
|
}).strict();
|
|
2887
2901
|
|
|
2888
2902
|
// src/commands/template/list.ts
|
|
@@ -2932,20 +2946,7 @@ async function getTemplate(opts) {
|
|
|
2932
2946
|
}
|
|
2933
2947
|
|
|
2934
2948
|
// src/commands/tokens/list.ts
|
|
2935
|
-
import
|
|
2936
|
-
var TokenRowSchema = z12.object({
|
|
2937
|
-
id: z12.string().uuid(),
|
|
2938
|
-
organizationId: z12.string().uuid(),
|
|
2939
|
-
userId: z12.string().uuid(),
|
|
2940
|
-
clientId: z12.string().nullable(),
|
|
2941
|
-
tokenPrefix: z12.string(),
|
|
2942
|
-
name: z12.string().nullable(),
|
|
2943
|
-
scopes: z12.array(z12.string()),
|
|
2944
|
-
lastUsedAt: z12.string().nullable(),
|
|
2945
|
-
expiresAt: z12.string(),
|
|
2946
|
-
createdAt: z12.string()
|
|
2947
|
-
}).strict();
|
|
2948
|
-
var TokensListResponseSchema = z12.array(TokenRowSchema);
|
|
2949
|
+
import "zod";
|
|
2949
2950
|
async function listTokens(options) {
|
|
2950
2951
|
const config = await loadConfig({
|
|
2951
2952
|
flagProfile: options.profile,
|
|
@@ -2971,51 +2972,51 @@ async function listTokens(options) {
|
|
|
2971
2972
|
}
|
|
2972
2973
|
|
|
2973
2974
|
// src/schemas/workflows.ts
|
|
2974
|
-
import { z as
|
|
2975
|
-
var WorkflowDeclaredParamSchema =
|
|
2976
|
-
name:
|
|
2977
|
-
type:
|
|
2978
|
-
required:
|
|
2979
|
-
defaultValue:
|
|
2980
|
-
description:
|
|
2975
|
+
import { z as z16 } from "zod";
|
|
2976
|
+
var WorkflowDeclaredParamSchema = z16.object({
|
|
2977
|
+
name: z16.string(),
|
|
2978
|
+
type: z16.string(),
|
|
2979
|
+
required: z16.boolean().optional(),
|
|
2980
|
+
defaultValue: z16.unknown().optional(),
|
|
2981
|
+
description: z16.unknown().optional()
|
|
2981
2982
|
}).passthrough();
|
|
2982
|
-
var WorkflowSummarySchema =
|
|
2983
|
-
id:
|
|
2984
|
-
name:
|
|
2985
|
-
tags:
|
|
2986
|
-
declared_params:
|
|
2987
|
-
canvas_rev:
|
|
2988
|
-
updated_at:
|
|
2983
|
+
var WorkflowSummarySchema = z16.object({
|
|
2984
|
+
id: z16.string().uuid(),
|
|
2985
|
+
name: z16.string(),
|
|
2986
|
+
tags: z16.array(z16.string()),
|
|
2987
|
+
declared_params: z16.array(WorkflowDeclaredParamSchema).nullable().default([]),
|
|
2988
|
+
canvas_rev: z16.number().int().nonnegative(),
|
|
2989
|
+
updated_at: z16.string()
|
|
2989
2990
|
}).strict();
|
|
2990
|
-
var WorkflowsListResponseSchema =
|
|
2991
|
-
items:
|
|
2992
|
-
nextCursor:
|
|
2991
|
+
var WorkflowsListResponseSchema = z16.object({
|
|
2992
|
+
items: z16.array(WorkflowSummarySchema),
|
|
2993
|
+
nextCursor: z16.string().nullable()
|
|
2993
2994
|
}).strict();
|
|
2994
|
-
var WorkflowDetailSchema =
|
|
2995
|
-
id:
|
|
2996
|
-
name:
|
|
2997
|
-
description:
|
|
2998
|
-
tags:
|
|
2999
|
-
declared_params:
|
|
3000
|
-
canvas_rev:
|
|
3001
|
-
nodes:
|
|
3002
|
-
edges:
|
|
3003
|
-
created_at:
|
|
3004
|
-
updated_at:
|
|
2995
|
+
var WorkflowDetailSchema = z16.object({
|
|
2996
|
+
id: z16.string().uuid(),
|
|
2997
|
+
name: z16.string(),
|
|
2998
|
+
description: z16.string().nullable(),
|
|
2999
|
+
tags: z16.array(z16.string()),
|
|
3000
|
+
declared_params: z16.array(WorkflowDeclaredParamSchema).nullable().default([]),
|
|
3001
|
+
canvas_rev: z16.number().int().nonnegative(),
|
|
3002
|
+
nodes: z16.array(z16.unknown()),
|
|
3003
|
+
edges: z16.array(z16.unknown()),
|
|
3004
|
+
created_at: z16.string(),
|
|
3005
|
+
updated_at: z16.string()
|
|
3005
3006
|
}).strict();
|
|
3006
|
-
var WorkflowCreateResponseSchema =
|
|
3007
|
-
id:
|
|
3008
|
-
name:
|
|
3009
|
-
description:
|
|
3010
|
-
tags:
|
|
3011
|
-
declared_params:
|
|
3012
|
-
canvas_rev:
|
|
3013
|
-
created_at:
|
|
3014
|
-
updated_at:
|
|
3007
|
+
var WorkflowCreateResponseSchema = z16.object({
|
|
3008
|
+
id: z16.string().uuid(),
|
|
3009
|
+
name: z16.string(),
|
|
3010
|
+
description: z16.string().nullable(),
|
|
3011
|
+
tags: z16.array(z16.string()),
|
|
3012
|
+
declared_params: z16.array(WorkflowDeclaredParamSchema).nullable().default([]),
|
|
3013
|
+
canvas_rev: z16.number().int().nonnegative(),
|
|
3014
|
+
created_at: z16.string(),
|
|
3015
|
+
updated_at: z16.string()
|
|
3015
3016
|
}).strict();
|
|
3016
|
-
var WorkflowMutateResponseSchema =
|
|
3017
|
-
canvas_rev:
|
|
3018
|
-
applied:
|
|
3017
|
+
var WorkflowMutateResponseSchema = z16.object({
|
|
3018
|
+
canvas_rev: z16.number().int().nonnegative(),
|
|
3019
|
+
applied: z16.number().int().nonnegative(),
|
|
3019
3020
|
workflow: WorkflowDetailSchema
|
|
3020
3021
|
}).strict();
|
|
3021
3022
|
|