@domino-sdk/relay 1.29.0 → 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 (38) hide show
  1. package/dist/{attempt-captures-BPMbTDYG.d.ts → attempt-captures-nMDnKGdI.d.ts} +1 -1
  2. package/dist/authoring.d.ts +10 -11
  3. package/dist/{automatic-outcomes-CGAxTwEj.d.ts → automatic-outcomes-CHiFP_U-.d.ts} +1 -1
  4. package/dist/browser.d.ts +6 -6
  5. package/dist/browser.js +3 -3
  6. package/dist/capability-error-FQGGb5xS.d.ts +71 -0
  7. package/dist/{chunk-6YLULKQM.js → chunk-24BMKPCY.js} +1 -1
  8. package/dist/{chunk-5FQ2BNG2.js → chunk-AOB3N4QO.js} +1 -1
  9. package/dist/{chunk-VP63H7IE.js → chunk-CMGGWWH3.js} +1 -1
  10. package/dist/{chunk-ZLYVOLU2.js → chunk-FHOEVR3S.js} +1 -1
  11. package/dist/{chunk-22QERRAG.js → chunk-FPKBRUIC.js} +17 -0
  12. package/dist/{chunk-V4FGPIR3.js → chunk-NFLNEKZ5.js} +1 -1
  13. package/dist/{chunk-W2HGXOZ5.js → chunk-P23AWV76.js} +1 -1
  14. package/dist/{client-D4WMWeWC.d.ts → client-Ciy0g8Hx.d.ts} +4 -4
  15. package/dist/{deployments-r5RxhZ9x.d.ts → deployments-V_BQ1PdE.d.ts} +1 -1
  16. package/dist/{groups-BNUhmxYY.d.ts → groups-sgKusEzF.d.ts} +1 -1
  17. package/dist/index.d.ts +7 -7
  18. package/dist/index.js +2 -2
  19. package/dist/internal.d.ts +9 -9
  20. package/dist/internal.js +4 -4
  21. package/dist/{offers-CdB5jnRl.d.ts → offers-DzdzB2ZI.d.ts} +2 -2
  22. package/dist/{pages-BUmWkUu2.d.ts → pages-DFZThUH7.d.ts} +1 -1
  23. package/dist/portal-proxy.js +1 -1
  24. package/dist/react/index.d.ts +8 -8
  25. package/dist/react/index.js +3 -3
  26. package/dist/{schema-lmOnv5C5.d.ts → schema-DquhoBae.d.ts} +1 -1
  27. package/dist/schema.d.ts +12 -12
  28. package/dist/schema.js +10 -4
  29. package/dist/server/index.d.ts +9 -9
  30. package/dist/server/index.js +28 -7
  31. package/dist/{submission-input-DdvTz7ac.d.ts → submission-input-Dr0v6J9N.d.ts} +2 -2
  32. package/dist/{telegram-browser-SK3KxXBL.d.ts → telegram-browser-DJiawHY-.d.ts} +1 -1
  33. package/dist/testing.d.ts +5 -5
  34. package/dist/testing.js +2 -2
  35. package/dist/{transport-BNdKQ_m4.d.ts → transport-BSGalAsT.d.ts} +33 -8
  36. package/dist/{images-PPPTL2Ct.d.ts → x-58jkoblN.d.ts} +99 -2
  37. package/package.json +1 -1
  38. package/dist/capability-error-CvSZaif2.d.ts +0 -151
@@ -1,151 +0,0 @@
1
- import * as 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 };