@uniformdev/canvas-next 19.135.0 → 19.135.1-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +2 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/{models-IAhm-va2.d.mts → models-CupnCqnn.d.mts} +6 -1
- package/dist/{models-IAhm-va2.d.ts → models-CupnCqnn.d.ts} +6 -1
- package/dist/project-map/index.d.mts +27 -70
- package/dist/project-map/index.d.ts +27 -70
- package/dist/route/index.d.mts +18 -363
- package/dist/route/index.d.ts +18 -363
- package/dist/route/index.js +1 -2
- package/dist/route/index.mjs +1 -2
- package/dist/slug/index.d.mts +23 -48
- package/dist/slug/index.d.ts +23 -48
- package/package.json +11 -11
package/dist/route/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, GetServerSidePropsResult, GetServerSideProps, GetStaticPropsContext, GetStaticPropsResult, GetStaticProps } from 'next';
|
|
3
|
-
import { a as UniformPreviewData } from '../models-
|
|
3
|
+
import { a as UniformPreviewData } from '../models-CupnCqnn.js';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
|
+
import * as _uniformdev_canvas from '@uniformdev/canvas';
|
|
6
7
|
import { RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, RouteClient, RouteGetParameters, RootComponentInstance } from '@uniformdev/canvas';
|
|
7
|
-
import { ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
|
|
8
|
+
import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
|
|
8
9
|
import { RedirectClient } from '@uniformdev/redirect';
|
|
9
10
|
import { GetStaticPropsContext as GetStaticPropsContext$1, GetServerSidePropsContext as GetServerSidePropsContext$1 } from 'next/types';
|
|
10
11
|
import '@uniformdev/canvas-react';
|
|
@@ -45,43 +46,25 @@ declare const withUniformGetServerSideProps: <TProps extends {
|
|
|
45
46
|
[key: string]: any;
|
|
46
47
|
} = {
|
|
47
48
|
data: RootComponentInstance;
|
|
48
|
-
}>(options?: RouteHandlerOptions<GetServerSidePropsContext<ParsedUrlQuery, UniformPreviewData>, GetServerSidePropsResult<never>, GetServerSidePropsResult<TProps>>
|
|
49
|
+
}>(options?: RouteHandlerOptions<GetServerSidePropsContext<ParsedUrlQuery, UniformPreviewData>, GetServerSidePropsResult<never>, GetServerSidePropsResult<TProps>>) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
|
|
49
50
|
|
|
50
51
|
declare const withUniformGetStaticPaths: (options?: {
|
|
51
|
-
projectMapId?: string
|
|
52
|
+
projectMapId?: string;
|
|
52
53
|
/** Starting path to fetch nodes from */
|
|
53
|
-
rootPath?: string
|
|
54
|
+
rootPath?: string;
|
|
54
55
|
/** A string that you want prepended to paths returned by your project map. Useful when calling from a nested folder which is not part of your project map structure */
|
|
55
|
-
prefix?: string
|
|
56
|
+
prefix?: string;
|
|
56
57
|
/** Set to true if you want to include draft compositions */
|
|
57
|
-
preview?: boolean
|
|
58
|
+
preview?: boolean;
|
|
58
59
|
/** Way to override getNodes request params */
|
|
59
|
-
requestOptions?: Partial<
|
|
60
|
-
projectMapId?: string | undefined;
|
|
61
|
-
projectId: string;
|
|
62
|
-
releaseId?: string | undefined;
|
|
63
|
-
id?: string | undefined;
|
|
64
|
-
path?: string | undefined;
|
|
65
|
-
compositionId?: string | undefined;
|
|
66
|
-
limit?: number | undefined;
|
|
67
|
-
offset?: number | undefined;
|
|
68
|
-
depth?: number | undefined;
|
|
69
|
-
state?: number | undefined;
|
|
70
|
-
tree?: boolean | undefined;
|
|
71
|
-
search?: string | undefined;
|
|
72
|
-
includeAncestors?: boolean | undefined;
|
|
73
|
-
expanded?: boolean | undefined;
|
|
74
|
-
withCompositionData?: boolean | undefined;
|
|
75
|
-
withCompositionUIStatus?: boolean | undefined;
|
|
76
|
-
withRedirectData?: boolean | undefined;
|
|
77
|
-
}> | undefined;
|
|
60
|
+
requestOptions?: Partial<ProjectMapNodeGetRequest>;
|
|
78
61
|
/** Way to modify list of nodes before building array of paths */
|
|
79
|
-
callback?: (
|
|
62
|
+
callback?: (nodes: ProjectMapNodeGetResponse["nodes"]) => Promise<ProjectMapNodeGetResponse["nodes"]>;
|
|
80
63
|
/** If you need to override the default client, you can pass it here */
|
|
81
|
-
client?: ProjectMapClient
|
|
64
|
+
client?: ProjectMapClient;
|
|
82
65
|
/** If you need to override the default redirect client, you can pass it here */
|
|
83
|
-
redirectClient?: RedirectClient
|
|
84
|
-
}
|
|
66
|
+
redirectClient?: RedirectClient;
|
|
67
|
+
}) => () => Promise<{
|
|
85
68
|
paths: string[];
|
|
86
69
|
fallback: boolean;
|
|
87
70
|
}>;
|
|
@@ -95,10 +78,10 @@ declare const withUniformGetStaticProps: <TProps extends {
|
|
|
95
78
|
[key: string]: any;
|
|
96
79
|
} = {
|
|
97
80
|
data: RootComponentInstance;
|
|
98
|
-
}>(options?:
|
|
81
|
+
}>(options?: RouteHandlerOptions<GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>, GetStaticPropsResult<never>, GetStaticPropsResult<TProps>> & {
|
|
99
82
|
/** Name of dynamic parameter coming from getStaticPath, usually specified in page file name (e.g. [...slug].jsx will have param = 'slug' */
|
|
100
|
-
param?: string
|
|
101
|
-
})
|
|
83
|
+
param?: string;
|
|
84
|
+
}) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
|
|
102
85
|
|
|
103
86
|
/**
|
|
104
87
|
* Prepends correct locale to the path before sending it to Uniform Route API.
|
|
@@ -117,171 +100,7 @@ declare const prependLocale: (path: string, { locale, defaultLocale, locales }:
|
|
|
117
100
|
* export getServerSideProps = withUniformGetServerSideProps({ ... });
|
|
118
101
|
*/
|
|
119
102
|
declare const getServerSideProps: next.GetServerSideProps<{
|
|
120
|
-
data:
|
|
121
|
-
type: string;
|
|
122
|
-
parameters?: {
|
|
123
|
-
[key: string]: {
|
|
124
|
-
value?: unknown;
|
|
125
|
-
type: string;
|
|
126
|
-
connectedData?: {
|
|
127
|
-
pointer: string;
|
|
128
|
-
syntax: "jptr";
|
|
129
|
-
} | undefined;
|
|
130
|
-
locales?: {
|
|
131
|
-
[key: string]: unknown;
|
|
132
|
-
} | undefined;
|
|
133
|
-
};
|
|
134
|
-
} | undefined;
|
|
135
|
-
variant?: string | undefined;
|
|
136
|
-
projectMapNodes?: {
|
|
137
|
-
id: string;
|
|
138
|
-
path: string;
|
|
139
|
-
projectMapId: string;
|
|
140
|
-
data?: {
|
|
141
|
-
isSearchHit?: boolean | undefined;
|
|
142
|
-
queryStrings?: {
|
|
143
|
-
name: string;
|
|
144
|
-
value: string;
|
|
145
|
-
helpText?: string | undefined;
|
|
146
|
-
}[] | undefined;
|
|
147
|
-
previewValue?: string | undefined;
|
|
148
|
-
} | undefined;
|
|
149
|
-
locales?: {
|
|
150
|
-
[key: string]: {
|
|
151
|
-
path: string;
|
|
152
|
-
inherited: boolean;
|
|
153
|
-
};
|
|
154
|
-
} | undefined;
|
|
155
|
-
}[] | undefined;
|
|
156
|
-
slots?: {
|
|
157
|
-
[key: string]: {
|
|
158
|
-
type: string;
|
|
159
|
-
parameters?: {
|
|
160
|
-
[key: string]: {
|
|
161
|
-
value?: unknown;
|
|
162
|
-
type: string;
|
|
163
|
-
connectedData?: {
|
|
164
|
-
pointer: string;
|
|
165
|
-
syntax: "jptr";
|
|
166
|
-
} | undefined;
|
|
167
|
-
locales?: {
|
|
168
|
-
[key: string]: unknown;
|
|
169
|
-
} | undefined;
|
|
170
|
-
};
|
|
171
|
-
} | undefined;
|
|
172
|
-
variant?: string | undefined;
|
|
173
|
-
slots?: {
|
|
174
|
-
[key: string]: any[];
|
|
175
|
-
} | undefined;
|
|
176
|
-
_id?: string | undefined;
|
|
177
|
-
_pattern?: string | undefined;
|
|
178
|
-
_dataResources?: {
|
|
179
|
-
[key: string]: {
|
|
180
|
-
type: string;
|
|
181
|
-
isPatternParameter?: boolean | undefined;
|
|
182
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
183
|
-
variables?: {
|
|
184
|
-
[key: string]: string;
|
|
185
|
-
} | undefined;
|
|
186
|
-
};
|
|
187
|
-
} | undefined;
|
|
188
|
-
_patternDataResources?: {
|
|
189
|
-
[key: string]: {
|
|
190
|
-
type: string;
|
|
191
|
-
isPatternParameter?: boolean | undefined;
|
|
192
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
193
|
-
variables?: {
|
|
194
|
-
[key: string]: string;
|
|
195
|
-
} | undefined;
|
|
196
|
-
};
|
|
197
|
-
} | undefined;
|
|
198
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
|
199
|
-
_overrides?: {
|
|
200
|
-
[key: string]: {
|
|
201
|
-
parameters?: {
|
|
202
|
-
[key: string]: {
|
|
203
|
-
value?: unknown;
|
|
204
|
-
type: string;
|
|
205
|
-
connectedData?: {
|
|
206
|
-
pointer: string;
|
|
207
|
-
syntax: "jptr";
|
|
208
|
-
} | undefined;
|
|
209
|
-
locales?: {
|
|
210
|
-
[key: string]: unknown;
|
|
211
|
-
} | undefined;
|
|
212
|
-
};
|
|
213
|
-
} | undefined;
|
|
214
|
-
slots?: {
|
|
215
|
-
[key: string]: any[];
|
|
216
|
-
} | undefined;
|
|
217
|
-
variant?: string | undefined;
|
|
218
|
-
};
|
|
219
|
-
} | undefined;
|
|
220
|
-
_overridability?: {
|
|
221
|
-
parameters?: {
|
|
222
|
-
[key: string]: "yes" | "no";
|
|
223
|
-
} | undefined;
|
|
224
|
-
variants?: boolean | undefined;
|
|
225
|
-
hideLockedParameters?: boolean | undefined;
|
|
226
|
-
} | undefined;
|
|
227
|
-
_locales?: string[] | undefined;
|
|
228
|
-
}[];
|
|
229
|
-
} | undefined;
|
|
230
|
-
_id: string;
|
|
231
|
-
_slug?: string | null | undefined;
|
|
232
|
-
_name: string;
|
|
233
|
-
_pattern?: string | undefined;
|
|
234
|
-
_patternDataResources?: {
|
|
235
|
-
[key: string]: {
|
|
236
|
-
type: string;
|
|
237
|
-
isPatternParameter?: boolean | undefined;
|
|
238
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
239
|
-
variables?: {
|
|
240
|
-
[key: string]: string;
|
|
241
|
-
} | undefined;
|
|
242
|
-
};
|
|
243
|
-
} | undefined;
|
|
244
|
-
_dataResources?: {
|
|
245
|
-
[key: string]: {
|
|
246
|
-
type: string;
|
|
247
|
-
isPatternParameter?: boolean | undefined;
|
|
248
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
249
|
-
variables?: {
|
|
250
|
-
[key: string]: string;
|
|
251
|
-
} | undefined;
|
|
252
|
-
};
|
|
253
|
-
} | undefined;
|
|
254
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
|
255
|
-
_overrides?: {
|
|
256
|
-
[key: string]: {
|
|
257
|
-
parameters?: {
|
|
258
|
-
[key: string]: {
|
|
259
|
-
value?: unknown;
|
|
260
|
-
type: string;
|
|
261
|
-
connectedData?: {
|
|
262
|
-
pointer: string;
|
|
263
|
-
syntax: "jptr";
|
|
264
|
-
} | undefined;
|
|
265
|
-
locales?: {
|
|
266
|
-
[key: string]: unknown;
|
|
267
|
-
} | undefined;
|
|
268
|
-
};
|
|
269
|
-
} | undefined;
|
|
270
|
-
slots?: {
|
|
271
|
-
[key: string]: any[];
|
|
272
|
-
} | undefined;
|
|
273
|
-
variant?: string | undefined;
|
|
274
|
-
};
|
|
275
|
-
} | undefined;
|
|
276
|
-
_overridability?: {
|
|
277
|
-
parameters?: {
|
|
278
|
-
[key: string]: "yes" | "no";
|
|
279
|
-
} | undefined;
|
|
280
|
-
variants?: boolean | undefined;
|
|
281
|
-
hideLockedParameters?: boolean | undefined;
|
|
282
|
-
} | undefined;
|
|
283
|
-
_locales?: string[] | undefined;
|
|
284
|
-
};
|
|
103
|
+
data: _uniformdev_canvas.RootComponentInstance;
|
|
285
104
|
}, querystring.ParsedUrlQuery, UniformPreviewData>;
|
|
286
105
|
/**
|
|
287
106
|
* Default implementation of getStaticProps with routes
|
|
@@ -289,171 +108,7 @@ declare const getServerSideProps: next.GetServerSideProps<{
|
|
|
289
108
|
* export getStaticProps = withUniformGetStaticProps({ ... });
|
|
290
109
|
*/
|
|
291
110
|
declare const getStaticProps: next.GetStaticProps<{
|
|
292
|
-
data:
|
|
293
|
-
type: string;
|
|
294
|
-
parameters?: {
|
|
295
|
-
[key: string]: {
|
|
296
|
-
value?: unknown;
|
|
297
|
-
type: string;
|
|
298
|
-
connectedData?: {
|
|
299
|
-
pointer: string;
|
|
300
|
-
syntax: "jptr";
|
|
301
|
-
} | undefined;
|
|
302
|
-
locales?: {
|
|
303
|
-
[key: string]: unknown;
|
|
304
|
-
} | undefined;
|
|
305
|
-
};
|
|
306
|
-
} | undefined;
|
|
307
|
-
variant?: string | undefined;
|
|
308
|
-
projectMapNodes?: {
|
|
309
|
-
id: string;
|
|
310
|
-
path: string;
|
|
311
|
-
projectMapId: string;
|
|
312
|
-
data?: {
|
|
313
|
-
isSearchHit?: boolean | undefined;
|
|
314
|
-
queryStrings?: {
|
|
315
|
-
name: string;
|
|
316
|
-
value: string;
|
|
317
|
-
helpText?: string | undefined;
|
|
318
|
-
}[] | undefined;
|
|
319
|
-
previewValue?: string | undefined;
|
|
320
|
-
} | undefined;
|
|
321
|
-
locales?: {
|
|
322
|
-
[key: string]: {
|
|
323
|
-
path: string;
|
|
324
|
-
inherited: boolean;
|
|
325
|
-
};
|
|
326
|
-
} | undefined;
|
|
327
|
-
}[] | undefined;
|
|
328
|
-
slots?: {
|
|
329
|
-
[key: string]: {
|
|
330
|
-
type: string;
|
|
331
|
-
parameters?: {
|
|
332
|
-
[key: string]: {
|
|
333
|
-
value?: unknown;
|
|
334
|
-
type: string;
|
|
335
|
-
connectedData?: {
|
|
336
|
-
pointer: string;
|
|
337
|
-
syntax: "jptr";
|
|
338
|
-
} | undefined;
|
|
339
|
-
locales?: {
|
|
340
|
-
[key: string]: unknown;
|
|
341
|
-
} | undefined;
|
|
342
|
-
};
|
|
343
|
-
} | undefined;
|
|
344
|
-
variant?: string | undefined;
|
|
345
|
-
slots?: {
|
|
346
|
-
[key: string]: any[];
|
|
347
|
-
} | undefined;
|
|
348
|
-
_id?: string | undefined;
|
|
349
|
-
_pattern?: string | undefined;
|
|
350
|
-
_dataResources?: {
|
|
351
|
-
[key: string]: {
|
|
352
|
-
type: string;
|
|
353
|
-
isPatternParameter?: boolean | undefined;
|
|
354
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
355
|
-
variables?: {
|
|
356
|
-
[key: string]: string;
|
|
357
|
-
} | undefined;
|
|
358
|
-
};
|
|
359
|
-
} | undefined;
|
|
360
|
-
_patternDataResources?: {
|
|
361
|
-
[key: string]: {
|
|
362
|
-
type: string;
|
|
363
|
-
isPatternParameter?: boolean | undefined;
|
|
364
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
365
|
-
variables?: {
|
|
366
|
-
[key: string]: string;
|
|
367
|
-
} | undefined;
|
|
368
|
-
};
|
|
369
|
-
} | undefined;
|
|
370
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
|
371
|
-
_overrides?: {
|
|
372
|
-
[key: string]: {
|
|
373
|
-
parameters?: {
|
|
374
|
-
[key: string]: {
|
|
375
|
-
value?: unknown;
|
|
376
|
-
type: string;
|
|
377
|
-
connectedData?: {
|
|
378
|
-
pointer: string;
|
|
379
|
-
syntax: "jptr";
|
|
380
|
-
} | undefined;
|
|
381
|
-
locales?: {
|
|
382
|
-
[key: string]: unknown;
|
|
383
|
-
} | undefined;
|
|
384
|
-
};
|
|
385
|
-
} | undefined;
|
|
386
|
-
slots?: {
|
|
387
|
-
[key: string]: any[];
|
|
388
|
-
} | undefined;
|
|
389
|
-
variant?: string | undefined;
|
|
390
|
-
};
|
|
391
|
-
} | undefined;
|
|
392
|
-
_overridability?: {
|
|
393
|
-
parameters?: {
|
|
394
|
-
[key: string]: "yes" | "no";
|
|
395
|
-
} | undefined;
|
|
396
|
-
variants?: boolean | undefined;
|
|
397
|
-
hideLockedParameters?: boolean | undefined;
|
|
398
|
-
} | undefined;
|
|
399
|
-
_locales?: string[] | undefined;
|
|
400
|
-
}[];
|
|
401
|
-
} | undefined;
|
|
402
|
-
_id: string;
|
|
403
|
-
_slug?: string | null | undefined;
|
|
404
|
-
_name: string;
|
|
405
|
-
_pattern?: string | undefined;
|
|
406
|
-
_patternDataResources?: {
|
|
407
|
-
[key: string]: {
|
|
408
|
-
type: string;
|
|
409
|
-
isPatternParameter?: boolean | undefined;
|
|
410
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
411
|
-
variables?: {
|
|
412
|
-
[key: string]: string;
|
|
413
|
-
} | undefined;
|
|
414
|
-
};
|
|
415
|
-
} | undefined;
|
|
416
|
-
_dataResources?: {
|
|
417
|
-
[key: string]: {
|
|
418
|
-
type: string;
|
|
419
|
-
isPatternParameter?: boolean | undefined;
|
|
420
|
-
ignorePatternParameterDefault?: boolean | undefined;
|
|
421
|
-
variables?: {
|
|
422
|
-
[key: string]: string;
|
|
423
|
-
} | undefined;
|
|
424
|
-
};
|
|
425
|
-
} | undefined;
|
|
426
|
-
_patternError?: "NOTFOUND" | "CYCLIC" | undefined;
|
|
427
|
-
_overrides?: {
|
|
428
|
-
[key: string]: {
|
|
429
|
-
parameters?: {
|
|
430
|
-
[key: string]: {
|
|
431
|
-
value?: unknown;
|
|
432
|
-
type: string;
|
|
433
|
-
connectedData?: {
|
|
434
|
-
pointer: string;
|
|
435
|
-
syntax: "jptr";
|
|
436
|
-
} | undefined;
|
|
437
|
-
locales?: {
|
|
438
|
-
[key: string]: unknown;
|
|
439
|
-
} | undefined;
|
|
440
|
-
};
|
|
441
|
-
} | undefined;
|
|
442
|
-
slots?: {
|
|
443
|
-
[key: string]: any[];
|
|
444
|
-
} | undefined;
|
|
445
|
-
variant?: string | undefined;
|
|
446
|
-
};
|
|
447
|
-
} | undefined;
|
|
448
|
-
_overridability?: {
|
|
449
|
-
parameters?: {
|
|
450
|
-
[key: string]: "yes" | "no";
|
|
451
|
-
} | undefined;
|
|
452
|
-
variants?: boolean | undefined;
|
|
453
|
-
hideLockedParameters?: boolean | undefined;
|
|
454
|
-
} | undefined;
|
|
455
|
-
_locales?: string[] | undefined;
|
|
456
|
-
};
|
|
111
|
+
data: _uniformdev_canvas.RootComponentInstance;
|
|
457
112
|
}, querystring.ParsedUrlQuery, UniformPreviewData>;
|
|
458
113
|
/**
|
|
459
114
|
* Default implementation of getStaticPaths with routes
|
package/dist/route/index.js
CHANGED
|
@@ -477,8 +477,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
477
477
|
|
|
478
478
|
// src/route/localePathModifier.ts
|
|
479
479
|
var prependLocale = (path, { locale, defaultLocale, locales }) => {
|
|
480
|
-
if (!(locales == null ? void 0 : locales.length))
|
|
481
|
-
return path;
|
|
480
|
+
if (!(locales == null ? void 0 : locales.length)) return path;
|
|
482
481
|
const slug = path === "/" ? "" : path;
|
|
483
482
|
return decodeURI(`/${locale || defaultLocale}${slug}`);
|
|
484
483
|
};
|
package/dist/route/index.mjs
CHANGED
|
@@ -344,8 +344,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
344
344
|
|
|
345
345
|
// src/route/localePathModifier.ts
|
|
346
346
|
var prependLocale = (path, { locale, defaultLocale, locales }) => {
|
|
347
|
-
if (!(locales == null ? void 0 : locales.length))
|
|
348
|
-
return path;
|
|
347
|
+
if (!(locales == null ? void 0 : locales.length)) return path;
|
|
349
348
|
const slug = path === "/" ? "" : path;
|
|
350
349
|
return decodeURI(`/${locale || defaultLocale}${slug}`);
|
|
351
350
|
};
|
package/dist/slug/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
|
|
3
|
-
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-
|
|
3
|
+
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-CupnCqnn.mjs';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
|
-
import
|
|
7
|
-
import { CanvasClient, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
|
|
6
|
+
import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
|
|
8
7
|
import '@uniformdev/canvas-react';
|
|
9
8
|
|
|
10
9
|
declare const withUniformGetServerSideProps: <TProps extends {
|
|
@@ -13,44 +12,32 @@ declare const withUniformGetServerSideProps: <TProps extends {
|
|
|
13
12
|
[key: string]: any;
|
|
14
13
|
}>(options?: {
|
|
15
14
|
/** 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 slug structure */
|
|
16
|
-
prefix?: string
|
|
15
|
+
prefix?: string;
|
|
17
16
|
/** Useful when you need to modify the slug passed to the API */
|
|
18
|
-
modifySlug?: (
|
|
17
|
+
modifySlug?: (slug: string, context: GetServerSidePropsContext<ParsedUrlQuery, UniformPreviewData>) => string;
|
|
19
18
|
/** Set to true if you want to include draft compositions */
|
|
20
|
-
preview?: boolean
|
|
19
|
+
preview?: boolean;
|
|
21
20
|
/** If you need to override the default client, you can pass it here */
|
|
22
|
-
client?: CanvasClient
|
|
23
|
-
requestOptions?: Omit<Partial<
|
|
24
|
-
|
|
25
|
-
skipEnhance?: boolean | undefined;
|
|
26
|
-
skipPatternResolution?: boolean | undefined;
|
|
27
|
-
skipOverridesResolution?: boolean | undefined;
|
|
28
|
-
state?: number | undefined;
|
|
29
|
-
withComponentIDs?: boolean | undefined;
|
|
30
|
-
withTotalCount?: boolean | undefined;
|
|
31
|
-
withUIStatus?: boolean | undefined;
|
|
32
|
-
withContentSourceMap?: boolean | undefined;
|
|
33
|
-
locale?: string | undefined;
|
|
34
|
-
releaseId?: string | undefined;
|
|
35
|
-
} & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "slug">> & DataResolutionOption>, "state"> | undefined;
|
|
36
|
-
callback?: UniformGetServerSideProps<TProps> | undefined;
|
|
21
|
+
client?: CanvasClient;
|
|
22
|
+
requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
|
|
23
|
+
callback?: UniformGetServerSideProps<TProps>;
|
|
37
24
|
/** Disables logging of response information and timings */
|
|
38
|
-
silent?: boolean
|
|
39
|
-
}
|
|
25
|
+
silent?: boolean;
|
|
26
|
+
}) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
|
|
40
27
|
|
|
41
28
|
declare const withUniformGetStaticPaths: (options?: {
|
|
42
|
-
projectMapId?: string
|
|
29
|
+
projectMapId?: string;
|
|
43
30
|
/** A string that you want prepended to slugs returned by Canvas. Useful when calling from a nested folder which is not part of your slug structure */
|
|
44
|
-
prefix?: string
|
|
31
|
+
prefix?: string;
|
|
45
32
|
/** Set to true if you want to include draft compositions */
|
|
46
|
-
preview?: boolean
|
|
33
|
+
preview?: boolean;
|
|
47
34
|
/** Way to override getCompositionList request params */
|
|
48
|
-
requestOptions?: Partial<CompositionGetParameters
|
|
35
|
+
requestOptions?: Partial<CompositionGetParameters>;
|
|
49
36
|
/** Way to modify list of slugs before building array of paths */
|
|
50
|
-
callback?: (
|
|
37
|
+
callback?: (compositions: CompositionGetResponse[]) => Promise<CompositionGetResponse[]>;
|
|
51
38
|
/** If you need to override the default client, you can pass it here */
|
|
52
|
-
client?: CanvasClient
|
|
53
|
-
}
|
|
39
|
+
client?: CanvasClient;
|
|
40
|
+
}) => () => Promise<{
|
|
54
41
|
paths: string[];
|
|
55
42
|
fallback: boolean;
|
|
56
43
|
}>;
|
|
@@ -63,29 +50,17 @@ declare const withUniformGetStaticProps: <TProps extends {
|
|
|
63
50
|
/** Name of dynamic parameter coming from getStaticPath, usually specified in page file name (e.g. [...slug].jsx will have param = 'slug' */
|
|
64
51
|
param: string;
|
|
65
52
|
/** Useful when you need to modify the slug passed to the API */
|
|
66
|
-
modifySlug?: (
|
|
53
|
+
modifySlug?: (slug: string, context: GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>) => string;
|
|
67
54
|
/** Set to true if you want to include draft compositions */
|
|
68
|
-
preview?: boolean
|
|
55
|
+
preview?: boolean;
|
|
69
56
|
/** If you need to override the default client, you can pass it here */
|
|
70
|
-
client?: CanvasClient
|
|
57
|
+
client?: CanvasClient;
|
|
71
58
|
/** Way to override getCompositionBySlug request params */
|
|
72
|
-
requestOptions?: Omit<Partial<
|
|
73
|
-
versionId?: string | undefined;
|
|
74
|
-
skipEnhance?: boolean | undefined;
|
|
75
|
-
skipPatternResolution?: boolean | undefined;
|
|
76
|
-
skipOverridesResolution?: boolean | undefined;
|
|
77
|
-
state?: number | undefined;
|
|
78
|
-
withComponentIDs?: boolean | undefined;
|
|
79
|
-
withTotalCount?: boolean | undefined;
|
|
80
|
-
withUIStatus?: boolean | undefined;
|
|
81
|
-
withContentSourceMap?: boolean | undefined;
|
|
82
|
-
locale?: string | undefined;
|
|
83
|
-
releaseId?: string | undefined;
|
|
84
|
-
} & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "slug">> & DataResolutionOption>, "state"> | undefined;
|
|
59
|
+
requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
|
|
85
60
|
/** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
|
|
86
|
-
callback?: UniformGetStaticProps<TProps
|
|
61
|
+
callback?: UniformGetStaticProps<TProps>;
|
|
87
62
|
/** Disables logging of response information and timings */
|
|
88
|
-
silent?: boolean
|
|
63
|
+
silent?: boolean;
|
|
89
64
|
}) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
|
|
90
65
|
|
|
91
66
|
declare const getServerSideProps: next.GetServerSideProps<{
|
package/dist/slug/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
|
|
3
|
-
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-
|
|
3
|
+
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-CupnCqnn.js';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
|
-
import
|
|
7
|
-
import { CanvasClient, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
|
|
6
|
+
import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
|
|
8
7
|
import '@uniformdev/canvas-react';
|
|
9
8
|
|
|
10
9
|
declare const withUniformGetServerSideProps: <TProps extends {
|
|
@@ -13,44 +12,32 @@ declare const withUniformGetServerSideProps: <TProps extends {
|
|
|
13
12
|
[key: string]: any;
|
|
14
13
|
}>(options?: {
|
|
15
14
|
/** 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 slug structure */
|
|
16
|
-
prefix?: string
|
|
15
|
+
prefix?: string;
|
|
17
16
|
/** Useful when you need to modify the slug passed to the API */
|
|
18
|
-
modifySlug?: (
|
|
17
|
+
modifySlug?: (slug: string, context: GetServerSidePropsContext<ParsedUrlQuery, UniformPreviewData>) => string;
|
|
19
18
|
/** Set to true if you want to include draft compositions */
|
|
20
|
-
preview?: boolean
|
|
19
|
+
preview?: boolean;
|
|
21
20
|
/** If you need to override the default client, you can pass it here */
|
|
22
|
-
client?: CanvasClient
|
|
23
|
-
requestOptions?: Omit<Partial<
|
|
24
|
-
|
|
25
|
-
skipEnhance?: boolean | undefined;
|
|
26
|
-
skipPatternResolution?: boolean | undefined;
|
|
27
|
-
skipOverridesResolution?: boolean | undefined;
|
|
28
|
-
state?: number | undefined;
|
|
29
|
-
withComponentIDs?: boolean | undefined;
|
|
30
|
-
withTotalCount?: boolean | undefined;
|
|
31
|
-
withUIStatus?: boolean | undefined;
|
|
32
|
-
withContentSourceMap?: boolean | undefined;
|
|
33
|
-
locale?: string | undefined;
|
|
34
|
-
releaseId?: string | undefined;
|
|
35
|
-
} & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "slug">> & DataResolutionOption>, "state"> | undefined;
|
|
36
|
-
callback?: UniformGetServerSideProps<TProps> | undefined;
|
|
21
|
+
client?: CanvasClient;
|
|
22
|
+
requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
|
|
23
|
+
callback?: UniformGetServerSideProps<TProps>;
|
|
37
24
|
/** Disables logging of response information and timings */
|
|
38
|
-
silent?: boolean
|
|
39
|
-
}
|
|
25
|
+
silent?: boolean;
|
|
26
|
+
}) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
|
|
40
27
|
|
|
41
28
|
declare const withUniformGetStaticPaths: (options?: {
|
|
42
|
-
projectMapId?: string
|
|
29
|
+
projectMapId?: string;
|
|
43
30
|
/** A string that you want prepended to slugs returned by Canvas. Useful when calling from a nested folder which is not part of your slug structure */
|
|
44
|
-
prefix?: string
|
|
31
|
+
prefix?: string;
|
|
45
32
|
/** Set to true if you want to include draft compositions */
|
|
46
|
-
preview?: boolean
|
|
33
|
+
preview?: boolean;
|
|
47
34
|
/** Way to override getCompositionList request params */
|
|
48
|
-
requestOptions?: Partial<CompositionGetParameters
|
|
35
|
+
requestOptions?: Partial<CompositionGetParameters>;
|
|
49
36
|
/** Way to modify list of slugs before building array of paths */
|
|
50
|
-
callback?: (
|
|
37
|
+
callback?: (compositions: CompositionGetResponse[]) => Promise<CompositionGetResponse[]>;
|
|
51
38
|
/** If you need to override the default client, you can pass it here */
|
|
52
|
-
client?: CanvasClient
|
|
53
|
-
}
|
|
39
|
+
client?: CanvasClient;
|
|
40
|
+
}) => () => Promise<{
|
|
54
41
|
paths: string[];
|
|
55
42
|
fallback: boolean;
|
|
56
43
|
}>;
|
|
@@ -63,29 +50,17 @@ declare const withUniformGetStaticProps: <TProps extends {
|
|
|
63
50
|
/** Name of dynamic parameter coming from getStaticPath, usually specified in page file name (e.g. [...slug].jsx will have param = 'slug' */
|
|
64
51
|
param: string;
|
|
65
52
|
/** Useful when you need to modify the slug passed to the API */
|
|
66
|
-
modifySlug?: (
|
|
53
|
+
modifySlug?: (slug: string, context: GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>) => string;
|
|
67
54
|
/** Set to true if you want to include draft compositions */
|
|
68
|
-
preview?: boolean
|
|
55
|
+
preview?: boolean;
|
|
69
56
|
/** If you need to override the default client, you can pass it here */
|
|
70
|
-
client?: CanvasClient
|
|
57
|
+
client?: CanvasClient;
|
|
71
58
|
/** Way to override getCompositionBySlug request params */
|
|
72
|
-
requestOptions?: Omit<Partial<
|
|
73
|
-
versionId?: string | undefined;
|
|
74
|
-
skipEnhance?: boolean | undefined;
|
|
75
|
-
skipPatternResolution?: boolean | undefined;
|
|
76
|
-
skipOverridesResolution?: boolean | undefined;
|
|
77
|
-
state?: number | undefined;
|
|
78
|
-
withComponentIDs?: boolean | undefined;
|
|
79
|
-
withTotalCount?: boolean | undefined;
|
|
80
|
-
withUIStatus?: boolean | undefined;
|
|
81
|
-
withContentSourceMap?: boolean | undefined;
|
|
82
|
-
locale?: string | undefined;
|
|
83
|
-
releaseId?: string | undefined;
|
|
84
|
-
} & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "slug">> & DataResolutionOption>, "state"> | undefined;
|
|
59
|
+
requestOptions?: Omit<Partial<CompositionGetBySlugParameters & DataResolutionOption>, "state">;
|
|
85
60
|
/** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
|
|
86
|
-
callback?: UniformGetStaticProps<TProps
|
|
61
|
+
callback?: UniformGetStaticProps<TProps>;
|
|
87
62
|
/** Disables logging of response information and timings */
|
|
88
|
-
silent?: boolean
|
|
63
|
+
silent?: boolean;
|
|
89
64
|
}) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
|
|
90
65
|
|
|
91
66
|
declare const getServerSideProps: next.GetServerSideProps<{
|