@domino-sdk/relay 1.22.0 → 1.23.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/dist/accounts-B31dWEYD.d.ts +292 -0
- package/dist/{attempt-captures-ByzZyggX.d.ts → attempt-captures-JDIgz2lY.d.ts} +1 -1
- package/dist/authoring.d.ts +112 -49
- package/dist/authoring.js +37 -3
- package/dist/{automatic-outcomes-BBSdMf0R.d.ts → automatic-outcomes-T9lEIvTj.d.ts} +1 -1
- package/dist/browser.d.ts +8 -8
- package/dist/browser.js +10 -9
- package/dist/{chunk-VJ7TTLFL.js → chunk-57KARWUC.js} +1 -1
- package/dist/{chunk-EMLDFUTV.js → chunk-6UFXPKLA.js} +6 -1
- package/dist/{chunk-GMKJPHN4.js → chunk-AXQYGVOP.js} +1 -1
- package/dist/{chunk-JIQHUDVZ.js → chunk-B4EZ76WX.js} +1 -1
- package/dist/{chunk-T47OFHHX.js → chunk-E7MVYASS.js} +1 -1
- package/dist/{chunk-CVQG2AZZ.js → chunk-ENBQ6UEE.js} +2 -2
- package/dist/{chunk-NGP2NMZ4.js → chunk-G75JVB4D.js} +1 -1
- package/dist/{chunk-5ZRDK4KQ.js → chunk-GB26FIZT.js} +96 -118
- package/dist/{chunk-YXAK2637.js → chunk-JUQ2GNMD.js} +1 -1
- package/dist/{chunk-XSLRNFIY.js → chunk-MRU7GX2V.js} +1 -1
- package/dist/{chunk-H2QDYEA4.js → chunk-RPEGZW27.js} +2 -2
- package/dist/{chunk-4LKSBBWD.js → chunk-SMUYGCGP.js} +4 -4
- package/dist/{chunk-7YRXDG7R.js → chunk-UCZGXYCN.js} +9 -7
- package/dist/chunk-W33PYWYQ.js +102 -0
- package/dist/{chunk-5P5PTZ3T.js → chunk-WOGCRDFT.js} +1 -1
- package/dist/{chunk-NSLQLGHF.js → chunk-XQE22UKY.js} +13 -11
- package/dist/{client-DSlycgar.d.ts → client-HG0uMG0Q.d.ts} +6 -6
- package/dist/{deployments-nNS4spO9.d.ts → deployments-B--Shwgx.d.ts} +121 -109
- package/dist/{groups-jLLG7MML.d.ts → groups-CfyRewkJ.d.ts} +1 -1
- package/dist/{images-BPiPqVKn.d.ts → images-DwNmzqWv.d.ts} +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -8
- package/dist/{integrations-Cr9EhGI_.d.ts → integrations-BMNtARU_.d.ts} +2 -0
- package/dist/internal.d.ts +9 -9
- package/dist/internal.js +8 -8
- package/dist/{offers-CPqiF3dZ.d.ts → offers-CEwkAGsB.d.ts} +2 -2
- package/dist/{pages-1h1387a3.d.ts → pages-D1xrbGJl.d.ts} +6 -1
- package/dist/{telegram-DALZ7GdF.d.ts → participant-activity-DYdUUhw2.d.ts} +1 -40
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +11 -11
- package/dist/react/index.js +10 -9
- package/dist/{schema-Br3c1GOu.d.ts → schema-D57mhL2q.d.ts} +1427 -1422
- package/dist/schema.d.ts +325 -323
- package/dist/schema.js +29 -11
- package/dist/server/index.d.ts +9 -9
- package/dist/server/index.js +57 -13
- package/dist/{submission-input-BEJ9qENg.d.ts → submission-input-DjXg0o-r.d.ts} +2 -2
- package/dist/{telegram-browser-CGB01TaB.d.ts → telegram-browser-DaP0Rawg.d.ts} +2 -3
- package/dist/testing.d.ts +18 -6
- package/dist/testing.js +42 -7
- package/dist/{transport-C6QJseIM.d.ts → transport-BZbTTtBk.d.ts} +2214 -2005
- package/package.json +1 -1
- package/dist/accounts-5ciAkCMP.d.ts +0 -147
package/dist/authoring.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
sourceDataSchema,
|
|
11
11
|
sourceRoles,
|
|
12
12
|
validateQuestShape
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AXQYGVOP.js";
|
|
14
14
|
import {
|
|
15
15
|
badgeDeclarationSchema,
|
|
16
16
|
defineOffer,
|
|
@@ -20,7 +20,11 @@ import {
|
|
|
20
20
|
leaderboardAuthoringSchema,
|
|
21
21
|
pointLedgerDeclarationSchema,
|
|
22
22
|
referralAuthoringSchema
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-MRU7GX2V.js";
|
|
24
|
+
import {
|
|
25
|
+
telegramReactionDataSchema,
|
|
26
|
+
telegramReactionsNamespace
|
|
27
|
+
} from "./chunk-W33PYWYQ.js";
|
|
24
28
|
import {
|
|
25
29
|
authoringKey,
|
|
26
30
|
badgeReward,
|
|
@@ -77,7 +81,7 @@ import {
|
|
|
77
81
|
whereSchemaIssue,
|
|
78
82
|
whereSettings,
|
|
79
83
|
xSearchSourceSchema
|
|
80
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-6UFXPKLA.js";
|
|
81
85
|
|
|
82
86
|
// src/builders.ts
|
|
83
87
|
import { z } from "zod";
|
|
@@ -258,6 +262,15 @@ var discord = {
|
|
|
258
262
|
});
|
|
259
263
|
}
|
|
260
264
|
};
|
|
265
|
+
var telegram = {
|
|
266
|
+
reactions() {
|
|
267
|
+
return customSource(telegramReactionsNamespace, {
|
|
268
|
+
identities: ["member"],
|
|
269
|
+
accounts: ["messageAuthor"],
|
|
270
|
+
data: telegramReactionDataSchema
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
};
|
|
261
274
|
var pointLedgers = () => ({
|
|
262
275
|
provider: "domino",
|
|
263
276
|
resource: "point-ledger"
|
|
@@ -320,6 +333,25 @@ var settings = {
|
|
|
320
333
|
z.string().min(field.minLength).max(field.maxLength).default(field.default).meta(field)
|
|
321
334
|
);
|
|
322
335
|
},
|
|
336
|
+
/**
|
|
337
|
+
* A Telegram chat the project connected, by its numeric ID: Console lists the connected chats
|
|
338
|
+
* to choose from. Pass it to `ctx.telegram.member({ chat })`.
|
|
339
|
+
*/
|
|
340
|
+
telegramChat(options) {
|
|
341
|
+
const field = {
|
|
342
|
+
...options,
|
|
343
|
+
kind: "text",
|
|
344
|
+
default: options.default ?? "",
|
|
345
|
+
minLength: 0,
|
|
346
|
+
maxLength: 64,
|
|
347
|
+
multiline: false,
|
|
348
|
+
picker: "telegram-chat"
|
|
349
|
+
};
|
|
350
|
+
return setting(
|
|
351
|
+
"text",
|
|
352
|
+
z.string().max(field.maxLength).default(field.default).meta(field)
|
|
353
|
+
);
|
|
354
|
+
},
|
|
323
355
|
integer(options) {
|
|
324
356
|
return setting(
|
|
325
357
|
"integer",
|
|
@@ -735,6 +767,7 @@ function questBuilder(template) {
|
|
|
735
767
|
trackers: schemaCheckedReader(ctx.trackers),
|
|
736
768
|
wallet: ctx.wallet,
|
|
737
769
|
images: ctx.images,
|
|
770
|
+
...ctx.telegram ? { telegram: ctx.telegram } : {},
|
|
738
771
|
// The declared module providers select these keys; unrelated host readers are omitted.
|
|
739
772
|
...Object.fromEntries(
|
|
740
773
|
integrations.map((provider) => [provider, ctx[provider]])
|
|
@@ -812,6 +845,7 @@ export {
|
|
|
812
845
|
settings,
|
|
813
846
|
staffHandover,
|
|
814
847
|
streak,
|
|
848
|
+
telegram,
|
|
815
849
|
trackerDataSchema,
|
|
816
850
|
trackerTriggerContextSchema,
|
|
817
851
|
untracked,
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { n as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-
|
|
2
|
-
export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-
|
|
3
|
-
import './groups-
|
|
1
|
+
import { n as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-HG0uMG0Q.js';
|
|
2
|
+
export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-DaP0Rawg.js';
|
|
3
|
+
import './groups-CfyRewkJ.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import './schema-
|
|
6
|
-
import './pages-
|
|
7
|
-
import './submission-input-
|
|
5
|
+
import './schema-D57mhL2q.js';
|
|
6
|
+
import './pages-D1xrbGJl.js';
|
|
7
|
+
import './submission-input-DjXg0o-r.js';
|
|
8
8
|
import './action-DBzILFx9.js';
|
|
9
|
-
import './
|
|
10
|
-
import './accounts-
|
|
9
|
+
import './participant-activity-DYdUUhw2.js';
|
|
10
|
+
import './accounts-B31dWEYD.js';
|
|
11
11
|
import './profiles-D29SS12z.js';
|
|
12
12
|
import './wallet-CDyo-U4n.js';
|
|
13
13
|
|
package/dist/browser.js
CHANGED
|
@@ -12,15 +12,16 @@ import {
|
|
|
12
12
|
solanaSigner,
|
|
13
13
|
telegramMiniAppInitData,
|
|
14
14
|
walletStandardSolanaSigner
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-RPEGZW27.js";
|
|
16
|
+
import "./chunk-XQE22UKY.js";
|
|
17
|
+
import "./chunk-E7MVYASS.js";
|
|
18
|
+
import "./chunk-GB26FIZT.js";
|
|
19
|
+
import "./chunk-MRU7GX2V.js";
|
|
20
|
+
import "./chunk-W33PYWYQ.js";
|
|
21
|
+
import "./chunk-WOGCRDFT.js";
|
|
22
|
+
import "./chunk-57KARWUC.js";
|
|
23
|
+
import "./chunk-JUQ2GNMD.js";
|
|
24
|
+
import "./chunk-6UFXPKLA.js";
|
|
24
25
|
export {
|
|
25
26
|
browserSubmissionStore,
|
|
26
27
|
cosmosChainList,
|
|
@@ -2424,7 +2424,12 @@ var settingFieldSchema = z21.discriminatedUnion("kind", [
|
|
|
2424
2424
|
default: z21.string(),
|
|
2425
2425
|
minLength: z21.number().int().nonnegative(),
|
|
2426
2426
|
maxLength: z21.number().int().positive(),
|
|
2427
|
-
multiline: z21.boolean()
|
|
2427
|
+
multiline: z21.boolean(),
|
|
2428
|
+
/**
|
|
2429
|
+
* A list Console offers the value from, beside free text: `telegram-chat` lists the
|
|
2430
|
+
* project's connected Telegram chats. Unknown pickers read as free text.
|
|
2431
|
+
*/
|
|
2432
|
+
picker: z21.string().optional()
|
|
2428
2433
|
}).strict(),
|
|
2429
2434
|
z21.object({
|
|
2430
2435
|
...base,
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
imageFieldsSchema,
|
|
5
5
|
imageInspectionSchema,
|
|
6
6
|
imageSightingsSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B4EZ76WX.js";
|
|
8
8
|
import {
|
|
9
9
|
photoResultSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6UFXPKLA.js";
|
|
11
11
|
|
|
12
12
|
// src/image-results.ts
|
|
13
13
|
import { z } from "zod";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
badgeSchema,
|
|
3
3
|
pointLedgerReferenceSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MRU7GX2V.js";
|
|
5
5
|
import {
|
|
6
|
-
accountConnectionSchema,
|
|
7
6
|
authoringIdentityShape,
|
|
8
7
|
entitlementSchema,
|
|
9
8
|
identifier,
|
|
@@ -21,7 +20,7 @@ import {
|
|
|
21
20
|
storedQuestDescriptionSchema,
|
|
22
21
|
storedReviewModeSchema,
|
|
23
22
|
tieredRewardReferenceSchema
|
|
24
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-6UFXPKLA.js";
|
|
25
24
|
|
|
26
25
|
// src/participant-activity.ts
|
|
27
26
|
import { z } from "zod";
|
|
@@ -271,47 +270,30 @@ var questPublicationPreviewSchema = responseShape(
|
|
|
271
270
|
var allocateQuestSchema = z2.object({ actionId: identifier }).strict();
|
|
272
271
|
var allocatedQuestSchema = z2.object({ id: identifier });
|
|
273
272
|
|
|
274
|
-
// src/telegram.ts
|
|
275
|
-
import { z as z3 } from "zod";
|
|
276
|
-
var telegramSignInMethodsSchema = z3.object({
|
|
277
|
-
/** Telegram Login, the OpenID Connect sign-in Domino configures for the platform. */
|
|
278
|
-
login: z3.boolean(),
|
|
279
|
-
/** Mini App sign-in, which the project enables in Console with its bot's ID. */
|
|
280
|
-
miniApp: z3.boolean()
|
|
281
|
-
});
|
|
282
|
-
var telegramAccountConnectionSchema = accountConnectionSchema.extend({
|
|
283
|
-
provider: z3.literal("telegram")
|
|
284
|
-
});
|
|
285
|
-
var telegramInitDataSchema = z3.string().min(1, "Pass the Mini App's Telegram.WebApp.initData").max(8192);
|
|
286
|
-
var telegramMiniAppSignInSchema = z3.object({
|
|
287
|
-
initData: telegramInitDataSchema,
|
|
288
|
-
mode: z3.enum(["sign-in", "connect"])
|
|
289
|
-
}).strict();
|
|
290
|
-
|
|
291
273
|
// src/collection.ts
|
|
292
|
-
import { z as
|
|
293
|
-
var collectionCodeSchema =
|
|
294
|
-
var collectionPassSchema =
|
|
274
|
+
import { z as z3 } from "zod";
|
|
275
|
+
var collectionCodeSchema = z3.string().regex(/^relay:collect:[a-f0-9]{64}$/);
|
|
276
|
+
var collectionPassSchema = z3.object({
|
|
295
277
|
code: collectionCodeSchema,
|
|
296
|
-
expiresAt:
|
|
278
|
+
expiresAt: z3.number(),
|
|
297
279
|
entitlement: identifier
|
|
298
280
|
});
|
|
299
|
-
var collectionResolveSchema =
|
|
281
|
+
var collectionResolveSchema = z3.object({ code: collectionCodeSchema }).strict();
|
|
300
282
|
var collectionBeginSchema = collectionResolveSchema.extend({
|
|
301
283
|
actionId: identifier,
|
|
302
|
-
revision:
|
|
284
|
+
revision: z3.number().int().positive(),
|
|
303
285
|
selection: pickupSelectionSchema.optional()
|
|
304
286
|
});
|
|
305
|
-
var collectionPreviewSchema =
|
|
287
|
+
var collectionPreviewSchema = z3.object({
|
|
306
288
|
entitlement: entitlementSchema,
|
|
307
289
|
inventory: pickupAvailabilitySchema,
|
|
308
|
-
expiresAt:
|
|
290
|
+
expiresAt: z3.number()
|
|
309
291
|
});
|
|
310
292
|
|
|
311
293
|
// src/outcomes.ts
|
|
312
|
-
import { z as
|
|
313
|
-
var timestamp =
|
|
314
|
-
var questEnrollmentInputSchema =
|
|
294
|
+
import { z as z4 } from "zod";
|
|
295
|
+
var timestamp = z4.number().int().safe().nonnegative();
|
|
296
|
+
var questEnrollmentInputSchema = z4.strictObject({
|
|
315
297
|
actionId: identifier,
|
|
316
298
|
/** Quest key or ID. */
|
|
317
299
|
quest: identifier
|
|
@@ -319,26 +301,26 @@ var questEnrollmentInputSchema = z5.strictObject({
|
|
|
319
301
|
var memberEnrollmentInputSchema = questEnrollmentInputSchema.extend({
|
|
320
302
|
member: identifier
|
|
321
303
|
});
|
|
322
|
-
var questEnrollmentSchema =
|
|
304
|
+
var questEnrollmentSchema = z4.object({
|
|
323
305
|
/** Stable quest ID. */
|
|
324
306
|
quest: identifier,
|
|
325
307
|
member: identifier,
|
|
326
308
|
enrolledAt: timestamp
|
|
327
309
|
});
|
|
328
|
-
var questClaimInputSchema =
|
|
310
|
+
var questClaimInputSchema = z4.strictObject({
|
|
329
311
|
actionId: identifier,
|
|
330
312
|
/** Quest key or ID. */
|
|
331
313
|
quest: identifier,
|
|
332
314
|
/** The outcome's tracker, as `QuestOutcome.tracker` names it. */
|
|
333
315
|
tracker: identifier,
|
|
334
|
-
record:
|
|
316
|
+
record: z4.string().min(1).max(256),
|
|
335
317
|
observedAt: timestamp
|
|
336
318
|
});
|
|
337
319
|
var QuestOutcomeState = {
|
|
338
320
|
Admitted: "admitted",
|
|
339
321
|
Skipped: "skipped"
|
|
340
322
|
};
|
|
341
|
-
var questOutcomeSchema =
|
|
323
|
+
var questOutcomeSchema = z4.object({
|
|
342
324
|
/** Prerequisite transition identity; absent on older tracker responses. */
|
|
343
325
|
automatic: identifier.optional(),
|
|
344
326
|
/** Stable quest ID. */
|
|
@@ -346,156 +328,156 @@ var questOutcomeSchema = z5.object({
|
|
|
346
328
|
/** Stable tracker ID of the record decided. */
|
|
347
329
|
tracker: identifier.nullable(),
|
|
348
330
|
/** The record's ID in its tracker. */
|
|
349
|
-
record:
|
|
331
|
+
record: z4.string().nullable(),
|
|
350
332
|
/** Which observation of the record was decided. */
|
|
351
333
|
observedAt: timestamp.nullable(),
|
|
352
|
-
state:
|
|
334
|
+
state: z4.enum(["admitted", "skipped"]),
|
|
353
335
|
/**
|
|
354
336
|
* Why it was skipped, one of `trackerSkipCodes` or a code a newer Relay sends; null when
|
|
355
337
|
* admitted. Show an unknown code by its `reason`.
|
|
356
338
|
*/
|
|
357
|
-
code:
|
|
339
|
+
code: z4.string().nullable(),
|
|
358
340
|
/** Why it was skipped, for people; null when admitted. */
|
|
359
|
-
reason:
|
|
341
|
+
reason: z4.string().nullable(),
|
|
360
342
|
/** Which window refused admission when `code` is `outside-window`. */
|
|
361
|
-
window:
|
|
343
|
+
window: z4.enum(["tracker", "quest"]).optional(),
|
|
362
344
|
/** The admitted attempt. */
|
|
363
345
|
attempt: identifier.nullable(),
|
|
364
346
|
/** The member can claim it with `relay.quests.claim()`. */
|
|
365
|
-
claimable:
|
|
347
|
+
claimable: z4.boolean(),
|
|
366
348
|
createdAt: timestamp,
|
|
367
349
|
updatedAt: timestamp
|
|
368
350
|
});
|
|
369
|
-
var questOutcomeQuerySchema =
|
|
351
|
+
var questOutcomeQuerySchema = z4.strictObject({
|
|
370
352
|
/** Quest key or ID. */
|
|
371
353
|
quest: identifier.optional(),
|
|
372
|
-
state:
|
|
354
|
+
state: z4.enum(["admitted", "skipped"]).optional(),
|
|
373
355
|
/** Only skips with this code, such as `historical`. */
|
|
374
|
-
code:
|
|
356
|
+
code: z4.string().min(1).max(100).optional(),
|
|
375
357
|
cursor: pageCursorSchema.optional()
|
|
376
358
|
});
|
|
377
|
-
var questOutcomePageSchema =
|
|
378
|
-
items:
|
|
359
|
+
var questOutcomePageSchema = z4.object({
|
|
360
|
+
items: z4.array(questOutcomeSchema),
|
|
379
361
|
nextCursor: pageCursorSchema.nullable()
|
|
380
362
|
});
|
|
381
363
|
|
|
382
364
|
// src/participant-rewards.ts
|
|
383
|
-
import { z as
|
|
384
|
-
var participantEntitlementsSchema =
|
|
385
|
-
items:
|
|
365
|
+
import { z as z5 } from "zod";
|
|
366
|
+
var participantEntitlementsSchema = z5.object({
|
|
367
|
+
items: z5.array(entitlementSchema)
|
|
386
368
|
});
|
|
387
369
|
var base2 = {
|
|
388
|
-
id:
|
|
389
|
-
status:
|
|
390
|
-
at:
|
|
391
|
-
quest:
|
|
392
|
-
completion:
|
|
370
|
+
id: z5.string(),
|
|
371
|
+
status: z5.string(),
|
|
372
|
+
at: z5.number().nullable(),
|
|
373
|
+
quest: z5.string().nullable(),
|
|
374
|
+
completion: z5.string().nullable()
|
|
393
375
|
};
|
|
394
|
-
var known =
|
|
395
|
-
|
|
376
|
+
var known = z5.discriminatedUnion("kind", [
|
|
377
|
+
z5.object({
|
|
396
378
|
...base2,
|
|
397
|
-
kind:
|
|
379
|
+
kind: z5.literal("points"),
|
|
398
380
|
ledger: pointLedgerReferenceSchema,
|
|
399
|
-
amount:
|
|
400
|
-
reversed:
|
|
401
|
-
}).catchall(
|
|
402
|
-
|
|
381
|
+
amount: z5.number(),
|
|
382
|
+
reversed: z5.number()
|
|
383
|
+
}).catchall(z5.json()),
|
|
384
|
+
z5.object({
|
|
403
385
|
...base2,
|
|
404
|
-
kind:
|
|
386
|
+
kind: z5.literal("tier"),
|
|
405
387
|
entitlement: entitlementSchema
|
|
406
|
-
}).catchall(
|
|
407
|
-
|
|
388
|
+
}).catchall(z5.json().transform((value) => value)),
|
|
389
|
+
z5.object({
|
|
408
390
|
...base2,
|
|
409
|
-
kind:
|
|
410
|
-
provider:
|
|
411
|
-
action:
|
|
412
|
-
roleId:
|
|
413
|
-
deliveredAt:
|
|
414
|
-
revokedAt:
|
|
415
|
-
reconciliation:
|
|
416
|
-
}).catchall(
|
|
391
|
+
kind: z5.literal("integration"),
|
|
392
|
+
provider: z5.string(),
|
|
393
|
+
action: z5.string(),
|
|
394
|
+
roleId: z5.string().optional(),
|
|
395
|
+
deliveredAt: z5.number().nullable(),
|
|
396
|
+
revokedAt: z5.number().nullable(),
|
|
397
|
+
reconciliation: z5.object({ status: z5.string(), ownership: z5.string(), at: z5.number() }).catchall(z5.json()).nullable()
|
|
398
|
+
}).catchall(z5.json().optional())
|
|
417
399
|
]);
|
|
418
|
-
var participantDeliverySchema =
|
|
400
|
+
var participantDeliverySchema = z5.union([
|
|
419
401
|
known,
|
|
420
|
-
|
|
402
|
+
z5.object({
|
|
421
403
|
...base2,
|
|
422
|
-
kind:
|
|
423
|
-
}).catchall(
|
|
404
|
+
kind: z5.string().refine((kind) => !["points", "tier", "integration"].includes(kind))
|
|
405
|
+
}).catchall(z5.json()).transform(({ kind, ...item }) => ({
|
|
424
406
|
...item,
|
|
425
407
|
kind: "unknown",
|
|
426
408
|
reportedKind: kind
|
|
427
409
|
}))
|
|
428
410
|
]);
|
|
429
|
-
var participantDeliveriesSchema =
|
|
430
|
-
items:
|
|
411
|
+
var participantDeliveriesSchema = z5.object({
|
|
412
|
+
items: z5.array(participantDeliverySchema)
|
|
431
413
|
});
|
|
432
414
|
|
|
433
415
|
// src/reward-deliveries.ts
|
|
434
|
-
import { z as
|
|
416
|
+
import { z as z6 } from "zod";
|
|
435
417
|
var RewardDeliveryAction = {
|
|
436
418
|
/** Delivers a quest's Discord role reward. */
|
|
437
419
|
GrantRole: "grant-role"
|
|
438
420
|
};
|
|
439
|
-
var rewardDeliveryActionSchema =
|
|
440
|
-
var roleReconciliationSchema =
|
|
441
|
-
status:
|
|
442
|
-
ownership:
|
|
443
|
-
at:
|
|
444
|
-
reason:
|
|
421
|
+
var rewardDeliveryActionSchema = z6.string().min(1).max(64);
|
|
422
|
+
var roleReconciliationSchema = z6.object({
|
|
423
|
+
status: z6.enum(["pending", "granted", "removed", "preserved", "failed"]),
|
|
424
|
+
ownership: z6.enum(["unclaimed", "relay", "external"]),
|
|
425
|
+
at: z6.number(),
|
|
426
|
+
reason: z6.string().nullable()
|
|
445
427
|
});
|
|
446
|
-
var knownRewardDeliverySchema =
|
|
447
|
-
id:
|
|
448
|
-
quest:
|
|
449
|
-
completion:
|
|
450
|
-
member:
|
|
451
|
-
provider:
|
|
428
|
+
var knownRewardDeliverySchema = z6.object({
|
|
429
|
+
id: z6.string(),
|
|
430
|
+
quest: z6.string(),
|
|
431
|
+
completion: z6.string(),
|
|
432
|
+
member: z6.string(),
|
|
433
|
+
provider: z6.literal("discord"),
|
|
452
434
|
/** `RewardDeliveryAction`, such as `grant-role`. */
|
|
453
435
|
action: rewardDeliveryActionSchema,
|
|
454
|
-
roleId:
|
|
436
|
+
roleId: z6.string(),
|
|
455
437
|
/**
|
|
456
438
|
* `failed` is terminal: Discord rejected the grant permanently (unknown role,
|
|
457
439
|
* member left the server, missing permissions) or retries ran out after about
|
|
458
440
|
* a day. An operator can retry it once the cause is fixed, unless revokedAt is set.
|
|
459
441
|
* Revoke stops pending grants; a late success records deliveredAt but leaves status failed.
|
|
460
442
|
*/
|
|
461
|
-
status:
|
|
443
|
+
status: z6.enum(["pending", "delivered", "failed"]),
|
|
462
444
|
/** Provider attempts in the current round; an operator retry starts a new round at zero. */
|
|
463
|
-
attempts:
|
|
445
|
+
attempts: z6.number().int(),
|
|
464
446
|
/** While pending with a `lastError`, when the next attempt is scheduled. */
|
|
465
|
-
nextAt:
|
|
466
|
-
lastError:
|
|
467
|
-
createdAt:
|
|
468
|
-
deliveredAt:
|
|
447
|
+
nextAt: z6.number(),
|
|
448
|
+
lastError: z6.string().nullable(),
|
|
449
|
+
createdAt: z6.number(),
|
|
450
|
+
deliveredAt: z6.number().nullable(),
|
|
469
451
|
/** First dispatch attempt, retained across retries. Legacy rows use creation time when dispatch timing is unknown. */
|
|
470
|
-
dispatchedAt:
|
|
452
|
+
dispatchedAt: z6.number().nullable().optional(),
|
|
471
453
|
/** Completion revocation stops retries, including deliveries that had already failed. */
|
|
472
|
-
revokedAt:
|
|
454
|
+
revokedAt: z6.number().nullable().optional(),
|
|
473
455
|
/** Current reconciliation of the pinned Discord membership; original delivery and revoke history stay intact. */
|
|
474
456
|
reconciliation: roleReconciliationSchema.nullable().optional()
|
|
475
457
|
});
|
|
476
458
|
var futureRewardDeliverySchema = knownRewardDeliverySchema.extend({
|
|
477
|
-
provider:
|
|
478
|
-
status:
|
|
479
|
-
roleId:
|
|
480
|
-
reconciliation:
|
|
481
|
-
status:
|
|
482
|
-
ownership:
|
|
483
|
-
at:
|
|
484
|
-
reason:
|
|
485
|
-
}).catchall(
|
|
486
|
-
}).catchall(
|
|
459
|
+
provider: z6.string(),
|
|
460
|
+
status: z6.string(),
|
|
461
|
+
roleId: z6.string().optional(),
|
|
462
|
+
reconciliation: z6.object({
|
|
463
|
+
status: z6.string(),
|
|
464
|
+
ownership: z6.string(),
|
|
465
|
+
at: z6.number(),
|
|
466
|
+
reason: z6.string().nullable()
|
|
467
|
+
}).catchall(z6.json()).nullable().optional()
|
|
468
|
+
}).catchall(z6.json().optional()).refine(
|
|
487
469
|
(delivery) => delivery.provider !== "discord" || !["pending", "delivered", "failed"].includes(delivery.status) || delivery.reconciliation && (!["pending", "granted", "removed", "preserved", "failed"].includes(
|
|
488
470
|
delivery.reconciliation.status
|
|
489
471
|
) || !["unclaimed", "relay", "external"].includes(
|
|
490
472
|
delivery.reconciliation.ownership
|
|
491
473
|
))
|
|
492
474
|
);
|
|
493
|
-
var rewardDeliverySchema =
|
|
494
|
-
knownRewardDeliverySchema.catchall(
|
|
475
|
+
var rewardDeliverySchema = z6.union([
|
|
476
|
+
knownRewardDeliverySchema.catchall(z6.json().optional()),
|
|
495
477
|
futureRewardDeliverySchema
|
|
496
478
|
]);
|
|
497
|
-
var rewardDeliveriesSchema =
|
|
498
|
-
deliveries:
|
|
479
|
+
var rewardDeliveriesSchema = z6.object({
|
|
480
|
+
deliveries: z6.array(rewardDeliverySchema)
|
|
499
481
|
});
|
|
500
482
|
|
|
501
483
|
export {
|
|
@@ -524,10 +506,6 @@ export {
|
|
|
524
506
|
questPublicationPreviewSchema,
|
|
525
507
|
allocateQuestSchema,
|
|
526
508
|
allocatedQuestSchema,
|
|
527
|
-
telegramSignInMethodsSchema,
|
|
528
|
-
telegramAccountConnectionSchema,
|
|
529
|
-
telegramInitDataSchema,
|
|
530
|
-
telegramMiniAppSignInSchema,
|
|
531
509
|
collectionCodeSchema,
|
|
532
510
|
collectionPassSchema,
|
|
533
511
|
collectionResolveSchema,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRelayClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XQE22UKY.js";
|
|
4
4
|
import {
|
|
5
5
|
RelayErrorCode,
|
|
6
6
|
asRelayError,
|
|
7
7
|
clientError,
|
|
8
8
|
cosmosChain
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6UFXPKLA.js";
|
|
10
10
|
|
|
11
11
|
// src/base58.ts
|
|
12
12
|
var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
retryAfter,
|
|
5
5
|
retrying,
|
|
6
6
|
validTimeout
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WOGCRDFT.js";
|
|
8
8
|
import {
|
|
9
9
|
clientIdentity
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-57KARWUC.js";
|
|
11
11
|
import {
|
|
12
12
|
authScopeSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JUQ2GNMD.js";
|
|
14
14
|
import {
|
|
15
15
|
RequestError,
|
|
16
16
|
appIdentityKindSchema,
|
|
17
17
|
isRequestError,
|
|
18
18
|
knownResponse,
|
|
19
19
|
openIdentityKindSchema
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6UFXPKLA.js";
|
|
21
21
|
|
|
22
22
|
// src/configuration.ts
|
|
23
23
|
function questConfiguration(release) {
|