pocketbase-zod-schema 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cli/index.cjs +449 -50
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +449 -50
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/migrate.cjs +455 -53
- package/dist/cli/migrate.cjs.map +1 -1
- package/dist/cli/migrate.js +455 -53
- package/dist/cli/migrate.js.map +1 -1
- package/dist/cli/utils/index.cjs +8 -1
- package/dist/cli/utils/index.cjs.map +1 -1
- package/dist/cli/utils/index.d.cts +1 -1
- package/dist/cli/utils/index.d.ts +1 -1
- package/dist/cli/utils/index.js +8 -1
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/index.cjs +90 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +87 -2
- package/dist/index.js.map +1 -1
- package/dist/migration/analyzer.cjs +87 -14
- package/dist/migration/analyzer.cjs.map +1 -1
- package/dist/migration/analyzer.d.cts +12 -4
- package/dist/migration/analyzer.d.ts +12 -4
- package/dist/migration/analyzer.js +87 -15
- package/dist/migration/analyzer.js.map +1 -1
- package/dist/migration/diff.cjs +64 -9
- package/dist/migration/diff.cjs.map +1 -1
- package/dist/migration/diff.d.cts +12 -2
- package/dist/migration/diff.d.ts +12 -2
- package/dist/migration/diff.js +64 -10
- package/dist/migration/diff.js.map +1 -1
- package/dist/migration/generator.cjs +206 -39
- package/dist/migration/generator.cjs.map +1 -1
- package/dist/migration/generator.d.cts +54 -2
- package/dist/migration/generator.d.ts +54 -2
- package/dist/migration/generator.js +203 -40
- package/dist/migration/generator.js.map +1 -1
- package/dist/migration/index.cjs +501 -63
- package/dist/migration/index.cjs.map +1 -1
- package/dist/migration/index.d.cts +2 -2
- package/dist/migration/index.d.ts +2 -2
- package/dist/migration/index.js +501 -63
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/snapshot.cjs +147 -1
- package/dist/migration/snapshot.cjs.map +1 -1
- package/dist/migration/snapshot.d.cts +3 -1
- package/dist/migration/snapshot.d.ts +3 -1
- package/dist/migration/snapshot.js +147 -1
- package/dist/migration/snapshot.js.map +1 -1
- package/dist/migration/utils/index.d.cts +1 -1
- package/dist/migration/utils/index.d.ts +1 -1
- package/dist/schema.cjs +90 -1
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +128 -2
- package/dist/schema.d.ts +128 -2
- package/dist/schema.js +87 -2
- package/dist/schema.js.map +1 -1
- package/dist/server.cjs +545 -65
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +542 -66
- package/dist/server.js.map +1 -1
- package/dist/{types-CWHV6ATd.d.cts → types-CnzfX6JH.d.cts} +20 -2
- package/dist/{types-C2nGWHLV.d.ts → types-Do3jyFBm.d.ts} +20 -2
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ interface FieldDefinition {
|
|
|
23
23
|
}
|
|
24
24
|
interface CollectionSchema {
|
|
25
25
|
name: string;
|
|
26
|
-
type: "base" | "auth";
|
|
26
|
+
type: "base" | "auth" | "view";
|
|
27
27
|
/**
|
|
28
28
|
* Pre-generated collection ID for use in migrations
|
|
29
29
|
* Format: pb_ followed by 15 alphanumeric lowercase characters
|
|
@@ -31,6 +31,12 @@ interface CollectionSchema {
|
|
|
31
31
|
* This ID is generated during migration creation to avoid runtime lookups
|
|
32
32
|
*/
|
|
33
33
|
id?: string;
|
|
34
|
+
/**
|
|
35
|
+
* SQL SELECT statement backing a view collection (type: "view" only)
|
|
36
|
+
* PocketBase derives the collection's fields from this query, so `fields`
|
|
37
|
+
* is not emitted into migrations for view collections
|
|
38
|
+
*/
|
|
39
|
+
viewQuery?: string;
|
|
34
40
|
fields: FieldDefinition[];
|
|
35
41
|
indexes?: string[];
|
|
36
42
|
rules?: {
|
|
@@ -82,6 +88,14 @@ interface PermissionChange {
|
|
|
82
88
|
oldValue: string | null;
|
|
83
89
|
newValue: string | null;
|
|
84
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* View query change tracking for view collections
|
|
93
|
+
* Applied in place so the collection ID stays stable
|
|
94
|
+
*/
|
|
95
|
+
interface ViewQueryUpdate {
|
|
96
|
+
oldValue: string | null;
|
|
97
|
+
newValue: string;
|
|
98
|
+
}
|
|
85
99
|
interface CollectionModification {
|
|
86
100
|
collection: string;
|
|
87
101
|
fieldsToAdd: FieldDefinition[];
|
|
@@ -91,6 +105,10 @@ interface CollectionModification {
|
|
|
91
105
|
indexesToRemove: string[];
|
|
92
106
|
rulesToUpdate: RuleUpdate[];
|
|
93
107
|
permissionsToUpdate: PermissionChange[];
|
|
108
|
+
/**
|
|
109
|
+
* Set when a view collection's SQL query changed (view collections only)
|
|
110
|
+
*/
|
|
111
|
+
viewQueryUpdate?: ViewQueryUpdate;
|
|
94
112
|
}
|
|
95
113
|
interface SchemaDiff {
|
|
96
114
|
collectionsToCreate: CollectionSchema[];
|
|
@@ -127,4 +145,4 @@ interface CollectionOperation {
|
|
|
127
145
|
timestamp: string;
|
|
128
146
|
}
|
|
129
147
|
|
|
130
|
-
export type { CollectionSchema as C, FieldDefinition as F, PermissionChange as P, RuleUpdate as R, SchemaDefinition as S, SchemaSnapshot as a, FieldChange as b, FieldModification as c, CollectionModification as d, SchemaDiff as e, CollectionOperation as f };
|
|
148
|
+
export type { CollectionSchema as C, FieldDefinition as F, PermissionChange as P, RuleUpdate as R, SchemaDefinition as S, ViewQueryUpdate as V, SchemaSnapshot as a, FieldChange as b, FieldModification as c, CollectionModification as d, SchemaDiff as e, CollectionOperation as f };
|
|
@@ -23,7 +23,7 @@ interface FieldDefinition {
|
|
|
23
23
|
}
|
|
24
24
|
interface CollectionSchema {
|
|
25
25
|
name: string;
|
|
26
|
-
type: "base" | "auth";
|
|
26
|
+
type: "base" | "auth" | "view";
|
|
27
27
|
/**
|
|
28
28
|
* Pre-generated collection ID for use in migrations
|
|
29
29
|
* Format: pb_ followed by 15 alphanumeric lowercase characters
|
|
@@ -31,6 +31,12 @@ interface CollectionSchema {
|
|
|
31
31
|
* This ID is generated during migration creation to avoid runtime lookups
|
|
32
32
|
*/
|
|
33
33
|
id?: string;
|
|
34
|
+
/**
|
|
35
|
+
* SQL SELECT statement backing a view collection (type: "view" only)
|
|
36
|
+
* PocketBase derives the collection's fields from this query, so `fields`
|
|
37
|
+
* is not emitted into migrations for view collections
|
|
38
|
+
*/
|
|
39
|
+
viewQuery?: string;
|
|
34
40
|
fields: FieldDefinition[];
|
|
35
41
|
indexes?: string[];
|
|
36
42
|
rules?: {
|
|
@@ -82,6 +88,14 @@ interface PermissionChange {
|
|
|
82
88
|
oldValue: string | null;
|
|
83
89
|
newValue: string | null;
|
|
84
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* View query change tracking for view collections
|
|
93
|
+
* Applied in place so the collection ID stays stable
|
|
94
|
+
*/
|
|
95
|
+
interface ViewQueryUpdate {
|
|
96
|
+
oldValue: string | null;
|
|
97
|
+
newValue: string;
|
|
98
|
+
}
|
|
85
99
|
interface CollectionModification {
|
|
86
100
|
collection: string;
|
|
87
101
|
fieldsToAdd: FieldDefinition[];
|
|
@@ -91,6 +105,10 @@ interface CollectionModification {
|
|
|
91
105
|
indexesToRemove: string[];
|
|
92
106
|
rulesToUpdate: RuleUpdate[];
|
|
93
107
|
permissionsToUpdate: PermissionChange[];
|
|
108
|
+
/**
|
|
109
|
+
* Set when a view collection's SQL query changed (view collections only)
|
|
110
|
+
*/
|
|
111
|
+
viewQueryUpdate?: ViewQueryUpdate;
|
|
94
112
|
}
|
|
95
113
|
interface SchemaDiff {
|
|
96
114
|
collectionsToCreate: CollectionSchema[];
|
|
@@ -127,4 +145,4 @@ interface CollectionOperation {
|
|
|
127
145
|
timestamp: string;
|
|
128
146
|
}
|
|
129
147
|
|
|
130
|
-
export type { CollectionSchema as C, FieldDefinition as F, PermissionChange as P, RuleUpdate as R, SchemaDefinition as S, SchemaSnapshot as a, FieldChange as b, FieldModification as c, CollectionModification as d, SchemaDiff as e, CollectionOperation as f };
|
|
148
|
+
export type { CollectionSchema as C, FieldDefinition as F, PermissionChange as P, RuleUpdate as R, SchemaDefinition as S, ViewQueryUpdate as V, SchemaSnapshot as a, FieldChange as b, FieldModification as c, CollectionModification as d, SchemaDiff as e, CollectionOperation as f };
|