@01.software/sdk 0.5.10 → 0.6.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/README.md +12 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -96,6 +96,16 @@ interface ApiQueryOptions {
|
|
|
96
96
|
where?: Where;
|
|
97
97
|
depth?: number;
|
|
98
98
|
select?: Record<string, boolean>;
|
|
99
|
+
/** Per-collection field selection for populated relationships (keyed by collection slug) */
|
|
100
|
+
populate?: Record<string, boolean | Record<string, boolean>>;
|
|
101
|
+
/** Join field control: pagination/filter per join, or false to disable */
|
|
102
|
+
joins?: Record<string, {
|
|
103
|
+
limit?: number;
|
|
104
|
+
page?: number;
|
|
105
|
+
sort?: string;
|
|
106
|
+
where?: Where;
|
|
107
|
+
count?: boolean;
|
|
108
|
+
} | false> | false;
|
|
99
109
|
}
|
|
100
110
|
interface DebugConfig {
|
|
101
111
|
logRequests?: boolean;
|
|
@@ -466,7 +476,7 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
466
476
|
* GET /api/{collection}/{id}
|
|
467
477
|
* @returns Document object directly (no wrapper)
|
|
468
478
|
*/
|
|
469
|
-
findById(id: string, options?: ApiQueryOptions): Promise<CollectionType<T>>;
|
|
479
|
+
findById(id: string | number, options?: ApiQueryOptions): Promise<CollectionType<T>>;
|
|
470
480
|
/**
|
|
471
481
|
* Create a new document
|
|
472
482
|
* POST /api/{collection}
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,16 @@ interface ApiQueryOptions {
|
|
|
96
96
|
where?: Where;
|
|
97
97
|
depth?: number;
|
|
98
98
|
select?: Record<string, boolean>;
|
|
99
|
+
/** Per-collection field selection for populated relationships (keyed by collection slug) */
|
|
100
|
+
populate?: Record<string, boolean | Record<string, boolean>>;
|
|
101
|
+
/** Join field control: pagination/filter per join, or false to disable */
|
|
102
|
+
joins?: Record<string, {
|
|
103
|
+
limit?: number;
|
|
104
|
+
page?: number;
|
|
105
|
+
sort?: string;
|
|
106
|
+
where?: Where;
|
|
107
|
+
count?: boolean;
|
|
108
|
+
} | false> | false;
|
|
99
109
|
}
|
|
100
110
|
interface DebugConfig {
|
|
101
111
|
logRequests?: boolean;
|
|
@@ -466,7 +476,7 @@ declare class CollectionQueryBuilder<T extends PublicCollection> {
|
|
|
466
476
|
* GET /api/{collection}/{id}
|
|
467
477
|
* @returns Document object directly (no wrapper)
|
|
468
478
|
*/
|
|
469
|
-
findById(id: string, options?: ApiQueryOptions): Promise<CollectionType<T>>;
|
|
479
|
+
findById(id: string | number, options?: ApiQueryOptions): Promise<CollectionType<T>>;
|
|
470
480
|
/**
|
|
471
481
|
* Create a new document
|
|
472
482
|
* POST /api/{collection}
|
package/dist/index.js
CHANGED
|
@@ -740,7 +740,7 @@ var CollectionQueryBuilder = class {
|
|
|
740
740
|
async find(options) {
|
|
741
741
|
return this.api.requestFind(
|
|
742
742
|
`/api/${String(this.collection)}`,
|
|
743
|
-
options
|
|
743
|
+
{ depth: 1, ...options }
|
|
744
744
|
);
|
|
745
745
|
}
|
|
746
746
|
/**
|
|
@@ -751,7 +751,7 @@ var CollectionQueryBuilder = class {
|
|
|
751
751
|
async findById(id, options) {
|
|
752
752
|
return this.api.requestFindById(
|
|
753
753
|
`/api/${String(this.collection)}/${String(id)}`,
|
|
754
|
-
options
|
|
754
|
+
{ depth: 1, ...options }
|
|
755
755
|
);
|
|
756
756
|
}
|
|
757
757
|
/**
|