@uniformdev/canvas-next-rsc 19.147.0 → 19.147.1-alpha.3

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/handler.js CHANGED
@@ -228,6 +228,7 @@ var getCanvasClient = (options) => {
228
228
  apiHost: env.getApiHost(),
229
229
  apiKey: env.getApiKey(),
230
230
  edgeApiHost: env.getEdgeApiHost(),
231
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
231
232
  fetch: (req, init) => {
232
233
  let requestedUrl;
233
234
  if (typeof req === "string") {
@@ -259,7 +260,7 @@ var getCanvasClient = (options) => {
259
260
  cache,
260
261
  headers: {
261
262
  ...init == null ? void 0 : init.headers,
262
- "x-bypass-cache": "true"
263
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
263
264
  },
264
265
  next: {
265
266
  revalidate
@@ -282,7 +283,7 @@ var getProjectMapClient = (options) => {
282
283
  ...init,
283
284
  headers: {
284
285
  ...init == null ? void 0 : init.headers,
285
- "x-bypass-cache": "true"
286
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
286
287
  },
287
288
  cache,
288
289
  next: {
@@ -301,6 +302,7 @@ var getRouteClient = (options) => {
301
302
  projectId: env.getProjectId(),
302
303
  apiKey: env.getApiKey(),
303
304
  edgeApiHost: env.getEdgeApiHost(),
305
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
304
306
  fetch: (req, init) => {
305
307
  let requestedUrl;
306
308
  if (typeof req === "string") {
@@ -328,7 +330,7 @@ var getRouteClient = (options) => {
328
330
  ...init,
329
331
  headers: {
330
332
  ...init == null ? void 0 : init.headers,
331
- "x-bypass-cache": "true"
333
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
332
334
  },
333
335
  cache,
334
336
  next: {
@@ -382,6 +384,7 @@ var processCompositionChange = async (compositionId) => {
382
384
  getComposition({ compositionId })
383
385
  ]);
384
386
  const tags = [];
387
+ const paths = [];
385
388
  if (composition == null ? void 0 : composition.pattern) {
386
389
  tags.push("route");
387
390
  }
@@ -391,12 +394,17 @@ var processCompositionChange = async (compositionId) => {
391
394
  await processEdgeConfigChange({
392
395
  source_url: node.path
393
396
  });
394
- tags.push(...buildProjectMapNodePaths(node.path));
397
+ const result = buildProjectMapNodePaths(node.path);
398
+ tags.push(...result.tags);
399
+ if (result.paths) {
400
+ paths.push(...result.paths);
401
+ }
395
402
  }
396
403
  }
397
404
  tags.push(buildCompositionTag(compositionId));
398
405
  return {
399
- tags
406
+ tags,
407
+ paths
400
408
  };
401
409
  };
402
410
  var getComposition = async ({ compositionId }) => {
@@ -419,9 +427,11 @@ var getComposition = async ({ compositionId }) => {
419
427
  };
420
428
  var buildProjectMapNodePaths = (path) => {
421
429
  const tags = [];
430
+ const paths = [];
422
431
  const isDynamic = path.includes(":");
423
432
  if (!isDynamic) {
424
433
  tags.push(buildPathTag(path));
434
+ paths.push(path);
425
435
  } else {
426
436
  const pieces = path.split("/");
427
437
  const invalidatePieces = [];
@@ -434,8 +444,12 @@ var buildProjectMapNodePaths = (path) => {
434
444
  }
435
445
  const toInvalidate = invalidatePieces.join("/");
436
446
  tags.push(buildPathTag(toInvalidate));
447
+ paths.push(toInvalidate);
437
448
  }
438
- return tags;
449
+ return {
450
+ tags,
451
+ paths
452
+ };
439
453
  };
440
454
  var getPathName = (url) => {
441
455
  try {
@@ -450,7 +464,8 @@ var processRedirectChange = async (sourceUrl) => {
450
464
  const pathName = getPathName(sourceUrl);
451
465
  tags.push(buildPathTag(pathName));
452
466
  return {
453
- tags
467
+ tags,
468
+ paths: [pathName]
454
469
  };
455
470
  };
456
471
  var processEdgeConfigChange = async ({ source_url }) => {
@@ -557,7 +572,12 @@ var handleProjectMapNodeDelete = async (body) => {
557
572
  return void 0;
558
573
  }
559
574
  const tags = [];
560
- tags.push(...buildProjectMapNodePaths(parsed.data.path));
575
+ const paths = [];
576
+ const result = buildProjectMapNodePaths(parsed.data.path);
577
+ tags.push(...result.tags);
578
+ if (result.paths) {
579
+ paths.push(...result.paths);
580
+ }
561
581
  const config = getServerConfig();
562
582
  if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
563
583
  await processEdgeConfigChange({
@@ -565,7 +585,8 @@ var handleProjectMapNodeDelete = async (body) => {
565
585
  });
566
586
  }
567
587
  return {
568
- tags
588
+ tags,
589
+ paths
569
590
  };
570
591
  };
571
592
 
@@ -578,7 +599,12 @@ var handleProjectMapNodeInsert = async (body) => {
578
599
  return void 0;
579
600
  }
580
601
  const tags = [];
581
- tags.push(...buildProjectMapNodePaths(parsed.data.path));
602
+ const paths = [];
603
+ const result = buildProjectMapNodePaths(parsed.data.path);
604
+ tags.push(...result.tags);
605
+ if (result.paths) {
606
+ paths.push(...result.paths);
607
+ }
582
608
  const config = getServerConfig();
583
609
  if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
584
610
  await processEdgeConfigChange({
@@ -586,7 +612,8 @@ var handleProjectMapNodeInsert = async (body) => {
586
612
  });
587
613
  }
588
614
  return {
589
- tags
615
+ tags,
616
+ paths
590
617
  };
591
618
  };
592
619
 
@@ -599,8 +626,17 @@ var handleProjectMapNodeUpdate = async (body) => {
599
626
  return void 0;
600
627
  }
601
628
  const tags = [];
602
- tags.push(...buildProjectMapNodePaths(parsed.data.path));
603
- tags.push(...buildProjectMapNodePaths(parsed.data.previous_path));
629
+ const paths = [];
630
+ const currentResult = buildProjectMapNodePaths(parsed.data.path);
631
+ tags.push(...currentResult.tags);
632
+ if (currentResult.paths) {
633
+ paths.push(...currentResult.paths);
634
+ }
635
+ const previousResult = buildProjectMapNodePaths(parsed.data.previous_path);
636
+ tags.push(...previousResult.tags);
637
+ if (previousResult.paths) {
638
+ paths.push(...previousResult.paths);
639
+ }
604
640
  const config = getServerConfig();
605
641
  if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
606
642
  await processEdgeConfigChange({
@@ -608,7 +644,8 @@ var handleProjectMapNodeUpdate = async (body) => {
608
644
  });
609
645
  }
610
646
  return {
611
- tags
647
+ tags,
648
+ paths
612
649
  };
613
650
  };
614
651
 
@@ -703,6 +740,7 @@ var handleSvixMessage = async (request) => {
703
740
  handleManifestPublished
704
741
  ];
705
742
  let tags = void 0;
743
+ let paths = void 0;
706
744
  let jsonBody;
707
745
  try {
708
746
  jsonBody = await request.json();
@@ -715,6 +753,7 @@ var handleSvixMessage = async (request) => {
715
753
  const result = await handler(jsonBody);
716
754
  if (result) {
717
755
  tags = result.tags;
756
+ paths = result.paths;
718
757
  break;
719
758
  }
720
759
  }
@@ -724,10 +763,17 @@ var handleSvixMessage = async (request) => {
724
763
  (0, import_cache.revalidateTag)(tag);
725
764
  }
726
765
  }
766
+ if (paths == null ? void 0 : paths.length) {
767
+ for (let i = 0; i < paths.length; i++) {
768
+ const path = paths[i];
769
+ (0, import_cache.revalidatePath)(path);
770
+ }
771
+ }
727
772
  return new Response(
728
773
  JSON.stringify({
729
- handled: typeof tags !== "undefined",
730
- tags
774
+ handled: typeof tags !== "undefined" || typeof paths !== "undefined",
775
+ tags,
776
+ paths
731
777
  })
732
778
  );
733
779
  };
package/dist/handler.mjs CHANGED
@@ -142,7 +142,7 @@ var createPreviewOPTIONSRouteHandler = () => {
142
142
 
143
143
  // src/handler/createPreviewPOSTRouteHandler.ts
144
144
  import { SECRET_QUERY_STRING_PARAM as SECRET_QUERY_STRING_PARAM2 } from "@uniformdev/canvas";
145
- import { revalidateTag } from "next/cache";
145
+ import { revalidatePath, revalidateTag } from "next/cache";
146
146
 
147
147
  // src/handler/helpers.ts
148
148
  import { ApiClientError } from "@uniformdev/canvas";
@@ -213,6 +213,7 @@ var getCanvasClient = (options) => {
213
213
  apiHost: env.getApiHost(),
214
214
  apiKey: env.getApiKey(),
215
215
  edgeApiHost: env.getEdgeApiHost(),
216
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
216
217
  fetch: (req, init) => {
217
218
  let requestedUrl;
218
219
  if (typeof req === "string") {
@@ -244,7 +245,7 @@ var getCanvasClient = (options) => {
244
245
  cache,
245
246
  headers: {
246
247
  ...init == null ? void 0 : init.headers,
247
- "x-bypass-cache": "true"
248
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
248
249
  },
249
250
  next: {
250
251
  revalidate
@@ -267,7 +268,7 @@ var getProjectMapClient = (options) => {
267
268
  ...init,
268
269
  headers: {
269
270
  ...init == null ? void 0 : init.headers,
270
- "x-bypass-cache": "true"
271
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
271
272
  },
272
273
  cache,
273
274
  next: {
@@ -286,6 +287,7 @@ var getRouteClient = (options) => {
286
287
  projectId: env.getProjectId(),
287
288
  apiKey: env.getApiKey(),
288
289
  edgeApiHost: env.getEdgeApiHost(),
290
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
289
291
  fetch: (req, init) => {
290
292
  let requestedUrl;
291
293
  if (typeof req === "string") {
@@ -313,7 +315,7 @@ var getRouteClient = (options) => {
313
315
  ...init,
314
316
  headers: {
315
317
  ...init == null ? void 0 : init.headers,
316
- "x-bypass-cache": "true"
318
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
317
319
  },
318
320
  cache,
319
321
  next: {
@@ -367,6 +369,7 @@ var processCompositionChange = async (compositionId) => {
367
369
  getComposition({ compositionId })
368
370
  ]);
369
371
  const tags = [];
372
+ const paths = [];
370
373
  if (composition == null ? void 0 : composition.pattern) {
371
374
  tags.push("route");
372
375
  }
@@ -376,12 +379,17 @@ var processCompositionChange = async (compositionId) => {
376
379
  await processEdgeConfigChange({
377
380
  source_url: node.path
378
381
  });
379
- tags.push(...buildProjectMapNodePaths(node.path));
382
+ const result = buildProjectMapNodePaths(node.path);
383
+ tags.push(...result.tags);
384
+ if (result.paths) {
385
+ paths.push(...result.paths);
386
+ }
380
387
  }
381
388
  }
382
389
  tags.push(buildCompositionTag(compositionId));
383
390
  return {
384
- tags
391
+ tags,
392
+ paths
385
393
  };
386
394
  };
387
395
  var getComposition = async ({ compositionId }) => {
@@ -404,9 +412,11 @@ var getComposition = async ({ compositionId }) => {
404
412
  };
405
413
  var buildProjectMapNodePaths = (path) => {
406
414
  const tags = [];
415
+ const paths = [];
407
416
  const isDynamic = path.includes(":");
408
417
  if (!isDynamic) {
409
418
  tags.push(buildPathTag(path));
419
+ paths.push(path);
410
420
  } else {
411
421
  const pieces = path.split("/");
412
422
  const invalidatePieces = [];
@@ -419,8 +429,12 @@ var buildProjectMapNodePaths = (path) => {
419
429
  }
420
430
  const toInvalidate = invalidatePieces.join("/");
421
431
  tags.push(buildPathTag(toInvalidate));
432
+ paths.push(toInvalidate);
422
433
  }
423
- return tags;
434
+ return {
435
+ tags,
436
+ paths
437
+ };
424
438
  };
425
439
  var getPathName = (url) => {
426
440
  try {
@@ -435,7 +449,8 @@ var processRedirectChange = async (sourceUrl) => {
435
449
  const pathName = getPathName(sourceUrl);
436
450
  tags.push(buildPathTag(pathName));
437
451
  return {
438
- tags
452
+ tags,
453
+ paths: [pathName]
439
454
  };
440
455
  };
441
456
  var processEdgeConfigChange = async ({ source_url }) => {
@@ -542,7 +557,12 @@ var handleProjectMapNodeDelete = async (body) => {
542
557
  return void 0;
543
558
  }
544
559
  const tags = [];
545
- tags.push(...buildProjectMapNodePaths(parsed.data.path));
560
+ const paths = [];
561
+ const result = buildProjectMapNodePaths(parsed.data.path);
562
+ tags.push(...result.tags);
563
+ if (result.paths) {
564
+ paths.push(...result.paths);
565
+ }
546
566
  const config = getServerConfig();
547
567
  if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
548
568
  await processEdgeConfigChange({
@@ -550,7 +570,8 @@ var handleProjectMapNodeDelete = async (body) => {
550
570
  });
551
571
  }
552
572
  return {
553
- tags
573
+ tags,
574
+ paths
554
575
  };
555
576
  };
556
577
 
@@ -563,7 +584,12 @@ var handleProjectMapNodeInsert = async (body) => {
563
584
  return void 0;
564
585
  }
565
586
  const tags = [];
566
- tags.push(...buildProjectMapNodePaths(parsed.data.path));
587
+ const paths = [];
588
+ const result = buildProjectMapNodePaths(parsed.data.path);
589
+ tags.push(...result.tags);
590
+ if (result.paths) {
591
+ paths.push(...result.paths);
592
+ }
567
593
  const config = getServerConfig();
568
594
  if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
569
595
  await processEdgeConfigChange({
@@ -571,7 +597,8 @@ var handleProjectMapNodeInsert = async (body) => {
571
597
  });
572
598
  }
573
599
  return {
574
- tags
600
+ tags,
601
+ paths
575
602
  };
576
603
  };
577
604
 
@@ -584,8 +611,17 @@ var handleProjectMapNodeUpdate = async (body) => {
584
611
  return void 0;
585
612
  }
586
613
  const tags = [];
587
- tags.push(...buildProjectMapNodePaths(parsed.data.path));
588
- tags.push(...buildProjectMapNodePaths(parsed.data.previous_path));
614
+ const paths = [];
615
+ const currentResult = buildProjectMapNodePaths(parsed.data.path);
616
+ tags.push(...currentResult.tags);
617
+ if (currentResult.paths) {
618
+ paths.push(...currentResult.paths);
619
+ }
620
+ const previousResult = buildProjectMapNodePaths(parsed.data.previous_path);
621
+ tags.push(...previousResult.tags);
622
+ if (previousResult.paths) {
623
+ paths.push(...previousResult.paths);
624
+ }
589
625
  const config = getServerConfig();
590
626
  if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
591
627
  await processEdgeConfigChange({
@@ -593,7 +629,8 @@ var handleProjectMapNodeUpdate = async (body) => {
593
629
  });
594
630
  }
595
631
  return {
596
- tags
632
+ tags,
633
+ paths
597
634
  };
598
635
  };
599
636
 
@@ -688,6 +725,7 @@ var handleSvixMessage = async (request) => {
688
725
  handleManifestPublished
689
726
  ];
690
727
  let tags = void 0;
728
+ let paths = void 0;
691
729
  let jsonBody;
692
730
  try {
693
731
  jsonBody = await request.json();
@@ -700,6 +738,7 @@ var handleSvixMessage = async (request) => {
700
738
  const result = await handler(jsonBody);
701
739
  if (result) {
702
740
  tags = result.tags;
741
+ paths = result.paths;
703
742
  break;
704
743
  }
705
744
  }
@@ -709,10 +748,17 @@ var handleSvixMessage = async (request) => {
709
748
  revalidateTag(tag);
710
749
  }
711
750
  }
751
+ if (paths == null ? void 0 : paths.length) {
752
+ for (let i = 0; i < paths.length; i++) {
753
+ const path = paths[i];
754
+ revalidatePath(path);
755
+ }
756
+ }
712
757
  return new Response(
713
758
  JSON.stringify({
714
- handled: typeof tags !== "undefined",
715
- tags
759
+ handled: typeof tags !== "undefined" || typeof paths !== "undefined",
760
+ tags,
761
+ paths
716
762
  })
717
763
  );
718
764
  };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CanvasClient, RouteClient, ResolvedRouteGetResponse, RouteGetParameters } from '@uniformdev/canvas';
2
- import { CacheMode, PageParameters, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
2
+ import { UniformServerConfig, PageParameters, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
3
3
  export { PageParameters, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
4
4
  import { ManifestClient } from '@uniformdev/context/api';
5
5
  import { ProjectMapClient, ProjectMapNode } from '@uniformdev/project-map';
@@ -10,7 +10,7 @@ export { a as UniformComposition, r as resolveComposition } from './UniformCompo
10
10
  import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
11
11
 
12
12
  type GetCanvasClientOptions = {
13
- cache: CacheMode;
13
+ cache: NonNullable<UniformServerConfig['canvasCache']>;
14
14
  };
15
15
  declare const getCanvasClient: (options: GetCanvasClientOptions) => CanvasClient;
16
16
  declare const getDefaultCanvasClient: ({ searchParams, }: {
@@ -18,7 +18,7 @@ declare const getDefaultCanvasClient: ({ searchParams, }: {
18
18
  }) => CanvasClient;
19
19
 
20
20
  type GetManifestClientOptions = {
21
- cache: CacheMode;
21
+ cache: NonNullable<UniformServerConfig['manifestCache']>;
22
22
  };
23
23
  declare const getManifestClient: (options: GetManifestClientOptions) => ManifestClient;
24
24
  declare const getDefaultManifestClient: ({ searchParams, }: {
@@ -183,7 +183,7 @@ declare const getManifest: ({ searchParams }: {
183
183
  }>;
184
184
 
185
185
  type GetProjectMapClientOptions = {
186
- cache: CacheMode;
186
+ cache: NonNullable<UniformServerConfig['projectMapCache']>;
187
187
  };
188
188
  declare const getProjectMapClient: (options: GetProjectMapClientOptions) => ProjectMapClient;
189
189
  declare const getDefaultProjectMapClient: ({ searchParams, }: {
@@ -191,7 +191,7 @@ declare const getDefaultProjectMapClient: ({ searchParams, }: {
191
191
  }) => ProjectMapClient;
192
192
 
193
193
  type GetRouteClientOptions = {
194
- cache: CacheMode;
194
+ cache: NonNullable<UniformServerConfig['canvasCache']>;
195
195
  };
196
196
  declare const getRouteClient: (options: GetRouteClientOptions) => RouteClient;
197
197
  declare const getDefaultRouteClient: ({ searchParams }: {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CanvasClient, RouteClient, ResolvedRouteGetResponse, RouteGetParameters } from '@uniformdev/canvas';
2
- import { CacheMode, PageParameters, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
2
+ import { UniformServerConfig, PageParameters, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
3
3
  export { PageParameters, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
4
4
  import { ManifestClient } from '@uniformdev/context/api';
5
5
  import { ProjectMapClient, ProjectMapNode } from '@uniformdev/project-map';
@@ -10,7 +10,7 @@ export { a as UniformComposition, r as resolveComposition } from './UniformCompo
10
10
  import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
11
11
 
12
12
  type GetCanvasClientOptions = {
13
- cache: CacheMode;
13
+ cache: NonNullable<UniformServerConfig['canvasCache']>;
14
14
  };
15
15
  declare const getCanvasClient: (options: GetCanvasClientOptions) => CanvasClient;
16
16
  declare const getDefaultCanvasClient: ({ searchParams, }: {
@@ -18,7 +18,7 @@ declare const getDefaultCanvasClient: ({ searchParams, }: {
18
18
  }) => CanvasClient;
19
19
 
20
20
  type GetManifestClientOptions = {
21
- cache: CacheMode;
21
+ cache: NonNullable<UniformServerConfig['manifestCache']>;
22
22
  };
23
23
  declare const getManifestClient: (options: GetManifestClientOptions) => ManifestClient;
24
24
  declare const getDefaultManifestClient: ({ searchParams, }: {
@@ -183,7 +183,7 @@ declare const getManifest: ({ searchParams }: {
183
183
  }>;
184
184
 
185
185
  type GetProjectMapClientOptions = {
186
- cache: CacheMode;
186
+ cache: NonNullable<UniformServerConfig['projectMapCache']>;
187
187
  };
188
188
  declare const getProjectMapClient: (options: GetProjectMapClientOptions) => ProjectMapClient;
189
189
  declare const getDefaultProjectMapClient: ({ searchParams, }: {
@@ -191,7 +191,7 @@ declare const getDefaultProjectMapClient: ({ searchParams, }: {
191
191
  }) => ProjectMapClient;
192
192
 
193
193
  type GetRouteClientOptions = {
194
- cache: CacheMode;
194
+ cache: NonNullable<UniformServerConfig['canvasCache']>;
195
195
  };
196
196
  declare const getRouteClient: (options: GetRouteClientOptions) => RouteClient;
197
197
  declare const getDefaultRouteClient: ({ searchParams }: {
package/dist/index.esm.js CHANGED
@@ -174,6 +174,7 @@ var getCanvasClient = (options) => {
174
174
  apiHost: env.getApiHost(),
175
175
  apiKey: env.getApiKey(),
176
176
  edgeApiHost: env.getEdgeApiHost(),
177
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
177
178
  fetch: (req, init) => {
178
179
  let requestedUrl;
179
180
  if (typeof req === "string") {
@@ -205,7 +206,7 @@ var getCanvasClient = (options) => {
205
206
  cache,
206
207
  headers: {
207
208
  ...init == null ? void 0 : init.headers,
208
- "x-bypass-cache": "true"
209
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
209
210
  },
210
211
  next: {
211
212
  revalidate
@@ -237,7 +238,7 @@ var getManifestClient = (options) => {
237
238
  ...init,
238
239
  headers: {
239
240
  ...init == null ? void 0 : init.headers,
240
- "x-bypass-cache": "true"
241
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
241
242
  },
242
243
  cache,
243
244
  next: {
@@ -278,7 +279,7 @@ var getProjectMapClient = (options) => {
278
279
  ...init,
279
280
  headers: {
280
281
  ...init == null ? void 0 : init.headers,
281
- "x-bypass-cache": "true"
282
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
282
283
  },
283
284
  cache,
284
285
  next: {
@@ -306,6 +307,7 @@ var getRouteClient = (options) => {
306
307
  projectId: env.getProjectId(),
307
308
  apiKey: env.getApiKey(),
308
309
  edgeApiHost: env.getEdgeApiHost(),
310
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
309
311
  fetch: (req, init) => {
310
312
  let requestedUrl;
311
313
  if (typeof req === "string") {
@@ -333,7 +335,7 @@ var getRouteClient = (options) => {
333
335
  ...init,
334
336
  headers: {
335
337
  ...init == null ? void 0 : init.headers,
336
- "x-bypass-cache": "true"
338
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
337
339
  },
338
340
  cache,
339
341
  next: {
package/dist/index.js CHANGED
@@ -221,6 +221,7 @@ var getCanvasClient = (options) => {
221
221
  apiHost: env.getApiHost(),
222
222
  apiKey: env.getApiKey(),
223
223
  edgeApiHost: env.getEdgeApiHost(),
224
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
224
225
  fetch: (req, init) => {
225
226
  let requestedUrl;
226
227
  if (typeof req === "string") {
@@ -252,7 +253,7 @@ var getCanvasClient = (options) => {
252
253
  cache,
253
254
  headers: {
254
255
  ...init == null ? void 0 : init.headers,
255
- "x-bypass-cache": "true"
256
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
256
257
  },
257
258
  next: {
258
259
  revalidate
@@ -284,7 +285,7 @@ var getManifestClient = (options) => {
284
285
  ...init,
285
286
  headers: {
286
287
  ...init == null ? void 0 : init.headers,
287
- "x-bypass-cache": "true"
288
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
288
289
  },
289
290
  cache,
290
291
  next: {
@@ -325,7 +326,7 @@ var getProjectMapClient = (options) => {
325
326
  ...init,
326
327
  headers: {
327
328
  ...init == null ? void 0 : init.headers,
328
- "x-bypass-cache": "true"
329
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
329
330
  },
330
331
  cache,
331
332
  next: {
@@ -353,6 +354,7 @@ var getRouteClient = (options) => {
353
354
  projectId: env.getProjectId(),
354
355
  apiKey: env.getApiKey(),
355
356
  edgeApiHost: env.getEdgeApiHost(),
357
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
356
358
  fetch: (req, init) => {
357
359
  let requestedUrl;
358
360
  if (typeof req === "string") {
@@ -380,7 +382,7 @@ var getRouteClient = (options) => {
380
382
  ...init,
381
383
  headers: {
382
384
  ...init == null ? void 0 : init.headers,
383
- "x-bypass-cache": "true"
385
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
384
386
  },
385
387
  cache,
386
388
  next: {
package/dist/index.mjs CHANGED
@@ -174,6 +174,7 @@ var getCanvasClient = (options) => {
174
174
  apiHost: env.getApiHost(),
175
175
  apiKey: env.getApiKey(),
176
176
  edgeApiHost: env.getEdgeApiHost(),
177
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
177
178
  fetch: (req, init) => {
178
179
  let requestedUrl;
179
180
  if (typeof req === "string") {
@@ -205,7 +206,7 @@ var getCanvasClient = (options) => {
205
206
  cache,
206
207
  headers: {
207
208
  ...init == null ? void 0 : init.headers,
208
- "x-bypass-cache": "true"
209
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
209
210
  },
210
211
  next: {
211
212
  revalidate
@@ -237,7 +238,7 @@ var getManifestClient = (options) => {
237
238
  ...init,
238
239
  headers: {
239
240
  ...init == null ? void 0 : init.headers,
240
- "x-bypass-cache": "true"
241
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
241
242
  },
242
243
  cache,
243
244
  next: {
@@ -278,7 +279,7 @@ var getProjectMapClient = (options) => {
278
279
  ...init,
279
280
  headers: {
280
281
  ...init == null ? void 0 : init.headers,
281
- "x-bypass-cache": "true"
282
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
282
283
  },
283
284
  cache,
284
285
  next: {
@@ -306,6 +307,7 @@ var getRouteClient = (options) => {
306
307
  projectId: env.getProjectId(),
307
308
  apiKey: env.getApiKey(),
308
309
  edgeApiHost: env.getEdgeApiHost(),
310
+ disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
309
311
  fetch: (req, init) => {
310
312
  let requestedUrl;
311
313
  if (typeof req === "string") {
@@ -333,7 +335,7 @@ var getRouteClient = (options) => {
333
335
  ...init,
334
336
  headers: {
335
337
  ...init == null ? void 0 : init.headers,
336
- "x-bypass-cache": "true"
338
+ "x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
337
339
  },
338
340
  cache,
339
341
  next: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc",
3
- "version": "19.147.0",
3
+ "version": "19.147.1-alpha.3+1af8304702",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -61,15 +61,15 @@
61
61
  "react-dom": "18.2.0"
62
62
  },
63
63
  "dependencies": {
64
- "@uniformdev/canvas": "19.147.0",
65
- "@uniformdev/canvas-next-rsc-client": "^19.147.0",
66
- "@uniformdev/canvas-next-rsc-shared": "^19.147.0",
67
- "@uniformdev/canvas-react": "19.147.0",
68
- "@uniformdev/context": "19.147.0",
69
- "@uniformdev/project-map": "19.147.0",
70
- "@uniformdev/redirect": "19.147.0",
71
- "@uniformdev/richtext": "19.147.0",
72
- "@uniformdev/webhooks": "19.147.0",
64
+ "@uniformdev/canvas": "19.147.1-alpha.3+1af8304702",
65
+ "@uniformdev/canvas-next-rsc-client": "^19.147.1-alpha.3+1af8304702",
66
+ "@uniformdev/canvas-next-rsc-shared": "^19.147.1-alpha.3+1af8304702",
67
+ "@uniformdev/canvas-react": "19.147.1-alpha.3+1af8304702",
68
+ "@uniformdev/context": "19.147.1-alpha.3+1af8304702",
69
+ "@uniformdev/project-map": "19.147.1-alpha.3+1af8304702",
70
+ "@uniformdev/redirect": "19.147.1-alpha.3+1af8304702",
71
+ "@uniformdev/richtext": "19.147.1-alpha.3+1af8304702",
72
+ "@uniformdev/webhooks": "19.147.1-alpha.3+1af8304702",
73
73
  "@vercel/edge-config": "^0.4.0",
74
74
  "encoding": "^0.1.13",
75
75
  "server-only": "^0.0.1",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "bdc172cb3eea065221b90993b142e6b34c4b93b1"
89
+ "gitHead": "1af830470251c963f96bad096f543cfd3b612ffe"
90
90
  }