@domino-sdk/relay-cli 0.2.0 → 0.4.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/cli/capabilities.json +56 -20
- package/cli/commands/discovery.mjs +1 -1
- package/cli/commands/hosting.mjs +7 -8
- package/cli/commands/project.mjs +4 -0
- package/cli/discovery.mjs +62 -0
- package/cli/doctor.mjs +9 -2
- package/cli/project.mjs +126 -29
- package/cli/skills/domino/SKILL.md +34 -4
- package/cli/skills/domino/references/authoring.md +98 -1
- package/cli/skills/domino/references/existing-app.md +6 -2
- package/cli/skills/domino/references/hosted.md +12 -0
- package/cli/skills/domino/references/participant-api.md +82 -1
- package/cli/skills/domino/references/referrals.md +57 -8
- package/cli/skills/domino/references/troubleshooting.md +2 -0
- package/dist/index.d.ts +993 -4
- package/dist/index.js +105 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
|
+
publishedReferralSchema,
|
|
4
|
+
referralManagementSchema,
|
|
5
|
+
referralControlSchema,
|
|
6
|
+
referralHistorySchema
|
|
7
|
+
} from "@domino-sdk/relay";
|
|
8
|
+
import {
|
|
9
|
+
leaderboardPageSchema,
|
|
10
|
+
publishedLeaderboardSchema,
|
|
11
|
+
leaderboardQuerySchema,
|
|
12
|
+
leaderboardExclusionSchema,
|
|
13
|
+
leaderboardGroupSchema,
|
|
14
|
+
pointsMutationSchema,
|
|
15
|
+
pointsResultSchema,
|
|
16
|
+
pointsAccountSchema,
|
|
17
|
+
pointsEntrySchema,
|
|
3
18
|
projectDeploymentSchema,
|
|
4
19
|
deploymentPreviewSchema,
|
|
5
20
|
publishDeploymentSchema,
|
|
@@ -52,7 +67,8 @@ var buildIdentitySchema = z.object({
|
|
|
52
67
|
project: identifier,
|
|
53
68
|
commit: commitSchema,
|
|
54
69
|
createdAt: z.number(),
|
|
55
|
-
actor: z.string()
|
|
70
|
+
actor: z.string(),
|
|
71
|
+
commitMessage: z.string().max(500).optional()
|
|
56
72
|
});
|
|
57
73
|
var buildPhaseSchema = z.enum([
|
|
58
74
|
"queued",
|
|
@@ -66,9 +82,22 @@ var buildPhaseSchema = z.enum([
|
|
|
66
82
|
]);
|
|
67
83
|
var buildStatusSchema = z.object({
|
|
68
84
|
phase: buildPhaseSchema,
|
|
85
|
+
failedPhase: buildPhaseSchema.optional(),
|
|
69
86
|
updatedAt: z.number(),
|
|
70
87
|
message: z.string()
|
|
71
88
|
});
|
|
89
|
+
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
90
|
+
...buildStatusSchema.shape,
|
|
91
|
+
finished: z.boolean(),
|
|
92
|
+
current: z.boolean(),
|
|
93
|
+
stagingUrl: z.string().url()
|
|
94
|
+
});
|
|
95
|
+
var buildSnapshotSchema = z.object({
|
|
96
|
+
builds: z.array(hostedBuildSchema),
|
|
97
|
+
current: hostedBuildSchema.nullable(),
|
|
98
|
+
selected: hostedBuildSchema.nullable(),
|
|
99
|
+
logs: z.string()
|
|
100
|
+
});
|
|
72
101
|
var assetPathSchema = z.string().max(512).refine(
|
|
73
102
|
(path) => path.startsWith("/") && !/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")) && !path.startsWith("/relay/") && !path.startsWith("/__domino/"),
|
|
74
103
|
"Expected a public asset path without hidden or reserved segments"
|
|
@@ -120,6 +149,10 @@ var developmentPreflightSchema = z2.object({
|
|
|
120
149
|
organization: z2.string(),
|
|
121
150
|
project: z2.string(),
|
|
122
151
|
environment: z2.enum(["test", "live"]),
|
|
152
|
+
identity: z2.object({
|
|
153
|
+
exchange: z2.literal("supported"),
|
|
154
|
+
activeIntegrations: z2.number().int().nonnegative()
|
|
155
|
+
}).optional(),
|
|
123
156
|
staging: z2.enum(["configured", "blocked"]),
|
|
124
157
|
development: z2.object({
|
|
125
158
|
status: z2.enum(["configured", "blocked"]),
|
|
@@ -147,10 +180,11 @@ var permissionSchema = z3.enum([
|
|
|
147
180
|
"confirm",
|
|
148
181
|
"handover",
|
|
149
182
|
"inventory",
|
|
150
|
-
"access"
|
|
183
|
+
"access",
|
|
184
|
+
"points"
|
|
151
185
|
]);
|
|
152
186
|
var rolePermissions = {
|
|
153
|
-
editor: ["read", "publish", "inventory"],
|
|
187
|
+
editor: ["read", "publish", "inventory", "points"],
|
|
154
188
|
reviewer: ["read", "review"],
|
|
155
189
|
staff: ["read", "confirm", "handover"]
|
|
156
190
|
};
|
|
@@ -349,6 +383,72 @@ function createManagementClient(options) {
|
|
|
349
383
|
return {
|
|
350
384
|
raw,
|
|
351
385
|
request,
|
|
386
|
+
points: {
|
|
387
|
+
update: (input) => request(
|
|
388
|
+
"/points",
|
|
389
|
+
pointsResultSchema,
|
|
390
|
+
pointsMutationSchema.parse(input)
|
|
391
|
+
),
|
|
392
|
+
balance: (member, balance) => request(
|
|
393
|
+
`/points/${identifier2.parse(member)}/${identifier2.parse(balance)}`,
|
|
394
|
+
pointsAccountSchema
|
|
395
|
+
),
|
|
396
|
+
history: (member, balance, before) => request(
|
|
397
|
+
`/points/${identifier2.parse(member)}/${identifier2.parse(balance)}/history${before === void 0 ? "" : "?before=" + before}`,
|
|
398
|
+
z3.object({
|
|
399
|
+
items: z3.array(pointsEntrySchema),
|
|
400
|
+
next: z3.number().nullable()
|
|
401
|
+
})
|
|
402
|
+
)
|
|
403
|
+
},
|
|
404
|
+
referrals: {
|
|
405
|
+
history: (member, before) => request(
|
|
406
|
+
`/referrals/history/${identifier2.parse(member)}${before === void 0 ? "" : "?before=" + before}`,
|
|
407
|
+
referralHistorySchema
|
|
408
|
+
),
|
|
409
|
+
list: () => request("/referrals", z3.array(publishedReferralSchema)),
|
|
410
|
+
participants: (before) => request(
|
|
411
|
+
`/referrals/participants${before === void 0 ? "" : "?before=" + before}`,
|
|
412
|
+
referralManagementSchema
|
|
413
|
+
),
|
|
414
|
+
control: (input) => request(
|
|
415
|
+
"/referrals/control",
|
|
416
|
+
z3.object({ ok: z3.literal(true) }),
|
|
417
|
+
referralControlSchema.parse(input)
|
|
418
|
+
)
|
|
419
|
+
},
|
|
420
|
+
leaderboards: {
|
|
421
|
+
list: () => request("/leaderboards", z3.array(publishedLeaderboardSchema)),
|
|
422
|
+
standings: (board, input = {}) => {
|
|
423
|
+
const query = leaderboardQuerySchema.parse(input);
|
|
424
|
+
const params = new URLSearchParams({
|
|
425
|
+
limit: String(query.limit),
|
|
426
|
+
...query.cursor ? { cursor: query.cursor } : {}
|
|
427
|
+
});
|
|
428
|
+
return request(
|
|
429
|
+
`/leaderboards/${identifier2.parse(board)}?${params}`,
|
|
430
|
+
leaderboardPageSchema
|
|
431
|
+
);
|
|
432
|
+
},
|
|
433
|
+
history: (board) => request(
|
|
434
|
+
`/leaderboards/${identifier2.parse(board)}/history`,
|
|
435
|
+
z3.array(publishedLeaderboardSchema)
|
|
436
|
+
),
|
|
437
|
+
exclusions: (board) => request(
|
|
438
|
+
`/leaderboards/${identifier2.parse(board)}/exclusions`,
|
|
439
|
+
z3.array(z3.object({ member: identifier2 }))
|
|
440
|
+
),
|
|
441
|
+
exclude: (board, input) => request(
|
|
442
|
+
`/leaderboards/${identifier2.parse(board)}/exclusions`,
|
|
443
|
+
z3.object({ ok: z3.literal(true) }),
|
|
444
|
+
leaderboardExclusionSchema.parse(input)
|
|
445
|
+
),
|
|
446
|
+
group: (group, input) => request(
|
|
447
|
+
`/leaderboard-groups/${identifier2.parse(group)}`,
|
|
448
|
+
z3.object({ ok: z3.literal(true) }),
|
|
449
|
+
leaderboardGroupSchema.parse(input)
|
|
450
|
+
)
|
|
451
|
+
},
|
|
352
452
|
deployments: {
|
|
353
453
|
preview: (input) => request(
|
|
354
454
|
"/deployments/preview",
|
|
@@ -431,6 +531,7 @@ export {
|
|
|
431
531
|
buildArtifactsSchema,
|
|
432
532
|
buildIdentitySchema,
|
|
433
533
|
buildPhaseSchema,
|
|
534
|
+
buildSnapshotSchema,
|
|
434
535
|
buildStatusSchema,
|
|
435
536
|
commitSchema,
|
|
436
537
|
createManagementClient,
|
|
@@ -441,6 +542,7 @@ export {
|
|
|
441
542
|
deviceStartSchema,
|
|
442
543
|
environmentSchema,
|
|
443
544
|
grantSchema,
|
|
545
|
+
hostedBuildSchema,
|
|
444
546
|
inventorySchema,
|
|
445
547
|
memberAccountSchema,
|
|
446
548
|
memberDetailSchema,
|
package/package.json
CHANGED