@objectstack/client 3.0.9 → 3.0.11
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/client.msw.test.ts +4 -2
- package/src/index.ts +19 -12
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/client@3.0.
|
|
2
|
+
> @objectstack/client@3.0.11 build /home/runner/work/spec/spec/packages/client
|
|
3
3
|
> tsup --config ../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m53.17 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m104.24 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 76ms
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m52.00 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m104.19 KB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 80ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m30.
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m30.
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 5202ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m30.61 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m30.61 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @objectstack/client
|
|
2
2
|
|
|
3
|
+
## 3.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [92d9d99]
|
|
8
|
+
- @objectstack/spec@3.0.11
|
|
9
|
+
- @objectstack/core@3.0.11
|
|
10
|
+
|
|
11
|
+
## 3.0.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [d1e5d31]
|
|
16
|
+
- @objectstack/spec@3.0.10
|
|
17
|
+
- @objectstack/core@3.0.10
|
|
18
|
+
|
|
3
19
|
## 3.0.9
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -190,7 +190,10 @@ interface ClientConfig {
|
|
|
190
190
|
type DiscoveryResult = GetDiscoveryResponse;
|
|
191
191
|
interface QueryOptions {
|
|
192
192
|
select?: string[];
|
|
193
|
-
|
|
193
|
+
/** @canonical Preferred filter parameter (singular). */
|
|
194
|
+
filter?: Record<string, any> | unknown[];
|
|
195
|
+
/** @deprecated Use `filter` (singular). Kept for backward compatibility. */
|
|
196
|
+
filters?: Record<string, any> | unknown[];
|
|
194
197
|
sort?: string | string[] | SortNode[];
|
|
195
198
|
top?: number;
|
|
196
199
|
skip?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -190,7 +190,10 @@ interface ClientConfig {
|
|
|
190
190
|
type DiscoveryResult = GetDiscoveryResponse;
|
|
191
191
|
interface QueryOptions {
|
|
192
192
|
select?: string[];
|
|
193
|
-
|
|
193
|
+
/** @canonical Preferred filter parameter (singular). */
|
|
194
|
+
filter?: Record<string, any> | unknown[];
|
|
195
|
+
/** @deprecated Use `filter` (singular). Kept for backward compatibility. */
|
|
196
|
+
filters?: Record<string, any> | unknown[];
|
|
194
197
|
sort?: string | string[] | SortNode[];
|
|
195
198
|
top?: number;
|
|
196
199
|
skip?: number;
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
createQuery: () => createQuery
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
var import_data = require("@objectstack/spec/data");
|
|
30
31
|
var import_core = require("@objectstack/core");
|
|
31
32
|
|
|
32
33
|
// src/query-builder.ts
|
|
@@ -1359,11 +1360,12 @@ var ObjectStackClient = class {
|
|
|
1359
1360
|
if (options.select) {
|
|
1360
1361
|
queryParams.set("select", options.select.join(","));
|
|
1361
1362
|
}
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1363
|
+
const filterValue = options.filter ?? options.filters;
|
|
1364
|
+
if (filterValue) {
|
|
1365
|
+
if (this.isFilterAST(filterValue) || Array.isArray(filterValue)) {
|
|
1366
|
+
queryParams.set("filter", JSON.stringify(filterValue));
|
|
1367
|
+
} else if (typeof filterValue === "object" && filterValue !== null) {
|
|
1368
|
+
Object.entries(filterValue).forEach(([k, v]) => {
|
|
1367
1369
|
if (v !== void 0 && v !== null) {
|
|
1368
1370
|
queryParams.append(k, String(v));
|
|
1369
1371
|
}
|
|
@@ -1530,7 +1532,7 @@ var ObjectStackClient = class {
|
|
|
1530
1532
|
* Private Helpers
|
|
1531
1533
|
*/
|
|
1532
1534
|
isFilterAST(filter) {
|
|
1533
|
-
return
|
|
1535
|
+
return (0, import_data.isFilterAST)(filter);
|
|
1534
1536
|
}
|
|
1535
1537
|
/**
|
|
1536
1538
|
* Unwrap the standard REST API response envelope.
|