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

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.
@@ -2,7 +2,7 @@ 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
4
  import * as node_querystring from 'node:querystring';
5
- import { CompositionDeliveryClient, CompositionDeliveryReadOptions } from '@uniformdev/canvas';
5
+ import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
6
6
  import { ParsedUrlQuery } from 'querystring';
7
7
  import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
8
8
  import '@uniformdev/canvas-react';
@@ -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?: CompositionDeliveryClient;
16
+ client?: CanvasClient;
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,11 +21,8 @@ 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 get request params */
25
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
26
- projectMapNodePath: string;
27
- projectMapId?: string;
28
- }>, "state">;
24
+ /** Way to override getCompositionByNodePath request params */
25
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
29
26
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
30
27
  callback?: UniformGetServerSideProps<TProps>;
31
28
  /** Disables logging of response information and timings */
@@ -64,12 +61,9 @@ declare const withUniformGetStaticProps: <TProps extends {
64
61
  /** Set to true if you want to include draft compositions */
65
62
  preview?: boolean;
66
63
  /** If you need to override the default client, you can pass it here */
67
- client?: CompositionDeliveryClient;
68
- /** Way to override get request params */
69
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
70
- projectMapNodePath: string;
71
- projectMapId?: string;
72
- }>, "state">;
64
+ client?: CanvasClient;
65
+ /** Way to override getCompositionByNodePath request params */
66
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
73
67
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
74
68
  callback?: UniformGetStaticProps<TProps>;
75
69
  /** Disables logging of response information and timings */
@@ -2,7 +2,7 @@ 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
4
  import * as node_querystring from 'node:querystring';
5
- import { CompositionDeliveryClient, CompositionDeliveryReadOptions } from '@uniformdev/canvas';
5
+ import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
6
6
  import { ParsedUrlQuery } from 'querystring';
7
7
  import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
8
8
  import '@uniformdev/canvas-react';
@@ -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?: CompositionDeliveryClient;
16
+ client?: CanvasClient;
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,11 +21,8 @@ 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 get request params */
25
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
26
- projectMapNodePath: string;
27
- projectMapId?: string;
28
- }>, "state">;
24
+ /** Way to override getCompositionByNodePath request params */
25
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
29
26
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
30
27
  callback?: UniformGetServerSideProps<TProps>;
31
28
  /** Disables logging of response information and timings */
@@ -64,12 +61,9 @@ declare const withUniformGetStaticProps: <TProps extends {
64
61
  /** Set to true if you want to include draft compositions */
65
62
  preview?: boolean;
66
63
  /** If you need to override the default client, you can pass it here */
67
- client?: CompositionDeliveryClient;
68
- /** Way to override get request params */
69
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
70
- projectMapNodePath: string;
71
- projectMapId?: string;
72
- }>, "state">;
64
+ client?: CanvasClient;
65
+ /** Way to override getCompositionByNodePath request params */
66
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
73
67
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
74
68
  callback?: UniformGetStaticProps<TProps>;
75
69
  /** Disables logging of response information and timings */
@@ -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.CompositionDeliveryClient({
155
+ const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CanvasClient({
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.get({
180
+ const response = await canvasClient.getCompositionByNodePath({
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.CompositionDeliveryClient({
254
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas3.CanvasClient({
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.get({
282
+ const response = await canvasClient.getCompositionByNodePath({
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
- CompositionDeliveryClient,
13
+ CanvasClient,
14
14
  EMPTY_COMPOSITION
15
15
  } from "@uniformdev/canvas";
16
16
  var withUniformGetServerSideProps = (options) => {
17
- const canvasClient = (options == null ? void 0 : options.client) || new CompositionDeliveryClient({
17
+ const canvasClient = (options == null ? void 0 : options.client) || new CanvasClient({
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.get({
42
+ const response = await canvasClient.getCompositionByNodePath({
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
- CompositionDeliveryClient as CompositionDeliveryClient2,
106
+ CanvasClient as CanvasClient2,
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 CompositionDeliveryClient2({
111
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CanvasClient2({
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.get({
139
+ const response = await canvasClient.getCompositionByNodePath({
140
140
  ...options == null ? void 0 : options.requestOptions,
141
141
  projectMapId,
142
142
  projectMapNodePath: pathString,
@@ -309,7 +309,7 @@ function createRouteFetcher(options) {
309
309
  previewReleaseId
310
310
  });
311
311
  const time = Date.now();
312
- const response = await routeClient.get({
312
+ const response = await routeClient.getRoute({
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)(
@@ -173,7 +173,7 @@ function createRouteFetcher(options) {
173
173
  previewReleaseId
174
174
  });
175
175
  const time = Date.now();
176
- const response = await routeClient.get({
176
+ const response = await routeClient.getRoute({
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(
@@ -2,7 +2,7 @@ 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
4
  import * as node_querystring from 'node:querystring';
5
- import { CompositionDeliveryClient, CompositionDeliveryReadOptions, CompositionManagementListQuery, CompositionGetResponse, CompositionManagementClient } from '@uniformdev/canvas';
5
+ import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
6
6
  import { ParsedUrlQuery } from 'querystring';
7
7
  import '@uniformdev/canvas-react';
8
8
 
@@ -18,10 +18,8 @@ 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?: CompositionDeliveryClient;
22
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
23
- slug: string;
24
- }>, "state">;
21
+ client?: CanvasClient;
22
+ requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
25
23
  callback?: UniformGetServerSideProps<TProps>;
26
24
  /** Disables logging of response information and timings */
27
25
  silent?: boolean;
@@ -33,12 +31,12 @@ declare const withUniformGetStaticPaths: (options?: {
33
31
  prefix?: string;
34
32
  /** Set to true if you want to include draft compositions */
35
33
  preview?: boolean;
36
- /** Way to override list request params */
37
- requestOptions?: Partial<CompositionManagementListQuery>;
34
+ /** Way to override getCompositionList request params */
35
+ requestOptions?: Partial<CompositionGetParameters>;
38
36
  /** Way to modify list of slugs before building array of paths */
39
37
  callback?: (compositions: CompositionGetResponse[]) => Promise<CompositionGetResponse[]>;
40
38
  /** If you need to override the default client, you can pass it here */
41
- client?: CompositionManagementClient;
39
+ client?: CanvasClient;
42
40
  }) => () => Promise<{
43
41
  paths: string[];
44
42
  fallback: boolean;
@@ -56,11 +54,9 @@ declare const withUniformGetStaticProps: <TProps extends {
56
54
  /** Set to true if you want to include draft compositions */
57
55
  preview?: boolean;
58
56
  /** If you need to override the default client, you can pass it here */
59
- client?: CompositionDeliveryClient;
60
- /** Way to override get request params */
61
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
62
- slug: string;
63
- }>, "state">;
57
+ client?: CanvasClient;
58
+ /** Way to override getCompositionBySlug request params */
59
+ requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
64
60
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
65
61
  callback?: UniformGetStaticProps<TProps>;
66
62
  /** Disables logging of response information and timings */
@@ -2,7 +2,7 @@ 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
4
  import * as node_querystring from 'node:querystring';
5
- import { CompositionDeliveryClient, CompositionDeliveryReadOptions, CompositionManagementListQuery, CompositionGetResponse, CompositionManagementClient } from '@uniformdev/canvas';
5
+ import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
6
6
  import { ParsedUrlQuery } from 'querystring';
7
7
  import '@uniformdev/canvas-react';
8
8
 
@@ -18,10 +18,8 @@ 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?: CompositionDeliveryClient;
22
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
23
- slug: string;
24
- }>, "state">;
21
+ client?: CanvasClient;
22
+ requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
25
23
  callback?: UniformGetServerSideProps<TProps>;
26
24
  /** Disables logging of response information and timings */
27
25
  silent?: boolean;
@@ -33,12 +31,12 @@ declare const withUniformGetStaticPaths: (options?: {
33
31
  prefix?: string;
34
32
  /** Set to true if you want to include draft compositions */
35
33
  preview?: boolean;
36
- /** Way to override list request params */
37
- requestOptions?: Partial<CompositionManagementListQuery>;
34
+ /** Way to override getCompositionList request params */
35
+ requestOptions?: Partial<CompositionGetParameters>;
38
36
  /** Way to modify list of slugs before building array of paths */
39
37
  callback?: (compositions: CompositionGetResponse[]) => Promise<CompositionGetResponse[]>;
40
38
  /** If you need to override the default client, you can pass it here */
41
- client?: CompositionManagementClient;
39
+ client?: CanvasClient;
42
40
  }) => () => Promise<{
43
41
  paths: string[];
44
42
  fallback: boolean;
@@ -56,11 +54,9 @@ declare const withUniformGetStaticProps: <TProps extends {
56
54
  /** Set to true if you want to include draft compositions */
57
55
  preview?: boolean;
58
56
  /** If you need to override the default client, you can pass it here */
59
- client?: CompositionDeliveryClient;
60
- /** Way to override get request params */
61
- requestOptions?: Omit<Partial<CompositionDeliveryReadOptions & {
62
- slug: string;
63
- }>, "state">;
57
+ client?: CanvasClient;
58
+ /** Way to override getCompositionBySlug request params */
59
+ requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
64
60
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
65
61
  callback?: UniformGetStaticProps<TProps>;
66
62
  /** Disables logging of response information and timings */
@@ -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.CompositionDeliveryClient({
155
+ const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CanvasClient({
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.get({
179
+ const response = await canvasClient.getCompositionBySlug({
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,18 +209,13 @@ 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 : (
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({
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({
224
219
  ...options == null ? void 0 : options.requestOptions,
225
220
  state: (options == null ? void 0 : options.preview) ? import_canvas2.CANVAS_DRAFT_STATE : import_canvas2.CANVAS_PUBLISHED_STATE
226
221
  });
@@ -252,7 +247,7 @@ var resolveSlugFromParams = ({
252
247
  // src/slug/withUniformGetStaticProps.ts
253
248
  var withUniformGetStaticProps = (options) => {
254
249
  var _a;
255
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas3.CompositionDeliveryClient({
250
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas3.CanvasClient({
256
251
  apiKey: process.env.UNIFORM_API_KEY,
257
252
  projectId: process.env.UNIFORM_PROJECT_ID,
258
253
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -279,7 +274,7 @@ var withUniformGetStaticProps = (options) => {
279
274
  } else {
280
275
  try {
281
276
  const time = Date.now();
282
- const response = await canvasClient.get({
277
+ const response = await canvasClient.getCompositionBySlug({
283
278
  slug: slugString,
284
279
  state: preview || (options == null ? void 0 : options.preview) ? import_canvas3.CANVAS_DRAFT_STATE : import_canvas3.CANVAS_PUBLISHED_STATE,
285
280
  ...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
- CompositionDeliveryClient,
13
+ CanvasClient,
14
14
  EMPTY_COMPOSITION
15
15
  } from "@uniformdev/canvas";
16
16
  var withUniformGetServerSideProps = (options) => {
17
- const canvasClient = (options == null ? void 0 : options.client) || new CompositionDeliveryClient({
17
+ const canvasClient = (options == null ? void 0 : options.client) || new CanvasClient({
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.get({
41
+ const response = await canvasClient.getCompositionBySlug({
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,23 +70,18 @@ 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
- CompositionManagementClient
73
+ CanvasClient as CanvasClient2
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 : (
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({
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({
90
85
  ...options == null ? void 0 : options.requestOptions,
91
86
  state: (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE2 : CANVAS_PUBLISHED_STATE2
92
87
  });
@@ -106,12 +101,12 @@ var withUniformGetStaticPaths = (options) => {
106
101
  import {
107
102
  CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3,
108
103
  CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE3,
109
- CompositionDeliveryClient as CompositionDeliveryClient2,
104
+ CanvasClient as CanvasClient3,
110
105
  EMPTY_COMPOSITION as EMPTY_COMPOSITION2
111
106
  } from "@uniformdev/canvas";
112
107
  var withUniformGetStaticProps = (options) => {
113
108
  var _a;
114
- const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CompositionDeliveryClient2({
109
+ const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CanvasClient3({
115
110
  apiKey: process.env.UNIFORM_API_KEY,
116
111
  projectId: process.env.UNIFORM_PROJECT_ID,
117
112
  apiHost: process.env.UNIFORM_CLI_BASE_URL,
@@ -138,7 +133,7 @@ var withUniformGetStaticProps = (options) => {
138
133
  } else {
139
134
  try {
140
135
  const time = Date.now();
141
- const response = await canvasClient.get({
136
+ const response = await canvasClient.getCompositionBySlug({
142
137
  slug: slugString,
143
138
  state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE3 : CANVAS_PUBLISHED_STATE3,
144
139
  ...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.167+74e60d5bb7",
3
+ "version": "20.50.2-alpha.180+0be2307590",
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.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",
69
+ "@uniformdev/canvas": "20.50.2-alpha.180+0be2307590",
70
+ "@uniformdev/canvas-react": "20.50.2-alpha.180+0be2307590",
71
+ "@uniformdev/context": "20.50.2-alpha.180+0be2307590",
72
+ "@uniformdev/project-map": "20.50.2-alpha.180+0be2307590",
73
+ "@uniformdev/redirect": "20.50.2-alpha.180+0be2307590",
74
+ "@uniformdev/richtext": "20.50.2-alpha.180+0be2307590",
75
75
  "colorette": "2.0.20"
76
76
  },
77
77
  "peerDependencies": {
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "74e60d5bb79fe1c4d446e4d3e6edf9f08850be4f"
94
+ "gitHead": "0be23075901a6fd0acd8166a2bea65fbd5589789"
95
95
  }