@uniformdev/canvas 19.63.2 → 19.63.3-alpha.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 CHANGED
@@ -11368,7 +11368,12 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
11368
11368
  private edgeApiHost;
11369
11369
  constructor(options: CanvasClientOptions);
11370
11370
  /** Fetches lists of Canvas compositions, optionally by type */
11371
- getCompositionList(options?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'>): Promise<{
11371
+ getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> & ({
11372
+ resolveData: true;
11373
+ diagnostics?: boolean;
11374
+ } | {
11375
+ resolveData?: false;
11376
+ })): Promise<{
11372
11377
  compositions: {
11373
11378
  state: number;
11374
11379
  uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | "Previous" | "Unknown" | undefined;
package/dist/index.d.ts CHANGED
@@ -11368,7 +11368,12 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
11368
11368
  private edgeApiHost;
11369
11369
  constructor(options: CanvasClientOptions);
11370
11370
  /** Fetches lists of Canvas compositions, optionally by type */
11371
- getCompositionList(options?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'>): Promise<{
11371
+ getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> & ({
11372
+ resolveData: true;
11373
+ diagnostics?: boolean;
11374
+ } | {
11375
+ resolveData?: false;
11376
+ })): Promise<{
11372
11377
  compositions: {
11373
11378
  state: number;
11374
11379
  uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | "Previous" | "Unknown" | undefined;
package/dist/index.esm.js CHANGED
@@ -478,10 +478,19 @@ 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
+ if (!params.resolveData) {
484
+ const fetchUri = this.createUrl(CANVAS_URL, { ...params, projectId });
485
+ return this.apiClient(fetchUri);
486
+ }
487
+ const edgeParams = {
488
+ ...params,
489
+ projectId,
490
+ ...params.diagnostics ? { diagnostics: "true" } : {}
491
+ };
492
+ const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
493
+ return this.apiClient(edgeUrl);
485
494
  }
486
495
  getCompositionByNodePath(options) {
487
496
  return this.getOneComposition(options);
@@ -546,7 +555,7 @@ var CanvasClient = class extends ApiClient {
546
555
  async getComponentDefinitions(options) {
547
556
  const { projectId } = this.options;
548
557
  const fetchUri = this.createUrl("/api/v1/canvas-definitions", { ...options, projectId });
549
- return await this.apiClient(fetchUri);
558
+ return this.apiClient(fetchUri);
550
559
  }
551
560
  /** Updates or creates a Canvas component definition */
552
561
  async updateComponentDefinition(body) {
package/dist/index.js CHANGED
@@ -590,10 +590,19 @@ 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
+ if (!params.resolveData) {
596
+ const fetchUri = this.createUrl(CANVAS_URL, { ...params, projectId });
597
+ return this.apiClient(fetchUri);
598
+ }
599
+ const edgeParams = {
600
+ ...params,
601
+ projectId,
602
+ ...params.diagnostics ? { diagnostics: "true" } : {}
603
+ };
604
+ const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
605
+ return this.apiClient(edgeUrl);
597
606
  }
598
607
  getCompositionByNodePath(options) {
599
608
  return this.getOneComposition(options);
@@ -658,7 +667,7 @@ var CanvasClient = class extends import_api2.ApiClient {
658
667
  async getComponentDefinitions(options) {
659
668
  const { projectId } = this.options;
660
669
  const fetchUri = this.createUrl("/api/v1/canvas-definitions", { ...options, projectId });
661
- return await this.apiClient(fetchUri);
670
+ return this.apiClient(fetchUri);
662
671
  }
663
672
  /** Updates or creates a Canvas component definition */
664
673
  async updateComponentDefinition(body) {
package/dist/index.mjs CHANGED
@@ -478,10 +478,19 @@ 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
+ if (!params.resolveData) {
484
+ const fetchUri = this.createUrl(CANVAS_URL, { ...params, projectId });
485
+ return this.apiClient(fetchUri);
486
+ }
487
+ const edgeParams = {
488
+ ...params,
489
+ projectId,
490
+ ...params.diagnostics ? { diagnostics: "true" } : {}
491
+ };
492
+ const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
493
+ return this.apiClient(edgeUrl);
485
494
  }
486
495
  getCompositionByNodePath(options) {
487
496
  return this.getOneComposition(options);
@@ -546,7 +555,7 @@ var CanvasClient = class extends ApiClient {
546
555
  async getComponentDefinitions(options) {
547
556
  const { projectId } = this.options;
548
557
  const fetchUri = this.createUrl("/api/v1/canvas-definitions", { ...options, projectId });
549
- return await this.apiClient(fetchUri);
558
+ return this.apiClient(fetchUri);
550
559
  }
551
560
  /** Updates or creates a Canvas component definition */
552
561
  async updateComponentDefinition(body) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.63.2",
3
+ "version": "19.63.3-alpha.0+d99b97b2a",
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,7 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/context": "19.63.2",
41
+ "@uniformdev/context": "19.63.3-alpha.0+d99b97b2a",
42
42
  "immer": "9.0.21"
43
43
  },
44
44
  "files": [
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "d233507166f115f0253f2571590f32be095c3193"
50
+ "gitHead": "d99b97b2ac5cbcd3b391384ac76d6fc92fbf526b"
51
51
  }