@uniformdev/canvas 16.2.4 → 17.0.0
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/chunk-VQFPUXRX.mjs +5 -0
- package/dist/cli/cli.d.ts +2 -5
- package/dist/cli/cli.js +72 -56
- package/dist/cli/cli.mjs +71 -55
- package/dist/createEventBus-aea3860f.d.ts +1056 -0
- package/dist/index.d.ts +229 -11
- package/dist/index.esm.js +1 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -4
- package/package.json +14 -12
- package/dist/chunk-ADDR7SB6.mjs +0 -2
- package/dist/createEventBus-a6696d11.d.ts +0 -266
@@ -0,0 +1,1056 @@
|
|
1
|
+
import Pusher from 'pusher-js';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* This file was auto-generated by openapi-typescript.
|
5
|
+
* Do not make direct changes to the file.
|
6
|
+
*/
|
7
|
+
interface paths$1 {
|
8
|
+
"/api/v1/canvas-definitions": {
|
9
|
+
get: {
|
10
|
+
parameters: {
|
11
|
+
query: {
|
12
|
+
/** The project ID to get component definitions for. */
|
13
|
+
projectId: string;
|
14
|
+
/** Limit list to one result by ID (response remains an array). */
|
15
|
+
componentId?: string;
|
16
|
+
/** Number of records to skip */
|
17
|
+
offset?: number;
|
18
|
+
/** Max number of records to return */
|
19
|
+
limit?: number;
|
20
|
+
/** Whether to fetch system meta-component definitions (personalize, test, etc) */
|
21
|
+
includeSystem?: boolean;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
responses: {
|
25
|
+
/** OK */
|
26
|
+
200: {
|
27
|
+
content: {
|
28
|
+
"application/json": {
|
29
|
+
/** @description Component definitions that match the query */
|
30
|
+
componentDefinitions: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinition"][];
|
31
|
+
};
|
32
|
+
};
|
33
|
+
};
|
34
|
+
400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
|
35
|
+
401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
|
36
|
+
403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
|
37
|
+
429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
|
38
|
+
500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
|
39
|
+
};
|
40
|
+
};
|
41
|
+
/** Upserts a component definition */
|
42
|
+
put: {
|
43
|
+
responses: {
|
44
|
+
/** OK */
|
45
|
+
204: never;
|
46
|
+
400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
|
47
|
+
401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
|
48
|
+
403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
|
49
|
+
429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
|
50
|
+
500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
|
51
|
+
};
|
52
|
+
requestBody: {
|
53
|
+
content: {
|
54
|
+
"application/json": {
|
55
|
+
/**
|
56
|
+
* Format: uuid
|
57
|
+
* @description The project ID to upsert the component definition to
|
58
|
+
*/
|
59
|
+
projectId: string;
|
60
|
+
componentDefinition: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinition"];
|
61
|
+
};
|
62
|
+
};
|
63
|
+
};
|
64
|
+
};
|
65
|
+
/** Deletes a component definition */
|
66
|
+
delete: {
|
67
|
+
responses: {
|
68
|
+
/** OK */
|
69
|
+
204: never;
|
70
|
+
400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
|
71
|
+
401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
|
72
|
+
403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
|
73
|
+
429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
|
74
|
+
500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
|
75
|
+
};
|
76
|
+
requestBody: {
|
77
|
+
content: {
|
78
|
+
"application/json": {
|
79
|
+
/** @description The public ID of the component definition to delete */
|
80
|
+
componentId: string;
|
81
|
+
/**
|
82
|
+
* Format: uuid
|
83
|
+
* @description The ID of the project the composition to delete belongs to
|
84
|
+
*/
|
85
|
+
projectId: string;
|
86
|
+
};
|
87
|
+
};
|
88
|
+
};
|
89
|
+
};
|
90
|
+
/** Handles preflight requests. This endpoint allows CORS. */
|
91
|
+
options: {
|
92
|
+
responses: {
|
93
|
+
/** OK */
|
94
|
+
204: never;
|
95
|
+
};
|
96
|
+
};
|
97
|
+
};
|
98
|
+
}
|
99
|
+
interface external$1 {
|
100
|
+
"swagger.yml": {
|
101
|
+
paths: {};
|
102
|
+
components: {
|
103
|
+
schemas: {
|
104
|
+
Error: {
|
105
|
+
/** @description Error message(s) that occurred while processing the request */
|
106
|
+
errorMessage?: string[] | string;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
responses: {
|
110
|
+
/** Request input validation failed */
|
111
|
+
BadRequestError: {
|
112
|
+
content: {
|
113
|
+
"application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
|
114
|
+
};
|
115
|
+
};
|
116
|
+
/** API key or token was not valid */
|
117
|
+
UnauthorizedError: {
|
118
|
+
content: {
|
119
|
+
"application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
|
120
|
+
};
|
121
|
+
};
|
122
|
+
/** Permission was denied */
|
123
|
+
ForbiddenError: {
|
124
|
+
content: {
|
125
|
+
"application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
|
126
|
+
};
|
127
|
+
};
|
128
|
+
/** Too many requests in allowed time period */
|
129
|
+
RateLimitError: unknown;
|
130
|
+
/** Execution error occurred */
|
131
|
+
InternalServerError: unknown;
|
132
|
+
};
|
133
|
+
};
|
134
|
+
operations: {};
|
135
|
+
};
|
136
|
+
"uniform-canvas-types.swagger.yml": {
|
137
|
+
paths: {};
|
138
|
+
components: {
|
139
|
+
schemas: {
|
140
|
+
/** @description Public ID (used in code). Do not change after creation. */
|
141
|
+
PublicIdProperty: string;
|
142
|
+
/** @description The definition of a component parameter */
|
143
|
+
ComponentDefinitionParameter: {
|
144
|
+
id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
145
|
+
/** @description Friendly name of the parameter */
|
146
|
+
name: string;
|
147
|
+
/** @description Appears next to the parameter in the Composition editor */
|
148
|
+
helpText?: string;
|
149
|
+
/** @description Type name of the parameter (provided by a Uniform integration) */
|
150
|
+
type: string;
|
151
|
+
/** @description The configuration object for the type (type-specific) */
|
152
|
+
typeConfig?: unknown;
|
153
|
+
};
|
154
|
+
/** @description The definition of a named component slot that can contain other components */
|
155
|
+
ComponentDefinitionSlot: {
|
156
|
+
id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
157
|
+
/** @description Friendly name of the slot */
|
158
|
+
name: string;
|
159
|
+
/** @description A list of component definition public IDs that are allowed in this named slot */
|
160
|
+
allowedComponents: string[];
|
161
|
+
/**
|
162
|
+
* @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
|
163
|
+
* @default false
|
164
|
+
*/
|
165
|
+
inheritAllowedComponents: boolean;
|
166
|
+
/** @description Minimum valid number of components in this slot */
|
167
|
+
minComponents?: number;
|
168
|
+
/** @description Maximum valid number of components in this slot */
|
169
|
+
maxComponents?: number;
|
170
|
+
};
|
171
|
+
/** @description The definition of a composition's slug settings */
|
172
|
+
ComponentDefinitionSlugSettings: {
|
173
|
+
/**
|
174
|
+
* @description Whether the slug is required
|
175
|
+
* no: slug is optional
|
176
|
+
* yes: slug is required
|
177
|
+
* disabled: slug is disabled and will not be shown in the editor
|
178
|
+
*
|
179
|
+
* @default no
|
180
|
+
* @enum {string}
|
181
|
+
*/
|
182
|
+
required?: "no" | "yes" | "disabled";
|
183
|
+
/**
|
184
|
+
* @description Slug uniqueness configuration.
|
185
|
+
* no = no unique constraint
|
186
|
+
* local = must be unique within this component type
|
187
|
+
* global = must be unique across all component types
|
188
|
+
*
|
189
|
+
* @enum {string}
|
190
|
+
*/
|
191
|
+
unique?: "no" | "local" | "global";
|
192
|
+
/** @description Regular expression slugs must match */
|
193
|
+
regularExpression?: string;
|
194
|
+
/**
|
195
|
+
* @description Custom error message when regular expression validation fails.
|
196
|
+
* Has no effect if `regularExpression` is not set.
|
197
|
+
*/
|
198
|
+
regularExpressionMessage?: string;
|
199
|
+
};
|
200
|
+
/** @description The definition of a component variant */
|
201
|
+
ComponentDefinitionVariant: {
|
202
|
+
id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
203
|
+
/** @description Friendly name of the variant */
|
204
|
+
name: string;
|
205
|
+
};
|
206
|
+
/** @description Permission set for a component defintion */
|
207
|
+
ComponentDefinitionPermission: {
|
208
|
+
roleId: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
209
|
+
/**
|
210
|
+
* @description Permission type for this permission ComponentDefinition:
|
211
|
+
* read | write | delete
|
212
|
+
*
|
213
|
+
* @enum {string}
|
214
|
+
*/
|
215
|
+
permission: "read" | "write" | "delete";
|
216
|
+
/** @description State of the component that this permission applies to */
|
217
|
+
state: number;
|
218
|
+
};
|
219
|
+
/** @description Defines a component type that can live on a Composition */
|
220
|
+
ComponentDefinition: {
|
221
|
+
id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
222
|
+
/** @description Friendly name of the component definition */
|
223
|
+
name: string;
|
224
|
+
/**
|
225
|
+
* @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
|
226
|
+
* @default screen
|
227
|
+
*/
|
228
|
+
icon?: string;
|
229
|
+
/**
|
230
|
+
* @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
|
231
|
+
* The parameter type must support being used as a title parameter for this to work.
|
232
|
+
*/
|
233
|
+
titleParameter?: string | null;
|
234
|
+
/**
|
235
|
+
* @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
|
236
|
+
* @default false
|
237
|
+
*/
|
238
|
+
canBeComposition?: boolean;
|
239
|
+
/** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
|
240
|
+
parameters?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
|
241
|
+
/**
|
242
|
+
* @description if this component uses team permissions or custom permissions
|
243
|
+
* @default true
|
244
|
+
*/
|
245
|
+
useTeamPermissions?: boolean;
|
246
|
+
/** @description Custom role permissions for this component definition */
|
247
|
+
permissions?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
|
248
|
+
/** @description The named slots for this component; placement areas where arrays of other components can be added. */
|
249
|
+
slots?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
|
250
|
+
slugSettings?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
|
251
|
+
/** @description Default component instance value */
|
252
|
+
defaults?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
|
253
|
+
/** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
|
254
|
+
variants?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
|
255
|
+
/** @description Created date string for this definition (ignored for writes) */
|
256
|
+
created?: string;
|
257
|
+
/** @description Last modified date string for this definition (ignored for writes) */
|
258
|
+
updated?: string;
|
259
|
+
};
|
260
|
+
/** @description Defines an editable parameter on a component. */
|
261
|
+
ComponentParameter: {
|
262
|
+
/** @description The value of the parameter. Any JSON-serializable value is acceptable. */
|
263
|
+
value: unknown;
|
264
|
+
/** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
|
265
|
+
type: string;
|
266
|
+
binding?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
|
267
|
+
};
|
268
|
+
/**
|
269
|
+
* @deprecated
|
270
|
+
* @description Defines a binding from a resource data value to a component parameter value. Do not use.
|
271
|
+
*/
|
272
|
+
ComponentParameterBinding: {
|
273
|
+
/**
|
274
|
+
* @description A JSON Pointer expression that defines the binding directly to the parameter value, or
|
275
|
+
* a map of JSON Pointers in the target parameter to JSON Pointers in the source resource data.
|
276
|
+
* Used to bind to object-type values.
|
277
|
+
* e.g. { "/prop1/thing": "/res1/things/value" } would set the target parameter's `value` to
|
278
|
+
* {
|
279
|
+
* prop1: {
|
280
|
+
* thing: "value of /res1/things/value resource"
|
281
|
+
* }
|
282
|
+
* }
|
283
|
+
*/
|
284
|
+
pointer: string | {
|
285
|
+
[key: string]: string;
|
286
|
+
};
|
287
|
+
/**
|
288
|
+
* @description The syntax of the binding (currently always 'jptr')
|
289
|
+
* @enum {string}
|
290
|
+
*/
|
291
|
+
syntax: "jptr";
|
292
|
+
};
|
293
|
+
/** @description Defines the shape of a component instance served by the composition API. */
|
294
|
+
ComponentInstance: {
|
295
|
+
/** @description Type of the component instance (public_id of its definition) */
|
296
|
+
type: string;
|
297
|
+
/** @description Component parameter values for the component instance */
|
298
|
+
parameters?: {
|
299
|
+
[key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
|
300
|
+
};
|
301
|
+
/** @description Public ID of alternate visual appearance for this component, if any selected */
|
302
|
+
variant?: string;
|
303
|
+
/** @description Slots containing any child components */
|
304
|
+
slots?: {
|
305
|
+
[key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
|
306
|
+
};
|
307
|
+
/** @description Indicates this component instance should be sourced from a pattern library pattern. */
|
308
|
+
_pattern?: string;
|
309
|
+
/**
|
310
|
+
* @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
|
311
|
+
* CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
|
312
|
+
* NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
|
313
|
+
*
|
314
|
+
* @enum {string}
|
315
|
+
*/
|
316
|
+
_patternError?: "NOTFOUND" | "CYCLIC";
|
317
|
+
};
|
318
|
+
/** @description Defines the shape of the root component in a composition */
|
319
|
+
RootComponentInstance: {
|
320
|
+
/** @description Type of the component instance (public_id of its definition) */
|
321
|
+
type: string;
|
322
|
+
/** @description Component parameter values for the component instance */
|
323
|
+
parameters?: {
|
324
|
+
[key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
|
325
|
+
};
|
326
|
+
/** @description Public ID of alternate visual appearance for this component, if any selected */
|
327
|
+
variant?: string;
|
328
|
+
/** @description Slots containing any child components */
|
329
|
+
slots?: {
|
330
|
+
[key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
|
331
|
+
};
|
332
|
+
/** @description The public UUID of the composition. */
|
333
|
+
_id: string;
|
334
|
+
/** @description Slug pattern of this component. */
|
335
|
+
_slug?: string | null;
|
336
|
+
/** @description Friendly name of this component. */
|
337
|
+
_name: string;
|
338
|
+
};
|
339
|
+
};
|
340
|
+
};
|
341
|
+
operations: {};
|
342
|
+
};
|
343
|
+
}
|
344
|
+
|
345
|
+
interface components$1 {
|
346
|
+
schemas: {
|
347
|
+
/** @description Public ID (used in code). Do not change after creation. */
|
348
|
+
PublicIdProperty: string;
|
349
|
+
/** @description The definition of a component parameter */
|
350
|
+
ComponentDefinitionParameter: {
|
351
|
+
id: components$1["schemas"]["PublicIdProperty"];
|
352
|
+
/** @description Friendly name of the parameter */
|
353
|
+
name: string;
|
354
|
+
/** @description Appears next to the parameter in the Composition editor */
|
355
|
+
helpText?: string;
|
356
|
+
/** @description Type name of the parameter (provided by a Uniform integration) */
|
357
|
+
type: string;
|
358
|
+
/** @description The configuration object for the type (type-specific) */
|
359
|
+
typeConfig?: unknown;
|
360
|
+
};
|
361
|
+
/** @description The definition of a named component slot that can contain other components */
|
362
|
+
ComponentDefinitionSlot: {
|
363
|
+
id: components$1["schemas"]["PublicIdProperty"];
|
364
|
+
/** @description Friendly name of the slot */
|
365
|
+
name: string;
|
366
|
+
/** @description A list of component definition public IDs that are allowed in this named slot */
|
367
|
+
allowedComponents: string[];
|
368
|
+
/**
|
369
|
+
* @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
|
370
|
+
* @default false
|
371
|
+
*/
|
372
|
+
inheritAllowedComponents: boolean;
|
373
|
+
/** @description Minimum valid number of components in this slot */
|
374
|
+
minComponents?: number;
|
375
|
+
/** @description Maximum valid number of components in this slot */
|
376
|
+
maxComponents?: number;
|
377
|
+
};
|
378
|
+
/** @description The definition of a composition's slug settings */
|
379
|
+
ComponentDefinitionSlugSettings: {
|
380
|
+
/**
|
381
|
+
* @description Whether the slug is required
|
382
|
+
* no: slug is optional
|
383
|
+
* yes: slug is required
|
384
|
+
* disabled: slug is disabled and will not be shown in the editor
|
385
|
+
*
|
386
|
+
* @default no
|
387
|
+
* @enum {string}
|
388
|
+
*/
|
389
|
+
required?: "no" | "yes" | "disabled";
|
390
|
+
/**
|
391
|
+
* @description Slug uniqueness configuration.
|
392
|
+
* no = no unique constraint
|
393
|
+
* local = must be unique within this component type
|
394
|
+
* global = must be unique across all component types
|
395
|
+
*
|
396
|
+
* @enum {string}
|
397
|
+
*/
|
398
|
+
unique?: "no" | "local" | "global";
|
399
|
+
/** @description Regular expression slugs must match */
|
400
|
+
regularExpression?: string;
|
401
|
+
/**
|
402
|
+
* @description Custom error message when regular expression validation fails.
|
403
|
+
* Has no effect if `regularExpression` is not set.
|
404
|
+
*/
|
405
|
+
regularExpressionMessage?: string;
|
406
|
+
};
|
407
|
+
/** @description The definition of a component variant */
|
408
|
+
ComponentDefinitionVariant: {
|
409
|
+
id: components$1["schemas"]["PublicIdProperty"];
|
410
|
+
/** @description Friendly name of the variant */
|
411
|
+
name: string;
|
412
|
+
};
|
413
|
+
/** @description Permission set for a component defintion */
|
414
|
+
ComponentDefinitionPermission: {
|
415
|
+
roleId: components$1["schemas"]["PublicIdProperty"];
|
416
|
+
/**
|
417
|
+
* @description Permission type for this permission ComponentDefinition:
|
418
|
+
* read | write | delete
|
419
|
+
*
|
420
|
+
* @enum {string}
|
421
|
+
*/
|
422
|
+
permission: "read" | "write" | "delete";
|
423
|
+
/** @description State of the component that this permission applies to */
|
424
|
+
state: number;
|
425
|
+
};
|
426
|
+
/** @description Defines a component type that can live on a Composition */
|
427
|
+
ComponentDefinition: {
|
428
|
+
id: components$1["schemas"]["PublicIdProperty"];
|
429
|
+
/** @description Friendly name of the component definition */
|
430
|
+
name: string;
|
431
|
+
/**
|
432
|
+
* @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
|
433
|
+
* @default screen
|
434
|
+
*/
|
435
|
+
icon?: string;
|
436
|
+
/**
|
437
|
+
* @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
|
438
|
+
* The parameter type must support being used as a title parameter for this to work.
|
439
|
+
*/
|
440
|
+
titleParameter?: string | null;
|
441
|
+
/**
|
442
|
+
* @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
|
443
|
+
* @default false
|
444
|
+
*/
|
445
|
+
canBeComposition?: boolean;
|
446
|
+
/** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
|
447
|
+
parameters?: components$1["schemas"]["ComponentDefinitionParameter"][];
|
448
|
+
/**
|
449
|
+
* @description if this component uses team permissions or custom permissions
|
450
|
+
* @default true
|
451
|
+
*/
|
452
|
+
useTeamPermissions?: boolean;
|
453
|
+
/** @description Custom role permissions for this component definition */
|
454
|
+
permissions?: components$1["schemas"]["ComponentDefinitionPermission"][];
|
455
|
+
/** @description The named slots for this component; placement areas where arrays of other components can be added. */
|
456
|
+
slots?: components$1["schemas"]["ComponentDefinitionSlot"][];
|
457
|
+
slugSettings?: components$1["schemas"]["ComponentDefinitionSlugSettings"];
|
458
|
+
/** @description Default component instance value */
|
459
|
+
defaults?: components$1["schemas"]["ComponentInstance"] | null;
|
460
|
+
/** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
|
461
|
+
variants?: components$1["schemas"]["ComponentDefinitionVariant"][];
|
462
|
+
/** @description Created date string for this definition (ignored for writes) */
|
463
|
+
created?: string;
|
464
|
+
/** @description Last modified date string for this definition (ignored for writes) */
|
465
|
+
updated?: string;
|
466
|
+
};
|
467
|
+
/** @description Defines an editable parameter on a component. */
|
468
|
+
ComponentParameter: {
|
469
|
+
/** @description The value of the parameter. Any JSON-serializable value is acceptable. */
|
470
|
+
value: unknown;
|
471
|
+
/** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
|
472
|
+
type: string;
|
473
|
+
binding?: components$1["schemas"]["ComponentParameterBinding"];
|
474
|
+
};
|
475
|
+
/**
|
476
|
+
* @deprecated
|
477
|
+
* @description Defines a binding from a resource data value to a component parameter value. Do not use.
|
478
|
+
*/
|
479
|
+
ComponentParameterBinding: {
|
480
|
+
/**
|
481
|
+
* @description A JSON Pointer expression that defines the binding directly to the parameter value, or
|
482
|
+
* a map of JSON Pointers in the target parameter to JSON Pointers in the source resource data.
|
483
|
+
* Used to bind to object-type values.
|
484
|
+
* e.g. { "/prop1/thing": "/res1/things/value" } would set the target parameter's `value` to
|
485
|
+
* {
|
486
|
+
* prop1: {
|
487
|
+
* thing: "value of /res1/things/value resource"
|
488
|
+
* }
|
489
|
+
* }
|
490
|
+
*/
|
491
|
+
pointer: string | {
|
492
|
+
[key: string]: string;
|
493
|
+
};
|
494
|
+
/**
|
495
|
+
* @description The syntax of the binding (currently always 'jptr')
|
496
|
+
* @enum {string}
|
497
|
+
*/
|
498
|
+
syntax: "jptr";
|
499
|
+
};
|
500
|
+
/** @description Defines the shape of a component instance served by the composition API. */
|
501
|
+
ComponentInstance: {
|
502
|
+
/** @description Type of the component instance (public_id of its definition) */
|
503
|
+
type: string;
|
504
|
+
/** @description Component parameter values for the component instance */
|
505
|
+
parameters?: {
|
506
|
+
[key: string]: components$1["schemas"]["ComponentParameter"];
|
507
|
+
};
|
508
|
+
/** @description Public ID of alternate visual appearance for this component, if any selected */
|
509
|
+
variant?: string;
|
510
|
+
/** @description Slots containing any child components */
|
511
|
+
slots?: {
|
512
|
+
[key: string]: components$1["schemas"]["ComponentInstance"][];
|
513
|
+
};
|
514
|
+
/** @description Indicates this component instance should be sourced from a pattern library pattern. */
|
515
|
+
_pattern?: string;
|
516
|
+
/**
|
517
|
+
* @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
|
518
|
+
* CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
|
519
|
+
* NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
|
520
|
+
*
|
521
|
+
* @enum {string}
|
522
|
+
*/
|
523
|
+
_patternError?: "NOTFOUND" | "CYCLIC";
|
524
|
+
};
|
525
|
+
/** @description Defines the shape of the root component in a composition */
|
526
|
+
RootComponentInstance: {
|
527
|
+
/** @description Type of the component instance (public_id of its definition) */
|
528
|
+
type: string;
|
529
|
+
/** @description Component parameter values for the component instance */
|
530
|
+
parameters?: {
|
531
|
+
[key: string]: components$1["schemas"]["ComponentParameter"];
|
532
|
+
};
|
533
|
+
/** @description Public ID of alternate visual appearance for this component, if any selected */
|
534
|
+
variant?: string;
|
535
|
+
/** @description Slots containing any child components */
|
536
|
+
slots?: {
|
537
|
+
[key: string]: components$1["schemas"]["ComponentInstance"][];
|
538
|
+
};
|
539
|
+
/** @description The public UUID of the composition. */
|
540
|
+
_id: string;
|
541
|
+
/** @description Slug pattern of this component. */
|
542
|
+
_slug?: string | null;
|
543
|
+
/** @description Friendly name of this component. */
|
544
|
+
_name: string;
|
545
|
+
};
|
546
|
+
};
|
547
|
+
}
|
548
|
+
|
549
|
+
declare type SharedComponents$1 = components$1['schemas'];
|
550
|
+
declare type Api$1 = paths$1['/api/v1/canvas-definitions'];
|
551
|
+
/** Shape of the GET response from /api/v1/canvas-definitions */
|
552
|
+
declare type ComponentDefinitionGetResponse = Api$1['get']['responses']['200']['content']['application/json'];
|
553
|
+
/** Shape of the PUT request body for /api/v1/canvas-definitions */
|
554
|
+
declare type ComponentDefinitionPutParameters = Api$1['put']['requestBody']['content']['application/json'];
|
555
|
+
/** Shape of the DELETE request body for /api/v1/canvas-definitions */
|
556
|
+
declare type ComponentDefinitionDeleteParameters = Api$1['delete']['requestBody']['content']['application/json'];
|
557
|
+
/** Query parameter options for GET /api/v1/canvas-definitions */
|
558
|
+
declare type ComponentDefinitionGetParameters = Api$1['get']['parameters']['query'];
|
559
|
+
/** @deprecated use ComponentDefinitionGetResponse instead */
|
560
|
+
declare type ComponentDefinitionAPIResponse = ComponentDefinitionGetResponse;
|
561
|
+
/** @deprecated use ComponentDefinitionPutParameters */
|
562
|
+
declare type ComponentDefinitionAPIPutRequest = ComponentDefinitionPutParameters;
|
563
|
+
/** @deprecated use ComponentDefinitionDeleteParameters */
|
564
|
+
declare type ComponentDefinitionAPIDeleteRequest = ComponentDefinitionDeleteParameters;
|
565
|
+
/** @deprecated use ComponentDefinitionGetParameters */
|
566
|
+
declare type ComponentDefinitionListAPIOptions = ComponentDefinitionGetParameters;
|
567
|
+
/** The definition of a component parameter */
|
568
|
+
declare type ComponentDefinitionParameter<TConfig = unknown> = Omit<components$1['schemas']['ComponentDefinitionParameter'], 'typeConfig'> & {
|
569
|
+
typeConfig?: TConfig;
|
570
|
+
};
|
571
|
+
/** The definition of a component visual variant */
|
572
|
+
declare type ComponentDefinitionVariant = SharedComponents$1['ComponentDefinitionVariant'];
|
573
|
+
/** The definition of a composition's slug settings */
|
574
|
+
declare type ComponentDefinitionSlugSettings = SharedComponents$1['ComponentDefinitionSlugSettings'];
|
575
|
+
/** The definition of a named component slot that can contain other components */
|
576
|
+
declare type ComponentDefinitionSlot = SharedComponents$1['ComponentDefinitionSlot'];
|
577
|
+
/** Permission set for a component defintion */
|
578
|
+
declare type ComponentDefinitionPermission = SharedComponents$1['ComponentDefinitionPermission'];
|
579
|
+
/** Defines a component type that can live on a Composition */
|
580
|
+
declare type ComponentDefinition = SharedComponents$1['ComponentDefinition'];
|
581
|
+
/** @deprecated use ComponentDefinition instead */
|
582
|
+
declare type CreatingComponentDefinition = Omit<Partial<ComponentDefinition>, 'created' | 'updated'>;
|
583
|
+
|
584
|
+
/**
|
585
|
+
* This file was auto-generated by openapi-typescript.
|
586
|
+
* Do not make direct changes to the file.
|
587
|
+
*/
|
588
|
+
interface paths {
|
589
|
+
"/api/v1/canvas": {
|
590
|
+
get: {
|
591
|
+
parameters: {
|
592
|
+
query: {
|
593
|
+
/** The project the composition(s) are on. */
|
594
|
+
projectId: string;
|
595
|
+
/** Specify a single composition ID to fetch. Changes response from list to single. */
|
596
|
+
compositionId?: string;
|
597
|
+
/** Specify a single composition to fetch by slug. Changes response from list to single. */
|
598
|
+
slug?: string;
|
599
|
+
/** The component type to filter by */
|
600
|
+
type?: string;
|
601
|
+
/** State of compositions to fetch. 0 = draft, 64 = published. */
|
602
|
+
state?: number;
|
603
|
+
/** Number of records to skip */
|
604
|
+
offset?: number;
|
605
|
+
/** Max number of records to return */
|
606
|
+
limit?: number;
|
607
|
+
/**
|
608
|
+
* Signals an enhancer proxy to skip processing enhancements to the data and return raw data only.
|
609
|
+
* This improves performance if you do not require enhanced component data.
|
610
|
+
* If calling the Canvas API directly with no enhancer proxy, this has no effect.
|
611
|
+
*/
|
612
|
+
skipEnhance?: boolean;
|
613
|
+
/**
|
614
|
+
* If true, any pattern references in the composition will be left unresolved.
|
615
|
+
* This is appropriate if you intend to serialize the composition data without pattern
|
616
|
+
* data embedded into it, and serialize the pattern data separately.
|
617
|
+
*/
|
618
|
+
skipPatternResolution?: boolean;
|
619
|
+
};
|
620
|
+
};
|
621
|
+
responses: {
|
622
|
+
/** OK */
|
623
|
+
200: {
|
624
|
+
content: {
|
625
|
+
"application/json": components["schemas"]["CompositionListResponse"] | components["schemas"]["CompositionApiResponse"];
|
626
|
+
};
|
627
|
+
};
|
628
|
+
400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
|
629
|
+
401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
|
630
|
+
403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
|
631
|
+
/** Composition not found */
|
632
|
+
404: {
|
633
|
+
content: {
|
634
|
+
"text/plain": string;
|
635
|
+
};
|
636
|
+
};
|
637
|
+
429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
|
638
|
+
500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
|
639
|
+
};
|
640
|
+
};
|
641
|
+
/** Upserts a composition */
|
642
|
+
put: {
|
643
|
+
responses: {
|
644
|
+
/** OK */
|
645
|
+
204: never;
|
646
|
+
400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
|
647
|
+
401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
|
648
|
+
403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
|
649
|
+
429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
|
650
|
+
500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
|
651
|
+
};
|
652
|
+
requestBody: {
|
653
|
+
content: {
|
654
|
+
"application/json": {
|
655
|
+
/**
|
656
|
+
* Format: uuid
|
657
|
+
* @description The project ID to upsert the composition to
|
658
|
+
*/
|
659
|
+
projectId: string;
|
660
|
+
/** @description The state of the composition to upsert into. 0 = draft, 64 = published */
|
661
|
+
state: number;
|
662
|
+
composition: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["RootComponentInstance"];
|
663
|
+
/**
|
664
|
+
* @description True if the composition is a pattern (which can be referenced on other compositions)
|
665
|
+
* @default false
|
666
|
+
*/
|
667
|
+
pattern?: boolean;
|
668
|
+
/** @description Ignored if present */
|
669
|
+
created?: string;
|
670
|
+
/** @description Ignored if present */
|
671
|
+
modified?: string;
|
672
|
+
};
|
673
|
+
};
|
674
|
+
};
|
675
|
+
};
|
676
|
+
/** Deletes or unpublishes a composition */
|
677
|
+
delete: {
|
678
|
+
responses: {
|
679
|
+
/** OK */
|
680
|
+
204: never;
|
681
|
+
400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
|
682
|
+
401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
|
683
|
+
403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
|
684
|
+
429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
|
685
|
+
500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
|
686
|
+
};
|
687
|
+
requestBody: {
|
688
|
+
content: {
|
689
|
+
"application/json": {
|
690
|
+
/**
|
691
|
+
* Format: uuid
|
692
|
+
* @description The ID of the composition to delete
|
693
|
+
*/
|
694
|
+
compositionId: string;
|
695
|
+
/**
|
696
|
+
* Format: uuid
|
697
|
+
* @description The ID of the project the composition to delete belongs to
|
698
|
+
*/
|
699
|
+
projectId: string;
|
700
|
+
/** @description The state of the composition to delete (0 = draft, 64 = published [causes unpublishing], unspecified = all) */
|
701
|
+
state?: number;
|
702
|
+
};
|
703
|
+
};
|
704
|
+
};
|
705
|
+
};
|
706
|
+
/** Handles preflight requests. This endpoint allows CORS. */
|
707
|
+
options: {
|
708
|
+
responses: {
|
709
|
+
/** OK */
|
710
|
+
204: never;
|
711
|
+
};
|
712
|
+
};
|
713
|
+
};
|
714
|
+
}
|
715
|
+
interface components {
|
716
|
+
schemas: {
|
717
|
+
CompositionApiResponse: {
|
718
|
+
/** @description State of compositions to fetch. 0 = draft, 64 = published. */
|
719
|
+
state: number;
|
720
|
+
/**
|
721
|
+
* Format: uuid
|
722
|
+
* @description The project ID that this layout data is part of
|
723
|
+
*/
|
724
|
+
projectId: string;
|
725
|
+
/**
|
726
|
+
* Format: date-time,
|
727
|
+
* @description Created date string for this definition
|
728
|
+
*/
|
729
|
+
created: string;
|
730
|
+
/**
|
731
|
+
* Format: date-time,
|
732
|
+
* @description Modified date string for this definition
|
733
|
+
*/
|
734
|
+
modified: string;
|
735
|
+
/** @description Whether this composition is a pattern (can be referenced by other compositions, not treated as a composition) */
|
736
|
+
pattern: boolean;
|
737
|
+
composition: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["RootComponentInstance"];
|
738
|
+
};
|
739
|
+
CompositionListResponse: {
|
740
|
+
compositions: components["schemas"]["CompositionApiResponse"][];
|
741
|
+
};
|
742
|
+
};
|
743
|
+
}
|
744
|
+
interface external {
|
745
|
+
"swagger.yml": {
|
746
|
+
paths: {};
|
747
|
+
components: {
|
748
|
+
schemas: {
|
749
|
+
Error: {
|
750
|
+
/** @description Error message(s) that occurred while processing the request */
|
751
|
+
errorMessage?: string[] | string;
|
752
|
+
};
|
753
|
+
};
|
754
|
+
responses: {
|
755
|
+
/** Request input validation failed */
|
756
|
+
BadRequestError: {
|
757
|
+
content: {
|
758
|
+
"application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
|
759
|
+
};
|
760
|
+
};
|
761
|
+
/** API key or token was not valid */
|
762
|
+
UnauthorizedError: {
|
763
|
+
content: {
|
764
|
+
"application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
|
765
|
+
};
|
766
|
+
};
|
767
|
+
/** Permission was denied */
|
768
|
+
ForbiddenError: {
|
769
|
+
content: {
|
770
|
+
"application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
|
771
|
+
};
|
772
|
+
};
|
773
|
+
/** Too many requests in allowed time period */
|
774
|
+
RateLimitError: unknown;
|
775
|
+
/** Execution error occurred */
|
776
|
+
InternalServerError: unknown;
|
777
|
+
};
|
778
|
+
};
|
779
|
+
operations: {};
|
780
|
+
};
|
781
|
+
"uniform-canvas-types.swagger.yml": {
|
782
|
+
paths: {};
|
783
|
+
components: {
|
784
|
+
schemas: {
|
785
|
+
/** @description Public ID (used in code). Do not change after creation. */
|
786
|
+
PublicIdProperty: string;
|
787
|
+
/** @description The definition of a component parameter */
|
788
|
+
ComponentDefinitionParameter: {
|
789
|
+
id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
790
|
+
/** @description Friendly name of the parameter */
|
791
|
+
name: string;
|
792
|
+
/** @description Appears next to the parameter in the Composition editor */
|
793
|
+
helpText?: string;
|
794
|
+
/** @description Type name of the parameter (provided by a Uniform integration) */
|
795
|
+
type: string;
|
796
|
+
/** @description The configuration object for the type (type-specific) */
|
797
|
+
typeConfig?: unknown;
|
798
|
+
};
|
799
|
+
/** @description The definition of a named component slot that can contain other components */
|
800
|
+
ComponentDefinitionSlot: {
|
801
|
+
id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
802
|
+
/** @description Friendly name of the slot */
|
803
|
+
name: string;
|
804
|
+
/** @description A list of component definition public IDs that are allowed in this named slot */
|
805
|
+
allowedComponents: string[];
|
806
|
+
/**
|
807
|
+
* @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
|
808
|
+
* @default false
|
809
|
+
*/
|
810
|
+
inheritAllowedComponents: boolean;
|
811
|
+
/** @description Minimum valid number of components in this slot */
|
812
|
+
minComponents?: number;
|
813
|
+
/** @description Maximum valid number of components in this slot */
|
814
|
+
maxComponents?: number;
|
815
|
+
};
|
816
|
+
/** @description The definition of a composition's slug settings */
|
817
|
+
ComponentDefinitionSlugSettings: {
|
818
|
+
/**
|
819
|
+
* @description Whether the slug is required
|
820
|
+
* no: slug is optional
|
821
|
+
* yes: slug is required
|
822
|
+
* disabled: slug is disabled and will not be shown in the editor
|
823
|
+
*
|
824
|
+
* @default no
|
825
|
+
* @enum {string}
|
826
|
+
*/
|
827
|
+
required?: "no" | "yes" | "disabled";
|
828
|
+
/**
|
829
|
+
* @description Slug uniqueness configuration.
|
830
|
+
* no = no unique constraint
|
831
|
+
* local = must be unique within this component type
|
832
|
+
* global = must be unique across all component types
|
833
|
+
*
|
834
|
+
* @enum {string}
|
835
|
+
*/
|
836
|
+
unique?: "no" | "local" | "global";
|
837
|
+
/** @description Regular expression slugs must match */
|
838
|
+
regularExpression?: string;
|
839
|
+
/**
|
840
|
+
* @description Custom error message when regular expression validation fails.
|
841
|
+
* Has no effect if `regularExpression` is not set.
|
842
|
+
*/
|
843
|
+
regularExpressionMessage?: string;
|
844
|
+
};
|
845
|
+
/** @description The definition of a component variant */
|
846
|
+
ComponentDefinitionVariant: {
|
847
|
+
id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
848
|
+
/** @description Friendly name of the variant */
|
849
|
+
name: string;
|
850
|
+
};
|
851
|
+
/** @description Permission set for a component defintion */
|
852
|
+
ComponentDefinitionPermission: {
|
853
|
+
roleId: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
854
|
+
/**
|
855
|
+
* @description Permission type for this permission ComponentDefinition:
|
856
|
+
* read | write | delete
|
857
|
+
*
|
858
|
+
* @enum {string}
|
859
|
+
*/
|
860
|
+
permission: "read" | "write" | "delete";
|
861
|
+
/** @description State of the component that this permission applies to */
|
862
|
+
state: number;
|
863
|
+
};
|
864
|
+
/** @description Defines a component type that can live on a Composition */
|
865
|
+
ComponentDefinition: {
|
866
|
+
id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
|
867
|
+
/** @description Friendly name of the component definition */
|
868
|
+
name: string;
|
869
|
+
/**
|
870
|
+
* @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
|
871
|
+
* @default screen
|
872
|
+
*/
|
873
|
+
icon?: string;
|
874
|
+
/**
|
875
|
+
* @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
|
876
|
+
* The parameter type must support being used as a title parameter for this to work.
|
877
|
+
*/
|
878
|
+
titleParameter?: string | null;
|
879
|
+
/**
|
880
|
+
* @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
|
881
|
+
* @default false
|
882
|
+
*/
|
883
|
+
canBeComposition?: boolean;
|
884
|
+
/** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
|
885
|
+
parameters?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
|
886
|
+
/**
|
887
|
+
* @description if this component uses team permissions or custom permissions
|
888
|
+
* @default true
|
889
|
+
*/
|
890
|
+
useTeamPermissions?: boolean;
|
891
|
+
/** @description Custom role permissions for this component definition */
|
892
|
+
permissions?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
|
893
|
+
/** @description The named slots for this component; placement areas where arrays of other components can be added. */
|
894
|
+
slots?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
|
895
|
+
slugSettings?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
|
896
|
+
/** @description Default component instance value */
|
897
|
+
defaults?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
|
898
|
+
/** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
|
899
|
+
variants?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
|
900
|
+
/** @description Created date string for this definition (ignored for writes) */
|
901
|
+
created?: string;
|
902
|
+
/** @description Last modified date string for this definition (ignored for writes) */
|
903
|
+
updated?: string;
|
904
|
+
};
|
905
|
+
/** @description Defines an editable parameter on a component. */
|
906
|
+
ComponentParameter: {
|
907
|
+
/** @description The value of the parameter. Any JSON-serializable value is acceptable. */
|
908
|
+
value: unknown;
|
909
|
+
/** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
|
910
|
+
type: string;
|
911
|
+
binding?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
|
912
|
+
};
|
913
|
+
/**
|
914
|
+
* @deprecated
|
915
|
+
* @description Defines a binding from a resource data value to a component parameter value. Do not use.
|
916
|
+
*/
|
917
|
+
ComponentParameterBinding: {
|
918
|
+
/**
|
919
|
+
* @description A JSON Pointer expression that defines the binding directly to the parameter value, or
|
920
|
+
* a map of JSON Pointers in the target parameter to JSON Pointers in the source resource data.
|
921
|
+
* Used to bind to object-type values.
|
922
|
+
* e.g. { "/prop1/thing": "/res1/things/value" } would set the target parameter's `value` to
|
923
|
+
* {
|
924
|
+
* prop1: {
|
925
|
+
* thing: "value of /res1/things/value resource"
|
926
|
+
* }
|
927
|
+
* }
|
928
|
+
*/
|
929
|
+
pointer: string | {
|
930
|
+
[key: string]: string;
|
931
|
+
};
|
932
|
+
/**
|
933
|
+
* @description The syntax of the binding (currently always 'jptr')
|
934
|
+
* @enum {string}
|
935
|
+
*/
|
936
|
+
syntax: "jptr";
|
937
|
+
};
|
938
|
+
/** @description Defines the shape of a component instance served by the composition API. */
|
939
|
+
ComponentInstance: {
|
940
|
+
/** @description Type of the component instance (public_id of its definition) */
|
941
|
+
type: string;
|
942
|
+
/** @description Component parameter values for the component instance */
|
943
|
+
parameters?: {
|
944
|
+
[key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
|
945
|
+
};
|
946
|
+
/** @description Public ID of alternate visual appearance for this component, if any selected */
|
947
|
+
variant?: string;
|
948
|
+
/** @description Slots containing any child components */
|
949
|
+
slots?: {
|
950
|
+
[key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
|
951
|
+
};
|
952
|
+
/** @description Indicates this component instance should be sourced from a pattern library pattern. */
|
953
|
+
_pattern?: string;
|
954
|
+
/**
|
955
|
+
* @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
|
956
|
+
* CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
|
957
|
+
* NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
|
958
|
+
*
|
959
|
+
* @enum {string}
|
960
|
+
*/
|
961
|
+
_patternError?: "NOTFOUND" | "CYCLIC";
|
962
|
+
};
|
963
|
+
/** @description Defines the shape of the root component in a composition */
|
964
|
+
RootComponentInstance: {
|
965
|
+
/** @description Type of the component instance (public_id of its definition) */
|
966
|
+
type: string;
|
967
|
+
/** @description Component parameter values for the component instance */
|
968
|
+
parameters?: {
|
969
|
+
[key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
|
970
|
+
};
|
971
|
+
/** @description Public ID of alternate visual appearance for this component, if any selected */
|
972
|
+
variant?: string;
|
973
|
+
/** @description Slots containing any child components */
|
974
|
+
slots?: {
|
975
|
+
[key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
|
976
|
+
};
|
977
|
+
/** @description The public UUID of the composition. */
|
978
|
+
_id: string;
|
979
|
+
/** @description Slug pattern of this component. */
|
980
|
+
_slug?: string | null;
|
981
|
+
/** @description Friendly name of this component. */
|
982
|
+
_name: string;
|
983
|
+
};
|
984
|
+
};
|
985
|
+
};
|
986
|
+
operations: {};
|
987
|
+
};
|
988
|
+
}
|
989
|
+
|
990
|
+
declare type Components = components['schemas'];
|
991
|
+
declare type SharedComponents = components$1['schemas'];
|
992
|
+
declare type Api = paths['/api/v1/canvas'];
|
993
|
+
/** Query parameter options for GET /api/v1/canvas */
|
994
|
+
declare type CompositionGetParameters = Api['get']['parameters']['query'];
|
995
|
+
/** The GET response from /api/v1/canvas when `component` or `slug` params are specified */
|
996
|
+
declare type CompositionGetResponse = Components['CompositionApiResponse'];
|
997
|
+
/** The GET response from /api/v1/canvas when `component` or `slug` are not specified */
|
998
|
+
declare type CompositionGetListResponse = Components['CompositionListResponse'];
|
999
|
+
/** The PUT request body for /api/v1/canvas */
|
1000
|
+
declare type CompositionPutParameters = Api['put']['requestBody']['content']['application/json'];
|
1001
|
+
/** Shape of the DELETE request body for /api/v1/canvas */
|
1002
|
+
declare type CompositionDeleteParameters = Api['delete']['requestBody']['content']['application/json'];
|
1003
|
+
/** @deprecated use CompositionGetResponse */
|
1004
|
+
declare type CompositionAPIResponse = CompositionGetResponse;
|
1005
|
+
/** @deprecated use CompositionDeleteParameters */
|
1006
|
+
declare type CompositionAPIDeleteRequest = CompositionDeleteParameters;
|
1007
|
+
/** @deprecated use CompositionGetParameters */
|
1008
|
+
declare type CompositionListAPIResponse = CompositionGetListResponse;
|
1009
|
+
/** @deprecated use CompositionGetParameters */
|
1010
|
+
declare type CompositionAPIOptions = CompositionGetParameters;
|
1011
|
+
/** Defines an editable parameter on a component. */
|
1012
|
+
declare type ComponentParameter<TValue = unknown> = Omit<SharedComponents['ComponentParameter'], 'value'> & {
|
1013
|
+
/** The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
|
1014
|
+
value: TValue;
|
1015
|
+
};
|
1016
|
+
/** Defines a binding from a resource data value to a component parameter value. */
|
1017
|
+
declare type ComponentParameterBinding = SharedComponents['ComponentParameterBinding'];
|
1018
|
+
/** Defines the shape of a component instance served by the composition API. */
|
1019
|
+
declare type ComponentInstance = SharedComponents['ComponentInstance'] & {
|
1020
|
+
/** Data for the component instance, provided by a component enhancer. Never set in unenhanced data. */
|
1021
|
+
data?: Record<string, unknown>;
|
1022
|
+
};
|
1023
|
+
/** Defines the shape of the root component in a composition */
|
1024
|
+
declare type RootComponentInstance = SharedComponents['RootComponentInstance'];
|
1025
|
+
/** Defines single structure to keep all canvas models (used in CLI commands and Starter content generations) */
|
1026
|
+
declare type CanvasDefinitions = {
|
1027
|
+
components?: Array<ComponentDefinition>;
|
1028
|
+
compositions?: Array<CompositionGetResponse>;
|
1029
|
+
};
|
1030
|
+
|
1031
|
+
/**
|
1032
|
+
* Pusher-js is large (80k) and not tree shakable so it is always bundled if directly referenced,
|
1033
|
+
* when it's only needed during preview mode. To avoid bundling it for all, we use an old-school
|
1034
|
+
* write-a-script-tag hack to load it in a poor man's approximation of a dynamic import ;)
|
1035
|
+
*/
|
1036
|
+
declare type ChannelSubscription = {
|
1037
|
+
addEventHandler: (eventName: string, handler: (data: unknown) => void) => () => void;
|
1038
|
+
unsubscribe: () => void;
|
1039
|
+
};
|
1040
|
+
declare type PreviewEventBus = {
|
1041
|
+
subscribe: (channel: string) => ChannelSubscription;
|
1042
|
+
};
|
1043
|
+
declare global {
|
1044
|
+
interface Window {
|
1045
|
+
Pusher?: typeof Pusher;
|
1046
|
+
__UNIFORM_EVENT_BUS__?: PreviewEventBus;
|
1047
|
+
}
|
1048
|
+
}
|
1049
|
+
/**
|
1050
|
+
* Creates an event bus client to receive updates from Canvas
|
1051
|
+
* IMPORTANT: in a server-side context this will always return undefined
|
1052
|
+
* IMPORTANT: in a browser context this is cached in window and does not create multiple instances
|
1053
|
+
*/
|
1054
|
+
declare function createEventBus(): Promise<PreviewEventBus | undefined>;
|
1055
|
+
|
1056
|
+
export { CanvasDefinitions as A, ChannelSubscription as B, ComponentInstance as C, createEventBus as D, PreviewEventBus as P, RootComponentInstance as R, ComponentParameter as a, CompositionGetParameters as b, CompositionPutParameters as c, CompositionDeleteParameters as d, ComponentDefinitionGetParameters as e, ComponentDefinitionPutParameters as f, ComponentDefinitionDeleteParameters as g, ComponentDefinitionGetResponse as h, ComponentDefinitionAPIResponse as i, ComponentDefinitionAPIPutRequest as j, ComponentDefinitionAPIDeleteRequest as k, ComponentDefinitionListAPIOptions as l, ComponentDefinitionParameter as m, ComponentDefinitionVariant as n, ComponentDefinitionSlugSettings as o, ComponentDefinitionSlot as p, ComponentDefinitionPermission as q, ComponentDefinition as r, CreatingComponentDefinition as s, CompositionGetResponse as t, CompositionGetListResponse as u, CompositionAPIResponse as v, CompositionAPIDeleteRequest as w, CompositionListAPIResponse as x, CompositionAPIOptions as y, ComponentParameterBinding as z };
|