@astrojs/db 0.3.5 → 0.4.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 (61) hide show
  1. package/dist/core/cli/commands/link/index.js +7 -3
  2. package/dist/core/cli/commands/push/index.js +3 -3
  3. package/dist/core/cli/migration-queries.d.ts +4 -4
  4. package/dist/core/cli/migration-queries.js +73 -73
  5. package/dist/core/cli/migrations.js +15 -7
  6. package/dist/core/errors.js +7 -3
  7. package/dist/core/integration/file-url.js +2 -1
  8. package/dist/core/integration/index.js +106 -57
  9. package/dist/core/integration/typegen.d.ts +3 -3
  10. package/dist/core/integration/typegen.js +8 -8
  11. package/dist/core/integration/vite-plugin-db.d.ts +14 -9
  12. package/dist/core/integration/vite-plugin-db.js +15 -12
  13. package/dist/core/integration/vite-plugin-inject-env-ts.d.ts +4 -2
  14. package/dist/core/integration/vite-plugin-inject-env-ts.js +8 -4
  15. package/dist/core/queries.d.ts +12 -12
  16. package/dist/core/queries.js +49 -46
  17. package/dist/core/types.d.ts +232 -231
  18. package/dist/core/types.js +56 -55
  19. package/dist/core/utils.js +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +4 -4
  22. package/dist/runtime/db-client.d.ts +9 -4
  23. package/dist/runtime/db-client.js +11 -7
  24. package/dist/runtime/index.d.ts +7 -7
  25. package/dist/runtime/index.js +27 -29
  26. package/dist/runtime/types.d.ts +7 -7
  27. package/package.json +3 -5
  28. package/components/Renderer.astro +0 -14
  29. package/components/astro-env.d.ts +0 -1
  30. package/components/index.ts +0 -2
  31. package/components/tsconfig.json +0 -7
  32. package/dist/cli/commands/push/index.d.ts +0 -6
  33. package/dist/cli/commands/shell/index.d.ts +0 -6
  34. package/dist/cli/commands/sync/index.d.ts +0 -6
  35. package/dist/cli/commands/verify/index.d.ts +0 -6
  36. package/dist/cli/index.d.ts +0 -6
  37. package/dist/cli/queries.d.ts +0 -18
  38. package/dist/cli/seed.d.ts +0 -6
  39. package/dist/cli/sync/admin.d.ts +0 -33
  40. package/dist/cli/sync/index.d.ts +0 -1
  41. package/dist/cli/sync/migrate.d.ts +0 -1
  42. package/dist/cli/sync/queries.d.ts +0 -19
  43. package/dist/cli/sync/remote-db.d.ts +0 -1
  44. package/dist/config.d.ts +0 -1374
  45. package/dist/consts.d.ts +0 -7
  46. package/dist/core/cli/commands/sync/index.d.ts +0 -6
  47. package/dist/error-map.d.ts +0 -6
  48. package/dist/errors.d.ts +0 -3
  49. package/dist/file-url-integration.d.ts +0 -2
  50. package/dist/integration.d.ts +0 -2
  51. package/dist/internal-drizzle.d.ts +0 -1
  52. package/dist/internal.d.ts +0 -47
  53. package/dist/load-astro-config.d.ts +0 -6
  54. package/dist/migrations.d.ts +0 -12
  55. package/dist/root.d.ts +0 -3
  56. package/dist/typegen.d.ts +0 -5
  57. package/dist/types.d.ts +0 -1604
  58. package/dist/utils-runtime.d.ts +0 -1
  59. package/dist/utils.d.ts +0 -59
  60. package/dist/vite-plugin-db.d.ts +0 -19
  61. package/dist/vite-plugin-inject-env-ts.d.ts +0 -9
package/dist/config.d.ts DELETED
@@ -1,1374 +0,0 @@
1
- import type { SQLiteInsertValue } from 'drizzle-orm/sqlite-core';
2
- import type { SqliteDB, Table } from './internal.js';
3
- import type { MaybeArray, collectionSchema } from './types.js';
4
- import { type BooleanColumn, type DBColumnInput, type DateColumnInput, type JsonColumn, type NumberColumn, type TextColumn, type indexSchema, type MaybePromise } from './types.js';
5
- import { z } from 'zod';
6
- export type DBDataContext = {
7
- db: SqliteDB;
8
- seed<TColumns extends ColumnsConfig>(collection: ResolvedCollectionConfig<TColumns>, data: MaybeArray<SQLiteInsertValue<Table<string,
9
- /** TODO: true type inference */ Record<Extract<keyof TColumns, string>, ColumnsConfig[number]>>>>): Promise<any> /** TODO: type output */;
10
- mode: 'dev' | 'build';
11
- };
12
- export declare const dbConfigSchema: z.ZodObject<{
13
- studio: z.ZodOptional<z.ZodBoolean>;
14
- collections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
15
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
16
- label: z.ZodOptional<z.ZodString>;
17
- optional: z.ZodOptional<z.ZodBoolean>;
18
- unique: z.ZodOptional<z.ZodBoolean>;
19
- type: z.ZodLiteral<"boolean">;
20
- default: z.ZodOptional<z.ZodBoolean>;
21
- }, "strip", z.ZodTypeAny, {
22
- type: "boolean";
23
- label?: string | undefined;
24
- optional?: boolean | undefined;
25
- unique?: boolean | undefined;
26
- default?: boolean | undefined;
27
- }, {
28
- type: "boolean";
29
- label?: string | undefined;
30
- optional?: boolean | undefined;
31
- unique?: boolean | undefined;
32
- default?: boolean | undefined;
33
- }>, z.ZodObject<{
34
- label: z.ZodOptional<z.ZodString>;
35
- optional: z.ZodOptional<z.ZodBoolean>;
36
- unique: z.ZodOptional<z.ZodBoolean>;
37
- type: z.ZodLiteral<"number">;
38
- default: z.ZodOptional<z.ZodNumber>;
39
- primaryKey: z.ZodOptional<z.ZodBoolean>;
40
- }, "strip", z.ZodTypeAny, {
41
- type: "number";
42
- label?: string | undefined;
43
- optional?: boolean | undefined;
44
- unique?: boolean | undefined;
45
- default?: number | undefined;
46
- primaryKey?: boolean | undefined;
47
- }, {
48
- type: "number";
49
- label?: string | undefined;
50
- optional?: boolean | undefined;
51
- unique?: boolean | undefined;
52
- default?: number | undefined;
53
- primaryKey?: boolean | undefined;
54
- }>, z.ZodObject<{
55
- label: z.ZodOptional<z.ZodString>;
56
- optional: z.ZodOptional<z.ZodBoolean>;
57
- unique: z.ZodOptional<z.ZodBoolean>;
58
- type: z.ZodLiteral<"text">;
59
- multiline: z.ZodOptional<z.ZodBoolean>;
60
- default: z.ZodOptional<z.ZodString>;
61
- primaryKey: z.ZodOptional<z.ZodBoolean>;
62
- }, "strip", z.ZodTypeAny, {
63
- type: "text";
64
- label?: string | undefined;
65
- optional?: boolean | undefined;
66
- unique?: boolean | undefined;
67
- multiline?: boolean | undefined;
68
- default?: string | undefined;
69
- primaryKey?: boolean | undefined;
70
- }, {
71
- type: "text";
72
- label?: string | undefined;
73
- optional?: boolean | undefined;
74
- unique?: boolean | undefined;
75
- multiline?: boolean | undefined;
76
- default?: string | undefined;
77
- primaryKey?: boolean | undefined;
78
- }>, z.ZodObject<{
79
- label: z.ZodOptional<z.ZodString>;
80
- optional: z.ZodOptional<z.ZodBoolean>;
81
- unique: z.ZodOptional<z.ZodBoolean>;
82
- type: z.ZodLiteral<"date">;
83
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
84
- }, "strip", z.ZodTypeAny, {
85
- type: "date";
86
- label?: string | undefined;
87
- optional?: boolean | undefined;
88
- unique?: boolean | undefined;
89
- default?: string | undefined;
90
- }, {
91
- type: "date";
92
- label?: string | undefined;
93
- optional?: boolean | undefined;
94
- unique?: boolean | undefined;
95
- default?: Date | "now" | undefined;
96
- }>, z.ZodObject<{
97
- label: z.ZodOptional<z.ZodString>;
98
- optional: z.ZodOptional<z.ZodBoolean>;
99
- unique: z.ZodOptional<z.ZodBoolean>;
100
- type: z.ZodLiteral<"json">;
101
- default: z.ZodOptional<z.ZodUnknown>;
102
- }, "strip", z.ZodTypeAny, {
103
- type: "json";
104
- label?: string | undefined;
105
- optional?: boolean | undefined;
106
- unique?: boolean | undefined;
107
- default?: unknown;
108
- }, {
109
- type: "json";
110
- label?: string | undefined;
111
- optional?: boolean | undefined;
112
- unique?: boolean | undefined;
113
- default?: unknown;
114
- }>]>>;
115
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
116
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
117
- unique: z.ZodOptional<z.ZodBoolean>;
118
- }, "strip", z.ZodTypeAny, {
119
- on: (string | string[]) & (string | string[] | undefined);
120
- unique?: boolean | undefined;
121
- }, {
122
- on: (string | string[]) & (string | string[] | undefined);
123
- unique?: boolean | undefined;
124
- }>>>;
125
- table: z.ZodAny;
126
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
127
- writable: z.ZodLiteral<false>;
128
- }, "strip", z.ZodTypeAny, {
129
- columns: Record<string, {
130
- type: "boolean";
131
- label?: string | undefined;
132
- optional?: boolean | undefined;
133
- unique?: boolean | undefined;
134
- default?: boolean | undefined;
135
- } | {
136
- type: "number";
137
- label?: string | undefined;
138
- optional?: boolean | undefined;
139
- unique?: boolean | undefined;
140
- default?: number | undefined;
141
- primaryKey?: boolean | undefined;
142
- } | {
143
- type: "text";
144
- label?: string | undefined;
145
- optional?: boolean | undefined;
146
- unique?: boolean | undefined;
147
- multiline?: boolean | undefined;
148
- default?: string | undefined;
149
- primaryKey?: boolean | undefined;
150
- } | {
151
- type: "date";
152
- label?: string | undefined;
153
- optional?: boolean | undefined;
154
- unique?: boolean | undefined;
155
- default?: string | undefined;
156
- } | {
157
- type: "json";
158
- label?: string | undefined;
159
- optional?: boolean | undefined;
160
- unique?: boolean | undefined;
161
- default?: unknown;
162
- }>;
163
- writable: false;
164
- indexes?: Record<string, {
165
- on: (string | string[]) & (string | string[] | undefined);
166
- unique?: boolean | undefined;
167
- }> | undefined;
168
- table?: any;
169
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
170
- }, {
171
- columns: Record<string, {
172
- type: "boolean";
173
- label?: string | undefined;
174
- optional?: boolean | undefined;
175
- unique?: boolean | undefined;
176
- default?: boolean | undefined;
177
- } | {
178
- type: "number";
179
- label?: string | undefined;
180
- optional?: boolean | undefined;
181
- unique?: boolean | undefined;
182
- default?: number | undefined;
183
- primaryKey?: boolean | undefined;
184
- } | {
185
- type: "text";
186
- label?: string | undefined;
187
- optional?: boolean | undefined;
188
- unique?: boolean | undefined;
189
- multiline?: boolean | undefined;
190
- default?: string | undefined;
191
- primaryKey?: boolean | undefined;
192
- } | {
193
- type: "date";
194
- label?: string | undefined;
195
- optional?: boolean | undefined;
196
- unique?: boolean | undefined;
197
- default?: Date | "now" | undefined;
198
- } | {
199
- type: "json";
200
- label?: string | undefined;
201
- optional?: boolean | undefined;
202
- unique?: boolean | undefined;
203
- default?: unknown;
204
- }>;
205
- writable: false;
206
- indexes?: Record<string, {
207
- on: (string | string[]) & (string | string[] | undefined);
208
- unique?: boolean | undefined;
209
- }> | undefined;
210
- table?: any;
211
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
212
- }>, z.ZodObject<{
213
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
214
- label: z.ZodOptional<z.ZodString>;
215
- optional: z.ZodOptional<z.ZodBoolean>;
216
- unique: z.ZodOptional<z.ZodBoolean>;
217
- type: z.ZodLiteral<"boolean">;
218
- default: z.ZodOptional<z.ZodBoolean>;
219
- }, "strip", z.ZodTypeAny, {
220
- type: "boolean";
221
- label?: string | undefined;
222
- optional?: boolean | undefined;
223
- unique?: boolean | undefined;
224
- default?: boolean | undefined;
225
- }, {
226
- type: "boolean";
227
- label?: string | undefined;
228
- optional?: boolean | undefined;
229
- unique?: boolean | undefined;
230
- default?: boolean | undefined;
231
- }>, z.ZodObject<{
232
- label: z.ZodOptional<z.ZodString>;
233
- optional: z.ZodOptional<z.ZodBoolean>;
234
- unique: z.ZodOptional<z.ZodBoolean>;
235
- type: z.ZodLiteral<"number">;
236
- default: z.ZodOptional<z.ZodNumber>;
237
- primaryKey: z.ZodOptional<z.ZodBoolean>;
238
- }, "strip", z.ZodTypeAny, {
239
- type: "number";
240
- label?: string | undefined;
241
- optional?: boolean | undefined;
242
- unique?: boolean | undefined;
243
- default?: number | undefined;
244
- primaryKey?: boolean | undefined;
245
- }, {
246
- type: "number";
247
- label?: string | undefined;
248
- optional?: boolean | undefined;
249
- unique?: boolean | undefined;
250
- default?: number | undefined;
251
- primaryKey?: boolean | undefined;
252
- }>, z.ZodObject<{
253
- label: z.ZodOptional<z.ZodString>;
254
- optional: z.ZodOptional<z.ZodBoolean>;
255
- unique: z.ZodOptional<z.ZodBoolean>;
256
- type: z.ZodLiteral<"text">;
257
- multiline: z.ZodOptional<z.ZodBoolean>;
258
- default: z.ZodOptional<z.ZodString>;
259
- primaryKey: z.ZodOptional<z.ZodBoolean>;
260
- }, "strip", z.ZodTypeAny, {
261
- type: "text";
262
- label?: string | undefined;
263
- optional?: boolean | undefined;
264
- unique?: boolean | undefined;
265
- multiline?: boolean | undefined;
266
- default?: string | undefined;
267
- primaryKey?: boolean | undefined;
268
- }, {
269
- type: "text";
270
- label?: string | undefined;
271
- optional?: boolean | undefined;
272
- unique?: boolean | undefined;
273
- multiline?: boolean | undefined;
274
- default?: string | undefined;
275
- primaryKey?: boolean | undefined;
276
- }>, z.ZodObject<{
277
- label: z.ZodOptional<z.ZodString>;
278
- optional: z.ZodOptional<z.ZodBoolean>;
279
- unique: z.ZodOptional<z.ZodBoolean>;
280
- type: z.ZodLiteral<"date">;
281
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
282
- }, "strip", z.ZodTypeAny, {
283
- type: "date";
284
- label?: string | undefined;
285
- optional?: boolean | undefined;
286
- unique?: boolean | undefined;
287
- default?: string | undefined;
288
- }, {
289
- type: "date";
290
- label?: string | undefined;
291
- optional?: boolean | undefined;
292
- unique?: boolean | undefined;
293
- default?: Date | "now" | undefined;
294
- }>, z.ZodObject<{
295
- label: z.ZodOptional<z.ZodString>;
296
- optional: z.ZodOptional<z.ZodBoolean>;
297
- unique: z.ZodOptional<z.ZodBoolean>;
298
- type: z.ZodLiteral<"json">;
299
- default: z.ZodOptional<z.ZodUnknown>;
300
- }, "strip", z.ZodTypeAny, {
301
- type: "json";
302
- label?: string | undefined;
303
- optional?: boolean | undefined;
304
- unique?: boolean | undefined;
305
- default?: unknown;
306
- }, {
307
- type: "json";
308
- label?: string | undefined;
309
- optional?: boolean | undefined;
310
- unique?: boolean | undefined;
311
- default?: unknown;
312
- }>]>>;
313
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
314
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
315
- unique: z.ZodOptional<z.ZodBoolean>;
316
- }, "strip", z.ZodTypeAny, {
317
- on: (string | string[]) & (string | string[] | undefined);
318
- unique?: boolean | undefined;
319
- }, {
320
- on: (string | string[]) & (string | string[] | undefined);
321
- unique?: boolean | undefined;
322
- }>>>;
323
- table: z.ZodAny;
324
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
325
- writable: z.ZodLiteral<true>;
326
- }, "strip", z.ZodTypeAny, {
327
- columns: Record<string, {
328
- type: "boolean";
329
- label?: string | undefined;
330
- optional?: boolean | undefined;
331
- unique?: boolean | undefined;
332
- default?: boolean | undefined;
333
- } | {
334
- type: "number";
335
- label?: string | undefined;
336
- optional?: boolean | undefined;
337
- unique?: boolean | undefined;
338
- default?: number | undefined;
339
- primaryKey?: boolean | undefined;
340
- } | {
341
- type: "text";
342
- label?: string | undefined;
343
- optional?: boolean | undefined;
344
- unique?: boolean | undefined;
345
- multiline?: boolean | undefined;
346
- default?: string | undefined;
347
- primaryKey?: boolean | undefined;
348
- } | {
349
- type: "date";
350
- label?: string | undefined;
351
- optional?: boolean | undefined;
352
- unique?: boolean | undefined;
353
- default?: string | undefined;
354
- } | {
355
- type: "json";
356
- label?: string | undefined;
357
- optional?: boolean | undefined;
358
- unique?: boolean | undefined;
359
- default?: unknown;
360
- }>;
361
- writable: true;
362
- indexes?: Record<string, {
363
- on: (string | string[]) & (string | string[] | undefined);
364
- unique?: boolean | undefined;
365
- }> | undefined;
366
- table?: any;
367
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
368
- }, {
369
- columns: Record<string, {
370
- type: "boolean";
371
- label?: string | undefined;
372
- optional?: boolean | undefined;
373
- unique?: boolean | undefined;
374
- default?: boolean | undefined;
375
- } | {
376
- type: "number";
377
- label?: string | undefined;
378
- optional?: boolean | undefined;
379
- unique?: boolean | undefined;
380
- default?: number | undefined;
381
- primaryKey?: boolean | undefined;
382
- } | {
383
- type: "text";
384
- label?: string | undefined;
385
- optional?: boolean | undefined;
386
- unique?: boolean | undefined;
387
- multiline?: boolean | undefined;
388
- default?: string | undefined;
389
- primaryKey?: boolean | undefined;
390
- } | {
391
- type: "date";
392
- label?: string | undefined;
393
- optional?: boolean | undefined;
394
- unique?: boolean | undefined;
395
- default?: Date | "now" | undefined;
396
- } | {
397
- type: "json";
398
- label?: string | undefined;
399
- optional?: boolean | undefined;
400
- unique?: boolean | undefined;
401
- default?: unknown;
402
- }>;
403
- writable: true;
404
- indexes?: Record<string, {
405
- on: (string | string[]) & (string | string[] | undefined);
406
- unique?: boolean | undefined;
407
- }> | undefined;
408
- table?: any;
409
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
410
- }>]>>>;
411
- data: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
412
- }, "strip", z.ZodTypeAny, {
413
- studio?: boolean | undefined;
414
- collections?: Record<string, {
415
- columns: Record<string, {
416
- type: "boolean";
417
- label?: string | undefined;
418
- optional?: boolean | undefined;
419
- unique?: boolean | undefined;
420
- default?: boolean | undefined;
421
- } | {
422
- type: "number";
423
- label?: string | undefined;
424
- optional?: boolean | undefined;
425
- unique?: boolean | undefined;
426
- default?: number | undefined;
427
- primaryKey?: boolean | undefined;
428
- } | {
429
- type: "text";
430
- label?: string | undefined;
431
- optional?: boolean | undefined;
432
- unique?: boolean | undefined;
433
- multiline?: boolean | undefined;
434
- default?: string | undefined;
435
- primaryKey?: boolean | undefined;
436
- } | {
437
- type: "date";
438
- label?: string | undefined;
439
- optional?: boolean | undefined;
440
- unique?: boolean | undefined;
441
- default?: string | undefined;
442
- } | {
443
- type: "json";
444
- label?: string | undefined;
445
- optional?: boolean | undefined;
446
- unique?: boolean | undefined;
447
- default?: unknown;
448
- }>;
449
- writable: false;
450
- indexes?: Record<string, {
451
- on: (string | string[]) & (string | string[] | undefined);
452
- unique?: boolean | undefined;
453
- }> | undefined;
454
- table?: any;
455
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
456
- } | {
457
- columns: Record<string, {
458
- type: "boolean";
459
- label?: string | undefined;
460
- optional?: boolean | undefined;
461
- unique?: boolean | undefined;
462
- default?: boolean | undefined;
463
- } | {
464
- type: "number";
465
- label?: string | undefined;
466
- optional?: boolean | undefined;
467
- unique?: boolean | undefined;
468
- default?: number | undefined;
469
- primaryKey?: boolean | undefined;
470
- } | {
471
- type: "text";
472
- label?: string | undefined;
473
- optional?: boolean | undefined;
474
- unique?: boolean | undefined;
475
- multiline?: boolean | undefined;
476
- default?: string | undefined;
477
- primaryKey?: boolean | undefined;
478
- } | {
479
- type: "date";
480
- label?: string | undefined;
481
- optional?: boolean | undefined;
482
- unique?: boolean | undefined;
483
- default?: string | undefined;
484
- } | {
485
- type: "json";
486
- label?: string | undefined;
487
- optional?: boolean | undefined;
488
- unique?: boolean | undefined;
489
- default?: unknown;
490
- }>;
491
- writable: true;
492
- indexes?: Record<string, {
493
- on: (string | string[]) & (string | string[] | undefined);
494
- unique?: boolean | undefined;
495
- }> | undefined;
496
- table?: any;
497
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
498
- }> | undefined;
499
- data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
500
- }, {
501
- studio?: boolean | undefined;
502
- collections?: Record<string, {
503
- columns: Record<string, {
504
- type: "boolean";
505
- label?: string | undefined;
506
- optional?: boolean | undefined;
507
- unique?: boolean | undefined;
508
- default?: boolean | undefined;
509
- } | {
510
- type: "number";
511
- label?: string | undefined;
512
- optional?: boolean | undefined;
513
- unique?: boolean | undefined;
514
- default?: number | undefined;
515
- primaryKey?: boolean | undefined;
516
- } | {
517
- type: "text";
518
- label?: string | undefined;
519
- optional?: boolean | undefined;
520
- unique?: boolean | undefined;
521
- multiline?: boolean | undefined;
522
- default?: string | undefined;
523
- primaryKey?: boolean | undefined;
524
- } | {
525
- type: "date";
526
- label?: string | undefined;
527
- optional?: boolean | undefined;
528
- unique?: boolean | undefined;
529
- default?: Date | "now" | undefined;
530
- } | {
531
- type: "json";
532
- label?: string | undefined;
533
- optional?: boolean | undefined;
534
- unique?: boolean | undefined;
535
- default?: unknown;
536
- }>;
537
- writable: false;
538
- indexes?: Record<string, {
539
- on: (string | string[]) & (string | string[] | undefined);
540
- unique?: boolean | undefined;
541
- }> | undefined;
542
- table?: any;
543
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
544
- } | {
545
- columns: Record<string, {
546
- type: "boolean";
547
- label?: string | undefined;
548
- optional?: boolean | undefined;
549
- unique?: boolean | undefined;
550
- default?: boolean | undefined;
551
- } | {
552
- type: "number";
553
- label?: string | undefined;
554
- optional?: boolean | undefined;
555
- unique?: boolean | undefined;
556
- default?: number | undefined;
557
- primaryKey?: boolean | undefined;
558
- } | {
559
- type: "text";
560
- label?: string | undefined;
561
- optional?: boolean | undefined;
562
- unique?: boolean | undefined;
563
- multiline?: boolean | undefined;
564
- default?: string | undefined;
565
- primaryKey?: boolean | undefined;
566
- } | {
567
- type: "date";
568
- label?: string | undefined;
569
- optional?: boolean | undefined;
570
- unique?: boolean | undefined;
571
- default?: Date | "now" | undefined;
572
- } | {
573
- type: "json";
574
- label?: string | undefined;
575
- optional?: boolean | undefined;
576
- unique?: boolean | undefined;
577
- default?: unknown;
578
- }>;
579
- writable: true;
580
- indexes?: Record<string, {
581
- on: (string | string[]) & (string | string[] | undefined);
582
- unique?: boolean | undefined;
583
- }> | undefined;
584
- table?: any;
585
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
586
- }> | undefined;
587
- data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
588
- }>;
589
- export type DBUserConfig = Omit<z.input<typeof dbConfigSchema>, 'data'> & {
590
- data(params: DBDataContext): MaybePromise<void>;
591
- };
592
- export declare const astroConfigWithDbSchema: z.ZodObject<{
593
- db: z.ZodOptional<z.ZodObject<{
594
- studio: z.ZodOptional<z.ZodBoolean>;
595
- collections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
596
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
597
- label: z.ZodOptional<z.ZodString>;
598
- optional: z.ZodOptional<z.ZodBoolean>;
599
- unique: z.ZodOptional<z.ZodBoolean>;
600
- type: z.ZodLiteral<"boolean">;
601
- default: z.ZodOptional<z.ZodBoolean>;
602
- }, "strip", z.ZodTypeAny, {
603
- type: "boolean";
604
- label?: string | undefined;
605
- optional?: boolean | undefined;
606
- unique?: boolean | undefined;
607
- default?: boolean | undefined;
608
- }, {
609
- type: "boolean";
610
- label?: string | undefined;
611
- optional?: boolean | undefined;
612
- unique?: boolean | undefined;
613
- default?: boolean | undefined;
614
- }>, z.ZodObject<{
615
- label: z.ZodOptional<z.ZodString>;
616
- optional: z.ZodOptional<z.ZodBoolean>;
617
- unique: z.ZodOptional<z.ZodBoolean>;
618
- type: z.ZodLiteral<"number">;
619
- default: z.ZodOptional<z.ZodNumber>;
620
- primaryKey: z.ZodOptional<z.ZodBoolean>;
621
- }, "strip", z.ZodTypeAny, {
622
- type: "number";
623
- label?: string | undefined;
624
- optional?: boolean | undefined;
625
- unique?: boolean | undefined;
626
- default?: number | undefined;
627
- primaryKey?: boolean | undefined;
628
- }, {
629
- type: "number";
630
- label?: string | undefined;
631
- optional?: boolean | undefined;
632
- unique?: boolean | undefined;
633
- default?: number | undefined;
634
- primaryKey?: boolean | undefined;
635
- }>, z.ZodObject<{
636
- label: z.ZodOptional<z.ZodString>;
637
- optional: z.ZodOptional<z.ZodBoolean>;
638
- unique: z.ZodOptional<z.ZodBoolean>;
639
- type: z.ZodLiteral<"text">;
640
- multiline: z.ZodOptional<z.ZodBoolean>;
641
- default: z.ZodOptional<z.ZodString>;
642
- primaryKey: z.ZodOptional<z.ZodBoolean>;
643
- }, "strip", z.ZodTypeAny, {
644
- type: "text";
645
- label?: string | undefined;
646
- optional?: boolean | undefined;
647
- unique?: boolean | undefined;
648
- multiline?: boolean | undefined;
649
- default?: string | undefined;
650
- primaryKey?: boolean | undefined;
651
- }, {
652
- type: "text";
653
- label?: string | undefined;
654
- optional?: boolean | undefined;
655
- unique?: boolean | undefined;
656
- multiline?: boolean | undefined;
657
- default?: string | undefined;
658
- primaryKey?: boolean | undefined;
659
- }>, z.ZodObject<{
660
- label: z.ZodOptional<z.ZodString>;
661
- optional: z.ZodOptional<z.ZodBoolean>;
662
- unique: z.ZodOptional<z.ZodBoolean>;
663
- type: z.ZodLiteral<"date">;
664
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
665
- }, "strip", z.ZodTypeAny, {
666
- type: "date";
667
- label?: string | undefined;
668
- optional?: boolean | undefined;
669
- unique?: boolean | undefined;
670
- default?: string | undefined;
671
- }, {
672
- type: "date";
673
- label?: string | undefined;
674
- optional?: boolean | undefined;
675
- unique?: boolean | undefined;
676
- default?: Date | "now" | undefined;
677
- }>, z.ZodObject<{
678
- label: z.ZodOptional<z.ZodString>;
679
- optional: z.ZodOptional<z.ZodBoolean>;
680
- unique: z.ZodOptional<z.ZodBoolean>;
681
- type: z.ZodLiteral<"json">;
682
- default: z.ZodOptional<z.ZodUnknown>;
683
- }, "strip", z.ZodTypeAny, {
684
- type: "json";
685
- label?: string | undefined;
686
- optional?: boolean | undefined;
687
- unique?: boolean | undefined;
688
- default?: unknown;
689
- }, {
690
- type: "json";
691
- label?: string | undefined;
692
- optional?: boolean | undefined;
693
- unique?: boolean | undefined;
694
- default?: unknown;
695
- }>]>>;
696
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
697
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
698
- unique: z.ZodOptional<z.ZodBoolean>;
699
- }, "strip", z.ZodTypeAny, {
700
- on: (string | string[]) & (string | string[] | undefined);
701
- unique?: boolean | undefined;
702
- }, {
703
- on: (string | string[]) & (string | string[] | undefined);
704
- unique?: boolean | undefined;
705
- }>>>;
706
- table: z.ZodAny;
707
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
708
- writable: z.ZodLiteral<false>;
709
- }, "strip", z.ZodTypeAny, {
710
- columns: Record<string, {
711
- type: "boolean";
712
- label?: string | undefined;
713
- optional?: boolean | undefined;
714
- unique?: boolean | undefined;
715
- default?: boolean | undefined;
716
- } | {
717
- type: "number";
718
- label?: string | undefined;
719
- optional?: boolean | undefined;
720
- unique?: boolean | undefined;
721
- default?: number | undefined;
722
- primaryKey?: boolean | undefined;
723
- } | {
724
- type: "text";
725
- label?: string | undefined;
726
- optional?: boolean | undefined;
727
- unique?: boolean | undefined;
728
- multiline?: boolean | undefined;
729
- default?: string | undefined;
730
- primaryKey?: boolean | undefined;
731
- } | {
732
- type: "date";
733
- label?: string | undefined;
734
- optional?: boolean | undefined;
735
- unique?: boolean | undefined;
736
- default?: string | undefined;
737
- } | {
738
- type: "json";
739
- label?: string | undefined;
740
- optional?: boolean | undefined;
741
- unique?: boolean | undefined;
742
- default?: unknown;
743
- }>;
744
- writable: false;
745
- indexes?: Record<string, {
746
- on: (string | string[]) & (string | string[] | undefined);
747
- unique?: boolean | undefined;
748
- }> | undefined;
749
- table?: any;
750
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
751
- }, {
752
- columns: Record<string, {
753
- type: "boolean";
754
- label?: string | undefined;
755
- optional?: boolean | undefined;
756
- unique?: boolean | undefined;
757
- default?: boolean | undefined;
758
- } | {
759
- type: "number";
760
- label?: string | undefined;
761
- optional?: boolean | undefined;
762
- unique?: boolean | undefined;
763
- default?: number | undefined;
764
- primaryKey?: boolean | undefined;
765
- } | {
766
- type: "text";
767
- label?: string | undefined;
768
- optional?: boolean | undefined;
769
- unique?: boolean | undefined;
770
- multiline?: boolean | undefined;
771
- default?: string | undefined;
772
- primaryKey?: boolean | undefined;
773
- } | {
774
- type: "date";
775
- label?: string | undefined;
776
- optional?: boolean | undefined;
777
- unique?: boolean | undefined;
778
- default?: Date | "now" | undefined;
779
- } | {
780
- type: "json";
781
- label?: string | undefined;
782
- optional?: boolean | undefined;
783
- unique?: boolean | undefined;
784
- default?: unknown;
785
- }>;
786
- writable: false;
787
- indexes?: Record<string, {
788
- on: (string | string[]) & (string | string[] | undefined);
789
- unique?: boolean | undefined;
790
- }> | undefined;
791
- table?: any;
792
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
793
- }>, z.ZodObject<{
794
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
795
- label: z.ZodOptional<z.ZodString>;
796
- optional: z.ZodOptional<z.ZodBoolean>;
797
- unique: z.ZodOptional<z.ZodBoolean>;
798
- type: z.ZodLiteral<"boolean">;
799
- default: z.ZodOptional<z.ZodBoolean>;
800
- }, "strip", z.ZodTypeAny, {
801
- type: "boolean";
802
- label?: string | undefined;
803
- optional?: boolean | undefined;
804
- unique?: boolean | undefined;
805
- default?: boolean | undefined;
806
- }, {
807
- type: "boolean";
808
- label?: string | undefined;
809
- optional?: boolean | undefined;
810
- unique?: boolean | undefined;
811
- default?: boolean | undefined;
812
- }>, z.ZodObject<{
813
- label: z.ZodOptional<z.ZodString>;
814
- optional: z.ZodOptional<z.ZodBoolean>;
815
- unique: z.ZodOptional<z.ZodBoolean>;
816
- type: z.ZodLiteral<"number">;
817
- default: z.ZodOptional<z.ZodNumber>;
818
- primaryKey: z.ZodOptional<z.ZodBoolean>;
819
- }, "strip", z.ZodTypeAny, {
820
- type: "number";
821
- label?: string | undefined;
822
- optional?: boolean | undefined;
823
- unique?: boolean | undefined;
824
- default?: number | undefined;
825
- primaryKey?: boolean | undefined;
826
- }, {
827
- type: "number";
828
- label?: string | undefined;
829
- optional?: boolean | undefined;
830
- unique?: boolean | undefined;
831
- default?: number | undefined;
832
- primaryKey?: boolean | undefined;
833
- }>, z.ZodObject<{
834
- label: z.ZodOptional<z.ZodString>;
835
- optional: z.ZodOptional<z.ZodBoolean>;
836
- unique: z.ZodOptional<z.ZodBoolean>;
837
- type: z.ZodLiteral<"text">;
838
- multiline: z.ZodOptional<z.ZodBoolean>;
839
- default: z.ZodOptional<z.ZodString>;
840
- primaryKey: z.ZodOptional<z.ZodBoolean>;
841
- }, "strip", z.ZodTypeAny, {
842
- type: "text";
843
- label?: string | undefined;
844
- optional?: boolean | undefined;
845
- unique?: boolean | undefined;
846
- multiline?: boolean | undefined;
847
- default?: string | undefined;
848
- primaryKey?: boolean | undefined;
849
- }, {
850
- type: "text";
851
- label?: string | undefined;
852
- optional?: boolean | undefined;
853
- unique?: boolean | undefined;
854
- multiline?: boolean | undefined;
855
- default?: string | undefined;
856
- primaryKey?: boolean | undefined;
857
- }>, z.ZodObject<{
858
- label: z.ZodOptional<z.ZodString>;
859
- optional: z.ZodOptional<z.ZodBoolean>;
860
- unique: z.ZodOptional<z.ZodBoolean>;
861
- type: z.ZodLiteral<"date">;
862
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
863
- }, "strip", z.ZodTypeAny, {
864
- type: "date";
865
- label?: string | undefined;
866
- optional?: boolean | undefined;
867
- unique?: boolean | undefined;
868
- default?: string | undefined;
869
- }, {
870
- type: "date";
871
- label?: string | undefined;
872
- optional?: boolean | undefined;
873
- unique?: boolean | undefined;
874
- default?: Date | "now" | undefined;
875
- }>, z.ZodObject<{
876
- label: z.ZodOptional<z.ZodString>;
877
- optional: z.ZodOptional<z.ZodBoolean>;
878
- unique: z.ZodOptional<z.ZodBoolean>;
879
- type: z.ZodLiteral<"json">;
880
- default: z.ZodOptional<z.ZodUnknown>;
881
- }, "strip", z.ZodTypeAny, {
882
- type: "json";
883
- label?: string | undefined;
884
- optional?: boolean | undefined;
885
- unique?: boolean | undefined;
886
- default?: unknown;
887
- }, {
888
- type: "json";
889
- label?: string | undefined;
890
- optional?: boolean | undefined;
891
- unique?: boolean | undefined;
892
- default?: unknown;
893
- }>]>>;
894
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
895
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
896
- unique: z.ZodOptional<z.ZodBoolean>;
897
- }, "strip", z.ZodTypeAny, {
898
- on: (string | string[]) & (string | string[] | undefined);
899
- unique?: boolean | undefined;
900
- }, {
901
- on: (string | string[]) & (string | string[] | undefined);
902
- unique?: boolean | undefined;
903
- }>>>;
904
- table: z.ZodAny;
905
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
906
- writable: z.ZodLiteral<true>;
907
- }, "strip", z.ZodTypeAny, {
908
- columns: Record<string, {
909
- type: "boolean";
910
- label?: string | undefined;
911
- optional?: boolean | undefined;
912
- unique?: boolean | undefined;
913
- default?: boolean | undefined;
914
- } | {
915
- type: "number";
916
- label?: string | undefined;
917
- optional?: boolean | undefined;
918
- unique?: boolean | undefined;
919
- default?: number | undefined;
920
- primaryKey?: boolean | undefined;
921
- } | {
922
- type: "text";
923
- label?: string | undefined;
924
- optional?: boolean | undefined;
925
- unique?: boolean | undefined;
926
- multiline?: boolean | undefined;
927
- default?: string | undefined;
928
- primaryKey?: boolean | undefined;
929
- } | {
930
- type: "date";
931
- label?: string | undefined;
932
- optional?: boolean | undefined;
933
- unique?: boolean | undefined;
934
- default?: string | undefined;
935
- } | {
936
- type: "json";
937
- label?: string | undefined;
938
- optional?: boolean | undefined;
939
- unique?: boolean | undefined;
940
- default?: unknown;
941
- }>;
942
- writable: true;
943
- indexes?: Record<string, {
944
- on: (string | string[]) & (string | string[] | undefined);
945
- unique?: boolean | undefined;
946
- }> | undefined;
947
- table?: any;
948
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
949
- }, {
950
- columns: Record<string, {
951
- type: "boolean";
952
- label?: string | undefined;
953
- optional?: boolean | undefined;
954
- unique?: boolean | undefined;
955
- default?: boolean | undefined;
956
- } | {
957
- type: "number";
958
- label?: string | undefined;
959
- optional?: boolean | undefined;
960
- unique?: boolean | undefined;
961
- default?: number | undefined;
962
- primaryKey?: boolean | undefined;
963
- } | {
964
- type: "text";
965
- label?: string | undefined;
966
- optional?: boolean | undefined;
967
- unique?: boolean | undefined;
968
- multiline?: boolean | undefined;
969
- default?: string | undefined;
970
- primaryKey?: boolean | undefined;
971
- } | {
972
- type: "date";
973
- label?: string | undefined;
974
- optional?: boolean | undefined;
975
- unique?: boolean | undefined;
976
- default?: Date | "now" | undefined;
977
- } | {
978
- type: "json";
979
- label?: string | undefined;
980
- optional?: boolean | undefined;
981
- unique?: boolean | undefined;
982
- default?: unknown;
983
- }>;
984
- writable: true;
985
- indexes?: Record<string, {
986
- on: (string | string[]) & (string | string[] | undefined);
987
- unique?: boolean | undefined;
988
- }> | undefined;
989
- table?: any;
990
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
991
- }>]>>>;
992
- data: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
993
- }, "strip", z.ZodTypeAny, {
994
- studio?: boolean | undefined;
995
- collections?: Record<string, {
996
- columns: Record<string, {
997
- type: "boolean";
998
- label?: string | undefined;
999
- optional?: boolean | undefined;
1000
- unique?: boolean | undefined;
1001
- default?: boolean | undefined;
1002
- } | {
1003
- type: "number";
1004
- label?: string | undefined;
1005
- optional?: boolean | undefined;
1006
- unique?: boolean | undefined;
1007
- default?: number | undefined;
1008
- primaryKey?: boolean | undefined;
1009
- } | {
1010
- type: "text";
1011
- label?: string | undefined;
1012
- optional?: boolean | undefined;
1013
- unique?: boolean | undefined;
1014
- multiline?: boolean | undefined;
1015
- default?: string | undefined;
1016
- primaryKey?: boolean | undefined;
1017
- } | {
1018
- type: "date";
1019
- label?: string | undefined;
1020
- optional?: boolean | undefined;
1021
- unique?: boolean | undefined;
1022
- default?: string | undefined;
1023
- } | {
1024
- type: "json";
1025
- label?: string | undefined;
1026
- optional?: boolean | undefined;
1027
- unique?: boolean | undefined;
1028
- default?: unknown;
1029
- }>;
1030
- writable: false;
1031
- indexes?: Record<string, {
1032
- on: (string | string[]) & (string | string[] | undefined);
1033
- unique?: boolean | undefined;
1034
- }> | undefined;
1035
- table?: any;
1036
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1037
- } | {
1038
- columns: Record<string, {
1039
- type: "boolean";
1040
- label?: string | undefined;
1041
- optional?: boolean | undefined;
1042
- unique?: boolean | undefined;
1043
- default?: boolean | undefined;
1044
- } | {
1045
- type: "number";
1046
- label?: string | undefined;
1047
- optional?: boolean | undefined;
1048
- unique?: boolean | undefined;
1049
- default?: number | undefined;
1050
- primaryKey?: boolean | undefined;
1051
- } | {
1052
- type: "text";
1053
- label?: string | undefined;
1054
- optional?: boolean | undefined;
1055
- unique?: boolean | undefined;
1056
- multiline?: boolean | undefined;
1057
- default?: string | undefined;
1058
- primaryKey?: boolean | undefined;
1059
- } | {
1060
- type: "date";
1061
- label?: string | undefined;
1062
- optional?: boolean | undefined;
1063
- unique?: boolean | undefined;
1064
- default?: string | undefined;
1065
- } | {
1066
- type: "json";
1067
- label?: string | undefined;
1068
- optional?: boolean | undefined;
1069
- unique?: boolean | undefined;
1070
- default?: unknown;
1071
- }>;
1072
- writable: true;
1073
- indexes?: Record<string, {
1074
- on: (string | string[]) & (string | string[] | undefined);
1075
- unique?: boolean | undefined;
1076
- }> | undefined;
1077
- table?: any;
1078
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1079
- }> | undefined;
1080
- data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
1081
- }, {
1082
- studio?: boolean | undefined;
1083
- collections?: Record<string, {
1084
- columns: Record<string, {
1085
- type: "boolean";
1086
- label?: string | undefined;
1087
- optional?: boolean | undefined;
1088
- unique?: boolean | undefined;
1089
- default?: boolean | undefined;
1090
- } | {
1091
- type: "number";
1092
- label?: string | undefined;
1093
- optional?: boolean | undefined;
1094
- unique?: boolean | undefined;
1095
- default?: number | undefined;
1096
- primaryKey?: boolean | undefined;
1097
- } | {
1098
- type: "text";
1099
- label?: string | undefined;
1100
- optional?: boolean | undefined;
1101
- unique?: boolean | undefined;
1102
- multiline?: boolean | undefined;
1103
- default?: string | undefined;
1104
- primaryKey?: boolean | undefined;
1105
- } | {
1106
- type: "date";
1107
- label?: string | undefined;
1108
- optional?: boolean | undefined;
1109
- unique?: boolean | undefined;
1110
- default?: Date | "now" | undefined;
1111
- } | {
1112
- type: "json";
1113
- label?: string | undefined;
1114
- optional?: boolean | undefined;
1115
- unique?: boolean | undefined;
1116
- default?: unknown;
1117
- }>;
1118
- writable: false;
1119
- indexes?: Record<string, {
1120
- on: (string | string[]) & (string | string[] | undefined);
1121
- unique?: boolean | undefined;
1122
- }> | undefined;
1123
- table?: any;
1124
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1125
- } | {
1126
- columns: Record<string, {
1127
- type: "boolean";
1128
- label?: string | undefined;
1129
- optional?: boolean | undefined;
1130
- unique?: boolean | undefined;
1131
- default?: boolean | undefined;
1132
- } | {
1133
- type: "number";
1134
- label?: string | undefined;
1135
- optional?: boolean | undefined;
1136
- unique?: boolean | undefined;
1137
- default?: number | undefined;
1138
- primaryKey?: boolean | undefined;
1139
- } | {
1140
- type: "text";
1141
- label?: string | undefined;
1142
- optional?: boolean | undefined;
1143
- unique?: boolean | undefined;
1144
- multiline?: boolean | undefined;
1145
- default?: string | undefined;
1146
- primaryKey?: boolean | undefined;
1147
- } | {
1148
- type: "date";
1149
- label?: string | undefined;
1150
- optional?: boolean | undefined;
1151
- unique?: boolean | undefined;
1152
- default?: Date | "now" | undefined;
1153
- } | {
1154
- type: "json";
1155
- label?: string | undefined;
1156
- optional?: boolean | undefined;
1157
- unique?: boolean | undefined;
1158
- default?: unknown;
1159
- }>;
1160
- writable: true;
1161
- indexes?: Record<string, {
1162
- on: (string | string[]) & (string | string[] | undefined);
1163
- unique?: boolean | undefined;
1164
- }> | undefined;
1165
- table?: any;
1166
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1167
- }> | undefined;
1168
- data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
1169
- }>>;
1170
- }, "strip", z.ZodTypeAny, {
1171
- db?: {
1172
- studio?: boolean | undefined;
1173
- collections?: Record<string, {
1174
- columns: Record<string, {
1175
- type: "boolean";
1176
- label?: string | undefined;
1177
- optional?: boolean | undefined;
1178
- unique?: boolean | undefined;
1179
- default?: boolean | undefined;
1180
- } | {
1181
- type: "number";
1182
- label?: string | undefined;
1183
- optional?: boolean | undefined;
1184
- unique?: boolean | undefined;
1185
- default?: number | undefined;
1186
- primaryKey?: boolean | undefined;
1187
- } | {
1188
- type: "text";
1189
- label?: string | undefined;
1190
- optional?: boolean | undefined;
1191
- unique?: boolean | undefined;
1192
- multiline?: boolean | undefined;
1193
- default?: string | undefined;
1194
- primaryKey?: boolean | undefined;
1195
- } | {
1196
- type: "date";
1197
- label?: string | undefined;
1198
- optional?: boolean | undefined;
1199
- unique?: boolean | undefined;
1200
- default?: string | undefined;
1201
- } | {
1202
- type: "json";
1203
- label?: string | undefined;
1204
- optional?: boolean | undefined;
1205
- unique?: boolean | undefined;
1206
- default?: unknown;
1207
- }>;
1208
- writable: false;
1209
- indexes?: Record<string, {
1210
- on: (string | string[]) & (string | string[] | undefined);
1211
- unique?: boolean | undefined;
1212
- }> | undefined;
1213
- table?: any;
1214
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1215
- } | {
1216
- columns: Record<string, {
1217
- type: "boolean";
1218
- label?: string | undefined;
1219
- optional?: boolean | undefined;
1220
- unique?: boolean | undefined;
1221
- default?: boolean | undefined;
1222
- } | {
1223
- type: "number";
1224
- label?: string | undefined;
1225
- optional?: boolean | undefined;
1226
- unique?: boolean | undefined;
1227
- default?: number | undefined;
1228
- primaryKey?: boolean | undefined;
1229
- } | {
1230
- type: "text";
1231
- label?: string | undefined;
1232
- optional?: boolean | undefined;
1233
- unique?: boolean | undefined;
1234
- multiline?: boolean | undefined;
1235
- default?: string | undefined;
1236
- primaryKey?: boolean | undefined;
1237
- } | {
1238
- type: "date";
1239
- label?: string | undefined;
1240
- optional?: boolean | undefined;
1241
- unique?: boolean | undefined;
1242
- default?: string | undefined;
1243
- } | {
1244
- type: "json";
1245
- label?: string | undefined;
1246
- optional?: boolean | undefined;
1247
- unique?: boolean | undefined;
1248
- default?: unknown;
1249
- }>;
1250
- writable: true;
1251
- indexes?: Record<string, {
1252
- on: (string | string[]) & (string | string[] | undefined);
1253
- unique?: boolean | undefined;
1254
- }> | undefined;
1255
- table?: any;
1256
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1257
- }> | undefined;
1258
- data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
1259
- } | undefined;
1260
- }, {
1261
- db?: {
1262
- studio?: boolean | undefined;
1263
- collections?: Record<string, {
1264
- columns: Record<string, {
1265
- type: "boolean";
1266
- label?: string | undefined;
1267
- optional?: boolean | undefined;
1268
- unique?: boolean | undefined;
1269
- default?: boolean | undefined;
1270
- } | {
1271
- type: "number";
1272
- label?: string | undefined;
1273
- optional?: boolean | undefined;
1274
- unique?: boolean | undefined;
1275
- default?: number | undefined;
1276
- primaryKey?: boolean | undefined;
1277
- } | {
1278
- type: "text";
1279
- label?: string | undefined;
1280
- optional?: boolean | undefined;
1281
- unique?: boolean | undefined;
1282
- multiline?: boolean | undefined;
1283
- default?: string | undefined;
1284
- primaryKey?: boolean | undefined;
1285
- } | {
1286
- type: "date";
1287
- label?: string | undefined;
1288
- optional?: boolean | undefined;
1289
- unique?: boolean | undefined;
1290
- default?: Date | "now" | undefined;
1291
- } | {
1292
- type: "json";
1293
- label?: string | undefined;
1294
- optional?: boolean | undefined;
1295
- unique?: boolean | undefined;
1296
- default?: unknown;
1297
- }>;
1298
- writable: false;
1299
- indexes?: Record<string, {
1300
- on: (string | string[]) & (string | string[] | undefined);
1301
- unique?: boolean | undefined;
1302
- }> | undefined;
1303
- table?: any;
1304
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1305
- } | {
1306
- columns: Record<string, {
1307
- type: "boolean";
1308
- label?: string | undefined;
1309
- optional?: boolean | undefined;
1310
- unique?: boolean | undefined;
1311
- default?: boolean | undefined;
1312
- } | {
1313
- type: "number";
1314
- label?: string | undefined;
1315
- optional?: boolean | undefined;
1316
- unique?: boolean | undefined;
1317
- default?: number | undefined;
1318
- primaryKey?: boolean | undefined;
1319
- } | {
1320
- type: "text";
1321
- label?: string | undefined;
1322
- optional?: boolean | undefined;
1323
- unique?: boolean | undefined;
1324
- multiline?: boolean | undefined;
1325
- default?: string | undefined;
1326
- primaryKey?: boolean | undefined;
1327
- } | {
1328
- type: "date";
1329
- label?: string | undefined;
1330
- optional?: boolean | undefined;
1331
- unique?: boolean | undefined;
1332
- default?: Date | "now" | undefined;
1333
- } | {
1334
- type: "json";
1335
- label?: string | undefined;
1336
- optional?: boolean | undefined;
1337
- unique?: boolean | undefined;
1338
- default?: unknown;
1339
- }>;
1340
- writable: true;
1341
- indexes?: Record<string, {
1342
- on: (string | string[]) & (string | string[] | undefined);
1343
- unique?: boolean | undefined;
1344
- }> | undefined;
1345
- table?: any;
1346
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1347
- }> | undefined;
1348
- data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
1349
- } | undefined;
1350
- }>;
1351
- export type ColumnsConfig = z.input<typeof collectionSchema>['columns'];
1352
- interface CollectionConfig<TColumns extends ColumnsConfig> extends Pick<z.input<typeof collectionSchema>, 'columns' | 'indexes'> {
1353
- columns: TColumns;
1354
- indexes?: Record<string, IndexConfig<TColumns>>;
1355
- }
1356
- interface IndexConfig<TColumns extends ColumnsConfig> extends z.input<typeof indexSchema> {
1357
- on: MaybeArray<Extract<keyof TColumns, string>>;
1358
- }
1359
- export type ResolvedCollectionConfig<TColumns extends ColumnsConfig = ColumnsConfig, Writable extends boolean = boolean> = CollectionConfig<TColumns> & {
1360
- writable: Writable;
1361
- table: Table<string, TColumns>;
1362
- };
1363
- export declare function defineCollection<TColumns extends ColumnsConfig>(userConfig: CollectionConfig<TColumns>): ResolvedCollectionConfig<TColumns, false>;
1364
- export declare function defineWritableCollection<TColumns extends ColumnsConfig>(userConfig: CollectionConfig<TColumns>): ResolvedCollectionConfig<TColumns, true>;
1365
- export type AstroConfigWithDB = z.infer<typeof astroConfigWithDbSchema>;
1366
- type ColumnOpts<T extends DBColumnInput> = Omit<T, 'type'>;
1367
- export declare const column: {
1368
- number(opts?: ColumnOpts<NumberColumn>): NumberColumn;
1369
- boolean(opts?: ColumnOpts<BooleanColumn>): BooleanColumn;
1370
- text(opts?: ColumnOpts<TextColumn>): TextColumn;
1371
- date(opts?: ColumnOpts<DateColumnInput>): DateColumnInput;
1372
- json(opts?: ColumnOpts<JsonColumn>): JsonColumn;
1373
- };
1374
- export {};