@domino-sdk/relay-cli 0.3.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 +45 -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 +7 -1
- 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 +2 -0
- package/cli/skills/domino/references/hosted.md +12 -0
- package/cli/skills/domino/references/participant-api.md +45 -0
- package/cli/skills/domino/references/referrals.md +57 -8
- package/dist/index.d.ts +989 -4
- package/dist/index.js +101 -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"
|
|
@@ -151,10 +180,11 @@ var permissionSchema = z3.enum([
|
|
|
151
180
|
"confirm",
|
|
152
181
|
"handover",
|
|
153
182
|
"inventory",
|
|
154
|
-
"access"
|
|
183
|
+
"access",
|
|
184
|
+
"points"
|
|
155
185
|
]);
|
|
156
186
|
var rolePermissions = {
|
|
157
|
-
editor: ["read", "publish", "inventory"],
|
|
187
|
+
editor: ["read", "publish", "inventory", "points"],
|
|
158
188
|
reviewer: ["read", "review"],
|
|
159
189
|
staff: ["read", "confirm", "handover"]
|
|
160
190
|
};
|
|
@@ -353,6 +383,72 @@ function createManagementClient(options) {
|
|
|
353
383
|
return {
|
|
354
384
|
raw,
|
|
355
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
|
+
},
|
|
356
452
|
deployments: {
|
|
357
453
|
preview: (input) => request(
|
|
358
454
|
"/deployments/preview",
|
|
@@ -435,6 +531,7 @@ export {
|
|
|
435
531
|
buildArtifactsSchema,
|
|
436
532
|
buildIdentitySchema,
|
|
437
533
|
buildPhaseSchema,
|
|
534
|
+
buildSnapshotSchema,
|
|
438
535
|
buildStatusSchema,
|
|
439
536
|
commitSchema,
|
|
440
537
|
createManagementClient,
|
|
@@ -445,6 +542,7 @@ export {
|
|
|
445
542
|
deviceStartSchema,
|
|
446
543
|
environmentSchema,
|
|
447
544
|
grantSchema,
|
|
545
|
+
hostedBuildSchema,
|
|
448
546
|
inventorySchema,
|
|
449
547
|
memberAccountSchema,
|
|
450
548
|
memberDetailSchema,
|
package/package.json
CHANGED