@uniformdev/canvas 20.49.3 → 20.49.4-alpha.102

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/dist/index.esm.js CHANGED
@@ -380,7 +380,7 @@ var require_retry2 = __commonJS({
380
380
  });
381
381
 
382
382
  // src/CanvasClient.ts
383
- import { ApiClient } from "@uniformdev/context/api";
383
+ import { ApiClient, rewriteFiltersForApi } from "@uniformdev/context/api";
384
384
 
385
385
  // src/enhancement/createLimitPolicy.ts
386
386
  var import_p_limit = __toESM(require_p_limit());
@@ -584,22 +584,6 @@ function createLimitPolicy({
584
584
  }
585
585
  var nullLimitPolicy = async (func) => await func();
586
586
 
587
- // src/utils/rewriteFilters.ts
588
- var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
589
- function rewriteFilters(filters) {
590
- return Object.entries(filters != null ? filters : {}).reduce(
591
- (acc, [key, value]) => {
592
- const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
593
- const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
594
- return {
595
- ...acc,
596
- [lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
597
- };
598
- },
599
- {}
600
- );
601
- }
602
-
603
587
  // src/CanvasClient.ts
604
588
  var CANVAS_URL = "/api/v1/canvas";
605
589
  var CanvasClient = class extends ApiClient {
@@ -616,7 +600,7 @@ var CanvasClient = class extends ApiClient {
616
600
  async getCompositionList(params = {}) {
617
601
  const { projectId } = this.options;
618
602
  const { resolveData, filters, ...originParams } = params;
619
- const rewrittenFilters = rewriteFilters(filters);
603
+ const rewrittenFilters = rewriteFiltersForApi(filters);
620
604
  if (!resolveData) {
621
605
  const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
622
606
  return this.apiClient(fetchUri);
@@ -770,7 +754,7 @@ var UncachedCategoryClient = class extends CategoryClient {
770
754
  };
771
755
 
772
756
  // src/ContentClient.ts
773
- import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
757
+ import { ApiClient as ApiClient3, rewriteFiltersForApi as rewriteFiltersForApi2 } from "@uniformdev/context/api";
774
758
  var _contentTypesUrl, _entriesUrl;
775
759
  var _ContentClient = class _ContentClient extends ApiClient3 {
776
760
  constructor(options) {
@@ -786,7 +770,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
786
770
  getEntries(options) {
787
771
  const { projectId } = this.options;
788
772
  const { skipDataResolution, filters, ...params } = options;
789
- const rewrittenFilters = rewriteFilters(filters);
773
+ const rewrittenFilters = rewriteFiltersForApi2(filters);
790
774
  if (skipDataResolution) {
791
775
  const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
792
776
  return this.apiClient(url);
@@ -3606,7 +3590,7 @@ function handleRichTextNodeBinding(object, options) {
3606
3590
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
3607
3591
 
3608
3592
  // src/.version.ts
3609
- var version = "20.49.3";
3593
+ var version = "20.50.0";
3610
3594
 
3611
3595
  // src/WorkflowClient.ts
3612
3596
  import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
package/dist/index.js CHANGED
@@ -762,22 +762,6 @@ function createLimitPolicy({
762
762
  }
763
763
  var nullLimitPolicy = async (func) => await func();
764
764
 
765
- // src/utils/rewriteFilters.ts
766
- var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
767
- function rewriteFilters(filters) {
768
- return Object.entries(filters != null ? filters : {}).reduce(
769
- (acc, [key, value]) => {
770
- const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
771
- const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
772
- return {
773
- ...acc,
774
- [lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
775
- };
776
- },
777
- {}
778
- );
779
- }
780
-
781
765
  // src/CanvasClient.ts
782
766
  var CANVAS_URL = "/api/v1/canvas";
783
767
  var CanvasClient = class extends import_api2.ApiClient {
@@ -794,7 +778,7 @@ var CanvasClient = class extends import_api2.ApiClient {
794
778
  async getCompositionList(params = {}) {
795
779
  const { projectId } = this.options;
796
780
  const { resolveData, filters, ...originParams } = params;
797
- const rewrittenFilters = rewriteFilters(filters);
781
+ const rewrittenFilters = (0, import_api2.rewriteFiltersForApi)(filters);
798
782
  if (!resolveData) {
799
783
  const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
800
784
  return this.apiClient(fetchUri);
@@ -964,7 +948,7 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
964
948
  getEntries(options) {
965
949
  const { projectId } = this.options;
966
950
  const { skipDataResolution, filters, ...params } = options;
967
- const rewrittenFilters = rewriteFilters(filters);
951
+ const rewrittenFilters = (0, import_api4.rewriteFiltersForApi)(filters);
968
952
  if (skipDataResolution) {
969
953
  const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
970
954
  return this.apiClient(url);
@@ -3784,7 +3768,7 @@ function handleRichTextNodeBinding(object, options) {
3784
3768
  var import_api18 = require("@uniformdev/context/api");
3785
3769
 
3786
3770
  // src/.version.ts
3787
- var version = "20.49.3";
3771
+ var version = "20.50.0";
3788
3772
 
3789
3773
  // src/WorkflowClient.ts
3790
3774
  var import_api17 = require("@uniformdev/context/api");
package/dist/index.mjs CHANGED
@@ -380,7 +380,7 @@ var require_retry2 = __commonJS({
380
380
  });
381
381
 
382
382
  // src/CanvasClient.ts
383
- import { ApiClient } from "@uniformdev/context/api";
383
+ import { ApiClient, rewriteFiltersForApi } from "@uniformdev/context/api";
384
384
 
385
385
  // src/enhancement/createLimitPolicy.ts
386
386
  var import_p_limit = __toESM(require_p_limit());
@@ -584,22 +584,6 @@ function createLimitPolicy({
584
584
  }
585
585
  var nullLimitPolicy = async (func) => await func();
586
586
 
587
- // src/utils/rewriteFilters.ts
588
- var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
589
- function rewriteFilters(filters) {
590
- return Object.entries(filters != null ? filters : {}).reduce(
591
- (acc, [key, value]) => {
592
- const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
593
- const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
594
- return {
595
- ...acc,
596
- [lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
597
- };
598
- },
599
- {}
600
- );
601
- }
602
-
603
587
  // src/CanvasClient.ts
604
588
  var CANVAS_URL = "/api/v1/canvas";
605
589
  var CanvasClient = class extends ApiClient {
@@ -616,7 +600,7 @@ var CanvasClient = class extends ApiClient {
616
600
  async getCompositionList(params = {}) {
617
601
  const { projectId } = this.options;
618
602
  const { resolveData, filters, ...originParams } = params;
619
- const rewrittenFilters = rewriteFilters(filters);
603
+ const rewrittenFilters = rewriteFiltersForApi(filters);
620
604
  if (!resolveData) {
621
605
  const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
622
606
  return this.apiClient(fetchUri);
@@ -770,7 +754,7 @@ var UncachedCategoryClient = class extends CategoryClient {
770
754
  };
771
755
 
772
756
  // src/ContentClient.ts
773
- import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
757
+ import { ApiClient as ApiClient3, rewriteFiltersForApi as rewriteFiltersForApi2 } from "@uniformdev/context/api";
774
758
  var _contentTypesUrl, _entriesUrl;
775
759
  var _ContentClient = class _ContentClient extends ApiClient3 {
776
760
  constructor(options) {
@@ -786,7 +770,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
786
770
  getEntries(options) {
787
771
  const { projectId } = this.options;
788
772
  const { skipDataResolution, filters, ...params } = options;
789
- const rewrittenFilters = rewriteFilters(filters);
773
+ const rewrittenFilters = rewriteFiltersForApi2(filters);
790
774
  if (skipDataResolution) {
791
775
  const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
792
776
  return this.apiClient(url);
@@ -3606,7 +3590,7 @@ function handleRichTextNodeBinding(object, options) {
3606
3590
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
3607
3591
 
3608
3592
  // src/.version.ts
3609
- var version = "20.49.3";
3593
+ var version = "20.50.0";
3610
3594
 
3611
3595
  // src/WorkflowClient.ts
3612
3596
  import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "20.49.3",
3
+ "version": "20.49.4-alpha.102+140d1a56b4",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -41,9 +41,9 @@
41
41
  "svix": "1.71.0"
42
42
  },
43
43
  "dependencies": {
44
- "@uniformdev/assets": "20.49.3",
45
- "@uniformdev/context": "20.49.3",
46
- "@uniformdev/richtext": "20.49.3",
44
+ "@uniformdev/assets": "20.49.4-alpha.102+140d1a56b4",
45
+ "@uniformdev/context": "20.49.4-alpha.102+140d1a56b4",
46
+ "@uniformdev/richtext": "20.49.4-alpha.102+140d1a56b4",
47
47
  "immer": "10.1.3"
48
48
  },
49
49
  "files": [
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "a6424635c7b318f5039e4d9c4d5a2ec72125af46"
55
+ "gitHead": "140d1a56b4b45021216a166bcaf7ebe629681b0b"
56
56
  }