@uniformdev/canvas 16.2.4 → 17.1.1-alpha.151

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.
@@ -0,0 +1,1549 @@
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
+ /** Resource not found */
129
+ NotFoundError: {
130
+ content: {
131
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
132
+ };
133
+ };
134
+ /** Too many requests in allowed time period */
135
+ RateLimitError: unknown;
136
+ /** Execution error occurred */
137
+ InternalServerError: unknown;
138
+ };
139
+ };
140
+ operations: {};
141
+ };
142
+ "uniform-canvas-types.swagger.yml": {
143
+ paths: {};
144
+ components: {
145
+ schemas: {
146
+ /** @description Public ID (used in code). Do not change after creation. */
147
+ PublicIdProperty: string;
148
+ /** @description The definition of a component parameter */
149
+ ComponentDefinitionParameter: {
150
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
151
+ /** @description Friendly name of the parameter */
152
+ name: string;
153
+ /** @description Appears next to the parameter in the Composition editor */
154
+ helpText?: string;
155
+ /** @description Type name of the parameter (provided by a Uniform integration) */
156
+ type: string;
157
+ /** @description The configuration object for the type (type-specific) */
158
+ typeConfig?: unknown;
159
+ };
160
+ /** @description The definition of a named component slot that can contain other components */
161
+ ComponentDefinitionSlot: {
162
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
163
+ /** @description Friendly name of the slot */
164
+ name: string;
165
+ /** @description A list of component definition public IDs that are allowed in this named slot */
166
+ allowedComponents: string[];
167
+ /**
168
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
169
+ * @default false
170
+ */
171
+ inheritAllowedComponents: boolean;
172
+ /** @description Minimum valid number of components in this slot */
173
+ minComponents?: number;
174
+ /** @description Maximum valid number of components in this slot */
175
+ maxComponents?: number;
176
+ };
177
+ /** @description The definition of a composition's slug settings */
178
+ ComponentDefinitionSlugSettings: {
179
+ /**
180
+ * @description Whether the slug is required
181
+ * no: slug is optional
182
+ * yes: slug is required
183
+ * disabled: slug is disabled and will not be shown in the editor
184
+ *
185
+ * @default no
186
+ * @enum {string}
187
+ */
188
+ required?: "no" | "yes" | "disabled";
189
+ /**
190
+ * @description Slug uniqueness configuration.
191
+ * no = no unique constraint
192
+ * local = must be unique within this component type
193
+ * global = must be unique across all component types
194
+ *
195
+ * @enum {string}
196
+ */
197
+ unique?: "no" | "local" | "global";
198
+ /** @description Regular expression slugs must match */
199
+ regularExpression?: string;
200
+ /**
201
+ * @description Custom error message when regular expression validation fails.
202
+ * Has no effect if `regularExpression` is not set.
203
+ */
204
+ regularExpressionMessage?: string;
205
+ };
206
+ /** @description The definition of a component variant */
207
+ ComponentDefinitionVariant: {
208
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
209
+ /** @description Friendly name of the variant */
210
+ name: string;
211
+ };
212
+ /** @description Permission set for a component defintion */
213
+ ComponentDefinitionPermission: {
214
+ roleId: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
215
+ /**
216
+ * @description Permission type for this permission ComponentDefinition:
217
+ * read | write | delete
218
+ *
219
+ * @enum {string}
220
+ */
221
+ permission: "read" | "write" | "delete";
222
+ /** @description State of the component that this permission applies to */
223
+ state: number;
224
+ };
225
+ /** @description Defines a component type that can live on a Composition */
226
+ ComponentDefinition: {
227
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
228
+ /** @description Friendly name of the component definition */
229
+ name: string;
230
+ /**
231
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
232
+ * @default screen
233
+ */
234
+ icon?: string;
235
+ /**
236
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
237
+ * The parameter type must support being used as a title parameter for this to work.
238
+ */
239
+ titleParameter?: string | null;
240
+ /**
241
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
242
+ * @default false
243
+ */
244
+ canBeComposition?: boolean;
245
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
246
+ parameters?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
247
+ /**
248
+ * @description if this component uses team permissions or custom permissions
249
+ * @default true
250
+ */
251
+ useTeamPermissions?: boolean;
252
+ /** @description Custom role permissions for this component definition */
253
+ permissions?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
254
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
255
+ slots?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
256
+ slugSettings?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
257
+ /** @description Default component instance value */
258
+ defaults?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
259
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
260
+ variants?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
261
+ /** @description Created date string for this definition (ignored for writes) */
262
+ created?: string;
263
+ /** @description Last modified date string for this definition (ignored for writes) */
264
+ updated?: string;
265
+ };
266
+ /** @description Defines an editable parameter on a component. */
267
+ ComponentParameter: {
268
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
269
+ value: unknown;
270
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
271
+ type: string;
272
+ binding?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
273
+ };
274
+ /**
275
+ * @deprecated
276
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
277
+ */
278
+ ComponentParameterBinding: {
279
+ /** @description A JSON Pointer expression that defines the binding directly to the parameter value */
280
+ pointer: string;
281
+ /**
282
+ * @description The syntax of the binding (currently always 'jptr')
283
+ * @enum {string}
284
+ */
285
+ syntax: "jptr";
286
+ /**
287
+ * @description Whether the binding should cause an error if it cannot be resolved.
288
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
289
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
290
+ *
291
+ * @default false
292
+ */
293
+ required?: boolean;
294
+ };
295
+ /** @description Defines the shape of a component instance served by the composition API. */
296
+ ComponentInstance: {
297
+ /** @description Type of the component instance (public_id of its definition) */
298
+ type: string;
299
+ /** @description Component parameter values for the component instance */
300
+ parameters?: {
301
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
302
+ };
303
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
304
+ variant?: string;
305
+ /** @description Slots containing any child components */
306
+ slots?: {
307
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
308
+ };
309
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
310
+ _id?: string;
311
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
312
+ _pattern?: string;
313
+ _data?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
314
+ /**
315
+ * @deprecated
316
+ * @description Data definitions coming from a pattern resolved for this component. Merged with _data during resolution.
317
+ * Means nothing for PUTs; it will be ignored.
318
+ */
319
+ _patternData?: {
320
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
321
+ };
322
+ /**
323
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
324
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
325
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
326
+ * Means nothing for PUTs; it will be ignored.
327
+ *
328
+ * @enum {string}
329
+ */
330
+ _patternError?: "NOTFOUND" | "CYCLIC";
331
+ };
332
+ /** @description Defines the shape of the root component in a composition */
333
+ RootComponentInstance: {
334
+ /** @description Type of the component instance (public_id of its definition) */
335
+ type: string;
336
+ /** @description Component parameter values for the component instance */
337
+ parameters?: {
338
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
339
+ };
340
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
341
+ variant?: string;
342
+ /** @description Slots containing any child components */
343
+ slots?: {
344
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
345
+ };
346
+ /** @description The public UUID of the composition. */
347
+ _id: string;
348
+ /** @description Slug pattern of this component. */
349
+ _slug?: string | null;
350
+ /** @description Friendly name of this component. */
351
+ _name: string;
352
+ _data?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
353
+ };
354
+ /**
355
+ * @deprecated
356
+ * @description Basic information about an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). This data is provided to list responses.
357
+ */
358
+ DataConnectionInfo: {
359
+ /** @description Public ID of the data connector */
360
+ id: string;
361
+ /** @description Display name of the data connector */
362
+ displayName: string;
363
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
364
+ connectorType: string;
365
+ /** @description Base resource URL of the data connector. No trailing slash. */
366
+ baseUrl?: string;
367
+ };
368
+ /**
369
+ * @deprecated
370
+ * @description An instance of an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). These are created in the UI and shared across a whole project.
371
+ */
372
+ DataConnection: {
373
+ /** @description Public ID of the data connector */
374
+ id: string;
375
+ /** @description Display name of the data connector */
376
+ displayName: string;
377
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
378
+ connectorType: string;
379
+ /** @description Base resource URL of the data connector. No trailing slash. */
380
+ baseUrl: string;
381
+ /** @description HTTP headers to pass with requests to the data connector */
382
+ headers?: {
383
+ [key: string]: string;
384
+ };
385
+ /** @description Query String parameters to pass with requests to the data connector */
386
+ parameters?: {
387
+ [key: string]: string;
388
+ };
389
+ /** @description Variables needed to make calls to the data connector */
390
+ variables?: {
391
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
392
+ };
393
+ /** @description Custom configuration specific to the data connection being defined */
394
+ custom?: {
395
+ [key: string]: unknown;
396
+ };
397
+ };
398
+ /**
399
+ * @deprecated
400
+ * @description A specific type of data that a Data Connection can provide (i.e. "Recipe", "Recipes List by Tag", "Yelp Reviews of My Restaurant"). These are created in the UI and shared a whole project.
401
+ */
402
+ DataType: {
403
+ /** @description Public ID of the data connector */
404
+ id: string;
405
+ /** @description Display name of the data connector */
406
+ displayName: string;
407
+ /** @description Public ID of the associated data connector */
408
+ connectionId: string;
409
+ /**
410
+ * @description A connector-specific archetype for this data type; used to select UI as well as perform any
411
+ * necessary post-processing on the response. e.g. 'cms-entry', 'cms-query'. Can be undefined if
412
+ * no special UI or processing is required.
413
+ */
414
+ archetype?: string;
415
+ /** @description Resource path, appended to the data connection's baseUrl (e.g. baseUrl = https://base.url, path = /v1/endpoint -> final URL https://base.url/v1/endpoint). Must have leading slash. */
416
+ path: string;
417
+ /** @description HTTP headers to pass with requests to the data connector */
418
+ headers?: {
419
+ [key: string]: string;
420
+ };
421
+ /** @description Query String parameters to pass with requests to the data connector */
422
+ parameters?: {
423
+ [key: string]: string;
424
+ };
425
+ /** @description Body to pass with requests to the data connector */
426
+ body?: string;
427
+ /**
428
+ * @description HTTP method to use with requests to the data connector.
429
+ * @default GET
430
+ * @enum {string}
431
+ */
432
+ method: "GET" | "POST" | "HEAD";
433
+ /** @description Variables needed to make calls to the data connector */
434
+ variables?: {
435
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
436
+ };
437
+ /** @description Custom configuration specific to the data connection being defined */
438
+ custom?: {
439
+ [key: string]: unknown;
440
+ };
441
+ };
442
+ /**
443
+ * @deprecated
444
+ * @description Defines the shape of a data variable on a Data Connector or Data Type
445
+ */
446
+ DataVariable: {
447
+ /** @description Display name of the data variable */
448
+ displayName?: string;
449
+ /**
450
+ * @description Type of the data variable
451
+ * @default text
452
+ */
453
+ type: string;
454
+ /** @description Default value of the data variable */
455
+ default: string;
456
+ /**
457
+ * @description Where the variable value is set. Static = set to static value by the author. Dynamic = set to a dynamic value by a runtime API request from the frontend (default is used in the editor).
458
+ * @enum {string}
459
+ */
460
+ setBy: "static" | "dynamic";
461
+ };
462
+ /**
463
+ * @deprecated
464
+ * @description Data definitions attached to this component. The property name is the key of the data in the data document.
465
+ * Note: data definitions are inherited from ancestors at runtime (and may be overridden by descendants that use the same key).
466
+ */
467
+ CompositionDataDefinitions: {
468
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
469
+ };
470
+ /**
471
+ * @deprecated
472
+ * @description Data definition attached to this component
473
+ */
474
+ CompositionDataDefinition: {
475
+ /** @description Public ID of the data type that provides this data */
476
+ type: string;
477
+ /** @description Whether this data is a pattern parameter that has to be overridden when a pattern is referenced on another composition. If this is not a pattern composition, this has no meaning and should not be used. If unspecified, the default is false. */
478
+ isPatternParameter?: boolean;
479
+ variables?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataVariables"];
480
+ };
481
+ /**
482
+ * @deprecated
483
+ * @description Static variable values for this composition.
484
+ */
485
+ CompositionDataVariables: {
486
+ [key: string]: string;
487
+ };
488
+ };
489
+ };
490
+ operations: {};
491
+ };
492
+ }
493
+
494
+ interface components$1 {
495
+ schemas: {
496
+ /** @description Public ID (used in code). Do not change after creation. */
497
+ PublicIdProperty: string;
498
+ /** @description The definition of a component parameter */
499
+ ComponentDefinitionParameter: {
500
+ id: components$1["schemas"]["PublicIdProperty"];
501
+ /** @description Friendly name of the parameter */
502
+ name: string;
503
+ /** @description Appears next to the parameter in the Composition editor */
504
+ helpText?: string;
505
+ /** @description Type name of the parameter (provided by a Uniform integration) */
506
+ type: string;
507
+ /** @description The configuration object for the type (type-specific) */
508
+ typeConfig?: unknown;
509
+ };
510
+ /** @description The definition of a named component slot that can contain other components */
511
+ ComponentDefinitionSlot: {
512
+ id: components$1["schemas"]["PublicIdProperty"];
513
+ /** @description Friendly name of the slot */
514
+ name: string;
515
+ /** @description A list of component definition public IDs that are allowed in this named slot */
516
+ allowedComponents: string[];
517
+ /**
518
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
519
+ * @default false
520
+ */
521
+ inheritAllowedComponents: boolean;
522
+ /** @description Minimum valid number of components in this slot */
523
+ minComponents?: number;
524
+ /** @description Maximum valid number of components in this slot */
525
+ maxComponents?: number;
526
+ };
527
+ /** @description The definition of a composition's slug settings */
528
+ ComponentDefinitionSlugSettings: {
529
+ /**
530
+ * @description Whether the slug is required
531
+ * no: slug is optional
532
+ * yes: slug is required
533
+ * disabled: slug is disabled and will not be shown in the editor
534
+ *
535
+ * @default no
536
+ * @enum {string}
537
+ */
538
+ required?: "no" | "yes" | "disabled";
539
+ /**
540
+ * @description Slug uniqueness configuration.
541
+ * no = no unique constraint
542
+ * local = must be unique within this component type
543
+ * global = must be unique across all component types
544
+ *
545
+ * @enum {string}
546
+ */
547
+ unique?: "no" | "local" | "global";
548
+ /** @description Regular expression slugs must match */
549
+ regularExpression?: string;
550
+ /**
551
+ * @description Custom error message when regular expression validation fails.
552
+ * Has no effect if `regularExpression` is not set.
553
+ */
554
+ regularExpressionMessage?: string;
555
+ };
556
+ /** @description The definition of a component variant */
557
+ ComponentDefinitionVariant: {
558
+ id: components$1["schemas"]["PublicIdProperty"];
559
+ /** @description Friendly name of the variant */
560
+ name: string;
561
+ };
562
+ /** @description Permission set for a component defintion */
563
+ ComponentDefinitionPermission: {
564
+ roleId: components$1["schemas"]["PublicIdProperty"];
565
+ /**
566
+ * @description Permission type for this permission ComponentDefinition:
567
+ * read | write | delete
568
+ *
569
+ * @enum {string}
570
+ */
571
+ permission: "read" | "write" | "delete";
572
+ /** @description State of the component that this permission applies to */
573
+ state: number;
574
+ };
575
+ /** @description Defines a component type that can live on a Composition */
576
+ ComponentDefinition: {
577
+ id: components$1["schemas"]["PublicIdProperty"];
578
+ /** @description Friendly name of the component definition */
579
+ name: string;
580
+ /**
581
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
582
+ * @default screen
583
+ */
584
+ icon?: string;
585
+ /**
586
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
587
+ * The parameter type must support being used as a title parameter for this to work.
588
+ */
589
+ titleParameter?: string | null;
590
+ /**
591
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
592
+ * @default false
593
+ */
594
+ canBeComposition?: boolean;
595
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
596
+ parameters?: components$1["schemas"]["ComponentDefinitionParameter"][];
597
+ /**
598
+ * @description if this component uses team permissions or custom permissions
599
+ * @default true
600
+ */
601
+ useTeamPermissions?: boolean;
602
+ /** @description Custom role permissions for this component definition */
603
+ permissions?: components$1["schemas"]["ComponentDefinitionPermission"][];
604
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
605
+ slots?: components$1["schemas"]["ComponentDefinitionSlot"][];
606
+ slugSettings?: components$1["schemas"]["ComponentDefinitionSlugSettings"];
607
+ /** @description Default component instance value */
608
+ defaults?: components$1["schemas"]["ComponentInstance"] | null;
609
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
610
+ variants?: components$1["schemas"]["ComponentDefinitionVariant"][];
611
+ /** @description Created date string for this definition (ignored for writes) */
612
+ created?: string;
613
+ /** @description Last modified date string for this definition (ignored for writes) */
614
+ updated?: string;
615
+ };
616
+ /** @description Defines an editable parameter on a component. */
617
+ ComponentParameter: {
618
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
619
+ value: unknown;
620
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
621
+ type: string;
622
+ binding?: components$1["schemas"]["ComponentParameterBinding"];
623
+ };
624
+ /**
625
+ * @deprecated
626
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
627
+ */
628
+ ComponentParameterBinding: {
629
+ /** @description A JSON Pointer expression that defines the binding directly to the parameter value */
630
+ pointer: string;
631
+ /**
632
+ * @description The syntax of the binding (currently always 'jptr')
633
+ * @enum {string}
634
+ */
635
+ syntax: "jptr";
636
+ /**
637
+ * @description Whether the binding should cause an error if it cannot be resolved.
638
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
639
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
640
+ *
641
+ * @default false
642
+ */
643
+ required?: boolean;
644
+ };
645
+ /** @description Defines the shape of a component instance served by the composition API. */
646
+ ComponentInstance: {
647
+ /** @description Type of the component instance (public_id of its definition) */
648
+ type: string;
649
+ /** @description Component parameter values for the component instance */
650
+ parameters?: {
651
+ [key: string]: components$1["schemas"]["ComponentParameter"];
652
+ };
653
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
654
+ variant?: string;
655
+ /** @description Slots containing any child components */
656
+ slots?: {
657
+ [key: string]: components$1["schemas"]["ComponentInstance"][];
658
+ };
659
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
660
+ _id?: string;
661
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
662
+ _pattern?: string;
663
+ _data?: components$1["schemas"]["CompositionDataDefinitions"];
664
+ /**
665
+ * @deprecated
666
+ * @description Data definitions coming from a pattern resolved for this component. Merged with _data during resolution.
667
+ * Means nothing for PUTs; it will be ignored.
668
+ */
669
+ _patternData?: {
670
+ [key: string]: components$1["schemas"]["CompositionDataDefinition"];
671
+ };
672
+ /**
673
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
674
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
675
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
676
+ * Means nothing for PUTs; it will be ignored.
677
+ *
678
+ * @enum {string}
679
+ */
680
+ _patternError?: "NOTFOUND" | "CYCLIC";
681
+ };
682
+ /** @description Defines the shape of the root component in a composition */
683
+ RootComponentInstance: {
684
+ /** @description Type of the component instance (public_id of its definition) */
685
+ type: string;
686
+ /** @description Component parameter values for the component instance */
687
+ parameters?: {
688
+ [key: string]: components$1["schemas"]["ComponentParameter"];
689
+ };
690
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
691
+ variant?: string;
692
+ /** @description Slots containing any child components */
693
+ slots?: {
694
+ [key: string]: components$1["schemas"]["ComponentInstance"][];
695
+ };
696
+ /** @description The public UUID of the composition. */
697
+ _id: string;
698
+ /** @description Slug pattern of this component. */
699
+ _slug?: string | null;
700
+ /** @description Friendly name of this component. */
701
+ _name: string;
702
+ _data?: components$1["schemas"]["CompositionDataDefinitions"];
703
+ };
704
+ /**
705
+ * @deprecated
706
+ * @description Basic information about an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). This data is provided to list responses.
707
+ */
708
+ DataConnectionInfo: {
709
+ /** @description Public ID of the data connector */
710
+ id: string;
711
+ /** @description Display name of the data connector */
712
+ displayName: string;
713
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
714
+ connectorType: string;
715
+ /** @description Base resource URL of the data connector. No trailing slash. */
716
+ baseUrl?: string;
717
+ };
718
+ /**
719
+ * @deprecated
720
+ * @description An instance of an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). These are created in the UI and shared across a whole project.
721
+ */
722
+ DataConnection: {
723
+ /** @description Public ID of the data connector */
724
+ id: string;
725
+ /** @description Display name of the data connector */
726
+ displayName: string;
727
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
728
+ connectorType: string;
729
+ /** @description Base resource URL of the data connector. No trailing slash. */
730
+ baseUrl: string;
731
+ /** @description HTTP headers to pass with requests to the data connector */
732
+ headers?: {
733
+ [key: string]: string;
734
+ };
735
+ /** @description Query String parameters to pass with requests to the data connector */
736
+ parameters?: {
737
+ [key: string]: string;
738
+ };
739
+ /** @description Variables needed to make calls to the data connector */
740
+ variables?: {
741
+ [key: string]: components$1["schemas"]["DataVariable"];
742
+ };
743
+ /** @description Custom configuration specific to the data connection being defined */
744
+ custom?: {
745
+ [key: string]: unknown;
746
+ };
747
+ };
748
+ /**
749
+ * @deprecated
750
+ * @description A specific type of data that a Data Connection can provide (i.e. "Recipe", "Recipes List by Tag", "Yelp Reviews of My Restaurant"). These are created in the UI and shared a whole project.
751
+ */
752
+ DataType: {
753
+ /** @description Public ID of the data connector */
754
+ id: string;
755
+ /** @description Display name of the data connector */
756
+ displayName: string;
757
+ /** @description Public ID of the associated data connector */
758
+ connectionId: string;
759
+ /**
760
+ * @description A connector-specific archetype for this data type; used to select UI as well as perform any
761
+ * necessary post-processing on the response. e.g. 'cms-entry', 'cms-query'. Can be undefined if
762
+ * no special UI or processing is required.
763
+ */
764
+ archetype?: string;
765
+ /** @description Resource path, appended to the data connection's baseUrl (e.g. baseUrl = https://base.url, path = /v1/endpoint -> final URL https://base.url/v1/endpoint). Must have leading slash. */
766
+ path: string;
767
+ /** @description HTTP headers to pass with requests to the data connector */
768
+ headers?: {
769
+ [key: string]: string;
770
+ };
771
+ /** @description Query String parameters to pass with requests to the data connector */
772
+ parameters?: {
773
+ [key: string]: string;
774
+ };
775
+ /** @description Body to pass with requests to the data connector */
776
+ body?: string;
777
+ /**
778
+ * @description HTTP method to use with requests to the data connector.
779
+ * @default GET
780
+ * @enum {string}
781
+ */
782
+ method: "GET" | "POST" | "HEAD";
783
+ /** @description Variables needed to make calls to the data connector */
784
+ variables?: {
785
+ [key: string]: components$1["schemas"]["DataVariable"];
786
+ };
787
+ /** @description Custom configuration specific to the data connection being defined */
788
+ custom?: {
789
+ [key: string]: unknown;
790
+ };
791
+ };
792
+ /**
793
+ * @deprecated
794
+ * @description Defines the shape of a data variable on a Data Connector or Data Type
795
+ */
796
+ DataVariable: {
797
+ /** @description Display name of the data variable */
798
+ displayName?: string;
799
+ /**
800
+ * @description Type of the data variable
801
+ * @default text
802
+ */
803
+ type: string;
804
+ /** @description Default value of the data variable */
805
+ default: string;
806
+ /**
807
+ * @description Where the variable value is set. Static = set to static value by the author. Dynamic = set to a dynamic value by a runtime API request from the frontend (default is used in the editor).
808
+ * @enum {string}
809
+ */
810
+ setBy: "static" | "dynamic";
811
+ };
812
+ /**
813
+ * @deprecated
814
+ * @description Data definitions attached to this component. The property name is the key of the data in the data document.
815
+ * Note: data definitions are inherited from ancestors at runtime (and may be overridden by descendants that use the same key).
816
+ */
817
+ CompositionDataDefinitions: {
818
+ [key: string]: components$1["schemas"]["CompositionDataDefinition"];
819
+ };
820
+ /**
821
+ * @deprecated
822
+ * @description Data definition attached to this component
823
+ */
824
+ CompositionDataDefinition: {
825
+ /** @description Public ID of the data type that provides this data */
826
+ type: string;
827
+ /** @description Whether this data is a pattern parameter that has to be overridden when a pattern is referenced on another composition. If this is not a pattern composition, this has no meaning and should not be used. If unspecified, the default is false. */
828
+ isPatternParameter?: boolean;
829
+ variables?: components$1["schemas"]["CompositionDataVariables"];
830
+ };
831
+ /**
832
+ * @deprecated
833
+ * @description Static variable values for this composition.
834
+ */
835
+ CompositionDataVariables: {
836
+ [key: string]: string;
837
+ };
838
+ };
839
+ }
840
+
841
+ declare type SharedComponents$1 = components$1['schemas'];
842
+ declare type Api$1 = paths$1['/api/v1/canvas-definitions'];
843
+ /** Shape of the GET response from /api/v1/canvas-definitions */
844
+ declare type ComponentDefinitionGetResponse = Api$1['get']['responses']['200']['content']['application/json'];
845
+ /** Shape of the PUT request body for /api/v1/canvas-definitions */
846
+ declare type ComponentDefinitionPutParameters = Api$1['put']['requestBody']['content']['application/json'];
847
+ /** Shape of the DELETE request body for /api/v1/canvas-definitions */
848
+ declare type ComponentDefinitionDeleteParameters = Api$1['delete']['requestBody']['content']['application/json'];
849
+ /** Query parameter options for GET /api/v1/canvas-definitions */
850
+ declare type ComponentDefinitionGetParameters = Api$1['get']['parameters']['query'];
851
+ /** @deprecated use ComponentDefinitionGetResponse instead */
852
+ declare type ComponentDefinitionAPIResponse = ComponentDefinitionGetResponse;
853
+ /** @deprecated use ComponentDefinitionPutParameters */
854
+ declare type ComponentDefinitionAPIPutRequest = ComponentDefinitionPutParameters;
855
+ /** @deprecated use ComponentDefinitionDeleteParameters */
856
+ declare type ComponentDefinitionAPIDeleteRequest = ComponentDefinitionDeleteParameters;
857
+ /** @deprecated use ComponentDefinitionGetParameters */
858
+ declare type ComponentDefinitionListAPIOptions = ComponentDefinitionGetParameters;
859
+ /** The definition of a component parameter */
860
+ declare type ComponentDefinitionParameter<TConfig = unknown> = Omit<components$1['schemas']['ComponentDefinitionParameter'], 'typeConfig'> & {
861
+ typeConfig?: TConfig;
862
+ };
863
+ /** The definition of a component visual variant */
864
+ declare type ComponentDefinitionVariant = SharedComponents$1['ComponentDefinitionVariant'];
865
+ /** The definition of a composition's slug settings */
866
+ declare type ComponentDefinitionSlugSettings = SharedComponents$1['ComponentDefinitionSlugSettings'];
867
+ /** The definition of a named component slot that can contain other components */
868
+ declare type ComponentDefinitionSlot = SharedComponents$1['ComponentDefinitionSlot'];
869
+ /** Permission set for a component defintion */
870
+ declare type ComponentDefinitionPermission = SharedComponents$1['ComponentDefinitionPermission'];
871
+ /** Defines a component type that can live on a Composition */
872
+ declare type ComponentDefinition = SharedComponents$1['ComponentDefinition'];
873
+ /** @deprecated use ComponentDefinition instead */
874
+ declare type CreatingComponentDefinition = Omit<Partial<ComponentDefinition>, 'created' | 'updated'>;
875
+
876
+ /**
877
+ * This file was auto-generated by openapi-typescript.
878
+ * Do not make direct changes to the file.
879
+ */
880
+ interface paths {
881
+ "/api/v1/canvas": {
882
+ get: {
883
+ parameters: {
884
+ query: {
885
+ /** The project the composition(s) are on. */
886
+ projectId: string;
887
+ /** Specify a single composition ID to fetch. Changes response from list to single. */
888
+ compositionId?: string;
889
+ /** Specify multiple composition IDs to fetch. Response type will be a list. */
890
+ compositionIDs?: string[];
891
+ /** Specify a single composition to fetch by slug. Changes response from list to single. */
892
+ slug?: string;
893
+ /** The component type (by public ID) to filter by. Note that this filters the root composition type only; components in slots are not matched by this filter. */
894
+ type?: string[];
895
+ /** State of compositions to fetch. 0 = draft, 64 = published. */
896
+ state?: number;
897
+ /** Number of records to skip */
898
+ offset?: number;
899
+ /** Max number of records to return */
900
+ limit?: number;
901
+ /**
902
+ * @deprecated Signals an enhancer proxy to skip processing enhancements to the data and return raw data only.
903
+ * This improves performance if you do not require enhanced component data.
904
+ * If calling the Canvas API directly with no enhancer proxy, this has no effect.
905
+ */
906
+ skipEnhance?: boolean;
907
+ /**
908
+ * If true, any pattern references in the composition will be left unresolved.
909
+ * This is appropriate if you intend to serialize the composition data without pattern
910
+ * data embedded into it, and serialize the pattern data separately.
911
+ */
912
+ skipPatternResolution?: boolean;
913
+ /**
914
+ * If true the `_id` unique identifier of each non-root component will be part of the response data.
915
+ * If false, the `_id` will not be present in the API response.
916
+ */
917
+ withComponentIDs?: boolean;
918
+ /**
919
+ * Matches compositions where their name, slug, or definition name contains the specified keyword.
920
+ * NOT a full text search; does not match composition contents.
921
+ */
922
+ keyword?: string;
923
+ /**
924
+ * Matches compositions based on whether they are a pattern composition or a regular composition.
925
+ * If true, only pattern compositions will be returned.
926
+ * If false, only regular compositions will be returned.
927
+ * If omitted, both pattern and regular compositions will be returned.
928
+ */
929
+ pattern?: boolean;
930
+ /** Sets the sorting of the results. If unspecified, results are sorted by name ascending. */
931
+ orderBy?: ("updated_at_DESC" | "updated_at_ASC" | "created_at_DESC" | "created_at_ASC" | "name_DESC" | "name_ASC" | "slug_DESC" | "slug_ASC")[];
932
+ /**
933
+ * @deprecated Returns the UI status string of the composition.
934
+ * This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
935
+ */
936
+ withUIStatus?: boolean;
937
+ /**
938
+ * @deprecated Filters composition lists by the UI status of the composition.
939
+ * This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
940
+ */
941
+ uiStatus?: ("Draft" | "Modified" | "Published" | "Orphan")[];
942
+ /** Filters composition lists by the user who created them. The user is specified by their identity subject. */
943
+ createdBy?: string;
944
+ /** Filters composition lists by the user who last updated them. The user is specified by their identity subject. */
945
+ updatedBy?: string;
946
+ };
947
+ };
948
+ responses: {
949
+ /** OK */
950
+ 200: {
951
+ content: {
952
+ "application/json": components["schemas"]["CompositionListResponse"] | components["schemas"]["CompositionApiResponse"];
953
+ };
954
+ };
955
+ 400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
956
+ 401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
957
+ 403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
958
+ /** Composition not found */
959
+ 404: {
960
+ content: {
961
+ "text/plain": string;
962
+ };
963
+ };
964
+ 429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
965
+ 500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
966
+ };
967
+ };
968
+ /** Upserts a composition */
969
+ put: {
970
+ responses: {
971
+ /** OK */
972
+ 204: never;
973
+ 400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
974
+ 401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
975
+ 403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
976
+ 429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
977
+ 500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
978
+ };
979
+ requestBody: {
980
+ content: {
981
+ "application/json": {
982
+ /**
983
+ * Format: uuid
984
+ * @description The project ID to upsert the composition to
985
+ */
986
+ projectId: string;
987
+ /** @description The state of the composition to upsert into. 0 = draft, 64 = published */
988
+ state: number;
989
+ composition: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["RootComponentInstance"];
990
+ /**
991
+ * @description True if the composition is a pattern (which can be referenced on other compositions)
992
+ * @default false
993
+ */
994
+ pattern?: boolean;
995
+ /** @description Ignored if present */
996
+ created?: string;
997
+ /** @description Ignored if present */
998
+ modified?: string;
999
+ };
1000
+ };
1001
+ };
1002
+ };
1003
+ /** Deletes or unpublishes a composition */
1004
+ delete: {
1005
+ responses: {
1006
+ /** OK */
1007
+ 204: never;
1008
+ 400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
1009
+ 401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
1010
+ 403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
1011
+ 429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
1012
+ 500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
1013
+ };
1014
+ requestBody: {
1015
+ content: {
1016
+ "application/json": {
1017
+ /**
1018
+ * Format: uuid
1019
+ * @description The ID of the composition to delete
1020
+ */
1021
+ compositionId: string;
1022
+ /**
1023
+ * Format: uuid
1024
+ * @description The ID of the project the composition to delete belongs to
1025
+ */
1026
+ projectId: string;
1027
+ /** @description The state of the composition to delete (0 = draft, 64 = published [causes unpublishing], unspecified = all) */
1028
+ state?: number;
1029
+ };
1030
+ };
1031
+ };
1032
+ };
1033
+ /** Handles preflight requests. This endpoint allows CORS. */
1034
+ options: {
1035
+ responses: {
1036
+ /** OK */
1037
+ 204: never;
1038
+ };
1039
+ };
1040
+ };
1041
+ }
1042
+ interface components {
1043
+ schemas: {
1044
+ CompositionApiResponse: {
1045
+ /** @description State of compositions to fetch. 0 = draft, 64 = published. */
1046
+ state: number;
1047
+ /**
1048
+ * @deprecated
1049
+ * @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withUIStatus` option is true.
1050
+ * @enum {string}
1051
+ */
1052
+ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan";
1053
+ /**
1054
+ * Format: uuid
1055
+ * @description The project ID that this layout data is part of
1056
+ */
1057
+ projectId: string;
1058
+ /**
1059
+ * Format: date-time,
1060
+ * @description Created date string for this definition
1061
+ */
1062
+ created: string;
1063
+ /**
1064
+ * Format: date-time,
1065
+ * @description Modified date string for this definition
1066
+ */
1067
+ modified: string;
1068
+ /** @description Whether this composition is a pattern (can be referenced by other compositions, not treated as a composition) */
1069
+ pattern: boolean;
1070
+ composition: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["RootComponentInstance"];
1071
+ };
1072
+ CompositionListResponse: {
1073
+ compositions: components["schemas"]["CompositionApiResponse"][];
1074
+ };
1075
+ };
1076
+ }
1077
+ interface external {
1078
+ "swagger.yml": {
1079
+ paths: {};
1080
+ components: {
1081
+ schemas: {
1082
+ Error: {
1083
+ /** @description Error message(s) that occurred while processing the request */
1084
+ errorMessage?: string[] | string;
1085
+ };
1086
+ };
1087
+ responses: {
1088
+ /** Request input validation failed */
1089
+ BadRequestError: {
1090
+ content: {
1091
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1092
+ };
1093
+ };
1094
+ /** API key or token was not valid */
1095
+ UnauthorizedError: {
1096
+ content: {
1097
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1098
+ };
1099
+ };
1100
+ /** Permission was denied */
1101
+ ForbiddenError: {
1102
+ content: {
1103
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1104
+ };
1105
+ };
1106
+ /** Resource not found */
1107
+ NotFoundError: {
1108
+ content: {
1109
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1110
+ };
1111
+ };
1112
+ /** Too many requests in allowed time period */
1113
+ RateLimitError: unknown;
1114
+ /** Execution error occurred */
1115
+ InternalServerError: unknown;
1116
+ };
1117
+ };
1118
+ operations: {};
1119
+ };
1120
+ "uniform-canvas-types.swagger.yml": {
1121
+ paths: {};
1122
+ components: {
1123
+ schemas: {
1124
+ /** @description Public ID (used in code). Do not change after creation. */
1125
+ PublicIdProperty: string;
1126
+ /** @description The definition of a component parameter */
1127
+ ComponentDefinitionParameter: {
1128
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1129
+ /** @description Friendly name of the parameter */
1130
+ name: string;
1131
+ /** @description Appears next to the parameter in the Composition editor */
1132
+ helpText?: string;
1133
+ /** @description Type name of the parameter (provided by a Uniform integration) */
1134
+ type: string;
1135
+ /** @description The configuration object for the type (type-specific) */
1136
+ typeConfig?: unknown;
1137
+ };
1138
+ /** @description The definition of a named component slot that can contain other components */
1139
+ ComponentDefinitionSlot: {
1140
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1141
+ /** @description Friendly name of the slot */
1142
+ name: string;
1143
+ /** @description A list of component definition public IDs that are allowed in this named slot */
1144
+ allowedComponents: string[];
1145
+ /**
1146
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
1147
+ * @default false
1148
+ */
1149
+ inheritAllowedComponents: boolean;
1150
+ /** @description Minimum valid number of components in this slot */
1151
+ minComponents?: number;
1152
+ /** @description Maximum valid number of components in this slot */
1153
+ maxComponents?: number;
1154
+ };
1155
+ /** @description The definition of a composition's slug settings */
1156
+ ComponentDefinitionSlugSettings: {
1157
+ /**
1158
+ * @description Whether the slug is required
1159
+ * no: slug is optional
1160
+ * yes: slug is required
1161
+ * disabled: slug is disabled and will not be shown in the editor
1162
+ *
1163
+ * @default no
1164
+ * @enum {string}
1165
+ */
1166
+ required?: "no" | "yes" | "disabled";
1167
+ /**
1168
+ * @description Slug uniqueness configuration.
1169
+ * no = no unique constraint
1170
+ * local = must be unique within this component type
1171
+ * global = must be unique across all component types
1172
+ *
1173
+ * @enum {string}
1174
+ */
1175
+ unique?: "no" | "local" | "global";
1176
+ /** @description Regular expression slugs must match */
1177
+ regularExpression?: string;
1178
+ /**
1179
+ * @description Custom error message when regular expression validation fails.
1180
+ * Has no effect if `regularExpression` is not set.
1181
+ */
1182
+ regularExpressionMessage?: string;
1183
+ };
1184
+ /** @description The definition of a component variant */
1185
+ ComponentDefinitionVariant: {
1186
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1187
+ /** @description Friendly name of the variant */
1188
+ name: string;
1189
+ };
1190
+ /** @description Permission set for a component defintion */
1191
+ ComponentDefinitionPermission: {
1192
+ roleId: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1193
+ /**
1194
+ * @description Permission type for this permission ComponentDefinition:
1195
+ * read | write | delete
1196
+ *
1197
+ * @enum {string}
1198
+ */
1199
+ permission: "read" | "write" | "delete";
1200
+ /** @description State of the component that this permission applies to */
1201
+ state: number;
1202
+ };
1203
+ /** @description Defines a component type that can live on a Composition */
1204
+ ComponentDefinition: {
1205
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1206
+ /** @description Friendly name of the component definition */
1207
+ name: string;
1208
+ /**
1209
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
1210
+ * @default screen
1211
+ */
1212
+ icon?: string;
1213
+ /**
1214
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
1215
+ * The parameter type must support being used as a title parameter for this to work.
1216
+ */
1217
+ titleParameter?: string | null;
1218
+ /**
1219
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
1220
+ * @default false
1221
+ */
1222
+ canBeComposition?: boolean;
1223
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
1224
+ parameters?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
1225
+ /**
1226
+ * @description if this component uses team permissions or custom permissions
1227
+ * @default true
1228
+ */
1229
+ useTeamPermissions?: boolean;
1230
+ /** @description Custom role permissions for this component definition */
1231
+ permissions?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
1232
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
1233
+ slots?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
1234
+ slugSettings?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
1235
+ /** @description Default component instance value */
1236
+ defaults?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
1237
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
1238
+ variants?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
1239
+ /** @description Created date string for this definition (ignored for writes) */
1240
+ created?: string;
1241
+ /** @description Last modified date string for this definition (ignored for writes) */
1242
+ updated?: string;
1243
+ };
1244
+ /** @description Defines an editable parameter on a component. */
1245
+ ComponentParameter: {
1246
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
1247
+ value: unknown;
1248
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
1249
+ type: string;
1250
+ binding?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
1251
+ };
1252
+ /**
1253
+ * @deprecated
1254
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
1255
+ */
1256
+ ComponentParameterBinding: {
1257
+ /** @description A JSON Pointer expression that defines the binding directly to the parameter value */
1258
+ pointer: string;
1259
+ /**
1260
+ * @description The syntax of the binding (currently always 'jptr')
1261
+ * @enum {string}
1262
+ */
1263
+ syntax: "jptr";
1264
+ /**
1265
+ * @description Whether the binding should cause an error if it cannot be resolved.
1266
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
1267
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
1268
+ *
1269
+ * @default false
1270
+ */
1271
+ required?: boolean;
1272
+ };
1273
+ /** @description Defines the shape of a component instance served by the composition API. */
1274
+ ComponentInstance: {
1275
+ /** @description Type of the component instance (public_id of its definition) */
1276
+ type: string;
1277
+ /** @description Component parameter values for the component instance */
1278
+ parameters?: {
1279
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
1280
+ };
1281
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
1282
+ variant?: string;
1283
+ /** @description Slots containing any child components */
1284
+ slots?: {
1285
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
1286
+ };
1287
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
1288
+ _id?: string;
1289
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
1290
+ _pattern?: string;
1291
+ _data?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
1292
+ /**
1293
+ * @deprecated
1294
+ * @description Data definitions coming from a pattern resolved for this component. Merged with _data during resolution.
1295
+ * Means nothing for PUTs; it will be ignored.
1296
+ */
1297
+ _patternData?: {
1298
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
1299
+ };
1300
+ /**
1301
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
1302
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
1303
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
1304
+ * Means nothing for PUTs; it will be ignored.
1305
+ *
1306
+ * @enum {string}
1307
+ */
1308
+ _patternError?: "NOTFOUND" | "CYCLIC";
1309
+ };
1310
+ /** @description Defines the shape of the root component in a composition */
1311
+ RootComponentInstance: {
1312
+ /** @description Type of the component instance (public_id of its definition) */
1313
+ type: string;
1314
+ /** @description Component parameter values for the component instance */
1315
+ parameters?: {
1316
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
1317
+ };
1318
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
1319
+ variant?: string;
1320
+ /** @description Slots containing any child components */
1321
+ slots?: {
1322
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
1323
+ };
1324
+ /** @description The public UUID of the composition. */
1325
+ _id: string;
1326
+ /** @description Slug pattern of this component. */
1327
+ _slug?: string | null;
1328
+ /** @description Friendly name of this component. */
1329
+ _name: string;
1330
+ _data?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
1331
+ };
1332
+ /**
1333
+ * @deprecated
1334
+ * @description Basic information about an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). This data is provided to list responses.
1335
+ */
1336
+ DataConnectionInfo: {
1337
+ /** @description Public ID of the data connector */
1338
+ id: string;
1339
+ /** @description Display name of the data connector */
1340
+ displayName: string;
1341
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
1342
+ connectorType: string;
1343
+ /** @description Base resource URL of the data connector. No trailing slash. */
1344
+ baseUrl?: string;
1345
+ };
1346
+ /**
1347
+ * @deprecated
1348
+ * @description An instance of an integration data connector (i.e. "Master environment of the stable space", "Yelp API", "Sanity dev dataset"). These are created in the UI and shared across a whole project.
1349
+ */
1350
+ DataConnection: {
1351
+ /** @description Public ID of the data connector */
1352
+ id: string;
1353
+ /** @description Display name of the data connector */
1354
+ displayName: string;
1355
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
1356
+ connectorType: string;
1357
+ /** @description Base resource URL of the data connector. No trailing slash. */
1358
+ baseUrl: string;
1359
+ /** @description HTTP headers to pass with requests to the data connector */
1360
+ headers?: {
1361
+ [key: string]: string;
1362
+ };
1363
+ /** @description Query String parameters to pass with requests to the data connector */
1364
+ parameters?: {
1365
+ [key: string]: string;
1366
+ };
1367
+ /** @description Variables needed to make calls to the data connector */
1368
+ variables?: {
1369
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
1370
+ };
1371
+ /** @description Custom configuration specific to the data connection being defined */
1372
+ custom?: {
1373
+ [key: string]: unknown;
1374
+ };
1375
+ };
1376
+ /**
1377
+ * @deprecated
1378
+ * @description A specific type of data that a Data Connection can provide (i.e. "Recipe", "Recipes List by Tag", "Yelp Reviews of My Restaurant"). These are created in the UI and shared a whole project.
1379
+ */
1380
+ DataType: {
1381
+ /** @description Public ID of the data connector */
1382
+ id: string;
1383
+ /** @description Display name of the data connector */
1384
+ displayName: string;
1385
+ /** @description Public ID of the associated data connector */
1386
+ connectionId: string;
1387
+ /**
1388
+ * @description A connector-specific archetype for this data type; used to select UI as well as perform any
1389
+ * necessary post-processing on the response. e.g. 'cms-entry', 'cms-query'. Can be undefined if
1390
+ * no special UI or processing is required.
1391
+ */
1392
+ archetype?: string;
1393
+ /** @description Resource path, appended to the data connection's baseUrl (e.g. baseUrl = https://base.url, path = /v1/endpoint -> final URL https://base.url/v1/endpoint). Must have leading slash. */
1394
+ path: string;
1395
+ /** @description HTTP headers to pass with requests to the data connector */
1396
+ headers?: {
1397
+ [key: string]: string;
1398
+ };
1399
+ /** @description Query String parameters to pass with requests to the data connector */
1400
+ parameters?: {
1401
+ [key: string]: string;
1402
+ };
1403
+ /** @description Body to pass with requests to the data connector */
1404
+ body?: string;
1405
+ /**
1406
+ * @description HTTP method to use with requests to the data connector.
1407
+ * @default GET
1408
+ * @enum {string}
1409
+ */
1410
+ method: "GET" | "POST" | "HEAD";
1411
+ /** @description Variables needed to make calls to the data connector */
1412
+ variables?: {
1413
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
1414
+ };
1415
+ /** @description Custom configuration specific to the data connection being defined */
1416
+ custom?: {
1417
+ [key: string]: unknown;
1418
+ };
1419
+ };
1420
+ /**
1421
+ * @deprecated
1422
+ * @description Defines the shape of a data variable on a Data Connector or Data Type
1423
+ */
1424
+ DataVariable: {
1425
+ /** @description Display name of the data variable */
1426
+ displayName?: string;
1427
+ /**
1428
+ * @description Type of the data variable
1429
+ * @default text
1430
+ */
1431
+ type: string;
1432
+ /** @description Default value of the data variable */
1433
+ default: string;
1434
+ /**
1435
+ * @description Where the variable value is set. Static = set to static value by the author. Dynamic = set to a dynamic value by a runtime API request from the frontend (default is used in the editor).
1436
+ * @enum {string}
1437
+ */
1438
+ setBy: "static" | "dynamic";
1439
+ };
1440
+ /**
1441
+ * @deprecated
1442
+ * @description Data definitions attached to this component. The property name is the key of the data in the data document.
1443
+ * Note: data definitions are inherited from ancestors at runtime (and may be overridden by descendants that use the same key).
1444
+ */
1445
+ CompositionDataDefinitions: {
1446
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
1447
+ };
1448
+ /**
1449
+ * @deprecated
1450
+ * @description Data definition attached to this component
1451
+ */
1452
+ CompositionDataDefinition: {
1453
+ /** @description Public ID of the data type that provides this data */
1454
+ type: string;
1455
+ /** @description Whether this data is a pattern parameter that has to be overridden when a pattern is referenced on another composition. If this is not a pattern composition, this has no meaning and should not be used. If unspecified, the default is false. */
1456
+ isPatternParameter?: boolean;
1457
+ variables?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataVariables"];
1458
+ };
1459
+ /**
1460
+ * @deprecated
1461
+ * @description Static variable values for this composition.
1462
+ */
1463
+ CompositionDataVariables: {
1464
+ [key: string]: string;
1465
+ };
1466
+ };
1467
+ };
1468
+ operations: {};
1469
+ };
1470
+ }
1471
+
1472
+ declare type Components = components['schemas'];
1473
+ declare type SharedComponents = components$1['schemas'];
1474
+ declare type Api = paths['/api/v1/canvas'];
1475
+ /** Query parameter options for GET /api/v1/canvas */
1476
+ declare type CompositionGetParameters = Omit<Api['get']['parameters']['query'], 'type'> & {
1477
+ type?: string | string[];
1478
+ };
1479
+ declare type CompositionGetOrderBy = NonNullable<Api['get']['parameters']['query']['orderBy']>[0];
1480
+ /** The GET response from /api/v1/canvas when `component` or `slug` params are specified */
1481
+ declare type CompositionGetResponse = Components['CompositionApiResponse'];
1482
+ /** @deprecated - internal use, do not rely on this value */
1483
+ declare type CompositionUIStatus = NonNullable<Components['CompositionApiResponse']['uiStatus']>;
1484
+ /** The GET response from /api/v1/canvas when `component` or `slug` are not specified */
1485
+ declare type CompositionGetListResponse = Components['CompositionListResponse'];
1486
+ /** The PUT request body for /api/v1/canvas */
1487
+ declare type CompositionPutParameters = Api['put']['requestBody']['content']['application/json'];
1488
+ /** Shape of the DELETE request body for /api/v1/canvas */
1489
+ declare type CompositionDeleteParameters = Api['delete']['requestBody']['content']['application/json'];
1490
+ /** @deprecated use CompositionGetResponse */
1491
+ declare type CompositionAPIResponse = CompositionGetResponse;
1492
+ /** @deprecated use CompositionDeleteParameters */
1493
+ declare type CompositionAPIDeleteRequest = CompositionDeleteParameters;
1494
+ /** @deprecated use CompositionGetParameters */
1495
+ declare type CompositionListAPIResponse = CompositionGetListResponse;
1496
+ /** @deprecated use CompositionGetParameters */
1497
+ declare type CompositionAPIOptions = CompositionGetParameters;
1498
+ /** Defines an editable parameter on a component. */
1499
+ declare type ComponentParameter<TValue = unknown> = Omit<SharedComponents['ComponentParameter'], 'value'> & {
1500
+ /** The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
1501
+ value: TValue;
1502
+ };
1503
+ /** Defines a binding from a resource data value to a component parameter value. */
1504
+ declare type ComponentParameterBinding = SharedComponents['ComponentParameterBinding'];
1505
+ /** Variables defined for this composition. */
1506
+ declare type CompositionDataVariables = SharedComponents['CompositionDataVariables'];
1507
+ /** Defines the shape of a resource bound to a composition */
1508
+ declare type CompositionDataDefinitions = SharedComponents['CompositionDataDefinitions'];
1509
+ /** Defines the shape of a resource bound to a composition */
1510
+ declare type CompositionDataDefinition = SharedComponents['CompositionDataDefinition'];
1511
+ /** Defines the shape of a component instance served by the composition API. */
1512
+ declare type ComponentInstance = SharedComponents['ComponentInstance'] & {
1513
+ /** Data for the component instance, provided by a component enhancer. Never set in unenhanced data. */
1514
+ data?: Record<string, unknown>;
1515
+ };
1516
+ /** Defines the shape of the root component in a composition */
1517
+ declare type RootComponentInstance = SharedComponents['RootComponentInstance'];
1518
+ /** Defines single structure to keep all canvas models (used in CLI commands and Starter content generations) */
1519
+ declare type CanvasDefinitions = {
1520
+ components?: Array<ComponentDefinition>;
1521
+ compositions?: Array<CompositionGetResponse>;
1522
+ };
1523
+
1524
+ /**
1525
+ * Pusher-js is large (80k) and not tree shakable so it is always bundled if directly referenced,
1526
+ * when it's only needed during preview mode. To avoid bundling it for all, we use an old-school
1527
+ * write-a-script-tag hack to load it in a poor man's approximation of a dynamic import ;)
1528
+ */
1529
+ declare type ChannelSubscription = {
1530
+ addEventHandler: (eventName: string, handler: (data: unknown) => void) => () => void;
1531
+ unsubscribe: () => void;
1532
+ };
1533
+ declare type PreviewEventBus = {
1534
+ subscribe: (channel: string) => ChannelSubscription;
1535
+ };
1536
+ declare global {
1537
+ interface Window {
1538
+ Pusher?: typeof Pusher;
1539
+ __UNIFORM_EVENT_BUS__?: PreviewEventBus;
1540
+ }
1541
+ }
1542
+ /**
1543
+ * Creates an event bus client to receive updates from Canvas
1544
+ * IMPORTANT: in a server-side context this will always return undefined
1545
+ * IMPORTANT: in a browser context this is cached in window and does not create multiple instances
1546
+ */
1547
+ declare function createEventBus(): Promise<PreviewEventBus | undefined>;
1548
+
1549
+ export { CompositionListAPIResponse as A, CompositionAPIOptions as B, ComponentInstance as C, ComponentParameterBinding as D, CompositionDataVariables as E, CompositionDataDefinitions as F, CompositionDataDefinition as G, CanvasDefinitions as H, ChannelSubscription as I, createEventBus as J, PreviewEventBus as P, RootComponentInstance as R, ComponentParameter as a, CompositionGetParameters as b, components$1 as c, CompositionPutParameters as d, CompositionDeleteParameters as e, ComponentDefinitionGetParameters as f, ComponentDefinitionPutParameters as g, ComponentDefinitionDeleteParameters as h, ComponentDefinitionGetResponse as i, ComponentDefinitionAPIResponse as j, ComponentDefinitionAPIPutRequest as k, ComponentDefinitionAPIDeleteRequest as l, ComponentDefinitionListAPIOptions as m, ComponentDefinitionParameter as n, ComponentDefinitionVariant as o, ComponentDefinitionSlugSettings as p, ComponentDefinitionSlot as q, ComponentDefinitionPermission as r, ComponentDefinition as s, CreatingComponentDefinition as t, CompositionGetOrderBy as u, CompositionGetResponse as v, CompositionUIStatus as w, CompositionGetListResponse as x, CompositionAPIResponse as y, CompositionAPIDeleteRequest as z };