@domino-sdk/relay 1.63.0 → 1.65.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 +25 -0
- package/dist/{accounts-nz3mzfRQ.d.ts → accounts-_lNsiR2k.d.ts} +22 -2
- package/dist/{attempt-captures-DMi8oR9T.d.ts → attempt-captures-BqPggxTU.d.ts} +1 -1
- package/dist/authoring.d.ts +11 -11
- package/dist/authoring.js +15 -20
- package/dist/{automatic-outcomes-C_LLQU1p.d.ts → automatic-outcomes-BzAvfcpd.d.ts} +2 -2
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +11 -14
- package/dist/{catalog-BaTOKpNw.d.ts → catalog-ByZMRS7I.d.ts} +1 -1
- package/dist/{chunk-VWQGWGCH.js → chunk-4NIV4NPV.js} +1 -1
- package/dist/{chunk-ICXZZNPS.js → chunk-7H4MRVQF.js} +1 -1
- package/dist/{chunk-NQDEWJWE.js → chunk-CVQZ2YP7.js} +6 -232
- package/dist/{chunk-3RFP6GT5.js → chunk-DLABJSBO.js} +2 -2
- package/dist/{chunk-AQOL3SK5.js → chunk-E22XSC4L.js} +1 -1
- package/dist/{chunk-N4LNEGQX.js → chunk-EDNKKVGU.js} +2 -2
- package/dist/{chunk-GLH6MEI2.js → chunk-EOUEAOWJ.js} +28 -2
- package/dist/{chunk-MTKRIQEU.js → chunk-EUEW2APU.js} +1 -1
- package/dist/{chunk-ID3BZXFZ.js → chunk-HNR6G3GV.js} +1939 -1211
- package/dist/{chunk-5XLZ34PV.js → chunk-KCUUHT2V.js} +3 -3
- package/dist/{chunk-EHUSD3O2.js → chunk-MPTE7EIV.js} +2 -4
- package/dist/{chunk-QR6HH4DI.js → chunk-NG4GZ54I.js} +4 -4
- package/dist/chunk-R2KZFX6E.js +405 -0
- package/dist/{chunk-4GQW43UU.js → chunk-RD3XJ4DH.js} +26 -30
- package/dist/{chunk-7Z4SZ6YM.js → chunk-SE7XHQFP.js} +1 -1
- package/dist/{chunk-LZWXCBUB.js → chunk-VBYOAT46.js} +41 -45
- package/dist/{chunk-7X67QLPB.js → chunk-XVZ4YOF2.js} +1 -1
- package/dist/{chunk-FU5CGNTR.js → chunk-ZQ3IPCI6.js} +44 -5
- package/dist/chunk-ZXGBDLVB.js +1510 -0
- package/dist/{client-DHmG7rn6.d.ts → client-D7IiwEq2.d.ts} +12 -7
- package/dist/{dashboards-CLemT6kj.d.ts → dashboards-pVfclkyh.d.ts} +2 -2
- package/dist/{deployments-DTULi7dF.d.ts → deployments-Cr1tfqrr.d.ts} +2 -2
- package/dist/{identity-integration-DOeNZaxF.d.ts → identity-integration-Ci2vGKtX.d.ts} +37 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +11 -15
- package/dist/internal.d.ts +12 -12
- package/dist/internal.js +21 -16
- package/dist/{limits-kNzYdZ00.d.ts → limits-pE04y9O2.d.ts} +8 -1
- package/dist/{offers-CYeN_I0Y.d.ts → offers-Hw2P6tcK.d.ts} +2 -2
- package/dist/{participant-activity-D-Drp24G.d.ts → participant-activity-DXRq4s6K.d.ts} +1 -0
- package/dist/portal-proxy.d.ts +4 -2
- package/dist/portal-proxy.js +13 -5
- package/dist/react/index.d.ts +20 -13
- package/dist/react/index.js +11 -14
- package/dist/{reward-deliveries-drp-x1G-.d.ts → reward-deliveries-BCV8hznc.d.ts} +1 -1
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/6EBN6IZU.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +19 -16
- package/dist/schema.js +109 -112
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +775 -1037
- package/dist/{sign-in-providers-B1Q9eDRm.d.ts → sign-in-providers-BAkGjSXo.d.ts} +2 -2
- package/dist/{submission-input-DZCbjQUH.d.ts → submission-input-ChL1aYNH.d.ts} +2 -2
- package/dist/{telegram-browser-NL0Asmsi.d.ts → telegram-browser-K27t4TwM.d.ts} +4 -4
- package/dist/telegram.d.ts +8 -8
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +10 -10
- package/dist/testing.js +19 -23
- package/dist/{tracker-data-esm3WG8R.d.ts → tracker-data-Bl-qPIvZ.d.ts} +3 -1
- package/dist/{transport-Czht_irp.d.ts → transport-DC1m73Tp.d.ts} +1065 -14
- package/package.json +1 -1
- package/dist/chunk-4NOFSGAL.js +0 -320
- package/dist/chunk-FO2LCZTL.js +0 -19
- package/dist/chunk-KP2MCX3R.js +0 -587
- package/dist/chunk-N4BDKS6Y.js +0 -87
- package/dist/chunk-TLSQETTY.js +0 -41
- package/dist/chunk-W7YSMSGC.js +0 -725
- package/dist/runtime/chunks/UGDV5W4N.js +0 -1
package/package.json
CHANGED
package/dist/chunk-4NOFSGAL.js
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
badgeSchema,
|
|
3
|
-
pointLedgerReferenceSchema
|
|
4
|
-
} from "./chunk-W7YSMSGC.js";
|
|
5
|
-
import {
|
|
6
|
-
authoringIdentityShape,
|
|
7
|
-
entitlementSchema,
|
|
8
|
-
identifier,
|
|
9
|
-
limits,
|
|
10
|
-
mediaUrlSchema,
|
|
11
|
-
memberProgressSchema,
|
|
12
|
-
pageCursorSchema,
|
|
13
|
-
prerequisiteSchema,
|
|
14
|
-
publishedReleaseSchema,
|
|
15
|
-
questPresentationContentSchema,
|
|
16
|
-
responseShape,
|
|
17
|
-
retryCooldownMsSchema,
|
|
18
|
-
reviewModeSchema,
|
|
19
|
-
sdkRuntimeReferenceSchema,
|
|
20
|
-
settingsValuesSchema,
|
|
21
|
-
storedQuestDescriptionSchema,
|
|
22
|
-
storedReviewModeSchema,
|
|
23
|
-
tieredRewardReferenceSchema
|
|
24
|
-
} from "./chunk-ID3BZXFZ.js";
|
|
25
|
-
|
|
26
|
-
// src/participant-activity.ts
|
|
27
|
-
import * as z from "zod";
|
|
28
|
-
var base = /* @__PURE__ */ (() => ({ id: z.string(), at: z.number() }))();
|
|
29
|
-
var attempt = /* @__PURE__ */ (() => ({
|
|
30
|
-
...base,
|
|
31
|
-
quest: z.string(),
|
|
32
|
-
attempt: z.string(),
|
|
33
|
-
completion: z.string().nullable()
|
|
34
|
-
}))();
|
|
35
|
-
var kinds = [
|
|
36
|
-
"attempt.accepted",
|
|
37
|
-
"attempt.rejected",
|
|
38
|
-
"attempt.review",
|
|
39
|
-
"points.awarded",
|
|
40
|
-
"entitlement.granted",
|
|
41
|
-
"entitlement.collected",
|
|
42
|
-
"delivery.updated",
|
|
43
|
-
"referral.qualified"
|
|
44
|
-
];
|
|
45
|
-
var knownRelayEventSchema = /* @__PURE__ */ (() => z.discriminatedUnion("kind", [
|
|
46
|
-
z.object({ ...attempt, kind: z.literal("attempt.accepted") }),
|
|
47
|
-
z.object({ ...attempt, kind: z.literal("attempt.rejected") }),
|
|
48
|
-
z.object({ ...attempt, kind: z.literal("attempt.review") }),
|
|
49
|
-
z.object({
|
|
50
|
-
...base,
|
|
51
|
-
kind: z.literal("points.awarded"),
|
|
52
|
-
entry: z.string(),
|
|
53
|
-
ledger: z.string(),
|
|
54
|
-
amount: z.number(),
|
|
55
|
-
quest: z.string().nullable(),
|
|
56
|
-
completion: z.string().nullable()
|
|
57
|
-
}),
|
|
58
|
-
z.object({
|
|
59
|
-
...base,
|
|
60
|
-
kind: z.literal("entitlement.granted"),
|
|
61
|
-
entitlement: z.string(),
|
|
62
|
-
tier: z.string(),
|
|
63
|
-
status: z.string()
|
|
64
|
-
}),
|
|
65
|
-
z.object({
|
|
66
|
-
...base,
|
|
67
|
-
kind: z.literal("entitlement.collected"),
|
|
68
|
-
entitlement: z.string()
|
|
69
|
-
}),
|
|
70
|
-
z.object({
|
|
71
|
-
...base,
|
|
72
|
-
kind: z.literal("delivery.updated"),
|
|
73
|
-
delivery: z.string(),
|
|
74
|
-
quest: z.string(),
|
|
75
|
-
completion: z.string(),
|
|
76
|
-
status: z.string()
|
|
77
|
-
}),
|
|
78
|
-
z.object({
|
|
79
|
-
...base,
|
|
80
|
-
kind: z.literal("referral.qualified"),
|
|
81
|
-
program: z.string()
|
|
82
|
-
})
|
|
83
|
-
]))();
|
|
84
|
-
var relayEventSchema = /* @__PURE__ */ (() => z.union([
|
|
85
|
-
knownRelayEventSchema,
|
|
86
|
-
z.object({
|
|
87
|
-
...base,
|
|
88
|
-
kind: z.string().refine((kind) => !kinds.includes(kind))
|
|
89
|
-
}).catchall(z.json()).transform(({ kind, ...event }) => ({
|
|
90
|
-
...event,
|
|
91
|
-
kind: "unknown",
|
|
92
|
-
reportedKind: kind
|
|
93
|
-
}))
|
|
94
|
-
]))();
|
|
95
|
-
var participantActivityQuerySchema = /* @__PURE__ */ (() => z.object({
|
|
96
|
-
cursor: pageCursorSchema.optional(),
|
|
97
|
-
/** `latest` answers no events and the cursor of the newest one, to follow only what comes next. */
|
|
98
|
-
start: z.literal("latest").optional(),
|
|
99
|
-
limit: z.number().int().min(1).max(100).default(50)
|
|
100
|
-
}).strict().refine((query) => !(query.cursor && query.start), {
|
|
101
|
-
message: "Pass either cursor or start, not both"
|
|
102
|
-
}))();
|
|
103
|
-
var participantActivitySchema = /* @__PURE__ */ (() => z.object({
|
|
104
|
-
member: z.string(),
|
|
105
|
-
items: z.array(relayEventSchema),
|
|
106
|
-
/**
|
|
107
|
-
* Never null: the feed has no last page, so an empty page still answers the cursor to read
|
|
108
|
-
* from next. A loop over it, such as `paginate`, stops on its own condition, such as an empty
|
|
109
|
-
* page or a count.
|
|
110
|
-
*/
|
|
111
|
-
nextCursor: pageCursorSchema
|
|
112
|
-
}))();
|
|
113
|
-
|
|
114
|
-
// src/catalog.ts
|
|
115
|
-
import * as z2 from "zod";
|
|
116
|
-
var interactionSchema = /* @__PURE__ */ (() => z2.enum([
|
|
117
|
-
"photo",
|
|
118
|
-
"text",
|
|
119
|
-
"url",
|
|
120
|
-
"quiz",
|
|
121
|
-
"claim",
|
|
122
|
-
"staff",
|
|
123
|
-
"automatic"
|
|
124
|
-
]))();
|
|
125
|
-
function questInteraction(trigger) {
|
|
126
|
-
return trigger.kind === "automatic" ? "automatic" : trigger.actor === "staff" ? "staff" : trigger.input === "none" ? "claim" : trigger.input;
|
|
127
|
-
}
|
|
128
|
-
var questTypeVersionSchema = /* @__PURE__ */ (() => z2.object({
|
|
129
|
-
archivedAt: z2.number().int().nonnegative().nullable().optional(),
|
|
130
|
-
key: identifier.optional(),
|
|
131
|
-
id: identifier,
|
|
132
|
-
version: identifier,
|
|
133
|
-
code: z2.string(),
|
|
134
|
-
/** The SDK runtime `code` imports. Absent, the code bundles its own SDK. */
|
|
135
|
-
runtime: sdkRuntimeReferenceSchema.optional(),
|
|
136
|
-
definition: storedQuestDescriptionSchema,
|
|
137
|
-
provider: storedReviewModeSchema,
|
|
138
|
-
createdAt: z2.number()
|
|
139
|
-
}))();
|
|
140
|
-
var collectionSlotSchema = /* @__PURE__ */ (() => z2.object({
|
|
141
|
-
archivedAt: z2.number().int().nonnegative().nullable().optional(),
|
|
142
|
-
id: identifier,
|
|
143
|
-
key: identifier.optional(),
|
|
144
|
-
title: z2.string().trim().min(1).max(120),
|
|
145
|
-
description: z2.string().max(4e3).optional(),
|
|
146
|
-
image: mediaUrlSchema.optional(),
|
|
147
|
-
imageAlt: z2.string().max(500).optional()
|
|
148
|
-
}))();
|
|
149
|
-
var collectionSlotDeclarationSchema = /* @__PURE__ */ (() => collectionSlotSchema.omit({ id: true, archivedAt: true }).extend(authoringIdentityShape).strict())();
|
|
150
|
-
var questCollectionSchema = /* @__PURE__ */ (() => collectionSlotSchema.extend({
|
|
151
|
-
quests: z2.array(identifier).max(100).refine(
|
|
152
|
-
(v) => new Set(v).size === v.length,
|
|
153
|
-
"A collection can contain a quest only once"
|
|
154
|
-
)
|
|
155
|
-
}))();
|
|
156
|
-
var questInstanceSchema = /* @__PURE__ */ (() => z2.object({
|
|
157
|
-
badges: z2.array(identifier).max(10).refine(
|
|
158
|
-
(items) => new Set(items).size === items.length,
|
|
159
|
-
"Choose each badge once"
|
|
160
|
-
).optional(),
|
|
161
|
-
id: identifier,
|
|
162
|
-
title: z2.string().trim().min(1).max(120),
|
|
163
|
-
typeVersion: identifier,
|
|
164
|
-
presentation: questPresentationContentSchema.optional(),
|
|
165
|
-
settings: settingsValuesSchema,
|
|
166
|
-
requires: z2.array(prerequisiteSchema).max(30),
|
|
167
|
-
/**
|
|
168
|
-
* Milliseconds a member waits after a rejected attempt before submitting again, or `null` for
|
|
169
|
-
* no cooldown. Omitted: the quest type's own `retryCooldownMs`.
|
|
170
|
-
*/
|
|
171
|
-
retryCooldownMs: retryCooldownMsSchema.nullable().optional(),
|
|
172
|
-
/**
|
|
173
|
-
* Milliseconds a member waits after an accepted completion before submitting again, or `null`
|
|
174
|
-
* for no cooldown. Omitted: the quest type's own `completionCooldownMs`.
|
|
175
|
-
*/
|
|
176
|
-
completionCooldownMs: retryCooldownMsSchema.nullable().optional(),
|
|
177
|
-
status: z2.enum(["active", "paused", "archived"])
|
|
178
|
-
}).strict())();
|
|
179
|
-
var questDraftChangesSchema = /* @__PURE__ */ (() => z2.object({
|
|
180
|
-
quests: z2.array(
|
|
181
|
-
questInstanceSchema.extend({ expectedRelease: identifier.nullable() })
|
|
182
|
-
).max(limits.quests),
|
|
183
|
-
collections: z2.array(questCollectionSchema.omit({ archivedAt: true }).strict()).max(limits.collections)
|
|
184
|
-
}).strict())();
|
|
185
|
-
var draftBase = /* @__PURE__ */ (() => z2.object({
|
|
186
|
-
id: identifier,
|
|
187
|
-
revision: z2.number().int().positive(),
|
|
188
|
-
baseRevision: z2.number().int().nonnegative(),
|
|
189
|
-
changes: questDraftChangesSchema
|
|
190
|
-
}))();
|
|
191
|
-
var questDraftSchema = /* @__PURE__ */ (() => responseShape(
|
|
192
|
-
z2.discriminatedUnion("status", [
|
|
193
|
-
draftBase.extend({ status: z2.literal("draft") }),
|
|
194
|
-
draftBase.extend({
|
|
195
|
-
status: z2.literal("published"),
|
|
196
|
-
releaseIds: z2.array(identifier)
|
|
197
|
-
})
|
|
198
|
-
])
|
|
199
|
-
))();
|
|
200
|
-
var questCatalogSchema = /* @__PURE__ */ (() => responseShape(
|
|
201
|
-
z2.object({
|
|
202
|
-
revision: z2.number().int().nonnegative(),
|
|
203
|
-
types: z2.array(questTypeVersionSchema),
|
|
204
|
-
collections: z2.array(questCollectionSchema),
|
|
205
|
-
quests: z2.array(questInstanceSchema),
|
|
206
|
-
drafts: z2.array(questDraftSchema),
|
|
207
|
-
releases: z2.array(publishedReleaseSchema).default([]),
|
|
208
|
-
supportedInteractions: z2.array(interactionSchema)
|
|
209
|
-
})
|
|
210
|
-
))();
|
|
211
|
-
var catalogDeploymentSchema = /* @__PURE__ */ (() => z2.object({
|
|
212
|
-
expectedRevision: z2.number().int().nonnegative(),
|
|
213
|
-
types: z2.array(
|
|
214
|
-
z2.object({
|
|
215
|
-
code: z2.string().min(1).max(1e6),
|
|
216
|
-
runtime: sdkRuntimeReferenceSchema.optional(),
|
|
217
|
-
provider: reviewModeSchema
|
|
218
|
-
})
|
|
219
|
-
).max(limits.questTypes).default([]),
|
|
220
|
-
collections: z2.array(collectionSlotDeclarationSchema).max(limits.collections).default([]),
|
|
221
|
-
supportedInteractions: z2.array(interactionSchema).min(1).optional()
|
|
222
|
-
}).strict())();
|
|
223
|
-
var catalogDeploymentPreviewSchema = /* @__PURE__ */ (() => responseShape(
|
|
224
|
-
z2.object({
|
|
225
|
-
revision: z2.number().int().nonnegative(),
|
|
226
|
-
types: z2.array(questTypeVersionSchema),
|
|
227
|
-
collections: z2.array(collectionSlotSchema),
|
|
228
|
-
supportedInteractions: z2.array(interactionSchema)
|
|
229
|
-
})
|
|
230
|
-
))();
|
|
231
|
-
var saveQuestDraftSchema = /* @__PURE__ */ (() => z2.object({
|
|
232
|
-
id: identifier.optional(),
|
|
233
|
-
actionId: identifier,
|
|
234
|
-
expectedRevision: z2.number().int().nonnegative(),
|
|
235
|
-
baseRevision: z2.number().int().nonnegative(),
|
|
236
|
-
changes: questDraftChangesSchema
|
|
237
|
-
}).strict())();
|
|
238
|
-
var publishQuestDraftSchema = /* @__PURE__ */ (() => z2.object({ id: identifier, expectedRevision: z2.number().int().positive() }).strict())();
|
|
239
|
-
var questRewardViewSchema = /* @__PURE__ */ (() => z2.discriminatedUnion("kind", [
|
|
240
|
-
z2.object({
|
|
241
|
-
kind: z2.literal("points"),
|
|
242
|
-
label: z2.string(),
|
|
243
|
-
amount: z2.number().int().nonnegative(),
|
|
244
|
-
ledger: pointLedgerReferenceSchema
|
|
245
|
-
}),
|
|
246
|
-
z2.object({
|
|
247
|
-
kind: z2.literal("tier"),
|
|
248
|
-
label: z2.string(),
|
|
249
|
-
reward: tieredRewardReferenceSchema.extend({
|
|
250
|
-
title: z2.string(),
|
|
251
|
-
badge: badgeSchema.optional(),
|
|
252
|
-
/** The group the reward adds the member to: its key and the title the quest names it by. */
|
|
253
|
-
group: z2.object({ key: identifier, title: z2.string() }).optional()
|
|
254
|
-
}),
|
|
255
|
-
tier: identifier
|
|
256
|
-
}),
|
|
257
|
-
z2.object({ kind: z2.literal("integration"), label: z2.string() })
|
|
258
|
-
]))();
|
|
259
|
-
var questViewSchema = /* @__PURE__ */ (() => responseShape(
|
|
260
|
-
memberProgressSchema.shape.quests.element.extend({
|
|
261
|
-
release: identifier,
|
|
262
|
-
interaction: interactionSchema,
|
|
263
|
-
lifecycle: z2.enum(["active", "paused", "archived"]),
|
|
264
|
-
rewards: z2.array(questRewardViewSchema)
|
|
265
|
-
})
|
|
266
|
-
))();
|
|
267
|
-
var collectionViewSchema = /* @__PURE__ */ (() => z2.object({
|
|
268
|
-
key: identifier.optional(),
|
|
269
|
-
id: identifier,
|
|
270
|
-
title: z2.string(),
|
|
271
|
-
description: z2.string().optional(),
|
|
272
|
-
image: mediaUrlSchema.optional(),
|
|
273
|
-
imageAlt: z2.string().optional(),
|
|
274
|
-
quests: z2.array(questViewSchema)
|
|
275
|
-
}))();
|
|
276
|
-
var questExperienceSchema = /* @__PURE__ */ (() => responseShape(
|
|
277
|
-
z2.object({
|
|
278
|
-
entitlements: z2.array(entitlementSchema).default([]),
|
|
279
|
-
member: identifier,
|
|
280
|
-
quests: z2.array(questViewSchema),
|
|
281
|
-
collections: z2.array(collectionViewSchema)
|
|
282
|
-
})
|
|
283
|
-
))();
|
|
284
|
-
var questPublicationPreviewSchema = /* @__PURE__ */ (() => responseShape(
|
|
285
|
-
z2.object({
|
|
286
|
-
draft: questDraftSchema,
|
|
287
|
-
releases: z2.array(publishedReleaseSchema),
|
|
288
|
-
affectedCollections: z2.array(questCollectionSchema)
|
|
289
|
-
})
|
|
290
|
-
))();
|
|
291
|
-
var allocateQuestSchema = /* @__PURE__ */ (() => z2.object({ actionId: identifier }).strict())();
|
|
292
|
-
var allocatedQuestSchema = /* @__PURE__ */ (() => z2.object({ id: identifier }))();
|
|
293
|
-
|
|
294
|
-
export {
|
|
295
|
-
knownRelayEventSchema,
|
|
296
|
-
relayEventSchema,
|
|
297
|
-
participantActivityQuerySchema,
|
|
298
|
-
participantActivitySchema,
|
|
299
|
-
interactionSchema,
|
|
300
|
-
questInteraction,
|
|
301
|
-
questTypeVersionSchema,
|
|
302
|
-
collectionSlotSchema,
|
|
303
|
-
collectionSlotDeclarationSchema,
|
|
304
|
-
questCollectionSchema,
|
|
305
|
-
questInstanceSchema,
|
|
306
|
-
questDraftChangesSchema,
|
|
307
|
-
questDraftSchema,
|
|
308
|
-
questCatalogSchema,
|
|
309
|
-
catalogDeploymentSchema,
|
|
310
|
-
catalogDeploymentPreviewSchema,
|
|
311
|
-
saveQuestDraftSchema,
|
|
312
|
-
publishQuestDraftSchema,
|
|
313
|
-
questRewardViewSchema,
|
|
314
|
-
questViewSchema,
|
|
315
|
-
collectionViewSchema,
|
|
316
|
-
questExperienceSchema,
|
|
317
|
-
questPublicationPreviewSchema,
|
|
318
|
-
allocateQuestSchema,
|
|
319
|
-
allocatedQuestSchema
|
|
320
|
-
};
|
package/dist/chunk-FO2LCZTL.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/definition-error.ts
|
|
2
|
-
function issueText(issues) {
|
|
3
|
-
return issues.map(
|
|
4
|
-
(issue) => issue.path.length ? issue.path.map(String).join(".") + ": " + issue.message : issue.message
|
|
5
|
-
).join("; ");
|
|
6
|
-
}
|
|
7
|
-
function parseDefinition(kind, schema, input) {
|
|
8
|
-
const parsed = schema.safeParse(input);
|
|
9
|
-
if (parsed.success) {
|
|
10
|
-
return parsed.data;
|
|
11
|
-
}
|
|
12
|
-
const key = typeof input === "object" && input !== null && "key" in input && typeof input.key === "string" ? ` "${input.key}"` : "";
|
|
13
|
-
parsed.error.message = `${kind}${key} is invalid: ${issueText(parsed.error.issues)}`;
|
|
14
|
-
throw parsed.error;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
parseDefinition
|
|
19
|
-
};
|