sandcms 0.6.3 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +15 -11
  2. package/dist/admin/Account.svelte +2 -0
  3. package/dist/admin/Admin.svelte +21 -6
  4. package/dist/admin/AssetAttachment.svelte +9 -6
  5. package/dist/admin/AssetAttachment.svelte.d.ts +3 -1
  6. package/dist/admin/BlueprintFields.svelte +0 -3
  7. package/dist/admin/BlueprintFields.svelte.d.ts +0 -1
  8. package/dist/admin/Editor.svelte +5 -10
  9. package/dist/admin/Fields.svelte +2 -8
  10. package/dist/admin/Fields.svelte.d.ts +0 -1
  11. package/dist/admin/Gallery.svelte +221 -80
  12. package/dist/admin/Gallery.svelte.d.ts +0 -1
  13. package/dist/admin/Inbox.svelte +3 -2
  14. package/dist/admin/LinkField.svelte +0 -3
  15. package/dist/admin/LinkField.svelte.d.ts +0 -1
  16. package/dist/admin/MediaLibrary.svelte +10 -7
  17. package/dist/admin/MediaPicker.svelte +43 -35
  18. package/dist/admin/MediaPicker.svelte.d.ts +0 -1
  19. package/dist/admin/Navigation.svelte +13 -2
  20. package/dist/admin/Pages.svelte +195 -0
  21. package/dist/admin/Pages.svelte.d.ts +7 -0
  22. package/dist/admin/Shell.svelte +27 -5
  23. package/dist/admin/SortableList.svelte +82 -61
  24. package/dist/admin/SortableList.svelte.d.ts +3 -1
  25. package/dist/admin/ThemePicker.svelte +72 -0
  26. package/dist/admin/ThemePicker.svelte.d.ts +18 -0
  27. package/dist/admin/UploadButton.svelte +2 -1
  28. package/dist/admin/UploadProgress.svelte +24 -0
  29. package/dist/admin/UploadProgress.svelte.d.ts +7 -0
  30. package/dist/admin/Users.svelte +8 -3
  31. package/dist/admin/client.d.ts +3 -670
  32. package/dist/admin/client.js +2 -1
  33. package/dist/admin/components/ui/alert/alert.svelte.d.ts +3 -13
  34. package/dist/admin/components/ui/attachment/attachment-media.svelte.d.ts +3 -13
  35. package/dist/admin/components/ui/attachment/attachment.svelte.d.ts +6 -26
  36. package/dist/admin/components/ui/badge/badge.svelte.d.ts +7 -25
  37. package/dist/admin/components/ui/button/button.svelte.d.ts +15 -53
  38. package/dist/admin/components/ui/toggle/toggle.svelte.d.ts +6 -26
  39. package/dist/admin/generated/admin.css +823 -115
  40. package/dist/admin/navigation.d.ts +9 -0
  41. package/dist/admin/navigation.js +20 -1
  42. package/dist/admin/theme-context.d.ts +7 -0
  43. package/dist/admin/theme-context.js +3 -0
  44. package/dist/admin/theme.d.ts +7 -0
  45. package/dist/admin/theme.js +14 -0
  46. package/dist/admin/types.d.ts +3 -1
  47. package/dist/admin/uploads.d.ts +8 -1
  48. package/dist/admin/uploads.js +94 -16
  49. package/dist/blueprints/files.js +1 -0
  50. package/dist/blueprints/labels.d.ts +6 -0
  51. package/dist/blueprints/labels.js +14 -0
  52. package/dist/blueprints/load.js +16 -2
  53. package/dist/blueprints/types.d.ts +4 -1
  54. package/dist/cli/admin.d.ts +39 -0
  55. package/dist/cli/admin.js +95 -0
  56. package/dist/cli/backup.js +4 -4
  57. package/dist/cli/doctor.d.ts +10 -1
  58. package/dist/cli/doctor.js +98 -33
  59. package/dist/cli/email-test.d.ts +3 -0
  60. package/dist/cli/email-test.js +20 -0
  61. package/dist/cli/files.d.ts +2 -6
  62. package/dist/cli/files.js +12 -2
  63. package/dist/cli/index.js +401 -95
  64. package/dist/cli/rebaseline.d.ts +10 -0
  65. package/dist/cli/rebaseline.js +117 -0
  66. package/dist/cli/scaffold.js +8 -8
  67. package/dist/cli/setup.js +16 -26
  68. package/dist/cli/upgrade.js +34 -7
  69. package/dist/env.d.ts +26 -2
  70. package/dist/env.js +48 -6
  71. package/dist/notification-fields.js +2 -1
  72. package/dist/server/admin-load.d.ts +85 -5
  73. package/dist/server/admin-load.js +26 -1
  74. package/dist/server/api-access.d.ts +4 -0
  75. package/dist/server/api-access.js +15 -2
  76. package/dist/server/api-keys.d.ts +96 -0
  77. package/dist/server/api-keys.js +115 -0
  78. package/dist/server/api-pagination.d.ts +3 -0
  79. package/dist/server/api.js +21 -63
  80. package/dist/server/auth.d.ts +10 -9
  81. package/dist/server/cms.d.ts +63 -21
  82. package/dist/server/cms.js +64 -7
  83. package/dist/server/db/auto-migrate.d.ts +0 -4
  84. package/dist/server/db/auto-migrate.js +12 -3
  85. package/dist/server/db/legacy.d.ts +13 -0
  86. package/dist/server/db/legacy.js +60 -0
  87. package/dist/server/db/migration-data.js +2 -34
  88. package/dist/server/db/migrations/{0000_foundation.sql → 0000_baseline.sql} +120 -4
  89. package/dist/server/db/migrations/meta/0000_snapshot.json +578 -3
  90. package/dist/server/db/migrations/meta/_journal.json +2 -58
  91. package/dist/server/db/schema.d.ts +119 -2
  92. package/dist/server/db/schema.js +23 -9
  93. package/dist/server/db/store.d.ts +25 -2
  94. package/dist/server/db/store.js +90 -26
  95. package/dist/server/forms.js +2 -1
  96. package/dist/server/hooks.js +155 -81
  97. package/dist/server/media/contracts.d.ts +115 -0
  98. package/dist/server/media/contracts.js +12 -0
  99. package/dist/server/media/deletions.d.ts +2 -1
  100. package/dist/server/media/deletions.js +3 -3
  101. package/dist/server/media/delivery.js +7 -11
  102. package/dist/server/media/processor-child.d.ts +2 -0
  103. package/dist/server/media/processor-child.js +236 -0
  104. package/dist/server/media/processor.d.ts +51 -0
  105. package/dist/server/media/processor.js +135 -0
  106. package/dist/server/media/render-math.d.ts +24 -0
  107. package/dist/server/media/render-math.js +50 -0
  108. package/dist/server/media/runner.d.ts +30 -1
  109. package/dist/server/media/runner.js +418 -165
  110. package/dist/server/media/service.d.ts +53 -11
  111. package/dist/server/media/service.js +307 -98
  112. package/dist/server/media/storage.d.ts +5 -0
  113. package/dist/server/media/storage.js +279 -0
  114. package/dist/server/media/upload-ticket.d.ts +12 -0
  115. package/dist/server/media/upload-ticket.js +35 -0
  116. package/dist/server/media/verify.d.ts +64 -0
  117. package/dist/server/media/verify.js +201 -0
  118. package/dist/server/platform/http.d.ts +27 -0
  119. package/dist/server/platform/http.js +77 -0
  120. package/dist/server/platform/index.d.ts +52 -0
  121. package/dist/server/platform/index.js +98 -0
  122. package/dist/server/platform/snapshots.d.ts +18 -0
  123. package/dist/server/platform/snapshots.js +110 -0
  124. package/dist/server/platform/volume.d.ts +20 -0
  125. package/dist/server/platform/volume.js +60 -0
  126. package/docs/acceptance.md +7 -5
  127. package/docs/api.md +56 -4
  128. package/docs/cloudflare.md +26 -152
  129. package/docs/content.md +20 -5
  130. package/docs/deployment.md +222 -57
  131. package/docs/email.md +6 -0
  132. package/docs/forms.md +2 -2
  133. package/docs/media.md +94 -21
  134. package/docs/package.md +21 -18
  135. package/docs/plans/0.7-self-hosted.md +264 -0
  136. package/docs/releases.md +37 -1
  137. package/docs/upgrades.md +72 -9
  138. package/package.json +37 -44
  139. package/templates/Dockerfile +32 -0
  140. package/templates/integration.ts +26 -5
  141. package/templates/openship.json +9 -0
  142. package/templates/railpack.json +1 -1
  143. package/templates/sandcms/blueprints/files/image.yaml +1 -1
  144. package/templates/sandcms/config.yaml +1 -1
  145. package/dist/cli/cloudflare.d.ts +0 -8
  146. package/dist/cli/cloudflare.js +0 -135
  147. package/dist/server/db/migrations/0001_independent_password_resets.sql +0 -3
  148. package/dist/server/db/migrations/0002_email_failure_reason.sql +0 -1
  149. package/dist/server/db/migrations/0003_direct_r2_uploads.sql +0 -10
  150. package/dist/server/db/migrations/0004_agent_api_keys.sql +0 -38
  151. package/dist/server/db/migrations/0005_api_retention_and_pagination.sql +0 -3
  152. package/dist/server/db/migrations/0006_durable_media_deletion.sql +0 -7
  153. package/dist/server/db/migrations/0007_content_and_job_indexes.sql +0 -2
  154. package/dist/server/db/migrations/0008_search_text_cache.sql +0 -45
  155. package/dist/server/db/migrations/meta/0001_snapshot.json +0 -1197
  156. package/dist/server/db/migrations/meta/0002_snapshot.json +0 -1204
  157. package/dist/server/db/migrations/meta/0003_snapshot.json +0 -1281
  158. package/dist/server/db/migrations/meta/0004_snapshot.json +0 -1546
  159. package/dist/server/db/migrations/meta/0005_snapshot.json +0 -1572
  160. package/dist/server/db/migrations/meta/0006_snapshot.json +0 -1627
  161. package/dist/server/db/migrations/meta/0007_snapshot.json +0 -1643
  162. package/dist/server/db/migrations/meta/0008_snapshot.json +0 -1711
  163. package/dist/worker/index.d.ts +0 -10
  164. package/dist/worker/index.js +0 -460
  165. package/dist/worker/local.d.ts +0 -5
  166. package/dist/worker/local.js +0 -57
  167. package/dist/worker/source.d.ts +0 -2
  168. package/dist/worker/source.js +0 -31
  169. package/dist/worker/uploads.d.ts +0 -22
  170. package/dist/worker/uploads.js +0 -48
  171. package/templates/sandcms/worker/index.ts +0 -1
  172. package/templates/sandcms/worker/local.ts +0 -1
  173. package/templates/sandcms/worker/wrangler.jsonc +0 -6
  174. /package/dist/{worker → server/media}/svg.d.ts +0 -0
  175. /package/dist/{worker → server/media}/svg.js +0 -0
@@ -3,675 +3,7 @@ export declare const authClient: import("better-auth/svelte").SvelteAuthClient<{
3
3
  plugins: {
4
4
  id: "two-factor";
5
5
  version: string;
6
- $InferServerPlugin: ReturnType<(<O extends import("better-auth/client/plugins").TwoFactorOptions>(options?: O) => {
7
- id: "two-factor";
8
- version: string;
9
- endpoints: {
10
- enableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/enable", {
11
- method: "POST";
12
- body: import("zod").ZodObject<{
13
- password: import("zod").ZodOptional<import("zod").ZodString>;
14
- method: import("zod").ZodDefault<import("zod").ZodEnum<{
15
- otp: "otp";
16
- totp: "totp";
17
- }>>;
18
- issuer: import("zod").ZodOptional<import("zod").ZodString>;
19
- }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
20
- password: import("zod").ZodString;
21
- method: import("zod").ZodDefault<import("zod").ZodEnum<{
22
- otp: "otp";
23
- totp: "totp";
24
- }>>;
25
- issuer: import("zod").ZodOptional<import("zod").ZodString>;
26
- }, import("zod/v4/core").$strip>;
27
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
28
- session: {
29
- session: Record<string, any> & {
30
- id: string;
31
- createdAt: Date;
32
- updatedAt: Date;
33
- userId: string;
34
- expiresAt: Date;
35
- token: string;
36
- ipAddress?: string | null | undefined;
37
- userAgent?: string | null | undefined;
38
- };
39
- user: Record<string, any> & {
40
- id: string;
41
- createdAt: Date;
42
- updatedAt: Date;
43
- email: string;
44
- emailVerified: boolean;
45
- name: string;
46
- image?: string | null | undefined;
47
- };
48
- };
49
- }>>[];
50
- metadata: {
51
- openapi: {
52
- summary: string;
53
- description: string;
54
- responses: {
55
- 200: {
56
- description: string;
57
- content: {
58
- "application/json": {
59
- schema: {
60
- type: "object";
61
- properties: {
62
- method: {
63
- type: string;
64
- enum: string[];
65
- description: string;
66
- };
67
- totpURI: {
68
- type: string;
69
- description: string;
70
- };
71
- backupCodes: {
72
- type: string;
73
- items: {
74
- type: string;
75
- };
76
- description: string;
77
- };
78
- };
79
- required: string[];
80
- };
81
- };
82
- };
83
- };
84
- };
85
- };
86
- };
87
- }, {
88
- method: "otp";
89
- } | {
90
- method: "totp";
91
- totpURI: string;
92
- backupCodes: string[];
93
- }>;
94
- disableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/disable", {
95
- method: "POST";
96
- body: import("zod").ZodObject<{
97
- password: import("zod").ZodOptional<import("zod").ZodString>;
98
- }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
99
- password: import("zod").ZodString;
100
- }, import("zod/v4/core").$strip>;
101
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
102
- session: {
103
- session: Record<string, any> & {
104
- id: string;
105
- createdAt: Date;
106
- updatedAt: Date;
107
- userId: string;
108
- expiresAt: Date;
109
- token: string;
110
- ipAddress?: string | null | undefined;
111
- userAgent?: string | null | undefined;
112
- };
113
- user: Record<string, any> & {
114
- id: string;
115
- createdAt: Date;
116
- updatedAt: Date;
117
- email: string;
118
- emailVerified: boolean;
119
- name: string;
120
- image?: string | null | undefined;
121
- };
122
- };
123
- }>>[];
124
- metadata: {
125
- openapi: {
126
- summary: string;
127
- description: string;
128
- responses: {
129
- 200: {
130
- description: string;
131
- content: {
132
- "application/json": {
133
- schema: {
134
- type: "object";
135
- properties: {
136
- status: {
137
- type: string;
138
- };
139
- };
140
- };
141
- };
142
- };
143
- };
144
- };
145
- };
146
- };
147
- }, {
148
- status: boolean;
149
- }>;
150
- verifyBackupCode: import("better-auth").StrictEndpoint<"/two-factor/verify-backup-code", {
151
- method: "POST";
152
- body: import("zod").ZodObject<{
153
- code: import("zod").ZodString;
154
- disableSession: import("zod").ZodOptional<import("zod").ZodBoolean>;
155
- trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
156
- }, import("zod/v4/core").$strip>;
157
- metadata: {
158
- openapi: {
159
- description: string;
160
- responses: {
161
- "200": {
162
- description: string;
163
- content: {
164
- "application/json": {
165
- schema: {
166
- type: "object";
167
- properties: {
168
- user: {
169
- type: string;
170
- properties: {
171
- id: {
172
- type: string;
173
- description: string;
174
- };
175
- email: {
176
- type: string;
177
- format: string;
178
- nullable: boolean;
179
- description: string;
180
- };
181
- emailVerified: {
182
- type: string;
183
- nullable: boolean;
184
- description: string;
185
- };
186
- name: {
187
- type: string;
188
- nullable: boolean;
189
- description: string;
190
- };
191
- image: {
192
- type: string;
193
- format: string;
194
- nullable: boolean;
195
- description: string;
196
- };
197
- twoFactorEnabled: {
198
- type: string;
199
- description: string;
200
- };
201
- createdAt: {
202
- type: string;
203
- format: string;
204
- description: string;
205
- };
206
- updatedAt: {
207
- type: string;
208
- format: string;
209
- description: string;
210
- };
211
- };
212
- required: string[];
213
- description: string;
214
- };
215
- session: {
216
- type: string;
217
- properties: {
218
- token: {
219
- type: string;
220
- description: string;
221
- };
222
- userId: {
223
- type: string;
224
- description: string;
225
- };
226
- createdAt: {
227
- type: string;
228
- format: string;
229
- description: string;
230
- };
231
- expiresAt: {
232
- type: string;
233
- format: string;
234
- description: string;
235
- };
236
- };
237
- required: string[];
238
- description: string;
239
- };
240
- };
241
- required: string[];
242
- };
243
- };
244
- };
245
- };
246
- };
247
- };
248
- };
249
- }, {
250
- token: string | undefined;
251
- user: (Record<string, any> & {
252
- id: string;
253
- createdAt: Date;
254
- updatedAt: Date;
255
- email: string;
256
- emailVerified: boolean;
257
- name: string;
258
- image?: string | null | undefined;
259
- }) | import("better-auth/client/plugins").UserWithTwoFactor;
260
- }>;
261
- generateBackupCodes: import("better-auth").StrictEndpoint<"/two-factor/generate-backup-codes", {
262
- method: "POST";
263
- body: import("zod").ZodObject<{
264
- password: import("zod").ZodOptional<import("zod").ZodString>;
265
- }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
266
- password: import("zod").ZodString;
267
- }, import("zod/v4/core").$strip>;
268
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
269
- session: {
270
- session: Record<string, any> & {
271
- id: string;
272
- createdAt: Date;
273
- updatedAt: Date;
274
- userId: string;
275
- expiresAt: Date;
276
- token: string;
277
- ipAddress?: string | null | undefined;
278
- userAgent?: string | null | undefined;
279
- };
280
- user: Record<string, any> & {
281
- id: string;
282
- createdAt: Date;
283
- updatedAt: Date;
284
- email: string;
285
- emailVerified: boolean;
286
- name: string;
287
- image?: string | null | undefined;
288
- };
289
- };
290
- }>>[];
291
- metadata: {
292
- openapi: {
293
- description: string;
294
- responses: {
295
- "200": {
296
- description: string;
297
- content: {
298
- "application/json": {
299
- schema: {
300
- type: "object";
301
- properties: {
302
- status: {
303
- type: string;
304
- description: string;
305
- enum: boolean[];
306
- };
307
- backupCodes: {
308
- type: string;
309
- items: {
310
- type: string;
311
- };
312
- description: string;
313
- };
314
- };
315
- required: string[];
316
- };
317
- };
318
- };
319
- };
320
- };
321
- };
322
- };
323
- }, {
324
- status: boolean;
325
- backupCodes: string[];
326
- }>;
327
- viewBackupCodes: import("better-auth").StrictEndpoint<string, {
328
- method: "POST";
329
- body: import("zod").ZodObject<{
330
- userId: import("zod").ZodCoercedString<unknown>;
331
- }, import("zod/v4/core").$strip>;
332
- }, {
333
- status: boolean;
334
- backupCodes: string[];
335
- }>;
336
- sendTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/send-otp", {
337
- method: "POST";
338
- body: import("zod").ZodOptional<import("zod").ZodObject<{
339
- trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
340
- }, import("zod/v4/core").$strip>>;
341
- metadata: {
342
- openapi: {
343
- summary: string;
344
- description: string;
345
- responses: {
346
- 200: {
347
- description: string;
348
- content: {
349
- "application/json": {
350
- schema: {
351
- type: "object";
352
- properties: {
353
- status: {
354
- type: string;
355
- };
356
- };
357
- };
358
- };
359
- };
360
- };
361
- };
362
- };
363
- };
364
- }, {
365
- status: boolean;
366
- }>;
367
- verifyTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-otp", {
368
- method: "POST";
369
- body: import("zod").ZodObject<{
370
- code: import("zod").ZodString;
371
- trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
372
- }, import("zod/v4/core").$strip>;
373
- metadata: {
374
- openapi: {
375
- summary: string;
376
- description: string;
377
- responses: {
378
- "200": {
379
- description: string;
380
- content: {
381
- "application/json": {
382
- schema: {
383
- type: "object";
384
- properties: {
385
- token: {
386
- type: string;
387
- description: string;
388
- };
389
- user: {
390
- type: string;
391
- properties: {
392
- id: {
393
- type: string;
394
- description: string;
395
- };
396
- email: {
397
- type: string;
398
- format: string;
399
- nullable: boolean;
400
- description: string;
401
- };
402
- emailVerified: {
403
- type: string;
404
- nullable: boolean;
405
- description: string;
406
- };
407
- name: {
408
- type: string;
409
- nullable: boolean;
410
- description: string;
411
- };
412
- image: {
413
- type: string;
414
- format: string;
415
- nullable: boolean;
416
- description: string;
417
- };
418
- createdAt: {
419
- type: string;
420
- format: string;
421
- description: string;
422
- };
423
- updatedAt: {
424
- type: string;
425
- format: string;
426
- description: string;
427
- };
428
- };
429
- required: string[];
430
- description: string;
431
- };
432
- };
433
- required: string[];
434
- };
435
- };
436
- };
437
- };
438
- };
439
- };
440
- };
441
- }, {
442
- token: string;
443
- user: import("better-auth/client/plugins").UserWithTwoFactor;
444
- } | {
445
- token: string;
446
- user: Record<string, any> & {
447
- id: string;
448
- createdAt: Date;
449
- updatedAt: Date;
450
- email: string;
451
- emailVerified: boolean;
452
- name: string;
453
- image?: string | null | undefined;
454
- };
455
- }>;
456
- generateTOTP: import("better-auth").StrictEndpoint<string, {
457
- method: "POST";
458
- body: import("zod").ZodObject<{
459
- secret: import("zod").ZodString;
460
- }, import("zod/v4/core").$strip>;
461
- metadata: {
462
- openapi: {
463
- summary: string;
464
- description: string;
465
- responses: {
466
- 200: {
467
- description: string;
468
- content: {
469
- "application/json": {
470
- schema: {
471
- type: "object";
472
- properties: {
473
- code: {
474
- type: string;
475
- };
476
- };
477
- };
478
- };
479
- };
480
- };
481
- };
482
- };
483
- };
484
- }, {
485
- code: string;
486
- }>;
487
- getTOTPURI: import("better-auth").StrictEndpoint<"/two-factor/get-totp-uri", {
488
- method: "POST";
489
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
490
- session: {
491
- session: Record<string, any> & {
492
- id: string;
493
- createdAt: Date;
494
- updatedAt: Date;
495
- userId: string;
496
- expiresAt: Date;
497
- token: string;
498
- ipAddress?: string | null | undefined;
499
- userAgent?: string | null | undefined;
500
- };
501
- user: Record<string, any> & {
502
- id: string;
503
- createdAt: Date;
504
- updatedAt: Date;
505
- email: string;
506
- emailVerified: boolean;
507
- name: string;
508
- image?: string | null | undefined;
509
- };
510
- };
511
- }>>[];
512
- body: import("zod").ZodObject<{
513
- password: import("zod").ZodOptional<import("zod").ZodString>;
514
- }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
515
- password: import("zod").ZodString;
516
- }, import("zod/v4/core").$strip>;
517
- metadata: {
518
- openapi: {
519
- summary: string;
520
- description: string;
521
- responses: {
522
- 200: {
523
- description: string;
524
- content: {
525
- "application/json": {
526
- schema: {
527
- type: "object";
528
- properties: {
529
- totpURI: {
530
- type: string;
531
- };
532
- };
533
- };
534
- };
535
- };
536
- };
537
- };
538
- };
539
- };
540
- }, {
541
- totpURI: string;
542
- }>;
543
- verifyTOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-totp", {
544
- method: "POST";
545
- body: import("zod").ZodObject<{
546
- code: import("zod").ZodString;
547
- trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
548
- }, import("zod/v4/core").$strip>;
549
- metadata: {
550
- openapi: {
551
- summary: string;
552
- description: string;
553
- responses: {
554
- 200: {
555
- description: string;
556
- content: {
557
- "application/json": {
558
- schema: {
559
- type: "object";
560
- properties: {
561
- status: {
562
- type: string;
563
- };
564
- };
565
- };
566
- };
567
- };
568
- };
569
- };
570
- };
571
- };
572
- }, {
573
- token: string;
574
- user: import("better-auth/client/plugins").UserWithTwoFactor;
575
- } | {
576
- token: string;
577
- user: Record<string, any> & {
578
- id: string;
579
- createdAt: Date;
580
- updatedAt: Date;
581
- email: string;
582
- emailVerified: boolean;
583
- name: string;
584
- image?: string | null | undefined;
585
- };
586
- }>;
587
- };
588
- options: NoInfer<O>;
589
- hooks: {
590
- after: {
591
- matcher(context: import("better-auth").HookEndpointContext): boolean;
592
- handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
593
- twoFactorRedirect: boolean;
594
- twoFactorMethods: string[];
595
- } | undefined>>;
596
- }[];
597
- };
598
- schema: {
599
- user: {
600
- fields: {
601
- twoFactorEnabled: {
602
- type: "boolean";
603
- required: false;
604
- defaultValue: false;
605
- input: false;
606
- };
607
- };
608
- };
609
- twoFactor: {
610
- fields: {
611
- secret: {
612
- type: "string";
613
- required: true;
614
- returned: false;
615
- index: true;
616
- };
617
- backupCodes: {
618
- type: "string";
619
- required: true;
620
- returned: false;
621
- };
622
- userId: {
623
- type: "string";
624
- required: true;
625
- returned: false;
626
- references: {
627
- model: string;
628
- field: string;
629
- };
630
- index: true;
631
- };
632
- verified: {
633
- type: "boolean";
634
- required: false;
635
- defaultValue: true;
636
- input: false;
637
- };
638
- failedVerificationCount: {
639
- type: "number";
640
- required: false;
641
- defaultValue: number;
642
- input: false;
643
- returned: false;
644
- };
645
- lockedUntil: {
646
- type: "date";
647
- required: false;
648
- input: false;
649
- returned: false;
650
- };
651
- };
652
- };
653
- };
654
- rateLimit: {
655
- pathMatcher(path: string): boolean;
656
- window: number;
657
- max: number;
658
- }[];
659
- $ERROR_CODES: {
660
- OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
661
- OTP_NOT_CONFIGURED: import("better-auth").RawError<"OTP_NOT_CONFIGURED">;
662
- OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
663
- TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
664
- TOTP_ALREADY_ENABLED: import("better-auth").RawError<"TOTP_ALREADY_ENABLED">;
665
- TOTP_NOT_CONFIGURED: import("better-auth").RawError<"TOTP_NOT_CONFIGURED">;
666
- TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
667
- BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
668
- INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
669
- INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
670
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
671
- ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
672
- INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
673
- };
674
- })>;
6
+ $InferServerPlugin: ReturnType<typeof import("better-auth/plugins").twoFactor>;
675
7
  atomListeners: {
676
8
  matcher: (path: string) => boolean;
677
9
  signal: "$sessionSignal";
@@ -718,5 +50,6 @@ export declare function api<T = unknown>(path: string, body: unknown): Promise<T
718
50
  /** Copy text, falling back to a hidden textarea when the Clipboard API is unavailable. */
719
51
  export declare function copyText(value: string): Promise<void>;
720
52
  export declare const message: (e: unknown) => string;
721
- export declare function assetUrl(asset: import('./types.js').Asset, _workerUrl: string): string;
53
+ export declare function assetUrl(asset: import('./types.js').Asset): string;
54
+ export declare const megabytes: (bytes: number) => string;
722
55
  export declare const date: (timestamp: number) => string;