@wix/autocms-collection-metadata-service 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,709 @@
1
+ /** CollectionMetadata contains CM-specific metadata for a collection */
2
+ interface CollectionMetadata {
3
+ /** ID of data collection */
4
+ dataCollectionId?: string;
5
+ /** active named view */
6
+ activeNamedViewId?: string | null;
7
+ /** if table view should be hidden */
8
+ hideTableView?: boolean | null;
9
+ /** named views */
10
+ namedViews?: Record<string, any>[] | null;
11
+ /** named view ID used for default site sort in datasets */
12
+ namedViewIdForSiteSort?: string | null;
13
+ /** Type of data permissions template used initially */
14
+ permissionsTemplate?: PermissionsTemplateType;
15
+ }
16
+ declare enum PermissionsTemplateType {
17
+ UNDEFINED = "UNDEFINED",
18
+ SHOW_CONTENT = "SHOW_CONTENT",
19
+ COLLECT_CONTENT = "COLLECT_CONTENT",
20
+ CUSTOM = "CUSTOM"
21
+ }
22
+ interface CreateCollectionMetadataRequest {
23
+ /** CollectionMetadata to be created */
24
+ collectionMetadata: CollectionMetadata;
25
+ }
26
+ interface CreateCollectionMetadataResponse {
27
+ /** The created CollectionMetadata */
28
+ collectionMetadata?: CollectionMetadata;
29
+ }
30
+ interface GetCollectionMetadataRequest {
31
+ /** Id of collection to retrieve metadata for */
32
+ dataCollectionId?: string;
33
+ }
34
+ interface GetCollectionMetadataResponse {
35
+ /** The retrieved CollectionMetadata */
36
+ collectionMetadata?: CollectionMetadata;
37
+ }
38
+ interface UpdateCollectionMetadataRequest {
39
+ /**
40
+ * ID of metadata to update, ignored if collection_metadata.data_collection_id is non-empty
41
+ * exists because of docs generation issue with nested fields and ** path variables
42
+ */
43
+ dataCollectionId?: string;
44
+ /** CollectionMetadata to be updated, may be partial */
45
+ collectionMetadata: CollectionMetadata;
46
+ }
47
+ interface UpdateCollectionMetadataResponse {
48
+ /** The updated CollectionMetadata */
49
+ collectionMetadata?: CollectionMetadata;
50
+ }
51
+ interface ReplaceCollectionMetadataRequest {
52
+ /** The updated CollectionMetadatas */
53
+ items?: CollectionMetadata[];
54
+ }
55
+ interface ReplaceCollectionMetadataResponse {
56
+ }
57
+ interface DeleteCollectionMetadataRequest {
58
+ /** Id of collection to delete metadata for */
59
+ dataCollectionId?: string;
60
+ }
61
+ interface DeleteCollectionMetadataResponse {
62
+ }
63
+ interface ListCollectionMetadataRequest {
64
+ /** paging info */
65
+ paging?: CursorPaging;
66
+ }
67
+ interface CursorPaging {
68
+ /** Maximum number of items to return in the results. */
69
+ limit?: number | null;
70
+ /**
71
+ * Pointer to the next or previous page in the list of results.
72
+ *
73
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
74
+ * Not relevant for the first request.
75
+ */
76
+ cursor?: string | null;
77
+ }
78
+ interface ListCollectionMetadataResponse {
79
+ /** The retrieved CollectionMetadatas */
80
+ items?: CollectionMetadata[];
81
+ /** paging metadata */
82
+ pagingMetadata?: CursorPagingMetadata;
83
+ }
84
+ interface CursorPagingMetadata {
85
+ /** Number of items returned in the response. */
86
+ count?: number | null;
87
+ /** Cursor strings that point to the next page, previous page, or both. */
88
+ cursors?: Cursors;
89
+ /**
90
+ * Whether there are more pages to retrieve following the current page.
91
+ *
92
+ * + `true`: Another page of results can be retrieved.
93
+ * + `false`: This is the last page.
94
+ */
95
+ hasNext?: boolean | null;
96
+ }
97
+ interface Cursors {
98
+ /** Cursor string pointing to the next page in the list of results. */
99
+ next?: string | null;
100
+ /** Cursor pointing to the previous page in the list of results. */
101
+ prev?: string | null;
102
+ }
103
+ interface DomainEvent extends DomainEventBodyOneOf {
104
+ createdEvent?: EntityCreatedEvent;
105
+ updatedEvent?: EntityUpdatedEvent;
106
+ deletedEvent?: EntityDeletedEvent;
107
+ actionEvent?: ActionEvent;
108
+ /**
109
+ * Unique event ID.
110
+ * Allows clients to ignore duplicate webhooks.
111
+ */
112
+ _id?: string;
113
+ /**
114
+ * Assumes actions are also always typed to an entity_type
115
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
116
+ */
117
+ entityFqdn?: string;
118
+ /**
119
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
120
+ * This is although the created/updated/deleted notion is duplication of the oneof types
121
+ * Example: created/updated/deleted/started/completed/email_opened
122
+ */
123
+ slug?: string;
124
+ /** ID of the entity associated with the event. */
125
+ entityId?: string;
126
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
127
+ eventTime?: Date;
128
+ /**
129
+ * Whether the event was triggered as a result of a privacy regulation application
130
+ * (for example, GDPR).
131
+ */
132
+ triggeredByAnonymizeRequest?: boolean | null;
133
+ /** If present, indicates the action that triggered the event. */
134
+ originatedFrom?: string | null;
135
+ /**
136
+ * A sequence number defining the order of updates to the underlying entity.
137
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
138
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
139
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
140
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
141
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
142
+ */
143
+ entityEventSequence?: string | null;
144
+ }
145
+ /** @oneof */
146
+ interface DomainEventBodyOneOf {
147
+ createdEvent?: EntityCreatedEvent;
148
+ updatedEvent?: EntityUpdatedEvent;
149
+ deletedEvent?: EntityDeletedEvent;
150
+ actionEvent?: ActionEvent;
151
+ }
152
+ interface EntityCreatedEvent {
153
+ entity?: string;
154
+ }
155
+ interface RestoreInfo {
156
+ deletedDate?: Date;
157
+ }
158
+ interface EntityUpdatedEvent {
159
+ /**
160
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
161
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
162
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
163
+ */
164
+ currentEntity?: string;
165
+ }
166
+ interface EntityDeletedEvent {
167
+ /** Entity that was deleted */
168
+ deletedEntity?: string | null;
169
+ }
170
+ interface ActionEvent {
171
+ body?: string;
172
+ }
173
+ interface Empty {
174
+ }
175
+ interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
176
+ /** Emitted on a meta site creation. */
177
+ siteCreated?: SiteCreated;
178
+ /** Emitted on a meta site transfer completion. */
179
+ siteTransferred?: SiteTransferred;
180
+ /** Emitted on a meta site deletion. */
181
+ siteDeleted?: SiteDeleted;
182
+ /** Emitted on a meta site restoration. */
183
+ siteUndeleted?: SiteUndeleted;
184
+ /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
185
+ sitePublished?: SitePublished;
186
+ /** Emitted on a meta site unpublish. */
187
+ siteUnpublished?: SiteUnpublished;
188
+ /** Emitted when meta site is marked as template. */
189
+ siteMarkedAsTemplate?: SiteMarkedAsTemplate;
190
+ /** Emitted when meta site is marked as a WixSite. */
191
+ siteMarkedAsWixSite?: SiteMarkedAsWixSite;
192
+ /** Emitted when an application is provisioned (installed). */
193
+ serviceProvisioned?: ServiceProvisioned;
194
+ /** Emitted when an application is removed (uninstalled). */
195
+ serviceRemoved?: ServiceRemoved;
196
+ /** Emitted when meta site name (URL slug) is changed. */
197
+ siteRenamedPayload?: SiteRenamed;
198
+ /** Emitted when meta site was permanently deleted. */
199
+ hardDeleted?: SiteHardDeleted;
200
+ /** Emitted on a namespace change. */
201
+ namespaceChanged?: NamespaceChanged;
202
+ /** Emitted when Studio is attached. */
203
+ studioAssigned?: StudioAssigned;
204
+ /** Emitted when Studio is detached. */
205
+ studioUnassigned?: StudioUnassigned;
206
+ /** A meta site id. */
207
+ metaSiteId?: string;
208
+ /** A meta site version. Monotonically increasing. */
209
+ version?: string;
210
+ /** A timestamp of the event. */
211
+ timestamp?: string;
212
+ /** A list of "assets" (applications). The same as MetaSiteContext. */
213
+ assets?: Asset[];
214
+ }
215
+ /** @oneof */
216
+ interface MetaSiteSpecialEventPayloadOneOf {
217
+ /** Emitted on a meta site creation. */
218
+ siteCreated?: SiteCreated;
219
+ /** Emitted on a meta site transfer completion. */
220
+ siteTransferred?: SiteTransferred;
221
+ /** Emitted on a meta site deletion. */
222
+ siteDeleted?: SiteDeleted;
223
+ /** Emitted on a meta site restoration. */
224
+ siteUndeleted?: SiteUndeleted;
225
+ /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
226
+ sitePublished?: SitePublished;
227
+ /** Emitted on a meta site unpublish. */
228
+ siteUnpublished?: SiteUnpublished;
229
+ /** Emitted when meta site is marked as template. */
230
+ siteMarkedAsTemplate?: SiteMarkedAsTemplate;
231
+ /** Emitted when meta site is marked as a WixSite. */
232
+ siteMarkedAsWixSite?: SiteMarkedAsWixSite;
233
+ /** Emitted when an application is provisioned (installed). */
234
+ serviceProvisioned?: ServiceProvisioned;
235
+ /** Emitted when an application is removed (uninstalled). */
236
+ serviceRemoved?: ServiceRemoved;
237
+ /** Emitted when meta site name (URL slug) is changed. */
238
+ siteRenamedPayload?: SiteRenamed;
239
+ /** Emitted when meta site was permanently deleted. */
240
+ hardDeleted?: SiteHardDeleted;
241
+ /** Emitted on a namespace change. */
242
+ namespaceChanged?: NamespaceChanged;
243
+ /** Emitted when Studio is attached. */
244
+ studioAssigned?: StudioAssigned;
245
+ /** Emitted when Studio is detached. */
246
+ studioUnassigned?: StudioUnassigned;
247
+ }
248
+ interface Asset {
249
+ /** An application definition id (app_id in dev-center). For legacy reasons may be UUID or a string (from Java Enum). */
250
+ appDefId?: string;
251
+ /** An instance id. For legacy reasons may be UUID or a string. */
252
+ instanceId?: string;
253
+ /** An application state. */
254
+ state?: State;
255
+ }
256
+ declare enum State {
257
+ UNKNOWN = "UNKNOWN",
258
+ ENABLED = "ENABLED",
259
+ DISABLED = "DISABLED",
260
+ PENDING = "PENDING",
261
+ DEMO = "DEMO"
262
+ }
263
+ interface SiteCreated {
264
+ /** A template identifier (empty if not created from a template). */
265
+ originTemplateId?: string;
266
+ /** An account id of the owner. */
267
+ ownerId?: string;
268
+ /** A context in which meta site was created. */
269
+ context?: SiteCreatedContext;
270
+ /**
271
+ * A meta site id from which this site was created.
272
+ *
273
+ * In case of a creation from a template it's a template id.
274
+ * In case of a site duplication ("Save As" in dashboard or duplicate in UM) it's an id of a source site.
275
+ */
276
+ originMetaSiteId?: string | null;
277
+ /** A meta site name (URL slug). */
278
+ siteName?: string;
279
+ /** A namespace. */
280
+ namespace?: Namespace;
281
+ }
282
+ declare enum SiteCreatedContext {
283
+ /** A valid option, we don't expose all reasons why site might be created. */
284
+ OTHER = "OTHER",
285
+ /** A meta site was created from template. */
286
+ FROM_TEMPLATE = "FROM_TEMPLATE",
287
+ /** A meta site was created by copying of the transfferred meta site. */
288
+ DUPLICATE_BY_SITE_TRANSFER = "DUPLICATE_BY_SITE_TRANSFER",
289
+ /** A copy of existing meta site. */
290
+ DUPLICATE = "DUPLICATE",
291
+ /** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
292
+ OLD_SITE_TRANSFER = "OLD_SITE_TRANSFER",
293
+ /** deprecated A meta site was created for Flash editor. */
294
+ FLASH = "FLASH"
295
+ }
296
+ declare enum Namespace {
297
+ UNKNOWN_NAMESPACE = "UNKNOWN_NAMESPACE",
298
+ /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
299
+ WIX = "WIX",
300
+ /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
301
+ SHOUT_OUT = "SHOUT_OUT",
302
+ /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
303
+ ALBUMS = "ALBUMS",
304
+ /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
305
+ WIX_STORES_TEST_DRIVE = "WIX_STORES_TEST_DRIVE",
306
+ /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
307
+ HOTELS = "HOTELS",
308
+ /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
309
+ CLUBS = "CLUBS",
310
+ /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
311
+ ONBOARDING_DRAFT = "ONBOARDING_DRAFT",
312
+ /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
313
+ DEV_SITE = "DEV_SITE",
314
+ /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
315
+ LOGOS = "LOGOS",
316
+ /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
317
+ VIDEO_MAKER = "VIDEO_MAKER",
318
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
319
+ PARTNER_DASHBOARD = "PARTNER_DASHBOARD",
320
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
321
+ DEV_CENTER_COMPANY = "DEV_CENTER_COMPANY",
322
+ /**
323
+ * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
324
+ *
325
+ * Meta site with this namespace will *not* be shown in a user's site list by default.
326
+ */
327
+ HTML_DRAFT = "HTML_DRAFT",
328
+ /**
329
+ * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
330
+ * Will be accessible from Site List and will not have a website app.
331
+ * Once the user attaches a site, the site will become a regular wixsite.
332
+ */
333
+ SITELESS_BUSINESS = "SITELESS_BUSINESS",
334
+ /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
335
+ CREATOR_ECONOMY = "CREATOR_ECONOMY",
336
+ /** It is to be used in the Business First efforts. */
337
+ DASHBOARD_FIRST = "DASHBOARD_FIRST",
338
+ /** Bookings business flow with no site. */
339
+ ANYWHERE = "ANYWHERE",
340
+ /** Namespace for Headless Backoffice with no editor */
341
+ HEADLESS = "HEADLESS",
342
+ /**
343
+ * Namespace for master site that will exist in parent account that will be referenced by subaccounts
344
+ * The site will be used for account level CSM feature for enterprise
345
+ */
346
+ ACCOUNT_MASTER_CMS = "ACCOUNT_MASTER_CMS",
347
+ /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
348
+ RISE = "RISE",
349
+ /**
350
+ * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
351
+ * There's a blank site behind the scene but it's blank).
352
+ * The Mobile company will be the owner of this namespace.
353
+ */
354
+ BRANDED_FIRST = "BRANDED_FIRST",
355
+ /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
356
+ NOWNIA = "NOWNIA"
357
+ }
358
+ /** Site transferred to another user. */
359
+ interface SiteTransferred {
360
+ /** A previous owner id (user that transfers meta site). */
361
+ oldOwnerId?: string;
362
+ /** A new owner id (user that accepts meta site). */
363
+ newOwnerId?: string;
364
+ }
365
+ /** Soft deletion of the meta site. Could be restored. */
366
+ interface SiteDeleted {
367
+ /** A deletion context. */
368
+ deleteContext?: DeleteContext;
369
+ }
370
+ interface DeleteContext {
371
+ /** When the meta site was deleted. */
372
+ dateDeleted?: Date;
373
+ /** A status. */
374
+ deleteStatus?: DeleteStatus;
375
+ /** A reason (flow). */
376
+ deleteOrigin?: string;
377
+ /** A service that deleted it. */
378
+ initiatorId?: string | null;
379
+ }
380
+ declare enum DeleteStatus {
381
+ UNKNOWN = "UNKNOWN",
382
+ TRASH = "TRASH",
383
+ DELETED = "DELETED",
384
+ PENDING_PURGE = "PENDING_PURGE"
385
+ }
386
+ /** Restoration of the meta site. */
387
+ interface SiteUndeleted {
388
+ }
389
+ /** First publish of a meta site. Or subsequent publish after unpublish. */
390
+ interface SitePublished {
391
+ }
392
+ interface SiteUnpublished {
393
+ /** A list of URLs previously associated with the meta site. */
394
+ urls?: string[];
395
+ }
396
+ interface SiteMarkedAsTemplate {
397
+ }
398
+ interface SiteMarkedAsWixSite {
399
+ }
400
+ interface ServiceProvisioned {
401
+ /** Either UUID or EmbeddedServiceType. */
402
+ appDefId?: string;
403
+ /** Not only UUID. Something here could be something weird. */
404
+ instanceId?: string;
405
+ /** An instance id from which this instance is originated. */
406
+ originInstanceId?: string;
407
+ /** A version. */
408
+ version?: string | null;
409
+ }
410
+ interface ServiceRemoved {
411
+ /** Either UUID or EmbeddedServiceType. */
412
+ appDefId?: string;
413
+ /** Not only UUID. Something here could be something weird. */
414
+ instanceId?: string;
415
+ /** A version. */
416
+ version?: string | null;
417
+ }
418
+ /** Rename of the site. Meaning, free public url has been changed as well. */
419
+ interface SiteRenamed {
420
+ /** A new meta site name (URL slug). */
421
+ newSiteName?: string;
422
+ /** A previous meta site name (URL slug). */
423
+ oldSiteName?: string;
424
+ }
425
+ /**
426
+ * Hard deletion of the meta site.
427
+ *
428
+ * Could not be restored. Therefore it's desirable to cleanup data.
429
+ */
430
+ interface SiteHardDeleted {
431
+ /** A deletion context. */
432
+ deleteContext?: DeleteContext;
433
+ }
434
+ interface NamespaceChanged {
435
+ /** A previous namespace. */
436
+ oldNamespace?: Namespace;
437
+ /** A new namespace. */
438
+ newNamespace?: Namespace;
439
+ }
440
+ /** Assigned Studio editor */
441
+ interface StudioAssigned {
442
+ }
443
+ /** Unassigned Studio editor */
444
+ interface StudioUnassigned {
445
+ }
446
+ interface MessageEnvelope {
447
+ /** App instance ID. */
448
+ instanceId?: string | null;
449
+ /** Event type. */
450
+ eventType?: string;
451
+ /** The identification type and identity data. */
452
+ identity?: IdentificationData;
453
+ /** Stringify payload. */
454
+ data?: string;
455
+ }
456
+ interface IdentificationData extends IdentificationDataIdOneOf {
457
+ /** ID of a site visitor that has not logged in to the site. */
458
+ anonymousVisitorId?: string;
459
+ /** ID of a site visitor that has logged in to the site. */
460
+ memberId?: string;
461
+ /** ID of a Wix user (site owner, contributor, etc.). */
462
+ wixUserId?: string;
463
+ /** ID of an app. */
464
+ appId?: string;
465
+ /** @readonly */
466
+ identityType?: WebhookIdentityType;
467
+ }
468
+ /** @oneof */
469
+ interface IdentificationDataIdOneOf {
470
+ /** ID of a site visitor that has not logged in to the site. */
471
+ anonymousVisitorId?: string;
472
+ /** ID of a site visitor that has logged in to the site. */
473
+ memberId?: string;
474
+ /** ID of a Wix user (site owner, contributor, etc.). */
475
+ wixUserId?: string;
476
+ /** ID of an app. */
477
+ appId?: string;
478
+ }
479
+ declare enum WebhookIdentityType {
480
+ UNKNOWN = "UNKNOWN",
481
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
482
+ MEMBER = "MEMBER",
483
+ WIX_USER = "WIX_USER",
484
+ APP = "APP"
485
+ }
486
+ interface CollectionMetadataNonNullableFields {
487
+ dataCollectionId: string;
488
+ permissionsTemplate: PermissionsTemplateType;
489
+ }
490
+ interface CreateCollectionMetadataResponseNonNullableFields {
491
+ collectionMetadata?: CollectionMetadataNonNullableFields;
492
+ }
493
+ interface GetCollectionMetadataResponseNonNullableFields {
494
+ collectionMetadata?: CollectionMetadataNonNullableFields;
495
+ }
496
+ interface UpdateCollectionMetadataResponseNonNullableFields {
497
+ collectionMetadata?: CollectionMetadataNonNullableFields;
498
+ }
499
+ interface ListCollectionMetadataResponseNonNullableFields {
500
+ items: CollectionMetadataNonNullableFields[];
501
+ }
502
+ interface BaseEventMetadata {
503
+ /** App instance ID. */
504
+ instanceId?: string | null;
505
+ /** Event type. */
506
+ eventType?: string;
507
+ /** The identification type and identity data. */
508
+ identity?: IdentificationData;
509
+ }
510
+ interface EventMetadata extends BaseEventMetadata {
511
+ /**
512
+ * Unique event ID.
513
+ * Allows clients to ignore duplicate webhooks.
514
+ */
515
+ _id?: string;
516
+ /**
517
+ * Assumes actions are also always typed to an entity_type
518
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
519
+ */
520
+ entityFqdn?: string;
521
+ /**
522
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
523
+ * This is although the created/updated/deleted notion is duplication of the oneof types
524
+ * Example: created/updated/deleted/started/completed/email_opened
525
+ */
526
+ slug?: string;
527
+ /** ID of the entity associated with the event. */
528
+ entityId?: string;
529
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
530
+ eventTime?: Date;
531
+ /**
532
+ * Whether the event was triggered as a result of a privacy regulation application
533
+ * (for example, GDPR).
534
+ */
535
+ triggeredByAnonymizeRequest?: boolean | null;
536
+ /** If present, indicates the action that triggered the event. */
537
+ originatedFrom?: string | null;
538
+ /**
539
+ * A sequence number defining the order of updates to the underlying entity.
540
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
541
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
542
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
543
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
544
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
545
+ */
546
+ entityEventSequence?: string | null;
547
+ }
548
+ interface CollectionMetadataCreatedEnvelope {
549
+ entity: CollectionMetadata;
550
+ metadata: EventMetadata;
551
+ }
552
+ interface CollectionMetadataUpdatedEnvelope {
553
+ entity: CollectionMetadata;
554
+ metadata: EventMetadata;
555
+ }
556
+ interface CollectionMetadataDeletedEnvelope {
557
+ metadata: EventMetadata;
558
+ }
559
+ interface ReplaceCollectionMetadataOptions {
560
+ /** The updated CollectionMetadatas */
561
+ items?: CollectionMetadata[];
562
+ }
563
+ interface ListCollectionMetadataOptions {
564
+ /** paging info */
565
+ paging?: CursorPaging;
566
+ }
567
+
568
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
569
+ interface HttpClient {
570
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
571
+ fetchWithAuth: typeof fetch;
572
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
573
+ }
574
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
575
+ type HttpResponse<T = any> = {
576
+ data: T;
577
+ status: number;
578
+ statusText: string;
579
+ headers: any;
580
+ request?: any;
581
+ };
582
+ type RequestOptions<_TResponse = any, Data = any> = {
583
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
584
+ url: string;
585
+ data?: Data;
586
+ params?: URLSearchParams;
587
+ } & APIMetadata;
588
+ type APIMetadata = {
589
+ methodFqn?: string;
590
+ entityFqdn?: string;
591
+ packageName?: string;
592
+ };
593
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
594
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
595
+ __type: 'event-definition';
596
+ type: Type;
597
+ isDomainEvent?: boolean;
598
+ transformations?: (envelope: unknown) => Payload;
599
+ __payload: Payload;
600
+ };
601
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
602
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
603
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
604
+
605
+ declare global {
606
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
607
+ interface SymbolConstructor {
608
+ readonly observable: symbol;
609
+ }
610
+ }
611
+
612
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
613
+
614
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
615
+
616
+ declare const createCollectionMetadata: ReturnType<typeof createRESTModule<typeof publicCreateCollectionMetadata>>;
617
+ declare const getCollectionMetadata: ReturnType<typeof createRESTModule<typeof publicGetCollectionMetadata>>;
618
+ declare const updateCollectionMetadata: ReturnType<typeof createRESTModule<typeof publicUpdateCollectionMetadata>>;
619
+ declare const replaceCollectionMetadata: ReturnType<typeof createRESTModule<typeof publicReplaceCollectionMetadata>>;
620
+ declare const deleteCollectionMetadata: ReturnType<typeof createRESTModule<typeof publicDeleteCollectionMetadata>>;
621
+ declare const listCollectionMetadata: ReturnType<typeof createRESTModule<typeof publicListCollectionMetadata>>;
622
+ declare const onCollectionMetadataCreated: ReturnType<typeof createEventModule<typeof publicOnCollectionMetadataCreated>>;
623
+ declare const onCollectionMetadataUpdated: ReturnType<typeof createEventModule<typeof publicOnCollectionMetadataUpdated>>;
624
+ declare const onCollectionMetadataDeleted: ReturnType<typeof createEventModule<typeof publicOnCollectionMetadataDeleted>>;
625
+
626
+ type context_ActionEvent = ActionEvent;
627
+ type context_Asset = Asset;
628
+ type context_BaseEventMetadata = BaseEventMetadata;
629
+ type context_CollectionMetadata = CollectionMetadata;
630
+ type context_CollectionMetadataCreatedEnvelope = CollectionMetadataCreatedEnvelope;
631
+ type context_CollectionMetadataDeletedEnvelope = CollectionMetadataDeletedEnvelope;
632
+ type context_CollectionMetadataNonNullableFields = CollectionMetadataNonNullableFields;
633
+ type context_CollectionMetadataUpdatedEnvelope = CollectionMetadataUpdatedEnvelope;
634
+ type context_CreateCollectionMetadataRequest = CreateCollectionMetadataRequest;
635
+ type context_CreateCollectionMetadataResponse = CreateCollectionMetadataResponse;
636
+ type context_CreateCollectionMetadataResponseNonNullableFields = CreateCollectionMetadataResponseNonNullableFields;
637
+ type context_CursorPaging = CursorPaging;
638
+ type context_CursorPagingMetadata = CursorPagingMetadata;
639
+ type context_Cursors = Cursors;
640
+ type context_DeleteCollectionMetadataRequest = DeleteCollectionMetadataRequest;
641
+ type context_DeleteCollectionMetadataResponse = DeleteCollectionMetadataResponse;
642
+ type context_DeleteContext = DeleteContext;
643
+ type context_DeleteStatus = DeleteStatus;
644
+ declare const context_DeleteStatus: typeof DeleteStatus;
645
+ type context_DomainEvent = DomainEvent;
646
+ type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
647
+ type context_Empty = Empty;
648
+ type context_EntityCreatedEvent = EntityCreatedEvent;
649
+ type context_EntityDeletedEvent = EntityDeletedEvent;
650
+ type context_EntityUpdatedEvent = EntityUpdatedEvent;
651
+ type context_EventMetadata = EventMetadata;
652
+ type context_GetCollectionMetadataRequest = GetCollectionMetadataRequest;
653
+ type context_GetCollectionMetadataResponse = GetCollectionMetadataResponse;
654
+ type context_GetCollectionMetadataResponseNonNullableFields = GetCollectionMetadataResponseNonNullableFields;
655
+ type context_IdentificationData = IdentificationData;
656
+ type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
657
+ type context_ListCollectionMetadataOptions = ListCollectionMetadataOptions;
658
+ type context_ListCollectionMetadataRequest = ListCollectionMetadataRequest;
659
+ type context_ListCollectionMetadataResponse = ListCollectionMetadataResponse;
660
+ type context_ListCollectionMetadataResponseNonNullableFields = ListCollectionMetadataResponseNonNullableFields;
661
+ type context_MessageEnvelope = MessageEnvelope;
662
+ type context_MetaSiteSpecialEvent = MetaSiteSpecialEvent;
663
+ type context_MetaSiteSpecialEventPayloadOneOf = MetaSiteSpecialEventPayloadOneOf;
664
+ type context_Namespace = Namespace;
665
+ declare const context_Namespace: typeof Namespace;
666
+ type context_NamespaceChanged = NamespaceChanged;
667
+ type context_PermissionsTemplateType = PermissionsTemplateType;
668
+ declare const context_PermissionsTemplateType: typeof PermissionsTemplateType;
669
+ type context_ReplaceCollectionMetadataOptions = ReplaceCollectionMetadataOptions;
670
+ type context_ReplaceCollectionMetadataRequest = ReplaceCollectionMetadataRequest;
671
+ type context_ReplaceCollectionMetadataResponse = ReplaceCollectionMetadataResponse;
672
+ type context_RestoreInfo = RestoreInfo;
673
+ type context_ServiceProvisioned = ServiceProvisioned;
674
+ type context_ServiceRemoved = ServiceRemoved;
675
+ type context_SiteCreated = SiteCreated;
676
+ type context_SiteCreatedContext = SiteCreatedContext;
677
+ declare const context_SiteCreatedContext: typeof SiteCreatedContext;
678
+ type context_SiteDeleted = SiteDeleted;
679
+ type context_SiteHardDeleted = SiteHardDeleted;
680
+ type context_SiteMarkedAsTemplate = SiteMarkedAsTemplate;
681
+ type context_SiteMarkedAsWixSite = SiteMarkedAsWixSite;
682
+ type context_SitePublished = SitePublished;
683
+ type context_SiteRenamed = SiteRenamed;
684
+ type context_SiteTransferred = SiteTransferred;
685
+ type context_SiteUndeleted = SiteUndeleted;
686
+ type context_SiteUnpublished = SiteUnpublished;
687
+ type context_State = State;
688
+ declare const context_State: typeof State;
689
+ type context_StudioAssigned = StudioAssigned;
690
+ type context_StudioUnassigned = StudioUnassigned;
691
+ type context_UpdateCollectionMetadataRequest = UpdateCollectionMetadataRequest;
692
+ type context_UpdateCollectionMetadataResponse = UpdateCollectionMetadataResponse;
693
+ type context_UpdateCollectionMetadataResponseNonNullableFields = UpdateCollectionMetadataResponseNonNullableFields;
694
+ type context_WebhookIdentityType = WebhookIdentityType;
695
+ declare const context_WebhookIdentityType: typeof WebhookIdentityType;
696
+ declare const context_createCollectionMetadata: typeof createCollectionMetadata;
697
+ declare const context_deleteCollectionMetadata: typeof deleteCollectionMetadata;
698
+ declare const context_getCollectionMetadata: typeof getCollectionMetadata;
699
+ declare const context_listCollectionMetadata: typeof listCollectionMetadata;
700
+ declare const context_onCollectionMetadataCreated: typeof onCollectionMetadataCreated;
701
+ declare const context_onCollectionMetadataDeleted: typeof onCollectionMetadataDeleted;
702
+ declare const context_onCollectionMetadataUpdated: typeof onCollectionMetadataUpdated;
703
+ declare const context_replaceCollectionMetadata: typeof replaceCollectionMetadata;
704
+ declare const context_updateCollectionMetadata: typeof updateCollectionMetadata;
705
+ declare namespace context {
706
+ export { type context_ActionEvent as ActionEvent, type context_Asset as Asset, type context_BaseEventMetadata as BaseEventMetadata, type context_CollectionMetadata as CollectionMetadata, type context_CollectionMetadataCreatedEnvelope as CollectionMetadataCreatedEnvelope, type context_CollectionMetadataDeletedEnvelope as CollectionMetadataDeletedEnvelope, type context_CollectionMetadataNonNullableFields as CollectionMetadataNonNullableFields, type context_CollectionMetadataUpdatedEnvelope as CollectionMetadataUpdatedEnvelope, type context_CreateCollectionMetadataRequest as CreateCollectionMetadataRequest, type context_CreateCollectionMetadataResponse as CreateCollectionMetadataResponse, type context_CreateCollectionMetadataResponseNonNullableFields as CreateCollectionMetadataResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_Cursors as Cursors, type context_DeleteCollectionMetadataRequest as DeleteCollectionMetadataRequest, type context_DeleteCollectionMetadataResponse as DeleteCollectionMetadataResponse, type context_DeleteContext as DeleteContext, context_DeleteStatus as DeleteStatus, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_Empty as Empty, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_GetCollectionMetadataRequest as GetCollectionMetadataRequest, type context_GetCollectionMetadataResponse as GetCollectionMetadataResponse, type context_GetCollectionMetadataResponseNonNullableFields as GetCollectionMetadataResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_ListCollectionMetadataOptions as ListCollectionMetadataOptions, type context_ListCollectionMetadataRequest as ListCollectionMetadataRequest, type context_ListCollectionMetadataResponse as ListCollectionMetadataResponse, type context_ListCollectionMetadataResponseNonNullableFields as ListCollectionMetadataResponseNonNullableFields, type context_MessageEnvelope as MessageEnvelope, type context_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type context_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, context_Namespace as Namespace, type context_NamespaceChanged as NamespaceChanged, context_PermissionsTemplateType as PermissionsTemplateType, type context_ReplaceCollectionMetadataOptions as ReplaceCollectionMetadataOptions, type context_ReplaceCollectionMetadataRequest as ReplaceCollectionMetadataRequest, type context_ReplaceCollectionMetadataResponse as ReplaceCollectionMetadataResponse, type context_RestoreInfo as RestoreInfo, type context_ServiceProvisioned as ServiceProvisioned, type context_ServiceRemoved as ServiceRemoved, type context_SiteCreated as SiteCreated, context_SiteCreatedContext as SiteCreatedContext, type context_SiteDeleted as SiteDeleted, type context_SiteHardDeleted as SiteHardDeleted, type context_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type context_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type context_SitePublished as SitePublished, type context_SiteRenamed as SiteRenamed, type context_SiteTransferred as SiteTransferred, type context_SiteUndeleted as SiteUndeleted, type context_SiteUnpublished as SiteUnpublished, context_State as State, type context_StudioAssigned as StudioAssigned, type context_StudioUnassigned as StudioUnassigned, type context_UpdateCollectionMetadataRequest as UpdateCollectionMetadataRequest, type context_UpdateCollectionMetadataResponse as UpdateCollectionMetadataResponse, type context_UpdateCollectionMetadataResponseNonNullableFields as UpdateCollectionMetadataResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, context_createCollectionMetadata as createCollectionMetadata, context_deleteCollectionMetadata as deleteCollectionMetadata, context_getCollectionMetadata as getCollectionMetadata, context_listCollectionMetadata as listCollectionMetadata, context_onCollectionMetadataCreated as onCollectionMetadataCreated, context_onCollectionMetadataDeleted as onCollectionMetadataDeleted, context_onCollectionMetadataUpdated as onCollectionMetadataUpdated, context_replaceCollectionMetadata as replaceCollectionMetadata, context_updateCollectionMetadata as updateCollectionMetadata };
707
+ }
708
+
709
+ export { context as autocms };