lazypock 0.1.0 → 0.1.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/README.md +145 -0
- package/dist/chunk-3MZJ5HCD.js +190 -0
- package/dist/chunk-3MZJ5HCD.js.map +1 -0
- package/dist/cli.cjs +235 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.global.js +243 -0
- package/dist/cli.global.js.map +1 -0
- package/dist/cli.js +105 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +360 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +298 -77
- package/dist/index.d.ts +298 -77
- package/dist/index.global.js +352 -10
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +178 -10
- package/dist/index.js.map +1 -1
- package/package.json +8 -1
- package/src/cli.ts +145 -0
- package/src/client.ts +48 -0
- package/src/codegen.ts +149 -0
- package/src/collection.ts +145 -21
- package/src/index.ts +29 -408
- package/src/lazypock.ts +490 -0
- package/src/realtime.ts +38 -0
- package/src/schema.ts +39 -0
- package/src/typegen.ts +137 -0
- package/src/types.ts +36 -2
package/src/types.ts
CHANGED
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
// ── Record & Collection types ───────────────────────────
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Base shape every record returned from any collection satisfies.
|
|
5
|
+
* Generated record interfaces extend this.
|
|
6
|
+
*/
|
|
7
|
+
export interface BaseRecordFields {
|
|
5
8
|
id: string;
|
|
6
9
|
collectionId: string;
|
|
7
10
|
collectionName: string;
|
|
8
11
|
created: string;
|
|
9
12
|
updated: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Shape of a record returned from any collection. */
|
|
16
|
+
export interface ApiRecord extends BaseRecordFields {
|
|
10
17
|
[key: string]: unknown;
|
|
11
18
|
}
|
|
12
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Structural marker for concrete record shapes (generated or hand-written).
|
|
22
|
+
* Used to differentiate a typed collection service from the untyped default.
|
|
23
|
+
*/
|
|
24
|
+
export type RecordShape = Record<string, unknown>;
|
|
25
|
+
|
|
26
|
+
/** System fields every record carries — not user-provided on create. */
|
|
27
|
+
export type SystemFields =
|
|
28
|
+
| "id"
|
|
29
|
+
| "collectionId"
|
|
30
|
+
| "collectionName"
|
|
31
|
+
| "created"
|
|
32
|
+
| "updated";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Data accepted by `create()`: any subset of `T`'s fields, but
|
|
36
|
+
* never the system fields. Unknown/extra keys are rejected at compile
|
|
37
|
+
* time via excess-property checking (object literals).
|
|
38
|
+
*/
|
|
39
|
+
export type CreateData<T> = Partial<Omit<T, SystemFields>>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Data accepted by `update()`: any subset of `T`'s fields.
|
|
43
|
+
* Unknown/extra keys are rejected at compile time.
|
|
44
|
+
*/
|
|
45
|
+
export type UpdateData<T> = Partial<Omit<T, SystemFields>>;
|
|
46
|
+
|
|
13
47
|
/** Paginated list response matching PocketBase format. */
|
|
14
48
|
export interface ListResult<T = ApiRecord> {
|
|
15
49
|
items: T[];
|