@uniformdev/canvas 17.1.0 → 17.1.1-alpha.231

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { C as ComponentInstance, a as ComponentParameter, b as CompositionGetParameters, c as CompositionPutParameters, d as CompositionDeleteParameters, e as ComponentDefinitionGetParameters, f as ComponentDefinitionPutParameters, g as ComponentDefinitionDeleteParameters, P as PreviewEventBus } from './createEventBus-c46c67da.js';
2
- export { F as CanvasDefinitions, G as ChannelSubscription, r as ComponentDefinition, k as ComponentDefinitionAPIDeleteRequest, j as ComponentDefinitionAPIPutRequest, i as ComponentDefinitionAPIResponse, g as ComponentDefinitionDeleteParameters, e as ComponentDefinitionGetParameters, h as ComponentDefinitionGetResponse, l as ComponentDefinitionListAPIOptions, m as ComponentDefinitionParameter, q as ComponentDefinitionPermission, f as ComponentDefinitionPutParameters, p as ComponentDefinitionSlot, o as ComponentDefinitionSlugSettings, n as ComponentDefinitionVariant, C as ComponentInstance, a as ComponentParameter, z as ComponentParameterBinding, w as CompositionAPIDeleteRequest, y as CompositionAPIOptions, v as CompositionAPIResponse, d as CompositionDeleteParameters, u as CompositionGetListResponse, b as CompositionGetParameters, t as CompositionGetResponse, x as CompositionListAPIResponse, c as CompositionPutParameters, E as CompositionResourceDefinition, D as CompositionResourceDefinitions, B as CompositionVariable, A as CompositionVariableDefinitions, s as CreatingComponentDefinition, P as PreviewEventBus, R as RootComponentInstance, H as createEventBus } from './createEventBus-c46c67da.js';
1
+ import { C as ComponentInstance, a as ComponentParameter, c as components, b as CompositionGetParameters, d as CompositionPutParameters, e as CompositionDeleteParameters, f as ComponentDefinitionGetParameters, g as ComponentDefinitionPutParameters, h as ComponentDefinitionDeleteParameters, R as RootComponentInstance, P as PreviewEventBus, i as CompositionGetResponse } from './createEventBus-e386fc9c.js';
2
+ export { H as CanvasDefinitions, I as ChannelSubscription, t as ComponentDefinition, m as ComponentDefinitionAPIDeleteRequest, l as ComponentDefinitionAPIPutRequest, k as ComponentDefinitionAPIResponse, h as ComponentDefinitionDeleteParameters, f as ComponentDefinitionGetParameters, j as ComponentDefinitionGetResponse, n as ComponentDefinitionListAPIOptions, o as ComponentDefinitionParameter, s as ComponentDefinitionPermission, g as ComponentDefinitionPutParameters, r as ComponentDefinitionSlot, q as ComponentDefinitionSlugSettings, p as ComponentDefinitionVariant, C as ComponentInstance, a as ComponentParameter, D as ComponentParameterBinding, z as CompositionAPIDeleteRequest, B as CompositionAPIOptions, y as CompositionAPIResponse, G as CompositionDataDefinition, F as CompositionDataDefinitions, E as CompositionDataVariables, e as CompositionDeleteParameters, x as CompositionGetListResponse, v as CompositionGetOrderBy, b as CompositionGetParameters, i as CompositionGetResponse, A as CompositionListAPIResponse, d as CompositionPutParameters, w as CompositionUIStatus, u as CreatingComponentDefinition, P as PreviewEventBus, R as RootComponentInstance, J as createEventBus } from './createEventBus-e386fc9c.js';
3
3
  import { Options } from 'p-throttle';
4
4
  import { Options as Options$1 } from 'p-retry';
5
+ import { ApiClient, ClientOptions, ExceptProject, ApiClientError } from '@uniformdev/context/api';
6
+ export { ApiClientError } from '@uniformdev/context/api';
5
7
  import { PersonalizedVariant, TestVariant } from '@uniformdev/context';
6
8
  import 'pusher-js';
7
9
 
@@ -83,12 +85,1398 @@ declare type ComponentParameterEnhancer<TRawValue = unknown, TOutputValue = unkn
83
85
  completeAll?: () => Promise<number>;
84
86
  };
85
87
 
88
+ /**
89
+ * This file was auto-generated by openapi-typescript.
90
+ * Do not make direct changes to the file.
91
+ */
92
+ interface paths$2 {
93
+ "/api/v1/data-types": {
94
+ get: {
95
+ parameters: {
96
+ query: {
97
+ projectId: string;
98
+ };
99
+ };
100
+ responses: {
101
+ /** OK */
102
+ 200: {
103
+ content: {
104
+ "application/json": {
105
+ results: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataType"][];
106
+ };
107
+ };
108
+ };
109
+ 400: external$2["swagger.yml"]["components"]["responses"]["BadRequestError"];
110
+ 401: external$2["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
111
+ 403: external$2["swagger.yml"]["components"]["responses"]["ForbiddenError"];
112
+ 429: external$2["swagger.yml"]["components"]["responses"]["RateLimitError"];
113
+ 500: external$2["swagger.yml"]["components"]["responses"]["InternalServerError"];
114
+ };
115
+ };
116
+ put: {
117
+ responses: {
118
+ /** OK */
119
+ 204: never;
120
+ 400: external$2["swagger.yml"]["components"]["responses"]["BadRequestError"];
121
+ 401: external$2["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
122
+ 403: external$2["swagger.yml"]["components"]["responses"]["ForbiddenError"];
123
+ 429: external$2["swagger.yml"]["components"]["responses"]["RateLimitError"];
124
+ 500: external$2["swagger.yml"]["components"]["responses"]["InternalServerError"];
125
+ };
126
+ requestBody: {
127
+ content: {
128
+ "application/json": {
129
+ data: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataType"];
130
+ /** Format: uuid */
131
+ projectId: string;
132
+ };
133
+ };
134
+ };
135
+ };
136
+ delete: {
137
+ responses: {
138
+ /** OK */
139
+ 204: never;
140
+ 400: external$2["swagger.yml"]["components"]["responses"]["BadRequestError"];
141
+ 401: external$2["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
142
+ 403: external$2["swagger.yml"]["components"]["responses"]["ForbiddenError"];
143
+ 429: external$2["swagger.yml"]["components"]["responses"]["RateLimitError"];
144
+ 500: external$2["swagger.yml"]["components"]["responses"]["InternalServerError"];
145
+ };
146
+ requestBody: {
147
+ content: {
148
+ "application/json": {
149
+ typeId: string;
150
+ /** Format: uuid */
151
+ projectId: string;
152
+ };
153
+ };
154
+ };
155
+ };
156
+ };
157
+ }
158
+ interface external$2 {
159
+ "swagger.yml": {
160
+ paths: {};
161
+ components: {
162
+ schemas: {
163
+ Error: {
164
+ /** @description Error message(s) that occurred while processing the request */
165
+ errorMessage?: string[] | string;
166
+ };
167
+ };
168
+ responses: {
169
+ /** Request input validation failed */
170
+ BadRequestError: {
171
+ content: {
172
+ "application/json": external$2["swagger.yml"]["components"]["schemas"]["Error"];
173
+ };
174
+ };
175
+ /** API key or token was not valid */
176
+ UnauthorizedError: {
177
+ content: {
178
+ "application/json": external$2["swagger.yml"]["components"]["schemas"]["Error"];
179
+ };
180
+ };
181
+ /** Permission was denied */
182
+ ForbiddenError: {
183
+ content: {
184
+ "application/json": external$2["swagger.yml"]["components"]["schemas"]["Error"];
185
+ };
186
+ };
187
+ /** Resource not found */
188
+ NotFoundError: {
189
+ content: {
190
+ "application/json": external$2["swagger.yml"]["components"]["schemas"]["Error"];
191
+ };
192
+ };
193
+ /** Too many requests in allowed time period */
194
+ RateLimitError: unknown;
195
+ /** Execution error occurred */
196
+ InternalServerError: unknown;
197
+ };
198
+ };
199
+ operations: {};
200
+ };
201
+ "uniform-canvas-types.swagger.yml": {
202
+ paths: {};
203
+ components: {
204
+ schemas: {
205
+ /** @description Public ID (used in code). Do not change after creation. */
206
+ PublicIdProperty: string;
207
+ /** @description The definition of a component parameter */
208
+ ComponentDefinitionParameter: {
209
+ id: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
210
+ /** @description Friendly name of the parameter */
211
+ name: string;
212
+ /** @description Appears next to the parameter in the Composition editor */
213
+ helpText?: string;
214
+ /** @description Type name of the parameter (provided by a Uniform integration) */
215
+ type: string;
216
+ /** @description The configuration object for the type (type-specific) */
217
+ typeConfig?: unknown;
218
+ };
219
+ /** @description The definition of a named component slot that can contain other components */
220
+ ComponentDefinitionSlot: {
221
+ id: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
222
+ /** @description Friendly name of the slot */
223
+ name: string;
224
+ /** @description A list of component definition public IDs that are allowed in this named slot */
225
+ allowedComponents: string[];
226
+ /**
227
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
228
+ * @default false
229
+ */
230
+ inheritAllowedComponents: boolean;
231
+ /** @description Minimum valid number of components in this slot */
232
+ minComponents?: number;
233
+ /** @description Maximum valid number of components in this slot */
234
+ maxComponents?: number;
235
+ };
236
+ /** @description The definition of a composition's slug settings */
237
+ ComponentDefinitionSlugSettings: {
238
+ /**
239
+ * @description Whether the slug is required
240
+ * no: slug is optional
241
+ * yes: slug is required
242
+ * disabled: slug is disabled and will not be shown in the editor
243
+ *
244
+ * @default no
245
+ * @enum {string}
246
+ */
247
+ required?: "no" | "yes" | "disabled";
248
+ /**
249
+ * @description Slug uniqueness configuration.
250
+ * no = no unique constraint
251
+ * local = must be unique within this component type
252
+ * global = must be unique across all component types
253
+ *
254
+ * @enum {string}
255
+ */
256
+ unique?: "no" | "local" | "global";
257
+ /** @description Regular expression slugs must match */
258
+ regularExpression?: string;
259
+ /**
260
+ * @description Custom error message when regular expression validation fails.
261
+ * Has no effect if `regularExpression` is not set.
262
+ */
263
+ regularExpressionMessage?: string;
264
+ };
265
+ /** @description The definition of a component variant */
266
+ ComponentDefinitionVariant: {
267
+ id: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
268
+ /** @description Friendly name of the variant */
269
+ name: string;
270
+ };
271
+ /** @description Permission set for a component defintion */
272
+ ComponentDefinitionPermission: {
273
+ roleId: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
274
+ /**
275
+ * @description Permission type for this permission ComponentDefinition:
276
+ * read | write | create | delete
277
+ *
278
+ * @enum {string}
279
+ */
280
+ permission: "read" | "write" | "create" | "delete";
281
+ /** @description State of the component that this permission applies to */
282
+ state: number;
283
+ };
284
+ /** @description Defines a component type that can live on a Composition */
285
+ ComponentDefinition: {
286
+ id: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
287
+ /** @description Friendly name of the component definition */
288
+ name: string;
289
+ /**
290
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
291
+ * @default screen
292
+ */
293
+ icon?: string;
294
+ /**
295
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
296
+ * The parameter type must support being used as a title parameter for this to work.
297
+ */
298
+ titleParameter?: string | null;
299
+ /**
300
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
301
+ * @default false
302
+ */
303
+ canBeComposition?: boolean;
304
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
305
+ parameters?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
306
+ /**
307
+ * @description if this component uses team permissions or custom permissions
308
+ * @default true
309
+ */
310
+ useTeamPermissions?: boolean;
311
+ /** @description Custom role permissions for this component definition */
312
+ permissions?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
313
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
314
+ slots?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
315
+ slugSettings?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
316
+ /** @description Default component instance value */
317
+ defaults?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
318
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
319
+ variants?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
320
+ /** @description Created date string for this definition (ignored for writes) */
321
+ created?: string;
322
+ /** @description Last modified date string for this definition (ignored for writes) */
323
+ updated?: string;
324
+ };
325
+ /** @description Defines an editable parameter on a component. */
326
+ ComponentParameter: {
327
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
328
+ value: unknown;
329
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
330
+ type: string;
331
+ binding?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
332
+ };
333
+ /**
334
+ * @deprecated
335
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
336
+ */
337
+ ComponentParameterBinding: {
338
+ /** @description A JSON Pointer expression that defines the binding directly to the parameter value */
339
+ pointer: string;
340
+ /**
341
+ * @description The syntax of the binding (currently always 'jptr')
342
+ * @enum {string}
343
+ */
344
+ syntax: "jptr";
345
+ /**
346
+ * @description Whether the binding should cause an error if it cannot be resolved.
347
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
348
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
349
+ *
350
+ * @default false
351
+ */
352
+ required?: boolean;
353
+ };
354
+ /** @description Defines the shape of a component instance served by the composition API. */
355
+ ComponentInstance: {
356
+ /** @description Type of the component instance (public_id of its definition) */
357
+ type: string;
358
+ /** @description Component parameter values for the component instance */
359
+ parameters?: {
360
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
361
+ };
362
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
363
+ variant?: string;
364
+ /** @description Slots containing any child components */
365
+ slots?: {
366
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
367
+ };
368
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
369
+ _id?: string;
370
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
371
+ _pattern?: string;
372
+ _data?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
373
+ /**
374
+ * @deprecated
375
+ * @description Data definitions coming from a pattern resolved for this component. Merged with _data during resolution.
376
+ * Means nothing for PUTs; it will be ignored.
377
+ */
378
+ _patternData?: {
379
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
380
+ };
381
+ /**
382
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
383
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
384
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
385
+ * Means nothing for PUTs; it will be ignored.
386
+ *
387
+ * @enum {string}
388
+ */
389
+ _patternError?: "NOTFOUND" | "CYCLIC";
390
+ };
391
+ /** @description Defines the shape of the root component in a composition */
392
+ RootComponentInstance: {
393
+ /** @description Type of the component instance (public_id of its definition) */
394
+ type: string;
395
+ /** @description Component parameter values for the component instance */
396
+ parameters?: {
397
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
398
+ };
399
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
400
+ variant?: string;
401
+ /** @description Slots containing any child components */
402
+ slots?: {
403
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
404
+ };
405
+ /** @description The public UUID of the composition. */
406
+ _id: string;
407
+ /** @description Slug pattern of this component. */
408
+ _slug?: string | null;
409
+ /** @description Friendly name of this component. */
410
+ _name: string;
411
+ _data?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
412
+ };
413
+ /**
414
+ * @deprecated
415
+ * @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.
416
+ */
417
+ DataConnectionInfo: {
418
+ /** @description Public ID of the data connector */
419
+ id: string;
420
+ /** @description Display name of the data connector */
421
+ displayName: string;
422
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
423
+ connectorType: string;
424
+ /** @description Base resource URL of the data connector. No trailing slash. */
425
+ baseUrl?: string;
426
+ };
427
+ /**
428
+ * @deprecated
429
+ * @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.
430
+ */
431
+ DataConnection: {
432
+ /** @description Public ID of the data connection */
433
+ id: string;
434
+ /** @description Display name of the data connection */
435
+ displayName: string;
436
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
437
+ connectorType: string;
438
+ /** @description Base resource URL of the data connection. No trailing slash. */
439
+ baseUrl: string;
440
+ /** @description HTTP headers to pass with requests to the data connection */
441
+ headers?: {
442
+ [key: string]: string;
443
+ };
444
+ /** @description Query String parameters to pass with requests to the data connection */
445
+ parameters?: {
446
+ [key: string]: string;
447
+ };
448
+ /** @description Variables needed to make calls to the data connection */
449
+ variables?: {
450
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
451
+ };
452
+ /** @description Custom configuration specific to the data connection being defined */
453
+ custom?: {
454
+ [key: string]: unknown;
455
+ };
456
+ };
457
+ /**
458
+ * @deprecated
459
+ * @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.
460
+ */
461
+ DataType: {
462
+ /** @description Public ID of the data type */
463
+ id: string;
464
+ /** @description Display name of the data type */
465
+ displayName: string;
466
+ /** @description Public ID of the associated data connection */
467
+ connectionId: string;
468
+ /**
469
+ * @description A connector-specific archetype for this data type; used to select UI as well as perform any
470
+ * necessary post-processing on the response. e.g. 'cms-entry', 'cms-query'. Can be undefined if
471
+ * no special UI or processing is required.
472
+ */
473
+ archetype?: string;
474
+ /** @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. */
475
+ path: string;
476
+ /** @description HTTP headers to pass with requests to the data type. Merged with headers from the data connection, overriding identical keys. */
477
+ headers?: {
478
+ [key: string]: string;
479
+ };
480
+ /** @description Query String parameters to pass with requests to the data type. Merged with parameters from the data connection, overriding identical keys. */
481
+ parameters?: {
482
+ [key: string]: string;
483
+ };
484
+ /** @description Body to pass with requests to the data type (ignored unless method is POST) */
485
+ body?: string;
486
+ /**
487
+ * @description HTTP method to use with requests to the data type.
488
+ * @default GET
489
+ * @enum {string}
490
+ */
491
+ method: "GET" | "POST" | "HEAD";
492
+ /** @description Variables needed to make calls to the data type. Merged with variables from the data connection, overriding identical keys. */
493
+ variables?: {
494
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
495
+ };
496
+ /** @description Custom configuration specific to the data connection being defined */
497
+ custom?: {
498
+ [key: string]: unknown;
499
+ };
500
+ };
501
+ /**
502
+ * @deprecated
503
+ * @description Defines the shape of a data variable on a Data Connector or Data Type
504
+ */
505
+ DataVariable: {
506
+ /** @description Display name of the data variable */
507
+ displayName?: string;
508
+ /**
509
+ * @description Type of the data variable
510
+ * @default text
511
+ */
512
+ type: string;
513
+ /** @description Default value of the data variable */
514
+ default: string;
515
+ /**
516
+ * @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).
517
+ * @enum {string}
518
+ */
519
+ setBy: "static" | "dynamic";
520
+ };
521
+ /**
522
+ * @deprecated
523
+ * @description Data definitions attached to this component. The property name is the key of the data in the data document.
524
+ * Note: data definitions are inherited from ancestors at runtime (and may be overridden by descendants that use the same key).
525
+ */
526
+ CompositionDataDefinitions: {
527
+ [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
528
+ };
529
+ /**
530
+ * @deprecated
531
+ * @description Data definition attached to this component
532
+ */
533
+ CompositionDataDefinition: {
534
+ /** @description Public ID of the data type that provides this data */
535
+ type: string;
536
+ /** @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. */
537
+ isPatternParameter?: boolean;
538
+ variables?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataVariables"];
539
+ };
540
+ /**
541
+ * @deprecated
542
+ * @description Static variable values for this composition.
543
+ */
544
+ CompositionDataVariables: {
545
+ [key: string]: string;
546
+ };
547
+ };
548
+ };
549
+ operations: {};
550
+ };
551
+ }
552
+
553
+ /**
554
+ * This file was auto-generated by openapi-typescript.
555
+ * Do not make direct changes to the file.
556
+ */
557
+ interface paths$1 {
558
+ "/api/v1/data-connection": {
559
+ get: {
560
+ parameters: {
561
+ query: {
562
+ dataConnectionId: string;
563
+ projectId: string;
564
+ };
565
+ };
566
+ responses: {
567
+ /** OK */
568
+ 200: {
569
+ content: {
570
+ "application/json": {
571
+ result: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataConnection"];
572
+ };
573
+ };
574
+ };
575
+ 400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
576
+ 401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
577
+ 403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
578
+ 429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
579
+ 500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
580
+ };
581
+ };
582
+ put: {
583
+ responses: {
584
+ /** OK */
585
+ 204: never;
586
+ 400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
587
+ 401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
588
+ 403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
589
+ 429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
590
+ 500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
591
+ };
592
+ requestBody: {
593
+ content: {
594
+ "application/json": {
595
+ data: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataConnection"];
596
+ /** Format: uuid */
597
+ projectId: string;
598
+ /** Format: uuid */
599
+ integrationId: string;
600
+ };
601
+ };
602
+ };
603
+ };
604
+ delete: {
605
+ responses: {
606
+ /** OK */
607
+ 204: never;
608
+ 400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
609
+ 401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
610
+ 403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
611
+ 429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
612
+ 500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
613
+ };
614
+ requestBody: {
615
+ content: {
616
+ "application/json": {
617
+ connectionId: string;
618
+ /** Format: uuid */
619
+ projectId: string;
620
+ };
621
+ };
622
+ };
623
+ };
624
+ };
625
+ }
626
+ interface external$1 {
627
+ "swagger.yml": {
628
+ paths: {};
629
+ components: {
630
+ schemas: {
631
+ Error: {
632
+ /** @description Error message(s) that occurred while processing the request */
633
+ errorMessage?: string[] | string;
634
+ };
635
+ };
636
+ responses: {
637
+ /** Request input validation failed */
638
+ BadRequestError: {
639
+ content: {
640
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
641
+ };
642
+ };
643
+ /** API key or token was not valid */
644
+ UnauthorizedError: {
645
+ content: {
646
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
647
+ };
648
+ };
649
+ /** Permission was denied */
650
+ ForbiddenError: {
651
+ content: {
652
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
653
+ };
654
+ };
655
+ /** Resource not found */
656
+ NotFoundError: {
657
+ content: {
658
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
659
+ };
660
+ };
661
+ /** Too many requests in allowed time period */
662
+ RateLimitError: unknown;
663
+ /** Execution error occurred */
664
+ InternalServerError: unknown;
665
+ };
666
+ };
667
+ operations: {};
668
+ };
669
+ "uniform-canvas-types.swagger.yml": {
670
+ paths: {};
671
+ components: {
672
+ schemas: {
673
+ /** @description Public ID (used in code). Do not change after creation. */
674
+ PublicIdProperty: string;
675
+ /** @description The definition of a component parameter */
676
+ ComponentDefinitionParameter: {
677
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
678
+ /** @description Friendly name of the parameter */
679
+ name: string;
680
+ /** @description Appears next to the parameter in the Composition editor */
681
+ helpText?: string;
682
+ /** @description Type name of the parameter (provided by a Uniform integration) */
683
+ type: string;
684
+ /** @description The configuration object for the type (type-specific) */
685
+ typeConfig?: unknown;
686
+ };
687
+ /** @description The definition of a named component slot that can contain other components */
688
+ ComponentDefinitionSlot: {
689
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
690
+ /** @description Friendly name of the slot */
691
+ name: string;
692
+ /** @description A list of component definition public IDs that are allowed in this named slot */
693
+ allowedComponents: string[];
694
+ /**
695
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
696
+ * @default false
697
+ */
698
+ inheritAllowedComponents: boolean;
699
+ /** @description Minimum valid number of components in this slot */
700
+ minComponents?: number;
701
+ /** @description Maximum valid number of components in this slot */
702
+ maxComponents?: number;
703
+ };
704
+ /** @description The definition of a composition's slug settings */
705
+ ComponentDefinitionSlugSettings: {
706
+ /**
707
+ * @description Whether the slug is required
708
+ * no: slug is optional
709
+ * yes: slug is required
710
+ * disabled: slug is disabled and will not be shown in the editor
711
+ *
712
+ * @default no
713
+ * @enum {string}
714
+ */
715
+ required?: "no" | "yes" | "disabled";
716
+ /**
717
+ * @description Slug uniqueness configuration.
718
+ * no = no unique constraint
719
+ * local = must be unique within this component type
720
+ * global = must be unique across all component types
721
+ *
722
+ * @enum {string}
723
+ */
724
+ unique?: "no" | "local" | "global";
725
+ /** @description Regular expression slugs must match */
726
+ regularExpression?: string;
727
+ /**
728
+ * @description Custom error message when regular expression validation fails.
729
+ * Has no effect if `regularExpression` is not set.
730
+ */
731
+ regularExpressionMessage?: string;
732
+ };
733
+ /** @description The definition of a component variant */
734
+ ComponentDefinitionVariant: {
735
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
736
+ /** @description Friendly name of the variant */
737
+ name: string;
738
+ };
739
+ /** @description Permission set for a component defintion */
740
+ ComponentDefinitionPermission: {
741
+ roleId: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
742
+ /**
743
+ * @description Permission type for this permission ComponentDefinition:
744
+ * read | write | create | delete
745
+ *
746
+ * @enum {string}
747
+ */
748
+ permission: "read" | "write" | "create" | "delete";
749
+ /** @description State of the component that this permission applies to */
750
+ state: number;
751
+ };
752
+ /** @description Defines a component type that can live on a Composition */
753
+ ComponentDefinition: {
754
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
755
+ /** @description Friendly name of the component definition */
756
+ name: string;
757
+ /**
758
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
759
+ * @default screen
760
+ */
761
+ icon?: string;
762
+ /**
763
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
764
+ * The parameter type must support being used as a title parameter for this to work.
765
+ */
766
+ titleParameter?: string | null;
767
+ /**
768
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
769
+ * @default false
770
+ */
771
+ canBeComposition?: boolean;
772
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
773
+ parameters?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
774
+ /**
775
+ * @description if this component uses team permissions or custom permissions
776
+ * @default true
777
+ */
778
+ useTeamPermissions?: boolean;
779
+ /** @description Custom role permissions for this component definition */
780
+ permissions?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
781
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
782
+ slots?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
783
+ slugSettings?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
784
+ /** @description Default component instance value */
785
+ defaults?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
786
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
787
+ variants?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
788
+ /** @description Created date string for this definition (ignored for writes) */
789
+ created?: string;
790
+ /** @description Last modified date string for this definition (ignored for writes) */
791
+ updated?: string;
792
+ };
793
+ /** @description Defines an editable parameter on a component. */
794
+ ComponentParameter: {
795
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
796
+ value: unknown;
797
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
798
+ type: string;
799
+ binding?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
800
+ };
801
+ /**
802
+ * @deprecated
803
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
804
+ */
805
+ ComponentParameterBinding: {
806
+ /** @description A JSON Pointer expression that defines the binding directly to the parameter value */
807
+ pointer: string;
808
+ /**
809
+ * @description The syntax of the binding (currently always 'jptr')
810
+ * @enum {string}
811
+ */
812
+ syntax: "jptr";
813
+ /**
814
+ * @description Whether the binding should cause an error if it cannot be resolved.
815
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
816
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
817
+ *
818
+ * @default false
819
+ */
820
+ required?: boolean;
821
+ };
822
+ /** @description Defines the shape of a component instance served by the composition API. */
823
+ ComponentInstance: {
824
+ /** @description Type of the component instance (public_id of its definition) */
825
+ type: string;
826
+ /** @description Component parameter values for the component instance */
827
+ parameters?: {
828
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
829
+ };
830
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
831
+ variant?: string;
832
+ /** @description Slots containing any child components */
833
+ slots?: {
834
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
835
+ };
836
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
837
+ _id?: string;
838
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
839
+ _pattern?: string;
840
+ _data?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
841
+ /**
842
+ * @deprecated
843
+ * @description Data definitions coming from a pattern resolved for this component. Merged with _data during resolution.
844
+ * Means nothing for PUTs; it will be ignored.
845
+ */
846
+ _patternData?: {
847
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
848
+ };
849
+ /**
850
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
851
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
852
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
853
+ * Means nothing for PUTs; it will be ignored.
854
+ *
855
+ * @enum {string}
856
+ */
857
+ _patternError?: "NOTFOUND" | "CYCLIC";
858
+ };
859
+ /** @description Defines the shape of the root component in a composition */
860
+ RootComponentInstance: {
861
+ /** @description Type of the component instance (public_id of its definition) */
862
+ type: string;
863
+ /** @description Component parameter values for the component instance */
864
+ parameters?: {
865
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
866
+ };
867
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
868
+ variant?: string;
869
+ /** @description Slots containing any child components */
870
+ slots?: {
871
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
872
+ };
873
+ /** @description The public UUID of the composition. */
874
+ _id: string;
875
+ /** @description Slug pattern of this component. */
876
+ _slug?: string | null;
877
+ /** @description Friendly name of this component. */
878
+ _name: string;
879
+ _data?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
880
+ };
881
+ /**
882
+ * @deprecated
883
+ * @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.
884
+ */
885
+ DataConnectionInfo: {
886
+ /** @description Public ID of the data connector */
887
+ id: string;
888
+ /** @description Display name of the data connector */
889
+ displayName: string;
890
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
891
+ connectorType: string;
892
+ /** @description Base resource URL of the data connector. No trailing slash. */
893
+ baseUrl?: string;
894
+ };
895
+ /**
896
+ * @deprecated
897
+ * @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.
898
+ */
899
+ DataConnection: {
900
+ /** @description Public ID of the data connection */
901
+ id: string;
902
+ /** @description Display name of the data connection */
903
+ displayName: string;
904
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
905
+ connectorType: string;
906
+ /** @description Base resource URL of the data connection. No trailing slash. */
907
+ baseUrl: string;
908
+ /** @description HTTP headers to pass with requests to the data connection */
909
+ headers?: {
910
+ [key: string]: string;
911
+ };
912
+ /** @description Query String parameters to pass with requests to the data connection */
913
+ parameters?: {
914
+ [key: string]: string;
915
+ };
916
+ /** @description Variables needed to make calls to the data connection */
917
+ variables?: {
918
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
919
+ };
920
+ /** @description Custom configuration specific to the data connection being defined */
921
+ custom?: {
922
+ [key: string]: unknown;
923
+ };
924
+ };
925
+ /**
926
+ * @deprecated
927
+ * @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.
928
+ */
929
+ DataType: {
930
+ /** @description Public ID of the data type */
931
+ id: string;
932
+ /** @description Display name of the data type */
933
+ displayName: string;
934
+ /** @description Public ID of the associated data connection */
935
+ connectionId: string;
936
+ /**
937
+ * @description A connector-specific archetype for this data type; used to select UI as well as perform any
938
+ * necessary post-processing on the response. e.g. 'cms-entry', 'cms-query'. Can be undefined if
939
+ * no special UI or processing is required.
940
+ */
941
+ archetype?: string;
942
+ /** @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. */
943
+ path: string;
944
+ /** @description HTTP headers to pass with requests to the data type. Merged with headers from the data connection, overriding identical keys. */
945
+ headers?: {
946
+ [key: string]: string;
947
+ };
948
+ /** @description Query String parameters to pass with requests to the data type. Merged with parameters from the data connection, overriding identical keys. */
949
+ parameters?: {
950
+ [key: string]: string;
951
+ };
952
+ /** @description Body to pass with requests to the data type (ignored unless method is POST) */
953
+ body?: string;
954
+ /**
955
+ * @description HTTP method to use with requests to the data type.
956
+ * @default GET
957
+ * @enum {string}
958
+ */
959
+ method: "GET" | "POST" | "HEAD";
960
+ /** @description Variables needed to make calls to the data type. Merged with variables from the data connection, overriding identical keys. */
961
+ variables?: {
962
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
963
+ };
964
+ /** @description Custom configuration specific to the data connection being defined */
965
+ custom?: {
966
+ [key: string]: unknown;
967
+ };
968
+ };
969
+ /**
970
+ * @deprecated
971
+ * @description Defines the shape of a data variable on a Data Connector or Data Type
972
+ */
973
+ DataVariable: {
974
+ /** @description Display name of the data variable */
975
+ displayName?: string;
976
+ /**
977
+ * @description Type of the data variable
978
+ * @default text
979
+ */
980
+ type: string;
981
+ /** @description Default value of the data variable */
982
+ default: string;
983
+ /**
984
+ * @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).
985
+ * @enum {string}
986
+ */
987
+ setBy: "static" | "dynamic";
988
+ };
989
+ /**
990
+ * @deprecated
991
+ * @description Data definitions attached to this component. The property name is the key of the data in the data document.
992
+ * Note: data definitions are inherited from ancestors at runtime (and may be overridden by descendants that use the same key).
993
+ */
994
+ CompositionDataDefinitions: {
995
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
996
+ };
997
+ /**
998
+ * @deprecated
999
+ * @description Data definition attached to this component
1000
+ */
1001
+ CompositionDataDefinition: {
1002
+ /** @description Public ID of the data type that provides this data */
1003
+ type: string;
1004
+ /** @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. */
1005
+ isPatternParameter?: boolean;
1006
+ variables?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataVariables"];
1007
+ };
1008
+ /**
1009
+ * @deprecated
1010
+ * @description Static variable values for this composition.
1011
+ */
1012
+ CompositionDataVariables: {
1013
+ [key: string]: string;
1014
+ };
1015
+ };
1016
+ };
1017
+ operations: {};
1018
+ };
1019
+ }
1020
+
1021
+ /**
1022
+ * This file was auto-generated by openapi-typescript.
1023
+ * Do not make direct changes to the file.
1024
+ */
1025
+ interface paths {
1026
+ "/api/v1/data-connections": {
1027
+ get: {
1028
+ parameters: {
1029
+ query: {
1030
+ projectId: string;
1031
+ };
1032
+ };
1033
+ responses: {
1034
+ /** OK */
1035
+ 200: {
1036
+ content: {
1037
+ "application/json": {
1038
+ results: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataConnectionInfo"][];
1039
+ };
1040
+ };
1041
+ };
1042
+ 400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
1043
+ 401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
1044
+ 403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
1045
+ 429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
1046
+ 500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
1047
+ };
1048
+ };
1049
+ };
1050
+ }
1051
+ interface external {
1052
+ "swagger.yml": {
1053
+ paths: {};
1054
+ components: {
1055
+ schemas: {
1056
+ Error: {
1057
+ /** @description Error message(s) that occurred while processing the request */
1058
+ errorMessage?: string[] | string;
1059
+ };
1060
+ };
1061
+ responses: {
1062
+ /** Request input validation failed */
1063
+ BadRequestError: {
1064
+ content: {
1065
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1066
+ };
1067
+ };
1068
+ /** API key or token was not valid */
1069
+ UnauthorizedError: {
1070
+ content: {
1071
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1072
+ };
1073
+ };
1074
+ /** Permission was denied */
1075
+ ForbiddenError: {
1076
+ content: {
1077
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1078
+ };
1079
+ };
1080
+ /** Resource not found */
1081
+ NotFoundError: {
1082
+ content: {
1083
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
1084
+ };
1085
+ };
1086
+ /** Too many requests in allowed time period */
1087
+ RateLimitError: unknown;
1088
+ /** Execution error occurred */
1089
+ InternalServerError: unknown;
1090
+ };
1091
+ };
1092
+ operations: {};
1093
+ };
1094
+ "uniform-canvas-types.swagger.yml": {
1095
+ paths: {};
1096
+ components: {
1097
+ schemas: {
1098
+ /** @description Public ID (used in code). Do not change after creation. */
1099
+ PublicIdProperty: string;
1100
+ /** @description The definition of a component parameter */
1101
+ ComponentDefinitionParameter: {
1102
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1103
+ /** @description Friendly name of the parameter */
1104
+ name: string;
1105
+ /** @description Appears next to the parameter in the Composition editor */
1106
+ helpText?: string;
1107
+ /** @description Type name of the parameter (provided by a Uniform integration) */
1108
+ type: string;
1109
+ /** @description The configuration object for the type (type-specific) */
1110
+ typeConfig?: unknown;
1111
+ };
1112
+ /** @description The definition of a named component slot that can contain other components */
1113
+ ComponentDefinitionSlot: {
1114
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1115
+ /** @description Friendly name of the slot */
1116
+ name: string;
1117
+ /** @description A list of component definition public IDs that are allowed in this named slot */
1118
+ allowedComponents: string[];
1119
+ /**
1120
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
1121
+ * @default false
1122
+ */
1123
+ inheritAllowedComponents: boolean;
1124
+ /** @description Minimum valid number of components in this slot */
1125
+ minComponents?: number;
1126
+ /** @description Maximum valid number of components in this slot */
1127
+ maxComponents?: number;
1128
+ };
1129
+ /** @description The definition of a composition's slug settings */
1130
+ ComponentDefinitionSlugSettings: {
1131
+ /**
1132
+ * @description Whether the slug is required
1133
+ * no: slug is optional
1134
+ * yes: slug is required
1135
+ * disabled: slug is disabled and will not be shown in the editor
1136
+ *
1137
+ * @default no
1138
+ * @enum {string}
1139
+ */
1140
+ required?: "no" | "yes" | "disabled";
1141
+ /**
1142
+ * @description Slug uniqueness configuration.
1143
+ * no = no unique constraint
1144
+ * local = must be unique within this component type
1145
+ * global = must be unique across all component types
1146
+ *
1147
+ * @enum {string}
1148
+ */
1149
+ unique?: "no" | "local" | "global";
1150
+ /** @description Regular expression slugs must match */
1151
+ regularExpression?: string;
1152
+ /**
1153
+ * @description Custom error message when regular expression validation fails.
1154
+ * Has no effect if `regularExpression` is not set.
1155
+ */
1156
+ regularExpressionMessage?: string;
1157
+ };
1158
+ /** @description The definition of a component variant */
1159
+ ComponentDefinitionVariant: {
1160
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1161
+ /** @description Friendly name of the variant */
1162
+ name: string;
1163
+ };
1164
+ /** @description Permission set for a component defintion */
1165
+ ComponentDefinitionPermission: {
1166
+ roleId: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1167
+ /**
1168
+ * @description Permission type for this permission ComponentDefinition:
1169
+ * read | write | create | delete
1170
+ *
1171
+ * @enum {string}
1172
+ */
1173
+ permission: "read" | "write" | "create" | "delete";
1174
+ /** @description State of the component that this permission applies to */
1175
+ state: number;
1176
+ };
1177
+ /** @description Defines a component type that can live on a Composition */
1178
+ ComponentDefinition: {
1179
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
1180
+ /** @description Friendly name of the component definition */
1181
+ name: string;
1182
+ /**
1183
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
1184
+ * @default screen
1185
+ */
1186
+ icon?: string;
1187
+ /**
1188
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
1189
+ * The parameter type must support being used as a title parameter for this to work.
1190
+ */
1191
+ titleParameter?: string | null;
1192
+ /**
1193
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
1194
+ * @default false
1195
+ */
1196
+ canBeComposition?: boolean;
1197
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
1198
+ parameters?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
1199
+ /**
1200
+ * @description if this component uses team permissions or custom permissions
1201
+ * @default true
1202
+ */
1203
+ useTeamPermissions?: boolean;
1204
+ /** @description Custom role permissions for this component definition */
1205
+ permissions?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
1206
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
1207
+ slots?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
1208
+ slugSettings?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
1209
+ /** @description Default component instance value */
1210
+ defaults?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
1211
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
1212
+ variants?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
1213
+ /** @description Created date string for this definition (ignored for writes) */
1214
+ created?: string;
1215
+ /** @description Last modified date string for this definition (ignored for writes) */
1216
+ updated?: string;
1217
+ };
1218
+ /** @description Defines an editable parameter on a component. */
1219
+ ComponentParameter: {
1220
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
1221
+ value: unknown;
1222
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
1223
+ type: string;
1224
+ binding?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
1225
+ };
1226
+ /**
1227
+ * @deprecated
1228
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
1229
+ */
1230
+ ComponentParameterBinding: {
1231
+ /** @description A JSON Pointer expression that defines the binding directly to the parameter value */
1232
+ pointer: string;
1233
+ /**
1234
+ * @description The syntax of the binding (currently always 'jptr')
1235
+ * @enum {string}
1236
+ */
1237
+ syntax: "jptr";
1238
+ /**
1239
+ * @description Whether the binding should cause an error if it cannot be resolved.
1240
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
1241
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
1242
+ *
1243
+ * @default false
1244
+ */
1245
+ required?: boolean;
1246
+ };
1247
+ /** @description Defines the shape of a component instance served by the composition API. */
1248
+ ComponentInstance: {
1249
+ /** @description Type of the component instance (public_id of its definition) */
1250
+ type: string;
1251
+ /** @description Component parameter values for the component instance */
1252
+ parameters?: {
1253
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
1254
+ };
1255
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
1256
+ variant?: string;
1257
+ /** @description Slots containing any child components */
1258
+ slots?: {
1259
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
1260
+ };
1261
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
1262
+ _id?: string;
1263
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
1264
+ _pattern?: string;
1265
+ _data?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
1266
+ /**
1267
+ * @deprecated
1268
+ * @description Data definitions coming from a pattern resolved for this component. Merged with _data during resolution.
1269
+ * Means nothing for PUTs; it will be ignored.
1270
+ */
1271
+ _patternData?: {
1272
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
1273
+ };
1274
+ /**
1275
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
1276
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
1277
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
1278
+ * Means nothing for PUTs; it will be ignored.
1279
+ *
1280
+ * @enum {string}
1281
+ */
1282
+ _patternError?: "NOTFOUND" | "CYCLIC";
1283
+ };
1284
+ /** @description Defines the shape of the root component in a composition */
1285
+ RootComponentInstance: {
1286
+ /** @description Type of the component instance (public_id of its definition) */
1287
+ type: string;
1288
+ /** @description Component parameter values for the component instance */
1289
+ parameters?: {
1290
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
1291
+ };
1292
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
1293
+ variant?: string;
1294
+ /** @description Slots containing any child components */
1295
+ slots?: {
1296
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
1297
+ };
1298
+ /** @description The public UUID of the composition. */
1299
+ _id: string;
1300
+ /** @description Slug pattern of this component. */
1301
+ _slug?: string | null;
1302
+ /** @description Friendly name of this component. */
1303
+ _name: string;
1304
+ _data?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinitions"];
1305
+ };
1306
+ /**
1307
+ * @deprecated
1308
+ * @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.
1309
+ */
1310
+ DataConnectionInfo: {
1311
+ /** @description Public ID of the data connector */
1312
+ id: string;
1313
+ /** @description Display name of the data connector */
1314
+ displayName: string;
1315
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
1316
+ connectorType: string;
1317
+ /** @description Base resource URL of the data connector. No trailing slash. */
1318
+ baseUrl?: string;
1319
+ };
1320
+ /**
1321
+ * @deprecated
1322
+ * @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.
1323
+ */
1324
+ DataConnection: {
1325
+ /** @description Public ID of the data connection */
1326
+ id: string;
1327
+ /** @description Display name of the data connection */
1328
+ displayName: string;
1329
+ /** @description The type of data connector this connects to (e.g. 'cms-items', provided by an intalled integration) */
1330
+ connectorType: string;
1331
+ /** @description Base resource URL of the data connection. No trailing slash. */
1332
+ baseUrl: string;
1333
+ /** @description HTTP headers to pass with requests to the data connection */
1334
+ headers?: {
1335
+ [key: string]: string;
1336
+ };
1337
+ /** @description Query String parameters to pass with requests to the data connection */
1338
+ parameters?: {
1339
+ [key: string]: string;
1340
+ };
1341
+ /** @description Variables needed to make calls to the data connection */
1342
+ variables?: {
1343
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
1344
+ };
1345
+ /** @description Custom configuration specific to the data connection being defined */
1346
+ custom?: {
1347
+ [key: string]: unknown;
1348
+ };
1349
+ };
1350
+ /**
1351
+ * @deprecated
1352
+ * @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.
1353
+ */
1354
+ DataType: {
1355
+ /** @description Public ID of the data type */
1356
+ id: string;
1357
+ /** @description Display name of the data type */
1358
+ displayName: string;
1359
+ /** @description Public ID of the associated data connection */
1360
+ connectionId: string;
1361
+ /**
1362
+ * @description A connector-specific archetype for this data type; used to select UI as well as perform any
1363
+ * necessary post-processing on the response. e.g. 'cms-entry', 'cms-query'. Can be undefined if
1364
+ * no special UI or processing is required.
1365
+ */
1366
+ archetype?: string;
1367
+ /** @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. */
1368
+ path: string;
1369
+ /** @description HTTP headers to pass with requests to the data type. Merged with headers from the data connection, overriding identical keys. */
1370
+ headers?: {
1371
+ [key: string]: string;
1372
+ };
1373
+ /** @description Query String parameters to pass with requests to the data type. Merged with parameters from the data connection, overriding identical keys. */
1374
+ parameters?: {
1375
+ [key: string]: string;
1376
+ };
1377
+ /** @description Body to pass with requests to the data type (ignored unless method is POST) */
1378
+ body?: string;
1379
+ /**
1380
+ * @description HTTP method to use with requests to the data type.
1381
+ * @default GET
1382
+ * @enum {string}
1383
+ */
1384
+ method: "GET" | "POST" | "HEAD";
1385
+ /** @description Variables needed to make calls to the data type. Merged with variables from the data connection, overriding identical keys. */
1386
+ variables?: {
1387
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataVariable"];
1388
+ };
1389
+ /** @description Custom configuration specific to the data connection being defined */
1390
+ custom?: {
1391
+ [key: string]: unknown;
1392
+ };
1393
+ };
1394
+ /**
1395
+ * @deprecated
1396
+ * @description Defines the shape of a data variable on a Data Connector or Data Type
1397
+ */
1398
+ DataVariable: {
1399
+ /** @description Display name of the data variable */
1400
+ displayName?: string;
1401
+ /**
1402
+ * @description Type of the data variable
1403
+ * @default text
1404
+ */
1405
+ type: string;
1406
+ /** @description Default value of the data variable */
1407
+ default: string;
1408
+ /**
1409
+ * @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).
1410
+ * @enum {string}
1411
+ */
1412
+ setBy: "static" | "dynamic";
1413
+ };
1414
+ /**
1415
+ * @deprecated
1416
+ * @description Data definitions attached to this component. The property name is the key of the data in the data document.
1417
+ * Note: data definitions are inherited from ancestors at runtime (and may be overridden by descendants that use the same key).
1418
+ */
1419
+ CompositionDataDefinitions: {
1420
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataDefinition"];
1421
+ };
1422
+ /**
1423
+ * @deprecated
1424
+ * @description Data definition attached to this component
1425
+ */
1426
+ CompositionDataDefinition: {
1427
+ /** @description Public ID of the data type that provides this data */
1428
+ type: string;
1429
+ /** @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. */
1430
+ isPatternParameter?: boolean;
1431
+ variables?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionDataVariables"];
1432
+ };
1433
+ /**
1434
+ * @deprecated
1435
+ * @description Static variable values for this composition.
1436
+ */
1437
+ CompositionDataVariables: {
1438
+ [key: string]: string;
1439
+ };
1440
+ };
1441
+ };
1442
+ operations: {};
1443
+ };
1444
+ }
1445
+
1446
+ declare type DataTypeApi = paths$2['/api/v1/data-types'];
1447
+ declare type DataConnectionsApi = paths['/api/v1/data-connections'];
1448
+ declare type DataConnectionApi = paths$1['/api/v1/data-connection'];
1449
+ /** Query parameter options for GET /api/v1/data-types */
1450
+ declare type DataTypeGetParameters = DataTypeApi['get']['parameters']['query'];
1451
+ /** The GET response from /api/v1/data-types */
1452
+ declare type DataTypeGetResponse = DataTypeApi['get']['responses']['200']['content']['application/json'];
1453
+ /** The PUT request body for /api/v1/data-types */
1454
+ declare type DataTypePutParameters = DataTypeApi['put']['requestBody']['content']['application/json'];
1455
+ /** Shape of the DELETE request body for /api/v1/data-types */
1456
+ declare type DataTypeDeleteParameters = DataTypeApi['delete']['requestBody']['content']['application/json'];
1457
+ /** Query parameter options for GET /api/v1/data-connection */
1458
+ declare type DataConnectionGetParameters = DataConnectionApi['get']['parameters']['query'];
1459
+ /** Query parameter options for GET /api/v1/data-connections */
1460
+ declare type DataConnectionsGetParameters = DataConnectionsApi['get']['parameters']['query'];
1461
+ /** The GET response from /api/v1/data-connections */
1462
+ declare type DataConnectionGetResponse = DataConnectionApi['get']['responses']['200']['content']['application/json'];
1463
+ /** The GET response from /api/v1/data-connections */
1464
+ declare type DataConnectionsGetResponse = DataConnectionsApi['get']['responses']['200']['content']['application/json'];
1465
+ /** The PUT request body for /api/v1/data-connection */
1466
+ declare type DataConnectionPutParameters = DataConnectionApi['put']['requestBody']['content']['application/json'];
1467
+ /** Shape of the DELETE request body for /api/v1/data-connection */
1468
+ declare type DataConnectionDeleteParameters = DataConnectionApi['delete']['requestBody']['content']['application/json'];
1469
+ declare type DataType = components['schemas']['DataType'];
1470
+ declare type DataConnection = components['schemas']['DataConnection'];
1471
+ declare type DataConnectionInfo = components['schemas']['DataConnectionInfo'];
1472
+ declare type DataVariable = components['schemas']['DataVariable'];
1473
+
86
1474
  declare type ComponentLocationReference = {
87
1475
  component: ComponentInstance;
88
1476
  parentSlot?: string;
89
1477
  parentSlotIndex?: number;
90
1478
  };
91
- declare type WalkComponentTreeActions = {
1479
+ declare type WalkComponentTreeActions<TContext> = {
92
1480
  /** Replaces the component being visited with a new object */
93
1481
  replaceComponent: (replacementComponent: ComponentInstance) => void;
94
1482
  /** Removes the component being visited from the composition */
@@ -97,9 +1485,17 @@ declare type WalkComponentTreeActions = {
97
1485
  insertAfter: (components: ComponentInstance | ComponentInstance[]) => void;
98
1486
  /** Aborts visitation of components that are in child slots of the current component */
99
1487
  stopProcessingDescendants: () => void;
1488
+ /**
1489
+ * Set a new traversal context for descendants of this node.
1490
+ * If this is not called, `context` will automatically pass through.
1491
+ */
1492
+ setDescendantsContext: (context: TContext) => void;
1493
+ setChildContext: (child: ComponentInstance, context: TContext) => void;
100
1494
  };
101
1495
  /** Walks a composition's component tree, visiting each component instance depth-first, in order. */
102
- declare function walkComponentTree(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions) => void): void;
1496
+ declare function walkComponentTree<TContext = unknown>(component: ComponentInstance, visitor: (component: ComponentInstance, ancestorsAndSelf: Array<ComponentLocationReference>, actions: WalkComponentTreeActions<TContext>,
1497
+ /** Traversal context for this node */
1498
+ currentContext: TContext | undefined) => void, initialContext?: TContext): void;
103
1499
  declare function getComponentPath(ancestorsAndSelf: Array<ComponentLocationReference>): string;
104
1500
 
105
1501
  /** A single entry in a batch of queued enhancements. */
@@ -252,56 +1648,18 @@ declare function createLimitPolicy({ throttle, retry, }: {
252
1648
  }): LimitPolicy;
253
1649
  declare const nullLimitPolicy: LimitPolicy;
254
1650
 
255
- declare type CanvasClientOptions = {
256
- /** The Uniform API host to use. Internal use. */
257
- apiHost?: string;
258
- /** The Uniform API key to use when sending API requests. This or bearer token must be specified. */
259
- apiKey?: string | null;
260
- /** The Uniform bearer token to use. Internal use. */
261
- bearerToken?: string | null;
262
- /** The Uniform project ID to connect to */
263
- projectId?: string | null;
264
- /** Specify a fetch implementation to use when fetching data. Useful if you want to only polyfill selectively. */
265
- fetch?: typeof fetch;
266
- /**
267
- * Specify how to retry and throttle requests.
268
- * Default: retry 3x on failures with exponential backoff, up to 10 requests per second.
269
- * Use createLimitPolicy() to help creating a policy. */
270
- limitPolicy?: LimitPolicy;
271
- /** Specify whether CDN caching is disabled. */
272
- bypassCache?: boolean;
273
- /** @deprecated do not use */
274
- experiment14?: boolean;
275
- };
276
- declare class CanvasClientError extends Error {
277
- errorMessage: string;
278
- fetchMethod: string;
279
- fetchUri: string;
280
- statusCode?: number | undefined;
281
- statusText?: string | undefined;
282
- requestId?: string | undefined;
283
- constructor(errorMessage: string, fetchMethod: string, fetchUri: string, statusCode?: number | undefined, statusText?: string | undefined, requestId?: string | undefined);
284
- }
285
- declare class CanvasClient {
286
- private options;
287
- constructor(options: CanvasClientOptions);
288
- private get canvasUrl();
1651
+ declare class CanvasClient extends ApiClient<ClientOptions> {
1652
+ constructor(options: ClientOptions);
1653
+ private canvasUrl;
289
1654
  /** Fetches lists of Canvas compositions, optionally by type */
290
- getCompositionList(options?: Omit<CompositionGetParameters, 'projectId'>): Promise<{
1655
+ getCompositionList(options?: Omit<CompositionGetParameters, 'projectId' | 'compositionId' | 'slug'>): Promise<{
291
1656
  compositions: {
292
1657
  state: number;
1658
+ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | undefined;
293
1659
  projectId: string;
294
1660
  created: string;
295
1661
  modified: string;
296
1662
  pattern: boolean;
297
- resources?: {
298
- [key: string]: {
299
- type: string;
300
- data: {
301
- [key: string]: unknown;
302
- };
303
- };
304
- } | undefined;
305
1663
  composition: {
306
1664
  type: string;
307
1665
  parameters?: {
@@ -309,9 +1667,7 @@ declare class CanvasClient {
309
1667
  value: unknown;
310
1668
  type: string;
311
1669
  binding?: {
312
- pointer: string | {
313
- [key: string]: string;
314
- };
1670
+ pointer: string;
315
1671
  syntax: "jptr";
316
1672
  required?: boolean | undefined;
317
1673
  } | undefined;
@@ -326,9 +1682,7 @@ declare class CanvasClient {
326
1682
  value: unknown;
327
1683
  type: string;
328
1684
  binding?: {
329
- pointer: string | {
330
- [key: string]: string;
331
- };
1685
+ pointer: string;
332
1686
  syntax: "jptr";
333
1687
  required?: boolean | undefined;
334
1688
  } | undefined;
@@ -340,36 +1694,50 @@ declare class CanvasClient {
340
1694
  } | undefined;
341
1695
  _id?: string | undefined;
342
1696
  _pattern?: string | undefined;
1697
+ _data?: {
1698
+ [key: string]: {
1699
+ type: string;
1700
+ isPatternParameter?: boolean | undefined;
1701
+ variables?: {
1702
+ [key: string]: string;
1703
+ } | undefined;
1704
+ };
1705
+ } | undefined;
1706
+ _patternData?: {
1707
+ [key: string]: {
1708
+ type: string;
1709
+ isPatternParameter?: boolean | undefined;
1710
+ variables?: {
1711
+ [key: string]: string;
1712
+ } | undefined;
1713
+ };
1714
+ } | undefined;
343
1715
  _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
344
1716
  }[];
345
1717
  } | undefined;
346
1718
  _id: string;
347
1719
  _slug?: string | null | undefined;
348
1720
  _name: string;
1721
+ _data?: {
1722
+ [key: string]: {
1723
+ type: string;
1724
+ isPatternParameter?: boolean | undefined;
1725
+ variables?: {
1726
+ [key: string]: string;
1727
+ } | undefined;
1728
+ };
1729
+ } | undefined;
349
1730
  };
350
- variables?: {
351
- [key: string]: {
352
- required: boolean;
353
- default: string;
354
- };
355
- } | undefined;
356
1731
  }[];
357
1732
  }>;
358
1733
  /** Fetches a Canvas composition by string name (slug) */
359
- getCompositionBySlug(options: Pick<CompositionGetParameters, 'slug' | 'state' | 'skipEnhance' | 'skipPatternResolution' | 'withComponentIDs'>): Promise<{
1734
+ getCompositionBySlug(options: Pick<CompositionGetParameters, 'slug' | 'state' | 'skipEnhance' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus'>): Promise<{
360
1735
  state: number;
1736
+ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | undefined;
361
1737
  projectId: string;
362
1738
  created: string;
363
1739
  modified: string;
364
1740
  pattern: boolean;
365
- resources?: {
366
- [key: string]: {
367
- type: string;
368
- data: {
369
- [key: string]: unknown;
370
- };
371
- };
372
- } | undefined;
373
1741
  composition: {
374
1742
  type: string;
375
1743
  parameters?: {
@@ -377,9 +1745,7 @@ declare class CanvasClient {
377
1745
  value: unknown;
378
1746
  type: string;
379
1747
  binding?: {
380
- pointer: string | {
381
- [key: string]: string;
382
- };
1748
+ pointer: string;
383
1749
  syntax: "jptr";
384
1750
  required?: boolean | undefined;
385
1751
  } | undefined;
@@ -394,9 +1760,7 @@ declare class CanvasClient {
394
1760
  value: unknown;
395
1761
  type: string;
396
1762
  binding?: {
397
- pointer: string | {
398
- [key: string]: string;
399
- };
1763
+ pointer: string;
400
1764
  syntax: "jptr";
401
1765
  required?: boolean | undefined;
402
1766
  } | undefined;
@@ -408,35 +1772,49 @@ declare class CanvasClient {
408
1772
  } | undefined;
409
1773
  _id?: string | undefined;
410
1774
  _pattern?: string | undefined;
1775
+ _data?: {
1776
+ [key: string]: {
1777
+ type: string;
1778
+ isPatternParameter?: boolean | undefined;
1779
+ variables?: {
1780
+ [key: string]: string;
1781
+ } | undefined;
1782
+ };
1783
+ } | undefined;
1784
+ _patternData?: {
1785
+ [key: string]: {
1786
+ type: string;
1787
+ isPatternParameter?: boolean | undefined;
1788
+ variables?: {
1789
+ [key: string]: string;
1790
+ } | undefined;
1791
+ };
1792
+ } | undefined;
411
1793
  _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
412
1794
  }[];
413
1795
  } | undefined;
414
1796
  _id: string;
415
1797
  _slug?: string | null | undefined;
416
1798
  _name: string;
1799
+ _data?: {
1800
+ [key: string]: {
1801
+ type: string;
1802
+ isPatternParameter?: boolean | undefined;
1803
+ variables?: {
1804
+ [key: string]: string;
1805
+ } | undefined;
1806
+ };
1807
+ } | undefined;
417
1808
  };
418
- variables?: {
419
- [key: string]: {
420
- required: boolean;
421
- default: string;
422
- };
423
- } | undefined;
424
1809
  }>;
425
1810
  /** Fetches a Canvas composition by its public UUID */
426
- getCompositionById(options: Pick<CompositionGetParameters, 'compositionId' | 'state' | 'skipEnhance' | 'skipPatternResolution' | 'withComponentIDs'>): Promise<{
1811
+ getCompositionById(options: Pick<CompositionGetParameters, 'compositionId' | 'state' | 'skipEnhance' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus'>): Promise<{
427
1812
  state: number;
1813
+ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan" | undefined;
428
1814
  projectId: string;
429
1815
  created: string;
430
1816
  modified: string;
431
1817
  pattern: boolean;
432
- resources?: {
433
- [key: string]: {
434
- type: string;
435
- data: {
436
- [key: string]: unknown;
437
- };
438
- };
439
- } | undefined;
440
1818
  composition: {
441
1819
  type: string;
442
1820
  parameters?: {
@@ -444,9 +1822,7 @@ declare class CanvasClient {
444
1822
  value: unknown;
445
1823
  type: string;
446
1824
  binding?: {
447
- pointer: string | {
448
- [key: string]: string;
449
- };
1825
+ pointer: string;
450
1826
  syntax: "jptr";
451
1827
  required?: boolean | undefined;
452
1828
  } | undefined;
@@ -461,9 +1837,7 @@ declare class CanvasClient {
461
1837
  value: unknown;
462
1838
  type: string;
463
1839
  binding?: {
464
- pointer: string | {
465
- [key: string]: string;
466
- };
1840
+ pointer: string;
467
1841
  syntax: "jptr";
468
1842
  required?: boolean | undefined;
469
1843
  } | undefined;
@@ -475,19 +1849,40 @@ declare class CanvasClient {
475
1849
  } | undefined;
476
1850
  _id?: string | undefined;
477
1851
  _pattern?: string | undefined;
1852
+ _data?: {
1853
+ [key: string]: {
1854
+ type: string;
1855
+ isPatternParameter?: boolean | undefined;
1856
+ variables?: {
1857
+ [key: string]: string;
1858
+ } | undefined;
1859
+ };
1860
+ } | undefined;
1861
+ _patternData?: {
1862
+ [key: string]: {
1863
+ type: string;
1864
+ isPatternParameter?: boolean | undefined;
1865
+ variables?: {
1866
+ [key: string]: string;
1867
+ } | undefined;
1868
+ };
1869
+ } | undefined;
478
1870
  _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
479
1871
  }[];
480
1872
  } | undefined;
481
1873
  _id: string;
482
1874
  _slug?: string | null | undefined;
483
1875
  _name: string;
1876
+ _data?: {
1877
+ [key: string]: {
1878
+ type: string;
1879
+ isPatternParameter?: boolean | undefined;
1880
+ variables?: {
1881
+ [key: string]: string;
1882
+ } | undefined;
1883
+ };
1884
+ } | undefined;
484
1885
  };
485
- variables?: {
486
- [key: string]: {
487
- required: boolean;
488
- default: string;
489
- };
490
- } | undefined;
491
1886
  }>;
492
1887
  /** Updates or creates a Canvas component definition */
493
1888
  updateComposition(body: Omit<CompositionPutParameters, 'projectId'>): Promise<void>;
@@ -511,7 +1906,7 @@ declare class CanvasClient {
511
1906
  useTeamPermissions?: boolean | undefined;
512
1907
  permissions?: {
513
1908
  roleId: string;
514
- permission: "read" | "write" | "delete";
1909
+ permission: "read" | "write" | "create" | "delete";
515
1910
  state: number;
516
1911
  }[] | undefined;
517
1912
  slots?: {
@@ -524,7 +1919,7 @@ declare class CanvasClient {
524
1919
  }[] | undefined;
525
1920
  slugSettings?: {
526
1921
  required?: "no" | "yes" | "disabled" | undefined;
527
- unique?: "no" | "local" | "global" | undefined;
1922
+ unique?: "global" | "no" | "local" | undefined;
528
1923
  regularExpression?: string | undefined;
529
1924
  regularExpressionMessage?: string | undefined;
530
1925
  } | undefined;
@@ -535,9 +1930,7 @@ declare class CanvasClient {
535
1930
  value: unknown;
536
1931
  type: string;
537
1932
  binding?: {
538
- pointer: string | {
539
- [key: string]: string;
540
- };
1933
+ pointer: string;
541
1934
  syntax: "jptr";
542
1935
  required?: boolean | undefined;
543
1936
  } | undefined;
@@ -549,6 +1942,24 @@ declare class CanvasClient {
549
1942
  } | undefined;
550
1943
  _id?: string | undefined;
551
1944
  _pattern?: string | undefined;
1945
+ _data?: {
1946
+ [key: string]: {
1947
+ type: string;
1948
+ isPatternParameter?: boolean | undefined;
1949
+ variables?: {
1950
+ [key: string]: string;
1951
+ } | undefined;
1952
+ };
1953
+ } | undefined;
1954
+ _patternData?: {
1955
+ [key: string]: {
1956
+ type: string;
1957
+ isPatternParameter?: boolean | undefined;
1958
+ variables?: {
1959
+ [key: string]: string;
1960
+ } | undefined;
1961
+ };
1962
+ } | undefined;
552
1963
  _patternError?: "NOTFOUND" | "CYCLIC" | undefined;
553
1964
  } | null | undefined;
554
1965
  variants?: {
@@ -563,12 +1974,69 @@ declare class CanvasClient {
563
1974
  updateComponentDefinition(body: Omit<ComponentDefinitionPutParameters, 'projectId'>): Promise<void>;
564
1975
  /** Deletes a Canvas component definition */
565
1976
  removeComponentDefinition(body: Omit<ComponentDefinitionDeleteParameters, 'projectId'>): Promise<void>;
566
- private apiClient;
567
- private createUrl;
568
- private static getRequestId;
569
1977
  }
570
1978
  declare class UncachedCanvasClient extends CanvasClient {
571
- constructor(options: Omit<CanvasClientOptions, 'bypassCache'>);
1979
+ constructor(options: Omit<ClientOptions, 'bypassCache'>);
1980
+ }
1981
+
1982
+ /**
1983
+ * @deprecated
1984
+ */
1985
+ declare class CanvasDataConnectionClient extends ApiClient {
1986
+ constructor(options: ClientOptions);
1987
+ /** Fetches all DataConnections for a project */
1988
+ get(options?: ExceptProject<DataConnectionGetParameters>): Promise<{
1989
+ result: {
1990
+ id: string;
1991
+ displayName: string;
1992
+ connectorType: string;
1993
+ baseUrl: string;
1994
+ headers?: {
1995
+ [key: string]: string;
1996
+ } | undefined;
1997
+ parameters?: {
1998
+ [key: string]: string;
1999
+ } | undefined;
2000
+ variables?: {
2001
+ [key: string]: {
2002
+ displayName?: string | undefined;
2003
+ type: string;
2004
+ default: string;
2005
+ setBy: "static" | "dynamic";
2006
+ };
2007
+ } | undefined;
2008
+ custom?: {
2009
+ [key: string]: unknown;
2010
+ } | undefined;
2011
+ };
2012
+ }>;
2013
+ /** Fetches all DataConnections for a project */
2014
+ getList(options?: ExceptProject<DataConnectionsGetParameters>): Promise<{
2015
+ results: {
2016
+ id: string;
2017
+ displayName: string;
2018
+ connectorType: string;
2019
+ baseUrl?: string | undefined;
2020
+ }[];
2021
+ }>;
2022
+ /** Updates or creates (based on id) a DataConnection */
2023
+ upsert(body: ExceptProject<DataConnectionPutParameters>): Promise<void>;
2024
+ /** Deletes a DataConnection */
2025
+ remove(body: ExceptProject<DataConnectionDeleteParameters>): Promise<void>;
2026
+ }
2027
+
2028
+ /**
2029
+ * @deprecated
2030
+ */
2031
+ declare class CanvasDataTypeClient extends ApiClient {
2032
+ #private;
2033
+ constructor(options: ClientOptions);
2034
+ /** Fetches all DataTypes for a project */
2035
+ get(options?: ExceptProject<DataTypeGetParameters>): Promise<DataTypeGetResponse>;
2036
+ /** Updates or creates (based on id) a DataType */
2037
+ upsert(body: ExceptProject<DataTypePutParameters>): Promise<void>;
2038
+ /** Deletes a DataType */
2039
+ remove(body: ExceptProject<DataTypeDeleteParameters>): Promise<void>;
572
2040
  }
573
2041
 
574
2042
  /** Public ID of Canvas personalization component type */
@@ -597,6 +2065,8 @@ declare const CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
597
2065
  declare const CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
598
2066
  /** Public ID of the Uniform Context enrichment tag parameter on Canvas components */
599
2067
  declare const CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
2068
+ /** The name of the query string used to detect if we are in in-context editing mode */
2069
+ declare const IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
600
2070
 
601
2071
  /** Determines if a given Canvas component type is a system-defined type */
602
2072
  declare const isSystemComponentDefinition: (componentType: string) => boolean;
@@ -613,6 +2083,11 @@ declare function mapSlotToPersonalizedVariations(slot: ComponentInstance[] | und
613
2083
  */
614
2084
  declare function mapSlotToTestVariations(slot: ComponentInstance[] | undefined): Array<ComponentInstance & TestVariant>;
615
2085
 
2086
+ declare const generateHash: ({ composition, secret, }: {
2087
+ composition: RootComponentInstance;
2088
+ secret: string | undefined;
2089
+ }) => number | undefined;
2090
+
616
2091
  declare function getChannelName(projectId: string, compositionId: string, state: number): string;
617
2092
 
618
2093
  declare type EventNames = 'updated';
@@ -640,4 +2115,126 @@ declare function localize({ composition, locale, }: {
640
2115
  }) => string | undefined);
641
2116
  }): void;
642
2117
 
643
- export { BatchEnhancer, BatchEntry, CANVAS_DRAFT_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasClientOptions, ChildEnhancerBuilder, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentLocationReference, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, EnhancerBuilder, EnhancerContext, EnhancerError, EventNames, LimitPolicy, SubscribeToCompositionOptions, UncachedCanvasClient, UniqueBatchEntries, UnsubscribeCallback, WalkComponentTreeActions, compose, createBatchEnhancer, createLimitPolicy, enhance, extractLocales, getChannelName, getComponentPath, isSystemComponentDefinition, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, subscribeToComposition, walkComponentTree };
2118
+ declare type SelectComponentMessage = {
2119
+ type: 'select-component';
2120
+ id: string;
2121
+ };
2122
+ declare type ReadyMessage = {
2123
+ type: 'ready';
2124
+ };
2125
+ declare type UpdateCompositionMessage = {
2126
+ type: 'update-composition';
2127
+ composition: RootComponentInstance;
2128
+ hash: number | undefined;
2129
+ };
2130
+ declare type AddComponentMessage = {
2131
+ type: 'add-component';
2132
+ componentId: string;
2133
+ slotName: string;
2134
+ index: number;
2135
+ };
2136
+ declare type MoveComponentMessage = {
2137
+ type: 'move-component';
2138
+ componentId: string;
2139
+ slotName: string;
2140
+ index: number;
2141
+ };
2142
+ declare const isSelectComponentMessage: (message: ChannelMessage) => message is SelectComponentMessage;
2143
+ declare const isReadyMessage: (message: ChannelMessage) => message is ReadyMessage;
2144
+ declare const isUpdateCompositionMessage: (message: ChannelMessage) => message is UpdateCompositionMessage;
2145
+ declare const isAddComponentMessage: (message: ChannelMessage) => message is AddComponentMessage;
2146
+ declare const isMovingComponentMessage: (message: ChannelMessage) => message is MoveComponentMessage;
2147
+ declare type ChannelMessage = SelectComponentMessage | ReadyMessage | UpdateCompositionMessage | AddComponentMessage | MoveComponentMessage;
2148
+ declare type MessageHandler = (message: ChannelMessage, originalEvent: MessageEvent) => void;
2149
+ declare type Channel = {
2150
+ ready: () => void;
2151
+ destroy: () => void;
2152
+ selectComponent: (id: string) => void;
2153
+ updateComposition: (component: RootComponentInstance, secret?: string) => void;
2154
+ on: (types: ChannelMessage['type'][] | ChannelMessage['type'], handler: MessageHandler) => () => void;
2155
+ addComponent: (options: {
2156
+ componentId: string;
2157
+ slotName: string;
2158
+ index: number;
2159
+ }) => void;
2160
+ moveComponent: (options: {
2161
+ componentId: string;
2162
+ slotName: string;
2163
+ index: number;
2164
+ }) => void;
2165
+ };
2166
+ declare const createCanvasChannel: ({ listenTo, broadcastTo, }: {
2167
+ listenTo: Window[];
2168
+ broadcastTo: Window[];
2169
+ }) => Channel;
2170
+
2171
+ declare type CompositionIssue = CompositionPatternIssue | CompositionDataIssue | CompositionBindingIssue;
2172
+ declare type CompositionIssueCore = {
2173
+ componentPath: string;
2174
+ componentType: string;
2175
+ message: string;
2176
+ };
2177
+ declare type CompositionPatternIssue = CompositionIssueCore & {
2178
+ type: 'pattern';
2179
+ code: NonNullable<ComponentInstance['_patternError']>;
2180
+ };
2181
+ declare type CompositionBindingIssue = CompositionIssueCore & {
2182
+ type: 'binding';
2183
+ parameterName: string;
2184
+ };
2185
+ declare type CompositionDataIssue = CompositionIssueCore & {
2186
+ type: 'data';
2187
+ dataName: string;
2188
+ dataType: string;
2189
+ };
2190
+ declare type CompositionDataDiagnostic = {
2191
+ componentPath: string;
2192
+ dataType: string;
2193
+ dataName: string;
2194
+ performance: number;
2195
+ data: unknown;
2196
+ };
2197
+ declare type CommonCompositionGetParameters = Pick<CompositionGetParameters, 'state' | 'skipPatternResolution' | 'withComponentIDs' | 'withUIStatus'> & {
2198
+ /**
2199
+ * Adds additional diagnostics (`dataDiagnostics`) to the response containing timings and resolved datas for the composition.
2200
+ * Because this adds a lot of data to the response, we do not recommend using this unless diagnosing performance issues.
2201
+ */
2202
+ dataDiagnostics?: boolean;
2203
+ /**
2204
+ * Pass dynamic variables to the composition that are required for resolving bindings and datas,
2205
+ * such as language, detail page ID, etc.
2206
+ */
2207
+ dynamicVariables?: Record<string, string>;
2208
+ };
2209
+ /** @deprecated do not use */
2210
+ declare type EdgeCompositionGetResponse = CompositionGetResponse & {
2211
+ /**
2212
+ * Copies of resolved data and how long it took to resolve each data.
2213
+ * Only set when dataDiagnostics=true is passed to the options.
2214
+ */
2215
+ dataDiagnostics?: Array<CompositionDataDiagnostic>;
2216
+ /**
2217
+ * Any failures to bind to data that occured on bindings marked 'must exist'.
2218
+ * If no failures occurred, this will be undefined.
2219
+ * NOTE: No exception will be thrown if this type of error occurs. You must inspect this property if you care to cause client errors.
2220
+ */
2221
+ errors?: Array<CompositionIssue>;
2222
+ /**
2223
+ * Any failures to bind to data that occurred on optional bindings. In most cases, these are only informational (i.e. data is bound to a property that does not always exist)
2224
+ * If no failures occurred, this will be undefined.
2225
+ */
2226
+ warnings?: Array<CompositionIssue>;
2227
+ };
2228
+ /** @deprecated do not use */
2229
+ declare class EdgeCanvasClient extends ApiClient<ClientOptions> {
2230
+ constructor(options: ClientOptions);
2231
+ private canvasUrl;
2232
+ /** Fetches a Canvas composition by string name (slug) */
2233
+ getCompositionBySlug(options: Pick<CompositionGetParameters, 'slug'> & CommonCompositionGetParameters): Promise<EdgeCompositionGetResponse>;
2234
+ /** Fetches a Canvas composition by its public UUID */
2235
+ getCompositionById(options: Pick<CompositionGetParameters, 'compositionId'> & CommonCompositionGetParameters): Promise<EdgeCompositionGetResponse>;
2236
+ }
2237
+
2238
+ declare const CanvasClientError: typeof ApiClientError;
2239
+
2240
+ export { AddComponentMessage, BatchEnhancer, BatchEntry, CANVAS_DRAFT_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDataConnectionClient, CanvasDataTypeClient, Channel, ChannelMessage, ChildEnhancerBuilder, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentLocationReference, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionBindingIssue, CompositionDataDiagnostic, CompositionDataIssue, CompositionIssue, CompositionPatternIssue, DataConnection, DataConnectionDeleteParameters, DataConnectionGetParameters, DataConnectionGetResponse, DataConnectionInfo, DataConnectionPutParameters, DataConnectionsGetParameters, DataConnectionsGetResponse, DataType, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariable, EdgeCanvasClient, EdgeCompositionGetResponse, EnhancerBuilder, EnhancerContext, EnhancerError, EventNames, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, LimitPolicy, MessageHandler, MoveComponentMessage, ReadyMessage, SelectComponentMessage, SubscribeToCompositionOptions, UncachedCanvasClient, UniqueBatchEntries, UnsubscribeCallback, UpdateCompositionMessage, WalkComponentTreeActions, compose, createBatchEnhancer, createCanvasChannel, createLimitPolicy, enhance, extractLocales, generateHash, getChannelName, getComponentPath, isAddComponentMessage, isMovingComponentMessage, isReadyMessage, isSelectComponentMessage, isSystemComponentDefinition, isUpdateCompositionMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, subscribeToComposition, walkComponentTree };