@domino-sdk/relay 1.72.0 → 1.74.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-COLmXRbW.d.ts → accounts-C9as33l1.d.ts} +2 -2
- package/dist/{attempt-captures-CVl161qB.d.ts → attempt-captures-DU4vi20Y.d.ts} +2 -2
- package/dist/authoring.d.ts +103 -106
- package/dist/authoring.js +187 -286
- package/dist/{automatic-outcomes-5l68PGr1.d.ts → automatic-outcomes-D0yMHSHL.d.ts} +2 -2
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +11 -11
- package/dist/{dashboards-DXpjHnq-.d.ts → capability-error-Bn6cCqof.d.ts} +298 -5
- package/dist/{catalog-BR3g-1H9.d.ts → catalog-9I6t18qP.d.ts} +2 -2
- package/dist/{chunk-W6DBNBMT.js → chunk-2LURSPDM.js} +232 -232
- package/dist/{chunk-VNEJH4NT.js → chunk-2M5FM7FW.js} +21 -0
- package/dist/{chunk-74SMLZZ5.js → chunk-6TDHRGBM.js} +1522 -1278
- package/dist/{chunk-QG6XVOOO.js → chunk-724CKAC7.js} +4 -4
- package/dist/{chunk-I7XIBXT2.js → chunk-7I7P5UVC.js} +3 -3
- package/dist/{chunk-LDO5GP7G.js → chunk-AL5XMXPO.js} +1 -1
- package/dist/{chunk-TW4RABVS.js → chunk-CW7FJ5PX.js} +1 -1
- package/dist/{chunk-BXUF3CRL.js → chunk-DNOLNMCW.js} +9 -9
- package/dist/{chunk-5RLIPTL7.js → chunk-E73HZCG2.js} +1 -1
- package/dist/{chunk-UEVZ3TST.js → chunk-ELHMJODS.js} +1 -1
- package/dist/{chunk-ASBDB436.js → chunk-F66GGNKD.js} +1 -1
- package/dist/{chunk-ETGKC2SB.js → chunk-HCOLMJFX.js} +2 -2
- package/dist/chunk-JZT2NLSG.js +7201 -0
- package/dist/{chunk-FGZGL5PG.js → chunk-KGZ7SRKJ.js} +2 -2
- package/dist/{chunk-3KKRXN5E.js → chunk-KP55TMCC.js} +1 -1
- package/dist/chunk-NI6XRGEL.js +374 -0
- package/dist/{chunk-VFHLMNYV.js → chunk-RALBAKKX.js} +1 -1
- package/dist/chunk-SVZ3QWHT.js +142 -0
- package/dist/{chunk-CVJTIVAP.js → chunk-T4PTFCSB.js} +2 -2
- package/dist/{chunk-KIRXE37T.js → chunk-TGQNNMCY.js} +6 -6
- package/dist/{client-B__hMWtK.d.ts → client-B2aVGf38.d.ts} +7 -7
- package/dist/{deployments-CT2kQloT.d.ts → deployments-CGV1rIZm.d.ts} +107 -107
- package/dist/{identity-integration-ClX4oUAu.d.ts → identity-integration-C03rUYc0.d.ts} +3 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/internal.d.ts +36197 -18
- package/dist/internal.js +518 -15
- package/dist/{limits-B7wbnWhd.d.ts → limits-p-Mg0oSi.d.ts} +1 -1
- package/dist/{offers-D4pyeY9b.d.ts → offers-CnMyMeQo.d.ts} +2 -2
- package/dist/portal-proxy.d.ts +2 -2
- package/dist/portal-proxy.js +10 -10
- package/dist/react/index.d.ts +11 -11
- package/dist/react/index.js +11 -11
- package/dist/{reward-deliveries-HGpj1VFz.d.ts → reward-deliveries-zWfsgc6m.d.ts} +1 -1
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/NYEWMPJH.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +35 -60
- package/dist/schema.js +10 -8
- package/dist/server/index.d.ts +13 -13
- package/dist/server/index.js +2972 -4528
- package/dist/{sign-in-providers-lbOXCF8N.d.ts → sign-in-providers-BG22ZZkl.d.ts} +2 -2
- package/dist/solana.d.ts +13 -13
- package/dist/solana.js +9 -9
- package/dist/stake-BSVjB3BJ.d.ts +254 -0
- package/dist/{station-check-in-qBiaftfE.d.ts → station-check-in-a1deSjbm.d.ts} +5 -5
- package/dist/{submission-input-U4aIkJuT.d.ts → submission-input-DBDLkTF8.d.ts} +2 -2
- package/dist/telegram.d.ts +7 -7
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +159 -160
- package/dist/testing.js +47 -344
- package/dist/{tracker-data-2BYXZjsN.d.ts → tracker-data-Dwq9dWEm.d.ts} +474 -221
- package/dist/{transport-DcRXDZ1j.d.ts → transport-D77Rbf4D.d.ts} +77050 -74062
- package/dist/{wallet-BqswMAqZ.d.ts → wallet-CeqgtXNm.d.ts} +2 -7
- package/dist/{wallet-browser-B5r7u3xB.d.ts → wallet-browser-Cucpqn3F.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/capability-error-db7kO8-P.d.ts +0 -297
- package/dist/chunk-2UELTHW6.js +0 -467
- package/dist/chunk-GHBYWDEZ.js +0 -94
- package/dist/chunk-HN7DE2UN.js +0 -53
- package/dist/runtime/chunks/A7G5P76B.js +0 -1
package/dist/authoring.js
CHANGED
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
sourceDataSchema,
|
|
7
7
|
sourceRoles,
|
|
8
8
|
validateQuestShape
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ELHMJODS.js";
|
|
10
10
|
import {
|
|
11
11
|
defineDashboard,
|
|
12
12
|
tiktokVideoBodySchema,
|
|
13
13
|
tiktokVideoMetrics,
|
|
14
14
|
youtubeShortBodySchema,
|
|
15
15
|
youtubeShortMetrics
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-T4PTFCSB.js";
|
|
17
17
|
import {
|
|
18
18
|
CapabilityError,
|
|
19
19
|
capabilityErrorCodes
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
engagementScoreSchema,
|
|
25
25
|
offerAuthoringSchema,
|
|
26
26
|
referralAuthoringSchema
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KGZ7SRKJ.js";
|
|
28
28
|
import {
|
|
29
29
|
announcementSchema,
|
|
30
30
|
authorBudgetSchema,
|
|
@@ -65,7 +65,6 @@ import {
|
|
|
65
65
|
isEvmAddress,
|
|
66
66
|
isEvmChainId,
|
|
67
67
|
isNftCollection,
|
|
68
|
-
isSolanaNetwork,
|
|
69
68
|
isSolanaProgram,
|
|
70
69
|
leaderboardAuthoringSchema,
|
|
71
70
|
ledgerKey,
|
|
@@ -97,8 +96,6 @@ import {
|
|
|
97
96
|
settingFieldSchema,
|
|
98
97
|
settingInstant,
|
|
99
98
|
settingResourceId,
|
|
100
|
-
solanaAddressSchema,
|
|
101
|
-
solanaMainnet,
|
|
102
99
|
sourceContent,
|
|
103
100
|
sourceIdentities,
|
|
104
101
|
streakPolicySchema,
|
|
@@ -118,29 +115,22 @@ import {
|
|
|
118
115
|
trackerTriggerContextSchema,
|
|
119
116
|
trackerTriggerPolicySchema,
|
|
120
117
|
urlOptionsSchema,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
walletProgramAccountSourceSchema,
|
|
127
|
-
walletProgramAccountsNamespace,
|
|
128
|
-
walletProgramActivityNamespace,
|
|
129
|
-
walletProgramActivitySchema,
|
|
130
|
-
walletProgramActivitySourceSchema,
|
|
131
|
-
walletStakeNamespace,
|
|
132
|
-
walletStakeSampleSchema,
|
|
133
|
-
walletStakeSourceSchema,
|
|
118
|
+
walletBalances,
|
|
119
|
+
walletNfts,
|
|
120
|
+
walletProgramAccounts,
|
|
121
|
+
walletProgramActivity,
|
|
122
|
+
walletStake,
|
|
134
123
|
whereSchemaIssue,
|
|
135
124
|
whereSettings,
|
|
136
125
|
xSearchSourceSchema,
|
|
137
126
|
youtubeShortsNamespace
|
|
138
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-6TDHRGBM.js";
|
|
139
128
|
import {
|
|
140
129
|
namedSchemaFailure,
|
|
141
130
|
parseDefinition,
|
|
142
|
-
parseField
|
|
143
|
-
|
|
131
|
+
parseField,
|
|
132
|
+
refusing
|
|
133
|
+
} from "./chunk-2M5FM7FW.js";
|
|
144
134
|
|
|
145
135
|
// src/builders.ts
|
|
146
136
|
import * as z from "zod";
|
|
@@ -488,151 +478,48 @@ var tiktok = {
|
|
|
488
478
|
});
|
|
489
479
|
}
|
|
490
480
|
};
|
|
491
|
-
function
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
throw new Error("wallet.balances() takes the token as a string");
|
|
496
|
-
}
|
|
497
|
-
if (chain === "solana" || typeof chain === "string" && isSolanaNetwork(chain)) {
|
|
498
|
-
if (given !== null && !solanaAddressSchema.safeParse(given).success) {
|
|
499
|
-
throw new Error(
|
|
500
|
-
"wallet.balances() on Solana takes an SPL or Token-2022 mint address (base58)"
|
|
501
|
-
);
|
|
502
|
-
}
|
|
503
|
-
return { chain: chain === "solana" ? solanaMainnet : chain, token: given };
|
|
504
|
-
}
|
|
505
|
-
if (typeof chain === "string" && isEvmChainId(chain)) {
|
|
506
|
-
if (given !== null && !isEvmAddress(given)) {
|
|
507
|
-
throw new Error(
|
|
508
|
-
"wallet.balances() on an EVM chain takes an ERC-20 contract address: 0x and 40 hex digits"
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
|
-
return { chain, token: given };
|
|
512
|
-
}
|
|
513
|
-
if (typeof chain === "string" && /^cosmos:[-_a-zA-Z0-9]{1,32}$/.test(chain)) {
|
|
514
|
-
if (given === null || !cosmosDenomSchema.safeParse(given).success) {
|
|
515
|
-
throw new Error(
|
|
516
|
-
"wallet.balances() on a Cosmos chain takes a bank denomination such as uatom"
|
|
517
|
-
);
|
|
518
|
-
}
|
|
519
|
-
return { chain, token: given };
|
|
520
|
-
}
|
|
521
|
-
throw new Error(
|
|
522
|
-
'wallet.balances() reads "solana", an EVM chain such as "eip155:8453" or a Cosmos network such as "cosmos:cosmoshub-4"'
|
|
523
|
-
);
|
|
524
|
-
}
|
|
525
|
-
function walletProgramActivitySource(query) {
|
|
526
|
-
const {
|
|
527
|
-
chain = "solana",
|
|
528
|
-
program,
|
|
529
|
-
instruction: instruction2,
|
|
530
|
-
mint,
|
|
531
|
-
minAmount,
|
|
532
|
-
signer = "wallet"
|
|
533
|
-
} = query;
|
|
534
|
-
if (chain !== "solana" && !(typeof chain === "string" && isSolanaNetwork(chain))) {
|
|
535
|
-
throw new Error(
|
|
536
|
-
'wallet.programActivity() reads "solana" (mainnet) or Solana devnet, solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1'
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
if (signer !== "wallet" && signer !== "any") {
|
|
540
|
-
throw new Error('wallet.programActivity() takes signer "wallet" or "any"');
|
|
541
|
-
}
|
|
542
|
-
const parsed = walletProgramActivitySourceSchema.safeParse({
|
|
543
|
-
chain: chain === "solana" ? solanaMainnet : chain,
|
|
544
|
-
program,
|
|
545
|
-
instruction: instruction2 ?? null,
|
|
546
|
-
mint: mint ?? null,
|
|
547
|
-
minAmount: minAmount ?? null,
|
|
548
|
-
anySigner: signer === "any"
|
|
481
|
+
function walletReadSource(kind) {
|
|
482
|
+
return customSource(kind.namespace, {
|
|
483
|
+
identities: ["wallet"],
|
|
484
|
+
data: kind.sample
|
|
549
485
|
});
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
`wallet.programActivity()${issue.path.length ? ` ${issue.path.join(".")}` : ""}: ${issue.message}`
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
|
-
return parsed.data;
|
|
486
|
+
}
|
|
487
|
+
function withWalletRead(kind, source, settings2) {
|
|
488
|
+
return customSourceSchema.parse({ ...source, [kind.field]: settings2 });
|
|
557
489
|
}
|
|
558
490
|
var wallet = {
|
|
559
491
|
balances(query) {
|
|
560
|
-
const balance =
|
|
561
|
-
const source =
|
|
562
|
-
|
|
563
|
-
data: walletBalanceSampleSchema
|
|
564
|
-
});
|
|
565
|
-
return customSourceSchema.parse({ ...source, balance });
|
|
492
|
+
const balance = walletBalances.settings(query);
|
|
493
|
+
const source = walletReadSource(walletBalances);
|
|
494
|
+
return withWalletRead(walletBalances, source, balance);
|
|
566
495
|
},
|
|
567
496
|
programActivity(query) {
|
|
568
|
-
const activity =
|
|
569
|
-
const source =
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
return customSourceSchema.parse({
|
|
574
|
-
...source,
|
|
497
|
+
const activity = walletProgramActivity.settings(query);
|
|
498
|
+
const source = walletReadSource(walletProgramActivity);
|
|
499
|
+
return withWalletRead(
|
|
500
|
+
walletProgramActivity,
|
|
501
|
+
source,
|
|
575
502
|
activity
|
|
576
|
-
|
|
503
|
+
);
|
|
577
504
|
},
|
|
578
505
|
nfts(query) {
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
'wallet.nfts() takes an NFT collection such as "eip155:1/erc721:0x\u2026", "eip155:8453/erc1155:0x\u2026/1" or "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection mint>"'
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
const source = customSource(walletNftsNamespace, {
|
|
586
|
-
identities: ["wallet"],
|
|
587
|
-
data: walletNftSampleSchema
|
|
588
|
-
});
|
|
589
|
-
const nfts = { collection };
|
|
590
|
-
return customSourceSchema.parse({ ...source, nfts });
|
|
506
|
+
const nfts = walletNfts.settings(query);
|
|
507
|
+
const source = walletReadSource(walletNfts);
|
|
508
|
+
return withWalletRead(walletNfts, source, nfts);
|
|
591
509
|
},
|
|
592
510
|
stake(query = {}) {
|
|
593
|
-
const
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
voteAccount: voteAccount ?? null
|
|
597
|
-
});
|
|
598
|
-
if (!stake.success) {
|
|
599
|
-
throw new Error(
|
|
600
|
-
`wallet.stake() ${stake.error.issues[0].path.join(".")}: ${stake.error.issues[0].message}`
|
|
601
|
-
);
|
|
602
|
-
}
|
|
603
|
-
const source = customSource(walletStakeNamespace, {
|
|
604
|
-
identities: ["wallet"],
|
|
605
|
-
data: walletStakeSampleSchema
|
|
606
|
-
});
|
|
607
|
-
return customSourceSchema.parse({
|
|
608
|
-
...source,
|
|
609
|
-
stake: stake.data
|
|
610
|
-
});
|
|
511
|
+
const stake = walletStake.settings(query);
|
|
512
|
+
const source = walletReadSource(walletStake);
|
|
513
|
+
return withWalletRead(walletStake, source, stake);
|
|
611
514
|
},
|
|
612
515
|
programAccounts(query) {
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
chain: chain === "solana" ? solanaMainnet : chain,
|
|
621
|
-
...idl === void 0 ? {} : { idl: { program: rest.program, source: "pasted", idl } }
|
|
622
|
-
});
|
|
623
|
-
if (!programAccount.success) {
|
|
624
|
-
throw new Error(
|
|
625
|
-
`wallet.programAccounts() ${programAccount.error.issues[0].path.join(".")}: ${programAccount.error.issues[0].message}`
|
|
626
|
-
);
|
|
627
|
-
}
|
|
628
|
-
const source = customSource(walletProgramAccountsNamespace, {
|
|
629
|
-
identities: ["wallet"],
|
|
630
|
-
data: walletProgramAccountSampleSchema
|
|
631
|
-
});
|
|
632
|
-
return customSourceSchema.parse({
|
|
633
|
-
...source,
|
|
634
|
-
programAccount: programAccount.data
|
|
635
|
-
});
|
|
516
|
+
const programAccount = walletProgramAccounts.settings(query);
|
|
517
|
+
const source = walletReadSource(walletProgramAccounts);
|
|
518
|
+
return withWalletRead(
|
|
519
|
+
walletProgramAccounts,
|
|
520
|
+
source,
|
|
521
|
+
programAccount
|
|
522
|
+
);
|
|
636
523
|
}
|
|
637
524
|
};
|
|
638
525
|
var pointLedgers = () => ({
|
|
@@ -1179,105 +1066,131 @@ function questBuilder(template) {
|
|
|
1179
1066
|
return function defineQuest2(definition) {
|
|
1180
1067
|
const key = authoringKey(definition);
|
|
1181
1068
|
const name = `${template ? "Quest type" : "Quest"} "${key}"`;
|
|
1182
|
-
if (definition.rewards === void 0) {
|
|
1183
|
-
throw new Error(
|
|
1184
|
-
`${name}: rewards is missing. Return [] for a quest that gives none.`
|
|
1185
|
-
);
|
|
1186
|
-
}
|
|
1187
|
-
const integrationModules = [
|
|
1188
|
-
...new Set(
|
|
1189
|
-
(definition.integrations ?? []).map(
|
|
1190
|
-
(module) => integrationModuleProviderSchema.parse(module.provider)
|
|
1191
|
-
)
|
|
1192
|
-
)
|
|
1193
|
-
];
|
|
1194
|
-
const integrations = integrationModules.flatMap((provider) => {
|
|
1195
|
-
const known = evaluatorIntegrationProviderSchema.safeParse(provider);
|
|
1196
|
-
return known.success ? [known.data] : [];
|
|
1197
|
-
});
|
|
1198
|
-
const contentTrigger = definition.trigger.kind === "automatic" && definition.trigger.tracker?.content === true;
|
|
1199
|
-
const trackerTrigger2 = definition.trigger.kind === "automatic" && definition.trigger.tracker !== void 0;
|
|
1200
1069
|
const declared = definition.completion;
|
|
1201
1070
|
const completion = typeof declared === "function" ? declared(completionPolicies) : declared;
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1071
|
+
const { integrationModules, integrations, trackerTrigger: trackerTrigger2, shape, fields } = refusing(name, () => {
|
|
1072
|
+
if (definition.rewards === void 0) {
|
|
1073
|
+
throw new Error(
|
|
1074
|
+
"rewards is missing. Return [] for a quest that gives none."
|
|
1075
|
+
);
|
|
1076
|
+
}
|
|
1077
|
+
const integrationModules2 = [
|
|
1078
|
+
...new Set(
|
|
1079
|
+
(definition.integrations ?? []).map(
|
|
1080
|
+
(module) => integrationModuleProviderSchema.parse(module.provider)
|
|
1081
|
+
)
|
|
1082
|
+
)
|
|
1083
|
+
];
|
|
1084
|
+
const integrations2 = integrationModules2.flatMap((provider) => {
|
|
1085
|
+
const known = evaluatorIntegrationProviderSchema.safeParse(provider);
|
|
1086
|
+
return known.success ? [known.data] : [];
|
|
1087
|
+
});
|
|
1088
|
+
const contentTrigger = definition.trigger.kind === "automatic" && definition.trigger.tracker?.content === true;
|
|
1089
|
+
const trackerTrigger3 = definition.trigger.kind === "automatic" && definition.trigger.tracker !== void 0;
|
|
1090
|
+
if (contentTrigger && completion !== void 0) {
|
|
1091
|
+
throw new Error(
|
|
1092
|
+
"A content quest completes once per content item: remove its completion"
|
|
1093
|
+
);
|
|
1094
|
+
}
|
|
1095
|
+
if (!contentTrigger && completion === void 0) {
|
|
1096
|
+
throw new Error(
|
|
1097
|
+
"A quest needs a completion, such as once(), keyed(...), streak(...) or progress(...)"
|
|
1098
|
+
);
|
|
1099
|
+
}
|
|
1100
|
+
const author = authorBudgets(definition.budgets);
|
|
1101
|
+
const { performance, stations, gallery } = definition;
|
|
1102
|
+
const shape2 = {
|
|
1103
|
+
...author.length ? { authorBudgets: author } : {},
|
|
1104
|
+
...performance ? {
|
|
1105
|
+
performance: parseField(
|
|
1106
|
+
"performance",
|
|
1107
|
+
() => contentPerformancePolicySchema.parse({
|
|
1108
|
+
metrics: performance.metrics,
|
|
1109
|
+
maxAgeMs: performance.maxAgeMs
|
|
1110
|
+
})
|
|
1111
|
+
)
|
|
1112
|
+
} : {},
|
|
1225
1113
|
...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs },
|
|
1226
1114
|
...definition.completionCooldownMs === void 0 ? {} : { completionCooldownMs: definition.completionCooldownMs },
|
|
1227
|
-
...stations ? {
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1115
|
+
...stations ? {
|
|
1116
|
+
stations: parseField(
|
|
1117
|
+
"stations",
|
|
1118
|
+
() => questStationsSchema.parse(stations)
|
|
1119
|
+
)
|
|
1120
|
+
} : {},
|
|
1121
|
+
...gallery ? {
|
|
1122
|
+
gallery: parseField(
|
|
1123
|
+
"gallery",
|
|
1124
|
+
() => questGallerySchema.parse(gallery)
|
|
1125
|
+
)
|
|
1126
|
+
} : {}
|
|
1127
|
+
};
|
|
1128
|
+
validateQuestShape(
|
|
1129
|
+
{
|
|
1130
|
+
trigger: definition.trigger,
|
|
1131
|
+
completion: completion ?? { kind: "keyed" },
|
|
1132
|
+
requires: definition.requires ?? [],
|
|
1133
|
+
...shape2
|
|
1134
|
+
},
|
|
1135
|
+
{ template, authoring: true }
|
|
1246
1136
|
);
|
|
1247
|
-
if (
|
|
1137
|
+
if (definition.retryCooldownMs !== void 0 && !retryCooldownMsSchema.safeParse(definition.retryCooldownMs).success) {
|
|
1248
1138
|
throw new Error(
|
|
1249
|
-
|
|
1139
|
+
"retryCooldownMs must be whole milliseconds from 1000 (one second) to 604800000 (seven days)"
|
|
1250
1140
|
);
|
|
1251
1141
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1142
|
+
if (definition.completionCooldownMs !== void 0 && !retryCooldownMsSchema.safeParse(definition.completionCooldownMs).success) {
|
|
1143
|
+
throw new Error(
|
|
1144
|
+
"completionCooldownMs must be whole milliseconds from 1000 (one second) to 604800000 (seven days)"
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
if (performance) {
|
|
1148
|
+
const declared2 = triggerContentMetrics.get(definition.trigger) ?? [];
|
|
1149
|
+
const unknown = performance.metrics.filter(
|
|
1150
|
+
(metric) => !declared2.includes(metric)
|
|
1151
|
+
);
|
|
1152
|
+
if (unknown.length) {
|
|
1260
1153
|
throw new Error(
|
|
1261
|
-
`
|
|
1154
|
+
`The tracker's source does not measure ${unknown.join(", ")}`
|
|
1262
1155
|
);
|
|
1263
1156
|
}
|
|
1264
|
-
|
|
1157
|
+
}
|
|
1158
|
+
if (definition.trigger.kind === "manual" && definition.trigger.input !== "none" && !definition.evaluate) {
|
|
1159
|
+
throw new Error("Evidence quests require an evaluator");
|
|
1160
|
+
}
|
|
1161
|
+
const fields2 = Object.fromEntries(
|
|
1162
|
+
Object.entries(definition.settings.shape).map(([key2, schema]) => {
|
|
1163
|
+
const field = settingFieldSchema.safeParse(schema.meta());
|
|
1164
|
+
if (!field.success) {
|
|
1165
|
+
throw new Error(
|
|
1166
|
+
`Setting "${key2}" is not a quest setting: build it with a settings builder, such as settings.integer({ label, default, min, max })`
|
|
1167
|
+
);
|
|
1168
|
+
}
|
|
1169
|
+
if (field.data.kind === "text" && field.data.secret && field.data.default !== "") {
|
|
1170
|
+
throw new Error(
|
|
1171
|
+
`Secret setting "${key2}" must default to "": set its value in Console, not in source or deploy settings`
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
return [key2, field.data];
|
|
1175
|
+
})
|
|
1176
|
+
);
|
|
1177
|
+
for (const setting2 of whereSettings(
|
|
1178
|
+
definition.trigger.kind === "automatic" ? definition.trigger.tracker?.where : void 0
|
|
1179
|
+
)) {
|
|
1180
|
+
if (!isBoundSetting(fields2[setting2])) {
|
|
1265
1181
|
throw new Error(
|
|
1266
|
-
`
|
|
1182
|
+
`The tracker filter compares with setting "${setting2}", which is not an integer or amount setting`
|
|
1267
1183
|
);
|
|
1268
1184
|
}
|
|
1269
|
-
return [key2, field.data];
|
|
1270
|
-
})
|
|
1271
|
-
);
|
|
1272
|
-
for (const setting2 of whereSettings(
|
|
1273
|
-
definition.trigger.kind === "automatic" ? definition.trigger.tracker?.where : void 0
|
|
1274
|
-
)) {
|
|
1275
|
-
if (!isBoundSetting(fields[setting2])) {
|
|
1276
|
-
throw new Error(
|
|
1277
|
-
`The tracker filter compares with setting "${setting2}", which is not an integer or amount setting`
|
|
1278
|
-
);
|
|
1279
1185
|
}
|
|
1280
|
-
|
|
1186
|
+
return {
|
|
1187
|
+
integrationModules: integrationModules2,
|
|
1188
|
+
integrations: integrations2,
|
|
1189
|
+
trackerTrigger: trackerTrigger3,
|
|
1190
|
+
shape: shape2,
|
|
1191
|
+
fields: fields2
|
|
1192
|
+
};
|
|
1193
|
+
});
|
|
1281
1194
|
function describe(input) {
|
|
1282
1195
|
try {
|
|
1283
1196
|
return describeWith(input);
|
|
@@ -1286,7 +1199,6 @@ function questBuilder(template) {
|
|
|
1286
1199
|
}
|
|
1287
1200
|
}
|
|
1288
1201
|
function describeWith(input) {
|
|
1289
|
-
const { performance } = definition;
|
|
1290
1202
|
const settings2 = parseField(
|
|
1291
1203
|
"settings",
|
|
1292
1204
|
() => definition.settings.parse(input)
|
|
@@ -1304,39 +1216,7 @@ function questBuilder(template) {
|
|
|
1304
1216
|
(typeof definition.announcements === "function" ? definition.announcements({ settings: settings2 }) : definition.announcements) ?? []
|
|
1305
1217
|
)
|
|
1306
1218
|
);
|
|
1307
|
-
|
|
1308
|
-
for (const announcement of announcements) {
|
|
1309
|
-
const parsed = parseAnnouncementTemplate(announcement.text);
|
|
1310
|
-
const usesAuthor = "segments" in parsed && parsed.segments.some(
|
|
1311
|
-
(segment) => segment.kind === "placeholder" && segment.name === "author"
|
|
1312
|
-
);
|
|
1313
|
-
if (!trackerTrigger3 && usesAuthor) {
|
|
1314
|
-
throw new Error(
|
|
1315
|
-
"An announcement names {author} only on a quest with an automatic tracker trigger"
|
|
1316
|
-
);
|
|
1317
|
-
}
|
|
1318
|
-
if (!trackerTrigger3 && announcement.replyToTriggeringMessage) {
|
|
1319
|
-
throw new Error(
|
|
1320
|
-
"An announcement replies to the triggering message only on a quest with an automatic tracker trigger"
|
|
1321
|
-
);
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
const required = [
|
|
1325
|
-
...rewards.flatMap(
|
|
1326
|
-
(reward) => reward.kind === "integration" ? [reward.provider] : []
|
|
1327
|
-
),
|
|
1328
|
-
...announcements.flatMap(
|
|
1329
|
-
(announcement) => announcement.provider === "discord" ? ["discord"] : []
|
|
1330
|
-
),
|
|
1331
|
-
...Object.values(fields).flatMap(
|
|
1332
|
-
(field) => field.kind === "resource" && field.source.provider !== "domino" ? [field.source.provider] : []
|
|
1333
|
-
)
|
|
1334
|
-
];
|
|
1335
|
-
for (const provider of required) {
|
|
1336
|
-
if (!integrations.includes(provider)) {
|
|
1337
|
-
throw new Error(`Declare the ${provider} integration on this quest`);
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1219
|
+
refusing(name, () => checkProviders(rewards, announcements));
|
|
1340
1220
|
return questDescriptionSchema.parse({
|
|
1341
1221
|
quest: key,
|
|
1342
1222
|
evaluatorProtocol,
|
|
@@ -1348,15 +1228,6 @@ function questBuilder(template) {
|
|
|
1348
1228
|
...announcements.length ? { announcements } : {},
|
|
1349
1229
|
humanReview: definition.review?.({ settings: settings2 })?.enabled ?? true,
|
|
1350
1230
|
trigger: definition.trigger,
|
|
1351
|
-
...performance ? {
|
|
1352
|
-
performance: parseField(
|
|
1353
|
-
"performance",
|
|
1354
|
-
() => contentPerformancePolicySchema.parse({
|
|
1355
|
-
metrics: performance.metrics,
|
|
1356
|
-
maxAgeMs: performance.maxAgeMs
|
|
1357
|
-
})
|
|
1358
|
-
)
|
|
1359
|
-
} : {},
|
|
1360
1231
|
integrations,
|
|
1361
1232
|
// Written only when it holds a module `integrations` lacks, so a quest declaring known
|
|
1362
1233
|
// modules describes itself as SDKs before `integrationModules` did, and a Relay that
|
|
@@ -1374,16 +1245,46 @@ function questBuilder(template) {
|
|
|
1374
1245
|
budgets: (definition.budgets ?? []).filter(
|
|
1375
1246
|
(value) => value.scope !== "author"
|
|
1376
1247
|
),
|
|
1377
|
-
...author.length ? { authorBudgets: author } : {},
|
|
1378
1248
|
requires: definition.requires ?? [],
|
|
1379
1249
|
...definition.campaign ? { campaign: definition.campaign } : {},
|
|
1380
1250
|
...definition.availability ? { availability: definition.availability } : {},
|
|
1381
|
-
...
|
|
1382
|
-
...definition.completionCooldownMs === void 0 ? {} : { completionCooldownMs: definition.completionCooldownMs },
|
|
1383
|
-
...stations ? { stations } : {},
|
|
1384
|
-
...gallery ? { gallery } : {}
|
|
1251
|
+
...shape
|
|
1385
1252
|
});
|
|
1386
1253
|
}
|
|
1254
|
+
function checkProviders(rewards, announcements) {
|
|
1255
|
+
for (const announcement of announcements) {
|
|
1256
|
+
const parsed = parseAnnouncementTemplate(announcement.text);
|
|
1257
|
+
const usesAuthor = "segments" in parsed && parsed.segments.some(
|
|
1258
|
+
(segment) => segment.kind === "placeholder" && segment.name === "author"
|
|
1259
|
+
);
|
|
1260
|
+
if (!trackerTrigger2 && usesAuthor) {
|
|
1261
|
+
throw new Error(
|
|
1262
|
+
"An announcement names {author} only on a quest with an automatic tracker trigger"
|
|
1263
|
+
);
|
|
1264
|
+
}
|
|
1265
|
+
if (!trackerTrigger2 && announcement.replyToTriggeringMessage) {
|
|
1266
|
+
throw new Error(
|
|
1267
|
+
"An announcement replies to the triggering message only on a quest with an automatic tracker trigger"
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
const required = [
|
|
1272
|
+
...rewards.flatMap(
|
|
1273
|
+
(reward) => reward.kind === "integration" ? [reward.provider] : []
|
|
1274
|
+
),
|
|
1275
|
+
...announcements.flatMap(
|
|
1276
|
+
(announcement) => announcement.provider === "discord" ? ["discord"] : []
|
|
1277
|
+
),
|
|
1278
|
+
...Object.values(fields).flatMap(
|
|
1279
|
+
(field) => field.kind === "resource" && field.source.provider !== "domino" ? [field.source.provider] : []
|
|
1280
|
+
)
|
|
1281
|
+
];
|
|
1282
|
+
for (const provider of required) {
|
|
1283
|
+
if (!integrations.includes(provider)) {
|
|
1284
|
+
throw new Error(`Declare the ${provider} integration on this quest`);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1387
1288
|
return resourceHandle("quest", {
|
|
1388
1289
|
protocol: evaluatorProtocol,
|
|
1389
1290
|
key,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { b as AttemptStatus, _ as RewardType } from './accounts-
|
|
3
|
-
import { S as SkipEnrollment } from './tracker-data-
|
|
2
|
+
import { b as AttemptStatus, _ as RewardType } from './accounts-C9as33l1.js';
|
|
3
|
+
import { S as SkipEnrollment } from './tracker-data-Dwq9dWEm.js';
|
|
4
4
|
|
|
5
5
|
declare const collectionCodeSchema: z.ZodString;
|
|
6
6
|
declare const collectionPassSchema: z.ZodObject<{
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { SubmissionStore, RelayClientOptions, RelayClient } from './index.js';
|
|
2
|
-
export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, K as KeplrLike, S as SignInWallet, a as SolanaInjectedProvider, b as StandardWallet, c as StandardWalletAccount, d as cosmosChainList, e as cosmosSigner, f as discoverCosmosWallets, g as discoverEvmWallets, h as discoverSignInWallets, i as discoverSolanaWallets, j as evmSigner, s as solanaSigner, w as walletStandardSolanaSigner } from './wallet-browser-
|
|
3
|
-
export { E as EmailSignInOption, K as KnownStationCheckInRefusal, O as OAuthSignInOption, P as ProviderSignInOption, S as SignInClient, a as SignInIcon, b as SignInMethods, c as SignInOption, d as SignInOptions, e as SignInUnavailable, f as StationCheckInOptions, g as StationCheckInRefusal, h as StationCheckInState, i as StationCheckInStation, T as TelegramSignInOption, W as WalletSignInOption, j as checkInAtStation, s as signInOptions, t as telegramMiniAppInitData } from './station-check-in-
|
|
2
|
+
export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, K as KeplrLike, S as SignInWallet, a as SolanaInjectedProvider, b as StandardWallet, c as StandardWalletAccount, d as cosmosChainList, e as cosmosSigner, f as discoverCosmosWallets, g as discoverEvmWallets, h as discoverSignInWallets, i as discoverSolanaWallets, j as evmSigner, s as solanaSigner, w as walletStandardSolanaSigner } from './wallet-browser-Cucpqn3F.js';
|
|
3
|
+
export { E as EmailSignInOption, K as KnownStationCheckInRefusal, O as OAuthSignInOption, P as ProviderSignInOption, S as SignInClient, a as SignInIcon, b as SignInMethods, c as SignInOption, d as SignInOptions, e as SignInUnavailable, f as StationCheckInOptions, g as StationCheckInRefusal, h as StationCheckInState, i as StationCheckInStation, T as TelegramSignInOption, W as WalletSignInOption, j as checkInAtStation, s as signInOptions, t as telegramMiniAppInitData } from './station-check-in-a1deSjbm.js';
|
|
4
4
|
export { H as HostEnvironment, g as getHostEnvironment } from './host-environment-DUw5-Cvj.js';
|
|
5
5
|
import { MemberSummary } from './index.js';
|
|
6
|
-
import './accounts-
|
|
6
|
+
import './accounts-C9as33l1.js';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import './tracker-data-
|
|
9
|
-
import './wallet-
|
|
10
|
-
import './submission-input-
|
|
8
|
+
import './tracker-data-Dwq9dWEm.js';
|
|
9
|
+
import './wallet-CeqgtXNm.js';
|
|
10
|
+
import './submission-input-DBDLkTF8.js';
|
|
11
11
|
import './request-error-C24SY7n9.js';
|
|
12
|
-
import './reward-deliveries-
|
|
13
|
-
import './catalog-
|
|
12
|
+
import './reward-deliveries-zWfsgc6m.js';
|
|
13
|
+
import './catalog-9I6t18qP.js';
|
|
14
14
|
import './action-BDFKqGlH.js';
|
|
15
|
-
import './sign-in-providers-
|
|
15
|
+
import './sign-in-providers-BG22ZZkl.js';
|
|
16
16
|
import './profiles-CLDKZVFx.js';
|
|
17
17
|
|
|
18
18
|
/**
|
package/dist/browser.js
CHANGED
|
@@ -13,23 +13,23 @@ import {
|
|
|
13
13
|
signInOptions,
|
|
14
14
|
solanaSigner,
|
|
15
15
|
walletStandardSolanaSigner
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-724CKAC7.js";
|
|
17
17
|
import {
|
|
18
18
|
telegramMiniAppInitData
|
|
19
19
|
} from "./chunk-FWLQ5XCS.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-DNOLNMCW.js";
|
|
21
|
+
import "./chunk-E73HZCG2.js";
|
|
22
|
+
import "./chunk-AL5XMXPO.js";
|
|
23
23
|
import {
|
|
24
24
|
getHostEnvironment
|
|
25
25
|
} from "./chunk-MDSSIOBC.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-F66GGNKD.js";
|
|
27
|
+
import "./chunk-HCOLMJFX.js";
|
|
28
|
+
import "./chunk-KP55TMCC.js";
|
|
29
|
+
import "./chunk-CW7FJ5PX.js";
|
|
30
|
+
import "./chunk-KGZ7SRKJ.js";
|
|
31
|
+
import "./chunk-6TDHRGBM.js";
|
|
32
|
+
import "./chunk-2M5FM7FW.js";
|
|
33
33
|
export {
|
|
34
34
|
browserSubmissionStore,
|
|
35
35
|
checkInAtStation,
|