@domino-sdk/relay 1.37.1 → 1.38.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/{attempt-captures-B2Clh9Df.d.ts → attempt-captures-CSiN1HKd.d.ts} +1 -1
- package/dist/authoring.d.ts +23 -9
- package/dist/authoring.js +14 -6
- package/dist/{automatic-outcomes-BiarOoiy.d.ts → automatic-outcomes-DDbgRubQ.d.ts} +1 -1
- package/dist/browser.d.ts +6 -6
- package/dist/browser.js +10 -10
- package/dist/{chunk-WYFGWUUJ.js → chunk-2CP3SULY.js} +1 -1
- package/dist/{chunk-2NNVJUP4.js → chunk-B65YJ6K4.js} +1 -1
- package/dist/{chunk-PWHKIZ2F.js → chunk-BYX27T2S.js} +2 -2
- package/dist/{chunk-TIXJGCWY.js → chunk-CHQWG5KQ.js} +12 -10
- package/dist/{chunk-OTDMH4IB.js → chunk-CRX274HO.js} +1 -1
- package/dist/{chunk-6KNYVJHM.js → chunk-DZZ5GSJ6.js} +2 -2
- package/dist/{chunk-EOCAYQUY.js → chunk-FTGW72A6.js} +1 -1
- package/dist/{chunk-2GGITG27.js → chunk-JYHRPMCE.js} +8 -2
- package/dist/{chunk-DOTZUOUI.js → chunk-KEYQHJHU.js} +6 -6
- package/dist/{chunk-4MPF5Y5A.js → chunk-KTHHGZSJ.js} +1 -1
- package/dist/{chunk-5D3O4GEM.js → chunk-OEO5OBY5.js} +30 -2
- package/dist/{chunk-IBNS3X7D.js → chunk-SBW52XXL.js} +1 -1
- package/dist/{chunk-ZG7XRZIF.js → chunk-V7KYVH3Z.js} +1 -1
- package/dist/{chunk-FB5GDPUU.js → chunk-YNQPFRQO.js} +7 -2
- package/dist/{chunk-FSJPYDW7.js → chunk-Z3SG7LKF.js} +4 -4
- package/dist/{chunk-XJCOVZZJ.js → chunk-ZT7FPD7B.js} +1 -1
- package/dist/{client-B3rMXsx2.d.ts → client-DjwKrpFo.d.ts} +18 -4
- package/dist/{deployments-CztfY7C8.d.ts → deployments-DYeuxXYg.d.ts} +29 -1
- package/dist/{groups-CRUAE6hI.d.ts → groups-JzAQ2JIN.d.ts} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/internal.d.ts +9 -9
- package/dist/internal.js +8 -8
- package/dist/{offers-B04ZE2JR.d.ts → offers-CIDAJEYs.d.ts} +2 -2
- package/dist/{pages-B5agdH0f.d.ts → pages-DR2YRvAp.d.ts} +20 -1
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +29 -18
- package/dist/react/index.js +60 -17
- package/dist/{schema--jNn3OfJ.d.ts → schema-Cgmj-CbC.d.ts} +18 -1
- package/dist/schema.d.ts +28 -11
- package/dist/schema.js +11 -7
- package/dist/server/index.d.ts +9 -9
- package/dist/server/index.js +14 -14
- package/dist/{submission-input-DGBBygFe.d.ts → submission-input-UBqB8NFC.d.ts} +2 -2
- package/dist/{telegram-browser-CiTSBNKo.d.ts → telegram-browser-2IllFeh-.d.ts} +1 -1
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +5 -5
- package/dist/{transport-BLq1PH-O.d.ts → transport-B3DkXMNu.d.ts} +217 -9
- package/dist/{x-imfTy_I1.d.ts → x-vVG6gZqi.d.ts} +1 -1
- package/package.json +1 -1
package/dist/authoring.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { x as xContentBodySchema, I as IdentityKind, n as customSourceSchema, W as WithRecordData, o as WithContent, p as WithAccountRoles, q as ResourceHandle, r as QuestHandle, L as LedgerReference, G as GroupHandle, u as TrackerSource, v as trackerDefinitionSchema, y as Tracker, z as TrackerData, B as SourceRoles, C as LedgerHandle, D as TrackerDataSchema, F as xSearchSourceSchema, X as XTweet, H as XContentMetric, J as TrackerTriggerPolicy, N as Where, P as MemberIdentity, U as TrackerTriggerContext, V as TrackerReader, Y as TextReviewInput, Z as TextResult, _ as PhotoResult, $ as Decision, a0 as rewardSchema, a1 as TrackerTriggerMode, a2 as RoleOf, a3 as WhereSetting, a4 as ContentBody, a5 as BadgeHandle, a6 as ContentMetricName, a7 as triggerSchema, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, a8 as TieredRewardDefinition } from './schema
|
|
2
|
-
export { a9 as LedgerSetting, aa as TrackerPage, ab as TrackerReadQuery, ac as trackerDataSchema, ad as trackerTriggerContextSchema } from './schema
|
|
1
|
+
import { x as xContentBodySchema, I as IdentityKind, n as customSourceSchema, W as WithRecordData, o as WithContent, p as WithAccountRoles, q as ResourceHandle, r as QuestHandle, L as LedgerReference, G as GroupHandle, u as TrackerSource, v as trackerDefinitionSchema, y as Tracker, z as TrackerData, B as SourceRoles, C as LedgerHandle, D as TrackerDataSchema, F as xSearchSourceSchema, X as XTweet, H as XContentMetric, J as TrackerTriggerPolicy, N as Where, P as MemberIdentity, U as TrackerTriggerContext, V as TrackerReader, Y as TextReviewInput, Z as TextResult, _ as PhotoResult, $ as Decision, a0 as rewardSchema, a1 as TrackerTriggerMode, a2 as RoleOf, a3 as WhereSetting, a4 as ContentBody, a5 as BadgeHandle, a6 as ContentMetricName, a7 as triggerSchema, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, a8 as TieredRewardDefinition } from './schema-Cgmj-CbC.js';
|
|
2
|
+
export { a9 as LedgerSetting, aa as TrackerPage, ab as TrackerReadQuery, ac as trackerDataSchema, ad as trackerTriggerContextSchema } from './schema-Cgmj-CbC.js';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
export { z } from 'zod';
|
|
5
|
-
import { f as badgeDeclarationSchema, B as Badge } from './offers-
|
|
6
|
-
export { g as defineOffer } from './offers-
|
|
7
|
-
import { E as EngagementBudget, q as leaderboardDefinitionSchema, r as AuthoringIdentity, s as pointLedgerDeclarationSchema, t as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-
|
|
8
|
-
export { u as defineCampaign, v as defineGroup } from './groups-
|
|
5
|
+
import { f as badgeDeclarationSchema, B as Badge } from './offers-CIDAJEYs.js';
|
|
6
|
+
export { g as defineOffer } from './offers-CIDAJEYs.js';
|
|
7
|
+
import { E as EngagementBudget, q as leaderboardDefinitionSchema, r as AuthoringIdentity, s as pointLedgerDeclarationSchema, t as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-JzAQ2JIN.js';
|
|
8
|
+
export { u as defineCampaign, v as defineGroup } from './groups-JzAQ2JIN.js';
|
|
9
9
|
import { d as discordMessagesSourceSchema, D as DiscordMessageData, c as DiscordMessageTextData, e as discordReactionsSourceSchema, f as DiscordReactionData, g as TelegramReader, h as DiscordReader } from './accounts-DRPENuZe.js';
|
|
10
10
|
export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramReactionData } from './accounts-DRPENuZe.js';
|
|
11
11
|
import { Q as QuizContent, a as StreakPolicy } from './streaks-0YuipsUQ.js';
|
|
12
12
|
import { R as ResourceSource, S as Setting, I as IntegrationModule, B as Budget, a as IntegerSettings } from './integrations-CllF-kWg.js';
|
|
13
|
-
import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-
|
|
14
|
-
export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-
|
|
15
|
-
import { I as ImageReader, X as XReader } from './x-
|
|
13
|
+
import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-UBqB8NFC.js';
|
|
14
|
+
export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-UBqB8NFC.js';
|
|
15
|
+
import { I as ImageReader, X as XReader } from './x-vVG6gZqi.js';
|
|
16
16
|
import { h as WalletReader } from './wallet-t7uNDg9p.js';
|
|
17
17
|
export { i as CosmosDenom, a as CosmosNetwork, E as EvmChainId, j as WalletBalance, k as WalletBalanceQuery, l as cosmosDenomSchema, m as cosmosNetworkSchema, n as isEvmChainId } from './wallet-t7uNDg9p.js';
|
|
18
18
|
export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-FQGGb5xS.js';
|
|
@@ -1066,6 +1066,12 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1066
1066
|
*/
|
|
1067
1067
|
profile?: QuestProfile;
|
|
1068
1068
|
budgets?: Budget[];
|
|
1069
|
+
/**
|
|
1070
|
+
* Milliseconds a member waits after an attempt is rejected, by the evaluator or a
|
|
1071
|
+
* reviewer, before submitting again: `300_000` lets a quiz be retried every five minutes.
|
|
1072
|
+
* Only for quests members submit. Omit it for no cooldown.
|
|
1073
|
+
*/
|
|
1074
|
+
retryCooldownMs?: number;
|
|
1069
1075
|
/**
|
|
1070
1076
|
* Whether staff can review this quest's attempts. Human review is on unless this returns
|
|
1071
1077
|
* `{ enabled: false }`. With it off, `decision.review(...)` becomes a reject that keeps the
|
|
@@ -1416,6 +1422,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1416
1422
|
from: number;
|
|
1417
1423
|
until: number;
|
|
1418
1424
|
} | undefined;
|
|
1425
|
+
retryCooldownMs?: number | undefined;
|
|
1419
1426
|
};
|
|
1420
1427
|
evaluate(ctx: {
|
|
1421
1428
|
settings: unknown;
|
|
@@ -1490,6 +1497,12 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
1490
1497
|
*/
|
|
1491
1498
|
profile?: QuestProfile;
|
|
1492
1499
|
budgets?: Budget[];
|
|
1500
|
+
/**
|
|
1501
|
+
* Milliseconds a member waits after an attempt is rejected, by the evaluator or a
|
|
1502
|
+
* reviewer, before submitting again: `300_000` lets a quiz be retried every five minutes.
|
|
1503
|
+
* Only for quests members submit. Omit it for no cooldown.
|
|
1504
|
+
*/
|
|
1505
|
+
retryCooldownMs?: number;
|
|
1493
1506
|
/**
|
|
1494
1507
|
* Whether staff can review this quest's attempts. Human review is on unless this returns
|
|
1495
1508
|
* `{ enabled: false }`. With it off, `decision.review(...)` becomes a reject that keeps the
|
|
@@ -1840,6 +1853,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
1840
1853
|
from: number;
|
|
1841
1854
|
until: number;
|
|
1842
1855
|
} | undefined;
|
|
1856
|
+
retryCooldownMs?: number | undefined;
|
|
1843
1857
|
};
|
|
1844
1858
|
evaluate(ctx: {
|
|
1845
1859
|
settings: unknown;
|
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-YNQPFRQO.js";
|
|
14
14
|
import {
|
|
15
15
|
badgeDeclarationSchema,
|
|
16
16
|
defineOffer,
|
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
leaderboardAuthoringSchema,
|
|
21
21
|
pointLedgerDeclarationSchema,
|
|
22
22
|
referralAuthoringSchema
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2CP3SULY.js";
|
|
24
24
|
import {
|
|
25
25
|
telegramReactionDataSchema,
|
|
26
26
|
telegramReactionsNamespace
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-B65YJ6K4.js";
|
|
28
28
|
import {
|
|
29
29
|
authoringKey,
|
|
30
30
|
badgeReward,
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
quizContentSchema,
|
|
62
62
|
resourceHandle,
|
|
63
63
|
resourceSourceSchema,
|
|
64
|
+
retryCooldownMsSchema,
|
|
64
65
|
rewardBundleSchema,
|
|
65
66
|
schemaCheckedReader,
|
|
66
67
|
settingFieldSchema,
|
|
@@ -81,7 +82,7 @@ import {
|
|
|
81
82
|
whereSchemaIssue,
|
|
82
83
|
whereSettings,
|
|
83
84
|
xSearchSourceSchema
|
|
84
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-OEO5OBY5.js";
|
|
85
86
|
|
|
86
87
|
// src/builders.ts
|
|
87
88
|
import * as z from "zod";
|
|
@@ -614,10 +615,16 @@ function questBuilder(template) {
|
|
|
614
615
|
performance: definition.performance ? contentPerformancePolicySchema.parse({
|
|
615
616
|
metrics: definition.performance.metrics,
|
|
616
617
|
maxAgeMs: definition.performance.maxAgeMs
|
|
617
|
-
}) : void 0
|
|
618
|
+
}) : void 0,
|
|
619
|
+
...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs }
|
|
618
620
|
},
|
|
619
621
|
{ template }
|
|
620
622
|
);
|
|
623
|
+
if (definition.retryCooldownMs !== void 0 && !retryCooldownMsSchema.safeParse(definition.retryCooldownMs).success) {
|
|
624
|
+
throw new Error(
|
|
625
|
+
"retryCooldownMs must be whole milliseconds from 1000 (one second) to 604800000 (seven days)"
|
|
626
|
+
);
|
|
627
|
+
}
|
|
621
628
|
if (definition.performance) {
|
|
622
629
|
const declared = triggerContentMetrics.get(definition.trigger) ?? [];
|
|
623
630
|
const unknown = definition.performance.metrics.filter(
|
|
@@ -700,7 +707,8 @@ function questBuilder(template) {
|
|
|
700
707
|
budgets: definition.budgets ?? [],
|
|
701
708
|
requires: definition.requires ?? [],
|
|
702
709
|
...definition.campaign ? { campaign: definition.campaign } : {},
|
|
703
|
-
...definition.availability ? { availability: definition.availability } : {}
|
|
710
|
+
...definition.availability ? { availability: definition.availability } : {},
|
|
711
|
+
...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs }
|
|
704
712
|
});
|
|
705
713
|
}
|
|
706
714
|
return resourceHandle("quest", {
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { o 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 { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-DjwKrpFo.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-2IllFeh-.js';
|
|
3
|
+
import './groups-JzAQ2JIN.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import './schema
|
|
6
|
-
import './pages-
|
|
7
|
-
import './submission-input-
|
|
5
|
+
import './schema-Cgmj-CbC.js';
|
|
6
|
+
import './pages-DR2YRvAp.js';
|
|
7
|
+
import './submission-input-UBqB8NFC.js';
|
|
8
8
|
import './action-DBzILFx9.js';
|
|
9
9
|
import './participant-activity-CoB2F30C.js';
|
|
10
10
|
import './accounts-DRPENuZe.js';
|
package/dist/browser.js
CHANGED
|
@@ -12,16 +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-
|
|
24
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-DZZ5GSJ6.js";
|
|
16
|
+
import "./chunk-CHQWG5KQ.js";
|
|
17
|
+
import "./chunk-CRX274HO.js";
|
|
18
|
+
import "./chunk-JYHRPMCE.js";
|
|
19
|
+
import "./chunk-2CP3SULY.js";
|
|
20
|
+
import "./chunk-B65YJ6K4.js";
|
|
21
|
+
import "./chunk-SBW52XXL.js";
|
|
22
|
+
import "./chunk-KTHHGZSJ.js";
|
|
23
|
+
import "./chunk-FTGW72A6.js";
|
|
24
|
+
import "./chunk-OEO5OBY5.js";
|
|
25
25
|
export {
|
|
26
26
|
browserSubmissionStore,
|
|
27
27
|
cosmosChainList,
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
imageFieldsSchema,
|
|
5
5
|
imageInspectionSchema,
|
|
6
6
|
imageSightingsSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V7KYVH3Z.js";
|
|
8
8
|
import {
|
|
9
9
|
photoResultSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OEO5OBY5.js";
|
|
11
11
|
|
|
12
12
|
// src/image-results.ts
|
|
13
13
|
import * as z from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRelayAction,
|
|
3
3
|
withActionId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CRX274HO.js";
|
|
5
5
|
import {
|
|
6
6
|
collectionPassSchema,
|
|
7
7
|
participantActivityQuerySchema,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
questOutcomeSchema,
|
|
18
18
|
rewardDeliveriesSchema,
|
|
19
19
|
rewardDeliveryQuerySchema
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JYHRPMCE.js";
|
|
21
21
|
import {
|
|
22
22
|
AVATAR_UPLOAD_LIMIT,
|
|
23
23
|
avatarUploadTypes,
|
|
@@ -46,29 +46,29 @@ import {
|
|
|
46
46
|
referralDefinitionSchema,
|
|
47
47
|
referralHistorySchema,
|
|
48
48
|
referralSummarySchema
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-2CP3SULY.js";
|
|
50
50
|
import {
|
|
51
51
|
telegramAccountConnectionSchema,
|
|
52
52
|
telegramMiniAppSignInSchema,
|
|
53
53
|
telegramSignInMethodsSchema
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-B65YJ6K4.js";
|
|
55
55
|
import {
|
|
56
56
|
PARTICIPANT_TIMEOUT,
|
|
57
57
|
lifetime,
|
|
58
58
|
retryAfter,
|
|
59
59
|
retrying,
|
|
60
60
|
validTimeout
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-SBW52XXL.js";
|
|
62
62
|
import {
|
|
63
63
|
clientIdentity
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-KTHHGZSJ.js";
|
|
65
65
|
import {
|
|
66
66
|
exchangeResultSchema,
|
|
67
67
|
exchangeSchema,
|
|
68
68
|
memberSummarySchema,
|
|
69
69
|
participantSessionSchema,
|
|
70
70
|
sessionMember
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-FTGW72A6.js";
|
|
72
72
|
import {
|
|
73
73
|
RelayError,
|
|
74
74
|
RelayErrorCode,
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
walletSignInNetworksSchema,
|
|
108
108
|
walletSignatureSchema,
|
|
109
109
|
walletUnlinkInputSchema
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-OEO5OBY5.js";
|
|
111
111
|
|
|
112
112
|
// src/legacy-submissions.ts
|
|
113
113
|
import * as z from "zod";
|
|
@@ -1126,7 +1126,8 @@ function errorBody(value) {
|
|
|
1126
1126
|
missing: Array.isArray(body.missing) ? body.missing.flatMap((entry) => {
|
|
1127
1127
|
const parsed = missingPrerequisiteSchema.safeParse(entry);
|
|
1128
1128
|
return parsed.success ? [parsed.data] : [];
|
|
1129
|
-
}) : []
|
|
1129
|
+
}) : [],
|
|
1130
|
+
retryAt: typeof body.retryAt === "number" && Number.isSafeInteger(body.retryAt) ? body.retryAt : void 0
|
|
1130
1131
|
};
|
|
1131
1132
|
}
|
|
1132
1133
|
async function fromSigner(step, signal) {
|
|
@@ -1358,13 +1359,14 @@ function relayClient(options) {
|
|
|
1358
1359
|
value = JSON.parse(text);
|
|
1359
1360
|
} catch {
|
|
1360
1361
|
}
|
|
1361
|
-
const { message, code, window, missing } = errorBody(value);
|
|
1362
|
+
const { message, code, window, missing, retryAt } = errorBody(value);
|
|
1362
1363
|
throw new RelayError(message ?? `Request failed (${response.status})`, {
|
|
1363
1364
|
kind: "http",
|
|
1364
1365
|
status: response.status,
|
|
1365
1366
|
code,
|
|
1366
1367
|
window,
|
|
1367
1368
|
missing,
|
|
1369
|
+
...retryAt === void 0 ? {} : { retryAt },
|
|
1368
1370
|
operationId: call.operationId,
|
|
1369
1371
|
replaySafe: call.replaySafe,
|
|
1370
1372
|
uncertain: methodOf(call) !== "GET" && uncertainStatuses.has(response.status),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRelayClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CHQWG5KQ.js";
|
|
4
4
|
import {
|
|
5
5
|
RelayErrorCode,
|
|
6
6
|
asRelayError,
|
|
7
7
|
clientError,
|
|
8
8
|
cosmosChain
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OEO5OBY5.js";
|
|
10
10
|
|
|
11
11
|
// src/base58.ts
|
|
12
12
|
var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
badgeSchema,
|
|
3
3
|
pointLedgerReferenceSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2CP3SULY.js";
|
|
5
5
|
import {
|
|
6
6
|
authoringIdentityShape,
|
|
7
7
|
entitlementSchema,
|
|
@@ -15,12 +15,13 @@ import {
|
|
|
15
15
|
publishedReleaseSchema,
|
|
16
16
|
questPresentationContentSchema,
|
|
17
17
|
responseShape,
|
|
18
|
+
retryCooldownMsSchema,
|
|
18
19
|
reviewModeSchema,
|
|
19
20
|
settingsValuesSchema,
|
|
20
21
|
storedQuestDescriptionSchema,
|
|
21
22
|
storedReviewModeSchema,
|
|
22
23
|
tieredRewardReferenceSchema
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-OEO5OBY5.js";
|
|
24
25
|
|
|
25
26
|
// src/participant-activity.ts
|
|
26
27
|
import * as z from "zod";
|
|
@@ -156,6 +157,11 @@ var questInstanceSchema = z2.object({
|
|
|
156
157
|
presentation: questPresentationContentSchema.optional(),
|
|
157
158
|
settings: settingsValuesSchema,
|
|
158
159
|
requires: z2.array(prerequisiteSchema).max(30),
|
|
160
|
+
/**
|
|
161
|
+
* Milliseconds a member waits after a rejected attempt before submitting again, or `null` for
|
|
162
|
+
* no cooldown. Omitted: the quest type's own `retryCooldownMs`.
|
|
163
|
+
*/
|
|
164
|
+
retryCooldownMs: retryCooldownMsSchema.nullable().optional(),
|
|
159
165
|
status: z2.enum(["active", "paused", "archived"])
|
|
160
166
|
}).strict();
|
|
161
167
|
var questDraftChangesSchema = z2.object({
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
imageSightingsSchema,
|
|
7
7
|
imageUploadsSchema,
|
|
8
8
|
publishedImageSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V7KYVH3Z.js";
|
|
10
10
|
import {
|
|
11
11
|
catalogDeploymentSchema,
|
|
12
12
|
collectionPassSchema,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
questTypeVersionSchema,
|
|
25
25
|
questViewSchema,
|
|
26
26
|
rewardDeliveriesSchema
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-JYHRPMCE.js";
|
|
28
28
|
import {
|
|
29
29
|
badgeArtifactSchema,
|
|
30
30
|
badgeSchema,
|
|
@@ -57,15 +57,15 @@ import {
|
|
|
57
57
|
referralDefinitionSchema,
|
|
58
58
|
referralHistorySchema,
|
|
59
59
|
referralSummarySchema
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-2CP3SULY.js";
|
|
61
61
|
import {
|
|
62
62
|
telegramAccountConnectionSchema
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-B65YJ6K4.js";
|
|
64
64
|
import {
|
|
65
65
|
exchangeResultSchema,
|
|
66
66
|
memberSummarySchema,
|
|
67
67
|
participantSessionSchema
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-FTGW72A6.js";
|
|
69
69
|
import {
|
|
70
70
|
accountConnectionSchema,
|
|
71
71
|
attemptSchema,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
walletBalanceSchema,
|
|
97
97
|
walletMessageChallengeSchema,
|
|
98
98
|
walletSignInNetworksSchema
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-OEO5OBY5.js";
|
|
100
100
|
|
|
101
101
|
// src/deployments.ts
|
|
102
102
|
import * as z from "zod";
|
|
@@ -70,6 +70,11 @@ var RelayErrorCode = {
|
|
|
70
70
|
QuestUpdated: "quest-updated",
|
|
71
71
|
/** Wait for the deferred attempt before submitting another action. */
|
|
72
72
|
AttemptPending: "attempt-pending",
|
|
73
|
+
/**
|
|
74
|
+
* The member's last attempt was rejected and the quest's retry cooldown is running; `retryAt`
|
|
75
|
+
* says when they may submit again.
|
|
76
|
+
*/
|
|
77
|
+
RetryCooldown: "retry-cooldown",
|
|
73
78
|
/** The quiz changed since the member answered it. */
|
|
74
79
|
StaleQuiz: "stale-quiz",
|
|
75
80
|
/** Relay refused the submitted evidence. */
|
|
@@ -130,10 +135,13 @@ var RelayError = class extends RequestError {
|
|
|
130
135
|
window;
|
|
131
136
|
/** Prerequisites the member does not currently meet, when Relay refused for that reason. */
|
|
132
137
|
missing;
|
|
138
|
+
/** Unix milliseconds when the member may submit again, when `code` is `retry-cooldown`. */
|
|
139
|
+
retryAt;
|
|
133
140
|
constructor(message, details) {
|
|
134
141
|
super(message, details);
|
|
135
142
|
this.window = details.window;
|
|
136
143
|
this.missing = details.missing ?? [];
|
|
144
|
+
this.retryAt = details.retryAt;
|
|
137
145
|
}
|
|
138
146
|
};
|
|
139
147
|
function asRelayError(cause, fallback = "Request failed") {
|
|
@@ -2857,6 +2865,11 @@ var deferPolicy = {
|
|
|
2857
2865
|
horizonMs: 864e5,
|
|
2858
2866
|
maxDefers: 100
|
|
2859
2867
|
};
|
|
2868
|
+
var retryCooldownPolicy = {
|
|
2869
|
+
minMs: 1e3,
|
|
2870
|
+
maxMs: 6048e5
|
|
2871
|
+
};
|
|
2872
|
+
var retryCooldownMsSchema = z26.number().int().min(retryCooldownPolicy.minMs).max(retryCooldownPolicy.maxMs);
|
|
2860
2873
|
var evaluatorProgressSchema = z26.object({
|
|
2861
2874
|
current: z26.number().finite().nonnegative(),
|
|
2862
2875
|
target: z26.number().finite().positive(),
|
|
@@ -2973,7 +2986,12 @@ var questDescriptionSchema = z26.object({
|
|
|
2973
2986
|
visibility: z26.enum(["visible", "hidden"]).default("visible"),
|
|
2974
2987
|
/** Whether completions show on participant profiles (`/v1/profiles/:id/completions`). */
|
|
2975
2988
|
profile: questProfileSchema.default({ visible: false }),
|
|
2976
|
-
budgets: z26.array(budgetSchema).max(20).default([])
|
|
2989
|
+
budgets: z26.array(budgetSchema).max(20).default([]),
|
|
2990
|
+
/**
|
|
2991
|
+
* Milliseconds a member waits after an attempt is rejected (by the evaluator or a reviewer)
|
|
2992
|
+
* before submitting this quest again. Only for quests members submit. Omitted: no cooldown.
|
|
2993
|
+
*/
|
|
2994
|
+
retryCooldownMs: retryCooldownMsSchema.optional()
|
|
2977
2995
|
}).strict();
|
|
2978
2996
|
var artifactSchema = z26.object({ code: z26.string().min(1).max(1e6) }).strict();
|
|
2979
2997
|
var releaseSchema = artifactSchema.extend({
|
|
@@ -3372,6 +3390,12 @@ var memberProgressSchema = responseShape(
|
|
|
3372
3390
|
campaign: campaignViewSchema.nullable().default(null),
|
|
3373
3391
|
window: availabilityWindowSchema.nullable().default(null),
|
|
3374
3392
|
budgets: z26.array(questBudgetViewSchema).default([]),
|
|
3393
|
+
/**
|
|
3394
|
+
* Unix milliseconds when the member may submit again, while the quest's retry cooldown
|
|
3395
|
+
* after their rejected attempt runs. Until then a new attempt is refused with
|
|
3396
|
+
* `retry-cooldown`. Absent when no cooldown is running.
|
|
3397
|
+
*/
|
|
3398
|
+
retryAt: z26.number().int().safe().optional(),
|
|
3375
3399
|
attempt: attemptSchema.nullable()
|
|
3376
3400
|
})
|
|
3377
3401
|
),
|
|
@@ -3407,7 +3431,9 @@ var errorSchema = z26.object({
|
|
|
3407
3431
|
code: z26.string().optional(),
|
|
3408
3432
|
/** Which window refused admission when `code` is `outside-window`. */
|
|
3409
3433
|
window: z26.enum(["tracker", "quest"]).optional(),
|
|
3410
|
-
missing: z26.array(missingPrerequisiteSchema).optional()
|
|
3434
|
+
missing: z26.array(missingPrerequisiteSchema).optional(),
|
|
3435
|
+
/** Unix milliseconds when the member may submit again, when `code` is `retry-cooldown`. */
|
|
3436
|
+
retryAt: z26.number().int().safe().optional()
|
|
3411
3437
|
});
|
|
3412
3438
|
var staffDecisionSchema = z26.object({
|
|
3413
3439
|
actionId: identifier,
|
|
@@ -3746,6 +3772,8 @@ export {
|
|
|
3746
3772
|
textReviewInputSchema,
|
|
3747
3773
|
textResultSchema,
|
|
3748
3774
|
deferPolicy,
|
|
3775
|
+
retryCooldownPolicy,
|
|
3776
|
+
retryCooldownMsSchema,
|
|
3749
3777
|
evaluatorProgressSchema,
|
|
3750
3778
|
decisionSchema,
|
|
3751
3779
|
reviewModeSchema,
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
isKnownTrackerSource,
|
|
6
6
|
trackerDataSchema,
|
|
7
7
|
xAccountRoles
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OEO5OBY5.js";
|
|
9
9
|
|
|
10
10
|
// src/quest-shape.ts
|
|
11
11
|
function validateQuestShape(description, options = {}) {
|
|
12
|
-
const { trigger, completion, requires, performance } = description;
|
|
12
|
+
const { trigger, completion, requires, performance, retryCooldownMs } = description;
|
|
13
13
|
const tracker = trigger.kind === "automatic" ? trigger.tracker : void 0;
|
|
14
14
|
const content = tracker?.content === true;
|
|
15
15
|
if (performance && !content) {
|
|
@@ -25,6 +25,11 @@ function validateQuestShape(description, options = {}) {
|
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
if (retryCooldownMs !== void 0 && (trigger.kind !== "manual" || trigger.actor === "staff")) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
"A retry cooldown applies only to quests members submit themselves"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
28
33
|
if (trigger.kind === "automatic" && !tracker) {
|
|
29
34
|
if (!options.template && requires.length === 0) {
|
|
30
35
|
throw new Error("Automatic quests need at least one prerequisite");
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
retryAfter,
|
|
5
5
|
retrying,
|
|
6
6
|
validTimeout
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SBW52XXL.js";
|
|
8
8
|
import {
|
|
9
9
|
clientIdentity
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KTHHGZSJ.js";
|
|
11
11
|
import {
|
|
12
12
|
authScopeSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FTGW72A6.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-OEO5OBY5.js";
|
|
21
21
|
|
|
22
22
|
// src/configuration.ts
|
|
23
23
|
function questConfiguration(release) {
|