pocketbase-zod-schema 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cli/index.cjs +497 -298
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +497 -298
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/migrate.cjs +497 -298
- package/dist/cli/migrate.cjs.map +1 -1
- package/dist/cli/migrate.js +497 -298
- package/dist/cli/migrate.js.map +1 -1
- package/dist/cli/utils/index.d.cts +2 -2
- package/dist/cli/utils/index.d.ts +2 -2
- package/dist/{fields-YjcpBXVp.d.cts → fields-RVj26U-O.d.cts} +17 -0
- package/dist/{fields-YjcpBXVp.d.ts → fields-RVj26U-O.d.ts} +17 -0
- package/dist/index.cjs +575 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +576 -144
- package/dist/index.js.map +1 -1
- package/dist/migration/analyzer.cjs +12 -2
- package/dist/migration/analyzer.cjs.map +1 -1
- package/dist/migration/analyzer.d.cts +2 -2
- package/dist/migration/analyzer.d.ts +2 -2
- package/dist/migration/analyzer.js +12 -2
- package/dist/migration/analyzer.js.map +1 -1
- package/dist/migration/diff.cjs +150 -24
- package/dist/migration/diff.cjs.map +1 -1
- package/dist/migration/diff.d.cts +4 -4
- package/dist/migration/diff.d.ts +4 -4
- package/dist/migration/diff.js +150 -24
- package/dist/migration/diff.js.map +1 -1
- package/dist/migration/generator.cjs +360 -46
- package/dist/migration/generator.cjs.map +1 -1
- package/dist/migration/generator.d.cts +59 -12
- package/dist/migration/generator.d.ts +59 -12
- package/dist/migration/generator.js +356 -47
- package/dist/migration/generator.js.map +1 -1
- package/dist/migration/index.cjs +561 -90
- package/dist/migration/index.cjs.map +1 -1
- package/dist/migration/index.d.cts +3 -3
- package/dist/migration/index.d.ts +3 -3
- package/dist/migration/index.js +561 -90
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/snapshot.cjs +51 -18
- package/dist/migration/snapshot.cjs.map +1 -1
- package/dist/migration/snapshot.d.cts +2 -2
- package/dist/migration/snapshot.d.ts +2 -2
- package/dist/migration/snapshot.js +51 -18
- package/dist/migration/snapshot.js.map +1 -1
- package/dist/migration/utils/index.cjs +66 -0
- package/dist/migration/utils/index.cjs.map +1 -1
- package/dist/migration/utils/index.d.cts +39 -202
- package/dist/migration/utils/index.d.ts +39 -202
- package/dist/migration/utils/index.js +65 -1
- package/dist/migration/utils/index.js.map +1 -1
- package/dist/schema.cjs +0 -61
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +2 -86
- package/dist/schema.d.ts +2 -86
- package/dist/schema.js +1 -50
- package/dist/schema.js.map +1 -1
- package/dist/type-mapper-CZzVeDj7.d.ts +208 -0
- package/dist/type-mapper-DaBe-1ph.d.cts +208 -0
- package/dist/{types-LFBGHl9Y.d.ts → types-CUVzgZ9k.d.ts} +33 -2
- package/dist/{types-mhQXWNi3.d.cts → types-D-Fsdn_O.d.cts} +33 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ora } from 'ora';
|
|
2
|
-
import { e as SchemaDiff } from '../../types-
|
|
3
|
-
import '../../fields-
|
|
2
|
+
import { e as SchemaDiff } from '../../types-D-Fsdn_O.cjs';
|
|
3
|
+
import '../../fields-RVj26U-O.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '../../permissions-ZHafVSIx.cjs';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ora } from 'ora';
|
|
2
|
-
import { e as SchemaDiff } from '../../types-
|
|
3
|
-
import '../../fields-
|
|
2
|
+
import { e as SchemaDiff } from '../../types-CUVzgZ9k.js';
|
|
3
|
+
import '../../fields-RVj26U-O.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '../../permissions-ZHafVSIx.js';
|
|
6
6
|
|
|
@@ -67,6 +67,15 @@ interface NumberFieldOptions {
|
|
|
67
67
|
* Whether to disallow decimal values (integers only)
|
|
68
68
|
*/
|
|
69
69
|
noDecimal?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the field is required
|
|
72
|
+
* @default false
|
|
73
|
+
*
|
|
74
|
+
* Note: In PocketBase, `required: true` for number fields means the value must be non-zero.
|
|
75
|
+
* If you want to allow zero values (e.g., for progress: 0-100), keep this as `false`.
|
|
76
|
+
* Set to `true` only if you want to enforce non-zero values.
|
|
77
|
+
*/
|
|
78
|
+
required?: boolean;
|
|
70
79
|
}
|
|
71
80
|
/**
|
|
72
81
|
* Date field configuration options
|
|
@@ -123,6 +132,7 @@ interface FileFieldOptions {
|
|
|
123
132
|
/**
|
|
124
133
|
* Thumbnail sizes to generate
|
|
125
134
|
* Example: ["100x100", "200x200"]
|
|
135
|
+
* Set to null to explicitly disable thumbnails
|
|
126
136
|
*/
|
|
127
137
|
thumbs?: string[];
|
|
128
138
|
/**
|
|
@@ -169,7 +179,14 @@ declare function BoolField(): z.ZodBoolean;
|
|
|
169
179
|
* price: NumberField({ min: 0 }),
|
|
170
180
|
* quantity: NumberField({ min: 0, noDecimal: true }),
|
|
171
181
|
* rating: NumberField({ min: 0, max: 5 }),
|
|
182
|
+
* progress: NumberField({ min: 0, max: 100 }), // required defaults to false, allowing zero
|
|
183
|
+
* score: NumberField({ min: 1, max: 10, required: true }), // requires non-zero value
|
|
172
184
|
* });
|
|
185
|
+
*
|
|
186
|
+
* @remarks
|
|
187
|
+
* By default, number fields are not required (`required: false`), which allows zero values.
|
|
188
|
+
* In PocketBase, `required: true` for number fields means the value must be non-zero.
|
|
189
|
+
* If you set `min: 0` and want to allow zero, keep `required: false` (the default).
|
|
173
190
|
*/
|
|
174
191
|
declare function NumberField(options?: NumberFieldOptions): z.ZodNumber;
|
|
175
192
|
/**
|
|
@@ -67,6 +67,15 @@ interface NumberFieldOptions {
|
|
|
67
67
|
* Whether to disallow decimal values (integers only)
|
|
68
68
|
*/
|
|
69
69
|
noDecimal?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the field is required
|
|
72
|
+
* @default false
|
|
73
|
+
*
|
|
74
|
+
* Note: In PocketBase, `required: true` for number fields means the value must be non-zero.
|
|
75
|
+
* If you want to allow zero values (e.g., for progress: 0-100), keep this as `false`.
|
|
76
|
+
* Set to `true` only if you want to enforce non-zero values.
|
|
77
|
+
*/
|
|
78
|
+
required?: boolean;
|
|
70
79
|
}
|
|
71
80
|
/**
|
|
72
81
|
* Date field configuration options
|
|
@@ -123,6 +132,7 @@ interface FileFieldOptions {
|
|
|
123
132
|
/**
|
|
124
133
|
* Thumbnail sizes to generate
|
|
125
134
|
* Example: ["100x100", "200x200"]
|
|
135
|
+
* Set to null to explicitly disable thumbnails
|
|
126
136
|
*/
|
|
127
137
|
thumbs?: string[];
|
|
128
138
|
/**
|
|
@@ -169,7 +179,14 @@ declare function BoolField(): z.ZodBoolean;
|
|
|
169
179
|
* price: NumberField({ min: 0 }),
|
|
170
180
|
* quantity: NumberField({ min: 0, noDecimal: true }),
|
|
171
181
|
* rating: NumberField({ min: 0, max: 5 }),
|
|
182
|
+
* progress: NumberField({ min: 0, max: 100 }), // required defaults to false, allowing zero
|
|
183
|
+
* score: NumberField({ min: 1, max: 10, required: true }), // requires non-zero value
|
|
172
184
|
* });
|
|
185
|
+
*
|
|
186
|
+
* @remarks
|
|
187
|
+
* By default, number fields are not required (`required: false`), which allows zero values.
|
|
188
|
+
* In PocketBase, `required: true` for number fields means the value must be non-zero.
|
|
189
|
+
* If you set `min: 0` and want to allow zero, keep `required: false` (the default).
|
|
173
190
|
*/
|
|
174
191
|
declare function NumberField(options?: NumberFieldOptions): z.ZodNumber;
|
|
175
192
|
/**
|