@domino-sdk/relay 1.24.1 → 1.30.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 (58) hide show
  1. package/dist/{accounts-B31dWEYD.d.ts → accounts-DRPENuZe.d.ts} +1 -1
  2. package/dist/{attempt-captures-JDIgz2lY.d.ts → attempt-captures-nMDnKGdI.d.ts} +2 -2
  3. package/dist/authoring.d.ts +59 -60
  4. package/dist/authoring.js +7 -7
  5. package/dist/{automatic-outcomes-T9lEIvTj.d.ts → automatic-outcomes-CHiFP_U-.d.ts} +2 -2
  6. package/dist/avatar.d.ts +2 -2
  7. package/dist/browser.d.ts +10 -10
  8. package/dist/browser.js +10 -10
  9. package/dist/capability-error-FQGGb5xS.d.ts +71 -0
  10. package/dist/{chunk-UCZGXYCN.js → chunk-24BMKPCY.js} +10 -10
  11. package/dist/{chunk-MC6V6VMG.js → chunk-4OC7REYX.js} +1 -1
  12. package/dist/{chunk-JKFSDBQX.js → chunk-AOB3N4QO.js} +1 -1
  13. package/dist/{chunk-6UFXPKLA.js → chunk-BVEWY2ZL.js} +99 -39
  14. package/dist/{chunk-MRU7GX2V.js → chunk-C3KL5SGM.js} +21 -8
  15. package/dist/{chunk-WOGCRDFT.js → chunk-CCTZIHWN.js} +1 -1
  16. package/dist/{chunk-FE6SQTXF.js → chunk-CMGGWWH3.js} +2 -2
  17. package/dist/{chunk-G75JVB4D.js → chunk-DDA7G23P.js} +3 -3
  18. package/dist/{chunk-USVER53M.js → chunk-DP4YWFMY.js} +7 -0
  19. package/dist/{chunk-LR2HLHIF.js → chunk-FHOEVR3S.js} +595 -147
  20. package/dist/{chunk-B4EZ76WX.js → chunk-FPKBRUIC.js} +20 -3
  21. package/dist/{chunk-W33PYWYQ.js → chunk-JNBNL7FE.js} +2 -2
  22. package/dist/{chunk-AXQYGVOP.js → chunk-LPURBE7D.js} +1 -1
  23. package/dist/{chunk-GB26FIZT.js → chunk-MNL5NSC4.js} +8 -8
  24. package/dist/{chunk-FMQDD2MT.js → chunk-NFLNEKZ5.js} +47 -16
  25. package/dist/{chunk-ENBQ6UEE.js → chunk-P23AWV76.js} +3 -3
  26. package/dist/{chunk-JUQ2GNMD.js → chunk-PNCLJOUD.js} +2 -2
  27. package/dist/{chunk-E7MVYASS.js → chunk-W7PDXGYB.js} +1 -1
  28. package/dist/{client-HG0uMG0Q.d.ts → client-Ciy0g8Hx.d.ts} +123 -58
  29. package/dist/{deployments-DQY0PNUk.d.ts → deployments-V_BQ1PdE.d.ts} +184 -184
  30. package/dist/{groups-CfyRewkJ.d.ts → groups-sgKusEzF.d.ts} +26 -3
  31. package/dist/index.d.ts +13 -13
  32. package/dist/index.js +12 -10
  33. package/dist/{integrations-BMNtARU_.d.ts → integrations-CllF-kWg.d.ts} +1 -1
  34. package/dist/internal.d.ts +10 -10
  35. package/dist/internal.js +9 -9
  36. package/dist/{offers-CEwkAGsB.d.ts → offers-DzdzB2ZI.d.ts} +3 -3
  37. package/dist/{pages-D1xrbGJl.d.ts → pages-DFZThUH7.d.ts} +17 -3
  38. package/dist/{participant-activity-DYdUUhw2.d.ts → participant-activity-BPZiW7m7.d.ts} +1 -1
  39. package/dist/{participant-rewards-3duLb8YJ.d.ts → participant-rewards-BcWkBRn_.d.ts} +1 -1
  40. package/dist/portal-proxy.js +4 -4
  41. package/dist/{profiles-D29SS12z.d.ts → profiles-BHuQdzsW.d.ts} +1 -1
  42. package/dist/react/index.d.ts +13 -13
  43. package/dist/react/index.js +16 -15
  44. package/dist/{schema-D57mhL2q.d.ts → schema-DquhoBae.d.ts} +164 -2
  45. package/dist/schema.d.ts +441 -442
  46. package/dist/schema.js +30 -10
  47. package/dist/server/index.d.ts +10 -10
  48. package/dist/server/index.js +1001 -725
  49. package/dist/{streaks-CWyq8Px5.d.ts → streaks-0YuipsUQ.d.ts} +1 -1
  50. package/dist/{submission-input-DjXg0o-r.d.ts → submission-input-Dr0v6J9N.d.ts} +3 -3
  51. package/dist/{telegram-browser-DaP0Rawg.d.ts → telegram-browser-DJiawHY-.d.ts} +13 -5
  52. package/dist/testing.d.ts +8 -8
  53. package/dist/testing.js +15 -15
  54. package/dist/{transport-BNOvDy_4.d.ts → transport-BSGalAsT.d.ts} +6799 -3923
  55. package/dist/{wallet-CDyo-U4n.d.ts → wallet-t7uNDg9p.d.ts} +1 -1
  56. package/dist/{images-DwNmzqWv.d.ts → x-58jkoblN.d.ts} +100 -3
  57. package/package.json +1 -1
  58. package/dist/capability-error-oTd3eYFH.d.ts +0 -151
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
 
3
3
  declare const solanaAddressSchema: z.ZodString;
4
4
  /** A wallet's chain family: its CAIP-2 namespace. */
@@ -1,5 +1,5 @@
1
- import { z } from 'zod';
2
- import { P as PhotoResult } from './schema-D57mhL2q.js';
1
+ import * as z from 'zod';
2
+ import { _ as PhotoResult } from './schema-DquhoBae.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
@@ -231,4 +231,101 @@ interface ImageReader {
231
231
  }): Promise<ImageSightings>;
232
232
  }
233
233
 
234
- export { type Extracted as E, type ImageReader as I, type PublishedImage as P, 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, imageAssetArtifactSchema as i, imageComparisonSchema as j, imageExtractionSchema as k, imageFieldSchema as l, imageFieldsSchema as m, imageInspectionSchema as n, imageReferenceSchema as o, imageRequestSchema as p, imageSightingsSchema as q, imageUploadRequestSchema as r, imageUploadsSchema as s, publishedImageSchema as t };
234
+ declare const xIdSchema: z.ZodString;
235
+ declare const xConnectionSchema: z.ZodObject<{
236
+ userId: z.ZodString;
237
+ }, z.core.$strip>;
238
+ declare const xProfileSchema: z.ZodObject<{
239
+ id: z.ZodString;
240
+ username: z.ZodString;
241
+ name: z.ZodString;
242
+ bio: z.ZodNullable<z.ZodString>;
243
+ profileImageUrl: z.ZodNullable<z.ZodString>;
244
+ followersCount: z.ZodNullable<z.ZodNumber>;
245
+ verified: z.ZodNullable<z.ZodBoolean>;
246
+ }, z.core.$strip>;
247
+ /** An X handle, with or without its leading `@`: 1 to 15 letters, digits or underscores. */
248
+ declare const xUsernameSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
249
+ declare const xUserLookupInputSchema: z.ZodObject<{
250
+ username: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
251
+ }, z.core.$strict>;
252
+ type XUserLookupInput = z.input<typeof xUserLookupInputSchema>;
253
+ /**
254
+ * The X account that holds a handle, as Domino last read it from X (at most a day ago). A handle
255
+ * can change hands, so the stable `id` is what trackers, `--author` filters and
256
+ * `ctx.x.follows({ userId })` take. Resolving a handle says nothing about who owns the account.
257
+ */
258
+ declare const xUserSchema: z.ZodObject<{
259
+ id: z.ZodString;
260
+ username: z.ZodString;
261
+ name: z.ZodString;
262
+ }, z.core.$strip>;
263
+ type XUser = z.infer<typeof xUserSchema>;
264
+ declare const xPostSchema: z.ZodObject<{
265
+ id: z.ZodString;
266
+ userId: z.ZodString;
267
+ content: z.ZodString;
268
+ createdAt: z.ZodISODateTime;
269
+ author: z.ZodObject<{
270
+ id: z.ZodString;
271
+ username: z.ZodString;
272
+ name: z.ZodString;
273
+ verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
274
+ }, z.core.$loose>;
275
+ likeCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
276
+ replyCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
277
+ retweetCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
278
+ quoteCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
279
+ viewCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
280
+ bookmarkCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
281
+ isReply: z.ZodBoolean;
282
+ isRetweet: z.ZodBoolean;
283
+ isQuoteTweet: z.ZodBoolean;
284
+ quotedTweetId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
285
+ inReplyToUserId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
286
+ inReplyToStatusId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
287
+ retweetedTweetId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
288
+ media: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
289
+ type: string;
290
+ url: string;
291
+ }[], unknown>>;
292
+ }, z.core.$loose>;
293
+ declare const xRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
294
+ operation: z.ZodLiteral<"connection">;
295
+ }, z.core.$strict>, z.ZodObject<{
296
+ operation: z.ZodLiteral<"profile">;
297
+ }, z.core.$strict>, z.ZodObject<{
298
+ operation: z.ZodLiteral<"post">;
299
+ postId: z.ZodString;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ operation: z.ZodLiteral<"follows">;
302
+ userId: z.ZodString;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ operation: z.ZodLiteral<"reposted">;
305
+ postId: z.ZodString;
306
+ }, z.core.$strict>], "operation">;
307
+ type XConnection = z.infer<typeof xConnectionSchema>;
308
+ type XProfile = z.infer<typeof xProfileSchema>;
309
+ type XPost = z.infer<typeof xPostSchema>;
310
+ /**
311
+ * Reads the member's linked X account and public X data. The account is pinned at the attempt's
312
+ * first X read: later links and unlinks do not change the attempt. `connection()`, `profile()`,
313
+ * `follows()` and `reposted()` resolve to `null` when the member has no linked X account;
314
+ * `post()` reads any public post and resolves to `null` when it does not exist. Provider failures
315
+ * throw `CapabilityError` with code `"provider-unavailable"`.
316
+ */
317
+ interface XReader {
318
+ connection(): Promise<XConnection | null>;
319
+ profile(): Promise<XProfile | null>;
320
+ post(input: {
321
+ postId: string;
322
+ }): Promise<XPost | null>;
323
+ follows(input: {
324
+ userId: string;
325
+ }): Promise<boolean | null>;
326
+ reposted(input: {
327
+ postId: string;
328
+ }): Promise<boolean | null>;
329
+ }
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domino-sdk/relay",
3
- "version": "1.24.1",
3
+ "version": "1.30.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,151 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const xIdSchema: z.ZodString;
4
- declare const xConnectionSchema: z.ZodObject<{
5
- userId: z.ZodString;
6
- }, z.core.$strip>;
7
- declare const xProfileSchema: z.ZodObject<{
8
- id: z.ZodString;
9
- username: z.ZodString;
10
- name: z.ZodString;
11
- bio: z.ZodNullable<z.ZodString>;
12
- profileImageUrl: z.ZodNullable<z.ZodString>;
13
- followersCount: z.ZodNullable<z.ZodNumber>;
14
- verified: z.ZodNullable<z.ZodBoolean>;
15
- }, z.core.$strip>;
16
- declare const xPostSchema: z.ZodObject<{
17
- id: z.ZodString;
18
- userId: z.ZodString;
19
- content: z.ZodString;
20
- createdAt: z.ZodISODateTime;
21
- author: z.ZodObject<{
22
- id: z.ZodString;
23
- username: z.ZodString;
24
- name: z.ZodString;
25
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
26
- }, z.core.$loose>;
27
- likeCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
28
- replyCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
29
- retweetCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
30
- quoteCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
31
- viewCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
32
- bookmarkCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
33
- isReply: z.ZodBoolean;
34
- isRetweet: z.ZodBoolean;
35
- isQuoteTweet: z.ZodBoolean;
36
- quotedTweetId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
37
- inReplyToUserId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
38
- inReplyToStatusId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
39
- retweetedTweetId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
40
- media: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
41
- type: string;
42
- url: string;
43
- }[], unknown>>;
44
- }, z.core.$loose>;
45
- declare const xRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
- operation: z.ZodLiteral<"connection">;
47
- }, z.core.$strict>, z.ZodObject<{
48
- operation: z.ZodLiteral<"profile">;
49
- }, z.core.$strict>, z.ZodObject<{
50
- operation: z.ZodLiteral<"post">;
51
- postId: z.ZodString;
52
- }, z.core.$strict>, z.ZodObject<{
53
- operation: z.ZodLiteral<"follows">;
54
- userId: z.ZodString;
55
- }, z.core.$strict>, z.ZodObject<{
56
- operation: z.ZodLiteral<"reposted">;
57
- postId: z.ZodString;
58
- }, z.core.$strict>], "operation">;
59
- type XConnection = z.infer<typeof xConnectionSchema>;
60
- type XProfile = z.infer<typeof xProfileSchema>;
61
- type XPost = z.infer<typeof xPostSchema>;
62
- /**
63
- * Reads the member's linked X account and public X data. The account is pinned at the attempt's
64
- * first X read: later links and unlinks do not change the attempt. `connection()`, `profile()`,
65
- * `follows()` and `reposted()` resolve to `null` when the member has no linked X account;
66
- * `post()` reads any public post and resolves to `null` when it does not exist. Provider failures
67
- * throw `CapabilityError` with code `"provider-unavailable"`.
68
- */
69
- interface XReader {
70
- connection(): Promise<XConnection | null>;
71
- profile(): Promise<XProfile | null>;
72
- post(input: {
73
- postId: string;
74
- }): Promise<XPost | null>;
75
- follows(input: {
76
- userId: string;
77
- }): Promise<boolean | null>;
78
- reposted(input: {
79
- postId: string;
80
- }): Promise<boolean | null>;
81
- }
82
-
83
- /**
84
- * Why an evaluator capability could not answer:
85
- *
86
- * - `not-linked`: the call needs a member account that is not linked, and its result cannot be
87
- * null, such as an image check of the member's X profile picture. Readers of the member's own
88
- * accounts return `null` instead.
89
- * - `provider-unavailable`: the provider (X, Discord, a chain RPC, AI review) did not answer, or
90
- * the project's integration cannot reach it.
91
- * - `author-error`: the call cannot be answered as written: invalid input, an undeclared
92
- * integration, an unknown tracker, a chain Relay does not read, a wallet the member never
93
- * linked, or an image that does not exist.
94
- *
95
- * Later versions can add codes. Treat an unknown code as a failure its `message` explains.
96
- */
97
- declare const capabilityErrorCodes: readonly ["not-linked", "provider-unavailable", "author-error"];
98
- /** @compat open */
99
- type KnownCapabilityErrorCode = (typeof capabilityErrorCodes)[number];
100
- /** A known code, or one a newer Relay added. */
101
- type CapabilityErrorCode = KnownCapabilityErrorCode | (string & {});
102
- /**
103
- * A capability failure as it crosses the sandbox boundary and as Relay captures it. Open, so a
104
- * newer Relay can add codes and fields without breaking an older evaluator or Worker.
105
- */
106
- declare const capabilityFailureSchema: z.ZodObject<{
107
- code: z.ZodString;
108
- message: z.ZodString;
109
- /**
110
- * True when Relay retries the attempt if the error reaches it uncaught, and calls the provider
111
- * again. A failure that is not retryable is captured (or follows from the attempt's pinned
112
- * inputs), so every run of the attempt sees it again. A retryable failure that quest code
113
- * handles and moves past is final for the attempt; one that escapes the evaluation is retried.
114
- */
115
- retryable: z.ZodBoolean;
116
- }, z.core.$loose>;
117
- type CapabilityFailure = z.infer<typeof capabilityFailureSchema>;
118
- /**
119
- * Thrown by an evaluator capability (`ctx.x`, `ctx.discord`, `ctx.wallet`, `ctx.trackers`,
120
- * `ctx.images`, `ctx.review`) that could not answer. A capability whose subject is missing (an
121
- * account the member has not linked, a deleted post or message) returns `null` instead of
122
- * throwing.
123
- *
124
- * Catch it to decide yourself; rethrow anything else. An uncaught retryable error makes Relay
125
- * retry the attempt later; an uncaught one that is not retryable fails it.
126
- *
127
- * ```ts
128
- * try {
129
- * return (await ctx.x.follows({ userId })) ? decision.accept() : decision.reject({ reason })
130
- * } catch (error) {
131
- * if (error instanceof CapabilityError && error.code === "provider-unavailable")
132
- * return decision.review({ reason: "X is unavailable" })
133
- * throw error
134
- * }
135
- * ```
136
- */
137
- declare class CapabilityError extends Error {
138
- readonly code: CapabilityErrorCode;
139
- readonly retryable: boolean;
140
- constructor(code: CapabilityErrorCode, message: string, options?: {
141
- retryable?: boolean;
142
- });
143
- static [Symbol.hasInstance](value: unknown): boolean;
144
- /**
145
- * The error for a captured or transported failure. A code this SDK does not know is never
146
- * retryable: nothing tells it a retry would help.
147
- */
148
- static from(failure: CapabilityFailure): CapabilityError;
149
- }
150
-
151
- export { CapabilityError as C, type KnownCapabilityErrorCode as K, type XReader as X, type CapabilityErrorCode as a, type CapabilityFailure as b, capabilityErrorCodes as c, type XConnection as d, type XPost as e, type XProfile as f, capabilityFailureSchema as g, xIdSchema as h, xPostSchema as i, xProfileSchema as j, xRequestSchema as k, xConnectionSchema as x };