pocketbase-zod-schema 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cli/index.cjs +374 -296
- 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 +374 -296
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/migrate.cjs +374 -296
- package/dist/cli/migrate.cjs.map +1 -1
- package/dist/cli/migrate.js +374 -296
- 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-UcOPu1OQ.d.cts} +16 -0
- package/dist/{fields-YjcpBXVp.d.ts → fields-UcOPu1OQ.d.ts} +16 -0
- package/dist/index.cjs +413 -114
- 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 +414 -103
- 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 +76 -1
- package/dist/migration/diff.cjs.map +1 -1
- package/dist/migration/diff.d.cts +2 -2
- package/dist/migration/diff.d.ts +2 -2
- package/dist/migration/diff.js +76 -1
- package/dist/migration/diff.js.map +1 -1
- package/dist/migration/generator.cjs +323 -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 +319 -47
- package/dist/migration/generator.js.map +1 -1
- package/dist/migration/index.cjs +399 -49
- 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 +399 -49
- package/dist/migration/index.js.map +1 -1
- 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.map +1 -1
- package/dist/migration/utils/index.cjs +64 -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 +63 -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-DrQmtznD.d.cts +208 -0
- package/dist/type-mapper-n231Fspm.d.ts +208 -0
- package/dist/{types-LFBGHl9Y.d.ts → types-Ds3NQvny.d.ts} +33 -2
- package/dist/{types-mhQXWNi3.d.cts → types-YoBjsa-A.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-YoBjsa-A.cjs';
|
|
3
|
+
import '../../fields-UcOPu1OQ.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-Ds3NQvny.js';
|
|
3
|
+
import '../../fields-UcOPu1OQ.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
|
|
@@ -169,7 +178,14 @@ declare function BoolField(): z.ZodBoolean;
|
|
|
169
178
|
* price: NumberField({ min: 0 }),
|
|
170
179
|
* quantity: NumberField({ min: 0, noDecimal: true }),
|
|
171
180
|
* rating: NumberField({ min: 0, max: 5 }),
|
|
181
|
+
* progress: NumberField({ min: 0, max: 100 }), // required defaults to false, allowing zero
|
|
182
|
+
* score: NumberField({ min: 1, max: 10, required: true }), // requires non-zero value
|
|
172
183
|
* });
|
|
184
|
+
*
|
|
185
|
+
* @remarks
|
|
186
|
+
* By default, number fields are not required (`required: false`), which allows zero values.
|
|
187
|
+
* In PocketBase, `required: true` for number fields means the value must be non-zero.
|
|
188
|
+
* If you set `min: 0` and want to allow zero, keep `required: false` (the default).
|
|
173
189
|
*/
|
|
174
190
|
declare function NumberField(options?: NumberFieldOptions): z.ZodNumber;
|
|
175
191
|
/**
|
|
@@ -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
|
|
@@ -169,7 +178,14 @@ declare function BoolField(): z.ZodBoolean;
|
|
|
169
178
|
* price: NumberField({ min: 0 }),
|
|
170
179
|
* quantity: NumberField({ min: 0, noDecimal: true }),
|
|
171
180
|
* rating: NumberField({ min: 0, max: 5 }),
|
|
181
|
+
* progress: NumberField({ min: 0, max: 100 }), // required defaults to false, allowing zero
|
|
182
|
+
* score: NumberField({ min: 1, max: 10, required: true }), // requires non-zero value
|
|
172
183
|
* });
|
|
184
|
+
*
|
|
185
|
+
* @remarks
|
|
186
|
+
* By default, number fields are not required (`required: false`), which allows zero values.
|
|
187
|
+
* In PocketBase, `required: true` for number fields means the value must be non-zero.
|
|
188
|
+
* If you set `min: 0` and want to allow zero, keep `required: false` (the default).
|
|
173
189
|
*/
|
|
174
190
|
declare function NumberField(options?: NumberFieldOptions): z.ZodNumber;
|
|
175
191
|
/**
|