@domino-sdk/relay 1.59.0 → 1.61.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/{accounts-CVonEkdb.d.ts → accounts-DoabriBX.d.ts} +4 -1
  3. package/dist/{integrations-DrbKQSTD.d.ts → announcements-CHx3-HBw.d.ts} +48 -42
  4. package/dist/{attempt-captures-DBj-rxak.d.ts → attempt-captures-DYnJVkfg.d.ts} +1 -1
  5. package/dist/authoring.d.ts +161 -29
  6. package/dist/authoring.js +116 -36
  7. package/dist/{automatic-outcomes-FS9okvBP.d.ts → automatic-outcomes-If88LR9f.d.ts} +1 -1
  8. package/dist/avatar.d.ts +1 -1
  9. package/dist/browser.d.ts +19 -10
  10. package/dist/browser.js +12 -10
  11. package/dist/{capability-error-DDJl0LY-.d.ts → capability-error-DufwG3G0.d.ts} +21 -1
  12. package/dist/{chunk-2LKGAL63.js → chunk-24I4R732.js} +39 -2
  13. package/dist/{chunk-UEMLYPKJ.js → chunk-3Y3L2F54.js} +34 -5
  14. package/dist/{chunk-YRSU2X2P.js → chunk-5I54XBK2.js} +2 -2
  15. package/dist/{chunk-KBCTII6C.js → chunk-7A4J67ZL.js} +1 -1
  16. package/dist/{chunk-LDLOB2UZ.js → chunk-DHXDBAJF.js} +4 -4
  17. package/dist/{chunk-W42KMMH5.js → chunk-DYXDZFKA.js} +5 -2
  18. package/dist/{chunk-TZJT5CRF.js → chunk-EN3M5Z4J.js} +1 -1
  19. package/dist/{chunk-IBROKMFV.js → chunk-L77O64I4.js} +1 -1
  20. package/dist/{chunk-EQF4ID47.js → chunk-PPB7HALD.js} +12 -2
  21. package/dist/{chunk-KYUQEZZA.js → chunk-QEAS4ZGS.js} +1 -1
  22. package/dist/{chunk-6U5WWH3W.js → chunk-QNUHWK7R.js} +9 -4
  23. package/dist/{chunk-YMWRLAAP.js → chunk-RHBS5FJL.js} +8 -2
  24. package/dist/chunk-SE4PFJPT.js +247 -0
  25. package/dist/{chunk-577DG2IT.js → chunk-SKGTNTLF.js} +12 -12
  26. package/dist/{chunk-M2JQPDUX.js → chunk-VURRFVNP.js} +9 -9
  27. package/dist/{chunk-R4S6BFOH.js → chunk-XBV2CK2H.js} +1 -1
  28. package/dist/{chunk-AWWCEP7F.js → chunk-ZDJLPN4L.js} +815 -592
  29. package/dist/{client-3b9HjSzZ.d.ts → client-C51w7fMb.d.ts} +12 -7
  30. package/dist/{deployments-BydFVj4Q.d.ts → deployments-kWoHFaqj.d.ts} +786 -2
  31. package/dist/{groups-CFuTfFqG.d.ts → groups-CqcA2Ycs.d.ts} +4 -1
  32. package/dist/index.d.ts +10 -10
  33. package/dist/index.js +9 -9
  34. package/dist/{analytics-URV-mxjH.d.ts → integrations-B3y36OaB.d.ts} +55 -1
  35. package/dist/internal.d.ts +11 -11
  36. package/dist/internal.js +8 -8
  37. package/dist/{offers-DAfe1O3_.d.ts → offers-BoV4ryUc.d.ts} +3 -2
  38. package/dist/{pages-ChDVLrgR.d.ts → pages-K7-KjSXw.d.ts} +147 -2
  39. package/dist/{participant-activity-iciCEs_8.d.ts → participant-activity-DHL8QYks.d.ts} +4 -0
  40. package/dist/portal-proxy.js +3 -3
  41. package/dist/react/index.d.ts +20 -15
  42. package/dist/react/index.js +143 -14
  43. package/dist/runtime/authoring.js +1 -1
  44. package/dist/runtime/chunks/5QVFB4TU.js +1 -0
  45. package/dist/runtime/manifest.json +3 -3
  46. package/dist/runtime/schema.js +1 -1
  47. package/dist/{schema-BA0nRRlt.d.ts → schema-CZ6Rj0ZF.d.ts} +142 -2
  48. package/dist/schema.d.ts +113 -18
  49. package/dist/schema.js +37 -21
  50. package/dist/server/index.d.ts +11 -11
  51. package/dist/server/index.js +346 -41
  52. package/dist/{submission-input-DxQ6RnKo.d.ts → submission-input-C54Q8yAD.d.ts} +2 -2
  53. package/dist/{telegram-browser-o3OIxGrJ.d.ts → telegram-browser-BUceZIGZ.d.ts} +7 -4
  54. package/dist/testing.d.ts +7 -7
  55. package/dist/testing.js +8 -8
  56. package/dist/{transport-D_Eqf78J.d.ts → transport-BrX9pIGN.d.ts} +5374 -62
  57. package/dist/{wallet-B06zvDXp.d.ts → wallet-CIqFoxdm.d.ts} +8 -1
  58. package/dist/{x-C28SNifw.d.ts → x-D1PGi8Sq.d.ts} +2 -2
  59. package/package.json +1 -1
  60. package/dist/chunk-XGXDINGM.js +0 -357
  61. package/dist/runtime/chunks/BG43KQ2T.js +0 -1
@@ -412,6 +412,13 @@ type WalletSigner = {
412
412
  signature: string;
413
413
  publicKey?: string;
414
414
  }>;
415
+ /**
416
+ * Calls `listener` with the wallet's accounts now, without a prompt, and each time they change;
417
+ * the selected account comes first, and an empty list means the wallet is locked or disconnected.
418
+ * Returns the function that stops it. `evmSigner` has it (`eth_accounts` and `accountsChanged`):
419
+ * `RelayProvider` signs the participant out when the wallet they signed in with switches accounts.
420
+ */
421
+ watchAccounts?(listener: (accounts: readonly string[]) => void): () => void;
415
422
  };
416
423
  /** Builds the challenge input for a signer's address. */
417
424
  declare function walletAddressInput(signer: WalletSigner): Promise<WalletAddressInput>;
@@ -969,4 +976,4 @@ interface WalletReader {
969
976
  transactions?(query: WalletTransactionsQuery): Promise<WalletTransactions | null>;
970
977
  }
971
978
 
972
- export { type WalletTransactionsQuery as $, type AvatarProvider as A, type NftCollectionParts as B, type CosmosChain as C, type NftStandard as D, type EvmChainId as E, type WalletBalance as F, type WalletBalanceChange as G, type WalletBalanceQuery as H, type WalletBalanceSample as I, type WalletCall as J, type WalletCallArgument as K, type LinkedWallet as L, type WalletCallQuery as M, type NftCollection as N, type OwnProfile as O, type ProfileAvatar as P, type WalletDelegations as Q, type WalletDelegationsQuery as R, type SolanaProgram as S, type WalletEventCondition as T, type WalletEventValue as U, type WalletEvents as V, type WalletAddressInput as W, type WalletEventsQuery as X, type WalletNfts as Y, type WalletNftsQuery as Z, type WalletTransactions as _, type CosmosNetwork as a, walletDelegationsSchema as a$, cosmosDenomSchema as a0, cosmosNetworkSchema as a1, isContractCall as a2, isContractEvent as a3, isEvmChainId as a4, isNftCollection as a5, isSolanaProgram as a6, maxWalletEventLogs as a7, maxWalletEventLookback as a8, maxWalletTransactionLookback as a9, cosmosChain as aA, displayNameSchema as aB, evmAddressSchema as aC, evmChainIdSchema as aD, linkedWalletSchema as aE, managedProfileSchema as aF, ownProfileSchema as aG, profileAvatarSchema as aH, profileCompletionPageSchema as aI, profileCompletionQuerySchema as aJ, profileCompletionSchema as aK, profileDefaultProviderSchema as aL, profileDefaultsSchema as aM, profileModerationSchema as aN, profileReferralSchema as aO, profileSettingsInputSchema as aP, profileSettingsSchema as aQ, profileSummarySchema as aR, profileVisibilitySchema as aS, solanaAddressSchema as aT, solanaMainnet as aU, solanaProgramIdlSchema as aV, walletAddressInput as aW, walletBalanceSampleSchema as aX, walletBalanceSchema as aY, walletCallSchema as aZ, walletChainSchema as a_, maxWalletTransactions as aa, parseContractCall as ab, parseContractEvent as ac, parseContractFunction as ad, parseNftCollection as ae, type SolanaIdlSource as af, profileUpdateSchema as ag, walletAddressInputSchema as ah, walletSignatureSchema as ai, AVATAR_UPLOAD_LIMIT as aj, type AnchorIdl as ak, type KnownSolanaIdlSource as al, type ManagedProfile as am, type ProfileDefaultProvider as an, type ProfileDefaults as ao, type ProfileModeration as ap, type ProfileSettings as aq, type ProfileSettingsInput as ar, type SolanaProgramIdl as as, WALLETS_PER_CHAIN as at, anchorIdlSchema as au, avatarProviderSchema as av, avatarSeedSchema as aw, avatarUploadTypes as ax, caip10 as ay, cosmosAddressSchema as az, type ProfileCompletion as b, walletEventsSchema as b0, walletMessageChallengeSchema as b1, walletNftsSchema as b2, walletSignInFamilies as b3, walletSignInNetwork as b4, walletSignInNetworkSchema as b5, walletSignInNetworksSchema as b6, walletTransactionsSchema as b7, walletUnlinkInputSchema as b8, type ProfileCompletionPage as c, type ProfileCompletionQuery as d, type ProfileReferral as e, type ProfileSummary as f, type ProfileUpdate as g, type ProfileVisibility as h, type WalletChain as i, type WalletMessageChallenge as j, type WalletSignInNetwork as k, type WalletSignature as l, type WalletSigner as m, type WalletUnlinkInput as n, type ContractCall as o, type ContractEvent as p, type WalletBalanceSourceQuery as q, type WalletTransaction as r, type WalletInstruction as s, type WalletReader as t, type ContractCallParts as u, type ContractCallReturnType as v, type ContractEventInput as w, type ContractEventParts as x, type ContractFunction as y, type CosmosDenom as z };
979
+ export { type WalletTransactionsQuery as $, type AvatarProvider as A, type NftCollectionParts as B, type CosmosChain as C, type NftStandard as D, type EvmChainId as E, type WalletBalance as F, type WalletBalanceChange as G, type WalletBalanceQuery as H, type WalletBalanceSample as I, type WalletCall as J, type WalletCallArgument as K, type LinkedWallet as L, type WalletCallQuery as M, type NftCollection as N, type OwnProfile as O, type ProfileAvatar as P, type WalletDelegations as Q, type WalletDelegationsQuery as R, type SolanaProgram as S, type WalletEventCondition as T, type WalletEventValue as U, type WalletEvents as V, type WalletAddressInput as W, type WalletEventsQuery as X, type WalletNfts as Y, type WalletNftsQuery as Z, type WalletTransactions as _, type CosmosNetwork as a, solanaProgramIdlSchema as a$, cosmosDenomSchema as a0, cosmosNetworkSchema as a1, isContractCall as a2, isContractEvent as a3, isEvmChainId as a4, isNftCollection as a5, isSolanaProgram as a6, maxWalletEventLogs as a7, maxWalletEventLookback as a8, maxWalletTransactionLookback as a9, type SolanaProgramIdl as aA, WALLETS_PER_CHAIN as aB, anchorIdlSchema as aC, avatarProviderSchema as aD, avatarSeedSchema as aE, avatarUploadTypes as aF, caip10 as aG, cosmosAddressSchema as aH, cosmosChain as aI, displayNameSchema as aJ, evmAddressSchema as aK, evmChainIdSchema as aL, managedProfileSchema as aM, ownProfileSchema as aN, profileAvatarSchema as aO, profileCompletionPageSchema as aP, profileCompletionQuerySchema as aQ, profileCompletionSchema as aR, profileDefaultProviderSchema as aS, profileDefaultsSchema as aT, profileModerationSchema as aU, profileSettingsInputSchema as aV, profileSettingsSchema as aW, profileSummarySchema as aX, profileVisibilitySchema as aY, solanaAddressSchema as aZ, solanaMainnet as a_, maxWalletTransactions as aa, parseContractCall as ab, parseContractEvent as ac, parseContractFunction as ad, parseNftCollection as ae, type SolanaIdlSource as af, profileUpdateSchema as ag, walletAddressInputSchema as ah, walletSignatureSchema as ai, profileReferralSchema as aj, linkedWalletSchema as ak, walletBalanceSchema as al, walletNftsSchema as am, walletCallSchema as an, walletDelegationsSchema as ao, walletEventsSchema as ap, walletTransactionsSchema as aq, AVATAR_UPLOAD_LIMIT as ar, type AnchorIdl as as, type KnownSolanaIdlSource as at, type ManagedProfile as au, type ProfileDefaultProvider as av, type ProfileDefaults as aw, type ProfileModeration as ax, type ProfileSettings as ay, type ProfileSettingsInput as az, type ProfileCompletion as b, walletAddressInput as b0, walletBalanceSampleSchema as b1, walletChainSchema as b2, walletMessageChallengeSchema as b3, walletSignInFamilies as b4, walletSignInNetwork as b5, walletSignInNetworkSchema as b6, walletSignInNetworksSchema as b7, walletUnlinkInputSchema as b8, type ProfileCompletionPage as c, type ProfileCompletionQuery as d, type ProfileReferral as e, type ProfileSummary as f, type ProfileUpdate as g, type ProfileVisibility as h, type WalletChain as i, type WalletMessageChallenge as j, type WalletSignInNetwork as k, type WalletSignature as l, type WalletSigner as m, type WalletUnlinkInput as n, type ContractCall as o, type ContractEvent as p, type WalletBalanceSourceQuery as q, type WalletTransaction as r, type WalletInstruction as s, type WalletReader as t, type ContractCallParts as u, type ContractCallReturnType as v, type ContractEventInput as w, type ContractEventParts as x, type ContractFunction as y, type CosmosDenom as z };
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod';
2
- import { z as PhotoResult } from './schema-BA0nRRlt.js';
2
+ import { z as PhotoResult } from './schema-CZ6Rj0ZF.js';
3
3
 
4
4
  /**
5
5
  * Quest code names an image; the platform fetches, decodes and pins it. No bytes or URLs cross the
@@ -328,4 +328,4 @@ interface XReader {
328
328
  }): Promise<boolean | null>;
329
329
  }
330
330
 
331
- export { xIdSchema as A, xPostSchema as B, xProfileSchema as C, xRequestSchema as D, type Extracted as E, xUserLookupInputSchema as F, xUserSchema as G, xUsernameSchema as H, type ImageReader as I, type PublishedImage as P, type XReader as X, type ImageAssetArtifact as a, type ImageComparison as b, type ImageExtraction as c, type ImageFields as d, type ImageInspection as e, type ImageReference as f, type ImageRequest as g, type ImageSightings as h, type XConnection as i, type XPost as j, type XProfile as k, type XUser as l, type XUserLookupInput as m, imageAssetArtifactSchema as n, imageComparisonSchema as o, imageExtractionSchema as p, imageFieldSchema as q, imageFieldsSchema as r, imageInspectionSchema as s, imageReferenceSchema as t, imageRequestSchema as u, imageSightingsSchema as v, imageUploadRequestSchema as w, imageUploadsSchema as x, publishedImageSchema as y, xConnectionSchema as z };
331
+ export { imageUploadsSchema as A, publishedImageSchema as B, xIdSchema as C, xRequestSchema as D, type Extracted as E, xUserLookupInputSchema as F, xUserSchema as G, xUsernameSchema as H, type ImageReader as I, type PublishedImage as P, type XReader as X, xProfileSchema as a, xPostSchema as b, type ImageReference as c, imageComparisonSchema as d, imageSightingsSchema as e, type ImageAssetArtifact as f, type ImageComparison as g, type ImageExtraction as h, imageInspectionSchema as i, type ImageFields as j, type ImageInspection as k, type ImageRequest as l, type ImageSightings as m, type XConnection as n, type XPost as o, type XProfile as p, type XUser as q, type XUserLookupInput as r, imageAssetArtifactSchema as s, imageExtractionSchema as t, imageFieldSchema as u, imageFieldsSchema as v, imageReferenceSchema as w, xConnectionSchema as x, imageRequestSchema as y, imageUploadRequestSchema as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domino-sdk/relay",
3
- "version": "1.59.0",
3
+ "version": "1.61.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,357 +0,0 @@
1
- import {
2
- accountConnectionSchema,
3
- identifier,
4
- pageCursorSchema
5
- } from "./chunk-AWWCEP7F.js";
6
-
7
- // src/point-ledgers.ts
8
- import * as z from "zod";
9
- var pointLedgerPropertiesSchema = z.object({
10
- name: z.string().trim().min(1).max(120),
11
- description: z.string().trim().max(1e3).default("")
12
- }).strict();
13
- var createPointLedgerSchema = pointLedgerPropertiesSchema.extend({ actionId: identifier, key: identifier.optional() }).strict();
14
- var pointLedgerSchema = pointLedgerPropertiesSchema.extend({
15
- id: identifier
16
- });
17
- var managedPointLedgerSchema = pointLedgerSchema.extend({
18
- archivedAt: z.number().int().nonnegative().nullable()
19
- });
20
- var pointLedgerDeclarationSchema = pointLedgerPropertiesSchema.extend({ key: identifier }).strict();
21
- var pointLedgerArtifactSchema = z.union([
22
- pointLedgerDeclarationSchema,
23
- z.object({ code: z.string().min(1).max(2e6) }).strict()
24
- ]);
25
- var pointLedgerReferenceSchema = z.object({
26
- id: identifier,
27
- key: identifier.nullable(),
28
- name: z.string()
29
- });
30
- var points = z.number().int().safe();
31
- var pointBalanceSchema = z.object({
32
- ledger: pointLedgerReferenceSchema,
33
- balance: points,
34
- available: points
35
- });
36
- var pointBalancesSchema = z.object({
37
- items: z.array(pointBalanceSchema)
38
- });
39
- var PointEntryKind = {
40
- /** Points a quest completion, an engagement settlement or an operator awarded. */
41
- Award: "award",
42
- /** Points the member spent. */
43
- Spend: "spend",
44
- /** A correction in either direction, by an operator or a referral payout. */
45
- Adjust: "adjust",
46
- /** Undoes part or all of an award or a positive adjustment (`reverses`). */
47
- Reverse: "reverse"
48
- };
49
- var pointEntryKindSchema = z.string().min(1).max(64);
50
- var pointEntrySchema = z.object({
51
- id: identifier,
52
- amount: points,
53
- kind: pointEntryKindSchema,
54
- /** When the entry took effect, in epoch milliseconds. A reversal keeps its source's. */
55
- at: points.nonnegative(),
56
- quest: identifier.nullable(),
57
- reverses: identifier.nullable(),
58
- /**
59
- * True for an opening balance a member import recorded (an `adjust`). Absent from Relay
60
- * versions without imports.
61
- */
62
- imported: z.boolean().optional()
63
- });
64
- var pointHistoryQuerySchema = z.strictObject({
65
- ledger: identifier,
66
- cursor: pageCursorSchema.optional()
67
- });
68
- var pointHistoryPageSchema = z.object({
69
- items: z.array(pointEntrySchema),
70
- nextCursor: pageCursorSchema.nullable()
71
- });
72
-
73
- // src/telegram.ts
74
- import * as z2 from "zod";
75
- var telegramSignInMethodsSchema = z2.object({
76
- /** Telegram Login, the OpenID Connect sign-in Domino configures for the platform. */
77
- login: z2.boolean(),
78
- /** Mini App sign-in, which the project enables in Console with its bot's ID. */
79
- miniApp: z2.boolean()
80
- });
81
- var telegramAccountConnectionSchema = accountConnectionSchema.extend({
82
- provider: z2.literal("telegram")
83
- });
84
- var telegramInitDataSchema = z2.string().min(1, "Pass the Mini App's Telegram.WebApp.initData").max(8192);
85
- var telegramMiniAppSignInSchema = z2.object({
86
- initData: telegramInitDataSchema,
87
- mode: z2.enum(["sign-in", "connect"])
88
- }).strict();
89
- var telegramChatIdSchema = z2.string().regex(
90
- /^-?[1-9][0-9]{0,19}$/,
91
- "Use the chat's numeric ID, such as -1001234567890"
92
- );
93
- var telegramChatSchema = z2.object({
94
- /** The numeric chat ID, as a string. */
95
- id: telegramChatIdSchema,
96
- /** `group`, `supergroup` or `channel`; a later Telegram may add others. */
97
- type: z2.string(),
98
- title: z2.string(),
99
- /** The public @username, without the @, or null for a private chat. */
100
- username: z2.string().nullable(),
101
- status: z2.string(),
102
- issue: z2.string().nullable(),
103
- connectedAt: z2.number()
104
- });
105
- var telegramChatsSchema = z2.object({
106
- configured: z2.boolean(),
107
- /** Domino's bot, the one operators add to their chats. */
108
- bot: z2.object({ username: z2.string() }).nullable(),
109
- chats: z2.array(telegramChatSchema)
110
- });
111
- var telegramChatConnectionSchema = z2.object({
112
- url: z2.string(),
113
- expiresAt: z2.number()
114
- });
115
- var telegramMemberInputSchema = z2.object({
116
- chat: z2.string().regex(
117
- /^(-?[1-9][0-9]{0,19}|@[A-Za-z][A-Za-z0-9_]{3,31})$/,
118
- "Name a chat the project connected, by its numeric ID or @username"
119
- )
120
- }).strict();
121
- var telegramChatMemberSchema = z2.object({
122
- /** The numeric Telegram user ID. */
123
- userId: z2.string(),
124
- username: z2.string().nullable(),
125
- status: z2.custom(
126
- (value) => typeof value === "string"
127
- ),
128
- /** Whether they are in the chat now: a creator, administrator, member, or restricted member. */
129
- isMember: z2.boolean(),
130
- /** Whether they are its creator or an administrator. */
131
- isAdmin: z2.boolean(),
132
- /** When a paid subscription or a restriction ends, epoch milliseconds; null when it does not. */
133
- untilDate: z2.number().nullable()
134
- });
135
- var telegramReactionDataSchema = z2.object({
136
- /** The chat's numeric ID, as a string. */
137
- chatId: z2.string(),
138
- /** `group` or `supergroup`: channel reactions are anonymous and never recorded. */
139
- chatType: z2.string(),
140
- messageId: z2.number(),
141
- /** `emoji`, `custom_emoji` or `paid`. */
142
- reactionType: z2.string(),
143
- /** The emoji, such as "❤", for an `emoji` reaction; null otherwise. */
144
- emoji: z2.string().nullable(),
145
- /** The custom emoji's ID for a `custom_emoji` reaction; null otherwise. */
146
- customEmojiId: z2.string().nullable(),
147
- /**
148
- * `creator` or `administrator` for one of the chat's administrators, read at most ten minutes
149
- * before Relay recorded the reaction; `member` for anyone else.
150
- */
151
- reactorStatus: z2.string(),
152
- /** Whether the reactor was the chat's creator or an administrator then. */
153
- reactorIsAdmin: z2.boolean()
154
- });
155
- var telegramMessageDataSchema = z2.object({
156
- /** The chat's numeric ID, as a string. */
157
- chatId: z2.string(),
158
- /** `group` or `supergroup`: channel posts are authored by the channel and never recorded. */
159
- chatType: z2.string(),
160
- messageId: z2.number(),
161
- /** The ID of the message it replies to in the same chat; null when it is not a reply. */
162
- replyToMessageId: z2.number().nullable(),
163
- /**
164
- * The message thread it belongs to: the forum topic in a supergroup with topics, or the reply
165
- * thread otherwise. Null when Telegram names none.
166
- */
167
- threadId: z2.number().nullable()
168
- });
169
-
170
- // src/profiles.ts
171
- import * as z3 from "zod";
172
- var count = z3.number().int().nonnegative().safe();
173
- var profileVisibilitySchema = z3.enum([
174
- "private",
175
- "participants",
176
- "public"
177
- ]);
178
- var avatarProviderSchema = z3.enum(["x", "discord", "google"]);
179
- var profileDefaultProviderSchema = z3.enum(["x", "discord"]);
180
- var profileDefaultsSchema = z3.array(profileDefaultProviderSchema).max(profileDefaultProviderSchema.options.length).refine(
181
- (providers) => new Set(providers).size === providers.length,
182
- "List each provider once"
183
- );
184
- var avatarSeedSchema = z3.string().min(1).max(100);
185
- var profileAvatarSchema = z3.discriminatedUnion("source", [
186
- z3.object({
187
- source: z3.literal("upload"),
188
- url: z3.string().url(),
189
- seed: avatarSeedSchema
190
- }),
191
- z3.object({
192
- source: z3.literal("account"),
193
- provider: avatarProviderSchema,
194
- url: z3.string().url(),
195
- seed: avatarSeedSchema
196
- }),
197
- z3.object({ source: z3.literal("generated"), seed: avatarSeedSchema })
198
- ]);
199
- var profileSummarySchema = z3.object({
200
- id: identifier,
201
- name: z3.string(),
202
- avatar: profileAvatarSchema
203
- });
204
- var invisible = /[\p{Cc}؜᠎​-‏‪-‮⁠-⁤⁦-⁩]/u;
205
- var displayNameSchema = z3.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
206
- z3.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
207
- );
208
- var profileUpdateSchema = z3.object({
209
- displayName: displayNameSchema.nullable().optional(),
210
- avatar: z3.discriminatedUnion("source", [
211
- z3.object({
212
- source: z3.literal("account"),
213
- provider: avatarProviderSchema
214
- }).strict(),
215
- z3.object({ source: z3.literal("generated") }).strict()
216
- ]).nullable().optional(),
217
- hidden: z3.boolean().optional()
218
- }).strict().refine(
219
- (value) => Object.values(value).some((field) => field !== void 0),
220
- "Change at least one field"
221
- );
222
- var ownProfileSchema = profileSummarySchema.extend({
223
- /** The name the member chose, or null for the default. */
224
- displayName: z3.string().nullable(),
225
- /** The avatar the member chose: `default` follows the project's defaults. */
226
- avatarChoice: z3.enum(["default", "upload", "account", "generated"]),
227
- /** The account of an `account` choice. */
228
- avatarProvider: avatarProviderSchema.nullable(),
229
- hidden: z3.boolean(),
230
- /** An operator locked the name and avatar; the member can still hide the profile. */
231
- locked: z3.boolean(),
232
- /** Who can see profiles in this project, so the app can explain it. */
233
- visibility: profileVisibilitySchema,
234
- /** The member's connected accounts a picture or name can come from. */
235
- options: z3.array(
236
- z3.object({
237
- provider: avatarProviderSchema,
238
- name: z3.string().nullable(),
239
- /**
240
- * The account's first name, where the provider sends one (Google does; X and Discord don't).
241
- * Only the member's own profile carries it.
242
- */
243
- givenName: z3.string().nullable().default(null),
244
- imageUrl: z3.string().url().nullable()
245
- })
246
- )
247
- });
248
- var cursor = z3.string().min(1).max(512);
249
- var profileCompletionQuerySchema = z3.object({
250
- limit: z3.coerce.number().int().min(1).max(100).default(20),
251
- cursor: cursor.optional()
252
- }).strict();
253
- var profileCompletionSchema = z3.object({
254
- quest: identifier,
255
- key: identifier.optional(),
256
- title: z3.string(),
257
- completions: count.positive(),
258
- /** Null for completions recorded before completion times were. */
259
- lastCompletedAt: count.nullable()
260
- });
261
- var profileCompletionPageSchema = z3.object({
262
- items: z3.array(profileCompletionSchema),
263
- nextCursor: cursor.nullable()
264
- });
265
- var profileReferralSchema = z3.object({
266
- program: identifier,
267
- key: identifier.optional(),
268
- title: z3.string(),
269
- /** Members this member invited. Invitations are shared by every program. */
270
- invited: count,
271
- /** Invited members who qualified in this program. */
272
- qualified: count,
273
- milestones: z3.array(
274
- z3.object({ id: identifier, count, reached: z3.boolean() })
275
- )
276
- });
277
- var profileSettingsSchema = z3.object({
278
- visibility: profileVisibilitySchema,
279
- defaults: profileDefaultsSchema,
280
- revision: count,
281
- actor: z3.string().nullable(),
282
- updatedAt: count.nullable()
283
- });
284
- var profileSettingsInputSchema = profileSettingsSchema.omit({ revision: true, actor: true, updatedAt: true }).extend({
285
- actionId: identifier,
286
- /** The revision the change was made against; a newer one is a 409. */
287
- expectedRevision: count,
288
- reason: z3.string().trim().min(1).max(500)
289
- }).strict();
290
- var profileModerationSchema = z3.object({
291
- actionId: identifier,
292
- resetName: z3.boolean().default(false),
293
- removeAvatar: z3.boolean().default(false),
294
- /** True locks the name and avatar, false unlocks them. */
295
- lock: z3.boolean().optional(),
296
- reason: z3.string().trim().min(1).max(1e3)
297
- }).strict().refine(
298
- (value) => value.resetName || value.removeAvatar || value.lock !== void 0,
299
- "Choose an action"
300
- );
301
- var managedProfileSchema = ownProfileSchema.omit({ options: true }).extend({
302
- member: identifier,
303
- lockedAt: count.nullable(),
304
- lockedBy: z3.string().nullable(),
305
- lockedReason: z3.string().nullable(),
306
- updatedAt: count
307
- });
308
- var AVATAR_UPLOAD_LIMIT = 5 * 1024 * 1024;
309
- var avatarUploadTypes = ["image/jpeg", "image/png", "image/webp"];
310
-
311
- export {
312
- pointLedgerPropertiesSchema,
313
- createPointLedgerSchema,
314
- pointLedgerSchema,
315
- managedPointLedgerSchema,
316
- pointLedgerDeclarationSchema,
317
- pointLedgerArtifactSchema,
318
- pointLedgerReferenceSchema,
319
- pointBalanceSchema,
320
- pointBalancesSchema,
321
- PointEntryKind,
322
- pointEntrySchema,
323
- pointHistoryQuerySchema,
324
- pointHistoryPageSchema,
325
- telegramSignInMethodsSchema,
326
- telegramAccountConnectionSchema,
327
- telegramInitDataSchema,
328
- telegramMiniAppSignInSchema,
329
- telegramChatIdSchema,
330
- telegramChatSchema,
331
- telegramChatsSchema,
332
- telegramChatConnectionSchema,
333
- telegramMemberInputSchema,
334
- telegramChatMemberSchema,
335
- telegramReactionDataSchema,
336
- telegramMessageDataSchema,
337
- profileVisibilitySchema,
338
- avatarProviderSchema,
339
- profileDefaultProviderSchema,
340
- profileDefaultsSchema,
341
- avatarSeedSchema,
342
- profileAvatarSchema,
343
- profileSummarySchema,
344
- displayNameSchema,
345
- profileUpdateSchema,
346
- ownProfileSchema,
347
- profileCompletionQuerySchema,
348
- profileCompletionSchema,
349
- profileCompletionPageSchema,
350
- profileReferralSchema,
351
- profileSettingsSchema,
352
- profileSettingsInputSchema,
353
- profileModerationSchema,
354
- managedProfileSchema,
355
- AVATAR_UPLOAD_LIMIT,
356
- avatarUploadTypes
357
- };