@uniformdev/canvas 19.1.1-alpha.1 → 19.2.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.esm.js CHANGED
@@ -481,7 +481,6 @@ var CanvasClient = class extends ApiClient {
481
481
  }
482
482
  getOneComposition({
483
483
  skipDataResolution,
484
- unstable_dynamicVariables: dynamicVariables,
485
484
  diagnostics,
486
485
  ...params
487
486
  }) {
@@ -492,7 +491,6 @@ var CanvasClient = class extends ApiClient {
492
491
  const edgeParams = {
493
492
  ...params,
494
493
  projectId,
495
- ...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
496
494
  ...diagnostics ? { diagnostics: "true" } : {}
497
495
  };
498
496
  const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
@@ -1537,6 +1535,26 @@ function subscribeToComposition({
1537
1535
  };
1538
1536
  }
1539
1537
 
1538
+ // src/RouteClient.ts
1539
+ import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
1540
+ var ROUTE_URL = "/api/v1/route";
1541
+ var unstable_RouteClient = class extends ApiClient5 {
1542
+ constructor(options) {
1543
+ var _a;
1544
+ if (!options.limitPolicy) {
1545
+ options.limitPolicy = createLimitPolicy({});
1546
+ }
1547
+ super(options);
1548
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
1549
+ }
1550
+ /** Fetches lists of Canvas compositions, optionally by type */
1551
+ async getRoute(options) {
1552
+ const { projectId } = this.options;
1553
+ const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
1554
+ return await this.apiClient(fetchUri);
1555
+ }
1556
+ };
1557
+
1540
1558
  // src/utils/createApiEnhancer.ts
1541
1559
  var createUniformApiEnhancer = ({ apiUrl }) => {
1542
1560
  return async (message) => {
@@ -1666,5 +1684,6 @@ export {
1666
1684
  nullLimitPolicy,
1667
1685
  subscribeToComposition,
1668
1686
  unstable_CompositionRelationshipClient,
1687
+ unstable_RouteClient,
1669
1688
  walkComponentTree
1670
1689
  };
package/dist/index.js CHANGED
@@ -274,7 +274,7 @@ var require_retry2 = __commonJS({
274
274
  // src/index.ts
275
275
  var src_exports = {};
276
276
  __export(src_exports, {
277
- ApiClientError: () => import_api5.ApiClientError,
277
+ ApiClientError: () => import_api6.ApiClientError,
278
278
  BatchEntry: () => BatchEntry,
279
279
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
280
280
  CANVAS_ENRICHMENT_TAG_PARAM: () => CANVAS_ENRICHMENT_TAG_PARAM,
@@ -340,6 +340,7 @@ __export(src_exports, {
340
340
  nullLimitPolicy: () => nullLimitPolicy,
341
341
  subscribeToComposition: () => subscribeToComposition,
342
342
  unstable_CompositionRelationshipClient: () => unstable_CompositionRelationshipClient,
343
+ unstable_RouteClient: () => unstable_RouteClient,
343
344
  walkComponentTree: () => walkComponentTree
344
345
  });
345
346
  module.exports = __toCommonJS(src_exports);
@@ -560,7 +561,6 @@ var CanvasClient = class extends import_api.ApiClient {
560
561
  }
561
562
  getOneComposition({
562
563
  skipDataResolution,
563
- unstable_dynamicVariables: dynamicVariables,
564
564
  diagnostics,
565
565
  ...params
566
566
  }) {
@@ -571,7 +571,6 @@ var CanvasClient = class extends import_api.ApiClient {
571
571
  const edgeParams = {
572
572
  ...params,
573
573
  projectId,
574
- ...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
575
574
  ...diagnostics ? { diagnostics: "true" } : {}
576
575
  };
577
576
  const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
@@ -1616,6 +1615,26 @@ function subscribeToComposition({
1616
1615
  };
1617
1616
  }
1618
1617
 
1618
+ // src/RouteClient.ts
1619
+ var import_api5 = require("@uniformdev/context/api");
1620
+ var ROUTE_URL = "/api/v1/route";
1621
+ var unstable_RouteClient = class extends import_api5.ApiClient {
1622
+ constructor(options) {
1623
+ var _a;
1624
+ if (!options.limitPolicy) {
1625
+ options.limitPolicy = createLimitPolicy({});
1626
+ }
1627
+ super(options);
1628
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
1629
+ }
1630
+ /** Fetches lists of Canvas compositions, optionally by type */
1631
+ async getRoute(options) {
1632
+ const { projectId } = this.options;
1633
+ const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
1634
+ return await this.apiClient(fetchUri);
1635
+ }
1636
+ };
1637
+
1619
1638
  // src/utils/createApiEnhancer.ts
1620
1639
  var createUniformApiEnhancer = ({ apiUrl }) => {
1621
1640
  return async (message) => {
@@ -1676,8 +1695,8 @@ function mapSlotToTestVariations(slot) {
1676
1695
  }
1677
1696
 
1678
1697
  // src/index.ts
1679
- var import_api5 = require("@uniformdev/context/api");
1680
- var CanvasClientError = import_api5.ApiClientError;
1698
+ var import_api6 = require("@uniformdev/context/api");
1699
+ var CanvasClientError = import_api6.ApiClientError;
1681
1700
  // Annotate the CommonJS export names for ESM import in node:
1682
1701
  0 && (module.exports = {
1683
1702
  ApiClientError,
@@ -1746,5 +1765,6 @@ var CanvasClientError = import_api5.ApiClientError;
1746
1765
  nullLimitPolicy,
1747
1766
  subscribeToComposition,
1748
1767
  unstable_CompositionRelationshipClient,
1768
+ unstable_RouteClient,
1749
1769
  walkComponentTree
1750
1770
  });
package/dist/index.mjs CHANGED
@@ -481,7 +481,6 @@ var CanvasClient = class extends ApiClient {
481
481
  }
482
482
  getOneComposition({
483
483
  skipDataResolution,
484
- unstable_dynamicVariables: dynamicVariables,
485
484
  diagnostics,
486
485
  ...params
487
486
  }) {
@@ -492,7 +491,6 @@ var CanvasClient = class extends ApiClient {
492
491
  const edgeParams = {
493
492
  ...params,
494
493
  projectId,
495
- ...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
496
494
  ...diagnostics ? { diagnostics: "true" } : {}
497
495
  };
498
496
  const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
@@ -1537,6 +1535,26 @@ function subscribeToComposition({
1537
1535
  };
1538
1536
  }
1539
1537
 
1538
+ // src/RouteClient.ts
1539
+ import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
1540
+ var ROUTE_URL = "/api/v1/route";
1541
+ var unstable_RouteClient = class extends ApiClient5 {
1542
+ constructor(options) {
1543
+ var _a;
1544
+ if (!options.limitPolicy) {
1545
+ options.limitPolicy = createLimitPolicy({});
1546
+ }
1547
+ super(options);
1548
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
1549
+ }
1550
+ /** Fetches lists of Canvas compositions, optionally by type */
1551
+ async getRoute(options) {
1552
+ const { projectId } = this.options;
1553
+ const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
1554
+ return await this.apiClient(fetchUri);
1555
+ }
1556
+ };
1557
+
1540
1558
  // src/utils/createApiEnhancer.ts
1541
1559
  var createUniformApiEnhancer = ({ apiUrl }) => {
1542
1560
  return async (message) => {
@@ -1666,5 +1684,6 @@ export {
1666
1684
  nullLimitPolicy,
1667
1685
  subscribeToComposition,
1668
1686
  unstable_CompositionRelationshipClient,
1687
+ unstable_RouteClient,
1669
1688
  walkComponentTree
1670
1689
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.1.1-alpha.1+3ec68fe9d",
3
+ "version": "19.2.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",
@@ -47,7 +47,7 @@
47
47
  "pusher-js": "8.0.1"
48
48
  },
49
49
  "dependencies": {
50
- "@uniformdev/context": "19.1.1-alpha.1+3ec68fe9d"
50
+ "@uniformdev/context": "19.2.0"
51
51
  },
52
52
  "files": [
53
53
  "/dist"
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "3ec68fe9d54c7128e57cc8a5c8116fe968f65865"
58
+ "gitHead": "9eb2423cd12a5db527f9f3a9d46b47ac2a0e7eb3"
59
59
  }