@uniformdev/canvas-next 19.173.1-alpha.17 → 19.173.2-alpha.210

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.
@@ -3,9 +3,8 @@ import { GetServerSidePropsContext, PreviewData, GetServerSideProps, GetStaticPr
3
3
  import { c as UniformGetServerSideProps, a as UniformPreviewData, b as UniformGetStaticProps } from '../models-CupnCqnn.mjs';
4
4
  import * as querystring from 'querystring';
5
5
  import { ParsedUrlQuery } from 'querystring';
6
- import * as _uniformdev_canvas from '@uniformdev/canvas';
7
- import { CanvasClient, DataResolutionOption } from '@uniformdev/canvas';
8
- import { ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
6
+ import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
7
+ import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
9
8
  import '@uniformdev/canvas-react';
10
9
 
11
10
  declare const withUniformGetServerSideProps: <TProps extends {
@@ -14,69 +13,37 @@ declare const withUniformGetServerSideProps: <TProps extends {
14
13
  [key: string]: any;
15
14
  }>(options?: {
16
15
  /** If you need to override the default client, you can pass it here */
17
- client?: CanvasClient | undefined;
16
+ client?: CanvasClient;
18
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 */
19
- prefix?: string | undefined;
18
+ prefix?: string;
20
19
  /** Useful when you need to modify the path passed to the API */
21
- modifyPath?: ((path: string, context: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>) => string) | undefined;
20
+ modifyPath?: (path: string, context: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>) => string;
22
21
  /** Set to true if you want to include draft compositions */
23
- preview?: boolean | undefined;
24
- projectMapId?: string | undefined;
22
+ preview?: boolean;
23
+ projectMapId?: string;
25
24
  /** Way to override getCompositionByNodePath request params */
26
- requestOptions?: Omit<Partial<{
27
- versionId?: string | undefined;
28
- skipEnhance?: boolean | undefined;
29
- skipPatternResolution?: boolean | undefined;
30
- skipOverridesResolution?: boolean | undefined;
31
- state?: number | undefined;
32
- withComponentIDs?: boolean | undefined;
33
- withTotalCount?: boolean | undefined;
34
- withUIStatus?: boolean | undefined;
35
- withWorkflowDefinition?: boolean | undefined;
36
- withProjectMapNodes?: boolean | undefined;
37
- withContentSourceMap?: boolean | undefined;
38
- locale?: string | undefined;
39
- releaseId?: string | undefined;
40
- } & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "projectMapNodePath">> & _uniformdev_canvas.SpecificProjectMap & DataResolutionOption>, "state"> | undefined;
25
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
41
26
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
42
- callback?: UniformGetServerSideProps<TProps> | undefined;
27
+ callback?: UniformGetServerSideProps<TProps>;
43
28
  /** Disables logging of response information and timings */
44
- silent?: boolean | undefined;
45
- } | undefined) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
29
+ silent?: boolean;
30
+ }) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
46
31
 
47
32
  declare const withUniformGetStaticPaths: (options?: {
48
- projectMapId?: string | undefined;
33
+ projectMapId?: string;
49
34
  /** Starting path to fetch nodes from */
50
- rootPath?: string | undefined;
35
+ rootPath?: string;
51
36
  /** 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 */
52
- prefix?: string | undefined;
37
+ prefix?: string;
53
38
  /** Set to true if you want to include draft compositions */
54
- preview?: boolean | undefined;
39
+ preview?: boolean;
55
40
  /** Way to override getNodes request params */
56
- requestOptions?: Partial<{
57
- projectMapId?: string | undefined;
58
- projectId: string;
59
- releaseId?: string | undefined;
60
- id?: string | undefined;
61
- path?: string | undefined;
62
- compositionId?: string | undefined;
63
- limit?: number | undefined;
64
- offset?: number | undefined;
65
- depth?: number | undefined;
66
- state?: number | undefined;
67
- tree?: boolean | undefined;
68
- search?: string | undefined;
69
- includeAncestors?: boolean | undefined;
70
- expanded?: boolean | undefined;
71
- withCompositionData?: boolean | undefined;
72
- withCompositionUIStatus?: boolean | undefined;
73
- withRedirectData?: boolean | undefined;
74
- }> | undefined;
41
+ requestOptions?: Partial<ProjectMapNodeGetRequest>;
75
42
  /** Way to modify list of nodes before building array of paths */
76
- callback?: ((nodes: ProjectMapNodeGetResponse['nodes']) => Promise<ProjectMapNodeGetResponse['nodes']>) | undefined;
43
+ callback?: (nodes: ProjectMapNodeGetResponse["nodes"]) => Promise<ProjectMapNodeGetResponse["nodes"]>;
77
44
  /** If you need to override the default client, you can pass it here */
78
- client?: ProjectMapClient | undefined;
79
- } | undefined) => () => Promise<{
45
+ client?: ProjectMapClient;
46
+ }) => () => Promise<{
80
47
  paths: string[] | undefined;
81
48
  fallback: boolean;
82
49
  }>;
@@ -86,35 +53,21 @@ declare const withUniformGetStaticProps: <TProps extends {
86
53
  } = {
87
54
  [key: string]: any;
88
55
  }>(options: {
89
- projectMapId?: string | undefined;
56
+ projectMapId?: string;
90
57
  /** Name of dynamic parameter coming from getStaticPath, usually specified in page file name (e.g. [...slug].jsx will have param = 'slug' */
91
58
  param: string;
92
59
  /** Useful when you need to modify the path passed to the API */
93
- modifyPath?: ((path: string, context: GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>) => string) | undefined;
60
+ modifyPath?: (path: string, context: GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>) => string;
94
61
  /** Set to true if you want to include draft compositions */
95
- preview?: boolean | undefined;
62
+ preview?: boolean;
96
63
  /** If you need to override the default client, you can pass it here */
97
- client?: CanvasClient | undefined;
64
+ client?: CanvasClient;
98
65
  /** Way to override getCompositionByNodePath request params */
99
- requestOptions?: Omit<Partial<{
100
- versionId?: string | undefined;
101
- skipEnhance?: boolean | undefined;
102
- skipPatternResolution?: boolean | undefined;
103
- skipOverridesResolution?: boolean | undefined;
104
- state?: number | undefined;
105
- withComponentIDs?: boolean | undefined;
106
- withTotalCount?: boolean | undefined;
107
- withUIStatus?: boolean | undefined;
108
- withWorkflowDefinition?: boolean | undefined;
109
- withProjectMapNodes?: boolean | undefined;
110
- withContentSourceMap?: boolean | undefined;
111
- locale?: string | undefined;
112
- releaseId?: string | undefined;
113
- } & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "projectMapNodePath">> & _uniformdev_canvas.SpecificProjectMap & DataResolutionOption>, "state"> | undefined;
66
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
114
67
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
115
- callback?: UniformGetStaticProps<TProps> | undefined;
68
+ callback?: UniformGetStaticProps<TProps>;
116
69
  /** Disables logging of response information and timings */
117
- silent?: boolean | undefined;
70
+ silent?: boolean;
118
71
  }) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
119
72
 
120
73
  declare const getServerSideProps: next.GetServerSideProps<{
@@ -3,9 +3,8 @@ import { GetServerSidePropsContext, PreviewData, GetServerSideProps, GetStaticPr
3
3
  import { c as UniformGetServerSideProps, a as UniformPreviewData, b as UniformGetStaticProps } 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';
7
- import { CanvasClient, DataResolutionOption } from '@uniformdev/canvas';
8
- import { ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
6
+ import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
7
+ import { ProjectMapNodeGetRequest, ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
9
8
  import '@uniformdev/canvas-react';
10
9
 
11
10
  declare const withUniformGetServerSideProps: <TProps extends {
@@ -14,69 +13,37 @@ declare const withUniformGetServerSideProps: <TProps extends {
14
13
  [key: string]: any;
15
14
  }>(options?: {
16
15
  /** If you need to override the default client, you can pass it here */
17
- client?: CanvasClient | undefined;
16
+ client?: CanvasClient;
18
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 */
19
- prefix?: string | undefined;
18
+ prefix?: string;
20
19
  /** Useful when you need to modify the path passed to the API */
21
- modifyPath?: ((path: string, context: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>) => string) | undefined;
20
+ modifyPath?: (path: string, context: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>) => string;
22
21
  /** Set to true if you want to include draft compositions */
23
- preview?: boolean | undefined;
24
- projectMapId?: string | undefined;
22
+ preview?: boolean;
23
+ projectMapId?: string;
25
24
  /** Way to override getCompositionByNodePath request params */
26
- requestOptions?: Omit<Partial<{
27
- versionId?: string | undefined;
28
- skipEnhance?: boolean | undefined;
29
- skipPatternResolution?: boolean | undefined;
30
- skipOverridesResolution?: boolean | undefined;
31
- state?: number | undefined;
32
- withComponentIDs?: boolean | undefined;
33
- withTotalCount?: boolean | undefined;
34
- withUIStatus?: boolean | undefined;
35
- withWorkflowDefinition?: boolean | undefined;
36
- withProjectMapNodes?: boolean | undefined;
37
- withContentSourceMap?: boolean | undefined;
38
- locale?: string | undefined;
39
- releaseId?: string | undefined;
40
- } & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "projectMapNodePath">> & _uniformdev_canvas.SpecificProjectMap & DataResolutionOption>, "state"> | undefined;
25
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
41
26
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
42
- callback?: UniformGetServerSideProps<TProps> | undefined;
27
+ callback?: UniformGetServerSideProps<TProps>;
43
28
  /** Disables logging of response information and timings */
44
- silent?: boolean | undefined;
45
- } | undefined) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
29
+ silent?: boolean;
30
+ }) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
46
31
 
47
32
  declare const withUniformGetStaticPaths: (options?: {
48
- projectMapId?: string | undefined;
33
+ projectMapId?: string;
49
34
  /** Starting path to fetch nodes from */
50
- rootPath?: string | undefined;
35
+ rootPath?: string;
51
36
  /** 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 */
52
- prefix?: string | undefined;
37
+ prefix?: string;
53
38
  /** Set to true if you want to include draft compositions */
54
- preview?: boolean | undefined;
39
+ preview?: boolean;
55
40
  /** Way to override getNodes request params */
56
- requestOptions?: Partial<{
57
- projectMapId?: string | undefined;
58
- projectId: string;
59
- releaseId?: string | undefined;
60
- id?: string | undefined;
61
- path?: string | undefined;
62
- compositionId?: string | undefined;
63
- limit?: number | undefined;
64
- offset?: number | undefined;
65
- depth?: number | undefined;
66
- state?: number | undefined;
67
- tree?: boolean | undefined;
68
- search?: string | undefined;
69
- includeAncestors?: boolean | undefined;
70
- expanded?: boolean | undefined;
71
- withCompositionData?: boolean | undefined;
72
- withCompositionUIStatus?: boolean | undefined;
73
- withRedirectData?: boolean | undefined;
74
- }> | undefined;
41
+ requestOptions?: Partial<ProjectMapNodeGetRequest>;
75
42
  /** Way to modify list of nodes before building array of paths */
76
- callback?: ((nodes: ProjectMapNodeGetResponse['nodes']) => Promise<ProjectMapNodeGetResponse['nodes']>) | undefined;
43
+ callback?: (nodes: ProjectMapNodeGetResponse["nodes"]) => Promise<ProjectMapNodeGetResponse["nodes"]>;
77
44
  /** If you need to override the default client, you can pass it here */
78
- client?: ProjectMapClient | undefined;
79
- } | undefined) => () => Promise<{
45
+ client?: ProjectMapClient;
46
+ }) => () => Promise<{
80
47
  paths: string[] | undefined;
81
48
  fallback: boolean;
82
49
  }>;
@@ -86,35 +53,21 @@ declare const withUniformGetStaticProps: <TProps extends {
86
53
  } = {
87
54
  [key: string]: any;
88
55
  }>(options: {
89
- projectMapId?: string | undefined;
56
+ projectMapId?: string;
90
57
  /** Name of dynamic parameter coming from getStaticPath, usually specified in page file name (e.g. [...slug].jsx will have param = 'slug' */
91
58
  param: string;
92
59
  /** Useful when you need to modify the path passed to the API */
93
- modifyPath?: ((path: string, context: GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>) => string) | undefined;
60
+ modifyPath?: (path: string, context: GetStaticPropsContext<ParsedUrlQuery, UniformPreviewData>) => string;
94
61
  /** Set to true if you want to include draft compositions */
95
- preview?: boolean | undefined;
62
+ preview?: boolean;
96
63
  /** If you need to override the default client, you can pass it here */
97
- client?: CanvasClient | undefined;
64
+ client?: CanvasClient;
98
65
  /** Way to override getCompositionByNodePath request params */
99
- requestOptions?: Omit<Partial<{
100
- versionId?: string | undefined;
101
- skipEnhance?: boolean | undefined;
102
- skipPatternResolution?: boolean | undefined;
103
- skipOverridesResolution?: boolean | undefined;
104
- state?: number | undefined;
105
- withComponentIDs?: boolean | undefined;
106
- withTotalCount?: boolean | undefined;
107
- withUIStatus?: boolean | undefined;
108
- withWorkflowDefinition?: boolean | undefined;
109
- withProjectMapNodes?: boolean | undefined;
110
- withContentSourceMap?: boolean | undefined;
111
- locale?: string | undefined;
112
- releaseId?: string | undefined;
113
- } & Required<Pick<_uniformdev_canvas.CompositionGetParameters, "projectMapNodePath">> & _uniformdev_canvas.SpecificProjectMap & DataResolutionOption>, "state"> | undefined;
66
+ requestOptions?: Omit<Partial<CompositionGetByNodePathParameters & DataResolutionOption>, "state">;
114
67
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
115
- callback?: UniformGetStaticProps<TProps> | undefined;
68
+ callback?: UniformGetStaticProps<TProps>;
116
69
  /** Disables logging of response information and timings */
117
- silent?: boolean | undefined;
70
+ silent?: boolean;
118
71
  }) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
119
72
 
120
73
  declare const getServerSideProps: next.GetServerSideProps<{