@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @objectstack/client@3.0.9 build /home/runner/work/spec/spec/packages/client
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
  CLI Building entry: src/index.ts
@@ -10,13 +10,13 @@
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/index.mjs 51.81 KB
14
- ESM dist/index.mjs.map 103.43 KB
15
- ESM ⚡️ Build success in 66ms
16
- CJS dist/index.js 52.96 KB
17
- CJS dist/index.js.map 103.49 KB
18
- CJS ⚡️ Build success in 66ms
13
+ CJS dist/index.js 53.17 KB
14
+ CJS dist/index.js.map 104.24 KB
15
+ CJS ⚡️ Build success in 76ms
16
+ ESM dist/index.mjs 52.00 KB
17
+ ESM dist/index.mjs.map 104.19 KB
18
+ ESM ⚡️ Build success in 80ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 5282ms
21
- DTS dist/index.d.mts 30.42 KB
22
- DTS dist/index.d.ts 30.42 KB
20
+ DTS ⚡️ Build success in 5202ms
21
+ DTS dist/index.d.mts 30.61 KB
22
+ DTS dist/index.d.ts 30.61 KB
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
- filters?: Record<string, any>;
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
- filters?: Record<string, any>;
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
- if (options.filters) {
1363
- if (this.isFilterAST(options.filters)) {
1364
- queryParams.set("filters", JSON.stringify(options.filters));
1365
- } else {
1366
- Object.entries(options.filters).forEach(([k, v]) => {
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 Array.isArray(filter);
1535
+ return (0, import_data.isFilterAST)(filter);
1534
1536
  }
1535
1537
  /**
1536
1538
  * Unwrap the standard REST API response envelope.