@colveor/admin 0.0.0-stage → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/LICENSE.md +106 -0
  2. package/TAILWINDADMIN-LICENSE +21 -0
  3. package/dist/account/data.d.ts +1 -0
  4. package/dist/account/data.js +44 -0
  5. package/dist/account/profile.d.ts +6 -0
  6. package/dist/account/profile.js +118 -0
  7. package/dist/account/sessions.d.ts +1 -0
  8. package/dist/account/sessions.js +26 -0
  9. package/dist/account/shared.d.ts +26 -0
  10. package/dist/account/shared.js +44 -0
  11. package/dist/account/two-factor.d.ts +5 -0
  12. package/dist/account/two-factor.js +60 -0
  13. package/dist/actions.d.ts +39 -0
  14. package/dist/actions.js +81 -0
  15. package/dist/api/audit.gen.d.ts +80 -0
  16. package/dist/api/audit.gen.js +43 -0
  17. package/dist/api/auth.gen.d.ts +537 -0
  18. package/dist/api/auth.gen.js +313 -0
  19. package/dist/api/errors.gen.d.ts +16 -0
  20. package/dist/api/errors.gen.js +2 -0
  21. package/dist/api/gormx.gen.d.ts +60 -0
  22. package/dist/api/gormx.gen.js +16 -0
  23. package/dist/api/health.gen.d.ts +103 -0
  24. package/dist/api/health.gen.js +23 -0
  25. package/dist/api/index.gen.d.ts +21 -0
  26. package/dist/api/index.gen.js +22 -0
  27. package/dist/api/invitations.gen.d.ts +128 -0
  28. package/dist/api/invitations.gen.js +57 -0
  29. package/dist/api/ledger.gen.d.ts +269 -0
  30. package/dist/api/ledger.gen.js +113 -0
  31. package/dist/api/msgtemplate.gen.d.ts +31 -0
  32. package/dist/api/msgtemplate.gen.js +2 -0
  33. package/dist/api/notifications.gen.d.ts +66 -0
  34. package/dist/api/notifications.gen.js +28 -0
  35. package/dist/api/outbox.gen.d.ts +8 -0
  36. package/dist/api/outbox.gen.js +2 -0
  37. package/dist/api/queue.gen.d.ts +112 -0
  38. package/dist/api/queue.gen.js +15 -0
  39. package/dist/api/rbac.gen.d.ts +406 -0
  40. package/dist/api/rbac.gen.js +191 -0
  41. package/dist/api/reauth.gen.d.ts +289 -0
  42. package/dist/api/reauth.gen.js +122 -0
  43. package/dist/api/recorded_payments.gen.d.ts +171 -0
  44. package/dist/api/recorded_payments.gen.js +79 -0
  45. package/dist/api/sessions.gen.d.ts +64 -0
  46. package/dist/api/sessions.gen.js +48 -0
  47. package/dist/api/settings.gen.d.ts +147 -0
  48. package/dist/api/settings.gen.js +69 -0
  49. package/dist/api/storage.gen.d.ts +327 -0
  50. package/dist/api/storage.gen.js +208 -0
  51. package/dist/api/support_access.gen.d.ts +155 -0
  52. package/dist/api/support_access.gen.js +131 -0
  53. package/dist/api/users.gen.d.ts +407 -0
  54. package/dist/api/users.gen.js +159 -0
  55. package/dist/api/verification.gen.d.ts +427 -0
  56. package/dist/api/verification.gen.js +280 -0
  57. package/dist/api/webhooks.gen.d.ts +110 -0
  58. package/dist/api/webhooks.gen.js +45 -0
  59. package/dist/auth-layout.d.ts +9 -0
  60. package/dist/auth-layout.js +5 -0
  61. package/dist/client.d.ts +41 -0
  62. package/dist/client.js +72 -0
  63. package/dist/config.d.ts +27 -0
  64. package/dist/config.js +82 -0
  65. package/dist/dates.d.ts +4 -0
  66. package/dist/dates.js +16 -0
  67. package/dist/header.d.ts +12 -0
  68. package/dist/header.js +105 -0
  69. package/dist/icons.d.ts +2 -0
  70. package/dist/icons.js +15 -0
  71. package/dist/index.d.ts +28 -0
  72. package/dist/index.js +42 -0
  73. package/dist/kit/avatar.d.ts +5 -0
  74. package/dist/kit/avatar.js +16 -0
  75. package/dist/kit/badge.d.ts +10 -0
  76. package/dist/kit/badge.js +31 -0
  77. package/dist/kit/card.d.ts +12 -0
  78. package/dist/kit/card.js +7 -0
  79. package/dist/kit/code-area.d.ts +15 -0
  80. package/dist/kit/code-area.js +69 -0
  81. package/dist/kit/dropdown.d.ts +26 -0
  82. package/dist/kit/dropdown.js +67 -0
  83. package/dist/kit/filter-tabs.d.ts +9 -0
  84. package/dist/kit/filter-tabs.js +7 -0
  85. package/dist/kit/modal.d.ts +8 -0
  86. package/dist/kit/modal.js +15 -0
  87. package/dist/kit/page-header.d.ts +13 -0
  88. package/dist/kit/page-header.js +13 -0
  89. package/dist/kit/search.d.ts +4 -0
  90. package/dist/kit/search.js +16 -0
  91. package/dist/kit/tooltip.d.ts +17 -0
  92. package/dist/kit/tooltip.js +52 -0
  93. package/dist/message-editor.d.ts +9 -0
  94. package/dist/message-editor.js +80 -0
  95. package/dist/money.d.ts +10 -0
  96. package/dist/money.js +17 -0
  97. package/dist/next.d.ts +6 -0
  98. package/dist/next.js +19 -0
  99. package/dist/pages/account.d.ts +1 -0
  100. package/dist/pages/account.js +47 -0
  101. package/dist/pages/audit.d.ts +1 -0
  102. package/dist/pages/audit.js +88 -0
  103. package/dist/pages/forgot-password.d.ts +1 -0
  104. package/dist/pages/forgot-password.js +73 -0
  105. package/dist/pages/ledger.d.ts +1 -0
  106. package/dist/pages/ledger.js +132 -0
  107. package/dist/pages/roles.d.ts +1 -0
  108. package/dist/pages/roles.js +102 -0
  109. package/dist/pages/settings.d.ts +1 -0
  110. package/dist/pages/settings.js +86 -0
  111. package/dist/pages/sign-in.d.ts +5 -0
  112. package/dist/pages/sign-in.js +117 -0
  113. package/dist/pages/status.d.ts +1 -0
  114. package/dist/pages/status.js +122 -0
  115. package/dist/pages/support.d.ts +1 -0
  116. package/dist/pages/support.js +90 -0
  117. package/dist/pages/teams.d.ts +1 -0
  118. package/dist/pages/teams.js +94 -0
  119. package/dist/pages/users.d.ts +1 -0
  120. package/dist/pages/users.js +158 -0
  121. package/dist/pages/webhooks.d.ts +1 -0
  122. package/dist/pages/webhooks.js +88 -0
  123. package/dist/permissions.d.ts +5 -0
  124. package/dist/permissions.js +31 -0
  125. package/dist/proof.d.ts +10 -0
  126. package/dist/proof.js +78 -0
  127. package/dist/proxy.d.ts +10 -0
  128. package/dist/proxy.js +166 -0
  129. package/dist/retry.d.ts +8 -0
  130. package/dist/retry.js +30 -0
  131. package/dist/router.d.ts +13 -0
  132. package/dist/router.js +14 -0
  133. package/dist/setting-fields.d.ts +12 -0
  134. package/dist/setting-fields.js +102 -0
  135. package/dist/setting-list.d.ts +22 -0
  136. package/dist/setting-list.js +78 -0
  137. package/dist/shell.d.ts +40 -0
  138. package/dist/shell.js +97 -0
  139. package/dist/support.d.ts +37 -0
  140. package/dist/support.js +76 -0
  141. package/dist/table.d.ts +40 -0
  142. package/dist/table.js +73 -0
  143. package/dist/ui.d.ts +39 -0
  144. package/dist/ui.js +56 -0
  145. package/dist/user-actions.d.ts +30 -0
  146. package/dist/user-actions.js +129 -0
  147. package/dist/user-roles.d.ts +4 -0
  148. package/dist/user-roles.js +51 -0
  149. package/dist/user-row-menu.d.ts +14 -0
  150. package/dist/user-row-menu.js +45 -0
  151. package/dist/version.d.ts +1 -0
  152. package/dist/version.js +3 -0
  153. package/package.json +59 -4
  154. package/README.md +0 -3
@@ -0,0 +1,427 @@
1
+ import type * as msgtemplate from "./msgtemplate.gen";
2
+ /**
3
+ * Stable error codes for verification. They keep the "auth." prefix they
4
+ * were released with when verification was part of the auth module: a code
5
+ * must not change once clients depend on it.
6
+ */
7
+ export declare const ErrCodeInvalidCode = "auth.invalid_code";
8
+ /**
9
+ * Stable error codes for verification. They keep the "auth." prefix they
10
+ * were released with when verification was part of the auth module: a code
11
+ * must not change once clients depend on it.
12
+ */
13
+ export declare const ErrCodeRateLimited = "auth.rate_limited";
14
+ /**
15
+ * Stable error codes for verification. They keep the "auth." prefix they
16
+ * were released with when verification was part of the auth module: a code
17
+ * must not change once clients depend on it.
18
+ */
19
+ export declare const ErrCodeVerificationExpired = "auth.verification_expired";
20
+ /**
21
+ * Stable error codes for verification. They keep the "auth." prefix they
22
+ * were released with when verification was part of the auth module: a code
23
+ * must not change once clients depend on it.
24
+ */
25
+ export declare const ErrCodeMaxAttemptsExceeded = "auth.max_attempts_exceeded";
26
+ /**
27
+ * Stable error codes for verification. They keep the "auth." prefix they
28
+ * were released with when verification was part of the auth module: a code
29
+ * must not change once clients depend on it.
30
+ */
31
+ export declare const ErrCodeInvalidVerificationID = "auth.invalid_verification_id";
32
+ /**
33
+ * Stable error codes for verification. They keep the "auth." prefix they
34
+ * were released with when verification was part of the auth module: a code
35
+ * must not change once clients depend on it.
36
+ */
37
+ export declare const ErrCodeVerificationMismatch = "auth.verification_mismatch";
38
+ /**
39
+ * Stable error codes for verification. They keep the "auth." prefix they
40
+ * were released with when verification was part of the auth module: a code
41
+ * must not change once clients depend on it.
42
+ */
43
+ export declare const ErrCodeMissingRecipient = "auth.missing_recipient";
44
+ /**
45
+ * Stable error codes for verification. They keep the "auth." prefix they
46
+ * were released with when verification was part of the auth module: a code
47
+ * must not change once clients depend on it.
48
+ */
49
+ export declare const ErrCodeVerificationUnavailable = "auth.verification_unavailable";
50
+ /**
51
+ * Stable error codes for verification. They keep the "auth." prefix they
52
+ * were released with when verification was part of the auth module: a code
53
+ * must not change once clients depend on it.
54
+ */
55
+ export declare const ErrCodeLinkRequiresEmail = "auth.link_requires_email";
56
+ /**
57
+ * Stable error codes for verification. They keep the "auth." prefix they
58
+ * were released with when verification was part of the auth module: a code
59
+ * must not change once clients depend on it.
60
+ */
61
+ export declare const ErrCodeLinkUnavailable = "auth.link_unavailable";
62
+ /**
63
+ * Stable error codes for verification. They keep the "auth." prefix they
64
+ * were released with when verification was part of the auth module: a code
65
+ * must not change once clients depend on it.
66
+ */
67
+ export declare const ErrCodeInvalidLink = "auth.invalid_link";
68
+ /**
69
+ * Stable error codes for verification. They keep the "auth." prefix they
70
+ * were released with when verification was part of the auth module: a code
71
+ * must not change once clients depend on it.
72
+ */
73
+ export declare const ErrCodeMaxResendsExceeded = "auth.max_resends_exceeded";
74
+ /**
75
+ * MessageTemplate is the stored value of a message setting.
76
+ */
77
+ export type MessageTemplate = msgtemplate.Template;
78
+ /**
79
+ * MessageData is what a message template can reference. Field names are
80
+ * part of the template contract: renaming one breaks stored templates.
81
+ */
82
+ export interface MessageData {
83
+ AppName: string;
84
+ Purpose: VerificationPurpose;
85
+ Channel: Channel;
86
+ Mode: DeliveryMode;
87
+ /**
88
+ * IsCode and IsLink mirror Mode, for shorter conditions. IsLink is only
89
+ * ever true for email: links are never sent by SMS.
90
+ */
91
+ IsCode: boolean;
92
+ IsLink: boolean;
93
+ /**
94
+ * Code is set in code mode, Link in link mode; the other is empty.
95
+ */
96
+ Code: string;
97
+ Link: string;
98
+ Recipient: string;
99
+ /**
100
+ * TTLMinutes is the time left until the code or link expires, measured
101
+ * at delivery and rounded up, never below 1.
102
+ */
103
+ TTLMinutes: number;
104
+ ExpiresAt: string;
105
+ /**
106
+ * Device and IP are set for notices that carry them (NoticeDetails).
107
+ */
108
+ Device: string;
109
+ IP: string;
110
+ }
111
+ /**
112
+ * Notice is an informational message that carries no code or link. Notices
113
+ * share the verification.messages.* namespace with the per-purpose messages, and
114
+ * the same template syntax and MessageData (Code, Link and Mode are empty).
115
+ */
116
+ export type Notice = string;
117
+ /**
118
+ * NoticeAccountUnavailable goes to the owner of an account that is not
119
+ * active when someone starts a verification for it (today: forgot
120
+ * password). The HTTP response is a decoy, so the requester learns
121
+ * nothing; only the inbox owner is told why no code or link arrived.
122
+ */
123
+ export declare const NoticeAccountUnavailable: Notice;
124
+ /**
125
+ * NoticeIdentityLinked tells the account owner a Google or Apple
126
+ * sign-in was connected, so a link they did not make (from a stolen
127
+ * session) does not go unnoticed.
128
+ */
129
+ export declare const NoticeIdentityLinked: Notice;
130
+ /**
131
+ * NoticeIdentifierChanged tells the account owner, at their previous
132
+ * address, that the sign-in email or phone was changed or added.
133
+ */
134
+ export declare const NoticeIdentifierChanged: Notice;
135
+ /**
136
+ * NoticeReauthLocked tells the account owner that confirming their
137
+ * identity failed too many times, so that method is locked for now.
138
+ */
139
+ export declare const NoticeReauthLocked: Notice;
140
+ /**
141
+ * NoticeSecurityChanged tells the account owner that a way of
142
+ * confirming it's them was added or changed, such as a PIN.
143
+ */
144
+ export declare const NoticeSecurityChanged: Notice;
145
+ /**
146
+ * NoticePasswordChanged tells the account owner their password was
147
+ * set, changed or reset, and that every device was signed out.
148
+ */
149
+ export declare const NoticePasswordChanged: Notice;
150
+ /**
151
+ * NoticeNewSignIn tells the account owner someone signed in from a
152
+ * device not seen before, with the device and IP (NoticeDetails).
153
+ */
154
+ export declare const NoticeNewSignIn: Notice;
155
+ /**
156
+ * NoticeRecoveryCodeUsed tells the account owner a two-factor recovery
157
+ * code was used, so its usual second factor was not.
158
+ */
159
+ export declare const NoticeRecoveryCodeUsed: Notice;
160
+ /**
161
+ * NoticeDetails are extra facts a notice can show, as {{.Device}} and
162
+ * {{.IP}}. Only NoticeNewSignIn uses them today.
163
+ */
164
+ export interface NoticeDetails {
165
+ device?: string;
166
+ ip?: string;
167
+ }
168
+ /**
169
+ * RateLimitStartIP limits starting and resending per client IP.
170
+ */
171
+ export declare const RateLimitStartIP = "verification.start_ip";
172
+ /**
173
+ * RateLimitStartRecipient limits sends to one email or phone, on top
174
+ * of the resend cooldown.
175
+ */
176
+ export declare const RateLimitStartRecipient = "verification.start_recipient";
177
+ /**
178
+ * RateLimitStartDaily caps sends across everyone per day: SMS and
179
+ * email cost money.
180
+ */
181
+ export declare const RateLimitStartDaily = "verification.start_daily";
182
+ /**
183
+ * RateLimitVerify limits verify attempts per client IP (guessing is
184
+ * also capped per challenge by max_attempts).
185
+ */
186
+ export declare const RateLimitVerify = "verification.verify";
187
+ export type VerificationService = unknown;
188
+ /**
189
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
190
+ * constants are the single source of truth for the keys; read them through
191
+ * the settings.Reader in modular.Deps. Message templates are one setting
192
+ * per purpose and per notice: see SettingMessage and SettingNotice.
193
+ */
194
+ export declare const SettingVerificationCodeTTLSeconds: string;
195
+ /**
196
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
197
+ * constants are the single source of truth for the keys; read them through
198
+ * the settings.Reader in modular.Deps. Message templates are one setting
199
+ * per purpose and per notice: see SettingMessage and SettingNotice.
200
+ */
201
+ export declare const SettingVerificationLinkTTLSeconds: string;
202
+ /**
203
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
204
+ * constants are the single source of truth for the keys; read them through
205
+ * the settings.Reader in modular.Deps. Message templates are one setting
206
+ * per purpose and per notice: see SettingMessage and SettingNotice.
207
+ */
208
+ export declare const SettingVerificationTokenTTLSeconds: string;
209
+ /**
210
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
211
+ * constants are the single source of truth for the keys; read them through
212
+ * the settings.Reader in modular.Deps. Message templates are one setting
213
+ * per purpose and per notice: see SettingMessage and SettingNotice.
214
+ */
215
+ export declare const SettingVerificationLinkURL: string;
216
+ /**
217
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
218
+ * constants are the single source of truth for the keys; read them through
219
+ * the settings.Reader in modular.Deps. Message templates are one setting
220
+ * per purpose and per notice: see SettingMessage and SettingNotice.
221
+ */
222
+ export declare const SettingVerificationMaxResends: string;
223
+ /**
224
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
225
+ * constants are the single source of truth for the keys; read them through
226
+ * the settings.Reader in modular.Deps. Message templates are one setting
227
+ * per purpose and per notice: see SettingMessage and SettingNotice.
228
+ */
229
+ export declare const SettingVerificationCodeLength: string;
230
+ /**
231
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
232
+ * constants are the single source of truth for the keys; read them through
233
+ * the settings.Reader in modular.Deps. Message templates are one setting
234
+ * per purpose and per notice: see SettingMessage and SettingNotice.
235
+ */
236
+ export declare const SettingVerificationMaxAttempts: string;
237
+ /**
238
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
239
+ * constants are the single source of truth for the keys; read them through
240
+ * the settings.Reader in modular.Deps. Message templates are one setting
241
+ * per purpose and per notice: see SettingMessage and SettingNotice.
242
+ */
243
+ export declare const SettingVerificationResendCooldownSeconds: string;
244
+ /**
245
+ * Runtime settings this module owns (section 24.5: <module>.<key>). The
246
+ * constants are the single source of truth for the keys; read them through
247
+ * the settings.Reader in modular.Deps. Message templates are one setting
248
+ * per purpose and per notice: see SettingMessage and SettingNotice.
249
+ */
250
+ export declare const SettingVerificationTestPhones: string;
251
+ /**
252
+ * Bounds for verification.code_length, shared by the setting's
253
+ * validation and the generator. The upper bound keeps the generated number
254
+ * inside int64 (10^18 < 2^63).
255
+ */
256
+ export declare const MinCodeLength = 4;
257
+ /**
258
+ * Bounds for verification.code_length, shared by the setting's
259
+ * validation and the generator. The upper bound keeps the generated number
260
+ * inside int64 (10^18 < 2^63).
261
+ */
262
+ export declare const MaxCodeLength = 18;
263
+ /**
264
+ * TestPhone is a phone number that, in development only, receives a fixed
265
+ * code instead of an SMS: there is no inbox to catch SMS locally, the way
266
+ * Mailpit catches email. Outside development the list is ignored and these
267
+ * numbers get real SMS like any other.
268
+ */
269
+ export interface TestPhone {
270
+ phone: string;
271
+ code: string;
272
+ }
273
+ export type Channel = string;
274
+ export declare const ChannelEmail: Channel;
275
+ export declare const ChannelPhone: Channel;
276
+ /**
277
+ * VerificationPurpose is why a code or link is being sent. Each purpose has its own
278
+ * message template (see messages.go) and its verification tokens are only
279
+ * accepted by the flow they were issued for.
280
+ */
281
+ export type VerificationPurpose = string;
282
+ /**
283
+ * Adding a purpose: add the constant, add it to VerificationPurposes and
284
+ * to the oneof tags on StartVerificationRequest.Purpose and
285
+ * VerifyResponseData.Purpose
286
+ * (TestPurposeTagsMatchRegistry fails until you do), and give it a default
287
+ * message in messageDefaults.
288
+ */
289
+ export declare const PurposeSignup: VerificationPurpose;
290
+ /**
291
+ * Adding a purpose: add the constant, add it to VerificationPurposes and
292
+ * to the oneof tags on StartVerificationRequest.Purpose and
293
+ * VerifyResponseData.Purpose
294
+ * (TestPurposeTagsMatchRegistry fails until you do), and give it a default
295
+ * message in messageDefaults.
296
+ */
297
+ export declare const PurposeLogin: VerificationPurpose;
298
+ /**
299
+ * Adding a purpose: add the constant, add it to VerificationPurposes and
300
+ * to the oneof tags on StartVerificationRequest.Purpose and
301
+ * VerifyResponseData.Purpose
302
+ * (TestPurposeTagsMatchRegistry fails until you do), and give it a default
303
+ * message in messageDefaults.
304
+ */
305
+ export declare const PurposeForgotPassword: VerificationPurpose;
306
+ /**
307
+ * Adding a purpose: add the constant, add it to VerificationPurposes and
308
+ * to the oneof tags on StartVerificationRequest.Purpose and
309
+ * VerifyResponseData.Purpose
310
+ * (TestPurposeTagsMatchRegistry fails until you do), and give it a default
311
+ * message in messageDefaults.
312
+ */
313
+ export declare const PurposeVerifyEmail: VerificationPurpose;
314
+ /**
315
+ * Adding a purpose: add the constant, add it to VerificationPurposes and
316
+ * to the oneof tags on StartVerificationRequest.Purpose and
317
+ * VerifyResponseData.Purpose
318
+ * (TestPurposeTagsMatchRegistry fails until you do), and give it a default
319
+ * message in messageDefaults.
320
+ */
321
+ export declare const PurposeUpdateEmail: VerificationPurpose;
322
+ /**
323
+ * Adding a purpose: add the constant, add it to VerificationPurposes and
324
+ * to the oneof tags on StartVerificationRequest.Purpose and
325
+ * VerifyResponseData.Purpose
326
+ * (TestPurposeTagsMatchRegistry fails until you do), and give it a default
327
+ * message in messageDefaults.
328
+ */
329
+ export declare const PurposeVerifyPhone: VerificationPurpose;
330
+ /**
331
+ * Adding a purpose: add the constant, add it to VerificationPurposes and
332
+ * to the oneof tags on StartVerificationRequest.Purpose and
333
+ * VerifyResponseData.Purpose
334
+ * (TestPurposeTagsMatchRegistry fails until you do), and give it a default
335
+ * message in messageDefaults.
336
+ */
337
+ export declare const PurposeUpdatePhone: VerificationPurpose;
338
+ /**
339
+ * PurposeReauth confirms a signed-in user before a sensitive action
340
+ * (the reauth module's email_code and phone_code methods).
341
+ */
342
+ export declare const PurposeReauth: VerificationPurpose;
343
+ /**
344
+ * DeliveryMode is what a message carries: a code the user types back, or
345
+ * a link that carries a verification token.
346
+ */
347
+ export type DeliveryMode = string;
348
+ export declare const DeliveryModeCode: DeliveryMode;
349
+ export declare const DeliveryModeLink: DeliveryMode;
350
+ /**
351
+ * VerifiedIdentity is what a consumed verification token proves: the caller
352
+ * received a code or link at Identifier over Channel, for Purpose.
353
+ */
354
+ export interface VerifiedIdentity {
355
+ Identifier: string;
356
+ Channel: Channel;
357
+ Purpose: VerificationPurpose;
358
+ }
359
+ export interface StartVerificationRequest {
360
+ channel: Channel;
361
+ email?: string;
362
+ phone?: string;
363
+ purpose: VerificationPurpose;
364
+ /**
365
+ * Mode is "code" (the default) or "link". Links are email-only.
366
+ */
367
+ mode: DeliveryMode;
368
+ }
369
+ /**
370
+ * VerifyRequest verifies a challenge in one of two ways:
371
+ * - code mode: verification_id (from start/resend) and the code the user typed;
372
+ * - link mode: the token from the link, alone. The link may be opened on
373
+ * another device than the one that asked for it, so no verification_id
374
+ * is needed.
375
+ */
376
+ export interface VerifyRequest {
377
+ verification_id: string;
378
+ code: string;
379
+ token: string;
380
+ }
381
+ /**
382
+ * ResendVerificationRequest is the body of POST /verifications/{id}/resend;
383
+ * the verification ID comes from the path.
384
+ */
385
+ export interface ResendVerificationRequest {
386
+ }
387
+ export interface VerificationResponseData {
388
+ verification_id: string;
389
+ mode: DeliveryMode;
390
+ channel: Channel;
391
+ /**
392
+ * Destination is the masked recipient, e.g. "j***@example.com", for
393
+ * "we sent it to ..." UI.
394
+ */
395
+ destination: string;
396
+ /**
397
+ * ExpiresAt is the code's or link's expiry as Unix milliseconds.
398
+ */
399
+ expires_at: number;
400
+ /**
401
+ * ResendIn is the resend cooldown in seconds.
402
+ */
403
+ resend_in: number;
404
+ }
405
+ export interface VerificationResponse {
406
+ message: string;
407
+ success: boolean;
408
+ data: VerificationResponseData;
409
+ }
410
+ export interface VerifyResponse {
411
+ message: string;
412
+ success: boolean;
413
+ data: VerifyResponseData;
414
+ }
415
+ export interface VerifyResponseData {
416
+ subject: string;
417
+ channel: Channel;
418
+ verification_token: string;
419
+ expires_at: number;
420
+ has_account: boolean;
421
+ /**
422
+ * Mode is how the challenge was delivered. A link-mode client uses
423
+ * Purpose to decide where to send the user next.
424
+ */
425
+ mode: DeliveryMode;
426
+ purpose: VerificationPurpose;
427
+ }