@domino-sdk/relay 1.67.0 → 1.69.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 +65 -0
- package/dist/{accounts-C2O8mpB8.d.ts → accounts-DD4gAOCe.d.ts} +232 -3
- package/dist/{action-9Xl0StBg.d.ts → action-BDFKqGlH.d.ts} +3 -2
- package/dist/{attempt-captures-ClHAoo_n.d.ts → attempt-captures-CbuCmthd.d.ts} +11 -2
- package/dist/authoring.d.ts +534 -48
- package/dist/authoring.js +192 -29
- package/dist/{automatic-outcomes-BEnPn4Uh.d.ts → automatic-outcomes-DE3vfi8g.d.ts} +11 -3
- package/dist/avatar.d.ts +2 -1
- package/dist/browser.d.ts +15 -13
- package/dist/browser.js +12 -13
- package/dist/{capability-error-CuI_F7yM.d.ts → capability-error-db7kO8-P.d.ts} +2 -1
- package/dist/{catalog-CbiftcxQ.d.ts → catalog-Cf3fHDNn.d.ts} +69 -3
- package/dist/{chunk-5DZNMLDM.js → chunk-2A3BJ262.js} +2 -2
- package/dist/{chunk-BQXRCJ3N.js → chunk-5RLIPTL7.js} +1 -1
- package/dist/{chunk-MVQQDPQX.js → chunk-AZDZEQFK.js} +14 -2
- package/dist/{chunk-JK3XV2CR.js → chunk-BRROI4CH.js} +50 -8
- package/dist/{chunk-P33ZAJMS.js → chunk-CQVKOD3B.js} +1266 -677
- package/dist/{chunk-QYC3CZVD.js → chunk-CZ23KRVK.js} +2 -2
- package/dist/{chunk-X3FMVRMM.js → chunk-DIXYVGXO.js} +1 -1
- package/dist/{chunk-RDUSFUXX.js → chunk-GEVARKEV.js} +9 -1
- package/dist/{chunk-2HHZV7U3.js → chunk-LDO5GP7G.js} +1 -1
- package/dist/{chunk-Z2Z5DBNW.js → chunk-LGGD7S5T.js} +45 -9
- package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
- package/dist/{chunk-NRMQVK2W.js → chunk-ME2KUAVJ.js} +1 -1
- package/dist/{chunk-KUNPCDN6.js → chunk-ODJGTFPY.js} +16 -9
- package/dist/{chunk-DSJ46QLB.js → chunk-PO2ZDY27.js} +1 -1
- package/dist/{chunk-RWR2LOPA.js → chunk-RKTMSTT7.js} +2 -2
- package/dist/{chunk-5SBA6X5X.js → chunk-SWLW4VN3.js} +2 -2
- package/dist/{chunk-BMJHFWVT.js → chunk-TCREFRPK.js} +10 -43
- package/dist/{chunk-Q5QVAF7R.js → chunk-UGM6DUB2.js} +42 -25
- package/dist/chunk-VAGGGB6B.js +87 -0
- package/dist/{chunk-FGXLXENM.js → chunk-VNEJH4NT.js} +47 -3
- package/dist/chunk-WNEQEDMU.js +427 -0
- package/dist/{chunk-Q6KTTVOI.js → chunk-WVK3G2J2.js} +1 -1
- package/dist/{client-CZPewB9h.d.ts → client-6eSYOl8h.d.ts} +159 -11
- package/dist/{dashboards-jGPM3AxF.d.ts → dashboards-DCOAXL54.d.ts} +6 -5
- package/dist/{deployments-BVFd7ddA.d.ts → deployments-BIfdCMd5.d.ts} +911 -309
- package/dist/{host-environment-FN4zg3hw.d.ts → host-environment-DUw5-Cvj.d.ts} +2 -1
- package/dist/{identity-integration-W1Vo3Ql9.d.ts → identity-integration-BlfOn8rc.d.ts} +3 -2
- package/dist/index.d.ts +16 -15
- package/dist/index.js +10 -10
- package/dist/internal.d.ts +155 -17
- package/dist/internal.js +266 -19
- package/dist/{limits-C4RzrOV4.d.ts → limits-Ctaeq23J.d.ts} +8 -2
- package/dist/{offers-BpYenB9i.d.ts → offers-COqHGbHm.d.ts} +4 -3
- package/dist/{participant-activity-DXRq4s6K.d.ts → participant-activity-BznrcePT.d.ts} +2 -1
- package/dist/{participant-rewards-BcWkBRn_.d.ts → participant-rewards-s5Gn23qb.d.ts} +23 -1
- package/dist/portal-proxy.d.ts +7 -4
- package/dist/portal-proxy.js +14 -18
- package/dist/profiles-CLDKZVFx.d.ts +370 -0
- package/dist/react/index.d.ts +71 -30
- package/dist/react/index.js +12 -13
- package/dist/{request-error-D_dUPLwo.d.ts → request-error-C24SY7n9.d.ts} +2 -1
- package/dist/{reward-deliveries-BOWpMytr.d.ts → reward-deliveries-DFhYGJdx.d.ts} +3 -2
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/HKAI5OQA.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +556 -180
- package/dist/schema.js +70 -8
- package/dist/server/index.d.ts +15 -14
- package/dist/server/index.js +2053 -893
- package/dist/{sign-in-providers-BRYVOSlG.d.ts → sign-in-providers-C97mRNbG.d.ts} +4 -3
- package/dist/solana.d.ts +287 -0
- package/dist/solana.js +699 -0
- package/dist/{streaks-0YuipsUQ.d.ts → streaks-MAqKHbHC.d.ts} +2 -1
- package/dist/{submission-input-C152xIdn.d.ts → submission-input-BD7nORuh.d.ts} +4 -3
- package/dist/{telegram-browser-657QqiQl.d.ts → telegram-browser-gRMgGs7B.d.ts} +8 -109
- package/dist/telegram.d.ts +14 -12
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +99 -18
- package/dist/testing.js +101 -11
- package/dist/{tracker-data-BqY-9Vu-.d.ts → tracker-data-DQgX3FIc.d.ts} +493 -1
- package/dist/{transport-CthYgZXK.d.ts → transport-BLU8jrhg.d.ts} +7340 -2134
- package/dist/vite.d.ts +2 -1
- package/dist/{wallet-Btng186v.d.ts → wallet-CPAjrW4k.d.ts} +339 -308
- package/dist/wallet-browser-BzPt_Qb5.d.ts +107 -0
- package/package.json +21 -3
- package/dist/chunk-UWUS4OOV.js +0 -59
- package/dist/chunk-UYVJZR33.js +0 -34
- package/dist/runtime/chunks/C2MGLQXC.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RelayErrorCode,
|
|
3
3
|
clientError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VNEJH4NT.js";
|
|
5
5
|
|
|
6
6
|
// src/identifier.ts
|
|
7
7
|
import * as z from "zod";
|
|
@@ -352,6 +352,10 @@ var telegramMessagesNamespace = "telegram-messages";
|
|
|
352
352
|
var youtubeShortsNamespace = "youtube-shorts";
|
|
353
353
|
var tiktokVideosNamespace = "tiktok-videos";
|
|
354
354
|
var walletBalancesNamespace = "wallet-balances";
|
|
355
|
+
var walletProgramActivityNamespace = "wallet-program-activity";
|
|
356
|
+
var walletNftsNamespace = "wallet-nfts";
|
|
357
|
+
var walletStakeNamespace = "wallet-stake";
|
|
358
|
+
var walletProgramAccountsNamespace = "wallet-program-accounts";
|
|
355
359
|
|
|
356
360
|
// src/telegram.ts
|
|
357
361
|
import * as z6 from "zod";
|
|
@@ -502,9 +506,65 @@ var limits = /* @__PURE__ */ (() => Object.freeze({
|
|
|
502
506
|
trackerPreview: Object.freeze({ pages: 3, posts: 100, days: 30 }),
|
|
503
507
|
walletsPerChain: 5,
|
|
504
508
|
walletEventLogs: 1e3,
|
|
505
|
-
walletTransactions: 1e3
|
|
509
|
+
walletTransactions: 1e3,
|
|
510
|
+
transactionFixtureSignatures: 20
|
|
506
511
|
}))();
|
|
507
512
|
|
|
513
|
+
// src/base58.ts
|
|
514
|
+
var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
515
|
+
function base58(bytes) {
|
|
516
|
+
let zeros = 0;
|
|
517
|
+
while (zeros < bytes.length && bytes[zeros] === 0) {
|
|
518
|
+
zeros++;
|
|
519
|
+
}
|
|
520
|
+
const digits = [];
|
|
521
|
+
for (let index = zeros; index < bytes.length; index++) {
|
|
522
|
+
let carry = bytes[index];
|
|
523
|
+
for (let digit = 0; digit < digits.length; digit++) {
|
|
524
|
+
carry += digits[digit] * 256;
|
|
525
|
+
digits[digit] = carry % 58;
|
|
526
|
+
carry = Math.floor(carry / 58);
|
|
527
|
+
}
|
|
528
|
+
while (carry > 0) {
|
|
529
|
+
digits.push(carry % 58);
|
|
530
|
+
carry = Math.floor(carry / 58);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
let result = "1".repeat(zeros);
|
|
534
|
+
for (let digit = digits.length - 1; digit >= 0; digit--) {
|
|
535
|
+
result += alphabet[digits[digit]];
|
|
536
|
+
}
|
|
537
|
+
return result;
|
|
538
|
+
}
|
|
539
|
+
function base58Bytes(value, length) {
|
|
540
|
+
if (value.length > Math.ceil(length * Math.log(256) / Math.log(58))) {
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
543
|
+
let zeros = 0;
|
|
544
|
+
while (zeros < value.length && value[zeros] === "1") {
|
|
545
|
+
zeros++;
|
|
546
|
+
}
|
|
547
|
+
const bytes = [];
|
|
548
|
+
for (let index = zeros; index < value.length; index++) {
|
|
549
|
+
let carry = alphabet.indexOf(value[index]);
|
|
550
|
+
if (carry < 0) {
|
|
551
|
+
return null;
|
|
552
|
+
}
|
|
553
|
+
for (let byte = 0; byte < bytes.length; byte++) {
|
|
554
|
+
carry += bytes[byte] * 58;
|
|
555
|
+
bytes[byte] = carry & 255;
|
|
556
|
+
carry >>= 8;
|
|
557
|
+
}
|
|
558
|
+
while (carry > 0) {
|
|
559
|
+
bytes.push(carry & 255);
|
|
560
|
+
carry >>= 8;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
const decoded = new Uint8Array(zeros + bytes.length);
|
|
564
|
+
decoded.set(bytes.reverse(), zeros);
|
|
565
|
+
return decoded.length === length && base58(decoded) === value ? decoded : null;
|
|
566
|
+
}
|
|
567
|
+
|
|
508
568
|
// src/wallet.ts
|
|
509
569
|
import * as z7 from "zod";
|
|
510
570
|
var solanaAddressSchema = /* @__PURE__ */ (() => z7.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/))();
|
|
@@ -593,6 +653,28 @@ var evmChainIdSchema = /* @__PURE__ */ (() => z7.custom(
|
|
|
593
653
|
(value) => typeof value === "string" && isEvmChainId(value),
|
|
594
654
|
'Use an EVM chain ID such as "eip155:8453"'
|
|
595
655
|
))();
|
|
656
|
+
var solanaMemoProgram = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
|
|
657
|
+
var solanaSignatureSchema = /* @__PURE__ */ (() => z7.string().min(64).max(88).refine((value) => base58Bytes(value, 64) !== null, {
|
|
658
|
+
message: "Use a Solana transaction signature: base58, 64 bytes"
|
|
659
|
+
}))();
|
|
660
|
+
var walletTransactionChallengeSchema = /* @__PURE__ */ (() => z7.object({
|
|
661
|
+
id: z7.string().min(1).max(200),
|
|
662
|
+
chain: walletChainSchema,
|
|
663
|
+
/** Canonical base58. The memo instruction lists this account, and it signs it. */
|
|
664
|
+
address: z7.string(),
|
|
665
|
+
/** The exact memo text, which names the project, the environment and a nonce. */
|
|
666
|
+
memo: z7.string().max(566),
|
|
667
|
+
/** The program the memo instruction calls: SPL Memo v2 (`solanaMemoProgram`). */
|
|
668
|
+
memoProgram: z7.string(),
|
|
669
|
+
/** Submit the transaction's signature before this time (epoch milliseconds). */
|
|
670
|
+
expiresAt: z7.number().int()
|
|
671
|
+
}))();
|
|
672
|
+
var walletTransactionProofSchema = /* @__PURE__ */ (() => z7.object({
|
|
673
|
+
chain: z7.literal("solana"),
|
|
674
|
+
address: solanaAddressSchema,
|
|
675
|
+
/** The transaction's signature (its first one, as explorers show it). */
|
|
676
|
+
signature: solanaSignatureSchema
|
|
677
|
+
}).strict())();
|
|
596
678
|
var linkedWalletSchema = /* @__PURE__ */ (() => z7.object({
|
|
597
679
|
chain: walletChainSchema,
|
|
598
680
|
network: cosmosNetworkSchema.nullable(),
|
|
@@ -603,6 +685,19 @@ var linkedWalletSchema = /* @__PURE__ */ (() => z7.object({
|
|
|
603
685
|
* Absent for a key's own signature.
|
|
604
686
|
*/
|
|
605
687
|
provedOn: evmChainIdSchema.optional(),
|
|
688
|
+
/**
|
|
689
|
+
* `"transaction"` when the wallet's latest proof was a transaction it executed (a Solana smart
|
|
690
|
+
* account, such as a Squads vault) rather than a signed message. Absent for a signed message.
|
|
691
|
+
*
|
|
692
|
+
* @experimental A minor release can change linking by transaction.
|
|
693
|
+
*/
|
|
694
|
+
provedBy: z7.string().optional(),
|
|
695
|
+
/**
|
|
696
|
+
* With `provedBy: "transaction"`: the signature of the Solana mainnet transaction that proved it.
|
|
697
|
+
*
|
|
698
|
+
* @experimental A minor release can change linking by transaction.
|
|
699
|
+
*/
|
|
700
|
+
proofTransaction: z7.string().optional(),
|
|
606
701
|
verifiedAt: z7.number().int().nonnegative(),
|
|
607
702
|
revision: z7.number().int().positive(),
|
|
608
703
|
/** True when this wallet can sign in: it was first used through wallet sign-in. Linking never enables sign-in. */
|
|
@@ -697,6 +792,30 @@ var walletBalanceSampleSchema = /* @__PURE__ */ (() => z7.object({
|
|
|
697
792
|
*/
|
|
698
793
|
block: z7.string()
|
|
699
794
|
}))();
|
|
795
|
+
var walletProgramActivitySchema = /* @__PURE__ */ (() => z7.object({
|
|
796
|
+
signature: z7.string(),
|
|
797
|
+
/** The transaction's slot, as a decimal integer string. */
|
|
798
|
+
slot: z7.string(),
|
|
799
|
+
/** The block time, in epoch milliseconds. */
|
|
800
|
+
timestamp: z7.number().int().nonnegative(),
|
|
801
|
+
/**
|
|
802
|
+
* Whether the wallet signed the transaction. Always true unless the tracker counts any signer
|
|
803
|
+
* (`signer: "any"`).
|
|
804
|
+
*/
|
|
805
|
+
signer: z7.boolean(),
|
|
806
|
+
/** The tracker's instruction, as the program's IDL spells it; null when the tracker names none. */
|
|
807
|
+
instruction: z7.string().nullable(),
|
|
808
|
+
/**
|
|
809
|
+
* How much of the tracker's mint the wallet moved, in or out, in base units as a decimal integer
|
|
810
|
+
* string; null when the tracker names no mint.
|
|
811
|
+
*/
|
|
812
|
+
amount: z7.string().nullable(),
|
|
813
|
+
/**
|
|
814
|
+
* The wallet's change of the tracker's mint in base units, negative when it spent: a decimal
|
|
815
|
+
* integer string; null when the tracker names no mint.
|
|
816
|
+
*/
|
|
817
|
+
delta: z7.string().nullable()
|
|
818
|
+
}))();
|
|
700
819
|
var nftCollectionPattern = /^(eip155:[1-9][0-9]{0,15})\/(erc721|erc1155):(0x[0-9a-fA-F]{40})(?:\/(0|[1-9][0-9]{0,77}))?$/;
|
|
701
820
|
var solanaNftCollectionPattern = /^(solana:[1-9A-HJ-NP-Za-km-z]{32})\/nft:(.*)$/;
|
|
702
821
|
var maxTokenId = 2n ** 256n - 1n;
|
|
@@ -730,7 +849,15 @@ var walletNftsSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
730
849
|
collection: z7.string(),
|
|
731
850
|
/** The collection's chain, canonical CAIP-2. */
|
|
732
851
|
chain: z7.string(),
|
|
852
|
+
/** `metaplex` for every Solana collection, token groups included: `kind` says which kind. */
|
|
733
853
|
standard: z7.enum(["erc721", "erc1155", "metaplex"]),
|
|
854
|
+
/**
|
|
855
|
+
* Solana only: the kind of collection read. `core` is a Metaplex Core collection,
|
|
856
|
+
* `token-metadata` a Metaplex Token Metadata collection NFT, and `token-group` a Token-2022
|
|
857
|
+
* token group, such as the Seeker Genesis Token's. Absent on EVM collections, and from Relay
|
|
858
|
+
* versions before it.
|
|
859
|
+
*/
|
|
860
|
+
kind: z7.string().optional(),
|
|
734
861
|
/** How many the wallets hold together: the sum over `wallets`. */
|
|
735
862
|
total: units,
|
|
736
863
|
wallets: z7.array(
|
|
@@ -741,6 +868,16 @@ var walletNftsSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
741
868
|
observedAt: z7.number().int().nonnegative()
|
|
742
869
|
}).strict()
|
|
743
870
|
))();
|
|
871
|
+
var walletNftSampleSchema = /* @__PURE__ */ (() => z7.object({
|
|
872
|
+
/** How many of the collection's NFTs the wallet held, as a decimal integer string. */
|
|
873
|
+
count: z7.string(),
|
|
874
|
+
/**
|
|
875
|
+
* Where the run read: the EVM block number every wallet of the run was read at, or on Solana the
|
|
876
|
+
* slot this wallet's answer reflects (at or after the run's pinned slot), as a decimal integer
|
|
877
|
+
* string.
|
|
878
|
+
*/
|
|
879
|
+
block: z7.string()
|
|
880
|
+
}))();
|
|
744
881
|
var integerType = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
|
|
745
882
|
var bytesType = /^bytes([1-9]|[12][0-9]|3[0-2])?$/;
|
|
746
883
|
function elementaryType(type) {
|
|
@@ -990,7 +1127,7 @@ var walletTransactionsSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
990
1127
|
),
|
|
991
1128
|
/**
|
|
992
1129
|
* The program's instructions in the transaction, top-level and inner, in call order,
|
|
993
|
-
* decoded with the program's
|
|
1130
|
+
* decoded with the program's IDL. Instructions the IDL does not describe are left
|
|
994
1131
|
* out. Absent when the program's setting has no IDL.
|
|
995
1132
|
*/
|
|
996
1133
|
instructions: z7.array(
|
|
@@ -1012,6 +1149,139 @@ var walletTransactionsSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
1012
1149
|
observedAt: z7.number().int().nonnegative()
|
|
1013
1150
|
}).strict()
|
|
1014
1151
|
))();
|
|
1152
|
+
var solanaTransactionFixtureInputSchema = /* @__PURE__ */ (() => z7.object({
|
|
1153
|
+
/** The cluster the transactions ran on; mainnet by default. */
|
|
1154
|
+
chain: z7.enum([solanaMainnet, solanaDevnet]).default(solanaMainnet),
|
|
1155
|
+
/** The program the quest reads, as its `settings.solanaProgram()` setting holds it. */
|
|
1156
|
+
program: solanaAddressSchema,
|
|
1157
|
+
/** Each signature once, at most {@link limits.transactionFixtureSignatures}. */
|
|
1158
|
+
signatures: z7.array(solanaSignatureSchema).min(1).max(limits.transactionFixtureSignatures).refine((list) => new Set(list).size === list.length, {
|
|
1159
|
+
message: "List each signature once"
|
|
1160
|
+
}),
|
|
1161
|
+
/** The wallet whose view the answer gives; the transactions' fee payer by default. */
|
|
1162
|
+
wallet: solanaAddressSchema.optional(),
|
|
1163
|
+
/**
|
|
1164
|
+
* The program's IDL, as a pasted one would be stored; without it, the IDL the program
|
|
1165
|
+
* publishes on chain, as saving its setting stores it.
|
|
1166
|
+
*/
|
|
1167
|
+
idl: anchorIdlSchema.optional()
|
|
1168
|
+
}).strict())();
|
|
1169
|
+
var seedInteger = /* @__PURE__ */ (() => z7.union([z7.number().finite(), z7.string().max(64)]))();
|
|
1170
|
+
var solanaSeedSchema = /* @__PURE__ */ (() => z7.union([
|
|
1171
|
+
z7.strictObject({ wallet: z7.literal(true) }),
|
|
1172
|
+
z7.string().max(200),
|
|
1173
|
+
z7.strictObject({ pubkey: z7.string().max(64) }),
|
|
1174
|
+
z7.strictObject({ u8: seedInteger }),
|
|
1175
|
+
z7.strictObject({ u16: seedInteger }),
|
|
1176
|
+
z7.strictObject({ u32: seedInteger }),
|
|
1177
|
+
z7.strictObject({ u64: seedInteger }),
|
|
1178
|
+
z7.strictObject({ u128: seedInteger }),
|
|
1179
|
+
z7.strictObject({ i8: seedInteger }),
|
|
1180
|
+
z7.strictObject({ i16: seedInteger }),
|
|
1181
|
+
z7.strictObject({ i32: seedInteger }),
|
|
1182
|
+
z7.strictObject({ i64: seedInteger }),
|
|
1183
|
+
z7.strictObject({ i128: seedInteger })
|
|
1184
|
+
]))();
|
|
1185
|
+
var maxSolanaSeeds = 15;
|
|
1186
|
+
var walletProgramAccountSchema = /* @__PURE__ */ (() => responseShape(
|
|
1187
|
+
z7.object({
|
|
1188
|
+
program: z7.string(),
|
|
1189
|
+
/** The CAIP-2 ID of the cluster read: Solana mainnet or devnet. */
|
|
1190
|
+
chain: z7.string(),
|
|
1191
|
+
/** The account type read, as the IDL names it. */
|
|
1192
|
+
account: z7.string(),
|
|
1193
|
+
wallets: z7.array(
|
|
1194
|
+
z7.object({
|
|
1195
|
+
/** The member's linked wallet. */
|
|
1196
|
+
address: z7.string(),
|
|
1197
|
+
/** The program-derived address its seeds give: the account read. */
|
|
1198
|
+
pda: z7.string(),
|
|
1199
|
+
/**
|
|
1200
|
+
* The account's fields by name, decoded with the IDL: integers up to 32 bits and floats as
|
|
1201
|
+
* numbers, wider integers as decimal strings, public keys in base58, `bytes` and arrays as
|
|
1202
|
+
* arrays, an absent option as null, and an enum as `{ Variant: fields }`. Null when no
|
|
1203
|
+
* account exists at `pda`.
|
|
1204
|
+
*/
|
|
1205
|
+
fields: z7.record(z7.string(), z7.json()).nullable()
|
|
1206
|
+
})
|
|
1207
|
+
),
|
|
1208
|
+
/** The slot every account was read at. */
|
|
1209
|
+
at: z7.object({
|
|
1210
|
+
kind: z7.string(),
|
|
1211
|
+
number: units
|
|
1212
|
+
}),
|
|
1213
|
+
observedAt: z7.number().int().nonnegative()
|
|
1214
|
+
})
|
|
1215
|
+
))();
|
|
1216
|
+
var stakeAmounts = {
|
|
1217
|
+
/** Delegated stake that is active: activated before the current epoch and not deactivating. */
|
|
1218
|
+
amount: units,
|
|
1219
|
+
/** Delegated stake that activates at the next epoch boundary. */
|
|
1220
|
+
activating: units,
|
|
1221
|
+
/** Stake deactivated this epoch, which stops earning at the next epoch boundary. */
|
|
1222
|
+
deactivating: units
|
|
1223
|
+
};
|
|
1224
|
+
var walletStakeSchema = /* @__PURE__ */ (() => responseShape(
|
|
1225
|
+
z7.object({
|
|
1226
|
+
/** The CAIP-2 ID of the cluster read: Solana mainnet or devnet. */
|
|
1227
|
+
chain: z7.string(),
|
|
1228
|
+
/** The vote account the read counted, or null for every validator. */
|
|
1229
|
+
voteAccount: z7.string().nullable(),
|
|
1230
|
+
/** The epoch the stake states are for. */
|
|
1231
|
+
epoch: z7.number().int().nonnegative(),
|
|
1232
|
+
/** Active stake, summed over `wallets`. */
|
|
1233
|
+
total: units,
|
|
1234
|
+
/** Activating stake, summed over `wallets`. */
|
|
1235
|
+
activating: units,
|
|
1236
|
+
/** Deactivating stake, summed over `wallets`. */
|
|
1237
|
+
deactivating: units,
|
|
1238
|
+
/**
|
|
1239
|
+
* Each wallet read, with the stake of the accounts it controls. An account two linked wallets
|
|
1240
|
+
* control counts once, for its withdrawer.
|
|
1241
|
+
*/
|
|
1242
|
+
wallets: z7.array(z7.object({ address: z7.string(), ...stakeAmounts })),
|
|
1243
|
+
/** The stake per vote account, summed over the wallets; none without stake in any state. */
|
|
1244
|
+
voteAccounts: z7.array(
|
|
1245
|
+
z7.object({ voteAccount: z7.string(), ...stakeAmounts })
|
|
1246
|
+
),
|
|
1247
|
+
/** The earliest slot the epoch and the stake accounts were read at. */
|
|
1248
|
+
at: z7.object({
|
|
1249
|
+
kind: z7.string(),
|
|
1250
|
+
number: units
|
|
1251
|
+
}),
|
|
1252
|
+
observedAt: z7.number().int().nonnegative()
|
|
1253
|
+
})
|
|
1254
|
+
))();
|
|
1255
|
+
var walletStakeSampleSchema = /* @__PURE__ */ (() => z7.object({
|
|
1256
|
+
/**
|
|
1257
|
+
* Active stake: delegated, activated before the sampled epoch and not deactivating, as a
|
|
1258
|
+
* decimal integer string.
|
|
1259
|
+
*/
|
|
1260
|
+
amount: z7.string(),
|
|
1261
|
+
/** Stake that activates at the next epoch boundary, as a decimal integer string. */
|
|
1262
|
+
activating: z7.string(),
|
|
1263
|
+
/** Stake deactivated this epoch, as a decimal integer string. */
|
|
1264
|
+
deactivating: z7.string(),
|
|
1265
|
+
/**
|
|
1266
|
+
* The slot this wallet's answer reflects, at or after the run's pinned slot, as a decimal
|
|
1267
|
+
* integer string.
|
|
1268
|
+
*/
|
|
1269
|
+
block: z7.string()
|
|
1270
|
+
}))();
|
|
1271
|
+
var walletProgramAccountSampleSchema = /* @__PURE__ */ (() => z7.object({
|
|
1272
|
+
/**
|
|
1273
|
+
* The field's value as a decimal integer string, or null when the wallet has no account at
|
|
1274
|
+
* `pda`: no position.
|
|
1275
|
+
*/
|
|
1276
|
+
amount: z7.string().nullable(),
|
|
1277
|
+
/** The program-derived address the tracker's seeds give for this wallet: the account read. */
|
|
1278
|
+
pda: z7.string(),
|
|
1279
|
+
/**
|
|
1280
|
+
* The slot this wallet's answer reflects, at or after the run's pinned slot, as a decimal
|
|
1281
|
+
* integer string.
|
|
1282
|
+
*/
|
|
1283
|
+
block: z7.string()
|
|
1284
|
+
}))();
|
|
1015
1285
|
|
|
1016
1286
|
// src/discord.ts
|
|
1017
1287
|
import * as z8 from "zod";
|
|
@@ -1495,26 +1765,26 @@ function matches(schema, value, at, budget) {
|
|
|
1495
1765
|
}
|
|
1496
1766
|
}
|
|
1497
1767
|
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
1498
|
-
const
|
|
1768
|
+
const object26 = value;
|
|
1499
1769
|
const properties = schema.properties ?? {};
|
|
1500
1770
|
const required = schema.required ?? [];
|
|
1501
1771
|
charge(budget, required.length);
|
|
1502
1772
|
for (const key of required) {
|
|
1503
|
-
if (!Object.hasOwn(
|
|
1773
|
+
if (!Object.hasOwn(object26, key)) {
|
|
1504
1774
|
return issue(() => `missing required key "${clip(key, maxKeyText)}"`);
|
|
1505
1775
|
}
|
|
1506
1776
|
}
|
|
1507
1777
|
const literals = literalsOf(schema);
|
|
1508
1778
|
charge(budget, literals.length);
|
|
1509
1779
|
for (const [key, property] of literals) {
|
|
1510
|
-
if (Object.hasOwn(
|
|
1780
|
+
if (Object.hasOwn(object26, key) && object26[key] !== property.const) {
|
|
1511
1781
|
return {
|
|
1512
1782
|
at: { parent: at, key },
|
|
1513
1783
|
reason: () => `expected ${JSON.stringify(property.const)}`
|
|
1514
1784
|
};
|
|
1515
1785
|
}
|
|
1516
1786
|
}
|
|
1517
|
-
const keys = Object.keys(
|
|
1787
|
+
const keys = Object.keys(object26);
|
|
1518
1788
|
charge(budget, keys.length);
|
|
1519
1789
|
const names = schema.propertyNames?.enum;
|
|
1520
1790
|
const allowed = names && setOf(schema.propertyNames, names);
|
|
@@ -1535,7 +1805,7 @@ function matches(schema, value, at, budget) {
|
|
|
1535
1805
|
if (property && property !== true) {
|
|
1536
1806
|
const found = matches(
|
|
1537
1807
|
property,
|
|
1538
|
-
|
|
1808
|
+
object26[key],
|
|
1539
1809
|
{ parent: at, key },
|
|
1540
1810
|
budget
|
|
1541
1811
|
);
|
|
@@ -1846,6 +2116,48 @@ var walletBalanceSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
|
1846
2116
|
),
|
|
1847
2117
|
token: z12.string().min(1).max(128).nullable()
|
|
1848
2118
|
}))();
|
|
2119
|
+
var solanaClusterSchema = /* @__PURE__ */ (() => z12.string().regex(
|
|
2120
|
+
/^solana:(?:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp|EtWTRABZaYq6iMfeYKouRu166VU2xqa1)$/,
|
|
2121
|
+
'Use "solana" or Solana devnet ("solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1")'
|
|
2122
|
+
))();
|
|
2123
|
+
var walletProgramActivitySourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2124
|
+
chain: solanaClusterSchema,
|
|
2125
|
+
program: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 program address"),
|
|
2126
|
+
instruction: z12.string().regex(
|
|
2127
|
+
/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,
|
|
2128
|
+
"Use the instruction's name as the program's IDL spells it"
|
|
2129
|
+
).nullable(),
|
|
2130
|
+
mint: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 SPL mint address").nullable(),
|
|
2131
|
+
minAmount: z12.string().regex(/^[1-9][0-9]{0,77}$/, "Use a positive whole number of base units").nullable(),
|
|
2132
|
+
anySigner: z12.boolean()
|
|
2133
|
+
}).refine(
|
|
2134
|
+
(activity) => activity.minAmount === null || activity.mint !== null,
|
|
2135
|
+
"minAmount needs a mint"
|
|
2136
|
+
))();
|
|
2137
|
+
var walletNftSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2138
|
+
collection: z12.string().max(200).refine(
|
|
2139
|
+
(value) => isNftCollection(value),
|
|
2140
|
+
"Use an NFT collection"
|
|
2141
|
+
)
|
|
2142
|
+
}))();
|
|
2143
|
+
var walletStakeSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2144
|
+
chain: solanaClusterSchema,
|
|
2145
|
+
voteAccount: z12.string().refine(
|
|
2146
|
+
(value) => base58Bytes(value, 32) !== null,
|
|
2147
|
+
"Use a base58 vote account address"
|
|
2148
|
+
).nullable()
|
|
2149
|
+
}))();
|
|
2150
|
+
var walletProgramAccountSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2151
|
+
chain: solanaClusterSchema,
|
|
2152
|
+
program: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 program address"),
|
|
2153
|
+
account: z12.string().min(1).max(128),
|
|
2154
|
+
seeds: z12.array(solanaSeedSchema).min(1).max(maxSolanaSeeds).refine(
|
|
2155
|
+
(seeds) => seeds.some((seed) => typeof seed === "object" && "wallet" in seed),
|
|
2156
|
+
"Place the member's wallet in the seeds with { wallet: true }"
|
|
2157
|
+
),
|
|
2158
|
+
field: z12.string().min(1).max(128),
|
|
2159
|
+
idl: solanaProgramIdlSchema.optional()
|
|
2160
|
+
}))();
|
|
1849
2161
|
var xSearchSourceSchema = /* @__PURE__ */ (() => z12.object({
|
|
1850
2162
|
kind: z12.literal("x-search"),
|
|
1851
2163
|
query: z12.string().trim().min(1).max(2e3)
|
|
@@ -1880,10 +2192,42 @@ var customSourceSchema = /* @__PURE__ */ (() => z12.object({
|
|
|
1880
2192
|
* The chain and token Relay samples, on `wallet.balances()`'s reserved namespace only.
|
|
1881
2193
|
* `wallet.balances()` sets it.
|
|
1882
2194
|
*/
|
|
1883
|
-
balance: walletBalanceSourceSchema.optional()
|
|
2195
|
+
balance: walletBalanceSourceSchema.optional(),
|
|
2196
|
+
/**
|
|
2197
|
+
* The program activity Relay records, on `wallet.programActivity()`'s reserved namespace only.
|
|
2198
|
+
* `wallet.programActivity()` sets it.
|
|
2199
|
+
*/
|
|
2200
|
+
activity: walletProgramActivitySourceSchema.optional(),
|
|
2201
|
+
/**
|
|
2202
|
+
* The NFT collection Relay samples, on `wallet.nfts()`'s reserved namespace only.
|
|
2203
|
+
* `wallet.nfts()` sets it.
|
|
2204
|
+
*/
|
|
2205
|
+
nfts: walletNftSourceSchema.optional(),
|
|
2206
|
+
/**
|
|
2207
|
+
* The cluster and vote account Relay samples stake for, on `wallet.stake()`'s reserved
|
|
2208
|
+
* namespace only. `wallet.stake()` sets it.
|
|
2209
|
+
*/
|
|
2210
|
+
stake: walletStakeSourceSchema.optional(),
|
|
2211
|
+
/**
|
|
2212
|
+
* The program account field Relay samples, on `wallet.programAccounts()`'s reserved namespace
|
|
2213
|
+
* only. `wallet.programAccounts()` sets it.
|
|
2214
|
+
*/
|
|
2215
|
+
programAccount: walletProgramAccountSourceSchema.optional()
|
|
1884
2216
|
}).strict().refine(
|
|
1885
2217
|
(source) => source.balance === void 0 || source.namespace === walletBalancesNamespace,
|
|
1886
2218
|
"Only wallet.balances() samples a balance"
|
|
2219
|
+
).refine(
|
|
2220
|
+
(source) => source.activity === void 0 || source.namespace === walletProgramActivityNamespace,
|
|
2221
|
+
"Only wallet.programActivity() records program activity"
|
|
2222
|
+
).refine(
|
|
2223
|
+
(source) => source.nfts === void 0 || source.namespace === walletNftsNamespace,
|
|
2224
|
+
"Only wallet.nfts() samples NFTs"
|
|
2225
|
+
).refine(
|
|
2226
|
+
(source) => source.stake === void 0 || source.namespace === walletStakeNamespace,
|
|
2227
|
+
"Only wallet.stake() samples stake"
|
|
2228
|
+
).refine(
|
|
2229
|
+
(source) => source.programAccount === void 0 || source.namespace === walletProgramAccountsNamespace,
|
|
2230
|
+
"Only wallet.programAccounts() samples program accounts"
|
|
1887
2231
|
).refine(
|
|
1888
2232
|
(source) => !source.content || source.data?.properties?.body?.type === "object" && (source.data.required ?? []).includes("body"),
|
|
1889
2233
|
"A content source's data schema has a required object body"
|
|
@@ -1948,7 +2292,22 @@ var knownTrackerSourceResponseSchema = /* @__PURE__ */ (() => z12.discriminatedU
|
|
|
1948
2292
|
z12.object(xSearchSourceSchema.shape),
|
|
1949
2293
|
z12.object({
|
|
1950
2294
|
...customSourceSchema.shape,
|
|
1951
|
-
identities: z12.array(openIdentityKindSchema).optional()
|
|
2295
|
+
identities: z12.array(openIdentityKindSchema).optional(),
|
|
2296
|
+
// A later Relay may add settings to program activity, NFT or stake samples.
|
|
2297
|
+
activity: z12.object(walletProgramActivitySourceSchema.shape).optional(),
|
|
2298
|
+
// Read as stored: a later Relay may sample collections this SDK does not parse.
|
|
2299
|
+
nfts: z12.object({ collection: z12.string() }).optional(),
|
|
2300
|
+
// Read as stored: a later Relay may sample clusters this SDK does not name.
|
|
2301
|
+
stake: z12.object({ chain: z12.string(), voteAccount: z12.string().nullable() }).optional(),
|
|
2302
|
+
// Read as stored: a later Relay may sample clusters, seeds or IDLs this SDK does not parse.
|
|
2303
|
+
programAccount: z12.object({
|
|
2304
|
+
chain: z12.string(),
|
|
2305
|
+
program: z12.string(),
|
|
2306
|
+
account: z12.string(),
|
|
2307
|
+
seeds: z12.array(z12.json()),
|
|
2308
|
+
field: z12.string(),
|
|
2309
|
+
idl: z12.object({ program: z12.string(), source: z12.string(), idl: z12.json() }).optional()
|
|
2310
|
+
}).optional()
|
|
1952
2311
|
}),
|
|
1953
2312
|
z12.object(discordMessagesSourceSchema.shape),
|
|
1954
2313
|
z12.object(discordReactionsSourceSchema.shape)
|
|
@@ -2082,6 +2441,30 @@ var managedTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.exte
|
|
|
2082
2441
|
(input) => input.query === void 0 !== (input.source === void 0),
|
|
2083
2442
|
"Name the source with source, or an X search with query, not both"
|
|
2084
2443
|
))();
|
|
2444
|
+
var walletProgramActivityTrackerSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2445
|
+
kind: z12.literal("wallet-program-activity"),
|
|
2446
|
+
...walletProgramActivitySourceSchema.shape
|
|
2447
|
+
}).refine(
|
|
2448
|
+
(activity) => activity.minAmount === null || activity.mint !== null,
|
|
2449
|
+
"minAmount needs a mint"
|
|
2450
|
+
))();
|
|
2451
|
+
var programActivityTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.omit({ query: true }).extend({ source: walletProgramActivityTrackerSourceSchema }))();
|
|
2452
|
+
var walletNftsTrackerSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2453
|
+
kind: z12.literal("wallet-nfts"),
|
|
2454
|
+
...walletNftSourceSchema.shape
|
|
2455
|
+
}))();
|
|
2456
|
+
var nftTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.omit({ query: true }).extend({ source: walletNftsTrackerSourceSchema }))();
|
|
2457
|
+
var walletStakeTrackerSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2458
|
+
kind: z12.literal("wallet-stake"),
|
|
2459
|
+
...walletStakeSourceSchema.shape
|
|
2460
|
+
}))();
|
|
2461
|
+
var stakeTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.omit({ query: true }).extend({ source: walletStakeTrackerSourceSchema }))();
|
|
2462
|
+
var walletProgramAccountsTrackerSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
|
|
2463
|
+
kind: z12.literal("wallet-program-accounts"),
|
|
2464
|
+
...walletProgramAccountSourceSchema.shape,
|
|
2465
|
+
idl: anchorIdlSchema.optional()
|
|
2466
|
+
}))();
|
|
2467
|
+
var programAccountTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.omit({ query: true }).extend({ source: walletProgramAccountsTrackerSourceSchema }))();
|
|
2085
2468
|
var trackerUpdateSchema = /* @__PURE__ */ (() => trackerPropertiesSchema.partial().extend({
|
|
2086
2469
|
source: managedTrackerSourceSchema.optional(),
|
|
2087
2470
|
actionId: identifier
|
|
@@ -2644,7 +3027,7 @@ var trackerTriggerModeSchema = /* @__PURE__ */ (() => z17.enum([
|
|
|
2644
3027
|
"data-changed"
|
|
2645
3028
|
]))();
|
|
2646
3029
|
function defaultTriggerMode(source, namespace) {
|
|
2647
|
-
return source === "custom" && namespace !== telegramMessagesNamespace && namespace !== telegramReactionsNamespace ? "new-observation" : "new-record";
|
|
3030
|
+
return source === "custom" && namespace !== telegramMessagesNamespace && namespace !== telegramReactionsNamespace && namespace !== walletProgramActivityNamespace ? "new-observation" : "new-record";
|
|
2648
3031
|
}
|
|
2649
3032
|
var trackerBoundSchema = /* @__PURE__ */ (() => z17.union([
|
|
2650
3033
|
z17.number().finite(),
|
|
@@ -3169,122 +3552,196 @@ var quizContentSchema = /* @__PURE__ */ (() => z24.array(
|
|
|
3169
3552
|
"Question IDs must be unique"
|
|
3170
3553
|
))();
|
|
3171
3554
|
|
|
3172
|
-
// src/
|
|
3555
|
+
// src/windows.ts
|
|
3173
3556
|
import * as z25 from "zod";
|
|
3174
|
-
var
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3557
|
+
var timestamp4 = /* @__PURE__ */ (() => z25.number().int().safe().nonnegative())();
|
|
3558
|
+
var endsAfterStart = (window) => window.from === void 0 || window.until === void 0 || window.until > window.from;
|
|
3559
|
+
var inWindow = (window, time) => (window.from === void 0 || time >= window.from) && (window.until === void 0 || time < window.until);
|
|
3560
|
+
|
|
3561
|
+
// src/solana-actions.ts
|
|
3562
|
+
import * as z26 from "zod";
|
|
3563
|
+
var maxSolanaActionReference = 64;
|
|
3564
|
+
var prefix = "domino:quest:";
|
|
3565
|
+
var referenceSchema = /* @__PURE__ */ (() => z26.string().min(1).max(maxSolanaActionReference).regex(/^[a-zA-Z0-9_-]+$/, "use letters, digits, _ or -"))();
|
|
3566
|
+
function solanaActionMemo(input) {
|
|
3567
|
+
const quest = identifier.parse(input.quest);
|
|
3568
|
+
return input.reference === void 0 ? prefix + quest : `${prefix}${quest}:${referenceSchema.parse(input.reference)}`;
|
|
3569
|
+
}
|
|
3570
|
+
function parseSolanaActionMemo(text) {
|
|
3571
|
+
if (!text.startsWith(prefix)) {
|
|
3572
|
+
return null;
|
|
3573
|
+
}
|
|
3574
|
+
const [quest, reference, ...rest] = text.slice(prefix.length).split(":");
|
|
3575
|
+
if (rest.length || !identifier.safeParse(quest).success || reference !== void 0 && !referenceSchema.safeParse(reference).success) {
|
|
3576
|
+
return null;
|
|
3577
|
+
}
|
|
3578
|
+
return { quest, reference: reference ?? null };
|
|
3579
|
+
}
|
|
3580
|
+
function takesSolanaTransaction(trigger) {
|
|
3581
|
+
return trigger.kind === "manual" && trigger.actor !== "staff" && trigger.input === "none";
|
|
3582
|
+
}
|
|
3583
|
+
var questStationSchema = /* @__PURE__ */ (() => z26.object({
|
|
3584
|
+
key: referenceSchema,
|
|
3585
|
+
label: z26.string().trim().min(1).max(120),
|
|
3586
|
+
opensAt: timestamp4.optional(),
|
|
3587
|
+
closesAt: timestamp4.optional()
|
|
3588
|
+
}).strict().refine(
|
|
3589
|
+
(station) => endsAfterStart({ from: station.opensAt, until: station.closesAt }),
|
|
3590
|
+
{ message: "A station must close after it opens", path: ["closesAt"] }
|
|
3591
|
+
))();
|
|
3592
|
+
var questStationsSchema = /* @__PURE__ */ (() => z26.array(questStationSchema).min(1).max(200).refine(
|
|
3593
|
+
(stations) => new Set(stations.map((station) => station.key)).size === stations.length,
|
|
3594
|
+
"Give each station its own key"
|
|
3595
|
+
))();
|
|
3596
|
+
function stationRefusal(stations, reference, blockTime) {
|
|
3597
|
+
const station = stations.find((station2) => station2.key === reference);
|
|
3598
|
+
if (!station) {
|
|
3599
|
+
return {
|
|
3600
|
+
code: "station-unknown",
|
|
3601
|
+
message: reference === null ? "This quest completes only from a transaction whose memo names one of its stations" : `The memo names station "${reference}", which this quest does not have`
|
|
3602
|
+
};
|
|
3603
|
+
}
|
|
3604
|
+
if (!inWindow({ from: station.opensAt, until: station.closesAt }, blockTime)) {
|
|
3605
|
+
return {
|
|
3606
|
+
code: "station-closed",
|
|
3607
|
+
message: `Station "${station.key}" was closed when the transaction landed`
|
|
3608
|
+
};
|
|
3609
|
+
}
|
|
3610
|
+
return null;
|
|
3611
|
+
}
|
|
3612
|
+
var solanaSignatureSchema2 = /* @__PURE__ */ (() => z26.string().min(64).max(88).regex(/^[1-9A-HJ-NP-Za-km-z]+$/, "use a base58 transaction signature"))();
|
|
3613
|
+
var solanaTransactionSubmissionSchema = /* @__PURE__ */ (() => z26.object({
|
|
3614
|
+
quest: identifier,
|
|
3615
|
+
signature: solanaSignatureSchema2,
|
|
3616
|
+
chain: z26.enum(["solana", solanaMainnet, solanaDevnet]).default(solanaMainnet).transform(
|
|
3617
|
+
(chain) => chain === "solana" ? solanaMainnet : chain
|
|
3618
|
+
)
|
|
3619
|
+
}).strict())();
|
|
3620
|
+
var attemptActionSchema = /* @__PURE__ */ (() => z26.object({
|
|
3621
|
+
kind: z26.string(),
|
|
3622
|
+
chain: z26.string(),
|
|
3623
|
+
signature: z26.string(),
|
|
3624
|
+
wallet: z26.string(),
|
|
3625
|
+
reference: z26.string().nullable()
|
|
3626
|
+
}))();
|
|
3627
|
+
|
|
3628
|
+
// src/resources.ts
|
|
3629
|
+
import * as z27 from "zod";
|
|
3630
|
+
var resourceSourceSchema = /* @__PURE__ */ (() => z27.union([
|
|
3631
|
+
z27.strictObject({
|
|
3632
|
+
provider: z27.literal("domino"),
|
|
3633
|
+
resource: z27.literal("point-ledger")
|
|
3178
3634
|
}),
|
|
3179
3635
|
discordResourceSourceSchema
|
|
3180
3636
|
]))();
|
|
3181
|
-
var resourceRequestSchema = /* @__PURE__ */ (() =>
|
|
3637
|
+
var resourceRequestSchema = /* @__PURE__ */ (() => z27.object({
|
|
3182
3638
|
source: resourceSourceSchema,
|
|
3183
|
-
query:
|
|
3184
|
-
cursor:
|
|
3185
|
-
ids:
|
|
3639
|
+
query: z27.string().max(100).optional(),
|
|
3640
|
+
cursor: z27.string().regex(/^\d{1,6}$/).optional(),
|
|
3641
|
+
ids: z27.array(z27.string().min(1).max(100)).max(50).optional()
|
|
3186
3642
|
}).strict())();
|
|
3187
|
-
var resourceOptionsSchema = /* @__PURE__ */ (() =>
|
|
3188
|
-
revision:
|
|
3189
|
-
options:
|
|
3190
|
-
|
|
3191
|
-
id:
|
|
3192
|
-
label:
|
|
3193
|
-
description:
|
|
3194
|
-
group:
|
|
3195
|
-
disabledReason:
|
|
3643
|
+
var resourceOptionsSchema = /* @__PURE__ */ (() => z27.object({
|
|
3644
|
+
revision: z27.number().int(),
|
|
3645
|
+
options: z27.array(
|
|
3646
|
+
z27.object({
|
|
3647
|
+
id: z27.string(),
|
|
3648
|
+
label: z27.string(),
|
|
3649
|
+
description: z27.string().optional(),
|
|
3650
|
+
group: z27.string().optional(),
|
|
3651
|
+
disabledReason: z27.string().optional()
|
|
3196
3652
|
})
|
|
3197
3653
|
),
|
|
3198
3654
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
3199
|
-
nextCursor:
|
|
3655
|
+
nextCursor: z27.string().nullable().default(null),
|
|
3200
3656
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
3201
|
-
cursor:
|
|
3657
|
+
cursor: z27.string().nullable()
|
|
3202
3658
|
}))();
|
|
3203
3659
|
|
|
3204
3660
|
// src/settings.ts
|
|
3205
|
-
import * as
|
|
3661
|
+
import * as z29 from "zod";
|
|
3206
3662
|
|
|
3207
3663
|
// src/setting-values.ts
|
|
3208
|
-
import * as
|
|
3664
|
+
import * as z28 from "zod";
|
|
3209
3665
|
var settingInstant = /* @__PURE__ */ (() => offsetDateTimeSchema().transform(
|
|
3210
3666
|
(value) => new Date(value).toISOString()
|
|
3211
3667
|
))();
|
|
3212
|
-
var settingResourceId = /* @__PURE__ */ (() =>
|
|
3213
|
-
|
|
3214
|
-
|
|
3668
|
+
var settingResourceId = /* @__PURE__ */ (() => z28.union([
|
|
3669
|
+
z28.literal(""),
|
|
3670
|
+
z28.string().regex(/^\S{1,200}$/)
|
|
3215
3671
|
]))();
|
|
3216
3672
|
|
|
3217
3673
|
// src/settings.ts
|
|
3218
|
-
var base = /* @__PURE__ */ (() => ({ label:
|
|
3219
|
-
var settingFieldSchema = /* @__PURE__ */ (() =>
|
|
3220
|
-
|
|
3674
|
+
var base = /* @__PURE__ */ (() => ({ label: z29.string().min(1), description: z29.string().optional() }))();
|
|
3675
|
+
var settingFieldSchema = /* @__PURE__ */ (() => z29.discriminatedUnion("kind", [
|
|
3676
|
+
z29.object({
|
|
3221
3677
|
...base,
|
|
3222
|
-
kind:
|
|
3223
|
-
default: identifier.or(
|
|
3678
|
+
kind: z29.literal("point-ledger"),
|
|
3679
|
+
default: identifier.or(z29.literal(""))
|
|
3224
3680
|
}).strict(),
|
|
3225
|
-
|
|
3226
|
-
|
|
3681
|
+
z29.object({ ...base, kind: z29.literal("datetime"), default: settingInstant }).strict(),
|
|
3682
|
+
z29.object({
|
|
3227
3683
|
...base,
|
|
3228
|
-
kind:
|
|
3684
|
+
kind: z29.literal("resource"),
|
|
3229
3685
|
default: settingResourceId,
|
|
3230
3686
|
source: resourceSourceSchema
|
|
3231
3687
|
}).strict(),
|
|
3232
|
-
|
|
3233
|
-
|
|
3688
|
+
z29.object({ ...base, kind: z29.literal("quiz"), default: quizContentSchema }).strict(),
|
|
3689
|
+
z29.object({
|
|
3234
3690
|
...base,
|
|
3235
|
-
kind:
|
|
3236
|
-
default:
|
|
3237
|
-
minLength:
|
|
3238
|
-
maxLength:
|
|
3239
|
-
multiline:
|
|
3691
|
+
kind: z29.literal("text"),
|
|
3692
|
+
default: z29.string(),
|
|
3693
|
+
minLength: z29.number().int().nonnegative(),
|
|
3694
|
+
maxLength: z29.number().int().positive(),
|
|
3695
|
+
multiline: z29.boolean(),
|
|
3240
3696
|
/**
|
|
3241
3697
|
* A list Console offers the value from, beside free text: `telegram-chat` lists the
|
|
3242
3698
|
* project's connected Telegram chats. Unknown pickers read as free text. Six pickers also
|
|
3243
3699
|
* constrain the value, at publication and when an operator edits it: `amount`, a
|
|
3244
3700
|
* non-negative integer in a token's base units (`settings.amount()`), `chain`, a chain
|
|
3245
3701
|
* `ctx.wallet.balance()` reads (`settings.chain()`), `nft`, an NFT collection
|
|
3246
|
-
* `ctx.wallet.nfts()` reads (`settings.nft()`), whose contract or Solana collection
|
|
3702
|
+
* `ctx.wallet.nfts()` reads (`settings.nft()`), whose contract or Solana collection
|
|
3247
3703
|
* Relay also checks on its chain, `contract-call`, a contract function `ctx.wallet.call()`
|
|
3248
3704
|
* reads (`settings.contractCall()`), whose chain Relay also checks, and `contract-event`, a
|
|
3249
3705
|
* contract event `ctx.wallet.events()` reads (`settings.contractEvent()`), whose chain and
|
|
3250
3706
|
* contract Relay also checks, and `solana-program`, a Solana program
|
|
3251
|
-
* `ctx.wallet.transactions()`
|
|
3707
|
+
* `ctx.wallet.transactions()` or `ctx.wallet.programAccount()` reads
|
|
3708
|
+
* (`settings.solanaProgram()`), which Relay also checks is
|
|
3252
3709
|
* an executable program.
|
|
3253
3710
|
*/
|
|
3254
|
-
picker:
|
|
3711
|
+
picker: z29.string().optional(),
|
|
3255
3712
|
/**
|
|
3256
3713
|
* On an `amount` setting, the token's decimals: Console shows and edits the value in whole
|
|
3257
3714
|
* tokens.
|
|
3258
3715
|
*/
|
|
3259
|
-
decimals:
|
|
3716
|
+
decimals: z29.number().int().min(0).max(255).optional(),
|
|
3260
3717
|
/**
|
|
3261
3718
|
* A value operators set in Console that never leaves Relay: management responses, the CLI
|
|
3262
3719
|
* and Console withhold it, and the quest's code reads it as usual. Its `default` is `""`.
|
|
3263
3720
|
*/
|
|
3264
|
-
secret:
|
|
3721
|
+
secret: z29.literal(true).optional()
|
|
3265
3722
|
}).strict(),
|
|
3266
|
-
|
|
3723
|
+
z29.object({
|
|
3267
3724
|
...base,
|
|
3268
|
-
kind:
|
|
3269
|
-
default:
|
|
3270
|
-
min:
|
|
3271
|
-
max:
|
|
3725
|
+
kind: z29.literal("integer"),
|
|
3726
|
+
default: z29.number().int(),
|
|
3727
|
+
min: z29.number().int(),
|
|
3728
|
+
max: z29.number().int()
|
|
3272
3729
|
}).strict(),
|
|
3273
|
-
|
|
3274
|
-
|
|
3730
|
+
z29.object({ ...base, kind: z29.literal("boolean"), default: z29.boolean() }).strict(),
|
|
3731
|
+
z29.object({
|
|
3275
3732
|
...base,
|
|
3276
|
-
kind:
|
|
3277
|
-
default:
|
|
3278
|
-
options:
|
|
3733
|
+
kind: z29.literal("choice"),
|
|
3734
|
+
default: z29.string(),
|
|
3735
|
+
options: z29.array(z29.string().min(1)).min(1)
|
|
3279
3736
|
}).strict()
|
|
3280
3737
|
]))();
|
|
3281
|
-
var settingsFieldsSchema = /* @__PURE__ */ (() =>
|
|
3282
|
-
|
|
3738
|
+
var settingsFieldsSchema = /* @__PURE__ */ (() => z29.record(
|
|
3739
|
+
z29.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
|
|
3283
3740
|
settingFieldSchema
|
|
3284
3741
|
))();
|
|
3285
|
-
var settingsValuesSchema = /* @__PURE__ */ (() =>
|
|
3286
|
-
|
|
3287
|
-
|
|
3742
|
+
var settingsValuesSchema = /* @__PURE__ */ (() => z29.record(
|
|
3743
|
+
z29.string(),
|
|
3744
|
+
z29.union([z29.string(), z29.number().finite(), z29.boolean(), quizContentSchema])
|
|
3288
3745
|
))();
|
|
3289
3746
|
function isAmount(value) {
|
|
3290
3747
|
return value.length <= 100 && /^(0|[1-9][0-9]*)$/.test(value);
|
|
@@ -3296,10 +3753,10 @@ function isBoundSetting(field) {
|
|
|
3296
3753
|
return field?.kind === "integer" || field?.kind === "text" && field.picker === "amount";
|
|
3297
3754
|
}
|
|
3298
3755
|
function textSettingSchema(field) {
|
|
3299
|
-
const text = field.secret ?
|
|
3756
|
+
const text = field.secret ? z29.string().max(field.maxLength).refine(
|
|
3300
3757
|
(value) => value === "" || value.length >= field.minLength,
|
|
3301
3758
|
`Use at least ${field.minLength} characters`
|
|
3302
|
-
) :
|
|
3759
|
+
) : z29.string().min(field.minLength).max(field.maxLength);
|
|
3303
3760
|
switch (field.picker) {
|
|
3304
3761
|
case "amount":
|
|
3305
3762
|
return text.refine(
|
|
@@ -3314,7 +3771,7 @@ function textSettingSchema(field) {
|
|
|
3314
3771
|
case "nft":
|
|
3315
3772
|
return text.refine(
|
|
3316
3773
|
isNftCollection,
|
|
3317
|
-
'Use an NFT collection such as "eip155:1/erc721:0x\u2026", "eip155:8453/erc1155:0x\u2026/1" for one ERC-1155 token ID, or "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection
|
|
3774
|
+
'Use an NFT collection such as "eip155:1/erc721:0x\u2026", "eip155:8453/erc1155:0x\u2026/1" for one ERC-1155 token ID, or "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection>" (mainnet; devnet is "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/nft:<collection>")'
|
|
3318
3775
|
);
|
|
3319
3776
|
case "contract-call":
|
|
3320
3777
|
return text.refine(
|
|
@@ -3355,17 +3812,17 @@ function parseSettings(fields2, input) {
|
|
|
3355
3812
|
shape[key] = textSettingSchema(field).default(field.default);
|
|
3356
3813
|
break;
|
|
3357
3814
|
case "integer":
|
|
3358
|
-
shape[key] =
|
|
3815
|
+
shape[key] = z29.number().int().min(field.min).max(field.max).default(field.default);
|
|
3359
3816
|
break;
|
|
3360
3817
|
case "boolean":
|
|
3361
|
-
shape[key] =
|
|
3818
|
+
shape[key] = z29.boolean().default(field.default);
|
|
3362
3819
|
break;
|
|
3363
3820
|
case "choice":
|
|
3364
|
-
shape[key] =
|
|
3821
|
+
shape[key] = z29.enum(field.options).default(field.default);
|
|
3365
3822
|
break;
|
|
3366
3823
|
}
|
|
3367
3824
|
}
|
|
3368
|
-
return settingsValuesSchema.parse(
|
|
3825
|
+
return settingsValuesSchema.parse(z29.object(shape).strict().parse(input));
|
|
3369
3826
|
}
|
|
3370
3827
|
function missingResourceSettings(fields2, values2) {
|
|
3371
3828
|
return Object.entries(fields2).filter(
|
|
@@ -3386,21 +3843,20 @@ function authoringKey(input) {
|
|
|
3386
3843
|
}
|
|
3387
3844
|
|
|
3388
3845
|
// src/campaigns.ts
|
|
3389
|
-
import * as
|
|
3390
|
-
var
|
|
3391
|
-
var availabilityWindowSchema = /* @__PURE__ */ (() => z28.object({ from: timestamp4, until: timestamp4 }).strict().refine((window) => window.until > window.from, {
|
|
3846
|
+
import * as z30 from "zod";
|
|
3847
|
+
var availabilityWindowSchema = /* @__PURE__ */ (() => z30.object({ from: timestamp4, until: timestamp4 }).strict().refine(endsAfterStart, {
|
|
3392
3848
|
message: "Window end must follow its start",
|
|
3393
3849
|
path: ["until"]
|
|
3394
3850
|
}))();
|
|
3395
|
-
var campaignDefinitionSchema = /* @__PURE__ */ (() =>
|
|
3851
|
+
var campaignDefinitionSchema = /* @__PURE__ */ (() => z30.object({
|
|
3396
3852
|
key: identifier,
|
|
3397
|
-
title:
|
|
3853
|
+
title: z30.string().trim().min(1).max(120),
|
|
3398
3854
|
window: availabilityWindowSchema.optional(),
|
|
3399
|
-
enrollment:
|
|
3855
|
+
enrollment: z30.enum(["none", "required"]).default("none")
|
|
3400
3856
|
}).strict())();
|
|
3401
3857
|
var campaignAuthoringSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.omit({ key: true, title: true }).extend({
|
|
3402
3858
|
...authoringIdentityShape,
|
|
3403
|
-
title:
|
|
3859
|
+
title: z30.string().trim().min(1).max(120).optional()
|
|
3404
3860
|
}).strict().transform((value) => {
|
|
3405
3861
|
const normalized = value;
|
|
3406
3862
|
return campaignDefinitionSchema.parse({
|
|
@@ -3414,42 +3870,42 @@ function defineCampaign(input) {
|
|
|
3414
3870
|
var campaignViewSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.extend({
|
|
3415
3871
|
enrolledAt: timestamp4.nullable(),
|
|
3416
3872
|
withdrawnAt: timestamp4.nullable().default(null),
|
|
3417
|
-
withdrawalReason:
|
|
3873
|
+
withdrawalReason: z30.string().nullable().default(null)
|
|
3418
3874
|
}))();
|
|
3419
|
-
var campaignEnrollmentInputSchema = /* @__PURE__ */ (() =>
|
|
3875
|
+
var campaignEnrollmentInputSchema = /* @__PURE__ */ (() => z30.object({ actionId: identifier, campaign: identifier }).strict())();
|
|
3420
3876
|
var memberCampaignEnrollmentInputSchema = /* @__PURE__ */ (() => campaignEnrollmentInputSchema.extend({ member: identifier }))();
|
|
3421
3877
|
var campaignWithdrawalInputSchema = campaignEnrollmentInputSchema;
|
|
3422
3878
|
var memberCampaignWithdrawalInputSchema = /* @__PURE__ */ (() => campaignWithdrawalInputSchema.extend({
|
|
3423
3879
|
member: identifier,
|
|
3424
|
-
reason:
|
|
3880
|
+
reason: z30.string().trim().min(1).max(500)
|
|
3425
3881
|
}))();
|
|
3426
|
-
var campaignEnrollmentSchema = /* @__PURE__ */ (() =>
|
|
3882
|
+
var campaignEnrollmentSchema = /* @__PURE__ */ (() => z30.object({
|
|
3427
3883
|
campaign: identifier,
|
|
3428
3884
|
member: identifier,
|
|
3429
3885
|
enrolledAt: timestamp4,
|
|
3430
3886
|
withdrawnAt: timestamp4.nullable().default(null),
|
|
3431
|
-
withdrawalReason:
|
|
3887
|
+
withdrawalReason: z30.string().nullable().default(null)
|
|
3432
3888
|
}))();
|
|
3433
3889
|
|
|
3434
3890
|
// src/resource-handle.ts
|
|
3435
|
-
import * as
|
|
3891
|
+
import * as z31 from "zod";
|
|
3436
3892
|
function resourceHandle(_kind, definition) {
|
|
3437
3893
|
return definition;
|
|
3438
3894
|
}
|
|
3439
|
-
var ledgerSettingSchema = /* @__PURE__ */ (() => identifier.or(
|
|
3895
|
+
var ledgerSettingSchema = /* @__PURE__ */ (() => identifier.or(z31.literal("")).brand())();
|
|
3440
3896
|
function ledgerKey(ledger) {
|
|
3441
3897
|
return typeof ledger === "string" ? ledger : ledger.key;
|
|
3442
3898
|
}
|
|
3443
3899
|
|
|
3444
3900
|
// src/groups.ts
|
|
3445
|
-
import * as
|
|
3446
|
-
var projectGroupSchema = /* @__PURE__ */ (() =>
|
|
3901
|
+
import * as z32 from "zod";
|
|
3902
|
+
var projectGroupSchema = /* @__PURE__ */ (() => z32.object({
|
|
3447
3903
|
key: identifier,
|
|
3448
|
-
title:
|
|
3904
|
+
title: z32.string().trim().min(1).max(120)
|
|
3449
3905
|
}).strict())();
|
|
3450
3906
|
var projectGroupAuthoringSchema = /* @__PURE__ */ (() => projectGroupSchema.omit({ key: true, title: true }).extend({
|
|
3451
3907
|
...authoringIdentityShape,
|
|
3452
|
-
title:
|
|
3908
|
+
title: z32.string().trim().min(1).max(120).optional()
|
|
3453
3909
|
}).strict().transform((value) => {
|
|
3454
3910
|
return projectGroupSchema.parse({
|
|
3455
3911
|
...value,
|
|
@@ -3462,93 +3918,93 @@ function defineGroup(input) {
|
|
|
3462
3918
|
function projectGroupKey(group) {
|
|
3463
3919
|
return identifier.parse(group.key);
|
|
3464
3920
|
}
|
|
3465
|
-
var groupTitle = /* @__PURE__ */ (() =>
|
|
3466
|
-
var reason = /* @__PURE__ */ (() =>
|
|
3467
|
-
var timestamp5 = /* @__PURE__ */ (() =>
|
|
3468
|
-
var createGroupSchema = /* @__PURE__ */ (() =>
|
|
3469
|
-
var updateGroupSchema = /* @__PURE__ */ (() =>
|
|
3470
|
-
var addGroupMemberSchema = /* @__PURE__ */ (() =>
|
|
3471
|
-
var removeGroupMemberSchema = /* @__PURE__ */ (() =>
|
|
3472
|
-
var groupArchiveInputSchema = /* @__PURE__ */ (() =>
|
|
3473
|
-
var groupPageQuerySchema = /* @__PURE__ */ (() =>
|
|
3921
|
+
var groupTitle = /* @__PURE__ */ (() => z32.string().trim().min(1).max(120))();
|
|
3922
|
+
var reason = /* @__PURE__ */ (() => z32.string().trim().min(1).max(1e3))();
|
|
3923
|
+
var timestamp5 = /* @__PURE__ */ (() => z32.number().int().nonnegative().max(864e13))();
|
|
3924
|
+
var createGroupSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, key: identifier, title: groupTitle }).strict())();
|
|
3925
|
+
var updateGroupSchema = /* @__PURE__ */ (() => z32.object({ title: groupTitle }).strict())();
|
|
3926
|
+
var addGroupMemberSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, member: identifier, reason }).strict())();
|
|
3927
|
+
var removeGroupMemberSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, reason }).strict())();
|
|
3928
|
+
var groupArchiveInputSchema = /* @__PURE__ */ (() => z32.object({ reason: lifecycleReasonSchema.optional() }).strict())();
|
|
3929
|
+
var groupPageQuerySchema = /* @__PURE__ */ (() => z32.strictObject({
|
|
3474
3930
|
cursor: pageCursorSchema.optional(),
|
|
3475
3931
|
/** Items per page, 1–100; the default is 50. */
|
|
3476
|
-
limit:
|
|
3932
|
+
limit: z32.number().int().min(1).max(100).optional()
|
|
3477
3933
|
}))();
|
|
3478
|
-
var managedGroupSchema = /* @__PURE__ */ (() =>
|
|
3934
|
+
var managedGroupSchema = /* @__PURE__ */ (() => z32.object({
|
|
3479
3935
|
key: identifier,
|
|
3480
|
-
title:
|
|
3481
|
-
members:
|
|
3936
|
+
title: z32.string(),
|
|
3937
|
+
members: z32.number().int().nonnegative(),
|
|
3482
3938
|
createdAt: timestamp5,
|
|
3483
3939
|
archivedAt: timestamp5.nullable()
|
|
3484
3940
|
}))();
|
|
3485
|
-
var groupPageSchema = /* @__PURE__ */ (() =>
|
|
3486
|
-
items:
|
|
3941
|
+
var groupPageSchema = /* @__PURE__ */ (() => z32.object({
|
|
3942
|
+
items: z32.array(managedGroupSchema),
|
|
3487
3943
|
nextCursor: pageCursorSchema.nullable()
|
|
3488
3944
|
}))();
|
|
3489
|
-
var groupMemberSchema = /* @__PURE__ */ (() =>
|
|
3945
|
+
var groupMemberSchema = /* @__PURE__ */ (() => z32.object({
|
|
3490
3946
|
member: identifier,
|
|
3491
3947
|
addedAt: timestamp5.nullable()
|
|
3492
3948
|
}))();
|
|
3493
|
-
var groupMemberPageSchema = /* @__PURE__ */ (() =>
|
|
3494
|
-
items:
|
|
3949
|
+
var groupMemberPageSchema = /* @__PURE__ */ (() => z32.object({
|
|
3950
|
+
items: z32.array(groupMemberSchema),
|
|
3495
3951
|
nextCursor: pageCursorSchema.nullable()
|
|
3496
3952
|
}))();
|
|
3497
3953
|
|
|
3498
3954
|
// src/prerequisites.ts
|
|
3499
|
-
import * as
|
|
3500
|
-
var amount = /* @__PURE__ */ (() =>
|
|
3955
|
+
import * as z33 from "zod";
|
|
3956
|
+
var amount = /* @__PURE__ */ (() => z33.number().int().safe().nonnegative())();
|
|
3501
3957
|
var threshold = /* @__PURE__ */ (() => amount.positive())();
|
|
3502
|
-
var completionPrerequisiteSchema = /* @__PURE__ */ (() =>
|
|
3503
|
-
|
|
3504
|
-
kind:
|
|
3958
|
+
var completionPrerequisiteSchema = /* @__PURE__ */ (() => z33.discriminatedUnion("scope", [
|
|
3959
|
+
z33.object({
|
|
3960
|
+
kind: z33.literal("completion"),
|
|
3505
3961
|
quest: identifier,
|
|
3506
|
-
scope:
|
|
3962
|
+
scope: z33.literal("ever")
|
|
3507
3963
|
}).strict(),
|
|
3508
|
-
|
|
3509
|
-
kind:
|
|
3964
|
+
z33.object({
|
|
3965
|
+
kind: z33.literal("completion"),
|
|
3510
3966
|
quest: identifier,
|
|
3511
|
-
scope:
|
|
3967
|
+
scope: z33.literal("period"),
|
|
3512
3968
|
period: calendarPeriodSchema.exclude(["lifetime"])
|
|
3513
3969
|
}).strict()
|
|
3514
3970
|
]))();
|
|
3515
|
-
var balancePrerequisiteSchema = /* @__PURE__ */ (() =>
|
|
3516
|
-
kind:
|
|
3971
|
+
var balancePrerequisiteSchema = /* @__PURE__ */ (() => z33.object({
|
|
3972
|
+
kind: z33.literal("balance"),
|
|
3517
3973
|
balance: identifier,
|
|
3518
3974
|
minimum: threshold
|
|
3519
3975
|
}).strict())();
|
|
3520
|
-
var groupPrerequisiteSchema = /* @__PURE__ */ (() =>
|
|
3521
|
-
var prerequisiteSchema = /* @__PURE__ */ (() =>
|
|
3976
|
+
var groupPrerequisiteSchema = /* @__PURE__ */ (() => z33.object({ kind: z33.literal("group"), group: identifier, title: z33.string() }).strict())();
|
|
3977
|
+
var prerequisiteSchema = /* @__PURE__ */ (() => z33.discriminatedUnion("kind", [
|
|
3522
3978
|
completionPrerequisiteSchema,
|
|
3523
3979
|
balancePrerequisiteSchema,
|
|
3524
3980
|
groupPrerequisiteSchema
|
|
3525
3981
|
]))();
|
|
3526
|
-
var missingPrerequisiteSchema = /* @__PURE__ */ (() =>
|
|
3527
|
-
|
|
3528
|
-
kind:
|
|
3982
|
+
var missingPrerequisiteSchema = /* @__PURE__ */ (() => z33.union([
|
|
3983
|
+
z33.object({
|
|
3984
|
+
kind: z33.literal("completion"),
|
|
3529
3985
|
quest: identifier,
|
|
3530
|
-
title:
|
|
3531
|
-
scope:
|
|
3986
|
+
title: z33.string(),
|
|
3987
|
+
scope: z33.literal("ever")
|
|
3532
3988
|
}),
|
|
3533
|
-
|
|
3534
|
-
kind:
|
|
3989
|
+
z33.object({
|
|
3990
|
+
kind: z33.literal("completion"),
|
|
3535
3991
|
quest: identifier,
|
|
3536
|
-
title:
|
|
3537
|
-
scope:
|
|
3992
|
+
title: z33.string(),
|
|
3993
|
+
scope: z33.literal("period"),
|
|
3538
3994
|
period: calendarPeriodSchema.exclude(["lifetime"]),
|
|
3539
|
-
resetsAt:
|
|
3995
|
+
resetsAt: z33.number().int().safe()
|
|
3540
3996
|
}),
|
|
3541
|
-
|
|
3542
|
-
kind:
|
|
3997
|
+
z33.object({
|
|
3998
|
+
kind: z33.literal("balance"),
|
|
3543
3999
|
balance: identifier,
|
|
3544
|
-
title:
|
|
4000
|
+
title: z33.string(),
|
|
3545
4001
|
minimum: threshold,
|
|
3546
4002
|
current: amount
|
|
3547
4003
|
}),
|
|
3548
|
-
|
|
3549
|
-
kind:
|
|
4004
|
+
z33.object({
|
|
4005
|
+
kind: z33.literal("group"),
|
|
3550
4006
|
group: identifier,
|
|
3551
|
-
title:
|
|
4007
|
+
title: z33.string()
|
|
3552
4008
|
})
|
|
3553
4009
|
]))();
|
|
3554
4010
|
function completed(quest, options = {}) {
|
|
@@ -3579,29 +4035,29 @@ function inGroup(group) {
|
|
|
3579
4035
|
var maxPointsAmount = 2147483647;
|
|
3580
4036
|
|
|
3581
4037
|
// src/schema.ts
|
|
3582
|
-
import * as
|
|
3583
|
-
var pointsRewardSchema = /* @__PURE__ */ (() =>
|
|
3584
|
-
kind:
|
|
4038
|
+
import * as z34 from "zod";
|
|
4039
|
+
var pointsRewardSchema = /* @__PURE__ */ (() => z34.object({
|
|
4040
|
+
kind: z34.literal("points").default("points"),
|
|
3585
4041
|
balance: identifier,
|
|
3586
|
-
amount:
|
|
4042
|
+
amount: z34.number().int().min(0).max(maxPointsAmount)
|
|
3587
4043
|
}).strict())();
|
|
3588
|
-
var tieredRewardDefinitionSchema = /* @__PURE__ */ (() =>
|
|
4044
|
+
var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z34.object({
|
|
3589
4045
|
/** An automatic achievement backed by the project badge catalog. */
|
|
3590
4046
|
badge: identifier.optional(),
|
|
3591
4047
|
/** Membership in the project group with this key, added when the reward is delivered. */
|
|
3592
4048
|
group: identifier.optional(),
|
|
3593
4049
|
id: identifier,
|
|
3594
|
-
title:
|
|
3595
|
-
tiers:
|
|
3596
|
-
|
|
4050
|
+
title: z34.string().min(1).max(120),
|
|
4051
|
+
tiers: z34.array(
|
|
4052
|
+
z34.object({ id: identifier, title: z34.string().min(1).max(120) }).strict()
|
|
3597
4053
|
).min(1).max(20).refine(
|
|
3598
4054
|
(tiers) => new Set(tiers.map((t) => t.id)).size === tiers.length,
|
|
3599
4055
|
"Tier IDs must be unique"
|
|
3600
4056
|
),
|
|
3601
|
-
inventory:
|
|
3602
|
-
fulfillment:
|
|
3603
|
-
|
|
3604
|
-
|
|
4057
|
+
inventory: z34.object({ kind: z34.literal("untracked") }).strict(),
|
|
4058
|
+
fulfillment: z34.discriminatedUnion("kind", [
|
|
4059
|
+
z34.object({ kind: z34.literal("staff-handover") }).strict(),
|
|
4060
|
+
z34.object({ kind: z34.literal("automatic") }).strict()
|
|
3605
4061
|
])
|
|
3606
4062
|
}).strict().refine(
|
|
3607
4063
|
(value) => value.badge === void 0 && value.group === void 0 || value.fulfillment.kind === "automatic" && value.tiers.length === 1 && value.tiers[0].id === "awarded",
|
|
@@ -3610,12 +4066,12 @@ var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z32.object({
|
|
|
3610
4066
|
(value) => value.badge === void 0 || value.group === void 0,
|
|
3611
4067
|
"A reward is either a badge or a group membership"
|
|
3612
4068
|
))();
|
|
3613
|
-
var tieredRewardReferenceSchema = /* @__PURE__ */ (() =>
|
|
4069
|
+
var tieredRewardReferenceSchema = /* @__PURE__ */ (() => z34.object({
|
|
3614
4070
|
id: identifier,
|
|
3615
4071
|
key: identifier.nullable()
|
|
3616
4072
|
}))();
|
|
3617
|
-
var tierRewardSchema = /* @__PURE__ */ (() =>
|
|
3618
|
-
kind:
|
|
4073
|
+
var tierRewardSchema = /* @__PURE__ */ (() => z34.object({
|
|
4074
|
+
kind: z34.literal("tier"),
|
|
3619
4075
|
reward: tieredRewardDefinitionSchema,
|
|
3620
4076
|
tier: identifier
|
|
3621
4077
|
}).strict().refine(
|
|
@@ -3627,7 +4083,7 @@ var badgeRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
|
|
|
3627
4083
|
const badge = value.reward.badge;
|
|
3628
4084
|
if (!badge || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
|
|
3629
4085
|
context.addIssue({ code: "custom", message: "Invalid badge reward" });
|
|
3630
|
-
return
|
|
4086
|
+
return z34.NEVER;
|
|
3631
4087
|
}
|
|
3632
4088
|
return { ...value, reward: { ...value.reward, badge } };
|
|
3633
4089
|
}
|
|
@@ -3651,7 +4107,7 @@ var groupRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
|
|
|
3651
4107
|
const group = value.reward.group;
|
|
3652
4108
|
if (!group || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
|
|
3653
4109
|
context.addIssue({ code: "custom", message: "Invalid group reward" });
|
|
3654
|
-
return
|
|
4110
|
+
return z34.NEVER;
|
|
3655
4111
|
}
|
|
3656
4112
|
return { ...value, reward: { ...value.reward, group } };
|
|
3657
4113
|
}
|
|
@@ -3671,15 +4127,15 @@ function groupReward(key, title) {
|
|
|
3671
4127
|
});
|
|
3672
4128
|
}
|
|
3673
4129
|
var integrationRewardSchema = discordRewardSchema;
|
|
3674
|
-
var rewardSchema = /* @__PURE__ */ (() =>
|
|
4130
|
+
var rewardSchema = /* @__PURE__ */ (() => z34.union([
|
|
3675
4131
|
pointsRewardSchema,
|
|
3676
4132
|
tierRewardSchema,
|
|
3677
4133
|
integrationRewardSchema
|
|
3678
4134
|
]))();
|
|
3679
|
-
var rewardTypeSchema = /* @__PURE__ */ (() =>
|
|
3680
|
-
var rewardEntrySchema = /* @__PURE__ */ (() =>
|
|
4135
|
+
var rewardTypeSchema = /* @__PURE__ */ (() => z34.string())();
|
|
4136
|
+
var rewardEntrySchema = /* @__PURE__ */ (() => z34.object({
|
|
3681
4137
|
type: rewardTypeSchema,
|
|
3682
|
-
data:
|
|
4138
|
+
data: z34.record(z34.string(), z34.json())
|
|
3683
4139
|
}))();
|
|
3684
4140
|
function rewardKey(reward) {
|
|
3685
4141
|
if (reward.kind === "tier" && reward.reward.badge) {
|
|
@@ -3693,39 +4149,39 @@ function rewardKey(reward) {
|
|
|
3693
4149
|
}
|
|
3694
4150
|
return reward.kind === "points" ? "points:" + reward.balance : "tier:" + reward.reward.id;
|
|
3695
4151
|
}
|
|
3696
|
-
var triggerSchema = /* @__PURE__ */ (() =>
|
|
3697
|
-
|
|
3698
|
-
kind:
|
|
3699
|
-
input:
|
|
4152
|
+
var triggerSchema = /* @__PURE__ */ (() => z34.union([
|
|
4153
|
+
z34.object({
|
|
4154
|
+
kind: z34.literal("manual"),
|
|
4155
|
+
input: z34.literal("text"),
|
|
3700
4156
|
constraints: textOptionsSchema,
|
|
3701
|
-
actor:
|
|
4157
|
+
actor: z34.enum(["member", "staff"]).optional()
|
|
3702
4158
|
}).strict(),
|
|
3703
|
-
|
|
3704
|
-
kind:
|
|
3705
|
-
input:
|
|
4159
|
+
z34.object({
|
|
4160
|
+
kind: z34.literal("manual"),
|
|
4161
|
+
input: z34.literal("url"),
|
|
3706
4162
|
constraints: urlOptionsSchema,
|
|
3707
|
-
actor:
|
|
4163
|
+
actor: z34.enum(["member", "staff"]).optional()
|
|
3708
4164
|
}).strict(),
|
|
3709
|
-
|
|
3710
|
-
kind:
|
|
3711
|
-
input:
|
|
3712
|
-
actor:
|
|
4165
|
+
z34.object({
|
|
4166
|
+
kind: z34.literal("manual"),
|
|
4167
|
+
input: z34.enum(["photo", "quiz", "none"]),
|
|
4168
|
+
actor: z34.enum(["member", "staff"]).optional()
|
|
3713
4169
|
}).strict(),
|
|
3714
|
-
|
|
3715
|
-
kind:
|
|
4170
|
+
z34.object({
|
|
4171
|
+
kind: z34.literal("automatic"),
|
|
3716
4172
|
tracker: trackerTriggerPolicySchema.optional()
|
|
3717
4173
|
}).strict()
|
|
3718
4174
|
]))();
|
|
3719
|
-
var triggerResponseSchema = /* @__PURE__ */ (() =>
|
|
4175
|
+
var triggerResponseSchema = /* @__PURE__ */ (() => z34.union(
|
|
3720
4176
|
triggerSchema.options.map((option) => option.strip())
|
|
3721
4177
|
))();
|
|
3722
|
-
var photoResultSchema = /* @__PURE__ */ (() =>
|
|
3723
|
-
kind:
|
|
3724
|
-
reason:
|
|
4178
|
+
var photoResultSchema = /* @__PURE__ */ (() => z34.object({
|
|
4179
|
+
kind: z34.enum(["pass", "fail", "unclear"]),
|
|
4180
|
+
reason: z34.string().min(1).max(2e3)
|
|
3725
4181
|
}).strict())();
|
|
3726
|
-
var textReviewInputSchema = /* @__PURE__ */ (() =>
|
|
3727
|
-
text:
|
|
3728
|
-
criteria:
|
|
4182
|
+
var textReviewInputSchema = /* @__PURE__ */ (() => z34.object({
|
|
4183
|
+
text: z34.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
|
|
4184
|
+
criteria: z34.string().trim().min(1).max(2e3)
|
|
3729
4185
|
}).strict())();
|
|
3730
4186
|
var textResultSchema = photoResultSchema;
|
|
3731
4187
|
var deferPolicy = {
|
|
@@ -3739,31 +4195,31 @@ var retryCooldownPolicy = {
|
|
|
3739
4195
|
minMs: 1e3,
|
|
3740
4196
|
maxMs: 6048e5
|
|
3741
4197
|
};
|
|
3742
|
-
var retryCooldownMsSchema = /* @__PURE__ */ (() =>
|
|
3743
|
-
var evaluatorProgressSchema = /* @__PURE__ */ (() =>
|
|
3744
|
-
current:
|
|
3745
|
-
target:
|
|
3746
|
-
reason:
|
|
4198
|
+
var retryCooldownMsSchema = /* @__PURE__ */ (() => z34.number().int().min(limits.retryCooldown.minMs).max(limits.retryCooldown.maxMs))();
|
|
4199
|
+
var evaluatorProgressSchema = /* @__PURE__ */ (() => z34.object({
|
|
4200
|
+
current: z34.number().finite().nonnegative(),
|
|
4201
|
+
target: z34.number().finite().positive(),
|
|
4202
|
+
reason: z34.string().min(1).max(2e3)
|
|
3747
4203
|
}).refine((value) => value.current <= value.target, {
|
|
3748
4204
|
message: "Progress current must not exceed target"
|
|
3749
4205
|
}))();
|
|
3750
|
-
var decisionSchema = /* @__PURE__ */ (() =>
|
|
3751
|
-
|
|
3752
|
-
kind:
|
|
3753
|
-
reason:
|
|
3754
|
-
retryAfterMs:
|
|
4206
|
+
var decisionSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
|
|
4207
|
+
z34.strictObject({
|
|
4208
|
+
kind: z34.literal("defer"),
|
|
4209
|
+
reason: z34.string().min(1).max(2e3),
|
|
4210
|
+
retryAfterMs: z34.number().int().min(limits.defer.minRetryAfterMs).max(limits.defer.maxRetryAfterMs).optional(),
|
|
3755
4211
|
/** Absolute Unix milliseconds; the platform can only shorten its existing deadline. */
|
|
3756
|
-
until:
|
|
4212
|
+
until: z34.number().int().safe().nonnegative().optional()
|
|
3757
4213
|
}),
|
|
3758
|
-
evaluatorProgressSchema.safeExtend({ kind:
|
|
3759
|
-
|
|
3760
|
-
kind:
|
|
3761
|
-
rewards:
|
|
4214
|
+
evaluatorProgressSchema.safeExtend({ kind: z34.literal("progress") }).strict(),
|
|
4215
|
+
z34.object({
|
|
4216
|
+
kind: z34.literal("accept"),
|
|
4217
|
+
rewards: z34.array(rewardSchema).max(10),
|
|
3762
4218
|
completionKey: completionKeySchema.optional()
|
|
3763
4219
|
}).strict(),
|
|
3764
|
-
|
|
3765
|
-
kind:
|
|
3766
|
-
reason:
|
|
4220
|
+
z34.object({
|
|
4221
|
+
kind: z34.literal("reject"),
|
|
4222
|
+
reason: z34.string().min(1).max(2e3),
|
|
3767
4223
|
/**
|
|
3768
4224
|
* A stable key for the rejection's cause, such as `wrong-answers`, stored as the attempt's
|
|
3769
4225
|
* `code`: lowercase letters, digits and hyphens, at most 64 characters, and none of the
|
|
@@ -3771,28 +4227,28 @@ var decisionSchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
|
|
|
3771
4227
|
*/
|
|
3772
4228
|
code: rejectCodeSchema.optional(),
|
|
3773
4229
|
/** The evaluator asked for human review, but review is off for the quest, so this is a reject. */
|
|
3774
|
-
requestedReview:
|
|
4230
|
+
requestedReview: z34.literal(true).optional()
|
|
3775
4231
|
}).strict(),
|
|
3776
|
-
|
|
3777
|
-
kind:
|
|
3778
|
-
reason:
|
|
3779
|
-
rewards:
|
|
4232
|
+
z34.object({
|
|
4233
|
+
kind: z34.literal("review"),
|
|
4234
|
+
reason: z34.string().min(1).max(2e3),
|
|
4235
|
+
rewards: z34.array(rewardSchema).max(10).optional(),
|
|
3780
4236
|
completionKey: completionKeySchema.optional()
|
|
3781
4237
|
}).strict()
|
|
3782
4238
|
]))();
|
|
3783
|
-
var reviewModeSchema = /* @__PURE__ */ (() =>
|
|
3784
|
-
var storedReviewModeSchema = /* @__PURE__ */ (() =>
|
|
4239
|
+
var reviewModeSchema = /* @__PURE__ */ (() => z34.enum(["workers-ai"]))();
|
|
4240
|
+
var storedReviewModeSchema = /* @__PURE__ */ (() => z34.enum([
|
|
3785
4241
|
"fixture-pass",
|
|
3786
4242
|
"fixture-fail",
|
|
3787
4243
|
"fixture-unclear",
|
|
3788
4244
|
"fixture-error",
|
|
3789
4245
|
"workers-ai"
|
|
3790
4246
|
]))();
|
|
3791
|
-
var rewardBundleSchema = /* @__PURE__ */ (() =>
|
|
4247
|
+
var rewardBundleSchema = /* @__PURE__ */ (() => z34.array(rewardSchema).max(10).refine(
|
|
3792
4248
|
(rewards) => new Set(rewards.map(rewardKey)).size === rewards.length,
|
|
3793
4249
|
"Use one entry per balance or shared reward"
|
|
3794
4250
|
))();
|
|
3795
|
-
var mediaUrlSchema = /* @__PURE__ */ (() =>
|
|
4251
|
+
var mediaUrlSchema = /* @__PURE__ */ (() => z34.string().max(2e3).refine((value) => {
|
|
3796
4252
|
if (/^\/(?!\/)[^\\\s]*$/.test(value)) {
|
|
3797
4253
|
return true;
|
|
3798
4254
|
}
|
|
@@ -3802,78 +4258,78 @@ var mediaUrlSchema = /* @__PURE__ */ (() => z32.string().max(2e3).refine((value)
|
|
|
3802
4258
|
return false;
|
|
3803
4259
|
}
|
|
3804
4260
|
}, "Use an HTTPS URL or a same-site path beginning with /"))();
|
|
3805
|
-
var questStepActionSchema = /* @__PURE__ */ (() =>
|
|
3806
|
-
|
|
3807
|
-
kind:
|
|
4261
|
+
var questStepActionSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
|
|
4262
|
+
z34.object({
|
|
4263
|
+
kind: z34.literal("link"),
|
|
3808
4264
|
url: mediaUrlSchema.refine(
|
|
3809
4265
|
(value) => value.startsWith("https://"),
|
|
3810
4266
|
"Use an HTTPS URL"
|
|
3811
4267
|
),
|
|
3812
|
-
label:
|
|
4268
|
+
label: z34.string().trim().min(1).max(120)
|
|
3813
4269
|
}).strict()
|
|
3814
4270
|
]))();
|
|
3815
|
-
var questStepSchema = /* @__PURE__ */ (() =>
|
|
3816
|
-
title:
|
|
3817
|
-
description:
|
|
4271
|
+
var questStepSchema = /* @__PURE__ */ (() => z34.object({
|
|
4272
|
+
title: z34.string().trim().min(1).max(120),
|
|
4273
|
+
description: z34.string().max(4e3).optional(),
|
|
3818
4274
|
action: questStepActionSchema.optional()
|
|
3819
4275
|
}).strict())();
|
|
3820
|
-
var questPresentationRequirementSchema = /* @__PURE__ */ (() =>
|
|
3821
|
-
|
|
3822
|
-
|
|
4276
|
+
var questPresentationRequirementSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
|
|
4277
|
+
z34.object({ kind: z34.literal("account"), provider: authProviderSchema }).strict(),
|
|
4278
|
+
z34.object({ kind: z34.literal("wallet"), chain: walletChainSchema.optional() }).strict()
|
|
3823
4279
|
]))();
|
|
3824
|
-
var questPresentationContentSchema = /* @__PURE__ */ (() =>
|
|
3825
|
-
steps:
|
|
4280
|
+
var questPresentationContentSchema = /* @__PURE__ */ (() => z34.object({
|
|
4281
|
+
steps: z34.array(questStepSchema).max(30).optional(),
|
|
3826
4282
|
image: mediaUrlSchema.optional(),
|
|
3827
|
-
imageAlt:
|
|
3828
|
-
requirements:
|
|
4283
|
+
imageAlt: z34.string().max(500).optional(),
|
|
4284
|
+
requirements: z34.array(questPresentationRequirementSchema).max(10).optional()
|
|
3829
4285
|
}).strict())();
|
|
3830
4286
|
var questPresentationSchema = /* @__PURE__ */ (() => questPresentationContentSchema.extend({
|
|
3831
4287
|
quiz: quizQuestionsSchema.optional(),
|
|
3832
|
-
instructions:
|
|
3833
|
-
video:
|
|
4288
|
+
instructions: z34.string().max(4e3).optional(),
|
|
4289
|
+
video: z34.object({
|
|
3834
4290
|
url: mediaUrlSchema,
|
|
3835
4291
|
poster: mediaUrlSchema.optional(),
|
|
3836
|
-
captions:
|
|
4292
|
+
captions: z34.object({
|
|
3837
4293
|
url: mediaUrlSchema,
|
|
3838
|
-
language:
|
|
3839
|
-
label:
|
|
4294
|
+
language: z34.string().min(2).max(20),
|
|
4295
|
+
label: z34.string().min(1).max(80)
|
|
3840
4296
|
}).strict().optional()
|
|
3841
4297
|
}).strict().optional()
|
|
3842
4298
|
}).strict())();
|
|
3843
|
-
var questProfileSchema = /* @__PURE__ */ (() =>
|
|
4299
|
+
var questProfileSchema = /* @__PURE__ */ (() => z34.object({ visible: z34.boolean() }).strict())();
|
|
3844
4300
|
var evaluatorProtocol = 2;
|
|
3845
|
-
var evaluatorProtocolSchema = /* @__PURE__ */ (() =>
|
|
3846
|
-
var questDescriptionSchema = /* @__PURE__ */ (() =>
|
|
4301
|
+
var evaluatorProtocolSchema = /* @__PURE__ */ (() => z34.literal(evaluatorProtocol))();
|
|
4302
|
+
var questDescriptionSchema = /* @__PURE__ */ (() => z34.object({
|
|
3847
4303
|
quest: identifier,
|
|
3848
4304
|
evaluatorProtocol: evaluatorProtocolSchema,
|
|
3849
|
-
title:
|
|
4305
|
+
title: z34.string().min(1).max(120),
|
|
3850
4306
|
presentation: questPresentationSchema.default({}),
|
|
3851
4307
|
/** The declared modules this SDK knows. `integrationModules` lists every declared module. */
|
|
3852
|
-
integrations:
|
|
4308
|
+
integrations: z34.array(evaluatorIntegrationProviderSchema).max(10).default([]),
|
|
3853
4309
|
/**
|
|
3854
4310
|
* Every integration module the quest declares, including providers this SDK does not know: the
|
|
3855
4311
|
* open sibling of `integrations`. A description omits it when every module is in
|
|
3856
4312
|
* `integrations`, as descriptions from older SDKs do; Relay's reads always include it.
|
|
3857
4313
|
*/
|
|
3858
|
-
integrationModules:
|
|
4314
|
+
integrationModules: z34.array(integrationModuleProviderSchema).max(10).optional(),
|
|
3859
4315
|
fields: settingsFieldsSchema,
|
|
3860
4316
|
values: settingsValuesSchema,
|
|
3861
4317
|
rewards: rewardBundleSchema,
|
|
3862
4318
|
/** Messages Relay posts in connected chats and channels when a completion pays. */
|
|
3863
|
-
announcements:
|
|
3864
|
-
humanReview:
|
|
4319
|
+
announcements: z34.array(announcementSchema).max(3).optional(),
|
|
4320
|
+
humanReview: z34.boolean(),
|
|
3865
4321
|
trigger: triggerSchema,
|
|
3866
4322
|
performance: contentPerformancePolicySchema.optional(),
|
|
3867
|
-
requires:
|
|
4323
|
+
requires: z34.array(prerequisiteSchema).max(30).default([]),
|
|
3868
4324
|
campaign: campaignDefinitionSchema.optional(),
|
|
3869
4325
|
availability: availabilityWindowSchema.optional(),
|
|
3870
|
-
completion:
|
|
3871
|
-
visibility:
|
|
4326
|
+
completion: z34.preprocess(refuseStreakTimeZone, completionPolicySchema),
|
|
4327
|
+
visibility: z34.enum(["visible", "hidden"]).default("visible"),
|
|
3872
4328
|
/** Whether completions show on participant profiles (`/v1/profiles/:id/completions`). */
|
|
3873
4329
|
profile: questProfileSchema.default({ visible: false }),
|
|
3874
|
-
budgets:
|
|
4330
|
+
budgets: z34.array(budgetSchema).max(20).default([]),
|
|
3875
4331
|
/** Budgets counted per tracker record author; only on quests with a tracker trigger. */
|
|
3876
|
-
authorBudgets:
|
|
4332
|
+
authorBudgets: z34.array(authorBudgetSchema).max(20).optional(),
|
|
3877
4333
|
/**
|
|
3878
4334
|
* Milliseconds a member waits after an attempt is rejected (by the evaluator or a reviewer)
|
|
3879
4335
|
* before submitting this quest again. Only for quests members submit. Omitted: no cooldown.
|
|
@@ -3884,33 +4340,39 @@ var questDescriptionSchema = /* @__PURE__ */ (() => z32.object({
|
|
|
3884
4340
|
* submitting it again. Only for repeatable quests members submit; same bounds as
|
|
3885
4341
|
* `retryCooldownMs`. Omitted: no cooldown.
|
|
3886
4342
|
*/
|
|
3887
|
-
completionCooldownMs: retryCooldownMsSchema.optional()
|
|
4343
|
+
completionCooldownMs: retryCooldownMsSchema.optional(),
|
|
4344
|
+
/**
|
|
4345
|
+
* Check-in stations: a transaction completes the quest only when its memo's `reference` names
|
|
4346
|
+
* one, inside the station's window. Only on quests a signed Solana transaction completes.
|
|
4347
|
+
* Experimental.
|
|
4348
|
+
*/
|
|
4349
|
+
stations: questStationsSchema.optional()
|
|
3888
4350
|
}).strict())();
|
|
3889
|
-
var artifactSchema = /* @__PURE__ */ (() =>
|
|
4351
|
+
var artifactSchema = /* @__PURE__ */ (() => z34.object({ code: z34.string().min(1).max(1e6) }).strict())();
|
|
3890
4352
|
var releaseSchema = /* @__PURE__ */ (() => artifactSchema.extend({
|
|
3891
4353
|
/** The SDK runtime the code imports. Absent, the code bundles its own SDK. */
|
|
3892
4354
|
runtime: sdkRuntimeReferenceSchema.optional(),
|
|
3893
4355
|
settings: settingsValuesSchema,
|
|
3894
4356
|
provider: reviewModeSchema,
|
|
3895
4357
|
expectedRelease: identifier.nullable().optional(),
|
|
3896
|
-
settingRenames:
|
|
4358
|
+
settingRenames: z34.record(z34.string(), z34.string()).optional()
|
|
3897
4359
|
}).strict())();
|
|
3898
|
-
var batchReleaseSchema = /* @__PURE__ */ (() =>
|
|
3899
|
-
releases:
|
|
4360
|
+
var batchReleaseSchema = /* @__PURE__ */ (() => z34.object({
|
|
4361
|
+
releases: z34.array(releaseSchema).min(1).max(limits.quests)
|
|
3900
4362
|
}).strict())();
|
|
3901
|
-
var questSettingsInputSchema = /* @__PURE__ */ (() =>
|
|
4363
|
+
var questSettingsInputSchema = /* @__PURE__ */ (() => z34.object({
|
|
3902
4364
|
quest: identifier,
|
|
3903
4365
|
expectedRelease: identifier,
|
|
3904
4366
|
set: settingsValuesSchema,
|
|
3905
|
-
reset:
|
|
4367
|
+
reset: z34.array(z34.string()),
|
|
3906
4368
|
/** Replace the editable presentation fields; null restores the code defaults. */
|
|
3907
4369
|
presentation: questPresentationContentSchema.nullable().optional(),
|
|
3908
4370
|
/**
|
|
3909
|
-
* Anchor
|
|
4371
|
+
* IDLs (Anchor, Codama or Shank) to paste, by `settings.solanaProgram()` setting key, for programs that publish
|
|
3910
4372
|
* none on chain or to use another; null removes a pasted one. A pasted IDL takes precedence
|
|
3911
4373
|
* over one the program publishes on chain.
|
|
3912
4374
|
*/
|
|
3913
|
-
solanaIdls:
|
|
4375
|
+
solanaIdls: z34.record(z34.string(), anchorIdlSchema.nullable()).optional()
|
|
3914
4376
|
}).strict())();
|
|
3915
4377
|
var storedQuestDescriptionSchema = /* @__PURE__ */ (() => questDescriptionSchema.extend({
|
|
3916
4378
|
completion: completionPolicySchema
|
|
@@ -3921,42 +4383,42 @@ var publishedReleaseSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
3921
4383
|
* Every reward of the quest, kinds this SDK does not know included: the open sibling of
|
|
3922
4384
|
* `rewards`, which keeps SDK 1.x's closed `Reward`. Absent from older Relay versions.
|
|
3923
4385
|
*/
|
|
3924
|
-
rewardEntries:
|
|
4386
|
+
rewardEntries: z34.array(rewardEntrySchema).optional(),
|
|
3925
4387
|
key: identifier.optional(),
|
|
3926
|
-
code:
|
|
4388
|
+
code: z34.string(),
|
|
3927
4389
|
/** The SDK runtime `code` imports. Absent, the code bundles its own SDK. */
|
|
3928
4390
|
runtime: sdkRuntimeReferenceSchema.optional(),
|
|
3929
4391
|
provider: storedReviewModeSchema,
|
|
3930
4392
|
id: identifier,
|
|
3931
|
-
createdAt:
|
|
3932
|
-
origin:
|
|
3933
|
-
lifecycle:
|
|
3934
|
-
configuration:
|
|
4393
|
+
createdAt: z34.number(),
|
|
4394
|
+
origin: z34.object({ typeVersion: identifier }).strict().optional(),
|
|
4395
|
+
lifecycle: z34.enum(["active", "paused", "archived"]).default("active"),
|
|
4396
|
+
configuration: z34.object({
|
|
3935
4397
|
defaults: settingsValuesSchema,
|
|
3936
4398
|
overrides: settingsValuesSchema,
|
|
3937
|
-
preserved:
|
|
4399
|
+
preserved: z34.array(z34.string()),
|
|
3938
4400
|
presentation: questPresentationContentSchema.optional(),
|
|
3939
4401
|
presentationDefaults: questPresentationContentSchema.optional()
|
|
3940
4402
|
}).strict().optional(),
|
|
3941
4403
|
/**
|
|
3942
|
-
* The
|
|
4404
|
+
* The IDLs `ctx.wallet.transactions()` decodes instructions with, by
|
|
3943
4405
|
* `settings.solanaProgram()` setting key. Stored when the setting is saved; a setting without
|
|
3944
4406
|
* an IDL has no entry.
|
|
3945
4407
|
*/
|
|
3946
|
-
solanaIdls:
|
|
4408
|
+
solanaIdls: z34.record(z34.string(), solanaProgramIdlSchema).optional(),
|
|
3947
4409
|
/**
|
|
3948
4410
|
* The secret settings (`settings.text({ secret: true })`) that hold a value. Responses leave
|
|
3949
4411
|
* every secret setting out of `values` and `configuration`; one not listed here is empty.
|
|
3950
4412
|
* Absent when the release has no secret setting.
|
|
3951
4413
|
*/
|
|
3952
|
-
withheldSettings:
|
|
4414
|
+
withheldSettings: z34.array(z34.string()).optional()
|
|
3953
4415
|
})
|
|
3954
4416
|
))();
|
|
3955
|
-
var templateSchema = /* @__PURE__ */ (() =>
|
|
3956
|
-
code:
|
|
4417
|
+
var templateSchema = /* @__PURE__ */ (() => z34.object({
|
|
4418
|
+
code: z34.string(),
|
|
3957
4419
|
definition: questDescriptionSchema
|
|
3958
4420
|
}))();
|
|
3959
|
-
var quizAnswersSchema = /* @__PURE__ */ (() =>
|
|
4421
|
+
var quizAnswersSchema = /* @__PURE__ */ (() => z34.record(identifier, identifier).refine(
|
|
3960
4422
|
(answers) => Object.keys(answers).length > 0 && Object.keys(answers).length <= 50,
|
|
3961
4423
|
"Provide between 1 and 50 answers"
|
|
3962
4424
|
).transform(
|
|
@@ -3964,17 +4426,17 @@ var quizAnswersSchema = /* @__PURE__ */ (() => z32.record(identifier, identifier
|
|
|
3964
4426
|
Object.entries(answers).sort(([a], [b]) => a.localeCompare(b))
|
|
3965
4427
|
)
|
|
3966
4428
|
))();
|
|
3967
|
-
var quizEvidenceSchema = /* @__PURE__ */ (() =>
|
|
3968
|
-
kind:
|
|
4429
|
+
var quizEvidenceSchema = /* @__PURE__ */ (() => z34.object({
|
|
4430
|
+
kind: z34.literal("quiz"),
|
|
3969
4431
|
release: identifier.optional(),
|
|
3970
4432
|
answers: quizAnswersSchema
|
|
3971
4433
|
}).strict())();
|
|
3972
|
-
var submissionEvidenceSchema = /* @__PURE__ */ (() =>
|
|
4434
|
+
var submissionEvidenceSchema = /* @__PURE__ */ (() => z34.union([
|
|
3973
4435
|
quizEvidenceSchema,
|
|
3974
4436
|
textEvidenceSchema,
|
|
3975
4437
|
urlEvidenceSchema
|
|
3976
4438
|
]))();
|
|
3977
|
-
var submitSchema = /* @__PURE__ */ (() =>
|
|
4439
|
+
var submitSchema = /* @__PURE__ */ (() => z34.object({
|
|
3978
4440
|
actionId: identifier,
|
|
3979
4441
|
quest: identifier,
|
|
3980
4442
|
member: identifier,
|
|
@@ -3982,7 +4444,7 @@ var submitSchema = /* @__PURE__ */ (() => z32.object({
|
|
|
3982
4444
|
input: submissionEvidenceSchema.optional(),
|
|
3983
4445
|
release: identifier.optional(),
|
|
3984
4446
|
/** @deprecated Relay refuses a submission that sets it to `true` and ignores `false`. Removed in 2.0.0. */
|
|
3985
|
-
faultAfterReview:
|
|
4447
|
+
faultAfterReview: z34.boolean().optional()
|
|
3986
4448
|
}).strict())();
|
|
3987
4449
|
var AttemptStatus = {
|
|
3988
4450
|
Queued: "queued",
|
|
@@ -3994,13 +4456,13 @@ var AttemptStatus = {
|
|
|
3994
4456
|
NeedsReview: "needs-review",
|
|
3995
4457
|
Failed: "failed"
|
|
3996
4458
|
};
|
|
3997
|
-
var attemptStatusSchema = /* @__PURE__ */ (() =>
|
|
4459
|
+
var attemptStatusSchema = /* @__PURE__ */ (() => z34.string())();
|
|
3998
4460
|
var AttemptCodeSource = {
|
|
3999
4461
|
Relay: "relay",
|
|
4000
4462
|
Evaluator: "evaluator"
|
|
4001
4463
|
};
|
|
4002
|
-
var attemptCodeSourceSchema = /* @__PURE__ */ (() =>
|
|
4003
|
-
var attemptSchema = /* @__PURE__ */ (() =>
|
|
4464
|
+
var attemptCodeSourceSchema = /* @__PURE__ */ (() => z34.string())();
|
|
4465
|
+
var attemptSchema = /* @__PURE__ */ (() => z34.object({
|
|
4004
4466
|
id: identifier,
|
|
4005
4467
|
release: identifier,
|
|
4006
4468
|
quest: identifier,
|
|
@@ -4008,22 +4470,22 @@ var attemptSchema = /* @__PURE__ */ (() => z32.object({
|
|
|
4008
4470
|
evidence: identifier.nullable(),
|
|
4009
4471
|
input: submissionEvidenceSchema.optional(),
|
|
4010
4472
|
status: attemptStatusSchema,
|
|
4011
|
-
reason:
|
|
4012
|
-
retries:
|
|
4013
|
-
generation:
|
|
4014
|
-
completion:
|
|
4473
|
+
reason: z34.string().nullable(),
|
|
4474
|
+
retries: z34.number(),
|
|
4475
|
+
generation: z34.number(),
|
|
4476
|
+
completion: z34.string().nullable(),
|
|
4015
4477
|
reviewRewards: rewardBundleSchema.nullable().default(null),
|
|
4016
4478
|
/** Scheduled reruns advance this number; failure retries preserve it. */
|
|
4017
|
-
evaluationRun:
|
|
4018
|
-
deferCount:
|
|
4019
|
-
deferUntil:
|
|
4020
|
-
nextEvaluationAt:
|
|
4479
|
+
evaluationRun: z34.number().int().nonnegative().default(0),
|
|
4480
|
+
deferCount: z34.number().int().nonnegative().default(0),
|
|
4481
|
+
deferUntil: z34.number().int().safe().nullable().default(null),
|
|
4482
|
+
nextEvaluationAt: z34.number().int().safe().nullable().default(null),
|
|
4021
4483
|
/**
|
|
4022
4484
|
* Open code: consumers must tolerate new values. Relay writes its own codes, such as
|
|
4023
4485
|
* `budget-exhausted`; an attempt the evaluator rejected with `decision.reject({ reason, code })`
|
|
4024
4486
|
* carries the evaluator's code in management reads, and null in responses to members.
|
|
4025
4487
|
*/
|
|
4026
|
-
code:
|
|
4488
|
+
code: z34.string().nullable().default(null),
|
|
4027
4489
|
/**
|
|
4028
4490
|
* Who wrote `code`: `relay` or `evaluator` (an `AttemptCodeSource`), null when `code` is null.
|
|
4029
4491
|
* Open: consumers must tolerate new values. An evaluator can reject with a code Relay also writes,
|
|
@@ -4036,8 +4498,15 @@ var attemptSchema = /* @__PURE__ */ (() => z32.object({
|
|
|
4036
4498
|
* The evaluator asked for human review of a quest with review off, so Domino rejected the attempt
|
|
4037
4499
|
* with the evaluator's reason. Only set on a rejected attempt.
|
|
4038
4500
|
*/
|
|
4039
|
-
requestedReview:
|
|
4040
|
-
createdAt:
|
|
4501
|
+
requestedReview: z34.boolean().default(false),
|
|
4502
|
+
createdAt: z34.number(),
|
|
4503
|
+
/**
|
|
4504
|
+
* The action that started the attempt: the signed Solana transaction an app's server submitted
|
|
4505
|
+
* with `management.attempts.submitSolanaTransaction()`. Absent for any other attempt.
|
|
4506
|
+
*
|
|
4507
|
+
* @experimental A minor release can change quest actions.
|
|
4508
|
+
*/
|
|
4509
|
+
action: attemptActionSchema.nullable().optional()
|
|
4041
4510
|
}))();
|
|
4042
4511
|
var QuestSubmissionStatus = {
|
|
4043
4512
|
Open: "open",
|
|
@@ -4045,9 +4514,9 @@ var QuestSubmissionStatus = {
|
|
|
4045
4514
|
Discarded: "discarded",
|
|
4046
4515
|
Expired: "expired"
|
|
4047
4516
|
};
|
|
4048
|
-
var questSubmissionStatusSchema = /* @__PURE__ */ (() =>
|
|
4517
|
+
var questSubmissionStatusSchema = /* @__PURE__ */ (() => z34.string())();
|
|
4049
4518
|
var questSubmissionSchema = /* @__PURE__ */ (() => responseShape(
|
|
4050
|
-
|
|
4519
|
+
z34.object({
|
|
4051
4520
|
id: identifier,
|
|
4052
4521
|
quest: identifier,
|
|
4053
4522
|
member: identifier,
|
|
@@ -4057,85 +4526,85 @@ var questSubmissionSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
4057
4526
|
/** An uploaded photo's evidence ID. */
|
|
4058
4527
|
evidence: identifier.nullable(),
|
|
4059
4528
|
/** Submitting was refused because the quest changed: review the draft before submitting again. */
|
|
4060
|
-
reviewRequired:
|
|
4529
|
+
reviewRequired: z34.boolean(),
|
|
4061
4530
|
status: questSubmissionStatusSchema,
|
|
4062
4531
|
/** The attempt a `submitted` submission admitted. */
|
|
4063
4532
|
attempt: identifier.nullable(),
|
|
4064
|
-
createdAt:
|
|
4065
|
-
updatedAt:
|
|
4533
|
+
createdAt: z34.number(),
|
|
4534
|
+
updatedAt: z34.number(),
|
|
4066
4535
|
/** When an open submission expires unless it changes again. */
|
|
4067
|
-
expiresAt:
|
|
4536
|
+
expiresAt: z34.number()
|
|
4068
4537
|
})
|
|
4069
4538
|
))();
|
|
4070
|
-
var questSubmissionUpdateSchema = /* @__PURE__ */ (() =>
|
|
4539
|
+
var questSubmissionUpdateSchema = /* @__PURE__ */ (() => z34.object({
|
|
4071
4540
|
release: identifier.nullable().optional(),
|
|
4072
4541
|
input: submissionEvidenceSchema.nullable().optional(),
|
|
4073
4542
|
evidence: identifier.nullable().optional()
|
|
4074
4543
|
}).strict())();
|
|
4075
4544
|
var questSubmissionResultSchema = /* @__PURE__ */ (() => responseShape(
|
|
4076
|
-
|
|
4545
|
+
z34.object({
|
|
4077
4546
|
submission: questSubmissionSchema,
|
|
4078
4547
|
attempt: attemptSchema,
|
|
4079
|
-
replayed:
|
|
4548
|
+
replayed: z34.boolean()
|
|
4080
4549
|
})
|
|
4081
4550
|
))();
|
|
4082
|
-
var eventSchema = /* @__PURE__ */ (() =>
|
|
4083
|
-
id:
|
|
4084
|
-
attempt:
|
|
4085
|
-
kind:
|
|
4086
|
-
detail:
|
|
4087
|
-
actor:
|
|
4088
|
-
at:
|
|
4089
|
-
}))();
|
|
4090
|
-
var pickupSelectionSchema = /* @__PURE__ */ (() =>
|
|
4551
|
+
var eventSchema = /* @__PURE__ */ (() => z34.object({
|
|
4552
|
+
id: z34.number(),
|
|
4553
|
+
attempt: z34.string().nullable(),
|
|
4554
|
+
kind: z34.string(),
|
|
4555
|
+
detail: z34.string(),
|
|
4556
|
+
actor: z34.string().nullable().default(null),
|
|
4557
|
+
at: z34.number()
|
|
4558
|
+
}))();
|
|
4559
|
+
var pickupSelectionSchema = /* @__PURE__ */ (() => z34.object({
|
|
4091
4560
|
item: identifier,
|
|
4092
|
-
revision:
|
|
4561
|
+
revision: z34.number().int().nonnegative()
|
|
4093
4562
|
}).strict())();
|
|
4094
|
-
var pickupAllocationSchema = /* @__PURE__ */ (() =>
|
|
4563
|
+
var pickupAllocationSchema = /* @__PURE__ */ (() => z34.object({
|
|
4095
4564
|
item: identifier,
|
|
4096
|
-
label:
|
|
4565
|
+
label: z34.string().min(1).max(80)
|
|
4097
4566
|
}).strict())();
|
|
4098
|
-
var pickupPolicySchema = /* @__PURE__ */ (() =>
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
kind:
|
|
4102
|
-
tiers:
|
|
4103
|
-
|
|
4567
|
+
var pickupPolicySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
|
|
4568
|
+
z34.object({ kind: z34.literal("untracked") }).strict(),
|
|
4569
|
+
z34.object({
|
|
4570
|
+
kind: z34.literal("at-pickup"),
|
|
4571
|
+
tiers: z34.array(
|
|
4572
|
+
z34.object({
|
|
4104
4573
|
tier: identifier,
|
|
4105
|
-
variants:
|
|
4574
|
+
variants: z34.array(pickupAllocationSchema).min(1).max(100)
|
|
4106
4575
|
}).strict()
|
|
4107
4576
|
).min(1).max(100)
|
|
4108
4577
|
}).strict()
|
|
4109
4578
|
]))();
|
|
4110
|
-
var pickupCatalogSchema = /* @__PURE__ */ (() =>
|
|
4579
|
+
var pickupCatalogSchema = /* @__PURE__ */ (() => z34.object({
|
|
4111
4580
|
reward: tieredRewardDefinitionSchema,
|
|
4112
|
-
revision:
|
|
4581
|
+
revision: z34.number().int().nonnegative(),
|
|
4113
4582
|
policy: pickupPolicySchema
|
|
4114
4583
|
}))();
|
|
4115
|
-
var pickupAvailabilitySchema = /* @__PURE__ */ (() =>
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
kind:
|
|
4119
|
-
revision:
|
|
4120
|
-
variants:
|
|
4584
|
+
var pickupAvailabilitySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
|
|
4585
|
+
z34.object({ kind: z34.literal("untracked") }).strict(),
|
|
4586
|
+
z34.object({
|
|
4587
|
+
kind: z34.literal("at-pickup"),
|
|
4588
|
+
revision: z34.number().int().nonnegative(),
|
|
4589
|
+
variants: z34.array(
|
|
4121
4590
|
pickupAllocationSchema.extend({
|
|
4122
|
-
available:
|
|
4591
|
+
available: z34.number().int().nonnegative()
|
|
4123
4592
|
})
|
|
4124
4593
|
)
|
|
4125
4594
|
}).strict()
|
|
4126
4595
|
]))();
|
|
4127
|
-
var configurePickupSchema = /* @__PURE__ */ (() =>
|
|
4596
|
+
var configurePickupSchema = /* @__PURE__ */ (() => z34.object({
|
|
4128
4597
|
reward: identifier,
|
|
4129
|
-
revision:
|
|
4598
|
+
revision: z34.number().int().nonnegative(),
|
|
4130
4599
|
actionId: identifier,
|
|
4131
|
-
policy:
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
kind:
|
|
4135
|
-
tiers:
|
|
4136
|
-
|
|
4600
|
+
policy: z34.discriminatedUnion("kind", [
|
|
4601
|
+
z34.object({ kind: z34.literal("untracked") }).strict(),
|
|
4602
|
+
z34.object({
|
|
4603
|
+
kind: z34.literal("at-pickup"),
|
|
4604
|
+
tiers: z34.array(
|
|
4605
|
+
z34.object({
|
|
4137
4606
|
tier: identifier,
|
|
4138
|
-
variants:
|
|
4607
|
+
variants: z34.array(
|
|
4139
4608
|
pickupAllocationSchema.extend({
|
|
4140
4609
|
item: identifier.optional()
|
|
4141
4610
|
})
|
|
@@ -4145,10 +4614,10 @@ var configurePickupSchema = /* @__PURE__ */ (() => z32.object({
|
|
|
4145
4614
|
}).strict()
|
|
4146
4615
|
])
|
|
4147
4616
|
}).strict())();
|
|
4148
|
-
var entitlementRecoverySchema = /* @__PURE__ */ (() =>
|
|
4617
|
+
var entitlementRecoverySchema = /* @__PURE__ */ (() => z34.object({
|
|
4149
4618
|
completion: identifier,
|
|
4150
|
-
reason:
|
|
4151
|
-
flaggedAt:
|
|
4619
|
+
reason: z34.string(),
|
|
4620
|
+
flaggedAt: z34.number(),
|
|
4152
4621
|
/** Null means no accepted completion currently earns this reward. */
|
|
4153
4622
|
remainingTier: identifier.nullable()
|
|
4154
4623
|
}))();
|
|
@@ -4158,40 +4627,45 @@ var entitlementBase = /* @__PURE__ */ (() => ({
|
|
|
4158
4627
|
reward: tieredRewardDefinitionSchema,
|
|
4159
4628
|
earnedTier: identifier,
|
|
4160
4629
|
tier: identifier,
|
|
4161
|
-
revision:
|
|
4630
|
+
revision: z34.number().int().positive()
|
|
4162
4631
|
}))();
|
|
4163
|
-
var entitlementStateSchema = /* @__PURE__ */ (() =>
|
|
4164
|
-
|
|
4165
|
-
|
|
4632
|
+
var entitlementStateSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("status", [
|
|
4633
|
+
z34.object({ ...entitlementBase, status: z34.literal("available") }).strict(),
|
|
4634
|
+
z34.object({
|
|
4166
4635
|
...entitlementBase,
|
|
4167
|
-
status:
|
|
4636
|
+
status: z34.literal("handing-over"),
|
|
4168
4637
|
handover: identifier,
|
|
4169
|
-
startedAt:
|
|
4638
|
+
startedAt: z34.number(),
|
|
4170
4639
|
allocation: pickupAllocationSchema.optional()
|
|
4171
4640
|
}).strict(),
|
|
4172
|
-
|
|
4641
|
+
z34.object({
|
|
4173
4642
|
...entitlementBase,
|
|
4174
|
-
status:
|
|
4643
|
+
status: z34.literal("collected"),
|
|
4175
4644
|
handover: identifier,
|
|
4176
|
-
startedAt:
|
|
4645
|
+
startedAt: z34.number(),
|
|
4177
4646
|
allocation: pickupAllocationSchema.optional(),
|
|
4178
|
-
collectedAt:
|
|
4647
|
+
collectedAt: z34.number(),
|
|
4179
4648
|
recovery: entitlementRecoverySchema.optional()
|
|
4180
4649
|
}).strict(),
|
|
4181
4650
|
// An operator voided it: it can no longer be handed over. A quest grant of the same reward to
|
|
4182
4651
|
// the member (the same grant key) makes it available again; a voided referral reward stays void.
|
|
4183
|
-
|
|
4652
|
+
z34.object({
|
|
4184
4653
|
...entitlementBase,
|
|
4185
|
-
status:
|
|
4186
|
-
voidedAt:
|
|
4654
|
+
status: z34.literal("void"),
|
|
4655
|
+
voidedAt: z34.number()
|
|
4187
4656
|
}).strict()
|
|
4188
4657
|
]))();
|
|
4189
|
-
var tieredRewardReadSchema = /* @__PURE__ */ (() =>
|
|
4658
|
+
var tieredRewardReadSchema = /* @__PURE__ */ (() => z34.object({
|
|
4190
4659
|
id: identifier,
|
|
4191
|
-
title:
|
|
4192
|
-
tiers:
|
|
4193
|
-
inventory:
|
|
4194
|
-
fulfillment:
|
|
4660
|
+
title: z34.string(),
|
|
4661
|
+
tiers: z34.array(z34.object({ id: identifier, title: z34.string() }).loose()),
|
|
4662
|
+
inventory: z34.object({ kind: z34.string() }).loose(),
|
|
4663
|
+
fulfillment: z34.object({ kind: z34.string() }).loose(),
|
|
4664
|
+
/**
|
|
4665
|
+
* The key given to defineTieredReward, or null for a reward created without one. Management
|
|
4666
|
+
* reads carry it; participant reads and Relay versions before it leave it out.
|
|
4667
|
+
*/
|
|
4668
|
+
key: identifier.nullish()
|
|
4195
4669
|
}).loose())();
|
|
4196
4670
|
var entitlementReadBase = /* @__PURE__ */ (() => ({
|
|
4197
4671
|
id: identifier,
|
|
@@ -4199,63 +4673,63 @@ var entitlementReadBase = /* @__PURE__ */ (() => ({
|
|
|
4199
4673
|
reward: tieredRewardReadSchema,
|
|
4200
4674
|
earnedTier: identifier,
|
|
4201
4675
|
tier: identifier,
|
|
4202
|
-
revision:
|
|
4676
|
+
revision: z34.number().int()
|
|
4203
4677
|
}))();
|
|
4204
|
-
var allocationReadSchema = /* @__PURE__ */ (() =>
|
|
4205
|
-
var entitlementSchema = /* @__PURE__ */ (() =>
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4678
|
+
var allocationReadSchema = /* @__PURE__ */ (() => z34.object({ item: identifier, label: z34.string() }).loose())();
|
|
4679
|
+
var entitlementSchema = /* @__PURE__ */ (() => z34.union([
|
|
4680
|
+
z34.discriminatedUnion("status", [
|
|
4681
|
+
z34.object({ ...entitlementReadBase, status: z34.literal("available") }).loose(),
|
|
4682
|
+
z34.object({
|
|
4209
4683
|
...entitlementReadBase,
|
|
4210
|
-
status:
|
|
4684
|
+
status: z34.literal("handing-over"),
|
|
4211
4685
|
handover: identifier,
|
|
4212
|
-
startedAt:
|
|
4686
|
+
startedAt: z34.number(),
|
|
4213
4687
|
allocation: allocationReadSchema.optional()
|
|
4214
4688
|
}).loose(),
|
|
4215
|
-
|
|
4689
|
+
z34.object({
|
|
4216
4690
|
...entitlementReadBase,
|
|
4217
|
-
status:
|
|
4691
|
+
status: z34.literal("collected"),
|
|
4218
4692
|
handover: identifier,
|
|
4219
|
-
startedAt:
|
|
4693
|
+
startedAt: z34.number(),
|
|
4220
4694
|
allocation: allocationReadSchema.optional(),
|
|
4221
|
-
collectedAt:
|
|
4695
|
+
collectedAt: z34.number(),
|
|
4222
4696
|
recovery: entitlementRecoverySchema.optional()
|
|
4223
4697
|
}).loose(),
|
|
4224
|
-
|
|
4698
|
+
z34.object({
|
|
4225
4699
|
...entitlementReadBase,
|
|
4226
|
-
status:
|
|
4227
|
-
voidedAt:
|
|
4700
|
+
status: z34.literal("void"),
|
|
4701
|
+
voidedAt: z34.number()
|
|
4228
4702
|
}).loose()
|
|
4229
4703
|
]),
|
|
4230
|
-
|
|
4704
|
+
z34.object({ ...entitlementReadBase, status: z34.string() }).loose().transform(({ status, ...entitlement }) => ({
|
|
4231
4705
|
...entitlement,
|
|
4232
4706
|
status: "unsupported",
|
|
4233
4707
|
reportedStatus: status
|
|
4234
4708
|
}))
|
|
4235
4709
|
]))();
|
|
4236
|
-
var beginHandoverSchema = /* @__PURE__ */ (() =>
|
|
4710
|
+
var beginHandoverSchema = /* @__PURE__ */ (() => z34.object({
|
|
4237
4711
|
actionId: identifier,
|
|
4238
|
-
revision:
|
|
4712
|
+
revision: z34.number().int().positive(),
|
|
4239
4713
|
selection: pickupSelectionSchema.optional()
|
|
4240
4714
|
}).strict())();
|
|
4241
|
-
var confirmHandoverSchema = /* @__PURE__ */ (() =>
|
|
4242
|
-
var entitlementCorrectionSchema = /* @__PURE__ */ (() =>
|
|
4715
|
+
var confirmHandoverSchema = /* @__PURE__ */ (() => z34.object({ actionId: identifier, handover: identifier }).strict())();
|
|
4716
|
+
var entitlementCorrectionSchema = /* @__PURE__ */ (() => z34.object({
|
|
4243
4717
|
actionId: identifier,
|
|
4244
|
-
revision:
|
|
4245
|
-
reason:
|
|
4718
|
+
revision: z34.number().int().positive(),
|
|
4719
|
+
reason: z34.string().trim().min(1).max(500)
|
|
4246
4720
|
}).strict())();
|
|
4247
4721
|
var CompletionSourceKind = {
|
|
4248
4722
|
Quest: "quest",
|
|
4249
4723
|
Leaderboard: "leaderboard"
|
|
4250
4724
|
};
|
|
4251
|
-
var completionSourceKindSchema = /* @__PURE__ */ (() =>
|
|
4252
|
-
var completionSourceSchema = /* @__PURE__ */ (() =>
|
|
4725
|
+
var completionSourceKindSchema = /* @__PURE__ */ (() => z34.string().min(1).max(64))();
|
|
4726
|
+
var completionSourceSchema = /* @__PURE__ */ (() => z34.object({
|
|
4253
4727
|
kind: completionSourceKindSchema,
|
|
4254
4728
|
id: identifier
|
|
4255
4729
|
}))();
|
|
4256
|
-
var completionRecordSchema = /* @__PURE__ */ (() =>
|
|
4730
|
+
var completionRecordSchema = /* @__PURE__ */ (() => z34.object({
|
|
4257
4731
|
/** The occurrence the completion consumed. For a leaderboard prize, the settlement ID. */
|
|
4258
|
-
key:
|
|
4732
|
+
key: z34.string().default("once"),
|
|
4259
4733
|
id: identifier,
|
|
4260
4734
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
4261
4735
|
quest: identifier,
|
|
@@ -4263,19 +4737,19 @@ var completionRecordSchema = /* @__PURE__ */ (() => z32.object({
|
|
|
4263
4737
|
/** What paid the completion. `source.id` repeats `quest`. */
|
|
4264
4738
|
source: completionSourceSchema.optional()
|
|
4265
4739
|
}))();
|
|
4266
|
-
var questAvailabilitySchema = /* @__PURE__ */ (() =>
|
|
4267
|
-
|
|
4268
|
-
kind:
|
|
4269
|
-
input:
|
|
4740
|
+
var questAvailabilitySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
|
|
4741
|
+
z34.object({
|
|
4742
|
+
kind: z34.literal("available"),
|
|
4743
|
+
input: z34.enum(["photo", "quiz", "none", "text", "url"])
|
|
4270
4744
|
}).strict(),
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
kind:
|
|
4274
|
-
missing:
|
|
4745
|
+
z34.object({ kind: z34.literal("completed") }).strict(),
|
|
4746
|
+
z34.object({
|
|
4747
|
+
kind: z34.literal("locked"),
|
|
4748
|
+
missing: z34.array(missingPrerequisiteSchema).min(1)
|
|
4275
4749
|
}).strict(),
|
|
4276
|
-
|
|
4277
|
-
kind:
|
|
4278
|
-
reason:
|
|
4750
|
+
z34.object({
|
|
4751
|
+
kind: z34.literal("blocked"),
|
|
4752
|
+
reason: z34.enum([
|
|
4279
4753
|
"budget-exhausted",
|
|
4280
4754
|
"connection-required",
|
|
4281
4755
|
"wallet-required",
|
|
@@ -4284,56 +4758,56 @@ var questAvailabilitySchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kin
|
|
|
4284
4758
|
"enrollment-required"
|
|
4285
4759
|
]),
|
|
4286
4760
|
/** Which window refused admission when `reason` is `outside-window`. */
|
|
4287
|
-
window:
|
|
4288
|
-
resetsAt:
|
|
4761
|
+
window: z34.enum(["tracker", "quest"]).optional(),
|
|
4762
|
+
resetsAt: z34.number().int().safe().optional()
|
|
4289
4763
|
}).strict(),
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4764
|
+
z34.object({ kind: z34.literal("staff-required") }).strict(),
|
|
4765
|
+
z34.object({ kind: z34.literal("automatic") }).strict(),
|
|
4766
|
+
z34.object({ kind: z34.literal("checking"), attempt: identifier }).strict(),
|
|
4767
|
+
z34.object({ kind: z34.literal("needs-review"), attempt: identifier }).strict(),
|
|
4768
|
+
z34.object({ kind: z34.literal("retryable"), attempt: identifier }).strict()
|
|
4295
4769
|
]))();
|
|
4296
|
-
var questAvailabilityResponseSchema = /* @__PURE__ */ (() =>
|
|
4770
|
+
var questAvailabilityResponseSchema = /* @__PURE__ */ (() => z34.union(
|
|
4297
4771
|
questAvailabilitySchema.options.map((option) => option.strip())
|
|
4298
4772
|
))();
|
|
4299
|
-
var questBudgetViewSchema = /* @__PURE__ */ (() =>
|
|
4773
|
+
var questBudgetViewSchema = /* @__PURE__ */ (() => z34.object({
|
|
4300
4774
|
id: identifier,
|
|
4301
|
-
scope:
|
|
4302
|
-
period:
|
|
4303
|
-
remaining:
|
|
4304
|
-
resetsAt:
|
|
4775
|
+
scope: z34.enum(["member", "project"]),
|
|
4776
|
+
period: z34.enum(["day", "week", "month", "lifetime"]),
|
|
4777
|
+
remaining: z34.number().int().safe().nonnegative(),
|
|
4778
|
+
resetsAt: z34.number().int().safe().nullable()
|
|
4305
4779
|
}))();
|
|
4306
4780
|
var memberProgressSchema = /* @__PURE__ */ (() => responseShape(
|
|
4307
|
-
|
|
4781
|
+
z34.object({
|
|
4308
4782
|
member: identifier,
|
|
4309
|
-
quests:
|
|
4310
|
-
|
|
4783
|
+
quests: z34.array(
|
|
4784
|
+
z34.object({
|
|
4311
4785
|
quest: identifier,
|
|
4312
4786
|
key: identifier.optional(),
|
|
4313
4787
|
release: identifier.optional(),
|
|
4314
|
-
title:
|
|
4788
|
+
title: z34.string(),
|
|
4315
4789
|
presentation: questPresentationSchema.default({}),
|
|
4316
|
-
connections:
|
|
4790
|
+
connections: z34.array(authProviderSchema).default([]),
|
|
4317
4791
|
trigger: triggerResponseSchema,
|
|
4318
4792
|
availability: questAvailabilityResponseSchema,
|
|
4319
|
-
completed:
|
|
4793
|
+
completed: z34.boolean(),
|
|
4320
4794
|
completion: completionPolicySchema.default({ kind: "once" }),
|
|
4321
4795
|
streak: streakProgressSchema.nullable().optional(),
|
|
4322
4796
|
counter: counterProgressSchema.nullable().optional(),
|
|
4323
4797
|
/** Latest attempt's committed evaluator progress, while it remains deferred/evaluating. */
|
|
4324
4798
|
progress: evaluatorProgressSchema.nullable().default(null),
|
|
4325
|
-
completionCount:
|
|
4326
|
-
visibility:
|
|
4327
|
-
missing:
|
|
4799
|
+
completionCount: z34.number().int().nonnegative().default(0),
|
|
4800
|
+
visibility: z34.enum(["visible", "hidden"]).default("visible"),
|
|
4801
|
+
missing: z34.array(missingPrerequisiteSchema),
|
|
4328
4802
|
campaign: campaignViewSchema.nullable().default(null),
|
|
4329
4803
|
window: availabilityWindowSchema.nullable().default(null),
|
|
4330
|
-
budgets:
|
|
4804
|
+
budgets: z34.array(questBudgetViewSchema).default([]),
|
|
4331
4805
|
/**
|
|
4332
4806
|
* Unix milliseconds when the member may submit again, while the quest's retry cooldown
|
|
4333
4807
|
* after their rejected attempt runs. Until then a new attempt is refused with
|
|
4334
4808
|
* `retry-cooldown`. Absent when no cooldown is running.
|
|
4335
4809
|
*/
|
|
4336
|
-
retryAt:
|
|
4810
|
+
retryAt: z34.number().int().safe().optional(),
|
|
4337
4811
|
/**
|
|
4338
4812
|
* Unix milliseconds when the member may next submit the quest, while it waits on something
|
|
4339
4813
|
* that ends by itself: the retry cooldown after a rejection, the completion cooldown after
|
|
@@ -4342,128 +4816,128 @@ var memberProgressSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
4342
4816
|
* several apply; use it for countdowns. Absent when the member can submit now, or when
|
|
4343
4817
|
* nothing will reopen the quest (a used-up lifetime budget, a closed window).
|
|
4344
4818
|
*/
|
|
4345
|
-
nextAvailableAt:
|
|
4819
|
+
nextAvailableAt: z34.number().int().safe().optional(),
|
|
4346
4820
|
attempt: attemptSchema.nullable()
|
|
4347
4821
|
})
|
|
4348
4822
|
),
|
|
4349
|
-
entitlements:
|
|
4823
|
+
entitlements: z34.array(entitlementSchema)
|
|
4350
4824
|
})
|
|
4351
4825
|
))();
|
|
4352
4826
|
var snapshotSchema = /* @__PURE__ */ (() => responseShape(
|
|
4353
|
-
|
|
4354
|
-
releases:
|
|
4355
|
-
completions:
|
|
4356
|
-
entitlements:
|
|
4357
|
-
attempts:
|
|
4358
|
-
balances:
|
|
4359
|
-
|
|
4360
|
-
member:
|
|
4361
|
-
balance:
|
|
4362
|
-
earned:
|
|
4363
|
-
held:
|
|
4364
|
-
available:
|
|
4827
|
+
z34.object({
|
|
4828
|
+
releases: z34.array(publishedReleaseSchema),
|
|
4829
|
+
completions: z34.array(completionRecordSchema),
|
|
4830
|
+
entitlements: z34.array(entitlementSchema),
|
|
4831
|
+
attempts: z34.array(attemptSchema),
|
|
4832
|
+
balances: z34.array(
|
|
4833
|
+
z34.object({
|
|
4834
|
+
member: z34.string(),
|
|
4835
|
+
balance: z34.string(),
|
|
4836
|
+
earned: z34.number(),
|
|
4837
|
+
held: z34.number(),
|
|
4838
|
+
available: z34.number()
|
|
4365
4839
|
})
|
|
4366
4840
|
),
|
|
4367
|
-
events:
|
|
4841
|
+
events: z34.array(eventSchema)
|
|
4368
4842
|
})
|
|
4369
4843
|
))();
|
|
4370
|
-
var evidenceSchema = /* @__PURE__ */ (() =>
|
|
4844
|
+
var evidenceSchema = /* @__PURE__ */ (() => z34.object({
|
|
4371
4845
|
id: identifier,
|
|
4372
4846
|
member: identifier,
|
|
4373
|
-
type:
|
|
4374
|
-
size:
|
|
4847
|
+
type: z34.enum(["image/jpeg", "image/png"]),
|
|
4848
|
+
size: z34.number()
|
|
4375
4849
|
}))();
|
|
4376
|
-
var errorSchema = /* @__PURE__ */ (() =>
|
|
4377
|
-
error:
|
|
4378
|
-
code:
|
|
4850
|
+
var errorSchema = /* @__PURE__ */ (() => z34.object({
|
|
4851
|
+
error: z34.string(),
|
|
4852
|
+
code: z34.string().optional(),
|
|
4379
4853
|
/** Which window refused admission when `code` is `outside-window`. */
|
|
4380
|
-
window:
|
|
4381
|
-
missing:
|
|
4854
|
+
window: z34.enum(["tracker", "quest"]).optional(),
|
|
4855
|
+
missing: z34.array(missingPrerequisiteSchema).optional(),
|
|
4382
4856
|
/**
|
|
4383
4857
|
* Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
|
|
4384
4858
|
* `completion-cooldown`.
|
|
4385
4859
|
*/
|
|
4386
|
-
retryAt:
|
|
4860
|
+
retryAt: z34.number().int().safe().optional()
|
|
4387
4861
|
}))();
|
|
4388
|
-
var staffDecisionSchema = /* @__PURE__ */ (() =>
|
|
4862
|
+
var staffDecisionSchema = /* @__PURE__ */ (() => z34.object({
|
|
4389
4863
|
actionId: identifier,
|
|
4390
|
-
generation:
|
|
4391
|
-
decision:
|
|
4392
|
-
reason:
|
|
4864
|
+
generation: z34.number().int().nonnegative(),
|
|
4865
|
+
decision: z34.enum(["accept", "reject"]),
|
|
4866
|
+
reason: z34.string().trim().min(1).max(2e3)
|
|
4393
4867
|
}).strict())();
|
|
4394
|
-
var acceptAnywaySchema = /* @__PURE__ */ (() =>
|
|
4868
|
+
var acceptAnywaySchema = /* @__PURE__ */ (() => z34.object({
|
|
4395
4869
|
actionId: identifier,
|
|
4396
|
-
reason:
|
|
4870
|
+
reason: z34.string().trim().min(1).max(2e3)
|
|
4397
4871
|
}).strict())();
|
|
4398
|
-
var evidenceRedactionInputSchema = /* @__PURE__ */ (() =>
|
|
4872
|
+
var evidenceRedactionInputSchema = /* @__PURE__ */ (() => z34.object({
|
|
4399
4873
|
actionId: identifier,
|
|
4400
|
-
reason:
|
|
4874
|
+
reason: z34.string().trim().min(1).max(2e3)
|
|
4401
4875
|
}).strict())();
|
|
4402
|
-
var evidenceRetentionInputSchema = /* @__PURE__ */ (() =>
|
|
4876
|
+
var evidenceRetentionInputSchema = /* @__PURE__ */ (() => z34.object({
|
|
4403
4877
|
actionId: identifier,
|
|
4404
4878
|
quest: identifier,
|
|
4405
|
-
decidedBefore:
|
|
4406
|
-
reason:
|
|
4879
|
+
decidedBefore: z34.number().int().nonnegative(),
|
|
4880
|
+
reason: z34.string().trim().min(1).max(2e3)
|
|
4407
4881
|
}).strict())();
|
|
4408
|
-
var evidenceRetentionPeriodSchema = /* @__PURE__ */ (() =>
|
|
4409
|
-
|
|
4410
|
-
|
|
4882
|
+
var evidenceRetentionPeriodSchema = /* @__PURE__ */ (() => z34.union([
|
|
4883
|
+
z34.object({ days: z34.number().int().min(1).max(3650) }).strict(),
|
|
4884
|
+
z34.literal("keep")
|
|
4411
4885
|
]))();
|
|
4412
|
-
var evidenceRetentionSettingInputSchema = /* @__PURE__ */ (() =>
|
|
4886
|
+
var evidenceRetentionSettingInputSchema = /* @__PURE__ */ (() => z34.object({
|
|
4413
4887
|
actionId: identifier,
|
|
4414
4888
|
evidenceRetention: evidenceRetentionPeriodSchema
|
|
4415
4889
|
}).strict())();
|
|
4416
|
-
var stockSchema = /* @__PURE__ */ (() =>
|
|
4417
|
-
var reservationSchema = /* @__PURE__ */ (() =>
|
|
4890
|
+
var stockSchema = /* @__PURE__ */ (() => z34.object({ item: identifier, quantity: z34.number().int().min(0).max(1e4) }).strict())();
|
|
4891
|
+
var reservationSchema = /* @__PURE__ */ (() => z34.object({
|
|
4418
4892
|
actionId: identifier,
|
|
4419
4893
|
member: identifier,
|
|
4420
4894
|
item: identifier,
|
|
4421
4895
|
balance: identifier,
|
|
4422
|
-
price:
|
|
4896
|
+
price: z34.number().int().positive().max(1e4)
|
|
4423
4897
|
}).strict())();
|
|
4424
4898
|
var pageOptions = /* @__PURE__ */ (() => ({
|
|
4425
|
-
limit:
|
|
4426
|
-
cursor:
|
|
4899
|
+
limit: z34.number().int().min(1).max(100).default(25),
|
|
4900
|
+
cursor: z34.string().min(1).max(4096).optional()
|
|
4427
4901
|
}))();
|
|
4428
|
-
var reviewListSchema = /* @__PURE__ */ (() =>
|
|
4902
|
+
var reviewListSchema = /* @__PURE__ */ (() => z34.object({
|
|
4429
4903
|
...pageOptions,
|
|
4430
4904
|
member: identifier.optional(),
|
|
4431
4905
|
quest: identifier.optional()
|
|
4432
4906
|
}).strict())();
|
|
4433
|
-
var memberListSchema = /* @__PURE__ */ (() =>
|
|
4907
|
+
var memberListSchema = /* @__PURE__ */ (() => z34.object({
|
|
4434
4908
|
...pageOptions,
|
|
4435
4909
|
prefix: identifier.optional()
|
|
4436
4910
|
}).strict())();
|
|
4437
|
-
var reviewItemSchema = /* @__PURE__ */ (() =>
|
|
4911
|
+
var reviewItemSchema = /* @__PURE__ */ (() => z34.object({
|
|
4438
4912
|
attempt: attemptSchema,
|
|
4439
|
-
title:
|
|
4440
|
-
checks:
|
|
4441
|
-
|
|
4913
|
+
title: z34.string(),
|
|
4914
|
+
checks: z34.array(
|
|
4915
|
+
z34.object({ criteria: z34.string(), result: photoResultSchema })
|
|
4442
4916
|
)
|
|
4443
4917
|
}))();
|
|
4444
|
-
var reviewPageSchema = /* @__PURE__ */ (() =>
|
|
4445
|
-
items:
|
|
4446
|
-
nextCursor:
|
|
4918
|
+
var reviewPageSchema = /* @__PURE__ */ (() => z34.object({
|
|
4919
|
+
items: z34.array(reviewItemSchema).max(100),
|
|
4920
|
+
nextCursor: z34.string().nullable()
|
|
4447
4921
|
}))();
|
|
4448
|
-
var memberPageSchema = /* @__PURE__ */ (() =>
|
|
4449
|
-
items:
|
|
4450
|
-
nextCursor:
|
|
4922
|
+
var memberPageSchema = /* @__PURE__ */ (() => z34.object({
|
|
4923
|
+
items: z34.array(z34.object({ member: identifier })).max(100),
|
|
4924
|
+
nextCursor: z34.string().nullable()
|
|
4451
4925
|
}))();
|
|
4452
|
-
var createStockItemSchema = /* @__PURE__ */ (() =>
|
|
4453
|
-
var stockItemSchema = /* @__PURE__ */ (() =>
|
|
4454
|
-
var contentPerformanceSnapshotSchema = /* @__PURE__ */ (() =>
|
|
4926
|
+
var createStockItemSchema = /* @__PURE__ */ (() => z34.object({ actionId: identifier, name: z34.string().trim().min(1).max(80) }).strict())();
|
|
4927
|
+
var stockItemSchema = /* @__PURE__ */ (() => z34.object({ id: identifier, name: z34.string() }))();
|
|
4928
|
+
var contentPerformanceSnapshotSchema = /* @__PURE__ */ (() => z34.strictObject({
|
|
4455
4929
|
contentAttempt: identifier,
|
|
4456
4930
|
observation: identifier,
|
|
4457
|
-
observedAt:
|
|
4931
|
+
observedAt: z34.number().int().safe().nonnegative(),
|
|
4458
4932
|
metrics: contentMetricsSchema,
|
|
4459
4933
|
rewards: rewardBundleSchema
|
|
4460
4934
|
}))();
|
|
4461
4935
|
var contentPerformanceQuerySchema = /* @__PURE__ */ (() => contentQualificationQuerySchema.extend({
|
|
4462
|
-
content:
|
|
4936
|
+
content: z34.string().min(1).max(256)
|
|
4463
4937
|
}))();
|
|
4464
|
-
var contentPerformancePageSchema = /* @__PURE__ */ (() =>
|
|
4465
|
-
current:
|
|
4466
|
-
state:
|
|
4938
|
+
var contentPerformancePageSchema = /* @__PURE__ */ (() => z34.strictObject({
|
|
4939
|
+
current: z34.strictObject({
|
|
4940
|
+
state: z34.enum([
|
|
4467
4941
|
"content-pending",
|
|
4468
4942
|
"content-unqualified",
|
|
4469
4943
|
"waiting",
|
|
@@ -4474,19 +4948,19 @@ var contentPerformancePageSchema = /* @__PURE__ */ (() => z32.strictObject({
|
|
|
4474
4948
|
"failed",
|
|
4475
4949
|
"superseded"
|
|
4476
4950
|
]),
|
|
4477
|
-
reason:
|
|
4951
|
+
reason: z34.string().nullable(),
|
|
4478
4952
|
contentAttempt: identifier,
|
|
4479
4953
|
attempt: identifier.nullable(),
|
|
4480
4954
|
reward: contentQualificationSchema.shape.reward
|
|
4481
4955
|
}),
|
|
4482
|
-
items:
|
|
4483
|
-
|
|
4956
|
+
items: z34.array(
|
|
4957
|
+
z34.strictObject({
|
|
4484
4958
|
attempt: identifier,
|
|
4485
4959
|
contentAttempt: identifier,
|
|
4486
4960
|
observation: identifier,
|
|
4487
|
-
observedAt:
|
|
4961
|
+
observedAt: z34.number(),
|
|
4488
4962
|
metrics: contentMetricsSchema,
|
|
4489
|
-
state:
|
|
4963
|
+
state: z34.enum([
|
|
4490
4964
|
"pending",
|
|
4491
4965
|
"qualified",
|
|
4492
4966
|
"unqualified",
|
|
@@ -4494,43 +4968,43 @@ var contentPerformancePageSchema = /* @__PURE__ */ (() => z32.strictObject({
|
|
|
4494
4968
|
"failed",
|
|
4495
4969
|
"superseded"
|
|
4496
4970
|
]),
|
|
4497
|
-
reason:
|
|
4971
|
+
reason: z34.string().nullable()
|
|
4498
4972
|
})
|
|
4499
4973
|
),
|
|
4500
4974
|
nextCursor: pageCursorSchema.nullable()
|
|
4501
4975
|
}))();
|
|
4502
4976
|
|
|
4503
4977
|
// src/point-ledgers.ts
|
|
4504
|
-
import * as
|
|
4505
|
-
var pointLedgerPropertiesSchema = /* @__PURE__ */ (() =>
|
|
4506
|
-
name:
|
|
4507
|
-
description:
|
|
4978
|
+
import * as z35 from "zod";
|
|
4979
|
+
var pointLedgerPropertiesSchema = /* @__PURE__ */ (() => z35.object({
|
|
4980
|
+
name: z35.string().trim().min(1).max(120),
|
|
4981
|
+
description: z35.string().trim().max(1e3).default("")
|
|
4508
4982
|
}).strict())();
|
|
4509
4983
|
var createPointLedgerSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({ actionId: identifier, key: identifier.optional() }).strict())();
|
|
4510
4984
|
var pointLedgerSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({
|
|
4511
4985
|
id: identifier
|
|
4512
4986
|
}))();
|
|
4513
4987
|
var managedPointLedgerSchema = /* @__PURE__ */ (() => pointLedgerSchema.extend({
|
|
4514
|
-
archivedAt:
|
|
4988
|
+
archivedAt: z35.number().int().nonnegative().nullable()
|
|
4515
4989
|
}))();
|
|
4516
4990
|
var pointLedgerDeclarationSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({ key: identifier }).strict())();
|
|
4517
|
-
var pointLedgerArtifactSchema = /* @__PURE__ */ (() =>
|
|
4991
|
+
var pointLedgerArtifactSchema = /* @__PURE__ */ (() => z35.union([
|
|
4518
4992
|
pointLedgerDeclarationSchema,
|
|
4519
|
-
|
|
4993
|
+
z35.object({ code: z35.string().min(1).max(2e6) }).strict()
|
|
4520
4994
|
]))();
|
|
4521
|
-
var pointLedgerReferenceSchema = /* @__PURE__ */ (() =>
|
|
4995
|
+
var pointLedgerReferenceSchema = /* @__PURE__ */ (() => z35.object({
|
|
4522
4996
|
id: identifier,
|
|
4523
4997
|
key: identifier.nullable(),
|
|
4524
|
-
name:
|
|
4998
|
+
name: z35.string()
|
|
4525
4999
|
}))();
|
|
4526
|
-
var points = /* @__PURE__ */ (() =>
|
|
4527
|
-
var pointBalanceSchema = /* @__PURE__ */ (() =>
|
|
5000
|
+
var points = /* @__PURE__ */ (() => z35.number().int().safe())();
|
|
5001
|
+
var pointBalanceSchema = /* @__PURE__ */ (() => z35.object({
|
|
4528
5002
|
ledger: pointLedgerReferenceSchema,
|
|
4529
5003
|
balance: points,
|
|
4530
5004
|
available: points
|
|
4531
5005
|
}))();
|
|
4532
|
-
var pointBalancesSchema = /* @__PURE__ */ (() =>
|
|
4533
|
-
items:
|
|
5006
|
+
var pointBalancesSchema = /* @__PURE__ */ (() => z35.object({
|
|
5007
|
+
items: z35.array(pointBalanceSchema)
|
|
4534
5008
|
}))();
|
|
4535
5009
|
var PointEntryKind = {
|
|
4536
5010
|
/** Points a quest completion, an engagement settlement or an operator awarded. */
|
|
@@ -4542,8 +5016,8 @@ var PointEntryKind = {
|
|
|
4542
5016
|
/** Undoes part or all of an award or a positive adjustment (`reverses`). */
|
|
4543
5017
|
Reverse: "reverse"
|
|
4544
5018
|
};
|
|
4545
|
-
var pointEntryKindSchema = /* @__PURE__ */ (() =>
|
|
4546
|
-
var pointEntrySchema = /* @__PURE__ */ (() =>
|
|
5019
|
+
var pointEntryKindSchema = /* @__PURE__ */ (() => z35.string().min(1).max(64))();
|
|
5020
|
+
var pointEntrySchema = /* @__PURE__ */ (() => z35.object({
|
|
4547
5021
|
id: identifier,
|
|
4548
5022
|
amount: points,
|
|
4549
5023
|
kind: pointEntryKindSchema,
|
|
@@ -4555,204 +5029,261 @@ var pointEntrySchema = /* @__PURE__ */ (() => z33.object({
|
|
|
4555
5029
|
* True for an opening balance a member import recorded (an `adjust`). Absent from Relay
|
|
4556
5030
|
* versions without imports.
|
|
4557
5031
|
*/
|
|
4558
|
-
imported:
|
|
5032
|
+
imported: z35.boolean().optional()
|
|
4559
5033
|
}))();
|
|
4560
|
-
var pointHistoryQuerySchema = /* @__PURE__ */ (() =>
|
|
5034
|
+
var pointHistoryQuerySchema = /* @__PURE__ */ (() => z35.strictObject({
|
|
4561
5035
|
ledger: identifier,
|
|
4562
5036
|
cursor: pageCursorSchema.optional()
|
|
4563
5037
|
}))();
|
|
4564
|
-
var pointHistoryPageSchema = /* @__PURE__ */ (() =>
|
|
4565
|
-
items:
|
|
5038
|
+
var pointHistoryPageSchema = /* @__PURE__ */ (() => z35.object({
|
|
5039
|
+
items: z35.array(pointEntrySchema),
|
|
4566
5040
|
nextCursor: pageCursorSchema.nullable()
|
|
4567
5041
|
}))();
|
|
4568
5042
|
|
|
4569
5043
|
// src/profiles.ts
|
|
4570
|
-
import * as
|
|
4571
|
-
var count3 = /* @__PURE__ */ (() =>
|
|
4572
|
-
var profileVisibilitySchema = /* @__PURE__ */ (() =>
|
|
5044
|
+
import * as z36 from "zod";
|
|
5045
|
+
var count3 = /* @__PURE__ */ (() => z36.number().int().nonnegative().safe())();
|
|
5046
|
+
var profileVisibilitySchema = /* @__PURE__ */ (() => z36.enum([
|
|
4573
5047
|
"private",
|
|
4574
5048
|
"participants",
|
|
4575
5049
|
"public"
|
|
4576
5050
|
]))();
|
|
4577
|
-
var avatarProviderSchema = /* @__PURE__ */ (() =>
|
|
4578
|
-
var profileDefaultProviderSchema = /* @__PURE__ */ (() =>
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
5051
|
+
var avatarProviderSchema = /* @__PURE__ */ (() => z36.enum(["x", "discord", "google"]))();
|
|
5052
|
+
var profileDefaultProviderSchema = /* @__PURE__ */ (() => z36.enum(["x", "discord"]))();
|
|
5053
|
+
function orderedSources(sources) {
|
|
5054
|
+
return z36.array(sources).max(sources.options.length).refine(
|
|
5055
|
+
(values2) => new Set(values2).size === values2.length,
|
|
5056
|
+
"List each provider once"
|
|
5057
|
+
);
|
|
5058
|
+
}
|
|
5059
|
+
var profileDefaultsSchema = /* @__PURE__ */ (() => orderedSources(
|
|
5060
|
+
profileDefaultProviderSchema
|
|
4582
5061
|
))();
|
|
4583
|
-
var
|
|
4584
|
-
var
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
5062
|
+
var knownProfileDefaultSources = ["x", "discord", "sol"];
|
|
5063
|
+
var profileDefaultSourcesSchema = /* @__PURE__ */ (() => orderedSources(
|
|
5064
|
+
z36.enum(knownProfileDefaultSources)
|
|
5065
|
+
))();
|
|
5066
|
+
var profileNameSourceSchema = /* @__PURE__ */ (() => z36.enum(["sol"]))();
|
|
5067
|
+
var openValue = /* @__PURE__ */ (() => z36.string().min(1).max(64))();
|
|
5068
|
+
var avatarSeedSchema = /* @__PURE__ */ (() => z36.string().min(1).max(100))();
|
|
5069
|
+
var profileAvatarSchema = /* @__PURE__ */ (() => z36.discriminatedUnion("source", [
|
|
5070
|
+
z36.object({
|
|
5071
|
+
source: z36.literal("upload"),
|
|
5072
|
+
url: z36.string().url(),
|
|
4588
5073
|
seed: avatarSeedSchema
|
|
4589
5074
|
}),
|
|
4590
|
-
|
|
4591
|
-
source:
|
|
5075
|
+
z36.object({
|
|
5076
|
+
source: z36.literal("account"),
|
|
4592
5077
|
provider: avatarProviderSchema,
|
|
4593
|
-
url:
|
|
5078
|
+
url: z36.string().url(),
|
|
4594
5079
|
seed: avatarSeedSchema
|
|
4595
5080
|
}),
|
|
4596
|
-
|
|
5081
|
+
z36.object({ source: z36.literal("generated"), seed: avatarSeedSchema })
|
|
4597
5082
|
]))();
|
|
4598
|
-
var profileSummarySchema = /* @__PURE__ */ (() =>
|
|
5083
|
+
var profileSummarySchema = /* @__PURE__ */ (() => z36.object({
|
|
4599
5084
|
id: identifier,
|
|
4600
|
-
name:
|
|
5085
|
+
name: z36.string(),
|
|
4601
5086
|
avatar: profileAvatarSchema
|
|
4602
5087
|
}))();
|
|
4603
5088
|
var invisible = /[\p{Cc}----]/u;
|
|
4604
|
-
var displayNameSchema = /* @__PURE__ */ (() =>
|
|
4605
|
-
|
|
5089
|
+
var displayNameSchema = /* @__PURE__ */ (() => z36.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
|
|
5090
|
+
z36.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
|
|
4606
5091
|
))();
|
|
4607
|
-
var profileUpdateSchema = /* @__PURE__ */ (() =>
|
|
5092
|
+
var profileUpdateSchema = /* @__PURE__ */ (() => z36.object({
|
|
4608
5093
|
displayName: displayNameSchema.nullable().optional(),
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
5094
|
+
/** @experimental A minor release can change `.sol` names. */
|
|
5095
|
+
nameSource: profileNameSourceSchema.nullable().optional(),
|
|
5096
|
+
avatar: z36.discriminatedUnion("source", [
|
|
5097
|
+
z36.object({
|
|
5098
|
+
source: z36.literal("account"),
|
|
4612
5099
|
provider: avatarProviderSchema
|
|
4613
5100
|
}).strict(),
|
|
4614
|
-
|
|
5101
|
+
z36.object({ source: z36.literal("generated") }).strict()
|
|
4615
5102
|
]).nullable().optional(),
|
|
4616
|
-
hidden:
|
|
5103
|
+
hidden: z36.boolean().optional()
|
|
4617
5104
|
}).strict().refine(
|
|
4618
5105
|
(value) => Object.values(value).some((field) => field !== void 0),
|
|
4619
5106
|
"Change at least one field"
|
|
4620
|
-
))()
|
|
5107
|
+
).refine((value) => !(value.displayName !== void 0 && value.nameSource), {
|
|
5108
|
+
message: "Choose a name or a name source, not both",
|
|
5109
|
+
path: ["nameSource"]
|
|
5110
|
+
}))();
|
|
4621
5111
|
var ownProfileSchema = /* @__PURE__ */ (() => profileSummarySchema.extend({
|
|
4622
5112
|
/** The name the member chose, or null for the default. */
|
|
4623
|
-
displayName:
|
|
5113
|
+
displayName: z36.string().nullable(),
|
|
4624
5114
|
/** The avatar the member chose: `default` follows the project's defaults. */
|
|
4625
|
-
avatarChoice:
|
|
5115
|
+
avatarChoice: z36.enum(["default", "upload", "account", "generated"]),
|
|
4626
5116
|
/** The account of an `account` choice. */
|
|
4627
5117
|
avatarProvider: avatarProviderSchema.nullable(),
|
|
4628
|
-
hidden:
|
|
5118
|
+
hidden: z36.boolean(),
|
|
4629
5119
|
/** An operator locked the name and avatar; the member can still hide the profile. */
|
|
4630
|
-
locked:
|
|
5120
|
+
locked: z36.boolean(),
|
|
4631
5121
|
/** Who can see profiles in this project, so the app can explain it. */
|
|
4632
5122
|
visibility: profileVisibilitySchema,
|
|
4633
5123
|
/** The member's connected accounts a picture or name can come from. */
|
|
4634
|
-
options:
|
|
4635
|
-
|
|
5124
|
+
options: z36.array(
|
|
5125
|
+
z36.object({
|
|
4636
5126
|
provider: avatarProviderSchema,
|
|
4637
|
-
name:
|
|
5127
|
+
name: z36.string().nullable(),
|
|
4638
5128
|
/**
|
|
4639
5129
|
* The account's first name, where the provider sends one (Google does; X and Discord don't).
|
|
4640
5130
|
* Only the member's own profile carries it.
|
|
4641
5131
|
*/
|
|
4642
|
-
givenName:
|
|
4643
|
-
imageUrl:
|
|
5132
|
+
givenName: z36.string().nullable().default(null),
|
|
5133
|
+
imageUrl: z36.string().url().nullable()
|
|
4644
5134
|
})
|
|
4645
|
-
)
|
|
5135
|
+
),
|
|
5136
|
+
/**
|
|
5137
|
+
* What the member's name follows instead of a name they typed (`profileNameSourceSchema`), or
|
|
5138
|
+
* null. Absent from Relay versions without name sources.
|
|
5139
|
+
*
|
|
5140
|
+
* @experimental A minor release can change `.sol` names.
|
|
5141
|
+
*/
|
|
5142
|
+
nameSource: openValue.nullable().optional(),
|
|
5143
|
+
/**
|
|
5144
|
+
* The names the member can choose to follow with `nameSource`: `sol`, the primary `.sol` name of
|
|
5145
|
+
* a Solana wallet they linked, when it has one. Absent from Relay versions without name sources.
|
|
5146
|
+
*
|
|
5147
|
+
* @experimental A minor release can change `.sol` names.
|
|
5148
|
+
*/
|
|
5149
|
+
nameOptions: z36.array(z36.object({ source: openValue, name: z36.string() })).optional()
|
|
4646
5150
|
}))();
|
|
4647
|
-
var cursor = /* @__PURE__ */ (() =>
|
|
4648
|
-
var profileCompletionQuerySchema = /* @__PURE__ */ (() =>
|
|
4649
|
-
limit:
|
|
5151
|
+
var cursor = /* @__PURE__ */ (() => z36.string().min(1).max(512))();
|
|
5152
|
+
var profileCompletionQuerySchema = /* @__PURE__ */ (() => z36.object({
|
|
5153
|
+
limit: z36.coerce.number().int().min(1).max(100).default(20),
|
|
4650
5154
|
cursor: cursor.optional()
|
|
4651
5155
|
}).strict())();
|
|
4652
|
-
var profileCompletionSchema = /* @__PURE__ */ (() =>
|
|
5156
|
+
var profileCompletionSchema = /* @__PURE__ */ (() => z36.object({
|
|
4653
5157
|
quest: identifier,
|
|
4654
5158
|
key: identifier.optional(),
|
|
4655
|
-
title:
|
|
5159
|
+
title: z36.string(),
|
|
4656
5160
|
completions: count3.positive(),
|
|
4657
5161
|
/** Null for completions recorded before completion times were. */
|
|
4658
5162
|
lastCompletedAt: count3.nullable()
|
|
4659
5163
|
}))();
|
|
4660
|
-
var profileCompletionPageSchema = /* @__PURE__ */ (() =>
|
|
4661
|
-
items:
|
|
5164
|
+
var profileCompletionPageSchema = /* @__PURE__ */ (() => z36.object({
|
|
5165
|
+
items: z36.array(profileCompletionSchema),
|
|
4662
5166
|
nextCursor: cursor.nullable()
|
|
4663
5167
|
}))();
|
|
4664
|
-
var profileReferralSchema = /* @__PURE__ */ (() =>
|
|
5168
|
+
var profileReferralSchema = /* @__PURE__ */ (() => z36.object({
|
|
4665
5169
|
program: identifier,
|
|
4666
5170
|
key: identifier.optional(),
|
|
4667
|
-
title:
|
|
5171
|
+
title: z36.string(),
|
|
4668
5172
|
/** Members this member invited. Invitations are shared by every program. */
|
|
4669
5173
|
invited: count3,
|
|
4670
5174
|
/** Invited members who qualified in this program. */
|
|
4671
5175
|
qualified: count3,
|
|
4672
|
-
milestones:
|
|
4673
|
-
|
|
5176
|
+
milestones: z36.array(
|
|
5177
|
+
z36.object({ id: identifier, count: count3, reached: z36.boolean() })
|
|
4674
5178
|
)
|
|
4675
5179
|
}))();
|
|
4676
|
-
var profileSettingsSchema = /* @__PURE__ */ (() =>
|
|
5180
|
+
var profileSettingsSchema = /* @__PURE__ */ (() => z36.object({
|
|
4677
5181
|
visibility: profileVisibilitySchema,
|
|
5182
|
+
/** The `defaultSources` that are accounts, in order: `.sol` names are left out. */
|
|
4678
5183
|
defaults: profileDefaultsSchema,
|
|
5184
|
+
/**
|
|
5185
|
+
* Every source of default names and pictures, in order (`knownProfileDefaultSources`). Absent
|
|
5186
|
+
* from Relay versions without `.sol` names, where it is `defaults`.
|
|
5187
|
+
*
|
|
5188
|
+
* @experimental A minor release can change `.sol` names.
|
|
5189
|
+
*/
|
|
5190
|
+
defaultSources: z36.array(openValue).optional(),
|
|
4679
5191
|
revision: count3,
|
|
4680
|
-
actor:
|
|
5192
|
+
actor: z36.string().nullable(),
|
|
4681
5193
|
updatedAt: count3.nullable()
|
|
4682
5194
|
}))();
|
|
4683
|
-
var profileSettingsInputSchema = /* @__PURE__ */ (() => profileSettingsSchema.omit({
|
|
5195
|
+
var profileSettingsInputSchema = /* @__PURE__ */ (() => profileSettingsSchema.omit({
|
|
5196
|
+
revision: true,
|
|
5197
|
+
actor: true,
|
|
5198
|
+
updatedAt: true,
|
|
5199
|
+
defaultSources: true
|
|
5200
|
+
}).extend({
|
|
5201
|
+
/**
|
|
5202
|
+
* Every source of default names and pictures in order, `.sol` names included. `defaults` must
|
|
5203
|
+
* list its accounts in the same order. Without it, the project's `.sol` names keep their place
|
|
5204
|
+
* around the accounts while `defaults` keeps the accounts' order.
|
|
5205
|
+
*
|
|
5206
|
+
* @experimental A minor release can change `.sol` names.
|
|
5207
|
+
*/
|
|
5208
|
+
defaultSources: profileDefaultSourcesSchema.optional(),
|
|
4684
5209
|
actionId: identifier,
|
|
4685
5210
|
/** The revision the change was made against; a newer one is a 409. */
|
|
4686
5211
|
expectedRevision: count3,
|
|
4687
|
-
reason:
|
|
4688
|
-
}).strict()
|
|
4689
|
-
|
|
5212
|
+
reason: z36.string().trim().min(1).max(500)
|
|
5213
|
+
}).strict().refine(
|
|
5214
|
+
(value) => !value.defaultSources || value.defaultSources.filter((source) => source !== "sol").join() === value.defaults.join(),
|
|
5215
|
+
{
|
|
5216
|
+
message: "List defaultSources' accounts in defaults, in the same order",
|
|
5217
|
+
path: ["defaults"]
|
|
5218
|
+
}
|
|
5219
|
+
))();
|
|
5220
|
+
var profileModerationSchema = /* @__PURE__ */ (() => z36.object({
|
|
4690
5221
|
actionId: identifier,
|
|
4691
|
-
resetName:
|
|
4692
|
-
removeAvatar:
|
|
5222
|
+
resetName: z36.boolean().default(false),
|
|
5223
|
+
removeAvatar: z36.boolean().default(false),
|
|
4693
5224
|
/** True locks the name and avatar, false unlocks them. */
|
|
4694
|
-
lock:
|
|
4695
|
-
reason:
|
|
5225
|
+
lock: z36.boolean().optional(),
|
|
5226
|
+
reason: z36.string().trim().min(1).max(1e3)
|
|
4696
5227
|
}).strict().refine(
|
|
4697
5228
|
(value) => value.resetName || value.removeAvatar || value.lock !== void 0,
|
|
4698
5229
|
"Choose an action"
|
|
4699
5230
|
))();
|
|
4700
|
-
var managedProfileSchema = /* @__PURE__ */ (() => ownProfileSchema.omit({ options: true }).extend({
|
|
5231
|
+
var managedProfileSchema = /* @__PURE__ */ (() => ownProfileSchema.omit({ options: true, nameOptions: true }).extend({
|
|
4701
5232
|
member: identifier,
|
|
4702
5233
|
lockedAt: count3.nullable(),
|
|
4703
|
-
lockedBy:
|
|
4704
|
-
lockedReason:
|
|
5234
|
+
lockedBy: z36.string().nullable(),
|
|
5235
|
+
lockedReason: z36.string().nullable(),
|
|
4705
5236
|
updatedAt: count3
|
|
4706
5237
|
}))();
|
|
4707
5238
|
var AVATAR_UPLOAD_LIMIT = 5 * 1024 * 1024;
|
|
4708
5239
|
var avatarUploadTypes = ["image/jpeg", "image/png", "image/webp"];
|
|
4709
5240
|
|
|
4710
5241
|
// src/leaderboards.ts
|
|
4711
|
-
import * as
|
|
4712
|
-
var integer = /* @__PURE__ */ (() =>
|
|
5242
|
+
import * as z37 from "zod";
|
|
5243
|
+
var integer = /* @__PURE__ */ (() => z37.number().int().safe())();
|
|
4713
5244
|
var timestamp6 = /* @__PURE__ */ (() => integer.nonnegative().max(864e13))();
|
|
4714
|
-
var leaderboardWindowSchema = /* @__PURE__ */ (() =>
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
5245
|
+
var leaderboardWindowSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
|
|
5246
|
+
z37.object({ kind: z37.literal("all-time") }).strict(),
|
|
5247
|
+
z37.object({ kind: z37.literal("fixed"), start: timestamp6, end: timestamp6 }).strict().refine((w) => w.end > w.start, "Window end must follow its start"),
|
|
5248
|
+
z37.object({ kind: z37.literal("rolling"), days: integer.min(1).max(3660) }).strict(),
|
|
4718
5249
|
// Not strict: boards published while a calendar window named its own `timeZone` keep reading,
|
|
4719
5250
|
// and the field drops on parse. The authoring schema refuses it.
|
|
4720
|
-
|
|
4721
|
-
kind:
|
|
5251
|
+
z37.object({
|
|
5252
|
+
kind: z37.literal("calendar"),
|
|
4722
5253
|
/** The current day, week (ISO, starting on Monday) or month of the project calendar. */
|
|
4723
5254
|
period: calendarPeriodSchema.exclude(["lifetime"])
|
|
4724
5255
|
})
|
|
4725
5256
|
]))();
|
|
4726
5257
|
var periodScore = /* @__PURE__ */ (() => ({
|
|
4727
5258
|
window: leaderboardWindowSchema.default({ kind: "all-time" }),
|
|
4728
|
-
quests:
|
|
5259
|
+
quests: z37.array(identifier).min(1).max(100).optional()
|
|
4729
5260
|
}))();
|
|
4730
|
-
var scoreSchema = /* @__PURE__ */ (() =>
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
kind:
|
|
5261
|
+
var scoreSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
|
|
5262
|
+
z37.object({ kind: z37.literal("balance") }).strict(),
|
|
5263
|
+
z37.object({ kind: z37.literal("earned"), ...periodScore }).strict(),
|
|
5264
|
+
z37.object({
|
|
5265
|
+
kind: z37.literal("net"),
|
|
4735
5266
|
window: leaderboardWindowSchema.default({ kind: "all-time" })
|
|
4736
5267
|
}).strict()
|
|
4737
5268
|
]).default({ kind: "balance" }))();
|
|
4738
|
-
var leaderboardPrizeRewardSchema = /* @__PURE__ */ (() =>
|
|
5269
|
+
var leaderboardPrizeRewardSchema = /* @__PURE__ */ (() => z37.union([
|
|
4739
5270
|
pointsRewardSchema,
|
|
4740
5271
|
tierRewardSchema
|
|
4741
5272
|
]))();
|
|
4742
|
-
var leaderboardPrizeSchema = /* @__PURE__ */ (() =>
|
|
4743
|
-
ranks:
|
|
5273
|
+
var leaderboardPrizeSchema = /* @__PURE__ */ (() => z37.object({
|
|
5274
|
+
ranks: z37.tuple([integer.positive(), integer.positive()]).refine(([first, last]) => last >= first, {
|
|
4744
5275
|
message: "Prize rank range must end at or after it starts"
|
|
4745
5276
|
}),
|
|
4746
|
-
rewards:
|
|
5277
|
+
rewards: z37.array(leaderboardPrizeRewardSchema).min(1).max(20)
|
|
4747
5278
|
}).strict())();
|
|
4748
|
-
var baseUnitsSchema = /* @__PURE__ */ (() =>
|
|
5279
|
+
var baseUnitsSchema = /* @__PURE__ */ (() => z37.string().regex(
|
|
4749
5280
|
/^(0|[1-9]\d{0,77})$/,
|
|
4750
5281
|
'Use a whole number of base units, such as "1000000"'
|
|
4751
5282
|
))();
|
|
4752
|
-
var leaderboardPoolUnitSchema = /* @__PURE__ */ (() =>
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
code:
|
|
5283
|
+
var leaderboardPoolUnitSchema = /* @__PURE__ */ (() => z37.union([
|
|
5284
|
+
z37.literal("points"),
|
|
5285
|
+
z37.object({
|
|
5286
|
+
code: z37.string().trim().min(1).max(32),
|
|
4756
5287
|
decimals: integer.min(0).max(36)
|
|
4757
5288
|
}).strict()
|
|
4758
5289
|
]))();
|
|
@@ -4794,12 +5325,12 @@ var refinePool = (pool, context) => {
|
|
|
4794
5325
|
});
|
|
4795
5326
|
}
|
|
4796
5327
|
};
|
|
4797
|
-
var leaderboardPoolSchema = /* @__PURE__ */ (() =>
|
|
4798
|
-
var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() =>
|
|
4799
|
-
at:
|
|
4800
|
-
ties:
|
|
5328
|
+
var leaderboardPoolSchema = /* @__PURE__ */ (() => z37.object(poolShape).strict().superRefine(refinePool))();
|
|
5329
|
+
var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z37.object({
|
|
5330
|
+
at: z37.literal("window-end"),
|
|
5331
|
+
ties: z37.enum(["shared", "earliest"]),
|
|
4801
5332
|
/** Rank prizes. A board with a pool may list none. */
|
|
4802
|
-
prizes:
|
|
5333
|
+
prizes: z37.array(leaderboardPrizeSchema).max(50),
|
|
4803
5334
|
pool: leaderboardPoolSchema.optional()
|
|
4804
5335
|
}).strict().superRefine((policy, context) => {
|
|
4805
5336
|
if (!policy.prizes.length && !policy.pool) {
|
|
@@ -4831,10 +5362,10 @@ var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z35.object({
|
|
|
4831
5362
|
}
|
|
4832
5363
|
}
|
|
4833
5364
|
}))();
|
|
4834
|
-
var leaderboardDefinitionObject = /* @__PURE__ */ (() =>
|
|
5365
|
+
var leaderboardDefinitionObject = /* @__PURE__ */ (() => z37.object({
|
|
4835
5366
|
id: identifier,
|
|
4836
5367
|
key: identifier.optional(),
|
|
4837
|
-
title:
|
|
5368
|
+
title: z37.string().trim().min(1).max(120),
|
|
4838
5369
|
/**
|
|
4839
5370
|
* The point ledger the leaderboard ranks members by. Named `balance` from before ledger fields
|
|
4840
5371
|
* were named `ledger` (docs/management-api.md#field-names); a points pool's `ledger` is the
|
|
@@ -4842,20 +5373,20 @@ var leaderboardDefinitionObject = /* @__PURE__ */ (() => z35.object({
|
|
|
4842
5373
|
*/
|
|
4843
5374
|
balance: identifier,
|
|
4844
5375
|
score: scoreSchema,
|
|
4845
|
-
access:
|
|
5376
|
+
access: z37.enum(["participants", "public"]).default("participants"),
|
|
4846
5377
|
group: identifier.optional(),
|
|
4847
5378
|
/**
|
|
4848
5379
|
* List the project's eligible members who have no qualifying points, with a score of 0, ranked
|
|
4849
5380
|
* after every member who scored and ordered by member ID. Omitted or false lists only members
|
|
4850
5381
|
* with a qualifying entry. Settlements never include them.
|
|
4851
5382
|
*/
|
|
4852
|
-
includeUnscored:
|
|
5383
|
+
includeUnscored: z37.boolean().optional(),
|
|
4853
5384
|
/**
|
|
4854
5385
|
* How the live standings order equal scores. Omitted or `"shared"`: they share a rank. With
|
|
4855
5386
|
* `"earliest"`, the member whose last counted entry is earlier ranks first (then member ID), and
|
|
4856
5387
|
* every scored member gets its own rank: the order `settle.ties: "earliest"` uses.
|
|
4857
5388
|
*/
|
|
4858
|
-
ties:
|
|
5389
|
+
ties: z37.enum(["shared", "earliest"]).optional(),
|
|
4859
5390
|
settle: leaderboardSettlementPolicySchema.optional()
|
|
4860
5391
|
}).strict())();
|
|
4861
5392
|
var validateSettlementWindow = (definition, context) => {
|
|
@@ -4873,70 +5404,70 @@ var leaderboardDefinitionResponseSchema = /* @__PURE__ */ (() => responseShape(
|
|
|
4873
5404
|
))();
|
|
4874
5405
|
var leaderboardAuthoringSchema = /* @__PURE__ */ (() => leaderboardDefinitionObject.omit({ id: true }).extend({
|
|
4875
5406
|
...authoringIdentityShape,
|
|
4876
|
-
score:
|
|
5407
|
+
score: z37.preprocess(refuseWindowTimeZone, scoreSchema),
|
|
4877
5408
|
group: identifier.optional()
|
|
4878
5409
|
}).strict().superRefine(validateSettlementWindow))();
|
|
4879
|
-
var leaderboardArtifactSchema = /* @__PURE__ */ (() =>
|
|
5410
|
+
var leaderboardArtifactSchema = /* @__PURE__ */ (() => z37.union([
|
|
4880
5411
|
leaderboardAuthoringSchema,
|
|
4881
|
-
|
|
5412
|
+
z37.object({ code: z37.string().min(1).max(2e6) }).strict()
|
|
4882
5413
|
]))();
|
|
4883
|
-
var publishedLeaderboardSchema = /* @__PURE__ */ (() =>
|
|
4884
|
-
archivedAt:
|
|
5414
|
+
var publishedLeaderboardSchema = /* @__PURE__ */ (() => z37.object({
|
|
5415
|
+
archivedAt: z37.number().int().nonnegative().nullable().optional(),
|
|
4885
5416
|
version: identifier,
|
|
4886
5417
|
definition: leaderboardDefinitionResponseSchema,
|
|
4887
5418
|
publishedAt: timestamp6,
|
|
4888
|
-
actor:
|
|
5419
|
+
actor: z37.string().nullable()
|
|
4889
5420
|
}))();
|
|
4890
|
-
var leaderboardQuerySchema = /* @__PURE__ */ (() =>
|
|
4891
|
-
limit:
|
|
4892
|
-
cursor:
|
|
5421
|
+
var leaderboardQuerySchema = /* @__PURE__ */ (() => z37.object({
|
|
5422
|
+
limit: z37.coerce.number().int().min(1).max(100).default(25),
|
|
5423
|
+
cursor: z37.string().max(4096).optional()
|
|
4893
5424
|
}).strict())();
|
|
4894
|
-
var leaderboardRowSchema = /* @__PURE__ */ (() =>
|
|
5425
|
+
var leaderboardRowSchema = /* @__PURE__ */ (() => z37.object({
|
|
4895
5426
|
/** The row's stable key: a pseudonym per board and member. */
|
|
4896
5427
|
participant: identifier,
|
|
4897
5428
|
member: identifier.optional(),
|
|
4898
5429
|
/** The profile's name where the viewer can see it, otherwise the pseudonym's. */
|
|
4899
|
-
name:
|
|
5430
|
+
name: z37.string(),
|
|
4900
5431
|
score: integer,
|
|
4901
5432
|
rank: integer.positive(),
|
|
4902
5433
|
/** The member's profile, where visible to this viewer and not hidden by the member. */
|
|
4903
5434
|
profile: profileSummarySchema.nullable()
|
|
4904
5435
|
}))();
|
|
4905
|
-
var leaderboardPageSchema = /* @__PURE__ */ (() =>
|
|
5436
|
+
var leaderboardPageSchema = /* @__PURE__ */ (() => z37.object({
|
|
4906
5437
|
leaderboard: identifier,
|
|
4907
|
-
title:
|
|
5438
|
+
title: z37.string(),
|
|
4908
5439
|
version: identifier,
|
|
4909
|
-
calculation:
|
|
4910
|
-
period:
|
|
5440
|
+
calculation: z37.enum(["balance", "earned", "net"]),
|
|
5441
|
+
period: z37.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
|
|
4911
5442
|
calculatedAt: timestamp6,
|
|
4912
5443
|
lastEntryAt: timestamp6.nullable(),
|
|
4913
5444
|
total: integer.nonnegative(),
|
|
4914
|
-
items:
|
|
5445
|
+
items: z37.array(leaderboardRowSchema),
|
|
4915
5446
|
me: leaderboardRowSchema.nullable(),
|
|
4916
|
-
nearby:
|
|
4917
|
-
nextCursor:
|
|
5447
|
+
nearby: z37.array(leaderboardRowSchema),
|
|
5448
|
+
nextCursor: z37.string().nullable()
|
|
4918
5449
|
}))();
|
|
4919
|
-
var leaderboardPlacementSchema = /* @__PURE__ */ (() =>
|
|
5450
|
+
var leaderboardPlacementSchema = /* @__PURE__ */ (() => z37.object({
|
|
4920
5451
|
leaderboard: identifier,
|
|
4921
5452
|
key: identifier.optional(),
|
|
4922
|
-
title:
|
|
5453
|
+
title: z37.string(),
|
|
4923
5454
|
profile: identifier,
|
|
4924
5455
|
rank: integer.positive().nullable(),
|
|
4925
5456
|
score: integer.nullable(),
|
|
4926
5457
|
/** Ranked participants on the board. */
|
|
4927
5458
|
total: integer.nonnegative()
|
|
4928
5459
|
}))();
|
|
4929
|
-
var leaderboardHistoryQuerySchema = /* @__PURE__ */ (() =>
|
|
5460
|
+
var leaderboardHistoryQuerySchema = /* @__PURE__ */ (() => z37.strictObject({
|
|
4930
5461
|
board: identifier,
|
|
4931
5462
|
cursor: pageCursorSchema.optional()
|
|
4932
5463
|
}))();
|
|
4933
|
-
var leaderboardHistoryPageSchema = /* @__PURE__ */ (() =>
|
|
5464
|
+
var leaderboardHistoryPageSchema = /* @__PURE__ */ (() => z37.object({
|
|
4934
5465
|
leaderboard: identifier,
|
|
4935
|
-
period:
|
|
4936
|
-
items:
|
|
5466
|
+
period: z37.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
|
|
5467
|
+
items: z37.array(pointEntrySchema),
|
|
4937
5468
|
nextCursor: pageCursorSchema.nullable()
|
|
4938
5469
|
}))();
|
|
4939
|
-
var leaderboardPreviewSchema = /* @__PURE__ */ (() =>
|
|
5470
|
+
var leaderboardPreviewSchema = /* @__PURE__ */ (() => z37.object({
|
|
4940
5471
|
published: publishedLeaderboardSchema,
|
|
4941
5472
|
before: leaderboardPageSchema.nullable(),
|
|
4942
5473
|
after: leaderboardPageSchema
|
|
@@ -4945,53 +5476,53 @@ var mutationBase = /* @__PURE__ */ (() => ({
|
|
|
4945
5476
|
actionId: identifier,
|
|
4946
5477
|
member: identifier,
|
|
4947
5478
|
balance: identifier,
|
|
4948
|
-
reason:
|
|
5479
|
+
reason: z37.string().trim().min(1).max(1e3)
|
|
4949
5480
|
}))();
|
|
4950
5481
|
var datedMutation = /* @__PURE__ */ (() => ({ ...mutationBase, effectiveAt: timestamp6.optional() }))();
|
|
4951
|
-
var pointsMutationSchema = /* @__PURE__ */ (() =>
|
|
4952
|
-
|
|
5482
|
+
var pointsMutationSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
|
|
5483
|
+
z37.object({
|
|
4953
5484
|
...datedMutation,
|
|
4954
|
-
kind:
|
|
4955
|
-
referralEligible:
|
|
5485
|
+
kind: z37.literal("award"),
|
|
5486
|
+
referralEligible: z37.boolean().optional(),
|
|
4956
5487
|
amount: integer.positive()
|
|
4957
5488
|
}).strict(),
|
|
4958
|
-
|
|
5489
|
+
z37.object({
|
|
4959
5490
|
...datedMutation,
|
|
4960
|
-
kind:
|
|
5491
|
+
kind: z37.literal("spend"),
|
|
4961
5492
|
amount: integer.positive()
|
|
4962
5493
|
}).strict(),
|
|
4963
|
-
|
|
5494
|
+
z37.object({
|
|
4964
5495
|
...datedMutation,
|
|
4965
|
-
kind:
|
|
5496
|
+
kind: z37.literal("adjust"),
|
|
4966
5497
|
amount: integer.refine((n) => n !== 0)
|
|
4967
5498
|
}).strict(),
|
|
4968
|
-
|
|
5499
|
+
z37.object({
|
|
4969
5500
|
...datedMutation,
|
|
4970
|
-
kind:
|
|
5501
|
+
kind: z37.literal("set"),
|
|
4971
5502
|
total: integer.nonnegative(),
|
|
4972
5503
|
expectedTotal: integer.nonnegative(),
|
|
4973
|
-
classification:
|
|
5504
|
+
classification: z37.enum(["earned", "spend"])
|
|
4974
5505
|
}).strict(),
|
|
4975
|
-
|
|
5506
|
+
z37.object({
|
|
4976
5507
|
...mutationBase,
|
|
4977
|
-
kind:
|
|
5508
|
+
kind: z37.literal("reverse"),
|
|
4978
5509
|
entry: identifier,
|
|
4979
5510
|
amount: integer.positive()
|
|
4980
5511
|
}).strict()
|
|
4981
5512
|
]))();
|
|
4982
|
-
var pointsEntrySchema = /* @__PURE__ */ (() =>
|
|
5513
|
+
var pointsEntrySchema = /* @__PURE__ */ (() => z37.object({
|
|
4983
5514
|
id: identifier,
|
|
4984
|
-
completion:
|
|
5515
|
+
completion: z37.string().nullable(),
|
|
4985
5516
|
member: identifier,
|
|
4986
5517
|
balance: identifier,
|
|
4987
5518
|
amount: integer,
|
|
4988
|
-
kind:
|
|
5519
|
+
kind: z37.enum(["award", "spend", "adjust", "reverse"]),
|
|
4989
5520
|
effectiveAt: timestamp6,
|
|
4990
5521
|
receivedAt: timestamp6,
|
|
4991
5522
|
quest: identifier.nullable(),
|
|
4992
5523
|
original: identifier.nullable(),
|
|
4993
|
-
reason:
|
|
4994
|
-
actor:
|
|
5524
|
+
reason: z37.string(),
|
|
5525
|
+
actor: z37.string().nullable(),
|
|
4995
5526
|
/**
|
|
4996
5527
|
* The member import whose opening balance this `adjust` is, or null. Imported entries emit no
|
|
4997
5528
|
* `points.awarded` and count on balance leaderboards only. Absent from Relay versions without
|
|
@@ -4999,103 +5530,116 @@ var pointsEntrySchema = /* @__PURE__ */ (() => z35.object({
|
|
|
4999
5530
|
*/
|
|
5000
5531
|
import: identifier.nullable().optional()
|
|
5001
5532
|
}))();
|
|
5002
|
-
var managedPointHistoryPageSchema = /* @__PURE__ */ (() =>
|
|
5003
|
-
items:
|
|
5533
|
+
var managedPointHistoryPageSchema = /* @__PURE__ */ (() => z37.object({
|
|
5534
|
+
items: z37.array(pointsEntrySchema),
|
|
5004
5535
|
nextCursor: pageCursorSchema.nullable(),
|
|
5005
5536
|
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
5006
|
-
next:
|
|
5537
|
+
next: z37.number().nullable()
|
|
5007
5538
|
}))();
|
|
5008
|
-
var pointsResultSchema = /* @__PURE__ */ (() =>
|
|
5539
|
+
var pointsResultSchema = /* @__PURE__ */ (() => z37.object({
|
|
5009
5540
|
entry: pointsEntrySchema,
|
|
5010
5541
|
total: integer.nonnegative()
|
|
5011
5542
|
}))();
|
|
5012
|
-
var pointsAccountSchema = /* @__PURE__ */ (() =>
|
|
5543
|
+
var pointsAccountSchema = /* @__PURE__ */ (() => z37.object({
|
|
5013
5544
|
member: identifier,
|
|
5014
5545
|
balance: identifier,
|
|
5015
5546
|
total: integer.nonnegative(),
|
|
5016
5547
|
held: integer.nonnegative()
|
|
5017
5548
|
}))();
|
|
5018
|
-
var leaderboardExclusionSchema = /* @__PURE__ */ (() =>
|
|
5549
|
+
var leaderboardExclusionSchema = /* @__PURE__ */ (() => z37.object({
|
|
5019
5550
|
actionId: identifier,
|
|
5020
5551
|
member: identifier,
|
|
5021
|
-
excluded:
|
|
5022
|
-
reason:
|
|
5552
|
+
excluded: z37.boolean(),
|
|
5553
|
+
reason: z37.string().trim().min(1).max(1e3)
|
|
5023
5554
|
}).strict())();
|
|
5024
|
-
var leaderboardExclusionGroupSchema = /* @__PURE__ */ (() =>
|
|
5555
|
+
var leaderboardExclusionGroupSchema = /* @__PURE__ */ (() => z37.object({
|
|
5025
5556
|
leaderboard: identifier,
|
|
5026
5557
|
group: identifier,
|
|
5027
|
-
generated:
|
|
5558
|
+
generated: z37.boolean(),
|
|
5028
5559
|
boundAt: timestamp6.nullable()
|
|
5029
5560
|
}))();
|
|
5030
|
-
var leaderboardExclusionGroupBindingSchema = /* @__PURE__ */ (() =>
|
|
5561
|
+
var leaderboardExclusionGroupBindingSchema = /* @__PURE__ */ (() => z37.object({
|
|
5031
5562
|
actionId: identifier,
|
|
5032
5563
|
group: identifier,
|
|
5033
|
-
reason:
|
|
5564
|
+
reason: z37.string().trim().min(1).max(1e3)
|
|
5034
5565
|
}).strict())();
|
|
5035
|
-
var leaderboardGroupSchema = /* @__PURE__ */ (() =>
|
|
5566
|
+
var leaderboardGroupSchema = /* @__PURE__ */ (() => z37.object({
|
|
5036
5567
|
actionId: identifier,
|
|
5037
5568
|
member: identifier,
|
|
5038
|
-
included:
|
|
5039
|
-
reason:
|
|
5569
|
+
included: z37.boolean(),
|
|
5570
|
+
reason: z37.string().trim().min(1).max(1e3)
|
|
5040
5571
|
}).strict())();
|
|
5041
|
-
var leaderboardSettlementStatusSchema = /* @__PURE__ */ (() =>
|
|
5042
|
-
var leaderboardSettlementSummarySchema = /* @__PURE__ */ (() =>
|
|
5572
|
+
var leaderboardSettlementStatusSchema = /* @__PURE__ */ (() => z37.enum(["pending", "approved"]))();
|
|
5573
|
+
var leaderboardSettlementSummarySchema = /* @__PURE__ */ (() => z37.object({
|
|
5043
5574
|
id: identifier,
|
|
5044
5575
|
leaderboard: identifier,
|
|
5045
5576
|
version: identifier,
|
|
5046
|
-
title:
|
|
5047
|
-
period:
|
|
5048
|
-
ties:
|
|
5577
|
+
title: z37.string(),
|
|
5578
|
+
period: z37.object({ start: timestamp6, end: timestamp6 }),
|
|
5579
|
+
ties: z37.enum(["shared", "earliest"]),
|
|
5049
5580
|
status: leaderboardSettlementStatusSchema,
|
|
5050
5581
|
total: integer.nonnegative(),
|
|
5051
5582
|
winners: integer.nonnegative(),
|
|
5052
5583
|
createdAt: timestamp6,
|
|
5053
5584
|
approvedAt: timestamp6.nullable(),
|
|
5054
|
-
approvedBy:
|
|
5055
|
-
approvalReason:
|
|
5056
|
-
}))();
|
|
5057
|
-
var
|
|
5585
|
+
approvedBy: z37.string().nullable(),
|
|
5586
|
+
approvalReason: z37.string().nullable()
|
|
5587
|
+
}))();
|
|
5588
|
+
var settlementPaymentSchema = /* @__PURE__ */ (() => z37.object({
|
|
5589
|
+
status: z37.string(),
|
|
5590
|
+
/** The CAIP-2 cluster of the batch that pays or paid the share; null when unpaid. */
|
|
5591
|
+
network: z37.string().nullable(),
|
|
5592
|
+
/** The transaction that paid the share; null until paid. */
|
|
5593
|
+
signature: z37.string().nullable(),
|
|
5594
|
+
paidAt: timestamp6.nullable()
|
|
5595
|
+
}))();
|
|
5596
|
+
var leaderboardSettlementRowSchema = /* @__PURE__ */ (() => z37.object({
|
|
5058
5597
|
member: identifier,
|
|
5059
5598
|
score: integer,
|
|
5060
5599
|
rank: integer.positive(),
|
|
5061
5600
|
position: integer.positive(),
|
|
5062
5601
|
scoredAt: timestamp6,
|
|
5063
|
-
prizes:
|
|
5602
|
+
prizes: z37.array(integer.nonnegative()),
|
|
5064
5603
|
completion: identifier.nullable(),
|
|
5065
5604
|
revokedAt: timestamp6.nullable(),
|
|
5066
5605
|
/**
|
|
5067
5606
|
* The member's pool share in the pool's base units, frozen with the row: `"0"` for a member the
|
|
5068
5607
|
* pool leaves out. Absent when the settlement has no pool.
|
|
5069
5608
|
*/
|
|
5070
|
-
share: baseUnitsSchema.optional()
|
|
5609
|
+
share: baseUnitsSchema.optional(),
|
|
5610
|
+
/**
|
|
5611
|
+
* How the row's pool share was paid on chain, for a non-zero share in a pool whose unit is not
|
|
5612
|
+
* points. Absent otherwise, and from Relay versions without Solana payouts.
|
|
5613
|
+
*/
|
|
5614
|
+
payment: settlementPaymentSchema.optional()
|
|
5071
5615
|
}))();
|
|
5072
|
-
var leaderboardSettlementPoolSchema = /* @__PURE__ */ (() =>
|
|
5616
|
+
var leaderboardSettlementPoolSchema = /* @__PURE__ */ (() => z37.object({
|
|
5073
5617
|
...poolShape,
|
|
5074
5618
|
allocated: baseUnitsSchema,
|
|
5075
5619
|
unallocated: baseUnitsSchema
|
|
5076
5620
|
}))();
|
|
5077
|
-
var leaderboardSettlementUnmeasuredSchema = /* @__PURE__ */ (() =>
|
|
5078
|
-
content:
|
|
5621
|
+
var leaderboardSettlementUnmeasuredSchema = /* @__PURE__ */ (() => z37.object({
|
|
5622
|
+
content: z37.string(),
|
|
5079
5623
|
member: identifier,
|
|
5080
5624
|
/** When the last good measurement was observed, if Relay has one. */
|
|
5081
5625
|
observedAt: timestamp6.nullable()
|
|
5082
5626
|
}))();
|
|
5083
5627
|
var leaderboardSettlementSchema = /* @__PURE__ */ (() => leaderboardSettlementSummarySchema.extend({
|
|
5084
|
-
prizes:
|
|
5085
|
-
excluded:
|
|
5628
|
+
prizes: z37.array(leaderboardPrizeSchema),
|
|
5629
|
+
excluded: z37.array(identifier),
|
|
5086
5630
|
/**
|
|
5087
5631
|
* Content frozen at its last good measurement because its closing measurement never came; a
|
|
5088
5632
|
* reviewer can retry measurement. Relay sends it for every settlement, empty when nothing is
|
|
5089
5633
|
* missing.
|
|
5090
5634
|
*/
|
|
5091
|
-
unmeasured:
|
|
5635
|
+
unmeasured: z37.array(leaderboardSettlementUnmeasuredSchema).optional(),
|
|
5092
5636
|
/** The settlement's pool prize, or null without one. Absent from Relay versions without pools. */
|
|
5093
5637
|
pool: leaderboardSettlementPoolSchema.nullable().optional(),
|
|
5094
|
-
rows:
|
|
5638
|
+
rows: z37.array(leaderboardSettlementRowSchema)
|
|
5095
5639
|
}))();
|
|
5096
|
-
var leaderboardSettlementApprovalSchema = /* @__PURE__ */ (() =>
|
|
5640
|
+
var leaderboardSettlementApprovalSchema = /* @__PURE__ */ (() => z37.object({
|
|
5097
5641
|
actionId: identifier,
|
|
5098
|
-
reason:
|
|
5642
|
+
reason: z37.string().trim().min(1).max(500)
|
|
5099
5643
|
}).strict())();
|
|
5100
5644
|
|
|
5101
5645
|
export {
|
|
@@ -5138,6 +5682,10 @@ export {
|
|
|
5138
5682
|
youtubeShortsNamespace,
|
|
5139
5683
|
tiktokVideosNamespace,
|
|
5140
5684
|
walletBalancesNamespace,
|
|
5685
|
+
walletProgramActivityNamespace,
|
|
5686
|
+
walletNftsNamespace,
|
|
5687
|
+
walletStakeNamespace,
|
|
5688
|
+
walletProgramAccountsNamespace,
|
|
5141
5689
|
telegramSignInMethodsSchema,
|
|
5142
5690
|
telegramAccountConnectionSchema,
|
|
5143
5691
|
telegramInitDataSchema,
|
|
@@ -5153,6 +5701,8 @@ export {
|
|
|
5153
5701
|
telegramReactionDataSchema,
|
|
5154
5702
|
telegramMessageDataSchema,
|
|
5155
5703
|
limits,
|
|
5704
|
+
base58,
|
|
5705
|
+
base58Bytes,
|
|
5156
5706
|
solanaAddressSchema,
|
|
5157
5707
|
walletChainSchema,
|
|
5158
5708
|
cosmosNetworkSchema,
|
|
@@ -5168,6 +5718,10 @@ export {
|
|
|
5168
5718
|
walletSignatureSchema,
|
|
5169
5719
|
isEvmChainId,
|
|
5170
5720
|
evmChainIdSchema,
|
|
5721
|
+
solanaMemoProgram,
|
|
5722
|
+
solanaSignatureSchema,
|
|
5723
|
+
walletTransactionChallengeSchema,
|
|
5724
|
+
walletTransactionProofSchema,
|
|
5171
5725
|
linkedWalletSchema,
|
|
5172
5726
|
walletUnlinkInputSchema,
|
|
5173
5727
|
walletAddressInput,
|
|
@@ -5180,9 +5734,11 @@ export {
|
|
|
5180
5734
|
caip10,
|
|
5181
5735
|
walletBalanceSchema,
|
|
5182
5736
|
walletBalanceSampleSchema,
|
|
5737
|
+
walletProgramActivitySchema,
|
|
5183
5738
|
parseNftCollection,
|
|
5184
5739
|
isNftCollection,
|
|
5185
5740
|
walletNftsSchema,
|
|
5741
|
+
walletNftSampleSchema,
|
|
5186
5742
|
parseContractFunction,
|
|
5187
5743
|
parseContractCall,
|
|
5188
5744
|
isContractCall,
|
|
@@ -5199,6 +5755,13 @@ export {
|
|
|
5199
5755
|
maxWalletTransactions,
|
|
5200
5756
|
maxWalletTransactionLookback,
|
|
5201
5757
|
walletTransactionsSchema,
|
|
5758
|
+
solanaTransactionFixtureInputSchema,
|
|
5759
|
+
solanaSeedSchema,
|
|
5760
|
+
maxSolanaSeeds,
|
|
5761
|
+
walletProgramAccountSchema,
|
|
5762
|
+
walletStakeSchema,
|
|
5763
|
+
walletStakeSampleSchema,
|
|
5764
|
+
walletProgramAccountSampleSchema,
|
|
5202
5765
|
lifecycleReasonSchema,
|
|
5203
5766
|
offsetDateTimeSchema,
|
|
5204
5767
|
discordMessageSchema,
|
|
@@ -5238,6 +5801,10 @@ export {
|
|
|
5238
5801
|
xContentMetrics,
|
|
5239
5802
|
customContentSchema,
|
|
5240
5803
|
walletBalanceSourceSchema,
|
|
5804
|
+
walletProgramActivitySourceSchema,
|
|
5805
|
+
walletNftSourceSchema,
|
|
5806
|
+
walletStakeSourceSchema,
|
|
5807
|
+
walletProgramAccountSourceSchema,
|
|
5241
5808
|
xSearchSourceSchema,
|
|
5242
5809
|
customSourceSchema,
|
|
5243
5810
|
trackerSourceSchema,
|
|
@@ -5257,6 +5824,14 @@ export {
|
|
|
5257
5824
|
trackerPropertiesSchema,
|
|
5258
5825
|
trackerCreateSchema,
|
|
5259
5826
|
managedTrackerCreateSchema,
|
|
5827
|
+
walletProgramActivityTrackerSourceSchema,
|
|
5828
|
+
programActivityTrackerCreateSchema,
|
|
5829
|
+
walletNftsTrackerSourceSchema,
|
|
5830
|
+
nftTrackerCreateSchema,
|
|
5831
|
+
walletStakeTrackerSourceSchema,
|
|
5832
|
+
stakeTrackerCreateSchema,
|
|
5833
|
+
walletProgramAccountsTrackerSourceSchema,
|
|
5834
|
+
programAccountTrackerCreateSchema,
|
|
5260
5835
|
trackerUpdateSchema,
|
|
5261
5836
|
trackerControlSchema,
|
|
5262
5837
|
trackerAccountSchema,
|
|
@@ -5364,6 +5939,16 @@ export {
|
|
|
5364
5939
|
quizQuestionSchema,
|
|
5365
5940
|
quizQuestionsSchema,
|
|
5366
5941
|
quizContentSchema,
|
|
5942
|
+
inWindow,
|
|
5943
|
+
maxSolanaActionReference,
|
|
5944
|
+
solanaActionMemo,
|
|
5945
|
+
parseSolanaActionMemo,
|
|
5946
|
+
takesSolanaTransaction,
|
|
5947
|
+
questStationsSchema,
|
|
5948
|
+
stationRefusal,
|
|
5949
|
+
solanaSignatureSchema2,
|
|
5950
|
+
solanaTransactionSubmissionSchema,
|
|
5951
|
+
attemptActionSchema,
|
|
5367
5952
|
resourceSourceSchema,
|
|
5368
5953
|
resourceRequestSchema,
|
|
5369
5954
|
resourceOptionsSchema,
|
|
@@ -5523,6 +6108,9 @@ export {
|
|
|
5523
6108
|
avatarProviderSchema,
|
|
5524
6109
|
profileDefaultProviderSchema,
|
|
5525
6110
|
profileDefaultsSchema,
|
|
6111
|
+
knownProfileDefaultSources,
|
|
6112
|
+
profileDefaultSourcesSchema,
|
|
6113
|
+
profileNameSourceSchema,
|
|
5526
6114
|
avatarSeedSchema,
|
|
5527
6115
|
profileAvatarSchema,
|
|
5528
6116
|
profileSummarySchema,
|
|
@@ -5569,6 +6157,7 @@ export {
|
|
|
5569
6157
|
leaderboardGroupSchema,
|
|
5570
6158
|
leaderboardSettlementStatusSchema,
|
|
5571
6159
|
leaderboardSettlementSummarySchema,
|
|
6160
|
+
settlementPaymentSchema,
|
|
5572
6161
|
leaderboardSettlementRowSchema,
|
|
5573
6162
|
leaderboardSettlementPoolSchema,
|
|
5574
6163
|
leaderboardSettlementUnmeasuredSchema,
|