@uniformdev/canvas 19.157.0 → 19.158.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/dist/index.d.mts +627 -712
 - package/dist/index.d.ts +627 -712
 - package/dist/index.esm.js +15 -12
 - package/dist/index.js +15 -12
 - package/dist/index.mjs +15 -12
 - package/package.json +4 -4
 
    
        package/dist/index.esm.js
    CHANGED
    
    | 
         @@ -466,6 +466,19 @@ function createLimitPolicy({ 
     | 
|
| 
       466 
466 
     | 
    
         
             
            }
         
     | 
| 
       467 
467 
     | 
    
         
             
            var nullLimitPolicy = async (func) => await func();
         
     | 
| 
       468 
468 
     | 
    
         | 
| 
      
 469 
     | 
    
         
            +
            // src/utils/rewriteFilters.ts
         
     | 
| 
      
 470 
     | 
    
         
            +
            var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
         
     | 
| 
      
 471 
     | 
    
         
            +
            function rewriteFilters(filters) {
         
     | 
| 
      
 472 
     | 
    
         
            +
              return Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
         
     | 
| 
      
 473 
     | 
    
         
            +
                const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
         
     | 
| 
      
 474 
     | 
    
         
            +
                const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
         
     | 
| 
      
 475 
     | 
    
         
            +
                return {
         
     | 
| 
      
 476 
     | 
    
         
            +
                  ...acc,
         
     | 
| 
      
 477 
     | 
    
         
            +
                  [lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
         
     | 
| 
      
 478 
     | 
    
         
            +
                };
         
     | 
| 
      
 479 
     | 
    
         
            +
              }, {});
         
     | 
| 
      
 480 
     | 
    
         
            +
            }
         
     | 
| 
      
 481 
     | 
    
         
            +
             
     | 
| 
       469 
482 
     | 
    
         
             
            // src/CanvasClient.ts
         
     | 
| 
       470 
483 
     | 
    
         
             
            var CANVAS_URL = "/api/v1/canvas";
         
     | 
| 
       471 
484 
     | 
    
         
             
            var CanvasClient = class extends ApiClient {
         
     | 
| 
         @@ -482,12 +495,7 @@ var CanvasClient = class extends ApiClient { 
     | 
|
| 
       482 
495 
     | 
    
         
             
              async getCompositionList(params = {}) {
         
     | 
| 
       483 
496 
     | 
    
         
             
                const { projectId } = this.options;
         
     | 
| 
       484 
497 
     | 
    
         
             
                const { resolveData, filters, ...originParams } = params;
         
     | 
| 
       485 
     | 
    
         
            -
                const rewrittenFilters =  
     | 
| 
       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 
     | 
    
         
            -
                }, {});
         
     | 
| 
      
 498 
     | 
    
         
            +
                const rewrittenFilters = rewriteFilters(filters);
         
     | 
| 
       491 
499 
     | 
    
         
             
                if (!resolveData) {
         
     | 
| 
       492 
500 
     | 
    
         
             
                  const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
         
     | 
| 
       493 
501 
     | 
    
         
             
                  return this.apiClient(fetchUri);
         
     | 
| 
         @@ -651,12 +659,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 { 
     | 
|
| 
       651 
659 
     | 
    
         
             
              getEntries(options) {
         
     | 
| 
       652 
660 
     | 
    
         
             
                const { projectId } = this.options;
         
     | 
| 
       653 
661 
     | 
    
         
             
                const { skipDataResolution, filters, ...params } = options;
         
     | 
| 
       654 
     | 
    
         
            -
                const rewrittenFilters =  
     | 
| 
       655 
     | 
    
         
            -
                  const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
         
     | 
| 
       656 
     | 
    
         
            -
                  let rhs = typeof value === "object" ? Object.values(value)[0] : value;
         
     | 
| 
       657 
     | 
    
         
            -
                  rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
         
     | 
| 
       658 
     | 
    
         
            -
                  return { ...acc, [lhs]: rhs };
         
     | 
| 
       659 
     | 
    
         
            -
                }, {});
         
     | 
| 
      
 662 
     | 
    
         
            +
                const rewrittenFilters = rewriteFilters(filters);
         
     | 
| 
       660 
663 
     | 
    
         
             
                if (skipDataResolution) {
         
     | 
| 
       661 
664 
     | 
    
         
             
                  const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
         
     | 
| 
       662 
665 
     | 
    
         
             
                  return this.apiClient(url);
         
     | 
    
        package/dist/index.js
    CHANGED
    
    | 
         @@ -603,6 +603,19 @@ function createLimitPolicy({ 
     | 
|
| 
       603 
603 
     | 
    
         
             
            }
         
     | 
| 
       604 
604 
     | 
    
         
             
            var nullLimitPolicy = async (func) => await func();
         
     | 
| 
       605 
605 
     | 
    
         | 
| 
      
 606 
     | 
    
         
            +
            // src/utils/rewriteFilters.ts
         
     | 
| 
      
 607 
     | 
    
         
            +
            var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
         
     | 
| 
      
 608 
     | 
    
         
            +
            function rewriteFilters(filters) {
         
     | 
| 
      
 609 
     | 
    
         
            +
              return Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
         
     | 
| 
      
 610 
     | 
    
         
            +
                const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
         
     | 
| 
      
 611 
     | 
    
         
            +
                const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
         
     | 
| 
      
 612 
     | 
    
         
            +
                return {
         
     | 
| 
      
 613 
     | 
    
         
            +
                  ...acc,
         
     | 
| 
      
 614 
     | 
    
         
            +
                  [lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
         
     | 
| 
      
 615 
     | 
    
         
            +
                };
         
     | 
| 
      
 616 
     | 
    
         
            +
              }, {});
         
     | 
| 
      
 617 
     | 
    
         
            +
            }
         
     | 
| 
      
 618 
     | 
    
         
            +
             
     | 
| 
       606 
619 
     | 
    
         
             
            // src/CanvasClient.ts
         
     | 
| 
       607 
620 
     | 
    
         
             
            var CANVAS_URL = "/api/v1/canvas";
         
     | 
| 
       608 
621 
     | 
    
         
             
            var CanvasClient = class extends import_api2.ApiClient {
         
     | 
| 
         @@ -619,12 +632,7 @@ var CanvasClient = class extends import_api2.ApiClient { 
     | 
|
| 
       619 
632 
     | 
    
         
             
              async getCompositionList(params = {}) {
         
     | 
| 
       620 
633 
     | 
    
         
             
                const { projectId } = this.options;
         
     | 
| 
       621 
634 
     | 
    
         
             
                const { resolveData, filters, ...originParams } = params;
         
     | 
| 
       622 
     | 
    
         
            -
                const rewrittenFilters =  
     | 
| 
       623 
     | 
    
         
            -
                  const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
         
     | 
| 
       624 
     | 
    
         
            -
                  let rhs = typeof value === "object" ? Object.values(value)[0] : value;
         
     | 
| 
       625 
     | 
    
         
            -
                  rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
         
     | 
| 
       626 
     | 
    
         
            -
                  return { ...acc, [lhs]: rhs };
         
     | 
| 
       627 
     | 
    
         
            -
                }, {});
         
     | 
| 
      
 635 
     | 
    
         
            +
                const rewrittenFilters = rewriteFilters(filters);
         
     | 
| 
       628 
636 
     | 
    
         
             
                if (!resolveData) {
         
     | 
| 
       629 
637 
     | 
    
         
             
                  const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
         
     | 
| 
       630 
638 
     | 
    
         
             
                  return this.apiClient(fetchUri);
         
     | 
| 
         @@ -788,12 +796,7 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient { 
     | 
|
| 
       788 
796 
     | 
    
         
             
              getEntries(options) {
         
     | 
| 
       789 
797 
     | 
    
         
             
                const { projectId } = this.options;
         
     | 
| 
       790 
798 
     | 
    
         
             
                const { skipDataResolution, filters, ...params } = options;
         
     | 
| 
       791 
     | 
    
         
            -
                const rewrittenFilters =  
     | 
| 
       792 
     | 
    
         
            -
                  const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
         
     | 
| 
       793 
     | 
    
         
            -
                  let rhs = typeof value === "object" ? Object.values(value)[0] : value;
         
     | 
| 
       794 
     | 
    
         
            -
                  rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
         
     | 
| 
       795 
     | 
    
         
            -
                  return { ...acc, [lhs]: rhs };
         
     | 
| 
       796 
     | 
    
         
            -
                }, {});
         
     | 
| 
      
 799 
     | 
    
         
            +
                const rewrittenFilters = rewriteFilters(filters);
         
     | 
| 
       797 
800 
     | 
    
         
             
                if (skipDataResolution) {
         
     | 
| 
       798 
801 
     | 
    
         
             
                  const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
         
     | 
| 
       799 
802 
     | 
    
         
             
                  return this.apiClient(url);
         
     | 
    
        package/dist/index.mjs
    CHANGED
    
    | 
         @@ -466,6 +466,19 @@ function createLimitPolicy({ 
     | 
|
| 
       466 
466 
     | 
    
         
             
            }
         
     | 
| 
       467 
467 
     | 
    
         
             
            var nullLimitPolicy = async (func) => await func();
         
     | 
| 
       468 
468 
     | 
    
         | 
| 
      
 469 
     | 
    
         
            +
            // src/utils/rewriteFilters.ts
         
     | 
| 
      
 470 
     | 
    
         
            +
            var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
         
     | 
| 
      
 471 
     | 
    
         
            +
            function rewriteFilters(filters) {
         
     | 
| 
      
 472 
     | 
    
         
            +
              return Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
         
     | 
| 
      
 473 
     | 
    
         
            +
                const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
         
     | 
| 
      
 474 
     | 
    
         
            +
                const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
         
     | 
| 
      
 475 
     | 
    
         
            +
                return {
         
     | 
| 
      
 476 
     | 
    
         
            +
                  ...acc,
         
     | 
| 
      
 477 
     | 
    
         
            +
                  [lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
         
     | 
| 
      
 478 
     | 
    
         
            +
                };
         
     | 
| 
      
 479 
     | 
    
         
            +
              }, {});
         
     | 
| 
      
 480 
     | 
    
         
            +
            }
         
     | 
| 
      
 481 
     | 
    
         
            +
             
     | 
| 
       469 
482 
     | 
    
         
             
            // src/CanvasClient.ts
         
     | 
| 
       470 
483 
     | 
    
         
             
            var CANVAS_URL = "/api/v1/canvas";
         
     | 
| 
       471 
484 
     | 
    
         
             
            var CanvasClient = class extends ApiClient {
         
     | 
| 
         @@ -482,12 +495,7 @@ var CanvasClient = class extends ApiClient { 
     | 
|
| 
       482 
495 
     | 
    
         
             
              async getCompositionList(params = {}) {
         
     | 
| 
       483 
496 
     | 
    
         
             
                const { projectId } = this.options;
         
     | 
| 
       484 
497 
     | 
    
         
             
                const { resolveData, filters, ...originParams } = params;
         
     | 
| 
       485 
     | 
    
         
            -
                const rewrittenFilters =  
     | 
| 
       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 
     | 
    
         
            -
                }, {});
         
     | 
| 
      
 498 
     | 
    
         
            +
                const rewrittenFilters = rewriteFilters(filters);
         
     | 
| 
       491 
499 
     | 
    
         
             
                if (!resolveData) {
         
     | 
| 
       492 
500 
     | 
    
         
             
                  const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
         
     | 
| 
       493 
501 
     | 
    
         
             
                  return this.apiClient(fetchUri);
         
     | 
| 
         @@ -651,12 +659,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 { 
     | 
|
| 
       651 
659 
     | 
    
         
             
              getEntries(options) {
         
     | 
| 
       652 
660 
     | 
    
         
             
                const { projectId } = this.options;
         
     | 
| 
       653 
661 
     | 
    
         
             
                const { skipDataResolution, filters, ...params } = options;
         
     | 
| 
       654 
     | 
    
         
            -
                const rewrittenFilters =  
     | 
| 
       655 
     | 
    
         
            -
                  const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
         
     | 
| 
       656 
     | 
    
         
            -
                  let rhs = typeof value === "object" ? Object.values(value)[0] : value;
         
     | 
| 
       657 
     | 
    
         
            -
                  rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
         
     | 
| 
       658 
     | 
    
         
            -
                  return { ...acc, [lhs]: rhs };
         
     | 
| 
       659 
     | 
    
         
            -
                }, {});
         
     | 
| 
      
 662 
     | 
    
         
            +
                const rewrittenFilters = rewriteFilters(filters);
         
     | 
| 
       660 
663 
     | 
    
         
             
                if (skipDataResolution) {
         
     | 
| 
       661 
664 
     | 
    
         
             
                  const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
         
     | 
| 
       662 
665 
     | 
    
         
             
                  return this.apiClient(url);
         
     | 
    
        package/package.json
    CHANGED
    
    | 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            {
         
     | 
| 
       2 
2 
     | 
    
         
             
              "name": "@uniformdev/canvas",
         
     | 
| 
       3 
     | 
    
         
            -
              "version": "19. 
     | 
| 
      
 3 
     | 
    
         
            +
              "version": "19.158.0",
         
     | 
| 
       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. 
     | 
| 
       42 
     | 
    
         
            -
                "@uniformdev/context": "19. 
     | 
| 
      
 41 
     | 
    
         
            +
                "@uniformdev/assets": "19.158.0",
         
     | 
| 
      
 42 
     | 
    
         
            +
                "@uniformdev/context": "19.158.0",
         
     | 
| 
       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": " 
     | 
| 
      
 51 
     | 
    
         
            +
              "gitHead": "f0be15ed3518c8d3d02e320d9b9a2f5175d30d1b"
         
     | 
| 
       52 
52 
     | 
    
         
             
            }
         
     |