@uniformdev/canvas 19.90.1-alpha.8 → 19.91.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
@@ -13335,9 +13335,11 @@ type RouteGetResponseEdgehancedComposition = Omit<RouteGetResponseComposition, '
13335
13335
 
13336
13336
  type CanvasClientOptions = ClientOptions & {
13337
13337
  edgeApiHost?: string;
13338
+ disableSWR?: boolean;
13338
13339
  };
13339
13340
  declare class CanvasClient extends ApiClient<CanvasClientOptions> {
13340
13341
  private edgeApiHost;
13342
+ private edgeApiRequestInit?;
13341
13343
  constructor(options: CanvasClientOptions);
13342
13344
  /** Fetches lists of Canvas compositions, optionally by type */
13343
13345
  getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> & ({
@@ -13393,6 +13395,7 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
13393
13395
  canBeComposition?: boolean | undefined;
13394
13396
  parameters?: {
13395
13397
  id: string;
13398
+ /** Fetches a component definition's composition defaults */
13396
13399
  name: string;
13397
13400
  helpText?: string | undefined;
13398
13401
  type: string;
@@ -14028,6 +14031,7 @@ type RichTextParamValue = SerializedEditorState | undefined | null;
14028
14031
 
14029
14032
  type ContentClientOptions = ClientOptions & {
14030
14033
  edgeApiHost?: string;
14034
+ disableSWR?: boolean;
14031
14035
  };
14032
14036
  declare class ContentClient extends ApiClient<ContentClientOptions> {
14033
14037
  #private;
@@ -14709,6 +14713,7 @@ declare class PromptClient extends ApiClient {
14709
14713
 
14710
14714
  type RouteClientOptions = Omit<ClientOptions, 'apiHost'> & {
14711
14715
  edgeApiHost?: string;
14716
+ disableSWR?: boolean;
14712
14717
  };
14713
14718
  /** A route API response with edgehancer composition result */
14714
14719
  type ResolvedRouteGetResponse = RouteGetResponseNotFound | RouteGetResponseRedirect | RouteGetResponseEdgehancedComposition;
package/dist/index.d.ts CHANGED
@@ -13335,9 +13335,11 @@ type RouteGetResponseEdgehancedComposition = Omit<RouteGetResponseComposition, '
13335
13335
 
13336
13336
  type CanvasClientOptions = ClientOptions & {
13337
13337
  edgeApiHost?: string;
13338
+ disableSWR?: boolean;
13338
13339
  };
13339
13340
  declare class CanvasClient extends ApiClient<CanvasClientOptions> {
13340
13341
  private edgeApiHost;
13342
+ private edgeApiRequestInit?;
13341
13343
  constructor(options: CanvasClientOptions);
13342
13344
  /** Fetches lists of Canvas compositions, optionally by type */
13343
13345
  getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> & ({
@@ -13393,6 +13395,7 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
13393
13395
  canBeComposition?: boolean | undefined;
13394
13396
  parameters?: {
13395
13397
  id: string;
13398
+ /** Fetches a component definition's composition defaults */
13396
13399
  name: string;
13397
13400
  helpText?: string | undefined;
13398
13401
  type: string;
@@ -14028,6 +14031,7 @@ type RichTextParamValue = SerializedEditorState | undefined | null;
14028
14031
 
14029
14032
  type ContentClientOptions = ClientOptions & {
14030
14033
  edgeApiHost?: string;
14034
+ disableSWR?: boolean;
14031
14035
  };
14032
14036
  declare class ContentClient extends ApiClient<ContentClientOptions> {
14033
14037
  #private;
@@ -14709,6 +14713,7 @@ declare class PromptClient extends ApiClient {
14709
14713
 
14710
14714
  type RouteClientOptions = Omit<ClientOptions, 'apiHost'> & {
14711
14715
  edgeApiHost?: string;
14716
+ disableSWR?: boolean;
14712
14717
  };
14713
14718
  /** A route API response with edgehancer composition result */
14714
14719
  type ResolvedRouteGetResponse = RouteGetResponseNotFound | RouteGetResponseRedirect | RouteGetResponseEdgehancedComposition;
package/dist/index.esm.js CHANGED
@@ -476,6 +476,7 @@ var CanvasClient = class extends ApiClient {
476
476
  }
477
477
  super(options);
478
478
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
479
+ this.edgeApiRequestInit = options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0;
479
480
  }
480
481
  /** Fetches lists of Canvas compositions, optionally by type */
481
482
  async getCompositionList(params = {}) {
@@ -491,7 +492,7 @@ var CanvasClient = class extends ApiClient {
491
492
  ...params.diagnostics ? { diagnostics: "true" } : {}
492
493
  };
493
494
  const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
494
- return this.apiClient(edgeUrl);
495
+ return this.apiClient(edgeUrl, this.edgeApiRequestInit);
495
496
  }
496
497
  getCompositionByNodePath(options) {
497
498
  return this.getOneComposition(options);
@@ -531,7 +532,7 @@ var CanvasClient = class extends ApiClient {
531
532
  ...diagnostics ? { diagnostics: "true" } : {}
532
533
  };
533
534
  const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
534
- return this.apiClient(edgeUrl);
535
+ return this.apiClient(edgeUrl, this.edgeApiRequestInit);
535
536
  }
536
537
  /** Updates or creates a Canvas component definition */
537
538
  async updateComposition(body) {
@@ -708,8 +709,15 @@ var _ContentClient = class _ContentClient extends ApiClient4 {
708
709
  getEntries(options) {
709
710
  const { projectId } = this.options;
710
711
  const { skipDataResolution, ...params } = options;
711
- const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
712
- return this.apiClient(fetchUri);
712
+ if (skipDataResolution) {
713
+ const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId });
714
+ return this.apiClient(url);
715
+ }
716
+ const edgeUrl = this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
717
+ return this.apiClient(
718
+ edgeUrl,
719
+ this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
720
+ );
713
721
  }
714
722
  /** Fetches historical versions of an entry */
715
723
  async getEntryHistory(options) {
@@ -2296,7 +2304,10 @@ var RouteClient = class extends ApiClient9 {
2296
2304
  async getRoute(options) {
2297
2305
  const { projectId } = this.options;
2298
2306
  const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
2299
- return await this.apiClient(fetchUri);
2307
+ return await this.apiClient(
2308
+ fetchUri,
2309
+ this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
2310
+ );
2300
2311
  }
2301
2312
  };
2302
2313
 
package/dist/index.js CHANGED
@@ -603,6 +603,7 @@ var CanvasClient = class extends import_api2.ApiClient {
603
603
  }
604
604
  super(options);
605
605
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
606
+ this.edgeApiRequestInit = options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0;
606
607
  }
607
608
  /** Fetches lists of Canvas compositions, optionally by type */
608
609
  async getCompositionList(params = {}) {
@@ -618,7 +619,7 @@ var CanvasClient = class extends import_api2.ApiClient {
618
619
  ...params.diagnostics ? { diagnostics: "true" } : {}
619
620
  };
620
621
  const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
621
- return this.apiClient(edgeUrl);
622
+ return this.apiClient(edgeUrl, this.edgeApiRequestInit);
622
623
  }
623
624
  getCompositionByNodePath(options) {
624
625
  return this.getOneComposition(options);
@@ -658,7 +659,7 @@ var CanvasClient = class extends import_api2.ApiClient {
658
659
  ...diagnostics ? { diagnostics: "true" } : {}
659
660
  };
660
661
  const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
661
- return this.apiClient(edgeUrl);
662
+ return this.apiClient(edgeUrl, this.edgeApiRequestInit);
662
663
  }
663
664
  /** Updates or creates a Canvas component definition */
664
665
  async updateComposition(body) {
@@ -835,8 +836,15 @@ var _ContentClient = class _ContentClient extends import_api5.ApiClient {
835
836
  getEntries(options) {
836
837
  const { projectId } = this.options;
837
838
  const { skipDataResolution, ...params } = options;
838
- const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
839
- return this.apiClient(fetchUri);
839
+ if (skipDataResolution) {
840
+ const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId });
841
+ return this.apiClient(url);
842
+ }
843
+ const edgeUrl = this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
844
+ return this.apiClient(
845
+ edgeUrl,
846
+ this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
847
+ );
840
848
  }
841
849
  /** Fetches historical versions of an entry */
842
850
  async getEntryHistory(options) {
@@ -2423,7 +2431,10 @@ var RouteClient = class extends import_api10.ApiClient {
2423
2431
  async getRoute(options) {
2424
2432
  const { projectId } = this.options;
2425
2433
  const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
2426
- return await this.apiClient(fetchUri);
2434
+ return await this.apiClient(
2435
+ fetchUri,
2436
+ this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
2437
+ );
2427
2438
  }
2428
2439
  };
2429
2440
 
package/dist/index.mjs CHANGED
@@ -476,6 +476,7 @@ var CanvasClient = class extends ApiClient {
476
476
  }
477
477
  super(options);
478
478
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
479
+ this.edgeApiRequestInit = options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0;
479
480
  }
480
481
  /** Fetches lists of Canvas compositions, optionally by type */
481
482
  async getCompositionList(params = {}) {
@@ -491,7 +492,7 @@ var CanvasClient = class extends ApiClient {
491
492
  ...params.diagnostics ? { diagnostics: "true" } : {}
492
493
  };
493
494
  const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
494
- return this.apiClient(edgeUrl);
495
+ return this.apiClient(edgeUrl, this.edgeApiRequestInit);
495
496
  }
496
497
  getCompositionByNodePath(options) {
497
498
  return this.getOneComposition(options);
@@ -531,7 +532,7 @@ var CanvasClient = class extends ApiClient {
531
532
  ...diagnostics ? { diagnostics: "true" } : {}
532
533
  };
533
534
  const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
534
- return this.apiClient(edgeUrl);
535
+ return this.apiClient(edgeUrl, this.edgeApiRequestInit);
535
536
  }
536
537
  /** Updates or creates a Canvas component definition */
537
538
  async updateComposition(body) {
@@ -708,8 +709,15 @@ var _ContentClient = class _ContentClient extends ApiClient4 {
708
709
  getEntries(options) {
709
710
  const { projectId } = this.options;
710
711
  const { skipDataResolution, ...params } = options;
711
- const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
712
- return this.apiClient(fetchUri);
712
+ if (skipDataResolution) {
713
+ const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId });
714
+ return this.apiClient(url);
715
+ }
716
+ const edgeUrl = this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
717
+ return this.apiClient(
718
+ edgeUrl,
719
+ this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
720
+ );
713
721
  }
714
722
  /** Fetches historical versions of an entry */
715
723
  async getEntryHistory(options) {
@@ -2296,7 +2304,10 @@ var RouteClient = class extends ApiClient9 {
2296
2304
  async getRoute(options) {
2297
2305
  const { projectId } = this.options;
2298
2306
  const fetchUri = this.createUrl(ROUTE_URL, { ...options, projectId }, this.edgeApiHost);
2299
- return await this.apiClient(fetchUri);
2307
+ return await this.apiClient(
2308
+ fetchUri,
2309
+ this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
2310
+ );
2300
2311
  }
2301
2312
  };
2302
2313
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.90.1-alpha.8+b7a030f80",
3
+ "version": "19.91.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.90.1-alpha.8+b7a030f80",
42
- "@uniformdev/context": "19.90.1-alpha.8+b7a030f80",
41
+ "@uniformdev/assets": "19.91.0",
42
+ "@uniformdev/context": "19.91.0",
43
43
  "immer": "10.0.3"
44
44
  },
45
45
  "files": [
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "b7a030f80fb1ba2389f8d9e1f34329da488dcf4c"
51
+ "gitHead": "c1d1a232c177a29f73ec0334d5b70e11fc6f4d77"
52
52
  }