lazypock 0.1.2 → 0.1.5
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 +44 -42
- package/dist/{chunk-3MZJ5HCD.js → chunk-Y6PMBL2S.js} +7 -5
- package/dist/{chunk-3MZJ5HCD.js.map → chunk-Y6PMBL2S.js.map} +1 -1
- package/dist/cli.cjs +9 -7
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.global.js +9 -7
- package/dist/cli.global.js.map +1 -1
- package/dist/cli.js +4 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +189 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +98 -78
- package/dist/index.d.ts +98 -78
- package/dist/index.global.js +188 -133
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +183 -130
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +7 -4
- package/src/codegen.ts +6 -4
- package/src/collection.ts +64 -10
- package/src/collections.ts +200 -0
- package/src/index.ts +2 -0
- package/src/lazypock.ts +5 -170
package/dist/index.d.cts
CHANGED
|
@@ -288,11 +288,27 @@ declare class CollectionService<T = ApiRecord> {
|
|
|
288
288
|
constructor(http: HttpClient, collectionName: string, authStore?: AuthStore, realtime?: RealtimeService);
|
|
289
289
|
private encodeId;
|
|
290
290
|
/**
|
|
291
|
-
*
|
|
292
|
-
*
|
|
291
|
+
* Fetch a paginated list of records (PocketBase `getList`).
|
|
292
|
+
*
|
|
293
|
+
* @param page Page number (default 1).
|
|
294
|
+
* @param perPage Records per page (default 30).
|
|
295
|
+
* @param options Query params (`filter`, `sort`, `expand`, `fields`) + request options.
|
|
296
|
+
*/
|
|
297
|
+
getList<T2 = T>(page?: number, perPage?: number, options?: Record<string, unknown> & RequestOptions): Promise<ListResult<T2> | null>;
|
|
298
|
+
/**
|
|
299
|
+
* Fetch all records at once (auto-paginates). Mirrors PocketBase's
|
|
300
|
+
* `pb.collection(name).getFullList()`.
|
|
301
|
+
*
|
|
302
|
+
* @param options Query params (`sort`, `filter`, `batch`, etc.) + request options.
|
|
303
|
+
*/
|
|
304
|
+
getFullList<T2 = T>(options?: Record<string, unknown> & RequestOptions): Promise<Array<T2>>;
|
|
305
|
+
/**
|
|
306
|
+
* Fetch the first record matching a filter (PocketBase `getFirstListItem`).
|
|
307
|
+
*
|
|
308
|
+
* @param filter Filter expression (e.g. `title = 'x'`).
|
|
293
309
|
* @param options Optional request options.
|
|
294
310
|
*/
|
|
295
|
-
|
|
311
|
+
getFirstListItem<T2 = T>(filter: string, options?: RequestOptions): Promise<T2 | null>;
|
|
296
312
|
/**
|
|
297
313
|
* Get a single record by ID.
|
|
298
314
|
* @param id Record ID.
|
|
@@ -432,6 +448,82 @@ declare class FilesService {
|
|
|
432
448
|
delete(fileId: string, options?: RequestOptions): Promise<null>;
|
|
433
449
|
}
|
|
434
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Registry-level realtime events for the collections admin channel.
|
|
453
|
+
* The backend (AdminChannel) broadcasts the action as the *event name*,
|
|
454
|
+
* with the collection JSON as the payload.
|
|
455
|
+
*/
|
|
456
|
+
interface CollectionsMessage {
|
|
457
|
+
action: "create" | "update" | "delete";
|
|
458
|
+
/** The collection payload (id + metadata), or {} when unavailable. */
|
|
459
|
+
collection: Record<string, unknown>;
|
|
460
|
+
topic?: string;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Registry service for collections (list/create/update/delete + realtime
|
|
464
|
+
* registry events). Mirrors PocketBase's `pb.collections`.
|
|
465
|
+
*/
|
|
466
|
+
declare class CollectionsService {
|
|
467
|
+
private http?;
|
|
468
|
+
private realtime?;
|
|
469
|
+
/** @internal */
|
|
470
|
+
constructor(http?: HttpClient, realtime?: RealtimeService);
|
|
471
|
+
/**
|
|
472
|
+
* Fetch a paginated list of collections (admin).
|
|
473
|
+
*
|
|
474
|
+
* @param params Optional query params (`page`, `perPage`, `filter`, `sort`).
|
|
475
|
+
* @param options Optional request options.
|
|
476
|
+
*/
|
|
477
|
+
getList<T = ApiRecord>(params?: Record<string, unknown>, options?: RequestOptions): Promise<ListResult<T> | null>;
|
|
478
|
+
/**
|
|
479
|
+
* Fetch all collections at once (auto-paginates). Mirrors PocketBase's
|
|
480
|
+
* `pb.collections.getFullList()` — defaults to listing everything.
|
|
481
|
+
*
|
|
482
|
+
* @param options Query params (`sort`, `batch`, etc.) or request options.
|
|
483
|
+
*/
|
|
484
|
+
getFullList<T = ApiRecord>(options?: Record<string, unknown> & RequestOptions): Promise<Array<T>>;
|
|
485
|
+
/**
|
|
486
|
+
* Get a single collection by ID or name (admin).
|
|
487
|
+
*
|
|
488
|
+
* @param id Collection ID or name.
|
|
489
|
+
* @param options Optional request options.
|
|
490
|
+
*/
|
|
491
|
+
getOne<T = ApiRecord>(id: string, options?: RequestOptions): Promise<T | null>;
|
|
492
|
+
/**
|
|
493
|
+
* Create a new collection (admin).
|
|
494
|
+
*
|
|
495
|
+
* @param data Collection definition (name, type, fields, options, rules, etc.).
|
|
496
|
+
* @param options Optional request options.
|
|
497
|
+
*/
|
|
498
|
+
create<T = ApiRecord>(data: Record<string, unknown>, options?: RequestOptions): Promise<T | null>;
|
|
499
|
+
/**
|
|
500
|
+
* Update an existing collection (admin).
|
|
501
|
+
*
|
|
502
|
+
* @param id Collection ID or name.
|
|
503
|
+
* @param data Updated collection fields.
|
|
504
|
+
* @param options Optional request options.
|
|
505
|
+
*/
|
|
506
|
+
update<T = ApiRecord>(id: string, data: Record<string, unknown>, options?: RequestOptions): Promise<T | null>;
|
|
507
|
+
/**
|
|
508
|
+
* Delete a collection (admin).
|
|
509
|
+
*
|
|
510
|
+
* @param id Collection ID or name.
|
|
511
|
+
* @param options Optional request options.
|
|
512
|
+
*/
|
|
513
|
+
delete(id: string, options?: RequestOptions): Promise<boolean>;
|
|
514
|
+
/**
|
|
515
|
+
* Subscribe to collection registry changes.
|
|
516
|
+
*
|
|
517
|
+
* @param callback Received on every collection create/update/delete.
|
|
518
|
+
* @returns A function that unsubscribes this callback.
|
|
519
|
+
*/
|
|
520
|
+
subscribe(callback: (e: CollectionsMessage) => void): () => void;
|
|
521
|
+
/**
|
|
522
|
+
* Unsubscribe all callbacks from the registry channel.
|
|
523
|
+
*/
|
|
524
|
+
unsubscribe(): void;
|
|
525
|
+
}
|
|
526
|
+
|
|
435
527
|
/** A single field definition as returned by `GET /collections`. */
|
|
436
528
|
interface SchemaField {
|
|
437
529
|
id?: string;
|
|
@@ -534,13 +626,14 @@ interface LazypockClientOptions {
|
|
|
534
626
|
* ```ts
|
|
535
627
|
* const client = new LazypockClient({ baseUrl: 'http://localhost:4000/api' });
|
|
536
628
|
* await client.login('admin@example.com', 'password');
|
|
537
|
-
* const posts = await client.collection('posts').
|
|
629
|
+
* const posts = await client.collection('posts').getList();
|
|
538
630
|
* ```
|
|
539
631
|
*/
|
|
540
632
|
declare class LazypockClient {
|
|
541
633
|
readonly http: HttpClient;
|
|
542
634
|
readonly authStore: AuthStore;
|
|
543
635
|
readonly realtime: RealtimeService;
|
|
636
|
+
readonly collections: CollectionsService;
|
|
544
637
|
readonly files: FilesService;
|
|
545
638
|
private collectionCache;
|
|
546
639
|
private schemaByName?;
|
|
@@ -635,79 +728,6 @@ declare class LazypockClient {
|
|
|
635
728
|
logout(): void;
|
|
636
729
|
/** Ping the API health endpoint. */
|
|
637
730
|
health(options?: RequestOptions): Promise<Record<string, unknown> | null>;
|
|
638
|
-
/**
|
|
639
|
-
* List all collections (admin).
|
|
640
|
-
* @param q URL query string (e.g. `page=1&perPage=200`).
|
|
641
|
-
* @param options Optional request options.
|
|
642
|
-
*/
|
|
643
|
-
listCollections(q?: string, options?: RequestOptions): Promise<ListResult<ApiRecord> | null>;
|
|
644
|
-
/**
|
|
645
|
-
* Get a single collection by ID or name.
|
|
646
|
-
* @param id Collection ID or name.
|
|
647
|
-
* @param options Optional request options.
|
|
648
|
-
*/
|
|
649
|
-
getCollection(id: string, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
650
|
-
/**
|
|
651
|
-
* Create a new collection (admin).
|
|
652
|
-
* @param data Collection definition (name, type, fields, options, rules, etc.).
|
|
653
|
-
* @param options Optional request options.
|
|
654
|
-
*/
|
|
655
|
-
createCollection(data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
656
|
-
/**
|
|
657
|
-
* Update an existing collection (admin).
|
|
658
|
-
* @param id Collection ID or name.
|
|
659
|
-
* @param data Updated collection fields.
|
|
660
|
-
* @param options Optional request options.
|
|
661
|
-
*/
|
|
662
|
-
updateCollection(id: string, data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
663
|
-
/**
|
|
664
|
-
* Delete a collection (admin).
|
|
665
|
-
* @param id Collection ID or name.
|
|
666
|
-
* @param options Optional request options.
|
|
667
|
-
*/
|
|
668
|
-
deleteCollection(id: string, options?: RequestOptions): Promise<null>;
|
|
669
|
-
/**
|
|
670
|
-
* List records from a dynamic collection with optional filter/sort/pagination.
|
|
671
|
-
*
|
|
672
|
-
* @param coll Collection name.
|
|
673
|
-
* @param params Query parameters including:
|
|
674
|
-
* - `filter` — PocketBase filter syntax (e.g. `title~'hello' && published=true`)
|
|
675
|
-
* - `sort` — Comma-separated, `-` prefix for DESC (e.g. `-created,title`)
|
|
676
|
-
* - `page` — Page number (default: 1)
|
|
677
|
-
* - `perPage` — Items per page (default: 30, max: 200)
|
|
678
|
-
* - `expand` — Comma-separated relation fields (e.g. `author,category`)
|
|
679
|
-
* @param options Optional request options.
|
|
680
|
-
*/
|
|
681
|
-
listRecords(coll: string, params?: Record<string, string>, options?: RequestOptions): Promise<ListResult<ApiRecord> | null>;
|
|
682
|
-
/**
|
|
683
|
-
* Get a single record by ID.
|
|
684
|
-
* @param coll Collection name.
|
|
685
|
-
* @param id Record ID.
|
|
686
|
-
* @param options Optional request options.
|
|
687
|
-
*/
|
|
688
|
-
getRecord(coll: string, id: string, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
689
|
-
/**
|
|
690
|
-
* Create a record in a dynamic collection.
|
|
691
|
-
* @param coll Collection name.
|
|
692
|
-
* @param data Record fields.
|
|
693
|
-
* @param options Optional request options.
|
|
694
|
-
*/
|
|
695
|
-
createRecord(coll: string, data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
696
|
-
/**
|
|
697
|
-
* Update a record in a dynamic collection.
|
|
698
|
-
* @param coll Collection name.
|
|
699
|
-
* @param id Record ID.
|
|
700
|
-
* @param data Updated record fields.
|
|
701
|
-
* @param options Optional request options.
|
|
702
|
-
*/
|
|
703
|
-
updateRecord(coll: string, id: string, data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
704
|
-
/**
|
|
705
|
-
* Delete a record from a dynamic collection.
|
|
706
|
-
* @param coll Collection name.
|
|
707
|
-
* @param id Record ID.
|
|
708
|
-
* @param options Optional request options.
|
|
709
|
-
*/
|
|
710
|
-
deleteRecord(coll: string, id: string, options?: RequestOptions): Promise<null>;
|
|
711
731
|
}
|
|
712
732
|
|
|
713
733
|
/**
|
|
@@ -738,4 +758,4 @@ declare class TypedClient<TCollections extends LazypockCollections = LazypockCol
|
|
|
738
758
|
*/
|
|
739
759
|
declare function createClient<TCollections extends LazypockCollections = LazypockCollections>(options: LazypockClientOptions): TypedClient<TCollections>;
|
|
740
760
|
|
|
741
|
-
export { ApiError, type ApiRecord, type AuthModel, AuthStore, type CollectionSchema, CollectionService, type CreateData, type FileRecord, FilesService, LazypockClient, type LazypockClientOptions, type LazypockCollections, type ListResult, type RealtimeCallback, type RealtimeMessage, RealtimeService, type RecordShape, type RequestOptions, type SchemaField, type StorageAdapter, type SystemFields, TypedClient, type UpdateData, collectionTypeName, createClient, fieldTypeKind, fieldTypeScriptType, generateTypes, getFileUrl, schemaFieldType, wsUrlFromBaseUrl };
|
|
761
|
+
export { ApiError, type ApiRecord, type AuthModel, AuthStore, type CollectionSchema, CollectionService, type CollectionsMessage, CollectionsService, type CreateData, type FileRecord, FilesService, LazypockClient, type LazypockClientOptions, type LazypockCollections, type ListResult, type RealtimeCallback, type RealtimeMessage, RealtimeService, type RecordShape, type RequestOptions, type SchemaField, type StorageAdapter, type SystemFields, TypedClient, type UpdateData, collectionTypeName, createClient, fieldTypeKind, fieldTypeScriptType, generateTypes, getFileUrl, schemaFieldType, wsUrlFromBaseUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -288,11 +288,27 @@ declare class CollectionService<T = ApiRecord> {
|
|
|
288
288
|
constructor(http: HttpClient, collectionName: string, authStore?: AuthStore, realtime?: RealtimeService);
|
|
289
289
|
private encodeId;
|
|
290
290
|
/**
|
|
291
|
-
*
|
|
292
|
-
*
|
|
291
|
+
* Fetch a paginated list of records (PocketBase `getList`).
|
|
292
|
+
*
|
|
293
|
+
* @param page Page number (default 1).
|
|
294
|
+
* @param perPage Records per page (default 30).
|
|
295
|
+
* @param options Query params (`filter`, `sort`, `expand`, `fields`) + request options.
|
|
296
|
+
*/
|
|
297
|
+
getList<T2 = T>(page?: number, perPage?: number, options?: Record<string, unknown> & RequestOptions): Promise<ListResult<T2> | null>;
|
|
298
|
+
/**
|
|
299
|
+
* Fetch all records at once (auto-paginates). Mirrors PocketBase's
|
|
300
|
+
* `pb.collection(name).getFullList()`.
|
|
301
|
+
*
|
|
302
|
+
* @param options Query params (`sort`, `filter`, `batch`, etc.) + request options.
|
|
303
|
+
*/
|
|
304
|
+
getFullList<T2 = T>(options?: Record<string, unknown> & RequestOptions): Promise<Array<T2>>;
|
|
305
|
+
/**
|
|
306
|
+
* Fetch the first record matching a filter (PocketBase `getFirstListItem`).
|
|
307
|
+
*
|
|
308
|
+
* @param filter Filter expression (e.g. `title = 'x'`).
|
|
293
309
|
* @param options Optional request options.
|
|
294
310
|
*/
|
|
295
|
-
|
|
311
|
+
getFirstListItem<T2 = T>(filter: string, options?: RequestOptions): Promise<T2 | null>;
|
|
296
312
|
/**
|
|
297
313
|
* Get a single record by ID.
|
|
298
314
|
* @param id Record ID.
|
|
@@ -432,6 +448,82 @@ declare class FilesService {
|
|
|
432
448
|
delete(fileId: string, options?: RequestOptions): Promise<null>;
|
|
433
449
|
}
|
|
434
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Registry-level realtime events for the collections admin channel.
|
|
453
|
+
* The backend (AdminChannel) broadcasts the action as the *event name*,
|
|
454
|
+
* with the collection JSON as the payload.
|
|
455
|
+
*/
|
|
456
|
+
interface CollectionsMessage {
|
|
457
|
+
action: "create" | "update" | "delete";
|
|
458
|
+
/** The collection payload (id + metadata), or {} when unavailable. */
|
|
459
|
+
collection: Record<string, unknown>;
|
|
460
|
+
topic?: string;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Registry service for collections (list/create/update/delete + realtime
|
|
464
|
+
* registry events). Mirrors PocketBase's `pb.collections`.
|
|
465
|
+
*/
|
|
466
|
+
declare class CollectionsService {
|
|
467
|
+
private http?;
|
|
468
|
+
private realtime?;
|
|
469
|
+
/** @internal */
|
|
470
|
+
constructor(http?: HttpClient, realtime?: RealtimeService);
|
|
471
|
+
/**
|
|
472
|
+
* Fetch a paginated list of collections (admin).
|
|
473
|
+
*
|
|
474
|
+
* @param params Optional query params (`page`, `perPage`, `filter`, `sort`).
|
|
475
|
+
* @param options Optional request options.
|
|
476
|
+
*/
|
|
477
|
+
getList<T = ApiRecord>(params?: Record<string, unknown>, options?: RequestOptions): Promise<ListResult<T> | null>;
|
|
478
|
+
/**
|
|
479
|
+
* Fetch all collections at once (auto-paginates). Mirrors PocketBase's
|
|
480
|
+
* `pb.collections.getFullList()` — defaults to listing everything.
|
|
481
|
+
*
|
|
482
|
+
* @param options Query params (`sort`, `batch`, etc.) or request options.
|
|
483
|
+
*/
|
|
484
|
+
getFullList<T = ApiRecord>(options?: Record<string, unknown> & RequestOptions): Promise<Array<T>>;
|
|
485
|
+
/**
|
|
486
|
+
* Get a single collection by ID or name (admin).
|
|
487
|
+
*
|
|
488
|
+
* @param id Collection ID or name.
|
|
489
|
+
* @param options Optional request options.
|
|
490
|
+
*/
|
|
491
|
+
getOne<T = ApiRecord>(id: string, options?: RequestOptions): Promise<T | null>;
|
|
492
|
+
/**
|
|
493
|
+
* Create a new collection (admin).
|
|
494
|
+
*
|
|
495
|
+
* @param data Collection definition (name, type, fields, options, rules, etc.).
|
|
496
|
+
* @param options Optional request options.
|
|
497
|
+
*/
|
|
498
|
+
create<T = ApiRecord>(data: Record<string, unknown>, options?: RequestOptions): Promise<T | null>;
|
|
499
|
+
/**
|
|
500
|
+
* Update an existing collection (admin).
|
|
501
|
+
*
|
|
502
|
+
* @param id Collection ID or name.
|
|
503
|
+
* @param data Updated collection fields.
|
|
504
|
+
* @param options Optional request options.
|
|
505
|
+
*/
|
|
506
|
+
update<T = ApiRecord>(id: string, data: Record<string, unknown>, options?: RequestOptions): Promise<T | null>;
|
|
507
|
+
/**
|
|
508
|
+
* Delete a collection (admin).
|
|
509
|
+
*
|
|
510
|
+
* @param id Collection ID or name.
|
|
511
|
+
* @param options Optional request options.
|
|
512
|
+
*/
|
|
513
|
+
delete(id: string, options?: RequestOptions): Promise<boolean>;
|
|
514
|
+
/**
|
|
515
|
+
* Subscribe to collection registry changes.
|
|
516
|
+
*
|
|
517
|
+
* @param callback Received on every collection create/update/delete.
|
|
518
|
+
* @returns A function that unsubscribes this callback.
|
|
519
|
+
*/
|
|
520
|
+
subscribe(callback: (e: CollectionsMessage) => void): () => void;
|
|
521
|
+
/**
|
|
522
|
+
* Unsubscribe all callbacks from the registry channel.
|
|
523
|
+
*/
|
|
524
|
+
unsubscribe(): void;
|
|
525
|
+
}
|
|
526
|
+
|
|
435
527
|
/** A single field definition as returned by `GET /collections`. */
|
|
436
528
|
interface SchemaField {
|
|
437
529
|
id?: string;
|
|
@@ -534,13 +626,14 @@ interface LazypockClientOptions {
|
|
|
534
626
|
* ```ts
|
|
535
627
|
* const client = new LazypockClient({ baseUrl: 'http://localhost:4000/api' });
|
|
536
628
|
* await client.login('admin@example.com', 'password');
|
|
537
|
-
* const posts = await client.collection('posts').
|
|
629
|
+
* const posts = await client.collection('posts').getList();
|
|
538
630
|
* ```
|
|
539
631
|
*/
|
|
540
632
|
declare class LazypockClient {
|
|
541
633
|
readonly http: HttpClient;
|
|
542
634
|
readonly authStore: AuthStore;
|
|
543
635
|
readonly realtime: RealtimeService;
|
|
636
|
+
readonly collections: CollectionsService;
|
|
544
637
|
readonly files: FilesService;
|
|
545
638
|
private collectionCache;
|
|
546
639
|
private schemaByName?;
|
|
@@ -635,79 +728,6 @@ declare class LazypockClient {
|
|
|
635
728
|
logout(): void;
|
|
636
729
|
/** Ping the API health endpoint. */
|
|
637
730
|
health(options?: RequestOptions): Promise<Record<string, unknown> | null>;
|
|
638
|
-
/**
|
|
639
|
-
* List all collections (admin).
|
|
640
|
-
* @param q URL query string (e.g. `page=1&perPage=200`).
|
|
641
|
-
* @param options Optional request options.
|
|
642
|
-
*/
|
|
643
|
-
listCollections(q?: string, options?: RequestOptions): Promise<ListResult<ApiRecord> | null>;
|
|
644
|
-
/**
|
|
645
|
-
* Get a single collection by ID or name.
|
|
646
|
-
* @param id Collection ID or name.
|
|
647
|
-
* @param options Optional request options.
|
|
648
|
-
*/
|
|
649
|
-
getCollection(id: string, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
650
|
-
/**
|
|
651
|
-
* Create a new collection (admin).
|
|
652
|
-
* @param data Collection definition (name, type, fields, options, rules, etc.).
|
|
653
|
-
* @param options Optional request options.
|
|
654
|
-
*/
|
|
655
|
-
createCollection(data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
656
|
-
/**
|
|
657
|
-
* Update an existing collection (admin).
|
|
658
|
-
* @param id Collection ID or name.
|
|
659
|
-
* @param data Updated collection fields.
|
|
660
|
-
* @param options Optional request options.
|
|
661
|
-
*/
|
|
662
|
-
updateCollection(id: string, data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
663
|
-
/**
|
|
664
|
-
* Delete a collection (admin).
|
|
665
|
-
* @param id Collection ID or name.
|
|
666
|
-
* @param options Optional request options.
|
|
667
|
-
*/
|
|
668
|
-
deleteCollection(id: string, options?: RequestOptions): Promise<null>;
|
|
669
|
-
/**
|
|
670
|
-
* List records from a dynamic collection with optional filter/sort/pagination.
|
|
671
|
-
*
|
|
672
|
-
* @param coll Collection name.
|
|
673
|
-
* @param params Query parameters including:
|
|
674
|
-
* - `filter` — PocketBase filter syntax (e.g. `title~'hello' && published=true`)
|
|
675
|
-
* - `sort` — Comma-separated, `-` prefix for DESC (e.g. `-created,title`)
|
|
676
|
-
* - `page` — Page number (default: 1)
|
|
677
|
-
* - `perPage` — Items per page (default: 30, max: 200)
|
|
678
|
-
* - `expand` — Comma-separated relation fields (e.g. `author,category`)
|
|
679
|
-
* @param options Optional request options.
|
|
680
|
-
*/
|
|
681
|
-
listRecords(coll: string, params?: Record<string, string>, options?: RequestOptions): Promise<ListResult<ApiRecord> | null>;
|
|
682
|
-
/**
|
|
683
|
-
* Get a single record by ID.
|
|
684
|
-
* @param coll Collection name.
|
|
685
|
-
* @param id Record ID.
|
|
686
|
-
* @param options Optional request options.
|
|
687
|
-
*/
|
|
688
|
-
getRecord(coll: string, id: string, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
689
|
-
/**
|
|
690
|
-
* Create a record in a dynamic collection.
|
|
691
|
-
* @param coll Collection name.
|
|
692
|
-
* @param data Record fields.
|
|
693
|
-
* @param options Optional request options.
|
|
694
|
-
*/
|
|
695
|
-
createRecord(coll: string, data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
696
|
-
/**
|
|
697
|
-
* Update a record in a dynamic collection.
|
|
698
|
-
* @param coll Collection name.
|
|
699
|
-
* @param id Record ID.
|
|
700
|
-
* @param data Updated record fields.
|
|
701
|
-
* @param options Optional request options.
|
|
702
|
-
*/
|
|
703
|
-
updateRecord(coll: string, id: string, data: Record<string, unknown>, options?: RequestOptions): Promise<ApiRecord | null>;
|
|
704
|
-
/**
|
|
705
|
-
* Delete a record from a dynamic collection.
|
|
706
|
-
* @param coll Collection name.
|
|
707
|
-
* @param id Record ID.
|
|
708
|
-
* @param options Optional request options.
|
|
709
|
-
*/
|
|
710
|
-
deleteRecord(coll: string, id: string, options?: RequestOptions): Promise<null>;
|
|
711
731
|
}
|
|
712
732
|
|
|
713
733
|
/**
|
|
@@ -738,4 +758,4 @@ declare class TypedClient<TCollections extends LazypockCollections = LazypockCol
|
|
|
738
758
|
*/
|
|
739
759
|
declare function createClient<TCollections extends LazypockCollections = LazypockCollections>(options: LazypockClientOptions): TypedClient<TCollections>;
|
|
740
760
|
|
|
741
|
-
export { ApiError, type ApiRecord, type AuthModel, AuthStore, type CollectionSchema, CollectionService, type CreateData, type FileRecord, FilesService, LazypockClient, type LazypockClientOptions, type LazypockCollections, type ListResult, type RealtimeCallback, type RealtimeMessage, RealtimeService, type RecordShape, type RequestOptions, type SchemaField, type StorageAdapter, type SystemFields, TypedClient, type UpdateData, collectionTypeName, createClient, fieldTypeKind, fieldTypeScriptType, generateTypes, getFileUrl, schemaFieldType, wsUrlFromBaseUrl };
|
|
761
|
+
export { ApiError, type ApiRecord, type AuthModel, AuthStore, type CollectionSchema, CollectionService, type CollectionsMessage, CollectionsService, type CreateData, type FileRecord, FilesService, LazypockClient, type LazypockClientOptions, type LazypockCollections, type ListResult, type RealtimeCallback, type RealtimeMessage, RealtimeService, type RecordShape, type RequestOptions, type SchemaField, type StorageAdapter, type SystemFields, TypedClient, type UpdateData, collectionTypeName, createClient, fieldTypeKind, fieldTypeScriptType, generateTypes, getFileUrl, schemaFieldType, wsUrlFromBaseUrl };
|