@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
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MANAGEMENT_TIMEOUT,
|
|
3
|
+
clientIdentity,
|
|
3
4
|
lifetime,
|
|
4
5
|
retryAfter,
|
|
5
6
|
retrying,
|
|
6
7
|
validTimeout
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3PYYGFSB.js";
|
|
8
9
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
authScopeSchema
|
|
13
|
-
} from "./chunk-422J3QRW.js";
|
|
10
|
+
knownResponse
|
|
11
|
+
} from "./chunk-MK425RXJ.js";
|
|
14
12
|
import {
|
|
15
13
|
RequestError,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
knownResponse,
|
|
19
|
-
openIdentityKindSchema
|
|
20
|
-
} from "./chunk-GBSDAD3N.js";
|
|
14
|
+
isRequestError
|
|
15
|
+
} from "./chunk-K2KS3JLY.js";
|
|
21
16
|
|
|
22
17
|
// src/configuration.ts
|
|
23
18
|
function questConfiguration(release) {
|
|
@@ -33,104 +28,8 @@ function questConfiguration(release) {
|
|
|
33
28
|
};
|
|
34
29
|
}
|
|
35
30
|
|
|
36
|
-
// src/credential-secrets.ts
|
|
37
|
-
import * as z from "zod";
|
|
38
|
-
var credentialSecretSchema = z.object({
|
|
39
|
-
id: z.string().uuid(),
|
|
40
|
-
/** The secret's last four characters, to tell secrets apart; null for one issued before hints. */
|
|
41
|
-
hint: z.string().nullable(),
|
|
42
|
-
createdAt: z.number(),
|
|
43
|
-
/** When the secret stops working; null when it never expires. */
|
|
44
|
-
expiresAt: z.number().nullable(),
|
|
45
|
-
/** When the secret last authenticated a request; null when it never has. */
|
|
46
|
-
lastUsedAt: z.number().nullable()
|
|
47
|
-
});
|
|
48
|
-
var credentialSecretInputSchema = z.object({
|
|
49
|
-
expiresInDays: z.number().int().min(1).max(3650).optional()
|
|
50
|
-
}).strict();
|
|
51
|
-
|
|
52
|
-
// src/identity-integration.ts
|
|
53
|
-
import * as z2 from "zod";
|
|
54
|
-
var identityIntegrationInputSchema = z2.object({
|
|
55
|
-
name: z2.string().trim().min(1).max(80),
|
|
56
|
-
origin: z2.string().url().refine((value) => {
|
|
57
|
-
const url = new URL(value);
|
|
58
|
-
return url.protocol === "https:" && url.origin === value;
|
|
59
|
-
}, "Use an exact HTTPS application origin"),
|
|
60
|
-
/**
|
|
61
|
-
* The identity kind this integration owns in the project and environment, such as
|
|
62
|
-
* `app:telegram`. Each member it signs in gets the exchanged subject as an identity of this
|
|
63
|
-
* kind, which tracker attribution and `ctx.member.identities()` read. Its kind cannot change.
|
|
64
|
-
* Omit it for an integration that only signs members in.
|
|
65
|
-
*
|
|
66
|
-
* A kind belongs to the integration that first claimed it, also after that integration is
|
|
67
|
-
* disconnected. A new integration takes a kind that already has identities only by adopting
|
|
68
|
-
* them with `adoptIdentitiesFrom`.
|
|
69
|
-
*/
|
|
70
|
-
identityKind: appIdentityKindSchema.optional(),
|
|
71
|
-
/**
|
|
72
|
-
* Adopt the identities of a disconnected integration's `identityKind`: its ID, as
|
|
73
|
-
* `identityIntegrations.kinds()` lists it. Adopt only when this app's user IDs mean the same
|
|
74
|
-
* users as that integration's, because each one then signs in as the member that ID is linked
|
|
75
|
-
* to. Needs `reason`, which the audit log keeps.
|
|
76
|
-
*/
|
|
77
|
-
adoptIdentitiesFrom: z2.string().uuid().optional(),
|
|
78
|
-
/** Why the identities are adopted; required with `adoptIdentitiesFrom`. */
|
|
79
|
-
reason: z2.string().trim().min(1).max(500).optional(),
|
|
80
|
-
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
81
|
-
expiresInDays: z2.number().int().min(1).max(3650).optional()
|
|
82
|
-
}).strict().refine(
|
|
83
|
-
(input) => !input.adoptIdentitiesFrom || input.identityKind,
|
|
84
|
-
"Adopting identities needs the identityKind they have"
|
|
85
|
-
).refine(
|
|
86
|
-
(input) => !input.adoptIdentitiesFrom === !input.reason,
|
|
87
|
-
"Give a reason when adopting identities, and only then"
|
|
88
|
-
);
|
|
89
|
-
var identityIntegrationSchema = z2.object({
|
|
90
|
-
...authScopeSchema.shape,
|
|
91
|
-
id: z2.string().uuid(),
|
|
92
|
-
name: z2.string(),
|
|
93
|
-
origin: z2.string(),
|
|
94
|
-
/**
|
|
95
|
-
* When the integration's last working secret expires: 8640000000000000 (the latest date
|
|
96
|
-
* JavaScript represents) when one never does.
|
|
97
|
-
*
|
|
98
|
-
* @deprecated Read `secrets`, which gives each secret's own expiry.
|
|
99
|
-
*/
|
|
100
|
-
expiresAt: z2.number(),
|
|
101
|
-
/** The integration's working secrets, oldest first. Any of them authenticates it. */
|
|
102
|
-
secrets: z2.array(credentialSecretSchema).default([]),
|
|
103
|
-
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
104
|
-
lastUsedAt: z2.number().nullable().default(null),
|
|
105
|
-
/** The identity kind the integration owns; null when it only signs members in. */
|
|
106
|
-
identityKind: openIdentityKindSchema.nullable().default(null)
|
|
107
|
-
});
|
|
108
|
-
var identityIntegrationSecretSchema = identityIntegrationSchema.extend(
|
|
109
|
-
{
|
|
110
|
-
token: z2.string()
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
var identityKindClaimSchema = z2.object({
|
|
114
|
-
kind: openIdentityKindSchema,
|
|
115
|
-
/** The owning integration's ID; it stays after the integration is disconnected. */
|
|
116
|
-
integration: z2.string(),
|
|
117
|
-
/** The owning integration's name when it claimed or adopted the kind. */
|
|
118
|
-
integrationName: z2.string(),
|
|
119
|
-
/** Whether the owning integration is still connected. */
|
|
120
|
-
connected: z2.boolean(),
|
|
121
|
-
/** Linked identities of the kind; adopting them is required to reuse the kind. */
|
|
122
|
-
linked: z2.number().int().nonnegative(),
|
|
123
|
-
/** Identities an operator unlinked. */
|
|
124
|
-
unlinked: z2.number().int().nonnegative(),
|
|
125
|
-
claimedAt: z2.number().int().nonnegative()
|
|
126
|
-
});
|
|
127
|
-
var participantExchangeSchema = z2.object({
|
|
128
|
-
subject: z2.string().min(1).max(200),
|
|
129
|
-
previousToken: z2.string().max(200).optional()
|
|
130
|
-
}).strict();
|
|
131
|
-
|
|
132
31
|
// src/server/errors.ts
|
|
133
|
-
import * as
|
|
32
|
+
import * as z from "zod";
|
|
134
33
|
var ManagementErrorCode = {
|
|
135
34
|
/** The input or an option failed validation before anything was sent (kind `client`). */
|
|
136
35
|
InvalidInput: "invalid-input",
|
|
@@ -141,9 +40,9 @@ var ManagementErrorCode = {
|
|
|
141
40
|
Aborted: "aborted",
|
|
142
41
|
InvalidResponse: "invalid-response"
|
|
143
42
|
};
|
|
144
|
-
var managementErrorSchema =
|
|
145
|
-
error:
|
|
146
|
-
code:
|
|
43
|
+
var managementErrorSchema = z.looseObject({
|
|
44
|
+
error: z.string(),
|
|
45
|
+
code: z.string().optional()
|
|
147
46
|
});
|
|
148
47
|
var uncertainStatuses = /* @__PURE__ */ new Set([500, 502, 504]);
|
|
149
48
|
function uncertainOutcome(init) {
|
|
@@ -195,7 +94,17 @@ var ManagementError = class extends RequestError {
|
|
|
195
94
|
var DEFAULT_MANAGEMENT_TIMEOUT = MANAGEMENT_TIMEOUT;
|
|
196
95
|
|
|
197
96
|
// src/server/transport.ts
|
|
198
|
-
import * as
|
|
97
|
+
import * as z2 from "zod";
|
|
98
|
+
var ManagementUploadBody = class {
|
|
99
|
+
constructor(body, headers, actionId) {
|
|
100
|
+
this.body = body;
|
|
101
|
+
this.headers = headers;
|
|
102
|
+
this.actionId = actionId;
|
|
103
|
+
}
|
|
104
|
+
body;
|
|
105
|
+
headers;
|
|
106
|
+
actionId;
|
|
107
|
+
};
|
|
199
108
|
function failureCause(error) {
|
|
200
109
|
if (typeof error !== "object" || error === null || !("cause" in error)) {
|
|
201
110
|
return {};
|
|
@@ -204,6 +113,9 @@ function failureCause(error) {
|
|
|
204
113
|
return typeof cause === "object" && cause !== null ? cause : {};
|
|
205
114
|
}
|
|
206
115
|
function actionIdOf(input) {
|
|
116
|
+
if (input instanceof ManagementUploadBody) {
|
|
117
|
+
return input.actionId;
|
|
118
|
+
}
|
|
207
119
|
return typeof input === "object" && input !== null && "actionId" in input && typeof input.actionId === "string" ? input.actionId : void 0;
|
|
208
120
|
}
|
|
209
121
|
function unsent(error) {
|
|
@@ -425,7 +337,14 @@ function managementTransport(options) {
|
|
|
425
337
|
const fetchInit = {
|
|
426
338
|
method,
|
|
427
339
|
headers: tolerant ? { "X-Domino-Response": "tolerant-v1" } : void 0,
|
|
428
|
-
...input === void 0 ? {} : {
|
|
340
|
+
...input === void 0 ? {} : input instanceof ManagementUploadBody ? {
|
|
341
|
+
headers: {
|
|
342
|
+
"Content-Type": input.body.type,
|
|
343
|
+
...input.headers,
|
|
344
|
+
...tolerant ? { "X-Domino-Response": "tolerant-v1" } : {}
|
|
345
|
+
},
|
|
346
|
+
body: input.body
|
|
347
|
+
} : {
|
|
429
348
|
headers: {
|
|
430
349
|
"Content-Type": "application/json",
|
|
431
350
|
...tolerant ? { "X-Domino-Response": "tolerant-v1" } : {}
|
|
@@ -491,7 +410,7 @@ function managementTransport(options) {
|
|
|
491
410
|
replaySafe
|
|
492
411
|
}) => exchange(
|
|
493
412
|
path,
|
|
494
|
-
|
|
413
|
+
z2.unknown(),
|
|
495
414
|
body,
|
|
496
415
|
method,
|
|
497
416
|
void 0,
|
|
@@ -501,8 +420,8 @@ function managementTransport(options) {
|
|
|
501
420
|
}
|
|
502
421
|
|
|
503
422
|
// src/sequence-cursor.ts
|
|
504
|
-
import * as
|
|
505
|
-
var sequenceCursorSchema =
|
|
423
|
+
import * as z3 from "zod";
|
|
424
|
+
var sequenceCursorSchema = z3.string().regex(/^[1-9][0-9]{0,15}$/, "Invalid cursor").transform(Number).pipe(z3.number().int().positive().safe());
|
|
506
425
|
|
|
507
426
|
// src/referral-reward-kinds.ts
|
|
508
427
|
var REFERRAL_INTEGRATION_REWARD_ERROR = "Referral programs can grant points and tiered rewards; Discord roles need a quest";
|
|
@@ -524,18 +443,12 @@ function containsReferralIntegrationReward(value) {
|
|
|
524
443
|
|
|
525
444
|
export {
|
|
526
445
|
questConfiguration,
|
|
527
|
-
credentialSecretSchema,
|
|
528
|
-
credentialSecretInputSchema,
|
|
529
|
-
identityIntegrationInputSchema,
|
|
530
|
-
identityIntegrationSchema,
|
|
531
|
-
identityIntegrationSecretSchema,
|
|
532
|
-
identityKindClaimSchema,
|
|
533
|
-
participantExchangeSchema,
|
|
534
446
|
ManagementErrorCode,
|
|
535
447
|
managementErrorSchema,
|
|
536
448
|
isManagementError,
|
|
537
449
|
ManagementError,
|
|
538
450
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
451
|
+
ManagementUploadBody,
|
|
539
452
|
actionIdOf,
|
|
540
453
|
managementTransport,
|
|
541
454
|
sequenceCursorSchema,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRelayClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GKIFABGN.js";
|
|
4
|
+
import {
|
|
5
|
+
cosmosChain
|
|
6
|
+
} from "./chunk-MK425RXJ.js";
|
|
4
7
|
import {
|
|
5
8
|
RelayErrorCode,
|
|
6
9
|
asRelayError,
|
|
7
|
-
clientError
|
|
8
|
-
|
|
9
|
-
} from "./chunk-GBSDAD3N.js";
|
|
10
|
+
clientError
|
|
11
|
+
} from "./chunk-K2KS3JLY.js";
|
|
10
12
|
|
|
11
13
|
// src/base58.ts
|
|
12
14
|
var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
@@ -78,6 +80,37 @@ function evmSigner(provider, info = {}) {
|
|
|
78
80
|
throw new Error("The wallet returned no signature.");
|
|
79
81
|
}
|
|
80
82
|
return { signature };
|
|
83
|
+
},
|
|
84
|
+
watchAccounts(listener) {
|
|
85
|
+
let stopped = false;
|
|
86
|
+
let heard = false;
|
|
87
|
+
const report = (accounts) => {
|
|
88
|
+
if (!stopped && Array.isArray(accounts)) {
|
|
89
|
+
listener(
|
|
90
|
+
accounts.filter(
|
|
91
|
+
(account) => typeof account === "string"
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const changed = (accounts) => {
|
|
97
|
+
heard = true;
|
|
98
|
+
report(accounts);
|
|
99
|
+
};
|
|
100
|
+
provider.on?.("accountsChanged", changed);
|
|
101
|
+
provider.request({ method: "eth_accounts" }).then(
|
|
102
|
+
(accounts) => {
|
|
103
|
+
if (!heard) {
|
|
104
|
+
report(accounts);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
() => {
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
return () => {
|
|
111
|
+
stopped = true;
|
|
112
|
+
provider.removeListener?.("accountsChanged", changed);
|
|
113
|
+
};
|
|
81
114
|
}
|
|
82
115
|
};
|
|
83
116
|
}
|
|
@@ -339,6 +372,10 @@ var providerLabels = {
|
|
|
339
372
|
x: "X",
|
|
340
373
|
discord: "Discord"
|
|
341
374
|
};
|
|
375
|
+
var signInProviderLabels = new Map([
|
|
376
|
+
...Object.entries(providerLabels),
|
|
377
|
+
["telegram", "Telegram"]
|
|
378
|
+
]);
|
|
342
379
|
var familyLabels = {
|
|
343
380
|
solana: "Solana",
|
|
344
381
|
eip155: "EVM",
|
|
@@ -431,8 +468,22 @@ function signInOptionsFrom(methods, wallets, input) {
|
|
|
431
468
|
});
|
|
432
469
|
}
|
|
433
470
|
const telegram = actions.telegram;
|
|
471
|
+
const start = actions.provider;
|
|
472
|
+
const configured = methods.signInProviders ?? [
|
|
473
|
+
...methods.providers,
|
|
474
|
+
...methods.telegram?.login ? ["telegram"] : []
|
|
475
|
+
];
|
|
434
476
|
return {
|
|
435
477
|
options,
|
|
478
|
+
...start ? {
|
|
479
|
+
signInProviders: configured.map((provider) => ({
|
|
480
|
+
kind: "provider",
|
|
481
|
+
id: provider,
|
|
482
|
+
label: signInProviderLabels.get(provider) ?? provider,
|
|
483
|
+
icon: provider,
|
|
484
|
+
start: () => start(provider)
|
|
485
|
+
}))
|
|
486
|
+
} : {},
|
|
436
487
|
unavailable,
|
|
437
488
|
...methods.telegram?.login && telegram ? {
|
|
438
489
|
telegram: {
|
|
@@ -451,6 +502,9 @@ async function readSignInMethods(relay) {
|
|
|
451
502
|
const result = await relay.auth.providers();
|
|
452
503
|
return {
|
|
453
504
|
providers: result.providers.filter((entry) => entry.configured).map((entry) => entry.provider),
|
|
505
|
+
...result.signInProviders ? {
|
|
506
|
+
signInProviders: result.signInProviders.filter((entry) => entry.configured).map((entry) => entry.provider)
|
|
507
|
+
} : {},
|
|
454
508
|
email: result.email,
|
|
455
509
|
wallets: result.wallets,
|
|
456
510
|
...result.telegram ? { telegram: result.telegram } : {}
|
|
@@ -481,6 +535,13 @@ async function signInOptions(relay, input = {}) {
|
|
|
481
535
|
const { url } = await relay.auth.start(provider, "sign-in");
|
|
482
536
|
window.location.assign(url);
|
|
483
537
|
},
|
|
538
|
+
async provider(provider) {
|
|
539
|
+
const { url } = await relay.auth.start(
|
|
540
|
+
provider,
|
|
541
|
+
"sign-in"
|
|
542
|
+
);
|
|
543
|
+
window.location.assign(url);
|
|
544
|
+
},
|
|
484
545
|
async sendCode(email) {
|
|
485
546
|
challenge = null;
|
|
486
547
|
challenge = (await relay.auth.emailStart(email)).challenge;
|
|
@@ -506,20 +567,6 @@ async function signInOptions(relay, input = {}) {
|
|
|
506
567
|
});
|
|
507
568
|
}
|
|
508
569
|
|
|
509
|
-
// src/telegram-browser.ts
|
|
510
|
-
function telegramMiniAppInitData() {
|
|
511
|
-
const scope = globalThis;
|
|
512
|
-
const fromScript = scope.Telegram?.WebApp?.initData;
|
|
513
|
-
if (typeof fromScript === "string" && fromScript.length > 0) {
|
|
514
|
-
return fromScript;
|
|
515
|
-
}
|
|
516
|
-
const hash = scope.location?.hash;
|
|
517
|
-
if (!hash) {
|
|
518
|
-
return null;
|
|
519
|
-
}
|
|
520
|
-
return new URLSearchParams(hash.replace(/^#/, "")).get("tgWebAppData") || null;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
570
|
// src/member-time.ts
|
|
524
571
|
function memberTime(me, at = Date.now()) {
|
|
525
572
|
return at + (me.clock?.offsetMs ?? 0);
|
|
@@ -703,7 +750,6 @@ export {
|
|
|
703
750
|
signInOptionsFrom,
|
|
704
751
|
readSignInMethods,
|
|
705
752
|
signInOptions,
|
|
706
|
-
telegramMiniAppInitData,
|
|
707
753
|
memberTime,
|
|
708
754
|
createBrowserRelayClient,
|
|
709
755
|
browserSubmissionStore
|