@uniformdev/canvas-next 20.50.2-alpha.149 → 20.50.2-alpha.167

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.js CHANGED
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  NextLinkRichTextNode: () => NextLinkRichTextNode,
34
34
  UniformRichText: () => UniformRichText,
35
35
  UniformRichTextNode: () => UniformRichTextNode,
@@ -39,7 +39,7 @@ __export(src_exports, {
39
39
  resolveSlugFromParams: () => resolveSlugFromParams,
40
40
  useResolveNextRichTextRenderer: () => useResolveNextRichTextRenderer
41
41
  });
42
- module.exports = __toCommonJS(src_exports);
42
+ module.exports = __toCommonJS(index_exports);
43
43
 
44
44
  // src/components/UniformRichText.tsx
45
45
  var import_canvas_react = require("@uniformdev/canvas-react");
@@ -1,9 +1,9 @@
1
1
  import * as next from 'next';
2
2
  import { GetServerSidePropsContext, PreviewData, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
3
3
  import { a as UniformGetServerSideProps, c as UniformPreviewData, b as UniformGetStaticProps } from '../models-BGg_qtcM.mjs';
4
- import * as querystring from 'querystring';
4
+ import * as node_querystring from 'node:querystring';
5
+ import { CompositionDeliveryClient, CompositionDeliveryReadOptions } from '@uniformdev/canvas';
5
6
  import { ParsedUrlQuery } from 'querystring';
6
- import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
7
7
  import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
8
8
  import '@uniformdev/canvas-react';
9
9
 
@@ -13,7 +13,7 @@ declare const withUniformGetServerSideProps: <TProps extends {
13
13
  [key: string]: any;
14
14
  }>(options?: {
15
15
  /** If you need to override the default client, you can pass it here */
16
- client?: CanvasClient;
16
+ client?: CompositionDeliveryClient;
17
17
  /** A string that you want to strip from the resolved context.resolvedUrl. Useful when calling from a nested folder which is not part of your project map structure */
18
18
  prefix?: string;
19
19
  /** Useful when you need to modify the path passed to the API */
@@ -21,8 +21,11 @@ declare const withUniformGetServerSideProps: <TProps extends {
21
21
  /** Set to true if you want to include draft compositions */
22
22
  preview?: boolean;
23
23
  projectMapId?: string;
24
- /** Way to override getCompositionByNodePath request params */
25
- requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
24
+ /** Way to override get request params */
25
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
26
+ projectMapNodePath: string;
27
+ projectMapId?: string;
28
+ }>, "state">;
26
29
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
27
30
  callback?: UniformGetServerSideProps<TProps>;
28
31
  /** Disables logging of response information and timings */
@@ -61,9 +64,12 @@ declare const withUniformGetStaticProps: <TProps extends {
61
64
  /** Set to true if you want to include draft compositions */
62
65
  preview?: boolean;
63
66
  /** If you need to override the default client, you can pass it here */
64
- client?: CanvasClient;
65
- /** Way to override getCompositionByNodePath request params */
66
- requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
67
+ client?: CompositionDeliveryClient;
68
+ /** Way to override get request params */
69
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
70
+ projectMapNodePath: string;
71
+ projectMapId?: string;
72
+ }>, "state">;
67
73
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
68
74
  callback?: UniformGetStaticProps<TProps>;
69
75
  /** Disables logging of response information and timings */
@@ -72,11 +78,11 @@ declare const withUniformGetStaticProps: <TProps extends {
72
78
 
73
79
  declare const getServerSideProps: next.GetServerSideProps<{
74
80
  [key: string]: any;
75
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
81
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
76
82
  /** Ready to go getStaticProps for dynamic route with 'path' param for [[...path]].jsx */
77
83
  declare const getStaticProps: next.GetStaticProps<{
78
84
  [key: string]: any;
79
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
85
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
80
86
  declare const getStaticPaths: () => Promise<{
81
87
  paths: string[] | undefined;
82
88
  fallback: boolean;
@@ -1,9 +1,9 @@
1
1
  import * as next from 'next';
2
2
  import { GetServerSidePropsContext, PreviewData, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
3
3
  import { a as UniformGetServerSideProps, c as UniformPreviewData, b as UniformGetStaticProps } from '../models-BGg_qtcM.js';
4
- import * as querystring from 'querystring';
4
+ import * as node_querystring from 'node:querystring';
5
+ import { CompositionDeliveryClient, CompositionDeliveryReadOptions } from '@uniformdev/canvas';
5
6
  import { ParsedUrlQuery } from 'querystring';
6
- import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
7
7
  import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
8
8
  import '@uniformdev/canvas-react';
9
9
 
@@ -13,7 +13,7 @@ declare const withUniformGetServerSideProps: <TProps extends {
13
13
  [key: string]: any;
14
14
  }>(options?: {
15
15
  /** If you need to override the default client, you can pass it here */
16
- client?: CanvasClient;
16
+ client?: CompositionDeliveryClient;
17
17
  /** A string that you want to strip from the resolved context.resolvedUrl. Useful when calling from a nested folder which is not part of your project map structure */
18
18
  prefix?: string;
19
19
  /** Useful when you need to modify the path passed to the API */
@@ -21,8 +21,11 @@ declare const withUniformGetServerSideProps: <TProps extends {
21
21
  /** Set to true if you want to include draft compositions */
22
22
  preview?: boolean;
23
23
  projectMapId?: string;
24
- /** Way to override getCompositionByNodePath request params */
25
- requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
24
+ /** Way to override get request params */
25
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
26
+ projectMapNodePath: string;
27
+ projectMapId?: string;
28
+ }>, "state">;
26
29
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
27
30
  callback?: UniformGetServerSideProps<TProps>;
28
31
  /** Disables logging of response information and timings */
@@ -61,9 +64,12 @@ declare const withUniformGetStaticProps: <TProps extends {
61
64
  /** Set to true if you want to include draft compositions */
62
65
  preview?: boolean;
63
66
  /** If you need to override the default client, you can pass it here */
64
- client?: CanvasClient;
65
- /** Way to override getCompositionByNodePath request params */
66
- requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
67
+ client?: CompositionDeliveryClient;
68
+ /** Way to override get request params */
69
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
70
+ projectMapNodePath: string;
71
+ projectMapId?: string;
72
+ }>, "state">;
67
73
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
68
74
  callback?: UniformGetStaticProps<TProps>;
69
75
  /** Disables logging of response information and timings */
@@ -72,11 +78,11 @@ declare const withUniformGetStaticProps: <TProps extends {
72
78
 
73
79
  declare const getServerSideProps: next.GetServerSideProps<{
74
80
  [key: string]: any;
75
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
81
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
76
82
  /** Ready to go getStaticProps for dynamic route with 'path' param for [[...path]].jsx */
77
83
  declare const getStaticProps: next.GetStaticProps<{
78
84
  [key: string]: any;
79
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
85
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
80
86
  declare const getStaticPaths: () => Promise<{
81
87
  paths: string[] | undefined;
82
88
  fallback: boolean;
@@ -152,7 +152,7 @@ function resolveDiagnosticsDuration(data) {
152
152
 
153
153
  // src/project-map/withUniformGetServerSideProps.ts
154
154
  var withUniformGetServerSideProps = (options) => {
155
- const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CanvasClient({
155
+ const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CompositionDeliveryClient({
156
156
  apiKey: process.env.UNIFORM_API_KEY,
157
157
  projectId: process.env.UNIFORM_PROJECT_ID,
158
158
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -177,7 +177,7 @@ var withUniformGetServerSideProps = (options) => {
177
177
  } else {
178
178
  try {
179
179
  const time = Date.now();
180
- const response = await canvasClient.getCompositionByNodePath({
180
+ const response = await canvasClient.get({
181
181
  ...options == null ? void 0 : options.requestOptions,
182
182
  projectMapId,
183
183
  projectMapNodePath: nodePath,
@@ -251,7 +251,7 @@ var resolveSlugFromParams = ({
251
251
  // src/project-map/withUniformGetStaticProps.ts
252
252
  var withUniformGetStaticProps = (options) => {
253
253
  var _a;
254
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas3.CanvasClient({
254
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas3.CompositionDeliveryClient({
255
255
  apiKey: process.env.UNIFORM_API_KEY,
256
256
  projectId: process.env.UNIFORM_PROJECT_ID,
257
257
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -279,7 +279,7 @@ var withUniformGetStaticProps = (options) => {
279
279
  } else {
280
280
  try {
281
281
  const time = Date.now();
282
- const response = await canvasClient.getCompositionByNodePath({
282
+ const response = await canvasClient.get({
283
283
  ...options == null ? void 0 : options.requestOptions,
284
284
  projectMapId,
285
285
  projectMapNodePath: pathString,
@@ -10,11 +10,11 @@ import {
10
10
  import {
11
11
  CANVAS_DRAFT_STATE,
12
12
  CANVAS_PUBLISHED_STATE,
13
- CanvasClient,
13
+ CompositionDeliveryClient,
14
14
  EMPTY_COMPOSITION
15
15
  } from "@uniformdev/canvas";
16
16
  var withUniformGetServerSideProps = (options) => {
17
- const canvasClient = (options == null ? void 0 : options.client) || new CanvasClient({
17
+ const canvasClient = (options == null ? void 0 : options.client) || new CompositionDeliveryClient({
18
18
  apiKey: process.env.UNIFORM_API_KEY,
19
19
  projectId: process.env.UNIFORM_PROJECT_ID,
20
20
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -39,7 +39,7 @@ var withUniformGetServerSideProps = (options) => {
39
39
  } else {
40
40
  try {
41
41
  const time = Date.now();
42
- const response = await canvasClient.getCompositionByNodePath({
42
+ const response = await canvasClient.get({
43
43
  ...options == null ? void 0 : options.requestOptions,
44
44
  projectMapId,
45
45
  projectMapNodePath: nodePath,
@@ -103,12 +103,12 @@ var withUniformGetStaticPaths = (options) => {
103
103
  import {
104
104
  CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3,
105
105
  CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE3,
106
- CanvasClient as CanvasClient2,
106
+ CompositionDeliveryClient as CompositionDeliveryClient2,
107
107
  EMPTY_COMPOSITION as EMPTY_COMPOSITION2
108
108
  } from "@uniformdev/canvas";
109
109
  var withUniformGetStaticProps = (options) => {
110
110
  var _a;
111
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CanvasClient2({
111
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CompositionDeliveryClient2({
112
112
  apiKey: process.env.UNIFORM_API_KEY,
113
113
  projectId: process.env.UNIFORM_PROJECT_ID,
114
114
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -136,7 +136,7 @@ var withUniformGetStaticProps = (options) => {
136
136
  } else {
137
137
  try {
138
138
  const time = Date.now();
139
- const response = await canvasClient.getCompositionByNodePath({
139
+ const response = await canvasClient.get({
140
140
  ...options == null ? void 0 : options.requestOptions,
141
141
  projectMapId,
142
142
  projectMapNodePath: pathString,
@@ -1,12 +1,12 @@
1
1
  import * as next from 'next';
2
2
  import { GetServerSidePropsContext, GetServerSidePropsResult, GetServerSideProps, GetStaticPropsContext, GetStaticPropsResult, GetStaticProps } from 'next';
3
3
  import { c as UniformPreviewData } from '../models-BGg_qtcM.mjs';
4
- import * as querystring from 'querystring';
5
- import { ParsedUrlQuery } from 'querystring';
6
- import * as _uniformdev_context__ from '@uniformdev/context/*';
4
+ import * as node_querystring from 'node:querystring';
5
+ import * as _uniformdev_context from '@uniformdev/context';
6
+ import { CompositionMetadata } from '@uniformdev/context';
7
7
  import * as _uniformdev_canvas from '@uniformdev/canvas';
8
8
  import { RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, RootComponentInstance, RouteClient, RouteGetParameters } from '@uniformdev/canvas';
9
- import { CompositionMetadata } from '@uniformdev/context';
9
+ import { ParsedUrlQuery } from 'querystring';
10
10
  import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
11
11
  import { RedirectClient } from '@uniformdev/redirect';
12
12
  import { GetStaticPropsContext as GetStaticPropsContext$1, GetServerSidePropsContext as GetServerSidePropsContext$1 } from 'next/types';
@@ -112,7 +112,7 @@ declare const prependLocale: (path: string, { locale, defaultLocale, locales }:
112
112
  */
113
113
  declare const getServerSideProps: next.GetServerSideProps<{
114
114
  data: _uniformdev_canvas.RootComponentInstance;
115
- } & Omit<_uniformdev_context__.CompositionMetadata, "compositionId">, querystring.ParsedUrlQuery, UniformPreviewData>;
115
+ } & Omit<_uniformdev_context.CompositionMetadata, "compositionId">, node_querystring.ParsedUrlQuery, UniformPreviewData>;
116
116
  /**
117
117
  * Default implementation of getStaticProps with routes
118
118
  * To configure custom behavior, use:
@@ -120,7 +120,7 @@ declare const getServerSideProps: next.GetServerSideProps<{
120
120
  */
121
121
  declare const getStaticProps: next.GetStaticProps<{
122
122
  data: _uniformdev_canvas.RootComponentInstance;
123
- } & Omit<_uniformdev_context__.CompositionMetadata, "compositionId">, querystring.ParsedUrlQuery, UniformPreviewData>;
123
+ } & Omit<_uniformdev_context.CompositionMetadata, "compositionId">, node_querystring.ParsedUrlQuery, UniformPreviewData>;
124
124
  /**
125
125
  * Default implementation of getStaticPaths with routes
126
126
  * To configure custom behavior, use:
@@ -1,12 +1,12 @@
1
1
  import * as next from 'next';
2
2
  import { GetServerSidePropsContext, GetServerSidePropsResult, GetServerSideProps, GetStaticPropsContext, GetStaticPropsResult, GetStaticProps } from 'next';
3
3
  import { c as UniformPreviewData } from '../models-BGg_qtcM.js';
4
- import * as querystring from 'querystring';
5
- import { ParsedUrlQuery } from 'querystring';
6
- import * as _uniformdev_context__ from '@uniformdev/context/*';
4
+ import * as node_querystring from 'node:querystring';
5
+ import * as _uniformdev_context from '@uniformdev/context';
6
+ import { CompositionMetadata } from '@uniformdev/context';
7
7
  import * as _uniformdev_canvas from '@uniformdev/canvas';
8
8
  import { RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, RootComponentInstance, RouteClient, RouteGetParameters } from '@uniformdev/canvas';
9
- import { CompositionMetadata } from '@uniformdev/context';
9
+ import { ParsedUrlQuery } from 'querystring';
10
10
  import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
11
11
  import { RedirectClient } from '@uniformdev/redirect';
12
12
  import { GetStaticPropsContext as GetStaticPropsContext$1, GetServerSidePropsContext as GetServerSidePropsContext$1 } from 'next/types';
@@ -112,7 +112,7 @@ declare const prependLocale: (path: string, { locale, defaultLocale, locales }:
112
112
  */
113
113
  declare const getServerSideProps: next.GetServerSideProps<{
114
114
  data: _uniformdev_canvas.RootComponentInstance;
115
- } & Omit<_uniformdev_context__.CompositionMetadata, "compositionId">, querystring.ParsedUrlQuery, UniformPreviewData>;
115
+ } & Omit<_uniformdev_context.CompositionMetadata, "compositionId">, node_querystring.ParsedUrlQuery, UniformPreviewData>;
116
116
  /**
117
117
  * Default implementation of getStaticProps with routes
118
118
  * To configure custom behavior, use:
@@ -120,7 +120,7 @@ declare const getServerSideProps: next.GetServerSideProps<{
120
120
  */
121
121
  declare const getStaticProps: next.GetStaticProps<{
122
122
  data: _uniformdev_canvas.RootComponentInstance;
123
- } & Omit<_uniformdev_context__.CompositionMetadata, "compositionId">, querystring.ParsedUrlQuery, UniformPreviewData>;
123
+ } & Omit<_uniformdev_context.CompositionMetadata, "compositionId">, node_querystring.ParsedUrlQuery, UniformPreviewData>;
124
124
  /**
125
125
  * Default implementation of getStaticPaths with routes
126
126
  * To configure custom behavior, use:
@@ -226,7 +226,7 @@ function createRouteFetcher(options) {
226
226
  projectId: process.env.UNIFORM_PROJECT_ID,
227
227
  edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
228
228
  });
229
- const handleModifyPath = modifyPath != null ? modifyPath : (path) => decodeURI(path);
229
+ const handleModifyPath = modifyPath != null ? modifyPath : ((path) => decodeURI(path));
230
230
  return async function fetcher(context) {
231
231
  var _a, _b;
232
232
  const {
@@ -309,7 +309,7 @@ function createRouteFetcher(options) {
309
309
  previewReleaseId
310
310
  });
311
311
  const time = Date.now();
312
- const response = await routeClient.getRoute({
312
+ const response = await routeClient.get({
313
313
  ...resolvedOptions,
314
314
  state: (_b = (_a = resolvedOptions == null ? void 0 : resolvedOptions.state) != null ? _a : defaultPreviewState) != null ? _b : import_canvas.CANVAS_PUBLISHED_STATE,
315
315
  dataSourceVariant: (0, import_canvas.getDataSourceVariantFromRouteGetParams)(
@@ -90,7 +90,7 @@ function createRouteFetcher(options) {
90
90
  projectId: process.env.UNIFORM_PROJECT_ID,
91
91
  edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
92
92
  });
93
- const handleModifyPath = modifyPath != null ? modifyPath : (path) => decodeURI(path);
93
+ const handleModifyPath = modifyPath != null ? modifyPath : ((path) => decodeURI(path));
94
94
  return async function fetcher(context) {
95
95
  var _a, _b;
96
96
  const {
@@ -173,7 +173,7 @@ function createRouteFetcher(options) {
173
173
  previewReleaseId
174
174
  });
175
175
  const time = Date.now();
176
- const response = await routeClient.getRoute({
176
+ const response = await routeClient.get({
177
177
  ...resolvedOptions,
178
178
  state: (_b = (_a = resolvedOptions == null ? void 0 : resolvedOptions.state) != null ? _a : defaultPreviewState) != null ? _b : CANVAS_PUBLISHED_STATE,
179
179
  dataSourceVariant: getDataSourceVariantFromRouteGetParams(
@@ -1,9 +1,9 @@
1
1
  import * as next from 'next';
2
2
  import { GetServerSidePropsContext, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
3
3
  import { c as UniformPreviewData, a as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-BGg_qtcM.mjs';
4
- import * as querystring from 'querystring';
4
+ import * as node_querystring from 'node:querystring';
5
+ import { CompositionDeliveryClient, CompositionDeliveryReadOptions, CompositionManagementListQuery, CompositionGetResponse, CompositionManagementClient } from '@uniformdev/canvas';
5
6
  import { ParsedUrlQuery } from 'querystring';
6
- import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
7
7
  import '@uniformdev/canvas-react';
8
8
 
9
9
  declare const withUniformGetServerSideProps: <TProps extends {
@@ -18,8 +18,10 @@ declare const withUniformGetServerSideProps: <TProps extends {
18
18
  /** Set to true if you want to include draft compositions */
19
19
  preview?: boolean;
20
20
  /** If you need to override the default client, you can pass it here */
21
- client?: CanvasClient;
22
- requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
21
+ client?: CompositionDeliveryClient;
22
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
23
+ slug: string;
24
+ }>, "state">;
23
25
  callback?: UniformGetServerSideProps<TProps>;
24
26
  /** Disables logging of response information and timings */
25
27
  silent?: boolean;
@@ -31,12 +33,12 @@ declare const withUniformGetStaticPaths: (options?: {
31
33
  prefix?: string;
32
34
  /** Set to true if you want to include draft compositions */
33
35
  preview?: boolean;
34
- /** Way to override getCompositionList request params */
35
- requestOptions?: Partial<CompositionGetParameters>;
36
+ /** Way to override list request params */
37
+ requestOptions?: Partial<CompositionManagementListQuery>;
36
38
  /** Way to modify list of slugs before building array of paths */
37
39
  callback?: (compositions: CompositionGetResponse[]) => Promise<CompositionGetResponse[]>;
38
40
  /** If you need to override the default client, you can pass it here */
39
- client?: CanvasClient;
41
+ client?: CompositionManagementClient;
40
42
  }) => () => Promise<{
41
43
  paths: string[];
42
44
  fallback: boolean;
@@ -54,9 +56,11 @@ declare const withUniformGetStaticProps: <TProps extends {
54
56
  /** Set to true if you want to include draft compositions */
55
57
  preview?: boolean;
56
58
  /** If you need to override the default client, you can pass it here */
57
- client?: CanvasClient;
58
- /** Way to override getCompositionBySlug request params */
59
- requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
59
+ client?: CompositionDeliveryClient;
60
+ /** Way to override get request params */
61
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
62
+ slug: string;
63
+ }>, "state">;
60
64
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
61
65
  callback?: UniformGetStaticProps<TProps>;
62
66
  /** Disables logging of response information and timings */
@@ -65,11 +69,11 @@ declare const withUniformGetStaticProps: <TProps extends {
65
69
 
66
70
  declare const getServerSideProps: next.GetServerSideProps<{
67
71
  [key: string]: any;
68
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
72
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
69
73
  /** Ready to go getStaticProps for dynamic route with 'slug' param for [[...slug]].jsx */
70
74
  declare const getStaticProps: next.GetStaticProps<{
71
75
  [key: string]: any;
72
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
76
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
73
77
  declare const getStaticPaths: () => Promise<{
74
78
  paths: string[];
75
79
  fallback: boolean;
@@ -1,9 +1,9 @@
1
1
  import * as next from 'next';
2
2
  import { GetServerSidePropsContext, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
3
3
  import { c as UniformPreviewData, a as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-BGg_qtcM.js';
4
- import * as querystring from 'querystring';
4
+ import * as node_querystring from 'node:querystring';
5
+ import { CompositionDeliveryClient, CompositionDeliveryReadOptions, CompositionManagementListQuery, CompositionGetResponse, CompositionManagementClient } from '@uniformdev/canvas';
5
6
  import { ParsedUrlQuery } from 'querystring';
6
- import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
7
7
  import '@uniformdev/canvas-react';
8
8
 
9
9
  declare const withUniformGetServerSideProps: <TProps extends {
@@ -18,8 +18,10 @@ declare const withUniformGetServerSideProps: <TProps extends {
18
18
  /** Set to true if you want to include draft compositions */
19
19
  preview?: boolean;
20
20
  /** If you need to override the default client, you can pass it here */
21
- client?: CanvasClient;
22
- requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
21
+ client?: CompositionDeliveryClient;
22
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
23
+ slug: string;
24
+ }>, "state">;
23
25
  callback?: UniformGetServerSideProps<TProps>;
24
26
  /** Disables logging of response information and timings */
25
27
  silent?: boolean;
@@ -31,12 +33,12 @@ declare const withUniformGetStaticPaths: (options?: {
31
33
  prefix?: string;
32
34
  /** Set to true if you want to include draft compositions */
33
35
  preview?: boolean;
34
- /** Way to override getCompositionList request params */
35
- requestOptions?: Partial<CompositionGetParameters>;
36
+ /** Way to override list request params */
37
+ requestOptions?: Partial<CompositionManagementListQuery>;
36
38
  /** Way to modify list of slugs before building array of paths */
37
39
  callback?: (compositions: CompositionGetResponse[]) => Promise<CompositionGetResponse[]>;
38
40
  /** If you need to override the default client, you can pass it here */
39
- client?: CanvasClient;
41
+ client?: CompositionManagementClient;
40
42
  }) => () => Promise<{
41
43
  paths: string[];
42
44
  fallback: boolean;
@@ -54,9 +56,11 @@ declare const withUniformGetStaticProps: <TProps extends {
54
56
  /** Set to true if you want to include draft compositions */
55
57
  preview?: boolean;
56
58
  /** If you need to override the default client, you can pass it here */
57
- client?: CanvasClient;
58
- /** Way to override getCompositionBySlug request params */
59
- requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
59
+ client?: CompositionDeliveryClient;
60
+ /** Way to override get request params */
61
+ requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
62
+ slug: string;
63
+ }>, "state">;
60
64
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
61
65
  callback?: UniformGetStaticProps<TProps>;
62
66
  /** Disables logging of response information and timings */
@@ -65,11 +69,11 @@ declare const withUniformGetStaticProps: <TProps extends {
65
69
 
66
70
  declare const getServerSideProps: next.GetServerSideProps<{
67
71
  [key: string]: any;
68
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
72
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
69
73
  /** Ready to go getStaticProps for dynamic route with 'slug' param for [[...slug]].jsx */
70
74
  declare const getStaticProps: next.GetStaticProps<{
71
75
  [key: string]: any;
72
- }, querystring.ParsedUrlQuery, UniformPreviewData>;
76
+ }, node_querystring.ParsedUrlQuery, UniformPreviewData>;
73
77
  declare const getStaticPaths: () => Promise<{
74
78
  paths: string[];
75
79
  fallback: boolean;
@@ -152,7 +152,7 @@ function resolveDiagnosticsDuration(data) {
152
152
 
153
153
  // src/slug/withUniformGetServerSideProps.ts
154
154
  var withUniformGetServerSideProps = (options) => {
155
- const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CanvasClient({
155
+ const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CompositionDeliveryClient({
156
156
  apiKey: process.env.UNIFORM_API_KEY,
157
157
  projectId: process.env.UNIFORM_PROJECT_ID,
158
158
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -176,7 +176,7 @@ var withUniformGetServerSideProps = (options) => {
176
176
  } else {
177
177
  try {
178
178
  const time = Date.now();
179
- const response = await canvasClient.getCompositionBySlug({
179
+ const response = await canvasClient.get({
180
180
  ...options == null ? void 0 : options.requestOptions,
181
181
  slug,
182
182
  state: preview || (options == null ? void 0 : options.preview) ? import_canvas.CANVAS_DRAFT_STATE : import_canvas.CANVAS_PUBLISHED_STATE,
@@ -209,13 +209,18 @@ var import_canvas2 = require("@uniformdev/canvas");
209
209
  var withUniformGetStaticPaths = (options) => {
210
210
  return async function wrappedGetStaticPaths() {
211
211
  var _a;
212
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas2.CanvasClient({
213
- apiKey: process.env.UNIFORM_API_KEY,
214
- projectId: process.env.UNIFORM_PROJECT_ID,
215
- apiHost: process.env.UNIFORM_CLI_BASE_URL,
216
- edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
217
- });
218
- const response = await canvasClient.getCompositionList({
212
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : (
213
+ // Build-time path enumeration only needs `_slug`, so read the lightweight
214
+ // canonical list from the origin (not the edge). bypassCache:false keeps the
215
+ // CDN-cacheable behavior of the old base CanvasClient at build time.
216
+ new import_canvas2.CompositionManagementClient({
217
+ apiKey: process.env.UNIFORM_API_KEY,
218
+ projectId: process.env.UNIFORM_PROJECT_ID,
219
+ apiHost: process.env.UNIFORM_CLI_BASE_URL,
220
+ bypassCache: false
221
+ })
222
+ );
223
+ const response = await canvasClient.list({
219
224
  ...options == null ? void 0 : options.requestOptions,
220
225
  state: (options == null ? void 0 : options.preview) ? import_canvas2.CANVAS_DRAFT_STATE : import_canvas2.CANVAS_PUBLISHED_STATE
221
226
  });
@@ -247,7 +252,7 @@ var resolveSlugFromParams = ({
247
252
  // src/slug/withUniformGetStaticProps.ts
248
253
  var withUniformGetStaticProps = (options) => {
249
254
  var _a;
250
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas3.CanvasClient({
255
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas3.CompositionDeliveryClient({
251
256
  apiKey: process.env.UNIFORM_API_KEY,
252
257
  projectId: process.env.UNIFORM_PROJECT_ID,
253
258
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -274,7 +279,7 @@ var withUniformGetStaticProps = (options) => {
274
279
  } else {
275
280
  try {
276
281
  const time = Date.now();
277
- const response = await canvasClient.getCompositionBySlug({
282
+ const response = await canvasClient.get({
278
283
  slug: slugString,
279
284
  state: preview || (options == null ? void 0 : options.preview) ? import_canvas3.CANVAS_DRAFT_STATE : import_canvas3.CANVAS_PUBLISHED_STATE,
280
285
  ...options == null ? void 0 : options.requestOptions,
@@ -10,11 +10,11 @@ import {
10
10
  import {
11
11
  CANVAS_DRAFT_STATE,
12
12
  CANVAS_PUBLISHED_STATE,
13
- CanvasClient,
13
+ CompositionDeliveryClient,
14
14
  EMPTY_COMPOSITION
15
15
  } from "@uniformdev/canvas";
16
16
  var withUniformGetServerSideProps = (options) => {
17
- const canvasClient = (options == null ? void 0 : options.client) || new CanvasClient({
17
+ const canvasClient = (options == null ? void 0 : options.client) || new CompositionDeliveryClient({
18
18
  apiKey: process.env.UNIFORM_API_KEY,
19
19
  projectId: process.env.UNIFORM_PROJECT_ID,
20
20
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -38,7 +38,7 @@ var withUniformGetServerSideProps = (options) => {
38
38
  } else {
39
39
  try {
40
40
  const time = Date.now();
41
- const response = await canvasClient.getCompositionBySlug({
41
+ const response = await canvasClient.get({
42
42
  ...options == null ? void 0 : options.requestOptions,
43
43
  slug,
44
44
  state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE,
@@ -70,18 +70,23 @@ var withUniformGetServerSideProps = (options) => {
70
70
  import {
71
71
  CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE2,
72
72
  CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2,
73
- CanvasClient as CanvasClient2
73
+ CompositionManagementClient
74
74
  } from "@uniformdev/canvas";
75
75
  var withUniformGetStaticPaths = (options) => {
76
76
  return async function wrappedGetStaticPaths() {
77
77
  var _a;
78
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CanvasClient2({
79
- apiKey: process.env.UNIFORM_API_KEY,
80
- projectId: process.env.UNIFORM_PROJECT_ID,
81
- apiHost: process.env.UNIFORM_CLI_BASE_URL,
82
- edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
83
- });
84
- const response = await canvasClient.getCompositionList({
78
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : (
79
+ // Build-time path enumeration only needs `_slug`, so read the lightweight
80
+ // canonical list from the origin (not the edge). bypassCache:false keeps the
81
+ // CDN-cacheable behavior of the old base CanvasClient at build time.
82
+ new CompositionManagementClient({
83
+ apiKey: process.env.UNIFORM_API_KEY,
84
+ projectId: process.env.UNIFORM_PROJECT_ID,
85
+ apiHost: process.env.UNIFORM_CLI_BASE_URL,
86
+ bypassCache: false
87
+ })
88
+ );
89
+ const response = await canvasClient.list({
85
90
  ...options == null ? void 0 : options.requestOptions,
86
91
  state: (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE2 : CANVAS_PUBLISHED_STATE2
87
92
  });
@@ -101,12 +106,12 @@ var withUniformGetStaticPaths = (options) => {
101
106
  import {
102
107
  CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3,
103
108
  CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE3,
104
- CanvasClient as CanvasClient3,
109
+ CompositionDeliveryClient as CompositionDeliveryClient2,
105
110
  EMPTY_COMPOSITION as EMPTY_COMPOSITION2
106
111
  } from "@uniformdev/canvas";
107
112
  var withUniformGetStaticProps = (options) => {
108
113
  var _a;
109
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CanvasClient3({
114
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CompositionDeliveryClient2({
110
115
  apiKey: process.env.UNIFORM_API_KEY,
111
116
  projectId: process.env.UNIFORM_PROJECT_ID,
112
117
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -133,7 +138,7 @@ var withUniformGetStaticProps = (options) => {
133
138
  } else {
134
139
  try {
135
140
  const time = Date.now();
136
- const response = await canvasClient.getCompositionBySlug({
141
+ const response = await canvasClient.get({
137
142
  slug: slugString,
138
143
  state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE3 : CANVAS_PUBLISHED_STATE3,
139
144
  ...options == null ? void 0 : options.requestOptions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next",
3
- "version": "20.50.2-alpha.149+913f0b7b57",
3
+ "version": "20.50.2-alpha.167+74e60d5bb7",
4
4
  "description": "Next.js SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -66,12 +66,12 @@
66
66
  "apidocs-extract": "api-extractor run --local"
67
67
  },
68
68
  "dependencies": {
69
- "@uniformdev/canvas": "20.50.2-alpha.149+913f0b7b57",
70
- "@uniformdev/canvas-react": "20.50.2-alpha.149+913f0b7b57",
71
- "@uniformdev/context": "20.50.2-alpha.149+913f0b7b57",
72
- "@uniformdev/project-map": "20.50.2-alpha.149+913f0b7b57",
73
- "@uniformdev/redirect": "20.50.2-alpha.149+913f0b7b57",
74
- "@uniformdev/richtext": "20.50.2-alpha.149+913f0b7b57",
69
+ "@uniformdev/canvas": "20.50.2-alpha.167+74e60d5bb7",
70
+ "@uniformdev/canvas-react": "20.50.2-alpha.167+74e60d5bb7",
71
+ "@uniformdev/context": "20.50.2-alpha.167+74e60d5bb7",
72
+ "@uniformdev/project-map": "20.50.2-alpha.167+74e60d5bb7",
73
+ "@uniformdev/redirect": "20.50.2-alpha.167+74e60d5bb7",
74
+ "@uniformdev/richtext": "20.50.2-alpha.167+74e60d5bb7",
75
75
  "colorette": "2.0.20"
76
76
  },
77
77
  "peerDependencies": {
@@ -80,8 +80,8 @@
80
80
  "react-dom": ">=16"
81
81
  },
82
82
  "devDependencies": {
83
- "@types/react": "19.2.2",
84
- "next": "16.2.3",
83
+ "@types/react": "19.2.17",
84
+ "next": "16.2.9",
85
85
  "react": "19.2.1",
86
86
  "react-dom": "19.2.1"
87
87
  },
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "913f0b7b57295ca79575810663c56a7a5deea9e4"
94
+ "gitHead": "74e60d5bb79fe1c4d446e4d3e6edf9f08850be4f"
95
95
  }