@domino-sdk/relay 1.62.0 → 1.65.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 +145 -0
- package/dist/{accounts-CCqCKCVx.d.ts → accounts-_lNsiR2k.d.ts} +42 -4
- package/dist/{attempt-captures-Cm-5G0PC.d.ts → attempt-captures-BqPggxTU.d.ts} +1 -1
- package/dist/authoring.d.ts +54 -20
- package/dist/authoring.js +60 -31
- package/dist/{automatic-outcomes-pAsOyIVp.d.ts → automatic-outcomes-BzAvfcpd.d.ts} +11 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +10 -10
- package/dist/browser.js +12 -13
- package/dist/capability-error-CuI_F7yM.d.ts +296 -0
- package/dist/{catalog--ZIlskAo.d.ts → catalog-ByZMRS7I.d.ts} +21 -10
- package/dist/{chunk-XNKSSE32.js → chunk-4NIV4NPV.js} +7 -7
- package/dist/chunk-7H4MRVQF.js +199 -0
- package/dist/{chunk-UPQPUJOU.js → chunk-CVQZ2YP7.js} +73 -202
- package/dist/{chunk-3PYYGFSB.js → chunk-DLABJSBO.js} +3 -3
- package/dist/{chunk-Y322OTCH.js → chunk-E22XSC4L.js} +1 -1
- package/dist/{chunk-E6IKQHTX.js → chunk-EDNKKVGU.js} +2 -2
- package/dist/{chunk-K2KS3JLY.js → chunk-EOUEAOWJ.js} +35 -4
- package/dist/{chunk-6WCIWXUV.js → chunk-EUEW2APU.js} +2 -2
- package/dist/{chunk-MK425RXJ.js → chunk-HNR6G3GV.js} +2335 -1538
- package/dist/{chunk-UW5232GG.js → chunk-KCUUHT2V.js} +5 -5
- package/dist/{chunk-CICDIBOF.js → chunk-MPTE7EIV.js} +76 -74
- package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
- package/dist/{chunk-GTDW453U.js → chunk-NG4GZ54I.js} +100 -114
- package/dist/chunk-R2KZFX6E.js +405 -0
- package/dist/{chunk-HTZHBTIL.js → chunk-RD3XJ4DH.js} +208 -376
- package/dist/{chunk-5TEYFX6X.js → chunk-SE7XHQFP.js} +2 -2
- package/dist/{chunk-CZFXGGEK.js → chunk-U66GUVSG.js} +2 -2
- package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
- package/dist/chunk-UZ765UGH.js +18 -0
- package/dist/{chunk-GKIFABGN.js → chunk-VBYOAT46.js} +100 -277
- package/dist/{chunk-QYPMPWVX.js → chunk-XVZ4YOF2.js} +43 -43
- package/dist/{chunk-3KLC4AMA.js → chunk-ZQ3IPCI6.js} +177 -176
- package/dist/chunk-ZXGBDLVB.js +1510 -0
- package/dist/{client-B-hbHX30.d.ts → client-D7IiwEq2.d.ts} +31 -62
- package/dist/{capability-error-DFMwSuSf.d.ts → dashboards-pVfclkyh.d.ts} +14 -294
- package/dist/{deployments-M4OHn7G3.d.ts → deployments-Cr1tfqrr.d.ts} +46 -3
- package/dist/{identity-integration-3mX6b5iH.d.ts → identity-integration-Ci2vGKtX.d.ts} +67 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -13
- package/dist/internal.d.ts +27 -13
- package/dist/internal.js +46 -13
- package/dist/{analytics-BwAKLi7O.d.ts → limits-pE04y9O2.d.ts} +131 -3
- package/dist/{offers-DhAtss4_.d.ts → offers-Hw2P6tcK.d.ts} +3 -2
- package/dist/{participant-activity-D-Drp24G.d.ts → participant-activity-DXRq4s6K.d.ts} +1 -0
- package/dist/portal-proxy.d.ts +21 -3
- package/dist/portal-proxy.js +72 -22
- package/dist/react/index.d.ts +29 -15
- package/dist/react/index.js +52 -29
- package/dist/{pages-B8q8Y_dQ.d.ts → reward-deliveries-BCV8hznc.d.ts} +300 -233
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/6EBN6IZU.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +197 -19
- package/dist/schema.js +126 -124
- package/dist/server/index.d.ts +13 -13
- package/dist/server/index.js +5701 -6302
- package/dist/{sign-in-providers-BkjcDsFF.d.ts → sign-in-providers-BAkGjSXo.d.ts} +7 -2
- package/dist/{submission-input-DHGKhXfp.d.ts → submission-input-ChL1aYNH.d.ts} +3 -2
- package/dist/{telegram-browser-BCE7zdOb.d.ts → telegram-browser-K27t4TwM.d.ts} +5 -5
- package/dist/telegram.d.ts +9 -9
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +229 -27
- package/dist/testing.js +146 -105
- package/dist/{tracker-data-Hb1uQnk5.d.ts → tracker-data-Bl-qPIvZ.d.ts} +37 -9
- package/dist/{transport-DkhX2Cbs.d.ts → transport-DC1m73Tp.d.ts} +40211 -37736
- package/dist/{wallet-DTO7SXj7.d.ts → wallet-B7e06v4m.d.ts} +14 -4
- package/package.json +1 -1
- package/dist/chunk-D26YNACF.js +0 -320
- package/dist/chunk-UAKYDVT3.js +0 -565
- package/dist/chunk-WSBYWVTZ.js +0 -717
- package/dist/chunk-XJFYAXET.js +0 -87
- package/dist/runtime/chunks/Y4OAVXFR.js +0 -1
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { J as SignInProvider } from './accounts-
|
|
1
|
+
import { J as SignInProvider } from './accounts-_lNsiR2k.js';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { a as TelegramSignInMethods } from './submission-input-
|
|
3
|
+
import { a as TelegramSignInMethods } from './submission-input-ChL1aYNH.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* `GET /v1/auth/providers`, as `relay.auth.providers()` reads it. Exported as a schema only, for the
|
|
7
|
+
* wire fixtures that pin its released shape (compat/wire/participant/auth-providers-*.json):
|
|
8
|
+
* `providers` keeps SDK 1.x's closed `AuthProvider`, and `signInProviders` is its open sibling.
|
|
9
|
+
*/
|
|
5
10
|
declare const authProvidersSchema: z.ZodObject<{
|
|
6
11
|
providers: z.ZodArray<z.ZodObject<{
|
|
7
12
|
provider: z.ZodEnum<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { L as LedgerReference, Q as QuestHandle } from './tracker-data-
|
|
3
|
-
import { B as ProjectGroupReference } from './accounts-
|
|
2
|
+
import { L as LedgerReference, Q as QuestHandle } from './tracker-data-Bl-qPIvZ.js';
|
|
3
|
+
import { B as ProjectGroupReference } from './accounts-_lNsiR2k.js';
|
|
4
4
|
|
|
5
5
|
declare const completionPrerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
6
|
kind: z.ZodLiteral<"completion">;
|
|
@@ -227,6 +227,7 @@ declare const telegramConnectionInputSchema: z.ZodObject<{
|
|
|
227
227
|
declare const telegramConnectionSchema: z.ZodObject<{
|
|
228
228
|
userId: z.ZodString;
|
|
229
229
|
}, z.core.$strip>;
|
|
230
|
+
/** The member's linked Telegram account, as `ctx.telegram.connection()` reads it. */
|
|
230
231
|
type TelegramConnection = z.infer<typeof telegramConnectionSchema>;
|
|
231
232
|
/** A member's status in a chat as Telegram reports it; a later Telegram may add others. */
|
|
232
233
|
type TelegramChatMemberStatus = "creator" | "administrator" | "member" | "restricted" | (string & {});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as AuthProvider, J as SignInProvider } from './accounts-
|
|
2
|
-
import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-
|
|
3
|
-
import { a as TelegramSignInMethods } from './submission-input-
|
|
4
|
-
import { b as ParticipantSession } from './participant-activity-
|
|
5
|
-
import { C as CosmosChain, a as CosmosNetwork, m as WalletSigner, k as WalletSignInNetwork } from './wallet-
|
|
1
|
+
import { c as AuthProvider, J as SignInProvider } from './accounts-_lNsiR2k.js';
|
|
2
|
+
import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-D7IiwEq2.js';
|
|
3
|
+
import { a as TelegramSignInMethods } from './submission-input-ChL1aYNH.js';
|
|
4
|
+
import { b as ParticipantSession } from './participant-activity-DXRq4s6K.js';
|
|
5
|
+
import { C as CosmosChain, a as CosmosNetwork, m as WalletSigner, k as WalletSignInNetwork } from './wallet-B7e06v4m.js';
|
|
6
6
|
|
|
7
7
|
/** An EIP-1193 provider, such as `window.ethereum` or an EIP-6963 announcement's provider. */
|
|
8
8
|
type Eip1193Provider = {
|
package/dist/telegram.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { k as RelayRequestOptions, R as RelayClient } from './client-
|
|
2
|
-
import { b as ParticipantSession } from './participant-activity-
|
|
3
|
-
import './accounts-
|
|
1
|
+
import { k as RelayRequestOptions, R as RelayClient } from './client-D7IiwEq2.js';
|
|
2
|
+
import { b as ParticipantSession } from './participant-activity-DXRq4s6K.js';
|
|
3
|
+
import './accounts-_lNsiR2k.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import './tracker-data-
|
|
6
|
-
import './wallet-
|
|
7
|
-
import './
|
|
8
|
-
import './submission-input-DHGKhXfp.js';
|
|
5
|
+
import './tracker-data-Bl-qPIvZ.js';
|
|
6
|
+
import './wallet-B7e06v4m.js';
|
|
7
|
+
import './submission-input-ChL1aYNH.js';
|
|
9
8
|
import './request-error-D_dUPLwo.js';
|
|
10
|
-
import './
|
|
9
|
+
import './reward-deliveries-BCV8hznc.js';
|
|
10
|
+
import './catalog-ByZMRS7I.js';
|
|
11
11
|
import './action-9Xl0StBg.js';
|
|
12
|
-
import './sign-in-providers-
|
|
12
|
+
import './sign-in-providers-BAkGjSXo.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* A plugin's own sign-in method, such as Telegram's Mini App sign-in: the app passes the vendor's
|
package/dist/telegram.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "./chunk-FWLQ5XCS.js";
|
|
4
4
|
import {
|
|
5
5
|
withPluginNamespace
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-EUEW2APU.js";
|
|
7
|
+
import "./chunk-EOUEAOWJ.js";
|
|
8
8
|
|
|
9
9
|
// src/plugins/telegram.generated.ts
|
|
10
10
|
function withTelegram(relay) {
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d5 as pointBalanceSchema, bD as discordMemberSchema, bG as discordMessageSchema, c$ as photoResultSchema, a8 as TextReviewInput, H as Reward, ac as Decision, P as PointBalance, y as PointLedgerReference, u as PointEntry, o as LeaderboardPage } from './accounts-_lNsiR2k.js';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import {
|
|
3
|
+
import { N as NftCollection, aO as profileReferralSchema, aE as linkedWalletSchema, aY as walletBalanceSchema, b2 as walletNftsSchema, M as WalletCallArgument, aZ as walletCallSchema, a$ as walletDelegationsSchema, U as WalletEventCondition, b0 as walletEventsSchema, b7 as walletTransactionsSchema, v as WalletReader } from './wallet-B7e06v4m.js';
|
|
4
|
+
import { f as CapabilityFailure, q as memberCompletionSchema } from './capability-error-CuI_F7yM.js';
|
|
5
|
+
export { C as CapabilityError } from './capability-error-CuI_F7yM.js';
|
|
6
|
+
import { C as xConnectionSchema, G as xProfileSchema, F as xPostSchema, g as ImageReference, u as imageInspectionSchema, q as imageComparisonSchema, x as imageSightingsSchema } from './limits-pE04y9O2.js';
|
|
7
|
+
export { L as Limits, l as limits } from './limits-pE04y9O2.js';
|
|
8
|
+
import { aM as memberIdentitySchema, bf as trackerQuerySchema, ba as trackerPageSchema, bo as trackerSummarySchema, ac as TrackerContentQuery, aX as trackerContentSchema, a8 as TrackerAttribution, o as Tracker, p as TrackerData, H as ContentBody, B as TrackerTriggerContext, U as TrackerPage } from './tracker-data-Bl-qPIvZ.js';
|
|
9
|
+
import { C as telegramConnectionSchema, y as telegramChatMemberSchema, e as TelegramReader } from './submission-input-ChL1aYNH.js';
|
|
9
10
|
import { EvaluationMember } from './authoring.js';
|
|
10
|
-
export { A as AttemptCapture, C as CapturedFact } from './attempt-captures-
|
|
11
|
-
import { b as ParticipantSession, R as RelayEvent } from './participant-activity-
|
|
12
|
-
import { B as Badge } from './offers-
|
|
13
|
-
import { b as QuestView, q as questExperienceSchema } from './catalog
|
|
11
|
+
export { A as AttemptCapture, C as CapturedFact } from './attempt-captures-BqPggxTU.js';
|
|
12
|
+
import { b as ParticipantSession, R as RelayEvent } from './participant-activity-DXRq4s6K.js';
|
|
13
|
+
import { B as Badge } from './offers-Hw2P6tcK.js';
|
|
14
|
+
import { b as QuestView, q as questExperienceSchema } from './catalog-ByZMRS7I.js';
|
|
14
15
|
import './streaks-0YuipsUQ.js';
|
|
16
|
+
import './dashboards-pVfclkyh.js';
|
|
15
17
|
import './units-CwgsPB_r.js';
|
|
16
18
|
|
|
17
19
|
/** One project time-zone change: from `effectiveAt` on, days are counted in `timeZone`. */
|
|
@@ -224,6 +226,123 @@ type CapabilityKind = keyof typeof capabilityRequestSchemas;
|
|
|
224
226
|
type CapabilityRequest = {
|
|
225
227
|
[K in CapabilityKind]: z.output<(typeof capabilityRequestSchemas)[K]>;
|
|
226
228
|
}[CapabilityKind];
|
|
229
|
+
/**
|
|
230
|
+
* `ctx.telegram.connection()` and `member()`'s request. It stays out of `CapabilityRequest`: that union is closed in
|
|
231
|
+
* SDK 1.x's public `CapabilityCall` and `ReplayDivergence`, and gaining a member would break code
|
|
232
|
+
* that switches over it (docs/adr/0011-telegram.md). The kit answers and numbers Telegram calls as
|
|
233
|
+
* Relay does, but lists them only in a run's `capabilityCalls`, not in the deprecated `calls`.
|
|
234
|
+
*/
|
|
235
|
+
declare const telegramRequestSchema: z.ZodObject<{
|
|
236
|
+
kind: z.ZodLiteral<"telegram">;
|
|
237
|
+
input: z.ZodUnion<readonly [z.ZodObject<{
|
|
238
|
+
chat: z.ZodString;
|
|
239
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
240
|
+
operation: z.ZodLiteral<"connection">;
|
|
241
|
+
}, z.core.$strict>]>;
|
|
242
|
+
}, z.core.$strict>;
|
|
243
|
+
type TelegramRequest = z.output<typeof telegramRequestSchema>;
|
|
244
|
+
/**
|
|
245
|
+
* `ctx.wallet.nfts()`'s request. Like Telegram's, it stays out of the closed `CapabilityRequest`:
|
|
246
|
+
* the kit answers and numbers NFT reads, but lists them only in a run's `capabilityCalls`, not in the deprecated `calls`.
|
|
247
|
+
*/
|
|
248
|
+
declare const walletNftsRequestSchema: z.ZodObject<{
|
|
249
|
+
kind: z.ZodLiteral<"wallet-nfts">;
|
|
250
|
+
collection: z.ZodString & z.ZodType<NftCollection, string, z.core.$ZodTypeInternals<NftCollection, string>>;
|
|
251
|
+
address: z.ZodNullable<z.ZodString>;
|
|
252
|
+
}, z.core.$strict>;
|
|
253
|
+
type WalletNftsRequest = z.output<typeof walletNftsRequestSchema>;
|
|
254
|
+
declare const walletEventsRequestSchema: z.ZodObject<{
|
|
255
|
+
kind: z.ZodLiteral<"wallet-events">;
|
|
256
|
+
event: z.ZodString & z.ZodType<`eip155:${number}:0x${string} ${string}`, string, z.core.$ZodTypeInternals<`eip155:${number}:0x${string} ${string}`, string>>;
|
|
257
|
+
account: z.ZodString;
|
|
258
|
+
since: z.ZodNumber;
|
|
259
|
+
afterActivation: z.ZodBoolean;
|
|
260
|
+
where: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodObject<{
|
|
261
|
+
gte: z.ZodString;
|
|
262
|
+
}, z.core.$strict>]>>>;
|
|
263
|
+
address: z.ZodNullable<z.ZodString>;
|
|
264
|
+
newest: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
}, z.core.$strict>;
|
|
266
|
+
type WalletEventsRequest = z.output<typeof walletEventsRequestSchema>;
|
|
267
|
+
/** `ctx.wallet.transactions()`'s request: answered and numbered like event reads, and unlisted the same way. */
|
|
268
|
+
declare const walletTransactionsRequestSchema: z.ZodObject<{
|
|
269
|
+
kind: z.ZodLiteral<"wallet-transactions">;
|
|
270
|
+
program: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
271
|
+
since: z.ZodNumber;
|
|
272
|
+
afterActivation: z.ZodBoolean;
|
|
273
|
+
mint: z.ZodNullable<z.ZodString>;
|
|
274
|
+
address: z.ZodNullable<z.ZodString>;
|
|
275
|
+
}, z.core.$strict>;
|
|
276
|
+
type WalletTransactionsRequest = z.output<typeof walletTransactionsRequestSchema>;
|
|
277
|
+
/**
|
|
278
|
+
* `ctx.wallet.call()`'s and `ctx.wallet.delegations()`'s requests. Like NFT reads, they stay out of
|
|
279
|
+
* the closed `CapabilityRequest`: the kit answers and numbers them, but lists them only in a run's `capabilityCalls`, not in the deprecated `calls`.
|
|
280
|
+
*/
|
|
281
|
+
declare const walletCallRequestSchema: z.ZodObject<{
|
|
282
|
+
kind: z.ZodLiteral<"wallet-call">;
|
|
283
|
+
call: z.ZodString & z.ZodType<`eip155:${number}:0x${string} function ${string}`, string, z.core.$ZodTypeInternals<`eip155:${number}:0x${string} function ${string}`, string>>;
|
|
284
|
+
args: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
285
|
+
wallet: z.ZodLiteral<true>;
|
|
286
|
+
}, z.core.$strict>, z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
287
|
+
address: z.ZodNullable<z.ZodString>;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
type WalletCallRequest = z.output<typeof walletCallRequestSchema>;
|
|
290
|
+
declare const walletDelegationsRequestSchema: z.ZodObject<{
|
|
291
|
+
kind: z.ZodLiteral<"wallet-delegations">;
|
|
292
|
+
chain: z.ZodCustom<`cosmos:${string}`, `cosmos:${string}`>;
|
|
293
|
+
validator: z.ZodNullable<z.ZodString>;
|
|
294
|
+
address: z.ZodNullable<z.ZodString>;
|
|
295
|
+
}, z.core.$strict>;
|
|
296
|
+
type WalletDelegationsRequest = z.output<typeof walletDelegationsRequestSchema>;
|
|
297
|
+
/**
|
|
298
|
+
* `ctx.member.balance()`, `completions()`, `groups()`, `enrolled()` and `referrals()`, which read
|
|
299
|
+
* Relay's own state of the member. Like Telegram's, they stay out of the closed `CapabilityRequest`: the kit answers and
|
|
300
|
+
* numbers them, but lists them only in a run's `capabilityCalls`, not in the deprecated `calls`.
|
|
301
|
+
*/
|
|
302
|
+
declare const memberStateRequestSchemas: {
|
|
303
|
+
"member-balance": z.ZodObject<{
|
|
304
|
+
kind: z.ZodLiteral<"member-balance">;
|
|
305
|
+
ledger: z.ZodString;
|
|
306
|
+
}, z.core.$strict>;
|
|
307
|
+
"member-completions": z.ZodObject<{
|
|
308
|
+
kind: z.ZodLiteral<"member-completions">;
|
|
309
|
+
quest: z.ZodNullable<z.ZodString>;
|
|
310
|
+
since: z.ZodNullable<z.ZodNumber>;
|
|
311
|
+
limit: z.ZodNumber;
|
|
312
|
+
}, z.core.$strict>;
|
|
313
|
+
"member-groups": z.ZodObject<{
|
|
314
|
+
kind: z.ZodLiteral<"member-groups">;
|
|
315
|
+
}, z.core.$strict>;
|
|
316
|
+
"member-enrolled": z.ZodObject<{
|
|
317
|
+
kind: z.ZodLiteral<"member-enrolled">;
|
|
318
|
+
campaign: z.ZodString;
|
|
319
|
+
}, z.core.$strict>;
|
|
320
|
+
"member-referrals": z.ZodObject<{
|
|
321
|
+
kind: z.ZodLiteral<"member-referrals">;
|
|
322
|
+
program: z.ZodString;
|
|
323
|
+
}, z.core.$strict>;
|
|
324
|
+
};
|
|
325
|
+
type MemberStateRequest = z.output<(typeof memberStateRequestSchemas)[keyof typeof memberStateRequestSchemas]>;
|
|
326
|
+
/** Every request the kit answers: the public `CapabilityRequest` kinds, Telegram's, NFT, contract call and delegation reads, and the member's state. */
|
|
327
|
+
type KitRequest = CapabilityRequest | TelegramRequest | WalletNftsRequest | WalletCallRequest | WalletDelegationsRequest | WalletEventsRequest | WalletTransactionsRequest | MemberStateRequest;
|
|
328
|
+
/**
|
|
329
|
+
* The capability kinds this release of the kit knows, one per reader method family.
|
|
330
|
+
*
|
|
331
|
+
* @compat open
|
|
332
|
+
*/
|
|
333
|
+
type KnownCapabilityKind = KitRequest["kind"];
|
|
334
|
+
/**
|
|
335
|
+
* One capability request quest code sent, as Relay validated it: `kind` names the reader, and the
|
|
336
|
+
* other fields are the wire request's, such as `{ kind: "wallet-events", event, account, since }`.
|
|
337
|
+
* Open: a later release adds kinds, and a request of a kind this release does not know keeps its
|
|
338
|
+
* fields. Compare it whole, or narrow on `kind` and read the fields you expect.
|
|
339
|
+
*
|
|
340
|
+
* @compat output
|
|
341
|
+
*/
|
|
342
|
+
type CapabilityCallRequest = {
|
|
343
|
+
kind: KnownCapabilityKind | (string & {});
|
|
344
|
+
[field: string]: unknown;
|
|
345
|
+
};
|
|
227
346
|
|
|
228
347
|
/** A result as a fake writes it: Relay's result schema fills defaults before quest code reads it. */
|
|
229
348
|
type Result<S extends z.ZodType> = z.input<S>;
|
|
@@ -358,23 +477,21 @@ type TestFacts = {
|
|
|
358
477
|
], Result<typeof walletBalanceSchema> | null>;
|
|
359
478
|
/**
|
|
360
479
|
* `ctx.wallet.nfts({ collection })`. Like `balance`, it reads null while the member has no
|
|
361
|
-
* linked wallet of the collection's family (EVM or Solana). A run's `
|
|
362
|
-
* SDK 1.x.
|
|
480
|
+
* linked wallet of the collection's family (EVM or Solana). A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
363
481
|
*/
|
|
364
482
|
nfts?: FakeAnswer<[
|
|
365
483
|
query: WalletNftsQueryRequest
|
|
366
484
|
], Result<typeof walletNftsSchema> | null>;
|
|
367
485
|
/**
|
|
368
486
|
* `ctx.wallet.call({ call, args })`. Like `balance`, it reads null while the member has no
|
|
369
|
-
* linked EVM wallet. A run's `
|
|
370
|
-
* in SDK 1.x.
|
|
487
|
+
* linked EVM wallet. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
371
488
|
*/
|
|
372
489
|
call?: FakeAnswer<[
|
|
373
490
|
query: WalletCallQueryRequest
|
|
374
491
|
], Result<typeof walletCallSchema> | null>;
|
|
375
492
|
/**
|
|
376
493
|
* `ctx.wallet.delegations({ chain, validator })`. Like `balance`, it reads null while the member
|
|
377
|
-
* has no wallet linked on that Cosmos network. A run's `calls` does not
|
|
494
|
+
* has no wallet linked on that Cosmos network. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
378
495
|
*/
|
|
379
496
|
delegations?: FakeAnswer<[
|
|
380
497
|
query: WalletDelegationsQueryRequest
|
|
@@ -383,7 +500,7 @@ type TestFacts = {
|
|
|
383
500
|
* `ctx.wallet.events({ event, account, since })`. Like `balance`, it reads null while the
|
|
384
501
|
* member has no linked EVM wallet. The kit does not apply `where`, `since` or `newest`: answer
|
|
385
502
|
* with the logs Relay would return, and `complete: false` for a `newest` read that left older
|
|
386
|
-
* events out. A run's `calls` does not
|
|
503
|
+
* events out. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
387
504
|
*/
|
|
388
505
|
events?: FakeAnswer<[
|
|
389
506
|
query: WalletEventsQueryRequest
|
|
@@ -392,7 +509,7 @@ type TestFacts = {
|
|
|
392
509
|
* `ctx.wallet.transactions({ program, since })`. Like `balance`, it reads null while the
|
|
393
510
|
* member has no linked Solana wallet. The kit does not apply `program`, `since` or `mint`:
|
|
394
511
|
* answer with the transactions Relay would return, with `instructions` when the program's
|
|
395
|
-
* setting has an Anchor IDL. A run's `calls` does not
|
|
512
|
+
* setting has an Anchor IDL. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
396
513
|
*/
|
|
397
514
|
transactions?: FakeAnswer<[
|
|
398
515
|
query: WalletTransactionsQueryRequest
|
|
@@ -426,8 +543,7 @@ type TestFacts = {
|
|
|
426
543
|
* `ctx.telegram.connection()` and `ctx.telegram.member({ chat })`, which the testing kit supplies
|
|
427
544
|
* to every quest as Relay does. `connection` is answered once per run, as Relay pins the account.
|
|
428
545
|
* Throw `new CapabilityError("integration-required", …)` from `member` to act out a chat the
|
|
429
|
-
* project has not connected. A run's `
|
|
430
|
-
* closed in SDK 1.x.
|
|
546
|
+
* project has not connected. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
431
547
|
*/
|
|
432
548
|
telegram?: {
|
|
433
549
|
connection?: FakeAnswer<[], Result<typeof telegramConnectionSchema> | null>;
|
|
@@ -500,6 +616,8 @@ declare const defaultSeed = "attempt_test";
|
|
|
500
616
|
/**
|
|
501
617
|
* The most capability calls one hosted evaluation run can make, shared by all capabilities. The
|
|
502
618
|
* next call throws a `CapabilityError` with code `capability-limit`.
|
|
619
|
+
*
|
|
620
|
+
* @deprecated Use `limits.capabilityCalls`, which a 1.x release can raise.
|
|
503
621
|
*/
|
|
504
622
|
declare const maxCapabilityCalls = 8;
|
|
505
623
|
/**
|
|
@@ -582,7 +700,8 @@ type RunQuestOptions<Q extends TestableQuest = TestableQuest> = {
|
|
|
582
700
|
facts?: TestFacts;
|
|
583
701
|
};
|
|
584
702
|
/**
|
|
585
|
-
* One capability call, as Relay captures it for replay.
|
|
703
|
+
* One capability call, as Relay captures it for replay. Its request type is closed in SDK 1.x, so
|
|
704
|
+
* lists of it leave out the kinds it cannot name; use `CapabilityCallRecord`.
|
|
586
705
|
*
|
|
587
706
|
* @compat output
|
|
588
707
|
*/
|
|
@@ -591,6 +710,17 @@ type CapabilityCall = {
|
|
|
591
710
|
request: CapabilityRequest;
|
|
592
711
|
outcome: CapabilityOutcome;
|
|
593
712
|
};
|
|
713
|
+
/**
|
|
714
|
+
* One capability call of any kind, as Relay captures it for replay: its position in the run, the
|
|
715
|
+
* request quest code sent, and the value or failure quest code received.
|
|
716
|
+
*
|
|
717
|
+
* @compat output
|
|
718
|
+
*/
|
|
719
|
+
type CapabilityCallRecord = {
|
|
720
|
+
sequence: number;
|
|
721
|
+
request: CapabilityCallRequest;
|
|
722
|
+
outcome: CapabilityOutcome;
|
|
723
|
+
};
|
|
594
724
|
/**
|
|
595
725
|
* The published release a run used: what `describe` returned for the settings.
|
|
596
726
|
*
|
|
@@ -616,8 +746,15 @@ type QuestDiagnostic = {
|
|
|
616
746
|
type TestContext<Q extends TestableQuest = TestableQuest> = {
|
|
617
747
|
/** The host context to pass to `quest.evaluate`. */
|
|
618
748
|
context: QuestHostContext<Q>;
|
|
619
|
-
/**
|
|
749
|
+
/**
|
|
750
|
+
* The capability calls of the kinds `CapabilityRequest` names, in order.
|
|
751
|
+
*
|
|
752
|
+
* @deprecated Use `capabilityCalls`, which lists every kind: Telegram, NFT, contract call,
|
|
753
|
+
* delegation, wallet event and transaction reads and the member's state are missing here.
|
|
754
|
+
*/
|
|
620
755
|
calls: CapabilityCall[];
|
|
756
|
+
/** Every capability call quest code has made so far, of any kind, in order. */
|
|
757
|
+
capabilityCalls: CapabilityCallRecord[];
|
|
621
758
|
/** What `quest.evaluate` has reported so far that had no effect. */
|
|
622
759
|
diagnostics: QuestDiagnostic[];
|
|
623
760
|
release: TestRelease;
|
|
@@ -628,7 +765,15 @@ type TestContext<Q extends TestableQuest = TestableQuest> = {
|
|
|
628
765
|
/** @compat output */
|
|
629
766
|
type QuestRun = {
|
|
630
767
|
decision: Decision;
|
|
768
|
+
/**
|
|
769
|
+
* The capability calls of the kinds `CapabilityRequest` names, in order.
|
|
770
|
+
*
|
|
771
|
+
* @deprecated Use `capabilityCalls`, which lists every kind: Telegram, NFT, contract call,
|
|
772
|
+
* delegation, wallet event and transaction reads and the member's state are missing here.
|
|
773
|
+
*/
|
|
631
774
|
calls: CapabilityCall[];
|
|
775
|
+
/** Every capability call the run made, of any kind, in order. `runQuest` always sets it. */
|
|
776
|
+
capabilityCalls?: CapabilityCallRecord[];
|
|
632
777
|
release: TestRelease;
|
|
633
778
|
/**
|
|
634
779
|
* What the run did that had no effect; Relay records none of it for hosted attempts. `runQuest`
|
|
@@ -638,6 +783,8 @@ type QuestRun = {
|
|
|
638
783
|
};
|
|
639
784
|
/** What `runQuest` resolves with. */
|
|
640
785
|
type DiagnosedRun = QuestRun & {
|
|
786
|
+
/** Every capability call the run made, of any kind, in order. */
|
|
787
|
+
capabilityCalls: CapabilityCallRecord[];
|
|
641
788
|
/** What the run did that had no effect; Relay records none of it for hosted attempts. */
|
|
642
789
|
diagnostics: QuestDiagnostic[];
|
|
643
790
|
};
|
|
@@ -663,7 +810,7 @@ declare function createTestContext<Q extends TestableQuest>(quest: Q, options?:
|
|
|
663
810
|
* capability readers answered from `facts` and checked against Relay's capability contracts, and
|
|
664
811
|
* the decision's rewards checked against the published bundle.
|
|
665
812
|
*
|
|
666
|
-
* Resolves with the decision and every capability call
|
|
813
|
+
* Resolves with the decision and every capability call, in `capabilityCalls`. Rejects with a capability failure that
|
|
667
814
|
* escaped quest code, as thrown or wrapped (Relay retries a retryable one); with an
|
|
668
815
|
* `EvaluatorError` for anything else quest code threw, which Relay fails the attempt with once;
|
|
669
816
|
* or with a `TestSetupError` for a call the facts cannot answer.
|
|
@@ -680,6 +827,19 @@ declare function runQuest<Q extends TestableQuest>(quest: Q, options?: RunQuestO
|
|
|
680
827
|
*/
|
|
681
828
|
declare function fakeEvaluationMember(member?: Partial<EvaluationMember>): EvaluationMember;
|
|
682
829
|
|
|
830
|
+
/**
|
|
831
|
+
* A `WalletReader` with every method Relay supplies, answered from `facts.wallet` as `runQuest`
|
|
832
|
+
* answers it: a member with no linked wallet unless `facts.wallet.list` links one. Use it in a
|
|
833
|
+
* test that builds its own evaluation context; a minor release that adds a reader method gives it
|
|
834
|
+
* here too, so the test keeps compiling and the new method keeps working.
|
|
835
|
+
*/
|
|
836
|
+
declare function fakeWalletReader(facts?: Pick<TestFacts, "wallet">): Required<WalletReader>;
|
|
837
|
+
/**
|
|
838
|
+
* A `TelegramReader` with every method Relay supplies, answered from `facts.telegram` as
|
|
839
|
+
* `runQuest` answers it: a member who has not linked Telegram unless the facts say otherwise.
|
|
840
|
+
*/
|
|
841
|
+
declare function fakeTelegramReader(facts?: Pick<TestFacts, "telegram">): Required<TelegramReader>;
|
|
842
|
+
|
|
683
843
|
type Kind = Decision["kind"];
|
|
684
844
|
type DecisionOf<K extends Kind> = Extract<Decision, {
|
|
685
845
|
kind: K;
|
|
@@ -782,7 +942,8 @@ type ReplayOptions = {
|
|
|
782
942
|
facts?: TestFacts;
|
|
783
943
|
};
|
|
784
944
|
/**
|
|
785
|
-
* The first call the capture could not answer.
|
|
945
|
+
* The first call the capture could not answer, when its kind is one `CapabilityRequest` names.
|
|
946
|
+
* Use `CapabilityDivergence`, which reports every kind.
|
|
786
947
|
*
|
|
787
948
|
* @compat output
|
|
788
949
|
*/
|
|
@@ -797,6 +958,27 @@ type ReplayDivergence = {
|
|
|
797
958
|
recorded: Record<string, unknown> | null;
|
|
798
959
|
replayed: CapabilityRequest;
|
|
799
960
|
};
|
|
961
|
+
/**
|
|
962
|
+
* Why the capture could not answer a call. `"new"`: the captured run made no such call.
|
|
963
|
+
* `"changed"`: it sent another request. `"uncaptured"`: its answer was a retryable failure Relay
|
|
964
|
+
* did not keep.
|
|
965
|
+
*
|
|
966
|
+
* @compat open
|
|
967
|
+
*/
|
|
968
|
+
type KnownDivergenceReason = "new" | "changed" | "uncaptured";
|
|
969
|
+
/**
|
|
970
|
+
* The first call the capture could not answer, of any capability kind.
|
|
971
|
+
*
|
|
972
|
+
* @compat output
|
|
973
|
+
*/
|
|
974
|
+
type CapabilityDivergence = {
|
|
975
|
+
sequence: number;
|
|
976
|
+
reason: KnownDivergenceReason | (string & {});
|
|
977
|
+
/** The request the captured run sent at this position; null for a new call. */
|
|
978
|
+
recorded: Record<string, unknown> | null;
|
|
979
|
+
/** The request current quest code sent. */
|
|
980
|
+
replayed: CapabilityCallRequest;
|
|
981
|
+
};
|
|
800
982
|
/** @compat output */
|
|
801
983
|
type AttemptReplay = {
|
|
802
984
|
/** What the current quest code decides; null when the replay stopped at a divergence. */
|
|
@@ -808,9 +990,26 @@ type AttemptReplay = {
|
|
|
808
990
|
* key. Null when either is missing.
|
|
809
991
|
*/
|
|
810
992
|
changed: boolean | null;
|
|
811
|
-
/**
|
|
993
|
+
/**
|
|
994
|
+
* The first call the capture could not answer, or null when it answered every call or the
|
|
995
|
+
* first such call is of a kind `CapabilityRequest` does not name.
|
|
996
|
+
*
|
|
997
|
+
* @deprecated Use `capabilityDivergence`, which reports every kind.
|
|
998
|
+
*/
|
|
812
999
|
divergence: ReplayDivergence | null;
|
|
1000
|
+
/**
|
|
1001
|
+
* The first call the capture could not answer, of any kind, or null when it answered every
|
|
1002
|
+
* call. `replayAttempt` always sets it.
|
|
1003
|
+
*/
|
|
1004
|
+
capabilityDivergence?: CapabilityDivergence | null;
|
|
1005
|
+
/**
|
|
1006
|
+
* The capability calls of the kinds `CapabilityRequest` names, in order.
|
|
1007
|
+
*
|
|
1008
|
+
* @deprecated Use `capabilityCalls`, which lists every kind.
|
|
1009
|
+
*/
|
|
813
1010
|
calls: CapabilityCall[];
|
|
1011
|
+
/** Every capability call the replay made, of any kind, in order. `replayAttempt` always sets it. */
|
|
1012
|
+
capabilityCalls?: CapabilityCallRecord[];
|
|
814
1013
|
};
|
|
815
1014
|
/**
|
|
816
1015
|
* Evaluates current quest code against a captured attempt: the release's settings and rewards,
|
|
@@ -823,7 +1022,10 @@ type AttemptReplay = {
|
|
|
823
1022
|
* alters a past outcome. A call the capture cannot answer stops the replay unless `facts`
|
|
824
1023
|
* answers it; the result names the first one.
|
|
825
1024
|
*/
|
|
826
|
-
declare function replayAttempt<Q extends TestableQuest>(quest: Q, capture: unknown, options?: ReplayOptions): Promise<AttemptReplay
|
|
1025
|
+
declare function replayAttempt<Q extends TestableQuest>(quest: Q, capture: unknown, options?: ReplayOptions): Promise<AttemptReplay & {
|
|
1026
|
+
capabilityDivergence: CapabilityDivergence | null;
|
|
1027
|
+
capabilityCalls: CapabilityCallRecord[];
|
|
1028
|
+
}>;
|
|
827
1029
|
|
|
828
1030
|
type Experience = z.output<typeof questExperienceSchema>;
|
|
829
1031
|
/**
|
|
@@ -900,4 +1102,4 @@ type FakeRelay = {
|
|
|
900
1102
|
*/
|
|
901
1103
|
declare function createFakeRelay(options?: FakeRelayOptions): FakeRelay;
|
|
902
1104
|
|
|
903
|
-
export { type AttemptReplay, type CalendarSegment, type CapabilityCall, type CapabilityOutcome, type CapabilityRequest, Decision, DecisionAssertionError, EvaluatorError, type FakeAnswer, type FakeRelay, type FakeRelayOptions, type FakeRelayRequest, type QuestDiagnostic, type QuestHostContext, type QuestInputOf, type QuestRun, type ReplayDivergence, type ReplayOptions, type RunQuestOptions, type TestContext, type TestFacts, type TestRelease, TestSetupError, type TestableQuest, type TrackerFacts, type TrackerObservationInput, type TrackerReadRequest, type TrackerRecordInput, type WalletBalanceRequest, createFakeRelay, createTestContext, defaultMember, defaultNow, defaultSeed, expectAccept, expectDefer, expectProgress, expectReject, expectReview, fakeEvaluationMember, maxCapabilityCalls, replayAttempt, runQuest, trackerObservation, trackerPage };
|
|
1105
|
+
export { type AttemptReplay, type CalendarSegment, type CapabilityCall, type CapabilityCallRecord, type CapabilityCallRequest, type CapabilityDivergence, type CapabilityOutcome, type CapabilityRequest, Decision, DecisionAssertionError, EvaluatorError, type FakeAnswer, type FakeRelay, type FakeRelayOptions, type FakeRelayRequest, type KnownCapabilityKind, type KnownDivergenceReason, type QuestDiagnostic, type QuestHostContext, type QuestInputOf, type QuestRun, type ReplayDivergence, type ReplayOptions, type RunQuestOptions, type TestContext, type TestFacts, type TestRelease, TestSetupError, type TestableQuest, type TrackerFacts, type TrackerObservationInput, type TrackerReadRequest, type TrackerRecordInput, type WalletBalanceRequest, createFakeRelay, createTestContext, defaultMember, defaultNow, defaultSeed, expectAccept, expectDefer, expectProgress, expectReject, expectReview, fakeEvaluationMember, fakeTelegramReader, fakeWalletReader, maxCapabilityCalls, replayAttempt, runQuest, trackerObservation, trackerPage };
|