@domino-sdk/relay 1.60.0 → 1.62.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 +175 -8
- package/README.md +3 -2
- package/dist/{schema-CwbRkmlr.d.ts → accounts-CCqCKCVx.d.ts} +3127 -1764
- package/dist/action-9Xl0StBg.d.ts +33 -0
- package/dist/{analytics-URV-mxjH.d.ts → analytics-BwAKLi7O.d.ts} +347 -3
- package/dist/{attempt-captures-W2dgzGqE.d.ts → attempt-captures-Cm-5G0PC.d.ts} +1 -1
- package/dist/authoring.d.ts +130 -42
- package/dist/authoring.js +105 -19
- package/dist/{automatic-outcomes-Cmou89IS.d.ts → automatic-outcomes-pAsOyIVp.d.ts} +5 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +15 -11
- package/dist/browser.js +15 -11
- package/dist/{integrations-CmIkP1Gi.d.ts → capability-error-DFMwSuSf.d.ts} +160 -42
- package/dist/{pages-Bti7g5mX.d.ts → catalog--ZIlskAo.d.ts} +39 -561
- package/dist/{chunk-N3LJ6GFK.js → chunk-3KLC4AMA.js} +40 -11
- package/dist/{chunk-6ZG7WNYX.js → chunk-3PYYGFSB.js} +14 -2
- package/dist/{chunk-VWMIA2TT.js → chunk-5TEYFX6X.js} +2 -2
- package/dist/chunk-6WCIWXUV.js +31 -0
- package/dist/chunk-CICDIBOF.js +373 -0
- package/dist/{chunk-MHPKEVEW.js → chunk-CZFXGGEK.js} +5 -0
- package/dist/chunk-D26YNACF.js +320 -0
- package/dist/{chunk-KUPVQXUJ.js → chunk-E6IKQHTX.js} +2 -2
- package/dist/chunk-FWLQ5XCS.js +21 -0
- package/dist/{chunk-VVRQQRMQ.js → chunk-GKIFABGN.js} +150 -61
- package/dist/chunk-GTDW453U.js +522 -0
- package/dist/{chunk-Y2IGFLD2.js → chunk-HTZHBTIL.js} +69 -27
- package/dist/chunk-K2KS3JLY.js +188 -0
- package/dist/{chunk-GBSDAD3N.js → chunk-MK425RXJ.js} +3140 -3202
- package/dist/{chunk-YOAPPIWN.js → chunk-QYPMPWVX.js} +1 -1
- package/dist/chunk-UAKYDVT3.js +565 -0
- package/dist/{chunk-KWFY7L7X.js → chunk-UPQPUJOU.js} +36 -123
- package/dist/{chunk-2FHNY52R.js → chunk-UW5232GG.js} +65 -19
- package/dist/chunk-WSBYWVTZ.js +717 -0
- package/dist/{chunk-422J3QRW.js → chunk-XJFYAXET.js} +9 -8
- package/dist/{chunk-OTEUP2SG.js → chunk-XNKSSE32.js} +1 -1
- package/dist/{chunk-4OFH4BNX.js → chunk-Y322OTCH.js} +1 -1
- package/dist/{client-Cw1pB5sv.d.ts → client-B-hbHX30.d.ts} +109 -40
- package/dist/{deployments-DI-W7fBq.d.ts → deployments-M4OHn7G3.d.ts} +407 -18
- package/dist/identity-integration-3mX6b5iH.d.ts +1241 -0
- package/dist/index.d.ts +13 -11
- package/dist/index.js +14 -11
- package/dist/internal.d.ts +14 -12
- package/dist/internal.js +26 -14
- package/dist/{offers-CqXfMIxq.d.ts → offers-DhAtss4_.d.ts} +21 -4
- package/dist/pages-B8q8Y_dQ.d.ts +715 -0
- package/dist/{participant-activity-DHL8QYks.d.ts → participant-activity-D-Drp24G.d.ts} +16 -3
- package/dist/portal-proxy.d.ts +59 -2
- package/dist/portal-proxy.js +109 -23
- package/dist/react/index.d.ts +211 -27
- package/dist/react/index.js +286 -29
- package/dist/{action-DBzILFx9.d.ts → request-error-D_dUPLwo.d.ts} +1 -31
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/Y4OAVXFR.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +154 -30
- package/dist/schema.js +128 -75
- package/dist/server/index.d.ts +14 -12
- package/dist/server/index.js +2189 -1631
- package/dist/sign-in-providers-BkjcDsFF.d.ts +39 -0
- package/dist/submission-input-DHGKhXfp.d.ts +342 -0
- package/dist/{telegram-browser-CTJh4Ro_.d.ts → telegram-browser-BCE7zdOb.d.ts} +49 -6
- package/dist/telegram.d.ts +64 -0
- package/dist/telegram.js +23 -0
- package/dist/testing.d.ts +112 -15
- package/dist/testing.js +321 -16
- package/dist/tracker-data-Hb1uQnk5.d.ts +1855 -0
- package/dist/{transport-B8Ss5lcz.d.ts → transport-DkhX2Cbs.d.ts} +5863 -2217
- package/dist/{wallet-DZWL7lJH.d.ts → wallet-DTO7SXj7.d.ts} +27 -7
- package/package.json +5 -1
- package/dist/accounts-DoabriBX.d.ts +0 -306
- package/dist/capability-error-DufwG3G0.d.ts +0 -159
- package/dist/chunk-MJEJQH5A.js +0 -962
- package/dist/chunk-N7YOS4ZU.js +0 -13
- package/dist/chunk-XQKUJL7H.js +0 -602
- package/dist/chunk-YNW2ZUUP.js +0 -247
- package/dist/groups-9Jm3peq3.d.ts +0 -2827
- package/dist/runtime/chunks/ADUMK6CR.js +0 -1
- package/dist/submission-input-D9EGH_yb.d.ts +0 -146
- package/dist/x-KFJD2x8y.d.ts +0 -331
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { J as SignInProvider } from './accounts-CCqCKCVx.js';
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
import { a as TelegramSignInMethods } from './submission-input-DHGKhXfp.js';
|
|
4
|
+
|
|
5
|
+
declare const authProvidersSchema: z.ZodObject<{
|
|
6
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
7
|
+
provider: z.ZodEnum<{
|
|
8
|
+
discord: "discord";
|
|
9
|
+
google: "google";
|
|
10
|
+
apple: "apple";
|
|
11
|
+
x: "x";
|
|
12
|
+
}>;
|
|
13
|
+
configured: z.ZodBoolean;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
email: z.ZodBoolean;
|
|
16
|
+
wallets: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
17
|
+
solana: "solana";
|
|
18
|
+
eip155: "eip155";
|
|
19
|
+
cosmos: "cosmos";
|
|
20
|
+
}>>, z.ZodTransform<("solana" | "eip155" | "cosmos")[], ("solana" | "eip155" | "cosmos")[]>>;
|
|
21
|
+
demo: z.ZodBoolean;
|
|
22
|
+
telegram: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
login: z.ZodBoolean;
|
|
24
|
+
miniApp: z.ZodBoolean;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
signInProviders: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
27
|
+
provider: z.ZodType<SignInProvider, unknown, z.core.$ZodTypeInternals<SignInProvider, unknown>>;
|
|
28
|
+
configured: z.ZodBoolean;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/**
|
|
32
|
+
* What `relay.auth.providers()` answers: `authProvidersSchema`'s shape, with `telegram` typed as
|
|
33
|
+
* `TelegramSignInMethods` so the deprecation on `telegram.login` reaches apps.
|
|
34
|
+
*/
|
|
35
|
+
type AuthProviders = Omit<z.infer<typeof authProvidersSchema>, "telegram"> & {
|
|
36
|
+
telegram?: TelegramSignInMethods;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { type AuthProviders as A, authProvidersSchema as a };
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { L as LedgerReference, Q as QuestHandle } from './tracker-data-Hb1uQnk5.js';
|
|
3
|
+
import { B as ProjectGroupReference } from './accounts-CCqCKCVx.js';
|
|
4
|
+
|
|
5
|
+
declare const completionPrerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"completion">;
|
|
7
|
+
quest: z.ZodString;
|
|
8
|
+
scope: z.ZodLiteral<"ever">;
|
|
9
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
10
|
+
kind: z.ZodLiteral<"completion">;
|
|
11
|
+
quest: z.ZodString;
|
|
12
|
+
scope: z.ZodLiteral<"period">;
|
|
13
|
+
period: z.ZodEnum<{
|
|
14
|
+
day: "day";
|
|
15
|
+
week: "week";
|
|
16
|
+
month: "month";
|
|
17
|
+
}>;
|
|
18
|
+
}, z.core.$strict>], "scope">;
|
|
19
|
+
declare const balancePrerequisiteSchema: z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"balance">;
|
|
21
|
+
balance: z.ZodString;
|
|
22
|
+
minimum: z.ZodNumber;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
declare const groupPrerequisiteSchema: z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"group">;
|
|
26
|
+
group: z.ZodString;
|
|
27
|
+
title: z.ZodString;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
declare const prerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
30
|
+
kind: z.ZodLiteral<"completion">;
|
|
31
|
+
quest: z.ZodString;
|
|
32
|
+
scope: z.ZodLiteral<"ever">;
|
|
33
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
34
|
+
kind: z.ZodLiteral<"completion">;
|
|
35
|
+
quest: z.ZodString;
|
|
36
|
+
scope: z.ZodLiteral<"period">;
|
|
37
|
+
period: z.ZodEnum<{
|
|
38
|
+
day: "day";
|
|
39
|
+
week: "week";
|
|
40
|
+
month: "month";
|
|
41
|
+
}>;
|
|
42
|
+
}, z.core.$strict>], "scope">, z.ZodObject<{
|
|
43
|
+
kind: z.ZodLiteral<"balance">;
|
|
44
|
+
balance: z.ZodString;
|
|
45
|
+
minimum: z.ZodNumber;
|
|
46
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"group">;
|
|
48
|
+
group: z.ZodString;
|
|
49
|
+
title: z.ZodString;
|
|
50
|
+
}, z.core.$strict>], "kind">;
|
|
51
|
+
type Prerequisite = z.infer<typeof prerequisiteSchema>;
|
|
52
|
+
declare const missingPrerequisiteSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"completion">;
|
|
54
|
+
quest: z.ZodString;
|
|
55
|
+
title: z.ZodString;
|
|
56
|
+
scope: z.ZodLiteral<"ever">;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
kind: z.ZodLiteral<"completion">;
|
|
59
|
+
quest: z.ZodString;
|
|
60
|
+
title: z.ZodString;
|
|
61
|
+
scope: z.ZodLiteral<"period">;
|
|
62
|
+
period: z.ZodEnum<{
|
|
63
|
+
day: "day";
|
|
64
|
+
week: "week";
|
|
65
|
+
month: "month";
|
|
66
|
+
}>;
|
|
67
|
+
resetsAt: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
kind: z.ZodLiteral<"balance">;
|
|
70
|
+
balance: z.ZodString;
|
|
71
|
+
title: z.ZodString;
|
|
72
|
+
minimum: z.ZodNumber;
|
|
73
|
+
current: z.ZodNumber;
|
|
74
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
+
kind: z.ZodLiteral<"group">;
|
|
76
|
+
group: z.ZodString;
|
|
77
|
+
title: z.ZodString;
|
|
78
|
+
}, z.core.$strip>]>;
|
|
79
|
+
type MissingPrerequisite = z.infer<typeof missingPrerequisiteSchema>;
|
|
80
|
+
declare function completed(quest: QuestHandle, options?: {
|
|
81
|
+
scope?: "ever";
|
|
82
|
+
} | {
|
|
83
|
+
scope: "period";
|
|
84
|
+
period: "day" | "week" | "month";
|
|
85
|
+
}): {
|
|
86
|
+
kind: "completion";
|
|
87
|
+
quest: string;
|
|
88
|
+
scope: "ever";
|
|
89
|
+
} | {
|
|
90
|
+
kind: "completion";
|
|
91
|
+
quest: string;
|
|
92
|
+
scope: "period";
|
|
93
|
+
period: "day" | "week" | "month";
|
|
94
|
+
};
|
|
95
|
+
declare function balanceAtLeast(balance: LedgerReference, minimum: number): {
|
|
96
|
+
kind: "balance";
|
|
97
|
+
balance: string;
|
|
98
|
+
minimum: number;
|
|
99
|
+
};
|
|
100
|
+
declare function inGroup(group: ProjectGroupReference): {
|
|
101
|
+
kind: "group";
|
|
102
|
+
group: string;
|
|
103
|
+
title: string;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The Telegram sign-in a project offers, beside `providers` in `relay.auth.providers()`. Written
|
|
108
|
+
* out rather than inferred from `telegramSignInMethodsSchema`, because the built declarations drop
|
|
109
|
+
* a schema field's comments, and with them the deprecation on `login`.
|
|
110
|
+
*/
|
|
111
|
+
type TelegramSignInMethods = {
|
|
112
|
+
/**
|
|
113
|
+
* Telegram Login, the OpenID Connect sign-in Domino configures for the platform.
|
|
114
|
+
*
|
|
115
|
+
* @deprecated Read the `"telegram"` entry of `relay.auth.providers().signInProviders`, whose
|
|
116
|
+
* `configured` is the same. Removed in 2.0.0.
|
|
117
|
+
*/
|
|
118
|
+
login: boolean;
|
|
119
|
+
/** Mini App sign-in, which the project enables in Console with its bot's ID. */
|
|
120
|
+
miniApp: boolean;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* `TelegramSignInMethods` as Relay sends it. `satisfies` catches a field the type has and the
|
|
124
|
+
* schema lacks, not the reverse: add a field to both.
|
|
125
|
+
*
|
|
126
|
+
* @compat output
|
|
127
|
+
*/
|
|
128
|
+
declare const telegramSignInMethodsSchema: z.ZodObject<{
|
|
129
|
+
login: z.ZodBoolean;
|
|
130
|
+
miniApp: z.ZodBoolean;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
/**
|
|
133
|
+
* The member's Telegram account, as `AccountConnection` describes the other providers'. `subject`
|
|
134
|
+
* is the numeric Telegram user ID; `configured` is whether Telegram Login is.
|
|
135
|
+
*
|
|
136
|
+
* @compat output
|
|
137
|
+
*/
|
|
138
|
+
declare const telegramAccountConnectionSchema: z.ZodObject<{
|
|
139
|
+
configured: z.ZodBoolean;
|
|
140
|
+
status: z.ZodEnum<{
|
|
141
|
+
disconnected: "disconnected";
|
|
142
|
+
connected: "connected";
|
|
143
|
+
reconnect: "reconnect";
|
|
144
|
+
}>;
|
|
145
|
+
subject: z.ZodNullable<z.ZodString>;
|
|
146
|
+
revision: z.ZodNumber;
|
|
147
|
+
provider: z.ZodLiteral<"telegram">;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
type TelegramAccountConnection = z.infer<typeof telegramAccountConnectionSchema>;
|
|
150
|
+
/** The signed launch data a Telegram Mini App receives, `Telegram.WebApp.initData`. */
|
|
151
|
+
declare const telegramInitDataSchema: z.ZodString;
|
|
152
|
+
/** `POST /v1/auth/telegram/mini-app`: sign in, or connect Telegram to the signed-in member. */
|
|
153
|
+
declare const telegramMiniAppSignInSchema: z.ZodObject<{
|
|
154
|
+
initData: z.ZodString;
|
|
155
|
+
mode: z.ZodEnum<{
|
|
156
|
+
"sign-in": "sign-in";
|
|
157
|
+
connect: "connect";
|
|
158
|
+
}>;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
/** A Telegram chat ID as a decimal string: negative for groups, supergroups and channels. */
|
|
161
|
+
declare const telegramChatIdSchema: z.ZodString;
|
|
162
|
+
/**
|
|
163
|
+
* A chat bound to the project through Domino's bot. `status` is `ready` while the bot can read
|
|
164
|
+
* the chat as an administrator, `attention` with an `issue` once it cannot.
|
|
165
|
+
*
|
|
166
|
+
* @compat output
|
|
167
|
+
*/
|
|
168
|
+
declare const telegramChatSchema: z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
type: z.ZodString;
|
|
171
|
+
title: z.ZodString;
|
|
172
|
+
username: z.ZodNullable<z.ZodString>;
|
|
173
|
+
status: z.ZodString;
|
|
174
|
+
issue: z.ZodNullable<z.ZodString>;
|
|
175
|
+
canPost: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
connectedAt: z.ZodNumber;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
type TelegramChat = z.infer<typeof telegramChatSchema>;
|
|
179
|
+
/**
|
|
180
|
+
* The project's Telegram chats in this environment, and Domino's bot. `configured` is whether
|
|
181
|
+
* Domino configured its bot; without it no chat can be added.
|
|
182
|
+
*
|
|
183
|
+
* @compat output
|
|
184
|
+
*/
|
|
185
|
+
declare const telegramChatsSchema: z.ZodObject<{
|
|
186
|
+
configured: z.ZodBoolean;
|
|
187
|
+
bot: z.ZodNullable<z.ZodObject<{
|
|
188
|
+
username: z.ZodString;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
chats: z.ZodArray<z.ZodObject<{
|
|
191
|
+
id: z.ZodString;
|
|
192
|
+
type: z.ZodString;
|
|
193
|
+
title: z.ZodString;
|
|
194
|
+
username: z.ZodNullable<z.ZodString>;
|
|
195
|
+
status: z.ZodString;
|
|
196
|
+
issue: z.ZodNullable<z.ZodString>;
|
|
197
|
+
canPost: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
connectedAt: z.ZodNumber;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
type TelegramChats = z.infer<typeof telegramChatsSchema>;
|
|
202
|
+
/**
|
|
203
|
+
* A chat installation in progress: open `url` in Telegram, start Domino's bot and choose the chat.
|
|
204
|
+
* It expires at `expiresAt`, epoch milliseconds.
|
|
205
|
+
*
|
|
206
|
+
* @compat output
|
|
207
|
+
*/
|
|
208
|
+
declare const telegramChatConnectionSchema: z.ZodObject<{
|
|
209
|
+
url: z.ZodString;
|
|
210
|
+
expiresAt: z.ZodNumber;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
type TelegramChatConnection = z.infer<typeof telegramChatConnectionSchema>;
|
|
213
|
+
/** `ctx.telegram.member({ chat })`: a chat the project bound, by its numeric ID or @username. */
|
|
214
|
+
declare const telegramMemberInputSchema: z.ZodObject<{
|
|
215
|
+
chat: z.ZodString;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
/** `ctx.telegram.connection()`: the member's linked account, as the attempt pinned it. */
|
|
218
|
+
declare const telegramConnectionInputSchema: z.ZodObject<{
|
|
219
|
+
operation: z.ZodLiteral<"connection">;
|
|
220
|
+
}, z.core.$strict>;
|
|
221
|
+
/**
|
|
222
|
+
* The member's linked Telegram account, as `ctx.telegram.connection()` reads it. A vouched or
|
|
223
|
+
* imported account counts like one the member proved.
|
|
224
|
+
*
|
|
225
|
+
* @compat output
|
|
226
|
+
*/
|
|
227
|
+
declare const telegramConnectionSchema: z.ZodObject<{
|
|
228
|
+
userId: z.ZodString;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
type TelegramConnection = z.infer<typeof telegramConnectionSchema>;
|
|
231
|
+
/** A member's status in a chat as Telegram reports it; a later Telegram may add others. */
|
|
232
|
+
type TelegramChatMemberStatus = "creator" | "administrator" | "member" | "restricted" | (string & {});
|
|
233
|
+
/**
|
|
234
|
+
* The member's place in a Telegram chat, read with Domino's bot when quest code asks.
|
|
235
|
+
*
|
|
236
|
+
* @compat output
|
|
237
|
+
*/
|
|
238
|
+
declare const telegramChatMemberSchema: z.ZodObject<{
|
|
239
|
+
userId: z.ZodString;
|
|
240
|
+
username: z.ZodNullable<z.ZodString>;
|
|
241
|
+
status: z.ZodCustom<TelegramChatMemberStatus, TelegramChatMemberStatus>;
|
|
242
|
+
isMember: z.ZodBoolean;
|
|
243
|
+
isAdmin: z.ZodBoolean;
|
|
244
|
+
untilDate: z.ZodNullable<z.ZodNumber>;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
type TelegramChatMember = z.infer<typeof telegramChatMemberSchema>;
|
|
247
|
+
/**
|
|
248
|
+
* Reads the member's linked Telegram account, and a chat the project connected for it. The account
|
|
249
|
+
* is pinned at the attempt's first Telegram call, so later links and unlinks do not change the
|
|
250
|
+
* attempt; each `member()` call reads the chat as it is then. A chat the project has not connected, or whose bot lost access,
|
|
251
|
+
* throws `CapabilityError` with code `"integration-required"`; a Telegram outage throws
|
|
252
|
+
* `"provider-unavailable"`.
|
|
253
|
+
*/
|
|
254
|
+
interface TelegramReader {
|
|
255
|
+
/**
|
|
256
|
+
* The member's linked Telegram account; null when they have not linked one. It asks neither
|
|
257
|
+
* Telegram nor Domino's bot, so it needs no connected chat and no configured bot. Relay supplies
|
|
258
|
+
* it to every evaluation; it is optional only so that test doubles written before it keep
|
|
259
|
+
* compiling.
|
|
260
|
+
*/
|
|
261
|
+
connection?(): Promise<TelegramConnection | null>;
|
|
262
|
+
/** The member in `chat`; null when they are not in it or have not linked Telegram. */
|
|
263
|
+
member(input: {
|
|
264
|
+
chat: string;
|
|
265
|
+
}): Promise<TelegramChatMember | null>;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* One reaction a Telegram user added to a message, as a `telegram.reactions()` record's `data`.
|
|
270
|
+
* Every field is a scalar, so a trigger's `where` can select on it.
|
|
271
|
+
*
|
|
272
|
+
* @compat output
|
|
273
|
+
*/
|
|
274
|
+
declare const telegramReactionDataSchema: z.ZodObject<{
|
|
275
|
+
chatId: z.ZodString;
|
|
276
|
+
chatType: z.ZodString;
|
|
277
|
+
messageId: z.ZodNumber;
|
|
278
|
+
reactionType: z.ZodString;
|
|
279
|
+
emoji: z.ZodNullable<z.ZodString>;
|
|
280
|
+
customEmojiId: z.ZodNullable<z.ZodString>;
|
|
281
|
+
reactorStatus: z.ZodString;
|
|
282
|
+
reactorIsAdmin: z.ZodBoolean;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
type TelegramReactionData = z.infer<typeof telegramReactionDataSchema>;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* One message a Telegram user posted in a connected group, as a `telegram.messages()` record's
|
|
288
|
+
* `data`. It names the message and never holds its text. Every field is a scalar, so a trigger's
|
|
289
|
+
* `where` can select on it.
|
|
290
|
+
*
|
|
291
|
+
* @compat output
|
|
292
|
+
*/
|
|
293
|
+
declare const telegramMessageDataSchema: z.ZodObject<{
|
|
294
|
+
chatId: z.ZodString;
|
|
295
|
+
chatType: z.ZodString;
|
|
296
|
+
messageId: z.ZodNumber;
|
|
297
|
+
replyToMessageId: z.ZodNullable<z.ZodNumber>;
|
|
298
|
+
threadId: z.ZodNullable<z.ZodNumber>;
|
|
299
|
+
}, z.core.$strip>;
|
|
300
|
+
type TelegramMessageData = z.infer<typeof telegramMessageDataSchema>;
|
|
301
|
+
|
|
302
|
+
declare const textOptionsSchema: z.ZodObject<{
|
|
303
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
304
|
+
minLength: z.ZodDefault<z.ZodNumber>;
|
|
305
|
+
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
306
|
+
}, z.core.$strict>;
|
|
307
|
+
declare const urlOptionsSchema: z.ZodObject<{
|
|
308
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
309
|
+
allowedHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
310
|
+
}, z.core.$strict>;
|
|
311
|
+
type TextOptions = z.input<typeof textOptionsSchema>;
|
|
312
|
+
type UrlOptions = z.input<typeof urlOptionsSchema>;
|
|
313
|
+
declare const textEvidenceSchema: z.ZodObject<{
|
|
314
|
+
kind: z.ZodLiteral<"text">;
|
|
315
|
+
value: z.ZodString;
|
|
316
|
+
}, z.core.$strict>;
|
|
317
|
+
declare const urlEvidenceSchema: z.ZodObject<{
|
|
318
|
+
kind: z.ZodLiteral<"url">;
|
|
319
|
+
value: z.ZodString;
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
declare const valueEvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
322
|
+
kind: z.ZodLiteral<"text">;
|
|
323
|
+
value: z.ZodString;
|
|
324
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
325
|
+
kind: z.ZodLiteral<"url">;
|
|
326
|
+
value: z.ZodString;
|
|
327
|
+
}, z.core.$strict>], "kind">;
|
|
328
|
+
type TextEvidence = z.infer<typeof textEvidenceSchema>;
|
|
329
|
+
type UrlEvidence = z.infer<typeof urlEvidenceSchema>;
|
|
330
|
+
type ValueEvidence = z.infer<typeof valueEvidenceSchema>;
|
|
331
|
+
/** Validates a claim without fetching it or changing the captured value. */
|
|
332
|
+
declare function validateSubmissionValue(input: ValueEvidence, contract: {
|
|
333
|
+
input: "text";
|
|
334
|
+
constraints: z.output<typeof textOptionsSchema>;
|
|
335
|
+
} | {
|
|
336
|
+
input: "url";
|
|
337
|
+
constraints: z.output<typeof urlOptionsSchema>;
|
|
338
|
+
}): string | null;
|
|
339
|
+
/** Extract an ID only. The URL and its author name are untrusted claims. */
|
|
340
|
+
declare function xPostId(value: string): string | null;
|
|
341
|
+
|
|
342
|
+
export { telegramChatsSchema as A, telegramConnectionInputSchema as B, telegramConnectionSchema as C, telegramInitDataSchema as D, telegramMemberInputSchema as E, telegramMessageDataSchema as F, telegramMiniAppSignInSchema as G, telegramReactionDataSchema as H, telegramSignInMethodsSchema as I, textEvidenceSchema as J, textOptionsSchema as K, urlEvidenceSchema as L, type MissingPrerequisite as M, urlOptionsSchema as N, validateSubmissionValue as O, type Prerequisite as P, valueEvidenceSchema as Q, xPostId as R, type TelegramAccountConnection as T, type UrlEvidence as U, type ValueEvidence as V, type TelegramSignInMethods as a, type TextEvidence as b, type TextOptions as c, type UrlOptions as d, type TelegramReader as e, type TelegramChatMember as f, type TelegramChatMemberStatus as g, type TelegramConnection as h, type TelegramMessageData as i, type TelegramReactionData as j, balanceAtLeast as k, completed as l, inGroup as m, type TelegramChat as n, type TelegramChatConnection as o, type TelegramChats as p, balancePrerequisiteSchema as q, completionPrerequisiteSchema as r, groupPrerequisiteSchema as s, missingPrerequisiteSchema as t, prerequisiteSchema as u, telegramAccountConnectionSchema as v, telegramChatConnectionSchema as w, telegramChatIdSchema as x, telegramChatMemberSchema as y, telegramChatSchema as z };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { c as AuthProvider, J as SignInProvider } from './accounts-CCqCKCVx.js';
|
|
2
|
+
import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-B-hbHX30.js';
|
|
3
|
+
import { a as TelegramSignInMethods } from './submission-input-DHGKhXfp.js';
|
|
4
|
+
import { b as ParticipantSession } from './participant-activity-D-Drp24G.js';
|
|
5
|
+
import { C as CosmosChain, a as CosmosNetwork, m as WalletSigner, k as WalletSignInNetwork } from './wallet-DTO7SXj7.js';
|
|
5
6
|
|
|
6
7
|
/** An EIP-1193 provider, such as `window.ethereum` or an EIP-6963 announcement's provider. */
|
|
7
8
|
type Eip1193Provider = {
|
|
@@ -9,6 +10,9 @@ type Eip1193Provider = {
|
|
|
9
10
|
method: string;
|
|
10
11
|
params?: unknown[] | object;
|
|
11
12
|
}): Promise<unknown>;
|
|
13
|
+
/** Subscribes to a provider event such as `accountsChanged`; wallets without events leave it out. */
|
|
14
|
+
on?(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
15
|
+
removeListener?(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
12
16
|
};
|
|
13
17
|
/** The legacy injected Solana shape Phantom, Solflare and Backpack expose. */
|
|
14
18
|
type SolanaInjectedProvider = {
|
|
@@ -115,7 +119,10 @@ type SignInClient = {
|
|
|
115
119
|
}>;
|
|
116
120
|
emailVerify: (challenge: string, code: string, requestOptions?: RelayRequestOptions) => Promise<ParticipantSession>;
|
|
117
121
|
wallet: Pick<Auth["wallet"], "signIn">;
|
|
118
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Telegram Login; without it, `signInOptions()` offers no `telegram` option. Its
|
|
124
|
+
* `signInProviders` start every provider, Telegram included, with `start`.
|
|
125
|
+
*/
|
|
119
126
|
telegram?: {
|
|
120
127
|
start: (mode: "sign-in" | "connect", requestOptions?: RelayRequestOptions) => Promise<{
|
|
121
128
|
url: string;
|
|
@@ -126,6 +133,13 @@ type SignInClient = {
|
|
|
126
133
|
/** The sign-in methods a project takes: the platform's OAuth providers and email, and its wallet families. */
|
|
127
134
|
type SignInMethods = {
|
|
128
135
|
providers: AuthProvider[];
|
|
136
|
+
/**
|
|
137
|
+
* Every sign-in provider Domino configured for the platform, Telegram included: the open
|
|
138
|
+
* sibling of `providers`. A newer Relay may name providers this SDK does not know. Absent when
|
|
139
|
+
* the methods could not be read or Relay predates the list; `signInOptionsFrom` then reads
|
|
140
|
+
* `providers` and `telegram`.
|
|
141
|
+
*/
|
|
142
|
+
signInProviders?: SignInProvider[];
|
|
129
143
|
email: boolean;
|
|
130
144
|
/** The wallet families this project enabled for sign-in in Console. */
|
|
131
145
|
wallets: WalletSignInNetwork[];
|
|
@@ -178,9 +192,27 @@ type WalletSignInOption = {
|
|
|
178
192
|
/** Asks the wallet to sign a message, then signs in, or signs up. See `SignInOption` for failures. */
|
|
179
193
|
start(): Promise<void>;
|
|
180
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
* One sign-in provider the platform configured, Telegram included: the open sibling of
|
|
197
|
+
* `OAuthSignInOption`, whose `id` SDK 1.x keeps to `AuthProvider`. A newer Relay may name a
|
|
198
|
+
* provider this SDK does not know; its `label` is then the provider's name as Relay sends it.
|
|
199
|
+
*/
|
|
200
|
+
type ProviderSignInOption = {
|
|
201
|
+
kind: "provider";
|
|
202
|
+
/** The provider, such as `"google"` or `"telegram"`. */
|
|
203
|
+
id: SignInProvider;
|
|
204
|
+
/** The provider's name, such as "Google" or "Telegram". */
|
|
205
|
+
label: string;
|
|
206
|
+
icon: SignInProvider;
|
|
207
|
+
/** Leaves the page for the provider's consent screen. See `SignInOption` for failures. */
|
|
208
|
+
start(): Promise<void>;
|
|
209
|
+
};
|
|
181
210
|
/**
|
|
182
211
|
* Telegram Login. It is not one of `options` in SDK 1.x, whose `OAuthSignInOption` names only
|
|
183
212
|
* `AuthProvider`s: `SignInOptions.telegram` carries it, so render it beside them.
|
|
213
|
+
*
|
|
214
|
+
* @deprecated Use the `"telegram"` entry of `signInProviders`, a `ProviderSignInOption`. Removed
|
|
215
|
+
* in 2.0.0.
|
|
184
216
|
*/
|
|
185
217
|
type TelegramSignInOption = {
|
|
186
218
|
kind: "telegram";
|
|
@@ -214,10 +246,18 @@ type SignInUnavailable = {
|
|
|
214
246
|
type SignInOptions = {
|
|
215
247
|
/** OAuth providers first, then installed wallets, then email. */
|
|
216
248
|
options: SignInOption[];
|
|
249
|
+
/**
|
|
250
|
+
* Every sign-in provider the platform configured, Telegram included, in Relay's order: render
|
|
251
|
+
* these in place of the `oauth` entries of `options`, which SDK 1.x keeps to `AuthProvider`.
|
|
252
|
+
* Absent when the actions offer no `provider` action.
|
|
253
|
+
*/
|
|
254
|
+
signInProviders?: ProviderSignInOption[];
|
|
217
255
|
unavailable: SignInUnavailable[];
|
|
218
256
|
/**
|
|
219
257
|
* Telegram Login when the platform configured it, to render beside `options`. Mini App sign-in
|
|
220
258
|
* needs no button: call `relay.auth.telegram.miniApp.signIn()` inside the Mini App.
|
|
259
|
+
*
|
|
260
|
+
* @deprecated Use the `"telegram"` entry of `signInProviders`. Removed in 2.0.0.
|
|
221
261
|
*/
|
|
222
262
|
telegram?: TelegramSignInOption;
|
|
223
263
|
/** Why the project's methods could not be read; the options are then email alone. */
|
|
@@ -240,7 +280,10 @@ declare function signInOptions(relay: SignInClient, input?: {
|
|
|
240
280
|
* `Telegram.WebApp.initData` when the app loaded telegram-web-app.js, else the `tgWebAppData`
|
|
241
281
|
* launch parameter Telegram puts in the page's URL fragment. Pass it to
|
|
242
282
|
* `relay.auth.telegram.miniApp.signIn()`. Safe to call during server rendering, where it is null.
|
|
283
|
+
*
|
|
284
|
+
* @deprecated Import `telegramMiniAppInitData` from `@domino-sdk/relay/telegram`, and sign in with
|
|
285
|
+
* `withTelegram(relay).telegram.miniApp.signIn()`. Removed in 2.0.0.
|
|
243
286
|
*/
|
|
244
287
|
declare function telegramMiniAppInitData(): string | null;
|
|
245
288
|
|
|
246
|
-
export { type CosmosChains as C, type DiscoveredWallet as D, type Eip1193Provider as E, type KeplrLike as K, type OAuthSignInOption as O, type SignInClient as S, type TelegramSignInOption as T, type WalletSignInOption as W, type EmailSignInOption as a, type SignInIcon as b, type SignInMethods as c, type SignInOption as d, type SignInOptions as e, type SignInUnavailable as f, type SignInWallet as g, type SolanaInjectedProvider as h, type StandardWallet as i, type StandardWalletAccount as j, cosmosChainList as k, cosmosSigner as l, discoverCosmosWallets as m, discoverEvmWallets as n, discoverSignInWallets as o, discoverSolanaWallets as p, evmSigner as q, solanaSigner as r, signInOptions as s, telegramMiniAppInitData as t, walletStandardSolanaSigner as w };
|
|
289
|
+
export { type CosmosChains as C, type DiscoveredWallet as D, type Eip1193Provider as E, type KeplrLike as K, type OAuthSignInOption as O, type ProviderSignInOption as P, type SignInClient as S, type TelegramSignInOption as T, type WalletSignInOption as W, type EmailSignInOption as a, type SignInIcon as b, type SignInMethods as c, type SignInOption as d, type SignInOptions as e, type SignInUnavailable as f, type SignInWallet as g, type SolanaInjectedProvider as h, type StandardWallet as i, type StandardWalletAccount as j, cosmosChainList as k, cosmosSigner as l, discoverCosmosWallets as m, discoverEvmWallets as n, discoverSignInWallets as o, discoverSolanaWallets as p, evmSigner as q, solanaSigner as r, signInOptions as s, telegramMiniAppInitData as t, walletStandardSolanaSigner as w };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { k as RelayRequestOptions, R as RelayClient } from './client-B-hbHX30.js';
|
|
2
|
+
import { b as ParticipantSession } from './participant-activity-D-Drp24G.js';
|
|
3
|
+
import './accounts-CCqCKCVx.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import './tracker-data-Hb1uQnk5.js';
|
|
6
|
+
import './wallet-DTO7SXj7.js';
|
|
7
|
+
import './pages-B8q8Y_dQ.js';
|
|
8
|
+
import './submission-input-DHGKhXfp.js';
|
|
9
|
+
import './request-error-D_dUPLwo.js';
|
|
10
|
+
import './catalog--ZIlskAo.js';
|
|
11
|
+
import './action-9Xl0StBg.js';
|
|
12
|
+
import './sign-in-providers-BkjcDsFF.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A plugin's own sign-in method, such as Telegram's Mini App sign-in: the app passes the vendor's
|
|
16
|
+
* signed proof.
|
|
17
|
+
*
|
|
18
|
+
* @experimental
|
|
19
|
+
*/
|
|
20
|
+
type PluginSignInMethod = {
|
|
21
|
+
/** Signs in, or signs up, as the account the proof names. */
|
|
22
|
+
signIn(proof: string, requestOptions?: RelayRequestOptions): Promise<ParticipantSession>;
|
|
23
|
+
/** Links the account the proof names to the signed-in member. */
|
|
24
|
+
connect(proof: string, requestOptions?: RelayRequestOptions): Promise<{
|
|
25
|
+
ok: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* What only the Telegram plugin does, as `relay.telegram` (docs/adr/0024-plugins.md). What every
|
|
31
|
+
* sign-in provider does, Telegram's included, is on `relay.auth`.
|
|
32
|
+
*
|
|
33
|
+
* @experimental
|
|
34
|
+
*/
|
|
35
|
+
type TelegramClient = {
|
|
36
|
+
/**
|
|
37
|
+
* Sign-in inside a Telegram Mini App, where the project named its bot in Console
|
|
38
|
+
* (`relay.auth.providers().telegram.miniApp`). Pass the Mini App's signed launch data,
|
|
39
|
+
* `telegramMiniAppInitData()`. Relay checks Telegram's signature for the project's bot and
|
|
40
|
+
* accepts launch data at most five minutes old, once.
|
|
41
|
+
*/
|
|
42
|
+
readonly miniApp: PluginSignInMethod;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Adds `relay.telegram` to a client that `createRelayClient` or `createBrowserRelayClient` made,
|
|
46
|
+
* and answers the same client.
|
|
47
|
+
*
|
|
48
|
+
* @experimental
|
|
49
|
+
*/
|
|
50
|
+
declare function withTelegram<Client extends RelayClient>(relay: Client): Client & {
|
|
51
|
+
readonly telegram: TelegramClient;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The signed launch data of the Telegram Mini App this page runs in, or null outside one: Telegram's
|
|
56
|
+
* `Telegram.WebApp.initData` when the app loaded telegram-web-app.js, else the `tgWebAppData`
|
|
57
|
+
* launch parameter Telegram puts in the page's URL fragment. Pass it to
|
|
58
|
+
* `relay.telegram.miniApp.signIn()`. Safe to call during server rendering, where it is null.
|
|
59
|
+
*
|
|
60
|
+
* @experimental
|
|
61
|
+
*/
|
|
62
|
+
declare function telegramMiniAppInitData(): string | null;
|
|
63
|
+
|
|
64
|
+
export { type PluginSignInMethod, type TelegramClient, telegramMiniAppInitData, withTelegram };
|
package/dist/telegram.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
miniAppInitData
|
|
3
|
+
} from "./chunk-FWLQ5XCS.js";
|
|
4
|
+
import {
|
|
5
|
+
withPluginNamespace
|
|
6
|
+
} from "./chunk-6WCIWXUV.js";
|
|
7
|
+
import "./chunk-K2KS3JLY.js";
|
|
8
|
+
|
|
9
|
+
// src/plugins/telegram.generated.ts
|
|
10
|
+
function withTelegram(relay) {
|
|
11
|
+
return withPluginNamespace(relay, "telegram", (transport) => ({
|
|
12
|
+
miniApp: transport.signInMethod("/v1/auth/telegram/mini-app", "initData")
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/plugins/telegram.ts
|
|
17
|
+
function telegramMiniAppInitData() {
|
|
18
|
+
return miniAppInitData();
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
telegramMiniAppInitData,
|
|
22
|
+
withTelegram
|
|
23
|
+
};
|