@domino-sdk/relay 1.63.0 → 1.66.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 +35 -0
- package/dist/{accounts-nz3mzfRQ.d.ts → accounts-_lNsiR2k.d.ts} +22 -2
- package/dist/{attempt-captures-DMi8oR9T.d.ts → attempt-captures-BqPggxTU.d.ts} +1 -1
- package/dist/authoring.d.ts +11 -11
- package/dist/authoring.js +15 -20
- package/dist/{automatic-outcomes-C_LLQU1p.d.ts → automatic-outcomes-BzAvfcpd.d.ts} +2 -2
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +11 -14
- package/dist/{catalog-BaTOKpNw.d.ts → catalog-ByZMRS7I.d.ts} +1 -1
- package/dist/{chunk-MTKRIQEU.js → chunk-2HHZV7U3.js} +1 -1
- package/dist/{chunk-ICXZZNPS.js → chunk-5BMZZDGY.js} +1 -1
- package/dist/{chunk-7Z4SZ6YM.js → chunk-5DYS2OIP.js} +1 -1
- package/dist/{chunk-QR6HH4DI.js → chunk-5LD5DKOM.js} +4 -4
- package/dist/chunk-7MQCQYEE.js +405 -0
- package/dist/{chunk-7X67QLPB.js → chunk-ANVAUOJP.js} +1 -1
- package/dist/{chunk-AQOL3SK5.js → chunk-BQXRCJ3N.js} +1 -1
- package/dist/{chunk-EHUSD3O2.js → chunk-CGUL4MRE.js} +2 -4
- package/dist/chunk-CJDB6W6I.js +1510 -0
- package/dist/{chunk-GLH6MEI2.js → chunk-FGXLXENM.js} +29 -3
- package/dist/{chunk-N4LNEGQX.js → chunk-FU3W4IQN.js} +2 -2
- package/dist/{chunk-NQDEWJWE.js → chunk-KHXCURXB.js} +6 -232
- package/dist/{chunk-4GQW43UU.js → chunk-M66Y5OMJ.js} +26 -30
- package/dist/{chunk-VWQGWGCH.js → chunk-OWDIR7ZU.js} +1 -1
- package/dist/{chunk-5XLZ34PV.js → chunk-PNVQ4RBG.js} +3 -3
- package/dist/{chunk-FU5CGNTR.js → chunk-QYHEHMCG.js} +44 -5
- package/dist/{chunk-LZWXCBUB.js → chunk-QZNLSK4U.js} +41 -45
- package/dist/{chunk-3RFP6GT5.js → chunk-TCYDFNV4.js} +2 -2
- package/dist/{chunk-ID3BZXFZ.js → chunk-XCEGNKGH.js} +1939 -1211
- package/dist/{client-DHmG7rn6.d.ts → client-Cze4lfwA.d.ts} +13 -8
- package/dist/{dashboards-CLemT6kj.d.ts → dashboards-pVfclkyh.d.ts} +2 -2
- package/dist/{deployments-DTULi7dF.d.ts → deployments-Cr1tfqrr.d.ts} +2 -2
- package/dist/{identity-integration-DOeNZaxF.d.ts → identity-integration-Ci2vGKtX.d.ts} +37 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +11 -15
- package/dist/internal.d.ts +12 -12
- package/dist/internal.js +21 -16
- package/dist/{limits-kNzYdZ00.d.ts → limits-pE04y9O2.d.ts} +8 -1
- package/dist/{offers-CYeN_I0Y.d.ts → offers-Hw2P6tcK.d.ts} +2 -2
- package/dist/{participant-activity-D-Drp24G.d.ts → participant-activity-DXRq4s6K.d.ts} +1 -0
- package/dist/portal-proxy.d.ts +4 -2
- package/dist/portal-proxy.js +13 -5
- package/dist/react/index.d.ts +20 -13
- package/dist/react/index.js +11 -14
- package/dist/{reward-deliveries-drp-x1G-.d.ts → reward-deliveries-BCV8hznc.d.ts} +1 -1
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/C5V267I7.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +19 -16
- package/dist/schema.js +109 -112
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +800 -1041
- package/dist/{sign-in-providers-B1Q9eDRm.d.ts → sign-in-providers-BAkGjSXo.d.ts} +2 -2
- package/dist/{submission-input-DZCbjQUH.d.ts → submission-input-ChL1aYNH.d.ts} +2 -2
- package/dist/{telegram-browser-NL0Asmsi.d.ts → telegram-browser-BFs4u7lC.d.ts} +4 -4
- package/dist/telegram.d.ts +8 -8
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +10 -10
- package/dist/testing.js +19 -23
- package/dist/{tracker-data-esm3WG8R.d.ts → tracker-data-Bl-qPIvZ.d.ts} +3 -1
- package/dist/{transport-Czht_irp.d.ts → transport-WE49Ta3A.d.ts} +1116 -19
- package/package.json +1 -1
- package/dist/chunk-4NOFSGAL.js +0 -320
- package/dist/chunk-FO2LCZTL.js +0 -19
- package/dist/chunk-KP2MCX3R.js +0 -587
- package/dist/chunk-N4BDKS6Y.js +0 -87
- package/dist/chunk-TLSQETTY.js +0 -41
- package/dist/chunk-W7YSMSGC.js +0 -725
- package/dist/runtime/chunks/UGDV5W4N.js +0 -1
package/dist/chunk-KP2MCX3R.js
DELETED
|
@@ -1,587 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
authScopeSchema,
|
|
3
|
-
exchangeResultSchema
|
|
4
|
-
} from "./chunk-N4BDKS6Y.js";
|
|
5
|
-
import {
|
|
6
|
-
appIdentityKindSchema,
|
|
7
|
-
cosmosAddressSchema,
|
|
8
|
-
cosmosNetworkSchema,
|
|
9
|
-
evmAddressSchema,
|
|
10
|
-
identifier,
|
|
11
|
-
offsetDateTimeSchema,
|
|
12
|
-
openIdentityKindSchema,
|
|
13
|
-
solanaAddressSchema
|
|
14
|
-
} from "./chunk-ID3BZXFZ.js";
|
|
15
|
-
|
|
16
|
-
// src/credential-secrets.ts
|
|
17
|
-
import * as z from "zod";
|
|
18
|
-
var credentialSecretSchema = /* @__PURE__ */ (() => z.object({
|
|
19
|
-
id: z.string().uuid(),
|
|
20
|
-
/** The secret's last four characters, to tell secrets apart; null for one issued before hints. */
|
|
21
|
-
hint: z.string().nullable(),
|
|
22
|
-
createdAt: z.number(),
|
|
23
|
-
/** When the secret stops working; null when it never expires. */
|
|
24
|
-
expiresAt: z.number().nullable(),
|
|
25
|
-
/** When the secret last authenticated a request; null when it never has. */
|
|
26
|
-
lastUsedAt: z.number().nullable()
|
|
27
|
-
}))();
|
|
28
|
-
var credentialSecretInputSchema = /* @__PURE__ */ (() => z.object({
|
|
29
|
-
expiresInDays: z.number().int().min(1).max(3650).optional()
|
|
30
|
-
}).strict())();
|
|
31
|
-
|
|
32
|
-
// src/server/member-imports.ts
|
|
33
|
-
import * as z2 from "zod";
|
|
34
|
-
var importTimeSchema = /* @__PURE__ */ (() => z2.union([
|
|
35
|
-
z2.number().int().nonnegative().safe(),
|
|
36
|
-
offsetDateTimeSchema().transform((value) => Date.parse(value))
|
|
37
|
-
]))();
|
|
38
|
-
var importWalletSchema = /* @__PURE__ */ (() => z2.discriminatedUnion("chain", [
|
|
39
|
-
z2.object({
|
|
40
|
-
kind: z2.literal("wallet"),
|
|
41
|
-
chain: z2.literal("solana"),
|
|
42
|
-
address: solanaAddressSchema
|
|
43
|
-
}).strict(),
|
|
44
|
-
z2.object({
|
|
45
|
-
kind: z2.literal("wallet"),
|
|
46
|
-
chain: z2.literal("eip155"),
|
|
47
|
-
address: evmAddressSchema
|
|
48
|
-
}).strict(),
|
|
49
|
-
z2.object({
|
|
50
|
-
kind: z2.literal("wallet"),
|
|
51
|
-
chain: z2.literal("cosmos"),
|
|
52
|
-
network: cosmosNetworkSchema,
|
|
53
|
-
address: cosmosAddressSchema
|
|
54
|
-
}).strict()
|
|
55
|
-
]))();
|
|
56
|
-
var importXSchema = /* @__PURE__ */ (() => z2.object({
|
|
57
|
-
kind: z2.literal("x"),
|
|
58
|
-
subject: z2.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric X user ID")
|
|
59
|
-
}).strict())();
|
|
60
|
-
var importTelegramSchema = /* @__PURE__ */ (() => z2.object({
|
|
61
|
-
kind: z2.literal("telegram"),
|
|
62
|
-
subject: z2.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric Telegram user ID")
|
|
63
|
-
}).strict())();
|
|
64
|
-
var importDiscordSchema = /* @__PURE__ */ (() => z2.object({
|
|
65
|
-
kind: z2.literal("discord"),
|
|
66
|
-
subject: z2.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric Discord user ID")
|
|
67
|
-
}).strict())();
|
|
68
|
-
var importAppIdentitySchema = /* @__PURE__ */ (() => z2.object({ kind: appIdentityKindSchema, subject: z2.string().min(1).max(256) }).strict())();
|
|
69
|
-
var memberImportIdentitySchema = /* @__PURE__ */ (() => z2.union([
|
|
70
|
-
importAppIdentitySchema,
|
|
71
|
-
importWalletSchema,
|
|
72
|
-
importXSchema
|
|
73
|
-
]))();
|
|
74
|
-
var memberImportAccountSchema = /* @__PURE__ */ (() => z2.union([
|
|
75
|
-
importWalletSchema,
|
|
76
|
-
importXSchema
|
|
77
|
-
]))();
|
|
78
|
-
var memberImportVouchedAccountSchema = /* @__PURE__ */ (() => z2.union([
|
|
79
|
-
importWalletSchema,
|
|
80
|
-
importXSchema,
|
|
81
|
-
importTelegramSchema,
|
|
82
|
-
importDiscordSchema
|
|
83
|
-
]))();
|
|
84
|
-
var identityReferenceSchema = /* @__PURE__ */ (() => z2.union([
|
|
85
|
-
importAppIdentitySchema,
|
|
86
|
-
importWalletSchema,
|
|
87
|
-
importXSchema,
|
|
88
|
-
importTelegramSchema,
|
|
89
|
-
importDiscordSchema
|
|
90
|
-
]))();
|
|
91
|
-
var memberImportActionSchema = /* @__PURE__ */ (() => z2.object({
|
|
92
|
-
at: importTimeSchema,
|
|
93
|
-
key: z2.string().min(1).max(200).optional()
|
|
94
|
-
}).strict())();
|
|
95
|
-
var memberImportReferralSchema = /* @__PURE__ */ (() => z2.object({
|
|
96
|
-
/**
|
|
97
|
-
* The inviter: the `ref` of another row of this import, or the sign-in identity of a member
|
|
98
|
-
* who already exists in this environment.
|
|
99
|
-
*/
|
|
100
|
-
inviter: z2.union([
|
|
101
|
-
z2.string().trim().min(1).max(200),
|
|
102
|
-
memberImportIdentitySchema
|
|
103
|
-
]),
|
|
104
|
-
/** When the member accepted the invitation. */
|
|
105
|
-
acceptedAt: importTimeSchema,
|
|
106
|
-
/** Referral programs, by authoring key or ID, the member qualified in, and when. */
|
|
107
|
-
qualified: z2.array(
|
|
108
|
-
z2.object({ program: z2.string().min(1).max(200), at: importTimeSchema }).strict()
|
|
109
|
-
).max(50).default([])
|
|
110
|
-
}).strict())();
|
|
111
|
-
var memberImportConsentSchema = /* @__PURE__ */ (() => z2.object({
|
|
112
|
-
/** The channel, such as `email`. */
|
|
113
|
-
channel: z2.string().min(1).max(64),
|
|
114
|
-
state: z2.enum(["granted", "withdrawn"]),
|
|
115
|
-
/** When the member chose, on the platform they come from. */
|
|
116
|
-
at: importTimeSchema,
|
|
117
|
-
/**
|
|
118
|
-
* The text the member saw, verbatim: required to grant, at most `consentWordingMaxLength`
|
|
119
|
-
* characters.
|
|
120
|
-
*/
|
|
121
|
-
// The 2,000-character limit is a row refusal at check, so a long wording refuses its row
|
|
122
|
-
// instead of the batch; this bound only caps what a row stores.
|
|
123
|
-
wording: z2.string().max(8e3).optional()
|
|
124
|
-
}).strict())();
|
|
125
|
-
var memberImportRowSchema = /* @__PURE__ */ (() => z2.object({
|
|
126
|
-
/** The member's ID on the platform they come from. Unique within an import. */
|
|
127
|
-
ref: z2.string().trim().min(1).max(200),
|
|
128
|
-
identity: memberImportIdentitySchema,
|
|
129
|
-
accounts: z2.array(memberImportAccountSchema).max(20).default([]),
|
|
130
|
-
/** Opening balances, credited once per ledger as an imported entry. */
|
|
131
|
-
points: z2.array(
|
|
132
|
-
z2.object({
|
|
133
|
-
ledger: z2.string().min(1).max(200),
|
|
134
|
-
balance: z2.number().int().positive().safe()
|
|
135
|
-
}).strict()
|
|
136
|
-
).max(50).default([]),
|
|
137
|
-
/** Quest progress, by quest authoring key or ID. */
|
|
138
|
-
quests: z2.array(
|
|
139
|
-
z2.object({
|
|
140
|
-
quest: z2.string().min(1).max(200),
|
|
141
|
-
actions: z2.array(memberImportActionSchema).min(1).max(3660)
|
|
142
|
-
}).strict()
|
|
143
|
-
).max(200).default([]),
|
|
144
|
-
referral: memberImportReferralSchema.optional(),
|
|
145
|
-
/** The member's marketing consent, per channel, as the platform they come from recorded it. */
|
|
146
|
-
consent: z2.array(memberImportConsentSchema).max(10).optional()
|
|
147
|
-
}).strict())();
|
|
148
|
-
var memberImportFullRowSchema = /* @__PURE__ */ (() => memberImportRowSchema.extend({
|
|
149
|
-
accounts: z2.array(memberImportVouchedAccountSchema).max(20).default([])
|
|
150
|
-
}).strict())();
|
|
151
|
-
var memberImportCreateSchema = /* @__PURE__ */ (() => z2.object({
|
|
152
|
-
actionId: identifier,
|
|
153
|
-
/** Where the members come from, such as "legacy-domino". */
|
|
154
|
-
source: z2.string().trim().min(1).max(100)
|
|
155
|
-
}).strict())();
|
|
156
|
-
var memberImportRowsInputSchema = /* @__PURE__ */ (() => z2.object({ rows: z2.array(memberImportRowSchema).min(1).max(500) }).strict())();
|
|
157
|
-
var memberImportFullRowsInputSchema = /* @__PURE__ */ (() => z2.object({ rows: z2.array(memberImportFullRowSchema).min(1).max(500) }).strict())();
|
|
158
|
-
var MemberImportRefusalCode = {
|
|
159
|
-
/** An account or identity belongs to another member in the project. */
|
|
160
|
-
AccountLinkedElsewhere: "account-linked-elsewhere",
|
|
161
|
-
/** An operator unlinked the row's app identity. */
|
|
162
|
-
IdentityUnlinked: "identity-unlinked",
|
|
163
|
-
/** An earlier row of the import names the same account. */
|
|
164
|
-
DuplicateAccount: "duplicate-account",
|
|
165
|
-
/** The row names two X accounts, or the member already has another X account selected. */
|
|
166
|
-
XAccountSelected: "x-account-selected",
|
|
167
|
-
/** The row names two Telegram accounts, or the member already has another one selected. */
|
|
168
|
-
TelegramAccountSelected: "telegram-account-selected",
|
|
169
|
-
/** The row names two Discord accounts, or the member already has another one selected. */
|
|
170
|
-
DiscordAccountSelected: "discord-account-selected",
|
|
171
|
-
/** The member would hold more wallets of a chain family than a member can link. */
|
|
172
|
-
LimitReached: "limit-reached",
|
|
173
|
-
UnknownLedger: "unknown-ledger",
|
|
174
|
-
UnknownQuest: "unknown-quest",
|
|
175
|
-
/** The quest has no active release in this environment. */
|
|
176
|
-
QuestNotPublished: "quest-not-published",
|
|
177
|
-
/** The quest's completions are decided per content item, which an import cannot record. */
|
|
178
|
-
QuestNotImportable: "quest-not-importable",
|
|
179
|
-
/** A keyed quest's action has no `key`. */
|
|
180
|
-
KeyRequired: "key-required",
|
|
181
|
-
/**
|
|
182
|
-
* An action's key, on a quest whose keys are unique across members, is used by another member's
|
|
183
|
-
* completion or by an earlier row of the import.
|
|
184
|
-
*/
|
|
185
|
-
KeyUsed: "key-used",
|
|
186
|
-
/** An action, a referral or a consent is dated in the future. */
|
|
187
|
-
FutureAction: "future-action",
|
|
188
|
-
/** A consent names a channel Relay does not record consent for. */
|
|
189
|
-
UnsupportedConsentChannel: "unsupported-consent-channel",
|
|
190
|
-
/** A granted consent has no wording. */
|
|
191
|
-
ConsentWordingRequired: "consent-wording-required",
|
|
192
|
-
/** A consent's wording is longer than `consentWordingMaxLength` characters. */
|
|
193
|
-
ConsentWordingTooLong: "consent-wording-too-long",
|
|
194
|
-
/** A consent's wording is not plain text: it has a NUL or a lone surrogate. */
|
|
195
|
-
ConsentWordingInvalid: "consent-wording-invalid",
|
|
196
|
-
/** The row's sign-in wallet or X account is linked to its member without sign-in. */
|
|
197
|
-
SignInDisabled: "sign-in-disabled",
|
|
198
|
-
/**
|
|
199
|
-
* The row names one point ledger, quest or referral program twice, by any of its names, or one
|
|
200
|
-
* consent channel twice.
|
|
201
|
-
*/
|
|
202
|
-
DuplicateEntry: "duplicate-entry",
|
|
203
|
-
/** The inviter is no row of this import, and no member of the environment signs in with it. */
|
|
204
|
-
UnknownInviter: "unknown-inviter",
|
|
205
|
-
/** The row names its own member as the inviter. */
|
|
206
|
-
SelfReferral: "self-referral",
|
|
207
|
-
/** The member already has an inviter. An import never replaces one. */
|
|
208
|
-
InviterAlreadyAccepted: "inviter-already-accepted",
|
|
209
|
-
/** The inviter was invited, directly or through others, by this row's member. */
|
|
210
|
-
ReferralCycle: "referral-cycle",
|
|
211
|
-
/** The row that names the inviter was refused, so the inviter is never imported. */
|
|
212
|
-
InviterRefused: "inviter-refused",
|
|
213
|
-
/** No referral program of that key or ID in this environment, or it is archived. */
|
|
214
|
-
UnknownReferralProgram: "unknown-referral-program"
|
|
215
|
-
};
|
|
216
|
-
var refusalCodeSchema = /* @__PURE__ */ (() => z2.string())();
|
|
217
|
-
var memberImportRefusalSchema = /* @__PURE__ */ (() => z2.object({
|
|
218
|
-
code: refusalCodeSchema,
|
|
219
|
-
message: z2.string()
|
|
220
|
-
}))();
|
|
221
|
-
var memberImportRowResultSchema = /* @__PURE__ */ (() => z2.object({
|
|
222
|
-
line: z2.number().int().positive(),
|
|
223
|
-
ref: z2.string(),
|
|
224
|
-
status: z2.enum(["pending", "ready", "applied", "refused"]),
|
|
225
|
-
/** The member the row resolves to: an existing member, or the one applying created. */
|
|
226
|
-
member: identifier.nullable(),
|
|
227
|
-
/** Whether the row's identity names a member who already exists. Null until checked. */
|
|
228
|
-
existing: z2.boolean().nullable(),
|
|
229
|
-
refusals: z2.array(memberImportRefusalSchema),
|
|
230
|
-
/**
|
|
231
|
-
* Whether the import's revert went through this applied row. Absent from a Relay older than
|
|
232
|
-
* this field.
|
|
233
|
-
*/
|
|
234
|
-
reverted: z2.boolean().optional()
|
|
235
|
-
}))();
|
|
236
|
-
var memberImportRowPageSchema = /* @__PURE__ */ (() => z2.object({
|
|
237
|
-
items: z2.array(memberImportRowResultSchema),
|
|
238
|
-
nextCursor: z2.string().nullable()
|
|
239
|
-
}))();
|
|
240
|
-
var memberImportRowQuerySchema = /* @__PURE__ */ (() => z2.object({
|
|
241
|
-
status: z2.enum(["pending", "ready", "applied", "refused"]).optional(),
|
|
242
|
-
cursor: z2.string().max(200).optional(),
|
|
243
|
-
limit: z2.coerce.number().int().min(1).max(500).optional()
|
|
244
|
-
}).strict())();
|
|
245
|
-
var memberImportSummarySchema = /* @__PURE__ */ (() => z2.object({
|
|
246
|
-
rows: z2.number().int().nonnegative(),
|
|
247
|
-
ready: z2.number().int().nonnegative(),
|
|
248
|
-
refused: z2.number().int().nonnegative(),
|
|
249
|
-
members: z2.object({
|
|
250
|
-
created: z2.number().int().nonnegative(),
|
|
251
|
-
existing: z2.number().int().nonnegative()
|
|
252
|
-
}),
|
|
253
|
-
/** Identities and accounts the ready rows attach, sign-in identities included. */
|
|
254
|
-
accounts: z2.number().int().nonnegative(),
|
|
255
|
-
/** Opening balance totals, by ledger as the rows name it. */
|
|
256
|
-
points: z2.array(
|
|
257
|
-
z2.object({ ledger: z2.string(), total: z2.number().int().nonnegative() })
|
|
258
|
-
),
|
|
259
|
-
/** Imported actions, by quest as the rows name it. */
|
|
260
|
-
actions: z2.array(
|
|
261
|
-
z2.object({ quest: z2.string(), total: z2.number().int().nonnegative() })
|
|
262
|
-
),
|
|
263
|
-
/**
|
|
264
|
-
* Accepted referrals the ready rows record, and their qualifications by program as the rows
|
|
265
|
-
* name it. Absent from a summary written before imports carried referrals.
|
|
266
|
-
*/
|
|
267
|
-
referrals: z2.object({
|
|
268
|
-
accepted: z2.number().int().nonnegative(),
|
|
269
|
-
qualified: z2.array(
|
|
270
|
-
z2.object({
|
|
271
|
-
program: z2.string(),
|
|
272
|
-
total: z2.number().int().nonnegative()
|
|
273
|
-
})
|
|
274
|
-
)
|
|
275
|
-
}).optional(),
|
|
276
|
-
/** Refused rows, by refusal code. A row can have several. */
|
|
277
|
-
refusals: z2.array(
|
|
278
|
-
z2.object({ code: refusalCodeSchema, rows: z2.number().int().nonnegative() })
|
|
279
|
-
)
|
|
280
|
-
}))();
|
|
281
|
-
var memberImportCommandSchema = /* @__PURE__ */ (() => z2.object({ actionId: identifier.optional() }).strict())();
|
|
282
|
-
var memberImportRevertInputSchema = /* @__PURE__ */ (() => z2.object({
|
|
283
|
-
actionId: identifier,
|
|
284
|
-
reason: z2.string().trim().min(1).max(500)
|
|
285
|
-
}).strict())();
|
|
286
|
-
var memberImportRevertOutcomeSchema = /* @__PURE__ */ (() => z2.object({
|
|
287
|
-
reversed: z2.object({
|
|
288
|
-
/** Applied rows the revert went through. */
|
|
289
|
-
rows: z2.number().int().nonnegative(),
|
|
290
|
-
/** Opening balance entries reversed. */
|
|
291
|
-
entries: z2.number().int().nonnegative(),
|
|
292
|
-
/** Imported completions revoked. */
|
|
293
|
-
completions: z2.number().int().nonnegative(),
|
|
294
|
-
/** Links the rows created that the revert removed. */
|
|
295
|
-
links: z2.number().int().nonnegative()
|
|
296
|
-
}),
|
|
297
|
-
/**
|
|
298
|
-
* Imported points the revert could not take back, by member and point ledger: the member had
|
|
299
|
-
* spent or reserved them. A revert takes only free points, as a completion's revocation does,
|
|
300
|
-
* so no balance goes below zero and Relay records no debt.
|
|
301
|
-
*/
|
|
302
|
-
unreversedPoints: z2.array(
|
|
303
|
-
z2.object({
|
|
304
|
-
member: identifier,
|
|
305
|
-
ledger: identifier,
|
|
306
|
-
amount: z2.number().int().positive()
|
|
307
|
-
})
|
|
308
|
-
),
|
|
309
|
-
/**
|
|
310
|
-
* Links the rows created that stay, because the member relied on them since: `signed-in` with
|
|
311
|
-
* it, or `proved` a vouched wallet. `kind` is `wallet`, the provider (`x`, `telegram`,
|
|
312
|
-
* `discord`) or `app:<name>`; `account` is the address or subject. A row whose member was erased
|
|
313
|
-
* (`members.erase`) is passed over whole: one entry with `kind: "member"`, the member ID as
|
|
314
|
-
* `account` and reason `member-erased`, and nothing of that row is reversed.
|
|
315
|
-
*/
|
|
316
|
-
keptLinks: z2.array(
|
|
317
|
-
z2.object({
|
|
318
|
-
member: identifier,
|
|
319
|
-
kind: z2.string(),
|
|
320
|
-
account: z2.string(),
|
|
321
|
-
reason: z2.string()
|
|
322
|
-
})
|
|
323
|
-
),
|
|
324
|
-
/**
|
|
325
|
-
* True when rows were applied before imports recorded the links they created: those rows'
|
|
326
|
-
* links all stay, and only their balances and completions were reversed.
|
|
327
|
-
*/
|
|
328
|
-
linksUntracked: z2.boolean()
|
|
329
|
-
}))();
|
|
330
|
-
var memberImportRevertSchema = /* @__PURE__ */ (() => z2.object({
|
|
331
|
-
reason: z2.string(),
|
|
332
|
-
requestedAt: z2.number().int(),
|
|
333
|
-
requestedBy: z2.string().nullable(),
|
|
334
|
-
/** Applied rows reverted so far. */
|
|
335
|
-
rows: z2.number().int().nonnegative(),
|
|
336
|
-
revertedAt: z2.number().int().nullable(),
|
|
337
|
-
outcome: memberImportRevertOutcomeSchema.nullable()
|
|
338
|
-
}))();
|
|
339
|
-
var MemberImportState = {
|
|
340
|
-
/** Rows are being added. */
|
|
341
|
-
Open: "open",
|
|
342
|
-
/** The check (the dry run) is running. */
|
|
343
|
-
Checking: "checking",
|
|
344
|
-
/** Checked, with a summary; it can be applied. */
|
|
345
|
-
Checked: "checked",
|
|
346
|
-
/** Applying its ready rows, in the background. */
|
|
347
|
-
Applying: "applying",
|
|
348
|
-
/** Every ready row was applied or refused. */
|
|
349
|
-
Applied: "applied",
|
|
350
|
-
/** Stopped while applying: the rows it did not reach stay `ready`, and it can't be applied again. */
|
|
351
|
-
Stopped: "stopped",
|
|
352
|
-
/** Its revert is taking back what its applied rows granted, in the background. */
|
|
353
|
-
Reverting: "reverting",
|
|
354
|
-
/** Its revert went through every applied row. */
|
|
355
|
-
Reverted: "reverted",
|
|
356
|
-
/** Canceled before it was applied. */
|
|
357
|
-
Canceled: "canceled"
|
|
358
|
-
};
|
|
359
|
-
var memberImportStateSchema = /* @__PURE__ */ (() => z2.string())();
|
|
360
|
-
var memberImportSchema = /* @__PURE__ */ (() => z2.object({
|
|
361
|
-
id: identifier,
|
|
362
|
-
source: z2.string(),
|
|
363
|
-
/**
|
|
364
|
-
* The import's state, open to states Relay adds. Absent from a Relay older than this field;
|
|
365
|
-
* `status` then holds the state, folded as below.
|
|
366
|
-
*/
|
|
367
|
-
state: memberImportStateSchema.optional(),
|
|
368
|
-
/**
|
|
369
|
-
* The state as SDK 1.0 typed it: `applied` for a stopped, reverting or reverted import too, so
|
|
370
|
-
* filtering on `applied` includes them. Read `state` instead.
|
|
371
|
-
*/
|
|
372
|
-
status: z2.enum([
|
|
373
|
-
"open",
|
|
374
|
-
"checking",
|
|
375
|
-
"checked",
|
|
376
|
-
"applying",
|
|
377
|
-
"applied",
|
|
378
|
-
"canceled"
|
|
379
|
-
]),
|
|
380
|
-
rows: z2.number().int().nonnegative(),
|
|
381
|
-
/** The latest check's summary, or null before the first check and after rows change. */
|
|
382
|
-
summary: memberImportSummarySchema.nullable(),
|
|
383
|
-
/** While applying and after, stopped included: rows applied and refused so far. */
|
|
384
|
-
progress: z2.object({
|
|
385
|
-
applied: z2.number().int().nonnegative(),
|
|
386
|
-
refused: z2.number().int().nonnegative()
|
|
387
|
-
}),
|
|
388
|
-
createdAt: z2.number().int(),
|
|
389
|
-
createdBy: z2.string().nullable(),
|
|
390
|
-
checkedAt: z2.number().int().nullable(),
|
|
391
|
-
appliedAt: z2.number().int().nullable(),
|
|
392
|
-
appliedBy: z2.string().nullable(),
|
|
393
|
-
canceledAt: z2.number().int().nullable(),
|
|
394
|
-
canceledBy: z2.string().nullable(),
|
|
395
|
-
/** Set when the import was stopped while applying; `appliedAt` stays null. */
|
|
396
|
-
stoppedAt: z2.number().int().nullish(),
|
|
397
|
-
stoppedBy: z2.string().nullish(),
|
|
398
|
-
/** Set once a revert was asked for: the import is `reverting`, then `reverted`. */
|
|
399
|
-
revert: memberImportRevertSchema.nullish()
|
|
400
|
-
}))();
|
|
401
|
-
var memberImportPageSchema = /* @__PURE__ */ (() => z2.object({
|
|
402
|
-
items: z2.array(memberImportSchema),
|
|
403
|
-
nextCursor: z2.string().nullable()
|
|
404
|
-
}))();
|
|
405
|
-
var memberImportListQuerySchema = /* @__PURE__ */ (() => z2.object({
|
|
406
|
-
cursor: z2.string().max(200).optional(),
|
|
407
|
-
limit: z2.coerce.number().int().min(1).max(100).optional()
|
|
408
|
-
}).strict())();
|
|
409
|
-
|
|
410
|
-
// src/identity-integration.ts
|
|
411
|
-
import * as z3 from "zod";
|
|
412
|
-
var identityIntegrationInputSchema = /* @__PURE__ */ (() => z3.object({
|
|
413
|
-
name: z3.string().trim().min(1).max(80),
|
|
414
|
-
origin: z3.string().url().superRefine((value, context) => {
|
|
415
|
-
const url = new URL(value);
|
|
416
|
-
if (url.protocol !== "https:") {
|
|
417
|
-
context.addIssue({ code: "custom", message: "Use an HTTPS origin." });
|
|
418
|
-
} else if (url.origin !== value) {
|
|
419
|
-
context.addIssue({
|
|
420
|
-
code: "custom",
|
|
421
|
-
message: `Use the exact origin ${url.origin}, without a path, query or trailing slash.`
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
}),
|
|
425
|
-
/**
|
|
426
|
-
* The identity kind this integration owns in the project and environment, such as
|
|
427
|
-
* `app:game`. Each member it signs in gets the exchanged subject as an identity of this
|
|
428
|
-
* kind, which tracker attribution and `ctx.member.identities()` read. Its kind cannot change.
|
|
429
|
-
* Omit it for an integration that only signs members in.
|
|
430
|
-
*
|
|
431
|
-
* A kind belongs to the integration that first claimed it, also after that integration is
|
|
432
|
-
* disconnected. A new integration takes a kind that already has identities only by adopting
|
|
433
|
-
* them with `adoptIdentitiesFrom`.
|
|
434
|
-
*/
|
|
435
|
-
identityKind: appIdentityKindSchema.optional(),
|
|
436
|
-
/**
|
|
437
|
-
* Adopt the identities of a disconnected integration's `identityKind`: its ID, as
|
|
438
|
-
* `identityIntegrations.kinds()` lists it. Adopt only when this app's user IDs mean the same
|
|
439
|
-
* users as that integration's, because each one then signs in as the member that ID is linked
|
|
440
|
-
* to. Needs `reason`, which the audit log keeps.
|
|
441
|
-
*/
|
|
442
|
-
adoptIdentitiesFrom: z3.string().uuid().optional(),
|
|
443
|
-
/** Why the identities are adopted; required with `adoptIdentitiesFrom`. */
|
|
444
|
-
reason: z3.string().trim().min(1).max(500).optional(),
|
|
445
|
-
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
446
|
-
expiresInDays: z3.number().int().min(1).max(3650).optional()
|
|
447
|
-
}).strict().refine(
|
|
448
|
-
(input) => !input.adoptIdentitiesFrom || input.identityKind,
|
|
449
|
-
"Adopting identities needs the identityKind they have"
|
|
450
|
-
).refine(
|
|
451
|
-
(input) => !input.adoptIdentitiesFrom === !input.reason,
|
|
452
|
-
"Give a reason when adopting identities, and only then"
|
|
453
|
-
))();
|
|
454
|
-
var identityIntegrationSchema = /* @__PURE__ */ (() => z3.object({
|
|
455
|
-
...authScopeSchema.shape,
|
|
456
|
-
id: z3.string().uuid(),
|
|
457
|
-
name: z3.string(),
|
|
458
|
-
origin: z3.string(),
|
|
459
|
-
/**
|
|
460
|
-
* When the integration's last working secret expires: 8640000000000000 (the latest date
|
|
461
|
-
* JavaScript represents) when one never does.
|
|
462
|
-
*
|
|
463
|
-
* @deprecated Read `secrets`, which gives each secret's own expiry.
|
|
464
|
-
*/
|
|
465
|
-
expiresAt: z3.number(),
|
|
466
|
-
/** The integration's working secrets, oldest first. Any of them authenticates it. */
|
|
467
|
-
secrets: z3.array(credentialSecretSchema).default([]),
|
|
468
|
-
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
469
|
-
lastUsedAt: z3.number().nullable().default(null),
|
|
470
|
-
/** The identity kind the integration owns; null when it only signs members in. */
|
|
471
|
-
identityKind: openIdentityKindSchema.nullable().default(null),
|
|
472
|
-
/**
|
|
473
|
-
* Whether the app's server may vouch for its members' accounts when it signs them in
|
|
474
|
-
* (`accounts` on the exchange). False in Relay versions without it.
|
|
475
|
-
*/
|
|
476
|
-
vouchesAccounts: z3.boolean().default(false)
|
|
477
|
-
}))();
|
|
478
|
-
var identityIntegrationSecretSchema = /* @__PURE__ */ (() => identityIntegrationSchema.extend(
|
|
479
|
-
{
|
|
480
|
-
token: z3.string()
|
|
481
|
-
}
|
|
482
|
-
))();
|
|
483
|
-
var identityKindClaimSchema = /* @__PURE__ */ (() => z3.object({
|
|
484
|
-
kind: openIdentityKindSchema,
|
|
485
|
-
/** The owning integration's ID; it stays after the integration is disconnected. */
|
|
486
|
-
integration: z3.string(),
|
|
487
|
-
/** The owning integration's name when it claimed or adopted the kind. */
|
|
488
|
-
integrationName: z3.string(),
|
|
489
|
-
/** Whether the owning integration is still connected. */
|
|
490
|
-
connected: z3.boolean(),
|
|
491
|
-
/** Linked identities of the kind; adopting them is required to reuse the kind. */
|
|
492
|
-
linked: z3.number().int().nonnegative(),
|
|
493
|
-
/** Identities an operator unlinked. */
|
|
494
|
-
unlinked: z3.number().int().nonnegative(),
|
|
495
|
-
claimedAt: z3.number().int().nonnegative()
|
|
496
|
-
}))();
|
|
497
|
-
var identityIntegrationAccountVouchingInputSchema = /* @__PURE__ */ (() => z3.object({
|
|
498
|
-
enabled: z3.boolean(),
|
|
499
|
-
reason: z3.string().trim().min(1).max(500),
|
|
500
|
-
actionId: identifier.optional()
|
|
501
|
-
}).strict())();
|
|
502
|
-
var vouchedProviders = ["x", "telegram", "discord"];
|
|
503
|
-
var participantExchangeAccountsSchema = /* @__PURE__ */ (() => z3.array(memberImportVouchedAccountSchema).max(20).refine(
|
|
504
|
-
(accounts) => vouchedProviders.every(
|
|
505
|
-
(kind) => accounts.filter((entry) => entry.kind === kind).length <= 1
|
|
506
|
-
),
|
|
507
|
-
"Vouch for at most one X, Telegram and Discord account each"
|
|
508
|
-
))();
|
|
509
|
-
var participantExchangeSchema = /* @__PURE__ */ (() => z3.object({
|
|
510
|
-
subject: z3.string().min(1).max(200),
|
|
511
|
-
previousToken: z3.string().max(200).optional(),
|
|
512
|
-
/**
|
|
513
|
-
* Accounts the app vouches belong to this member, attached on the organization's word like an
|
|
514
|
-
* import's. Needs an integration with `vouchesAccounts`; otherwise the exchange is refused with
|
|
515
|
-
* `ACCOUNT_VOUCHING_OFF`.
|
|
516
|
-
*/
|
|
517
|
-
accounts: participantExchangeAccountsSchema.optional()
|
|
518
|
-
}).strict())();
|
|
519
|
-
var participantExchangeAccountResultSchema = /* @__PURE__ */ (() => z3.object({
|
|
520
|
-
account: memberImportVouchedAccountSchema,
|
|
521
|
-
status: z3.string(),
|
|
522
|
-
code: z3.string().optional(),
|
|
523
|
-
message: z3.string().optional()
|
|
524
|
-
}))();
|
|
525
|
-
var participantExchangeResultSchema = /* @__PURE__ */ (() => exchangeResultSchema.extend({
|
|
526
|
-
accounts: z3.array(participantExchangeAccountResultSchema).optional()
|
|
527
|
-
}))();
|
|
528
|
-
var identityIntegrationKeySchema = /* @__PURE__ */ (() => z3.object({
|
|
529
|
-
id: z3.string(),
|
|
530
|
-
name: z3.string(),
|
|
531
|
-
organization: z3.string(),
|
|
532
|
-
project: z3.string(),
|
|
533
|
-
environment: z3.string(),
|
|
534
|
-
origin: z3.string(),
|
|
535
|
-
identityKind: openIdentityKindSchema.nullable().default(null),
|
|
536
|
-
vouchesAccounts: z3.boolean().default(false),
|
|
537
|
-
secretExpiresAt: z3.number().nullable().default(null),
|
|
538
|
-
appOrigins: z3.array(z3.string()).default([])
|
|
539
|
-
}))();
|
|
540
|
-
var accountVouchedBySchema = /* @__PURE__ */ (() => z3.object({
|
|
541
|
-
/** The integration's ID; it stays after the integration is disconnected. */
|
|
542
|
-
integration: z3.string(),
|
|
543
|
-
/** The integration's name when it vouched for the account. */
|
|
544
|
-
integrationName: z3.string()
|
|
545
|
-
}))();
|
|
546
|
-
|
|
547
|
-
export {
|
|
548
|
-
credentialSecretSchema,
|
|
549
|
-
credentialSecretInputSchema,
|
|
550
|
-
memberImportIdentitySchema,
|
|
551
|
-
memberImportAccountSchema,
|
|
552
|
-
memberImportVouchedAccountSchema,
|
|
553
|
-
identityReferenceSchema,
|
|
554
|
-
memberImportActionSchema,
|
|
555
|
-
memberImportReferralSchema,
|
|
556
|
-
memberImportConsentSchema,
|
|
557
|
-
memberImportRowSchema,
|
|
558
|
-
memberImportFullRowSchema,
|
|
559
|
-
memberImportCreateSchema,
|
|
560
|
-
memberImportRowsInputSchema,
|
|
561
|
-
memberImportFullRowsInputSchema,
|
|
562
|
-
MemberImportRefusalCode,
|
|
563
|
-
memberImportRefusalSchema,
|
|
564
|
-
memberImportRowResultSchema,
|
|
565
|
-
memberImportRowPageSchema,
|
|
566
|
-
memberImportRowQuerySchema,
|
|
567
|
-
memberImportSummarySchema,
|
|
568
|
-
memberImportCommandSchema,
|
|
569
|
-
memberImportRevertInputSchema,
|
|
570
|
-
memberImportRevertOutcomeSchema,
|
|
571
|
-
memberImportRevertSchema,
|
|
572
|
-
MemberImportState,
|
|
573
|
-
memberImportSchema,
|
|
574
|
-
memberImportPageSchema,
|
|
575
|
-
memberImportListQuerySchema,
|
|
576
|
-
identityIntegrationInputSchema,
|
|
577
|
-
identityIntegrationSchema,
|
|
578
|
-
identityIntegrationSecretSchema,
|
|
579
|
-
identityKindClaimSchema,
|
|
580
|
-
identityIntegrationAccountVouchingInputSchema,
|
|
581
|
-
participantExchangeAccountsSchema,
|
|
582
|
-
participantExchangeSchema,
|
|
583
|
-
participantExchangeAccountResultSchema,
|
|
584
|
-
participantExchangeResultSchema,
|
|
585
|
-
identityIntegrationKeySchema,
|
|
586
|
-
accountVouchedBySchema
|
|
587
|
-
};
|
package/dist/chunk-N4BDKS6Y.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
identifier
|
|
3
|
-
} from "./chunk-ID3BZXFZ.js";
|
|
4
|
-
|
|
5
|
-
// src/auth.ts
|
|
6
|
-
import * as z from "zod";
|
|
7
|
-
var authScopeSchema = /* @__PURE__ */ (() => z.object({
|
|
8
|
-
organization: identifier,
|
|
9
|
-
project: identifier,
|
|
10
|
-
environment: z.enum(["test", "live"])
|
|
11
|
-
}).strict())();
|
|
12
|
-
var principalSchema = /* @__PURE__ */ (() => z.discriminatedUnion("kind", [
|
|
13
|
-
z.object({ kind: z.literal("member"), member: identifier }),
|
|
14
|
-
z.object({ kind: z.literal("staff"), subject: identifier }),
|
|
15
|
-
z.object({ kind: z.literal("operator"), subject: identifier })
|
|
16
|
-
]))();
|
|
17
|
-
var sessionSchema = /* @__PURE__ */ (() => z.object({
|
|
18
|
-
...authScopeSchema.shape,
|
|
19
|
-
id: identifier,
|
|
20
|
-
principal: principalSchema,
|
|
21
|
-
expiresAt: z.number()
|
|
22
|
-
}))();
|
|
23
|
-
var knownPrincipalKinds = /* @__PURE__ */ (() => principalSchema.options.map(
|
|
24
|
-
(option) => option.shape.kind.value
|
|
25
|
-
))();
|
|
26
|
-
var participantPrincipalSchema = /* @__PURE__ */ (() => z.union([
|
|
27
|
-
principalSchema,
|
|
28
|
-
z.object({ kind: z.string().min(1) }).refine((principal) => !knownPrincipalKinds.includes(principal.kind))
|
|
29
|
-
]))();
|
|
30
|
-
var participantSessionSchema = /* @__PURE__ */ (() => z.object({
|
|
31
|
-
...authScopeSchema.shape,
|
|
32
|
-
id: identifier,
|
|
33
|
-
principal: participantPrincipalSchema,
|
|
34
|
-
expiresAt: z.number()
|
|
35
|
-
}))();
|
|
36
|
-
function sessionMember(session) {
|
|
37
|
-
const principal = session?.principal;
|
|
38
|
-
return principal?.kind === "member" && "member" in principal ? principal.member : null;
|
|
39
|
-
}
|
|
40
|
-
var memberSummarySchema = /* @__PURE__ */ (() => z.object({
|
|
41
|
-
member: identifier,
|
|
42
|
-
avatarSeed: z.string().min(1).max(100),
|
|
43
|
-
/**
|
|
44
|
-
* The member's own email address for "signed in as": the first of `emails`, or null when they
|
|
45
|
-
* have none, such as after wallet-only sign-in. Only the member reads it. Relay always sends
|
|
46
|
-
* it; the SDK reads one older than this field as null.
|
|
47
|
-
*/
|
|
48
|
-
email: z.string().min(1).nullable().default(null),
|
|
49
|
-
/**
|
|
50
|
-
* The verified email addresses that sign the member in: each email-code sign-in address, then
|
|
51
|
-
* the verified email of each Google or Apple account enabled for sign-in. Accounts connected
|
|
52
|
-
* only for activity are left out. Empty when there are none, and read as empty from a Relay
|
|
53
|
-
* older than this field.
|
|
54
|
-
*/
|
|
55
|
-
emails: z.array(z.string().min(1)).default([]),
|
|
56
|
-
/**
|
|
57
|
-
* The member's clock, which Relay judges their activity on. `now` is their current time in epoch
|
|
58
|
-
* milliseconds and `offsetMs` how far it runs ahead of real time: a test member's clock moves
|
|
59
|
-
* when the staging toolbar or `domino test-members advance` moves it, and every other member's
|
|
60
|
-
* offset is 0. `memberTime()` keeps it ticking. Absent from a Relay older than this field;
|
|
61
|
-
* `relay.me.get()` then answers real time.
|
|
62
|
-
*/
|
|
63
|
-
clock: z.object({
|
|
64
|
-
now: z.number().int().nonnegative(),
|
|
65
|
-
offsetMs: z.number().int()
|
|
66
|
-
}).optional()
|
|
67
|
-
}))();
|
|
68
|
-
var exchangeSchema = /* @__PURE__ */ (() => authScopeSchema.extend({
|
|
69
|
-
identity: z.object({ issuer: identifier, subject: z.string().min(1).max(200) }).strict(),
|
|
70
|
-
role: z.enum(["member", "staff", "operator"])
|
|
71
|
-
}).strict())();
|
|
72
|
-
var exchangeResultSchema = /* @__PURE__ */ (() => z.object({
|
|
73
|
-
token: z.string(),
|
|
74
|
-
session: sessionSchema
|
|
75
|
-
}))();
|
|
76
|
-
|
|
77
|
-
export {
|
|
78
|
-
authScopeSchema,
|
|
79
|
-
principalSchema,
|
|
80
|
-
sessionSchema,
|
|
81
|
-
participantPrincipalSchema,
|
|
82
|
-
participantSessionSchema,
|
|
83
|
-
sessionMember,
|
|
84
|
-
memberSummarySchema,
|
|
85
|
-
exchangeSchema,
|
|
86
|
-
exchangeResultSchema
|
|
87
|
-
};
|