@uniformdev/canvas 19.134.3-alpha.10 → 19.134.3-alpha.28

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
@@ -481,15 +481,22 @@ var CanvasClient = class extends ApiClient {
481
481
  /** Fetches lists of Canvas compositions, optionally by type */
482
482
  async getCompositionList(params = {}) {
483
483
  const { projectId } = this.options;
484
- const { resolveData, ...originParams } = params;
484
+ const { resolveData, filters, ...originParams } = params;
485
+ const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
486
+ const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
487
+ let rhs = typeof value === "object" ? Object.values(value)[0] : value;
488
+ rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
489
+ return { ...acc, [lhs]: rhs };
490
+ }, {});
485
491
  if (!resolveData) {
486
- const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
492
+ const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
487
493
  return this.apiClient(fetchUri);
488
494
  }
489
495
  const edgeParams = {
490
496
  ...originParams,
491
497
  projectId,
492
- ...params.diagnostics ? { diagnostics: "true" } : {}
498
+ ...params.diagnostics ? { diagnostics: "true" } : {},
499
+ ...rewrittenFilters
493
500
  };
494
501
  const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
495
502
  return this.apiClient(edgeUrl, this.edgeApiRequestInit);
package/dist/index.js CHANGED
@@ -616,15 +616,22 @@ var CanvasClient = class extends import_api2.ApiClient {
616
616
  /** Fetches lists of Canvas compositions, optionally by type */
617
617
  async getCompositionList(params = {}) {
618
618
  const { projectId } = this.options;
619
- const { resolveData, ...originParams } = params;
619
+ const { resolveData, filters, ...originParams } = params;
620
+ const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
621
+ const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
622
+ let rhs = typeof value === "object" ? Object.values(value)[0] : value;
623
+ rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
624
+ return { ...acc, [lhs]: rhs };
625
+ }, {});
620
626
  if (!resolveData) {
621
- const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
627
+ const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
622
628
  return this.apiClient(fetchUri);
623
629
  }
624
630
  const edgeParams = {
625
631
  ...originParams,
626
632
  projectId,
627
- ...params.diagnostics ? { diagnostics: "true" } : {}
633
+ ...params.diagnostics ? { diagnostics: "true" } : {},
634
+ ...rewrittenFilters
628
635
  };
629
636
  const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
630
637
  return this.apiClient(edgeUrl, this.edgeApiRequestInit);
package/dist/index.mjs CHANGED
@@ -481,15 +481,22 @@ var CanvasClient = class extends ApiClient {
481
481
  /** Fetches lists of Canvas compositions, optionally by type */
482
482
  async getCompositionList(params = {}) {
483
483
  const { projectId } = this.options;
484
- const { resolveData, ...originParams } = params;
484
+ const { resolveData, filters, ...originParams } = params;
485
+ const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
486
+ const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
487
+ let rhs = typeof value === "object" ? Object.values(value)[0] : value;
488
+ rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
489
+ return { ...acc, [lhs]: rhs };
490
+ }, {});
485
491
  if (!resolveData) {
486
- const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
492
+ const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
487
493
  return this.apiClient(fetchUri);
488
494
  }
489
495
  const edgeParams = {
490
496
  ...originParams,
491
497
  projectId,
492
- ...params.diagnostics ? { diagnostics: "true" } : {}
498
+ ...params.diagnostics ? { diagnostics: "true" } : {},
499
+ ...rewrittenFilters
493
500
  };
494
501
  const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
495
502
  return this.apiClient(edgeUrl, this.edgeApiRequestInit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.134.3-alpha.10+ae656e8e4c",
3
+ "version": "19.134.3-alpha.28+506233b832",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -38,8 +38,8 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/assets": "19.134.3-alpha.10+ae656e8e4c",
42
- "@uniformdev/context": "19.134.3-alpha.10+ae656e8e4c",
41
+ "@uniformdev/assets": "19.134.3-alpha.28+506233b832",
42
+ "@uniformdev/context": "19.134.3-alpha.28+506233b832",
43
43
  "immer": "10.0.4"
44
44
  },
45
45
  "files": [
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "ae656e8e4c730dbf960ef43b6c5e9a0b8ba13193"
51
+ "gitHead": "506233b8324cbb3d7d6a0ef97b8d5e01b36bfb08"
52
52
  }