@domino-sdk/relay 1.54.0 → 1.56.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 +1859 -0
- package/dist/analytics-URV-mxjH.d.ts +482 -0
- package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
- package/dist/authoring.d.ts +277 -40
- package/dist/authoring.js +142 -14
- package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +7 -7
- package/dist/browser.js +10 -10
- package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
- package/dist/{chunk-RP4LLEON.js → chunk-ABJ4G47X.js} +1 -1
- package/dist/{chunk-IELNFM3V.js → chunk-BHHUSBSD.js} +97 -8
- package/dist/chunk-BJYMTCWG.js +950 -0
- package/dist/{chunk-K6TVMNU4.js → chunk-CK7HO32Z.js} +1 -1
- package/dist/{chunk-GTQJSDBS.js → chunk-CXKXPB7K.js} +32 -16
- package/dist/{chunk-TL5TL5RD.js → chunk-G6XVBYH7.js} +4 -4
- package/dist/{chunk-S2PMKZSX.js → chunk-H2MD6E7Z.js} +21 -2
- package/dist/{chunk-YVC3B72P.js → chunk-INSWI2VZ.js} +1 -1
- package/dist/{chunk-XFAYQFRO.js → chunk-KBVH4XZC.js} +1 -1
- package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
- package/dist/{chunk-7BNCLWAO.js → chunk-MNU6UPXY.js} +1 -1
- package/dist/{chunk-JL7J3EQQ.js → chunk-NK6EER33.js} +46 -16
- package/dist/{chunk-QIDQWXSF.js → chunk-OTITLABX.js} +2 -2
- package/dist/{chunk-53JMTUWG.js → chunk-QNQNKIAA.js} +1 -1
- package/dist/{chunk-ZJ3FVZRP.js → chunk-RBPMT53S.js} +132 -99
- package/dist/chunk-ULQU7KC4.js +704 -0
- package/dist/chunk-VSHV7FEA.js +344 -0
- package/dist/{chunk-LPHXTZDA.js → chunk-W5U2WXG3.js} +2 -2
- package/dist/{client-CzNtl8UO.d.ts → client-bX3oTpRu.d.ts} +111 -8
- package/dist/{deployments-ovtqtAcx.d.ts → deployments-D3lxfQMB.d.ts} +1436 -185
- package/dist/{groups-B5R1RCsl.d.ts → groups-DPE004_V.d.ts} +135 -139
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -9
- package/dist/integrations-CcD5NPEA.d.ts +633 -0
- package/dist/internal.d.ts +11 -10
- package/dist/internal.js +9 -9
- package/dist/{offers-CH1RZekg.d.ts → offers-CtzMeB7O.d.ts} +207 -2
- package/dist/{pages-BTlOg8sl.d.ts → pages-BlLqB8ZQ.d.ts} +82 -2
- package/dist/portal-proxy.d.ts +11 -1
- package/dist/portal-proxy.js +27 -6
- package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
- package/dist/react/index.d.ts +566 -13
- package/dist/react/index.js +105 -15
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/NDB42VFF.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
- package/dist/schema.d.ts +383 -79
- package/dist/schema.js +105 -41
- package/dist/server/index.d.ts +11 -10
- package/dist/server/index.js +1590 -1175
- package/dist/{submission-input-BNah53go.d.ts → submission-input-wTiYGdgA.d.ts} +2 -2
- package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-Bh3i0HiH.d.ts} +1 -1
- package/dist/testing.d.ts +85 -12
- package/dist/testing.js +322 -37
- package/dist/{transport-C8BlCzmF.d.ts → transport-CnKA-_RL.d.ts} +7625 -1265
- package/dist/vite.d.ts +54 -1
- package/dist/vite.js +35 -0
- package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
- package/package.json +3 -2
- package/dist/chunk-2NUD237O.js +0 -102
- package/dist/chunk-CCE2JWES.js +0 -1083
- package/dist/integrations-CllF-kWg.d.ts +0 -314
- package/dist/runtime/chunks/AVRVSLHX.js +0 -1
|
@@ -75,6 +75,11 @@ var RelayErrorCode = {
|
|
|
75
75
|
* says when they may submit again.
|
|
76
76
|
*/
|
|
77
77
|
RetryCooldown: "retry-cooldown",
|
|
78
|
+
/**
|
|
79
|
+
* The member's last accepted completion of the quest is more recent than its completion
|
|
80
|
+
* cooldown; `retryAt` says when they may submit again.
|
|
81
|
+
*/
|
|
82
|
+
CompletionCooldown: "completion-cooldown",
|
|
78
83
|
/** The quiz changed since the member answered it. */
|
|
79
84
|
StaleQuiz: "stale-quiz",
|
|
80
85
|
/** Relay refused the submitted evidence. */
|
|
@@ -105,7 +110,7 @@ var RelayErrorCode = {
|
|
|
105
110
|
Credential: "credential",
|
|
106
111
|
/** A wallet signer failed or the member refused to sign; `cause` is the wallet's own error. */
|
|
107
112
|
WalletSigner: "wallet-signer",
|
|
108
|
-
/** The member has not met the quest's prerequisites; `missing` lists them. */
|
|
113
|
+
/** The member has not met the quest's or offer's prerequisites; `missing` lists them. */
|
|
109
114
|
PrerequisitesIncomplete: "prerequisites-incomplete",
|
|
110
115
|
/** The quest is archived or retired: it takes no new participation. */
|
|
111
116
|
QuestClosed: "quest-closed",
|
|
@@ -135,7 +140,10 @@ var RelayError = class extends RequestError {
|
|
|
135
140
|
window;
|
|
136
141
|
/** Prerequisites the member does not currently meet, when Relay refused for that reason. */
|
|
137
142
|
missing;
|
|
138
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
|
|
145
|
+
* `completion-cooldown`.
|
|
146
|
+
*/
|
|
139
147
|
retryAt;
|
|
140
148
|
constructor(message, details) {
|
|
141
149
|
super(message, details);
|
|
@@ -1346,6 +1354,21 @@ var trackerStatusSchema = z8.object({
|
|
|
1346
1354
|
archivedAt: z8.number().int().nonnegative().nullable().optional(),
|
|
1347
1355
|
published: publishedTrackerSchema,
|
|
1348
1356
|
paused: z8.boolean(),
|
|
1357
|
+
/**
|
|
1358
|
+
* Why a paused tracker is paused, null when it isn't: `operator` (paused by hand),
|
|
1359
|
+
* `x-budget-exhausted` (the project's monthly X budget, or in test the organization's, is spent;
|
|
1360
|
+
* it resumes on its own at `resumesAt`, or sooner on a plan that allows more), or
|
|
1361
|
+
* `test-window-ended` (a test X tracker collects for 14 days; resume it for another 14). Treat an
|
|
1362
|
+
* unknown reason, which a newer Relay can add, as paused. Older servers leave it out.
|
|
1363
|
+
*/
|
|
1364
|
+
pauseReason: z8.string().nullable().optional(),
|
|
1365
|
+
/** When a tracker paused on its X budget resumes on its own: the start of the next UTC month. */
|
|
1366
|
+
resumesAt: timestamp.nullable().optional(),
|
|
1367
|
+
/**
|
|
1368
|
+
* The interval a scheduled tracker actually runs at: `refreshSeconds`, but no shorter than the
|
|
1369
|
+
* project's plan allows (6 hours, shorter on Enterprise). Older servers leave it out.
|
|
1370
|
+
*/
|
|
1371
|
+
effectiveRefreshSeconds: z8.number().int().positive().optional(),
|
|
1349
1372
|
state: z8.enum(["idle", "syncing", "error", "complete"]),
|
|
1350
1373
|
lastStartedAt: timestamp.nullable(),
|
|
1351
1374
|
lastCompletedAt: timestamp.nullable(),
|
|
@@ -2112,7 +2135,9 @@ var reservedAttemptCodes = Object.freeze([
|
|
|
2112
2135
|
"integration-required",
|
|
2113
2136
|
"not-linked",
|
|
2114
2137
|
"provider-unavailable",
|
|
2115
|
-
"author-error"
|
|
2138
|
+
"author-error",
|
|
2139
|
+
"evaluator-error",
|
|
2140
|
+
"capability-limit"
|
|
2116
2141
|
]);
|
|
2117
2142
|
var rejectCodeMaxLength = 64;
|
|
2118
2143
|
var rejectCodePattern = /^[a-z0-9-]+$/;
|
|
@@ -2198,6 +2223,12 @@ var budgetSchema = z16.object({
|
|
|
2198
2223
|
z16.object({ balance: name }).strict()
|
|
2199
2224
|
])
|
|
2200
2225
|
}).strict();
|
|
2226
|
+
var memberCompletionSchema = z16.object({
|
|
2227
|
+
quest: z16.string().min(1).max(200),
|
|
2228
|
+
key: completionKeySchema,
|
|
2229
|
+
completedAt: z16.number().int().nonnegative().safe().nullable()
|
|
2230
|
+
});
|
|
2231
|
+
var maxMemberCompletions = 100;
|
|
2201
2232
|
|
|
2202
2233
|
// src/integrations.ts
|
|
2203
2234
|
import * as z17 from "zod";
|
|
@@ -2554,9 +2585,17 @@ var settingFieldSchema = z23.discriminatedUnion("kind", [
|
|
|
2554
2585
|
multiline: z23.boolean(),
|
|
2555
2586
|
/**
|
|
2556
2587
|
* A list Console offers the value from, beside free text: `telegram-chat` lists the
|
|
2557
|
-
* project's connected Telegram chats. Unknown pickers read as free text.
|
|
2588
|
+
* project's connected Telegram chats. Unknown pickers read as free text. Two pickers also
|
|
2589
|
+
* constrain the value, at publication and when an operator edits it: `amount`, a
|
|
2590
|
+
* non-negative integer in a token's base units (`settings.amount()`), and `chain`, a chain
|
|
2591
|
+
* `ctx.wallet.balance()` reads (`settings.chain()`).
|
|
2592
|
+
*/
|
|
2593
|
+
picker: z23.string().optional(),
|
|
2594
|
+
/**
|
|
2595
|
+
* On an `amount` setting, the token's decimals: Console shows and edits the value in whole
|
|
2596
|
+
* tokens.
|
|
2558
2597
|
*/
|
|
2559
|
-
|
|
2598
|
+
decimals: z23.number().int().min(0).max(255).optional()
|
|
2560
2599
|
}).strict(),
|
|
2561
2600
|
z23.object({
|
|
2562
2601
|
...base,
|
|
@@ -2581,6 +2620,32 @@ var settingsValuesSchema = z23.record(
|
|
|
2581
2620
|
z23.string(),
|
|
2582
2621
|
z23.union([z23.string(), z23.number().finite(), z23.boolean(), quizContentSchema])
|
|
2583
2622
|
);
|
|
2623
|
+
function isAmount(value) {
|
|
2624
|
+
return value.length <= 100 && /^(0|[1-9][0-9]*)$/.test(value);
|
|
2625
|
+
}
|
|
2626
|
+
function isBalanceChain(value) {
|
|
2627
|
+
return value === "solana" || value === solanaMainnet || isEvmChainId(value);
|
|
2628
|
+
}
|
|
2629
|
+
function isBoundSetting(field) {
|
|
2630
|
+
return field?.kind === "integer" || field?.kind === "text" && field.picker === "amount";
|
|
2631
|
+
}
|
|
2632
|
+
function textSettingSchema(field) {
|
|
2633
|
+
const text = z23.string().min(field.minLength).max(field.maxLength);
|
|
2634
|
+
switch (field.picker) {
|
|
2635
|
+
case "amount":
|
|
2636
|
+
return text.refine(
|
|
2637
|
+
isAmount,
|
|
2638
|
+
"Use a whole number of base units, such as 1000000"
|
|
2639
|
+
);
|
|
2640
|
+
case "chain":
|
|
2641
|
+
return text.refine(
|
|
2642
|
+
isBalanceChain,
|
|
2643
|
+
'Use "solana" or an EVM chain ID such as "eip155:8453"'
|
|
2644
|
+
);
|
|
2645
|
+
default:
|
|
2646
|
+
return text;
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2584
2649
|
function parseSettings(fields2, input) {
|
|
2585
2650
|
const shape = {};
|
|
2586
2651
|
for (const [key, field] of Object.entries(fields2)) {
|
|
@@ -2598,7 +2663,7 @@ function parseSettings(fields2, input) {
|
|
|
2598
2663
|
shape[key] = quizContentSchema.default(field.default);
|
|
2599
2664
|
break;
|
|
2600
2665
|
case "text":
|
|
2601
|
-
shape[key] =
|
|
2666
|
+
shape[key] = textSettingSchema(field).default(field.default);
|
|
2602
2667
|
break;
|
|
2603
2668
|
case "integer":
|
|
2604
2669
|
shape[key] = z23.number().int().min(field.min).max(field.max).default(field.default);
|
|
@@ -3107,7 +3172,13 @@ var questDescriptionSchema = z28.object({
|
|
|
3107
3172
|
* Milliseconds a member waits after an attempt is rejected (by the evaluator or a reviewer)
|
|
3108
3173
|
* before submitting this quest again. Only for quests members submit. Omitted: no cooldown.
|
|
3109
3174
|
*/
|
|
3110
|
-
retryCooldownMs: retryCooldownMsSchema.optional()
|
|
3175
|
+
retryCooldownMs: retryCooldownMsSchema.optional(),
|
|
3176
|
+
/**
|
|
3177
|
+
* Milliseconds a member waits after an accepted completion of this quest, of any key, before
|
|
3178
|
+
* submitting it again. Only for repeatable quests members submit; same bounds as
|
|
3179
|
+
* `retryCooldownMs`. Omitted: no cooldown.
|
|
3180
|
+
*/
|
|
3181
|
+
completionCooldownMs: retryCooldownMsSchema.optional()
|
|
3111
3182
|
}).strict();
|
|
3112
3183
|
var artifactSchema = z28.object({ code: z28.string().min(1).max(1e6) }).strict();
|
|
3113
3184
|
var releaseSchema = artifactSchema.extend({
|
|
@@ -3522,6 +3593,15 @@ var memberProgressSchema = responseShape(
|
|
|
3522
3593
|
* `retry-cooldown`. Absent when no cooldown is running.
|
|
3523
3594
|
*/
|
|
3524
3595
|
retryAt: z28.number().int().safe().optional(),
|
|
3596
|
+
/**
|
|
3597
|
+
* Unix milliseconds when the member may next submit the quest, while it waits on something
|
|
3598
|
+
* that ends by itself: the retry cooldown after a rejection, the completion cooldown after
|
|
3599
|
+
* an accepted completion, an exhausted budget's next reset, or the next window of a counter
|
|
3600
|
+
* that pays once per window. The latest of these when
|
|
3601
|
+
* several apply; use it for countdowns. Absent when the member can submit now, or when
|
|
3602
|
+
* nothing will reopen the quest (a used-up lifetime budget, a closed window).
|
|
3603
|
+
*/
|
|
3604
|
+
nextAvailableAt: z28.number().int().safe().optional(),
|
|
3525
3605
|
attempt: attemptSchema.nullable()
|
|
3526
3606
|
})
|
|
3527
3607
|
),
|
|
@@ -3558,7 +3638,10 @@ var errorSchema = z28.object({
|
|
|
3558
3638
|
/** Which window refused admission when `code` is `outside-window`. */
|
|
3559
3639
|
window: z28.enum(["tracker", "quest"]).optional(),
|
|
3560
3640
|
missing: z28.array(missingPrerequisiteSchema).optional(),
|
|
3561
|
-
/**
|
|
3641
|
+
/**
|
|
3642
|
+
* Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
|
|
3643
|
+
* `completion-cooldown`.
|
|
3644
|
+
*/
|
|
3562
3645
|
retryAt: z28.number().int().safe().optional()
|
|
3563
3646
|
});
|
|
3564
3647
|
var staffDecisionSchema = z28.object({
|
|
@@ -3810,6 +3893,8 @@ export {
|
|
|
3810
3893
|
completionPolicySchema,
|
|
3811
3894
|
completionKeySchema,
|
|
3812
3895
|
budgetSchema,
|
|
3896
|
+
memberCompletionSchema,
|
|
3897
|
+
maxMemberCompletions,
|
|
3813
3898
|
evaluatorIntegrationProviderSchema,
|
|
3814
3899
|
integrationProviderSchema,
|
|
3815
3900
|
discordServerSchema,
|
|
@@ -3856,6 +3941,10 @@ export {
|
|
|
3856
3941
|
settingFieldSchema,
|
|
3857
3942
|
settingsFieldsSchema,
|
|
3858
3943
|
settingsValuesSchema,
|
|
3944
|
+
isAmount,
|
|
3945
|
+
isBalanceChain,
|
|
3946
|
+
isBoundSetting,
|
|
3947
|
+
textSettingSchema,
|
|
3859
3948
|
parseSettings,
|
|
3860
3949
|
missingResourceSettings,
|
|
3861
3950
|
compatibleSettingKinds,
|