@uniformdev/canvas 19.0.0 → 19.1.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
@@ -548,11 +548,74 @@ var UncachedCanvasClient = class extends CanvasClient {
548
548
  }
549
549
  };
550
550
 
551
- // src/DataSourceClient.ts
551
+ // src/CompositionRelationshipClient.ts
552
552
  import { ApiClient as ApiClient2 } from "@uniformdev/context/api";
553
+ var COMPOSITION_RELATIONSHIP_URL = "/api/v1/composition-relationships";
554
+ var unstable_CompositionRelationshipClient = class extends ApiClient2 {
555
+ constructor(options) {
556
+ super(options);
557
+ this.getDefinitionsRelationships = async ({
558
+ definitionIds,
559
+ withCompositions
560
+ }) => {
561
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL, {
562
+ type: "definition",
563
+ projectId: this._options.projectId,
564
+ definitionIds: definitionIds.join(","),
565
+ withCompositions
566
+ });
567
+ return this.apiClient(url);
568
+ };
569
+ this.clearAllRelationships = async () => {
570
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL);
571
+ return this.apiClient(url, {
572
+ method: "POST",
573
+ body: JSON.stringify({
574
+ type: "clear",
575
+ projectId: this._options.projectId
576
+ })
577
+ });
578
+ };
579
+ this.indexCompositionRelationships = async ({
580
+ state,
581
+ compositionId
582
+ }) => {
583
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL);
584
+ return this.apiClient(url, {
585
+ method: "POST",
586
+ body: JSON.stringify({
587
+ type: "index",
588
+ projectId: this._options.projectId,
589
+ state,
590
+ compositionId
591
+ })
592
+ });
593
+ };
594
+ this.getVersion = async () => {
595
+ const url = this.createUrl("/api/v1/usage-tracking", {
596
+ projectId: this._options.projectId
597
+ });
598
+ return this.apiClient(url).then((response) => response.version);
599
+ };
600
+ this.setVersion = async (version) => {
601
+ const url = this.createUrl("/api/v1/usage-tracking");
602
+ return this.apiClient(url, {
603
+ method: "POST",
604
+ body: JSON.stringify({
605
+ projectId: this._options.projectId,
606
+ version
607
+ })
608
+ });
609
+ };
610
+ this._options = options;
611
+ }
612
+ };
613
+
614
+ // src/DataSourceClient.ts
615
+ import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
553
616
  var dataSourceUrl = "/api/v1/data-source";
554
617
  var dataSourcesUrl = "/api/v1/data-sources";
555
- var DataSourceClient = class extends ApiClient2 {
618
+ var DataSourceClient = class extends ApiClient3 {
556
619
  constructor(options) {
557
620
  super(options);
558
621
  }
@@ -589,9 +652,9 @@ var DataSourceClient = class extends ApiClient2 {
589
652
  };
590
653
 
591
654
  // src/DataTypeClient.ts
592
- import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
655
+ import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
593
656
  var _url;
594
- var _DataTypeClient = class extends ApiClient3 {
657
+ var _DataTypeClient = class extends ApiClient4 {
595
658
  constructor(options) {
596
659
  super(options);
597
660
  }
@@ -1575,5 +1638,6 @@ export {
1575
1638
  mapSlotToTestVariations,
1576
1639
  nullLimitPolicy,
1577
1640
  subscribeToComposition,
1641
+ unstable_CompositionRelationshipClient,
1578
1642
  walkComponentTree
1579
1643
  };
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_api4.ApiClientError,
277
+ ApiClientError: () => import_api5.ApiClientError,
278
278
  BatchEntry: () => BatchEntry,
279
279
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
280
280
  CANVAS_ENRICHMENT_TAG_PARAM: () => CANVAS_ENRICHMENT_TAG_PARAM,
@@ -336,6 +336,7 @@ __export(src_exports, {
336
336
  mapSlotToTestVariations: () => mapSlotToTestVariations,
337
337
  nullLimitPolicy: () => nullLimitPolicy,
338
338
  subscribeToComposition: () => subscribeToComposition,
339
+ unstable_CompositionRelationshipClient: () => unstable_CompositionRelationshipClient,
339
340
  walkComponentTree: () => walkComponentTree
340
341
  });
341
342
  module.exports = __toCommonJS(src_exports);
@@ -623,11 +624,74 @@ var UncachedCanvasClient = class extends CanvasClient {
623
624
  }
624
625
  };
625
626
 
626
- // src/DataSourceClient.ts
627
+ // src/CompositionRelationshipClient.ts
627
628
  var import_api2 = require("@uniformdev/context/api");
629
+ var COMPOSITION_RELATIONSHIP_URL = "/api/v1/composition-relationships";
630
+ var unstable_CompositionRelationshipClient = class extends import_api2.ApiClient {
631
+ constructor(options) {
632
+ super(options);
633
+ this.getDefinitionsRelationships = async ({
634
+ definitionIds,
635
+ withCompositions
636
+ }) => {
637
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL, {
638
+ type: "definition",
639
+ projectId: this._options.projectId,
640
+ definitionIds: definitionIds.join(","),
641
+ withCompositions
642
+ });
643
+ return this.apiClient(url);
644
+ };
645
+ this.clearAllRelationships = async () => {
646
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL);
647
+ return this.apiClient(url, {
648
+ method: "POST",
649
+ body: JSON.stringify({
650
+ type: "clear",
651
+ projectId: this._options.projectId
652
+ })
653
+ });
654
+ };
655
+ this.indexCompositionRelationships = async ({
656
+ state,
657
+ compositionId
658
+ }) => {
659
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL);
660
+ return this.apiClient(url, {
661
+ method: "POST",
662
+ body: JSON.stringify({
663
+ type: "index",
664
+ projectId: this._options.projectId,
665
+ state,
666
+ compositionId
667
+ })
668
+ });
669
+ };
670
+ this.getVersion = async () => {
671
+ const url = this.createUrl("/api/v1/usage-tracking", {
672
+ projectId: this._options.projectId
673
+ });
674
+ return this.apiClient(url).then((response) => response.version);
675
+ };
676
+ this.setVersion = async (version) => {
677
+ const url = this.createUrl("/api/v1/usage-tracking");
678
+ return this.apiClient(url, {
679
+ method: "POST",
680
+ body: JSON.stringify({
681
+ projectId: this._options.projectId,
682
+ version
683
+ })
684
+ });
685
+ };
686
+ this._options = options;
687
+ }
688
+ };
689
+
690
+ // src/DataSourceClient.ts
691
+ var import_api3 = require("@uniformdev/context/api");
628
692
  var dataSourceUrl = "/api/v1/data-source";
629
693
  var dataSourcesUrl = "/api/v1/data-sources";
630
- var DataSourceClient = class extends import_api2.ApiClient {
694
+ var DataSourceClient = class extends import_api3.ApiClient {
631
695
  constructor(options) {
632
696
  super(options);
633
697
  }
@@ -664,9 +728,9 @@ var DataSourceClient = class extends import_api2.ApiClient {
664
728
  };
665
729
 
666
730
  // src/DataTypeClient.ts
667
- var import_api3 = require("@uniformdev/context/api");
731
+ var import_api4 = require("@uniformdev/context/api");
668
732
  var _url;
669
- var _DataTypeClient = class extends import_api3.ApiClient {
733
+ var _DataTypeClient = class extends import_api4.ApiClient {
670
734
  constructor(options) {
671
735
  super(options);
672
736
  }
@@ -1585,8 +1649,8 @@ function mapSlotToTestVariations(slot) {
1585
1649
  }
1586
1650
 
1587
1651
  // src/index.ts
1588
- var import_api4 = require("@uniformdev/context/api");
1589
- var CanvasClientError = import_api4.ApiClientError;
1652
+ var import_api5 = require("@uniformdev/context/api");
1653
+ var CanvasClientError = import_api5.ApiClientError;
1590
1654
  // Annotate the CommonJS export names for ESM import in node:
1591
1655
  0 && (module.exports = {
1592
1656
  ApiClientError,
@@ -1651,5 +1715,6 @@ var CanvasClientError = import_api4.ApiClientError;
1651
1715
  mapSlotToTestVariations,
1652
1716
  nullLimitPolicy,
1653
1717
  subscribeToComposition,
1718
+ unstable_CompositionRelationshipClient,
1654
1719
  walkComponentTree
1655
1720
  });
package/dist/index.mjs CHANGED
@@ -548,11 +548,74 @@ var UncachedCanvasClient = class extends CanvasClient {
548
548
  }
549
549
  };
550
550
 
551
- // src/DataSourceClient.ts
551
+ // src/CompositionRelationshipClient.ts
552
552
  import { ApiClient as ApiClient2 } from "@uniformdev/context/api";
553
+ var COMPOSITION_RELATIONSHIP_URL = "/api/v1/composition-relationships";
554
+ var unstable_CompositionRelationshipClient = class extends ApiClient2 {
555
+ constructor(options) {
556
+ super(options);
557
+ this.getDefinitionsRelationships = async ({
558
+ definitionIds,
559
+ withCompositions
560
+ }) => {
561
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL, {
562
+ type: "definition",
563
+ projectId: this._options.projectId,
564
+ definitionIds: definitionIds.join(","),
565
+ withCompositions
566
+ });
567
+ return this.apiClient(url);
568
+ };
569
+ this.clearAllRelationships = async () => {
570
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL);
571
+ return this.apiClient(url, {
572
+ method: "POST",
573
+ body: JSON.stringify({
574
+ type: "clear",
575
+ projectId: this._options.projectId
576
+ })
577
+ });
578
+ };
579
+ this.indexCompositionRelationships = async ({
580
+ state,
581
+ compositionId
582
+ }) => {
583
+ const url = this.createUrl(COMPOSITION_RELATIONSHIP_URL);
584
+ return this.apiClient(url, {
585
+ method: "POST",
586
+ body: JSON.stringify({
587
+ type: "index",
588
+ projectId: this._options.projectId,
589
+ state,
590
+ compositionId
591
+ })
592
+ });
593
+ };
594
+ this.getVersion = async () => {
595
+ const url = this.createUrl("/api/v1/usage-tracking", {
596
+ projectId: this._options.projectId
597
+ });
598
+ return this.apiClient(url).then((response) => response.version);
599
+ };
600
+ this.setVersion = async (version) => {
601
+ const url = this.createUrl("/api/v1/usage-tracking");
602
+ return this.apiClient(url, {
603
+ method: "POST",
604
+ body: JSON.stringify({
605
+ projectId: this._options.projectId,
606
+ version
607
+ })
608
+ });
609
+ };
610
+ this._options = options;
611
+ }
612
+ };
613
+
614
+ // src/DataSourceClient.ts
615
+ import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
553
616
  var dataSourceUrl = "/api/v1/data-source";
554
617
  var dataSourcesUrl = "/api/v1/data-sources";
555
- var DataSourceClient = class extends ApiClient2 {
618
+ var DataSourceClient = class extends ApiClient3 {
556
619
  constructor(options) {
557
620
  super(options);
558
621
  }
@@ -589,9 +652,9 @@ var DataSourceClient = class extends ApiClient2 {
589
652
  };
590
653
 
591
654
  // src/DataTypeClient.ts
592
- import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
655
+ import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
593
656
  var _url;
594
- var _DataTypeClient = class extends ApiClient3 {
657
+ var _DataTypeClient = class extends ApiClient4 {
595
658
  constructor(options) {
596
659
  super(options);
597
660
  }
@@ -1575,5 +1638,6 @@ export {
1575
1638
  mapSlotToTestVariations,
1576
1639
  nullLimitPolicy,
1577
1640
  subscribeToComposition,
1641
+ unstable_CompositionRelationshipClient,
1578
1642
  walkComponentTree
1579
1643
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.0.0",
3
+ "version": "19.1.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.0.0"
50
+ "@uniformdev/context": "19.1.0"
51
51
  },
52
52
  "files": [
53
53
  "/dist"
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "e104985924b24a8de1d8dcfcca6c9167611adf85"
58
+ "gitHead": "0a06bc3cbf5a3ef7eb72b7ba237e76df645a4a88"
59
59
  }