@domino-sdk/relay 1.16.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{attempt-captures-DHwIVoRP.d.ts → attempt-captures-ByzZyggX.d.ts} +5 -1
- package/dist/authoring.d.ts +82 -9
- package/dist/authoring.js +14 -9
- package/dist/{automatic-outcomes-BcEn_L46.d.ts → automatic-outcomes-BBSdMf0R.d.ts} +2 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +7 -7
- package/dist/browser.js +9 -11
- package/dist/{chunk-Y6SRF54G.js → chunk-4VWMY4II.js} +32 -25
- package/dist/{chunk-6QJ3LADK.js → chunk-5P5PTZ3T.js} +1 -1
- package/dist/{chunk-3YCCHTCU.js → chunk-BWW3XLEE.js} +2 -2
- package/dist/{chunk-W335CWYJ.js → chunk-CVQG2AZZ.js} +2 -2
- package/dist/{chunk-ZLYBUM7K.js → chunk-DQWRDRVO.js} +26 -14
- package/dist/{chunk-46C33ASD.js → chunk-EMLDFUTV.js} +1314 -908
- package/dist/{chunk-4OLQYRSA.js → chunk-GMKJPHN4.js} +1 -1
- package/dist/{chunk-NM3IYYPG.js → chunk-HQBCFU5G.js} +6 -8
- package/dist/{chunk-YT3QKV2L.js → chunk-I525XMUY.js} +1 -1
- package/dist/{chunk-LLMJ2SUT.js → chunk-IE4QOQUI.js} +21 -4
- package/dist/{chunk-ZGH6NEG6.js → chunk-JIQHUDVZ.js} +1 -1
- package/dist/{chunk-NIYCAW2I.js → chunk-NGP2NMZ4.js} +1 -1
- package/dist/{chunk-XMBM2XD5.js → chunk-T47OFHHX.js} +2 -4
- package/dist/{chunk-AXRMT33W.js → chunk-UIHPWC4C.js} +3 -0
- package/dist/{chunk-UJACD6K2.js → chunk-XSLRNFIY.js} +346 -304
- package/dist/{chunk-PT5STHFH.js → chunk-YXAK2637.js} +1 -1
- package/dist/{client-DFSCmf3H.d.ts → client-93pUw04R.d.ts} +182 -14
- package/dist/{deployments-DIbKJO_Y.d.ts → deployments-D0mrWCsp.d.ts} +817 -1
- package/dist/{groups-Bi7lc54m.d.ts → groups-jLLG7MML.d.ts} +27 -2
- package/dist/{images-Cb8QHGjn.d.ts → images-BPiPqVKn.d.ts} +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +12 -16
- package/dist/internal.d.ts +10 -10
- package/dist/internal.js +9 -10
- package/dist/{offers-Catj06u7.d.ts → offers-CPqiF3dZ.d.ts} +92 -3
- package/dist/{pages-CpYt56Km.d.ts → pages-1h1387a3.d.ts} +757 -3
- package/dist/portal-proxy.js +4 -4
- package/dist/react/index.d.ts +47 -19
- package/dist/react/index.js +361 -340
- package/dist/{schema-BaVl2VBS.d.ts → schema-Br3c1GOu.d.ts} +508 -2
- package/dist/schema.d.ts +565 -24
- package/dist/schema.js +61 -32
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +82 -24
- package/dist/{sign-in-options-CU1ND6-y.d.ts → sign-in-options--25uHySG.d.ts} +1 -1
- package/dist/{submission-input-Bi4HipqI.d.ts → submission-input-BEJ9qENg.d.ts} +2 -2
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +10 -13
- package/dist/{transport-BdrcbKi_.d.ts → transport-C2cK-6wO.d.ts} +6411 -72
- package/package.json +1 -1
- package/dist/chunk-2UAVZCMH.js +0 -314
- package/dist/chunk-NPGENI7K.js +0 -37
- package/dist/{profiles-BHMVj0kM.d.ts → profiles-D29SS12z.d.ts} +1 -1
package/package.json
CHANGED
package/dist/chunk-2UAVZCMH.js
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RequestError,
|
|
3
|
-
isRequestError
|
|
4
|
-
} from "./chunk-NPGENI7K.js";
|
|
5
|
-
import {
|
|
6
|
-
responseShape
|
|
7
|
-
} from "./chunk-46C33ASD.js";
|
|
8
|
-
|
|
9
|
-
// src/errors.ts
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
var RelayErrorCode = {
|
|
12
|
-
/** The call needs a signed-in member. */
|
|
13
|
-
NotSignedIn: "not-signed-in",
|
|
14
|
-
/** The session changed since the app read it (the `session` option). Reload before retrying. */
|
|
15
|
-
StaleSession: "stale-session",
|
|
16
|
-
/** The input failed validation before it was sent. */
|
|
17
|
-
InvalidInput: "invalid-input",
|
|
18
|
-
/** Relay's answer was not JSON or not the expected shape (kind `invalid-response`). */
|
|
19
|
-
InvalidResponse: "invalid-response",
|
|
20
|
-
/** The transport failed, before a response or while reading its body (kind `network`). */
|
|
21
|
-
Network: "network",
|
|
22
|
-
/** The client's deadline elapsed (kind `timeout`). */
|
|
23
|
-
Timeout: "timeout",
|
|
24
|
-
/** The caller cancelled the request (kind `aborted`). */
|
|
25
|
-
Aborted: "aborted",
|
|
26
|
-
/** A quest or collection the call named is not in the member's experience. */
|
|
27
|
-
NotFound: "not-found",
|
|
28
|
-
/** The quest has no failed attempt the member can retry. */
|
|
29
|
-
RetryUnavailable: "retry-unavailable",
|
|
30
|
-
/**
|
|
31
|
-
* Durable submission storage is missing, blocked or unreadable. Nothing was lost: call the
|
|
32
|
-
* handle's `status()` or `resume()` again once storage is available.
|
|
33
|
-
*/
|
|
34
|
-
SubmissionStorage: "submission-storage",
|
|
35
|
-
/** Browser storage is full, so submission progress was not saved. Free space, then resume. */
|
|
36
|
-
SubmissionStorageQuota: "submission-storage-quota",
|
|
37
|
-
/** The saved submission is in a state that does not allow this action. */
|
|
38
|
-
SubmissionConflict: "submission-conflict",
|
|
39
|
-
/** The quest changed since the member saw it; review it before submitting again. */
|
|
40
|
-
QuestUpdated: "quest-updated",
|
|
41
|
-
/** Wait for the deferred attempt before submitting another action. */
|
|
42
|
-
AttemptPending: "attempt-pending",
|
|
43
|
-
/** The quiz changed since the member answered it. */
|
|
44
|
-
StaleQuiz: "stale-quiz",
|
|
45
|
-
/** Relay refused the submitted evidence. */
|
|
46
|
-
InvalidSubmission: "invalid-submission",
|
|
47
|
-
/** A page cursor Relay cannot read; start again from the first page. */
|
|
48
|
-
InvalidCursor: "invalid-cursor",
|
|
49
|
-
/** No point ledger in the project has the key or ID the call named. */
|
|
50
|
-
PointLedgerNotFound: "point-ledger-not-found",
|
|
51
|
-
/** The member has not joined this project, so it holds no points here. */
|
|
52
|
-
NotJoined: "not-joined",
|
|
53
|
-
/** The quest or campaign is not open at this time. */
|
|
54
|
-
OutsideWindow: "outside-window",
|
|
55
|
-
/** The signed-in member must enroll in the campaign first. */
|
|
56
|
-
EnrollmentRequired: "enrollment-required",
|
|
57
|
-
/** The quest's current reward budget has no remaining capacity. */
|
|
58
|
-
BudgetExhausted: "budget-exhausted",
|
|
59
|
-
/** No published offer has the key or ID the call named. */
|
|
60
|
-
OfferNotFound: "offer-not-found",
|
|
61
|
-
/** The operator paused this offer. */
|
|
62
|
-
OfferPaused: "offer-paused",
|
|
63
|
-
/** This member has already used the offer's allowed number of redemptions. */
|
|
64
|
-
OfferLimitReached: "offer-limit-reached",
|
|
65
|
-
/** No declared units remain. */
|
|
66
|
-
OfferOutOfStock: "offer-out-of-stock",
|
|
67
|
-
/** The participant's available point balance is below the offer price. */
|
|
68
|
-
InsufficientPoints: "insufficient-points",
|
|
69
|
-
/** A wallet signer failed or the member refused to sign; `cause` is the wallet's own error. */
|
|
70
|
-
WalletSigner: "wallet-signer",
|
|
71
|
-
/** The member has not met the quest's prerequisites; `missing` lists them. */
|
|
72
|
-
PrerequisitesIncomplete: "prerequisites-incomplete",
|
|
73
|
-
/** The quest is archived or retired: it takes no new participation. */
|
|
74
|
-
QuestClosed: "quest-closed",
|
|
75
|
-
/** An operator paused the quest. */
|
|
76
|
-
QuestPaused: "quest-paused",
|
|
77
|
-
/** An operator locked the member's profile; hiding it is still allowed. */
|
|
78
|
-
ProfileLocked: "profile-locked",
|
|
79
|
-
/** No member in the project has the invitation code the member accepted. */
|
|
80
|
-
InvitationNotFound: "invitation-not-found",
|
|
81
|
-
/** The email sign-in code is wrong; the member can type it again. */
|
|
82
|
-
InvalidCode: "invalid-code",
|
|
83
|
-
/** The email sign-in code expired, was used or had too many attempts; request another. */
|
|
84
|
-
CodeExpired: "code-expired",
|
|
85
|
-
/** The wallet sign-in challenge expired, was used or changed; start sign-in again. */
|
|
86
|
-
ChallengeExpired: "challenge-expired",
|
|
87
|
-
/** Too many requests; `retryAfter` says how long to wait when Relay knows. */
|
|
88
|
-
RateLimited: "rate-limited"
|
|
89
|
-
};
|
|
90
|
-
var relayErrorBrand = /* @__PURE__ */ Symbol.for("@domino-sdk/relay.RelayError");
|
|
91
|
-
function isRelayError(value) {
|
|
92
|
-
return isRequestError(value) && value[relayErrorBrand] === true;
|
|
93
|
-
}
|
|
94
|
-
var RelayError = class extends RequestError {
|
|
95
|
-
name = "RelayError";
|
|
96
|
-
[relayErrorBrand] = true;
|
|
97
|
-
/** Which window refused admission when `code` is `outside-window`. */
|
|
98
|
-
window;
|
|
99
|
-
/** Prerequisites the member does not currently meet, when Relay refused for that reason. */
|
|
100
|
-
missing;
|
|
101
|
-
constructor(message, details) {
|
|
102
|
-
super(message, details);
|
|
103
|
-
this.window = details.window;
|
|
104
|
-
this.missing = details.missing ?? [];
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
function asRelayError(cause, fallback = "Request failed") {
|
|
108
|
-
if (isRelayError(cause)) {
|
|
109
|
-
return cause;
|
|
110
|
-
}
|
|
111
|
-
return new RelayError(
|
|
112
|
-
cause instanceof Error && cause.message ? cause.message : fallback,
|
|
113
|
-
{ kind: "client", cause }
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
function clientError(message, code, details = {}) {
|
|
117
|
-
return new RelayError(message, { ...details, kind: "client", code });
|
|
118
|
-
}
|
|
119
|
-
function parseInput(schema, value) {
|
|
120
|
-
const parsed = schema.safeParse(value);
|
|
121
|
-
if (!parsed.success) {
|
|
122
|
-
throw clientError(
|
|
123
|
-
z.prettifyError(parsed.error),
|
|
124
|
-
RelayErrorCode.InvalidInput,
|
|
125
|
-
{ cause: parsed.error }
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
return parsed.data;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// src/wallet.ts
|
|
132
|
-
import { z as z2 } from "zod";
|
|
133
|
-
var solanaAddressSchema = z2.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
|
|
134
|
-
var walletChainSchema = z2.enum(["solana", "eip155", "cosmos"]);
|
|
135
|
-
var cosmosNetworkPattern = /^cosmos:[-_a-zA-Z0-9]{1,32}$/;
|
|
136
|
-
var cosmosNetworkSchema = z2.custom(
|
|
137
|
-
(value) => typeof value === "string" && cosmosNetworkPattern.test(value),
|
|
138
|
-
"Use a Cosmos network: cosmos:<chain ID>"
|
|
139
|
-
);
|
|
140
|
-
var cosmosDenomSchema = z2.string().regex(
|
|
141
|
-
/^[a-zA-Z][a-zA-Z0-9/:._-]{2,127}$/,
|
|
142
|
-
"Use a Cosmos bank denomination such as uatom or uosmo"
|
|
143
|
-
);
|
|
144
|
-
function cosmosChain(chain) {
|
|
145
|
-
if (typeof chain === "string" && !chain.startsWith("cosmos:")) {
|
|
146
|
-
throw new Error('Use a Cosmos network such as "cosmos:cosmoshub-4"');
|
|
147
|
-
}
|
|
148
|
-
const value = typeof chain === "string" ? { chainId: chain.slice("cosmos:".length) } : chain;
|
|
149
|
-
if (typeof value?.chainId !== "string") {
|
|
150
|
-
throw new Error(
|
|
151
|
-
'Pass a Cosmos chain as { chainId } or a network such as "cosmos:cosmoshub-4"'
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
const network = `cosmos:${value.chainId}`;
|
|
155
|
-
if (!cosmosNetworkPattern.test(network)) {
|
|
156
|
-
throw new Error(
|
|
157
|
-
"A Cosmos chain ID has 1 to 32 letters, digits, hyphens or underscores"
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
if (value.chainInfo && value.chainInfo.chainId !== value.chainId) {
|
|
161
|
-
throw new Error("The chain info describes another chain ID");
|
|
162
|
-
}
|
|
163
|
-
return { ...value, network };
|
|
164
|
-
}
|
|
165
|
-
var solanaMainnet = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
166
|
-
var evmAddressSchema = z2.string().regex(/^0x[0-9a-fA-F]{40}$/);
|
|
167
|
-
var cosmosAddressSchema = z2.string().min(8).max(90).regex(
|
|
168
|
-
/^(?:[a-z][a-z0-9]{0,82}1[02-9ac-hj-np-z]{38,}|[A-Z][A-Z0-9]{0,82}1[02-9AC-HJ-NP-Z]{38,})$/
|
|
169
|
-
);
|
|
170
|
-
var walletAddressInputSchema = z2.discriminatedUnion("chain", [
|
|
171
|
-
z2.object({ chain: z2.literal("solana"), address: solanaAddressSchema }).strict(),
|
|
172
|
-
z2.object({
|
|
173
|
-
chain: z2.literal("eip155"),
|
|
174
|
-
address: evmAddressSchema,
|
|
175
|
-
/** Shown in the sign-in message's Chain ID line only: links are chain-agnostic. Defaults to 1. */
|
|
176
|
-
chainId: z2.number().int().positive().safe().optional()
|
|
177
|
-
}).strict(),
|
|
178
|
-
z2.object({
|
|
179
|
-
chain: z2.literal("cosmos"),
|
|
180
|
-
network: cosmosNetworkSchema,
|
|
181
|
-
address: cosmosAddressSchema
|
|
182
|
-
}).strict()
|
|
183
|
-
]);
|
|
184
|
-
var walletMessageChallengeSchema = z2.object({
|
|
185
|
-
id: z2.string().min(1).max(200),
|
|
186
|
-
purpose: z2.enum(["link", "sign-in"]),
|
|
187
|
-
chain: walletChainSchema,
|
|
188
|
-
network: cosmosNetworkSchema.nullable(),
|
|
189
|
-
/** Canonical (base58, EIP-55 or lowercase bech32). The signer must sign with this address. */
|
|
190
|
-
address: z2.string(),
|
|
191
|
-
message: z2.string().max(4096),
|
|
192
|
-
expiresAt: z2.number().int()
|
|
193
|
-
});
|
|
194
|
-
var walletSignatureSchema = z2.object({
|
|
195
|
-
challenge: z2.string().min(1).max(200),
|
|
196
|
-
/** solana: base58, 64 bytes · eip155: 0x and 130 hex digits (65 bytes) · cosmos: base64, 64 bytes (r‖s) */
|
|
197
|
-
signature: z2.string().min(1).max(256),
|
|
198
|
-
/** cosmos only: the base64 33-byte compressed secp256k1 key from signArbitrary's pub_key.value */
|
|
199
|
-
publicKey: z2.string().max(128).optional()
|
|
200
|
-
}).strict();
|
|
201
|
-
var linkedWalletSchema = z2.object({
|
|
202
|
-
chain: walletChainSchema,
|
|
203
|
-
network: cosmosNetworkSchema.nullable(),
|
|
204
|
-
address: z2.string(),
|
|
205
|
-
verifiedAt: z2.number().int().nonnegative(),
|
|
206
|
-
revision: z2.number().int().positive(),
|
|
207
|
-
/** True when this wallet can sign in: it was first used through wallet sign-in. Linking never enables sign-in. */
|
|
208
|
-
signIn: z2.boolean()
|
|
209
|
-
});
|
|
210
|
-
var walletUnlinkInputSchema = z2.object({ chain: walletChainSchema, address: z2.string().min(1).max(100) }).strict();
|
|
211
|
-
async function walletAddressInput(signer) {
|
|
212
|
-
const address = await signer.address();
|
|
213
|
-
switch (signer.chain) {
|
|
214
|
-
case "solana":
|
|
215
|
-
return { chain: "solana", address };
|
|
216
|
-
case "eip155":
|
|
217
|
-
return {
|
|
218
|
-
chain: "eip155",
|
|
219
|
-
address,
|
|
220
|
-
...signer.chainId ? { chainId: await signer.chainId() } : {}
|
|
221
|
-
};
|
|
222
|
-
case "cosmos":
|
|
223
|
-
if (!signer.network) {
|
|
224
|
-
throw clientError(
|
|
225
|
-
"Choose the Cosmos chain for this wallet",
|
|
226
|
-
RelayErrorCode.InvalidInput
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
return { chain: "cosmos", network: signer.network, address };
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
var WALLETS_PER_CHAIN = 5;
|
|
233
|
-
var walletSignInFamilies = ["solana", "eip155", "cosmos"];
|
|
234
|
-
var walletSignInNetworkSchema = z2.enum(walletSignInFamilies);
|
|
235
|
-
var walletSignInNetworksSchema = z2.array(walletSignInNetworkSchema).max(walletSignInFamilies.length).refine((values) => new Set(values).size === values.length, {
|
|
236
|
-
message: "Duplicate wallet family"
|
|
237
|
-
}).transform(
|
|
238
|
-
(values) => walletSignInFamilies.filter((family) => values.includes(family))
|
|
239
|
-
);
|
|
240
|
-
function walletSignInNetwork(wallet) {
|
|
241
|
-
return wallet.chain;
|
|
242
|
-
}
|
|
243
|
-
function caip10(wallet, network) {
|
|
244
|
-
if (wallet.chain === "cosmos") {
|
|
245
|
-
if (!wallet.network || network && network !== wallet.network) {
|
|
246
|
-
throw new Error("A Cosmos wallet belongs to its own network");
|
|
247
|
-
}
|
|
248
|
-
return `${wallet.network}:${wallet.address}`;
|
|
249
|
-
}
|
|
250
|
-
const selected = network ?? (wallet.chain === "solana" ? solanaMainnet : "eip155:1");
|
|
251
|
-
const valid = wallet.chain === "solana" ? /^solana:[1-9A-HJ-NP-Za-km-z]{32}$/.test(selected) : isEvmChainId(selected);
|
|
252
|
-
if (!valid) {
|
|
253
|
-
throw new Error(`Use a ${wallet.chain} network for this wallet`);
|
|
254
|
-
}
|
|
255
|
-
return `${selected}:${wallet.address}`;
|
|
256
|
-
}
|
|
257
|
-
function isEvmChainId(value) {
|
|
258
|
-
return /^eip155:[1-9][0-9]{0,15}$/.test(value);
|
|
259
|
-
}
|
|
260
|
-
var evmChainIdSchema = z2.custom(
|
|
261
|
-
(value) => typeof value === "string" && isEvmChainId(value),
|
|
262
|
-
'Use an EVM chain ID such as "eip155:8453"'
|
|
263
|
-
);
|
|
264
|
-
var units = z2.string().regex(/^(0|[1-9][0-9]*)$/);
|
|
265
|
-
var walletBalanceSchema = responseShape(
|
|
266
|
-
z2.object({
|
|
267
|
-
/** Canonical CAIP-2 ID for Solana, EVM or a supported Cosmos SDK chain. */
|
|
268
|
-
chain: z2.string(),
|
|
269
|
-
/** The canonical mint, EIP-55 contract or Cosmos bank denom; null for a native coin. */
|
|
270
|
-
token: z2.string().nullable(),
|
|
271
|
-
/** Null when token metadata does not report decimals. */
|
|
272
|
-
decimals: z2.number().int().min(0).max(255).nullable(),
|
|
273
|
-
/** The sum over `wallets`. */
|
|
274
|
-
total: units,
|
|
275
|
-
wallets: z2.array(
|
|
276
|
-
z2.object({ address: z2.string(), amount: units }).strict()
|
|
277
|
-
),
|
|
278
|
-
/** Solana: lowest slot. EVM: approximate latest block. Cosmos: the fixed queried block. */
|
|
279
|
-
at: z2.object({ kind: z2.enum(["slot", "block"]), number: units }).strict(),
|
|
280
|
-
observedAt: z2.number().int().nonnegative()
|
|
281
|
-
}).strict()
|
|
282
|
-
);
|
|
283
|
-
|
|
284
|
-
export {
|
|
285
|
-
RelayErrorCode,
|
|
286
|
-
isRelayError,
|
|
287
|
-
RelayError,
|
|
288
|
-
asRelayError,
|
|
289
|
-
clientError,
|
|
290
|
-
parseInput,
|
|
291
|
-
solanaAddressSchema,
|
|
292
|
-
walletChainSchema,
|
|
293
|
-
cosmosNetworkSchema,
|
|
294
|
-
cosmosDenomSchema,
|
|
295
|
-
cosmosChain,
|
|
296
|
-
solanaMainnet,
|
|
297
|
-
evmAddressSchema,
|
|
298
|
-
cosmosAddressSchema,
|
|
299
|
-
walletAddressInputSchema,
|
|
300
|
-
walletMessageChallengeSchema,
|
|
301
|
-
walletSignatureSchema,
|
|
302
|
-
linkedWalletSchema,
|
|
303
|
-
walletUnlinkInputSchema,
|
|
304
|
-
walletAddressInput,
|
|
305
|
-
WALLETS_PER_CHAIN,
|
|
306
|
-
walletSignInFamilies,
|
|
307
|
-
walletSignInNetworkSchema,
|
|
308
|
-
walletSignInNetworksSchema,
|
|
309
|
-
walletSignInNetwork,
|
|
310
|
-
caip10,
|
|
311
|
-
isEvmChainId,
|
|
312
|
-
evmChainIdSchema,
|
|
313
|
-
walletBalanceSchema
|
|
314
|
-
};
|
package/dist/chunk-NPGENI7K.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/request-error.ts
|
|
2
|
-
var requestErrorBrand = /* @__PURE__ */ Symbol.for("@domino-sdk/relay.RequestError");
|
|
3
|
-
function isRequestError(value) {
|
|
4
|
-
return typeof value === "object" && value !== null && value[requestErrorBrand] === true;
|
|
5
|
-
}
|
|
6
|
-
var RequestError = class extends Error {
|
|
7
|
-
name = "RequestError";
|
|
8
|
-
[requestErrorBrand] = true;
|
|
9
|
-
kind;
|
|
10
|
-
uncertain;
|
|
11
|
-
status;
|
|
12
|
-
code;
|
|
13
|
-
operationId;
|
|
14
|
-
/** `replay` for a replay-safe operation ID, else `reconcile`; only when `uncertain`. */
|
|
15
|
-
recovery;
|
|
16
|
-
/**
|
|
17
|
-
* Milliseconds the server asked the client to wait before trying again, from the `Retry-After`
|
|
18
|
-
* header of an error answer such as a 429 or 503. The client's own retries never wait past the
|
|
19
|
-
* call's deadline, so a longer wait is left to the caller.
|
|
20
|
-
*/
|
|
21
|
-
retryAfter;
|
|
22
|
-
constructor(message, details) {
|
|
23
|
-
super(message, details.cause === void 0 ? {} : { cause: details.cause });
|
|
24
|
-
this.kind = details.kind;
|
|
25
|
-
this.uncertain = details.uncertain ?? false;
|
|
26
|
-
this.status = details.status;
|
|
27
|
-
this.code = details.code;
|
|
28
|
-
this.operationId = details.operationId;
|
|
29
|
-
this.retryAfter = details.retryAfter;
|
|
30
|
-
this.recovery = this.uncertain ? details.operationId && (details.replaySafe ?? true) ? "replay" : "reconcile" : void 0;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
isRequestError,
|
|
36
|
-
RequestError
|
|
37
|
-
};
|
|
@@ -245,8 +245,8 @@ declare const profileModerationSchema: z.ZodObject<{
|
|
|
245
245
|
type ProfileModeration = z.input<typeof profileModerationSchema>;
|
|
246
246
|
/** A member's profile as operators see it: always, whatever the settings. */
|
|
247
247
|
declare const managedProfileSchema: z.ZodObject<{
|
|
248
|
-
id: z.ZodString;
|
|
249
248
|
name: z.ZodString;
|
|
249
|
+
id: z.ZodString;
|
|
250
250
|
displayName: z.ZodNullable<z.ZodString>;
|
|
251
251
|
hidden: z.ZodBoolean;
|
|
252
252
|
visibility: z.ZodEnum<{
|