@uniformdev/canvas 19.55.2-alpha.29 → 19.55.2-alpha.34

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
@@ -478,10 +478,20 @@ var CanvasClient = class extends ApiClient {
478
478
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
479
479
  }
480
480
  /** Fetches lists of Canvas compositions, optionally by type */
481
- async getCompositionList(options) {
481
+ async getCompositionList(params = {}) {
482
482
  const { projectId } = this.options;
483
- const fetchUri = this.createUrl(CANVAS_URL, { ...options, projectId });
484
- return await this.apiClient(fetchUri);
483
+ const { resolveData, ...originParams } = params;
484
+ if (!resolveData) {
485
+ const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
486
+ return this.apiClient(fetchUri);
487
+ }
488
+ const edgeParams = {
489
+ ...originParams,
490
+ projectId,
491
+ ...params.diagnostics ? { diagnostics: "true" } : {}
492
+ };
493
+ const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
494
+ return this.apiClient(edgeUrl);
485
495
  }
486
496
  getCompositionByNodePath(options) {
487
497
  return this.getOneComposition(options);
@@ -499,12 +509,12 @@ var CanvasClient = class extends ApiClient {
499
509
  return this.getOneComposition(options);
500
510
  }
501
511
  /** Fetches historical versions of a composition or pattern */
502
- async unstable_getCompositionHistory(options) {
503
- const edgeUrl = this.createUrl("/api/v1/canvas-history", {
512
+ async getCompositionHistory(options) {
513
+ const historyUrl = this.createUrl("/api/v1/canvas-history", {
504
514
  ...options,
505
515
  projectId: this.options.projectId
506
516
  });
507
- return this.apiClient(edgeUrl);
517
+ return this.apiClient(historyUrl);
508
518
  }
509
519
  getOneComposition({
510
520
  skipDataResolution,
@@ -546,7 +556,7 @@ var CanvasClient = class extends ApiClient {
546
556
  async getComponentDefinitions(options) {
547
557
  const { projectId } = this.options;
548
558
  const fetchUri = this.createUrl("/api/v1/canvas-definitions", { ...options, projectId });
549
- return await this.apiClient(fetchUri);
559
+ return this.apiClient(fetchUri);
550
560
  }
551
561
  /** Updates or creates a Canvas component definition */
552
562
  async updateComponentDefinition(body) {
@@ -699,6 +709,14 @@ var _ContentClient = class _ContentClient extends ApiClient4 {
699
709
  const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
700
710
  return this.apiClient(fetchUri);
701
711
  }
712
+ /** Fetches historical versions of an entry */
713
+ async getEntryHistory(options) {
714
+ const historyUrl = this.createUrl("/api/v1/entries-history", {
715
+ ...options,
716
+ projectId: this.options.projectId
717
+ });
718
+ return this.apiClient(historyUrl);
719
+ }
702
720
  async upsertContentType(body) {
703
721
  const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
704
722
  await this.apiClient(fetchUri, {
@@ -1808,7 +1826,7 @@ var createCanvasChannel = ({
1808
1826
  };
1809
1827
  postMessage(message);
1810
1828
  };
1811
- const ready = () => {
1829
+ const ready = (options) => {
1812
1830
  var _a, _b;
1813
1831
  if (typeof window === "undefined") {
1814
1832
  return;
@@ -1818,7 +1836,8 @@ var createCanvasChannel = ({
1818
1836
  const message = {
1819
1837
  type: "ready",
1820
1838
  framework,
1821
- version
1839
+ version,
1840
+ rsc: options == null ? void 0 : options.rsc
1822
1841
  };
1823
1842
  postMessage(message);
1824
1843
  };
package/dist/index.js CHANGED
@@ -590,10 +590,20 @@ var CanvasClient = class extends import_api2.ApiClient {
590
590
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
591
591
  }
592
592
  /** Fetches lists of Canvas compositions, optionally by type */
593
- async getCompositionList(options) {
593
+ async getCompositionList(params = {}) {
594
594
  const { projectId } = this.options;
595
- const fetchUri = this.createUrl(CANVAS_URL, { ...options, projectId });
596
- return await this.apiClient(fetchUri);
595
+ const { resolveData, ...originParams } = params;
596
+ if (!resolveData) {
597
+ const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
598
+ return this.apiClient(fetchUri);
599
+ }
600
+ const edgeParams = {
601
+ ...originParams,
602
+ projectId,
603
+ ...params.diagnostics ? { diagnostics: "true" } : {}
604
+ };
605
+ const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
606
+ return this.apiClient(edgeUrl);
597
607
  }
598
608
  getCompositionByNodePath(options) {
599
609
  return this.getOneComposition(options);
@@ -611,12 +621,12 @@ var CanvasClient = class extends import_api2.ApiClient {
611
621
  return this.getOneComposition(options);
612
622
  }
613
623
  /** Fetches historical versions of a composition or pattern */
614
- async unstable_getCompositionHistory(options) {
615
- const edgeUrl = this.createUrl("/api/v1/canvas-history", {
624
+ async getCompositionHistory(options) {
625
+ const historyUrl = this.createUrl("/api/v1/canvas-history", {
616
626
  ...options,
617
627
  projectId: this.options.projectId
618
628
  });
619
- return this.apiClient(edgeUrl);
629
+ return this.apiClient(historyUrl);
620
630
  }
621
631
  getOneComposition({
622
632
  skipDataResolution,
@@ -658,7 +668,7 @@ var CanvasClient = class extends import_api2.ApiClient {
658
668
  async getComponentDefinitions(options) {
659
669
  const { projectId } = this.options;
660
670
  const fetchUri = this.createUrl("/api/v1/canvas-definitions", { ...options, projectId });
661
- return await this.apiClient(fetchUri);
671
+ return this.apiClient(fetchUri);
662
672
  }
663
673
  /** Updates or creates a Canvas component definition */
664
674
  async updateComponentDefinition(body) {
@@ -811,6 +821,14 @@ var _ContentClient = class _ContentClient extends import_api5.ApiClient {
811
821
  const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
812
822
  return this.apiClient(fetchUri);
813
823
  }
824
+ /** Fetches historical versions of an entry */
825
+ async getEntryHistory(options) {
826
+ const historyUrl = this.createUrl("/api/v1/entries-history", {
827
+ ...options,
828
+ projectId: this.options.projectId
829
+ });
830
+ return this.apiClient(historyUrl);
831
+ }
814
832
  async upsertContentType(body) {
815
833
  const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
816
834
  await this.apiClient(fetchUri, {
@@ -1920,7 +1938,7 @@ var createCanvasChannel = ({
1920
1938
  };
1921
1939
  postMessage(message);
1922
1940
  };
1923
- const ready = () => {
1941
+ const ready = (options) => {
1924
1942
  var _a, _b;
1925
1943
  if (typeof window === "undefined") {
1926
1944
  return;
@@ -1930,7 +1948,8 @@ var createCanvasChannel = ({
1930
1948
  const message = {
1931
1949
  type: "ready",
1932
1950
  framework,
1933
- version
1951
+ version,
1952
+ rsc: options == null ? void 0 : options.rsc
1934
1953
  };
1935
1954
  postMessage(message);
1936
1955
  };
package/dist/index.mjs CHANGED
@@ -478,10 +478,20 @@ var CanvasClient = class extends ApiClient {
478
478
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
479
479
  }
480
480
  /** Fetches lists of Canvas compositions, optionally by type */
481
- async getCompositionList(options) {
481
+ async getCompositionList(params = {}) {
482
482
  const { projectId } = this.options;
483
- const fetchUri = this.createUrl(CANVAS_URL, { ...options, projectId });
484
- return await this.apiClient(fetchUri);
483
+ const { resolveData, ...originParams } = params;
484
+ if (!resolveData) {
485
+ const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
486
+ return this.apiClient(fetchUri);
487
+ }
488
+ const edgeParams = {
489
+ ...originParams,
490
+ projectId,
491
+ ...params.diagnostics ? { diagnostics: "true" } : {}
492
+ };
493
+ const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
494
+ return this.apiClient(edgeUrl);
485
495
  }
486
496
  getCompositionByNodePath(options) {
487
497
  return this.getOneComposition(options);
@@ -499,12 +509,12 @@ var CanvasClient = class extends ApiClient {
499
509
  return this.getOneComposition(options);
500
510
  }
501
511
  /** Fetches historical versions of a composition or pattern */
502
- async unstable_getCompositionHistory(options) {
503
- const edgeUrl = this.createUrl("/api/v1/canvas-history", {
512
+ async getCompositionHistory(options) {
513
+ const historyUrl = this.createUrl("/api/v1/canvas-history", {
504
514
  ...options,
505
515
  projectId: this.options.projectId
506
516
  });
507
- return this.apiClient(edgeUrl);
517
+ return this.apiClient(historyUrl);
508
518
  }
509
519
  getOneComposition({
510
520
  skipDataResolution,
@@ -546,7 +556,7 @@ var CanvasClient = class extends ApiClient {
546
556
  async getComponentDefinitions(options) {
547
557
  const { projectId } = this.options;
548
558
  const fetchUri = this.createUrl("/api/v1/canvas-definitions", { ...options, projectId });
549
- return await this.apiClient(fetchUri);
559
+ return this.apiClient(fetchUri);
550
560
  }
551
561
  /** Updates or creates a Canvas component definition */
552
562
  async updateComponentDefinition(body) {
@@ -699,6 +709,14 @@ var _ContentClient = class _ContentClient extends ApiClient4 {
699
709
  const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
700
710
  return this.apiClient(fetchUri);
701
711
  }
712
+ /** Fetches historical versions of an entry */
713
+ async getEntryHistory(options) {
714
+ const historyUrl = this.createUrl("/api/v1/entries-history", {
715
+ ...options,
716
+ projectId: this.options.projectId
717
+ });
718
+ return this.apiClient(historyUrl);
719
+ }
702
720
  async upsertContentType(body) {
703
721
  const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
704
722
  await this.apiClient(fetchUri, {
@@ -1808,7 +1826,7 @@ var createCanvasChannel = ({
1808
1826
  };
1809
1827
  postMessage(message);
1810
1828
  };
1811
- const ready = () => {
1829
+ const ready = (options) => {
1812
1830
  var _a, _b;
1813
1831
  if (typeof window === "undefined") {
1814
1832
  return;
@@ -1818,7 +1836,8 @@ var createCanvasChannel = ({
1818
1836
  const message = {
1819
1837
  type: "ready",
1820
1838
  framework,
1821
- version
1839
+ version,
1840
+ rsc: options == null ? void 0 : options.rsc
1822
1841
  };
1823
1842
  postMessage(message);
1824
1843
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.55.2-alpha.29+d3dee9648",
3
+ "version": "19.55.2-alpha.34+8aefcd7df",
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,7 +38,8 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/context": "19.55.2-alpha.29+d3dee9648",
41
+ "@uniformdev/assets": "19.55.2-alpha.34+8aefcd7df",
42
+ "@uniformdev/context": "19.55.2-alpha.34+8aefcd7df",
42
43
  "immer": "9.0.21"
43
44
  },
44
45
  "files": [
@@ -47,5 +48,5 @@
47
48
  "publishConfig": {
48
49
  "access": "public"
49
50
  },
50
- "gitHead": "d3dee964810fcfa01070b60b83acadf1e5487cb1"
51
+ "gitHead": "8aefcd7df66f58e0ffa59360ae2b518eb485386a"
51
52
  }