@wix/pro-gallery 1.0.63 → 1.0.65

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.
@@ -12,6 +12,10 @@ type Host<Environment = unknown> = {
12
12
  }>;
13
13
  };
14
14
  environment?: Environment;
15
+ /**
16
+ * Optional name of the environment, use for logging
17
+ */
18
+ name?: string;
15
19
  /**
16
20
  * Optional bast url to use for API requests, for example `www.wixapis.com`
17
21
  */
@@ -63,16 +67,16 @@ type APIMetadata = {
63
67
  packageName?: string;
64
68
  };
65
69
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
70
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
67
71
  __type: 'event-definition';
68
72
  type: Type;
69
73
  isDomainEvent?: boolean;
70
74
  transformations?: (envelope: unknown) => Payload;
71
75
  __payload: Payload;
72
76
  };
73
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
74
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
75
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
77
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
76
80
 
77
81
  type ServicePluginMethodInput = {
78
82
  request: any;
@@ -271,6 +275,72 @@ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends Excep
271
275
  ? Partial<Record<KeysType, never>>
272
276
  : {});
273
277
 
278
+ /**
279
+ Returns a boolean for whether the given type is `never`.
280
+
281
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
+ @link https://stackoverflow.com/a/53984913/10292952
283
+ @link https://www.zhenghao.io/posts/ts-never
284
+
285
+ Useful in type utilities, such as checking if something does not occur.
286
+
287
+ @example
288
+ ```
289
+ import type {IsNever, And} from 'type-fest';
290
+
291
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
+ type AreStringsEqual<A extends string, B extends string> =
293
+ And<
294
+ IsNever<Exclude<A, B>> extends true ? true : false,
295
+ IsNever<Exclude<B, A>> extends true ? true : false
296
+ >;
297
+
298
+ type EndIfEqual<I extends string, O extends string> =
299
+ AreStringsEqual<I, O> extends true
300
+ ? never
301
+ : void;
302
+
303
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
+ if (input === output) {
305
+ process.exit(0);
306
+ }
307
+ }
308
+
309
+ endIfEqual('abc', 'abc');
310
+ //=> never
311
+
312
+ endIfEqual('abc', '123');
313
+ //=> void
314
+ ```
315
+
316
+ @category Type Guard
317
+ @category Utilities
318
+ */
319
+ type IsNever<T> = [T] extends [never] ? true : false;
320
+
321
+ /**
322
+ An if-else-like type that resolves depending on whether the given type is `never`.
323
+
324
+ @see {@link IsNever}
325
+
326
+ @example
327
+ ```
328
+ import type {IfNever} from 'type-fest';
329
+
330
+ type ShouldBeTrue = IfNever<never>;
331
+ //=> true
332
+
333
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
+ //=> 'bar'
335
+ ```
336
+
337
+ @category Type Guard
338
+ @category Utilities
339
+ */
340
+ type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
+ IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
+ );
343
+
274
344
  /**
275
345
  Extract the keys from a type where the value type of the key extends the given `Condition`.
276
346
 
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
303
373
 
304
374
  @category Object
305
375
  */
306
- type ConditionalKeys<Base, Condition> = NonNullable<
307
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
376
+ type ConditionalKeys<Base, Condition> =
308
377
  {
309
378
  // Map through all the keys of the given base type.
310
- [Key in keyof Base]:
379
+ [Key in keyof Base]-?:
311
380
  // Pick only keys with types extending the given `Condition` type.
312
381
  Base[Key] extends Condition
313
- // Retain this key since the condition passes.
314
- ? Key
382
+ // Retain this key
383
+ // If the value for the key extends never, only include it if `Condition` also extends never
384
+ ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
315
385
  // Discard this key since the condition fails.
316
386
  : never;
317
-
318
387
  // Convert the produced object into a union type of the keys which passed the conditional test.
319
- }[keyof Base]
320
- >;
388
+ }[keyof Base];
321
389
 
322
390
  /**
323
391
  Exclude keys from a shape that matches the given `Condition`.
@@ -367,7 +435,7 @@ ConditionalKeys<Base, Condition>
367
435
  * can either be a REST module or a host module.
368
436
  * This type is recursive, so it can describe nested modules.
369
437
  */
370
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
438
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
371
439
  [key: string]: Descriptors | PublicMetadata | any;
372
440
  };
373
441
  /**
@@ -380,7 +448,7 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
380
448
  done: T;
381
449
  recurse: T extends {
382
450
  __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
451
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
384
452
  [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
453
  -1,
386
454
  0,
@@ -433,7 +501,7 @@ interface Gallery {
433
501
  * Date and time the gallery was created.
434
502
  * @readonly
435
503
  */
436
- _createdDate?: Date;
504
+ _createdDate?: Date | null;
437
505
  }
438
506
  interface Item extends ItemMetadataOneOf {
439
507
  /** Details about the image. */
@@ -461,18 +529,21 @@ interface Item extends ItemMetadataOneOf {
461
529
  description?: string | null;
462
530
  /** Link from the item. You can link to Wix sites or external URLs. */
463
531
  link?: Link;
464
- /** @readonly */
532
+ /**
533
+ * Type of item.
534
+ * @readonly
535
+ */
465
536
  type?: Type;
466
537
  /**
467
538
  * Date and time the item was created.
468
539
  * @readonly
469
540
  */
470
- _createdDate?: Date;
541
+ _createdDate?: Date | null;
471
542
  /**
472
543
  * Date and time the item was last updated.
473
544
  * @readonly
474
545
  */
475
- _updatedDate?: Date;
546
+ _updatedDate?: Date | null;
476
547
  /** Item tags. */
477
548
  tags?: Tags;
478
549
  }
@@ -493,9 +564,9 @@ interface Link {
493
564
  }
494
565
  declare enum LinkType {
495
566
  UNDEFINED = "UNDEFINED",
496
- /** external link */
567
+ /** External link. */
497
568
  EXTERNAL = "EXTERNAL",
498
- /** for internal usage using wixLinkData */
569
+ /** For internal usage using wixLinkData. */
499
570
  INTERNAL = "INTERNAL"
500
571
  }
501
572
  /** The link object generated by panels in the editor and used by applications in Wix */
@@ -683,7 +754,7 @@ interface UnsharpMasking {
683
754
  /** Unsharp masking radius in pixels. Controls the sharpening width. */
684
755
  radius?: number | null;
685
756
  /**
686
- * Unsharp masking threshold. Controls how different neighboring pixels must be for shapening to apply. <br />
757
+ * Unsharp masking threshold. Controls how different neighboring pixels must be for sharpening to apply. <br />
687
758
  *
688
759
  * Min: `0` <br />
689
760
  * Max: `1`
@@ -691,6 +762,7 @@ interface UnsharpMasking {
691
762
  threshold?: number | null;
692
763
  }
693
764
  interface Video {
765
+ /** Type of video. */
694
766
  type?: VideoType;
695
767
  /**
696
768
  * The video's URL. Either a Wix media URL, or a supported https external URL in the following formats:
@@ -822,9 +894,9 @@ interface GalleryPublished {
822
894
  galleryId?: string;
823
895
  isRc?: boolean;
824
896
  /** @readonly */
825
- newRevision?: Date;
897
+ newRevision?: Date | null;
826
898
  /** @readonly */
827
- oldRevision?: Date;
899
+ oldRevision?: Date | null;
828
900
  }
829
901
  interface CleanDeletedGalleriesEvent {
830
902
  /** @readonly */
@@ -834,7 +906,7 @@ interface CleanDeletedGalleriesEvent {
834
906
  /** @readonly */
835
907
  htmlSiteRevision?: string;
836
908
  /** @readonly */
837
- timeSitePublished?: Date;
909
+ timeSitePublished?: Date | null;
838
910
  }
839
911
  interface ProgallerypublisherPublishGalleryRequest {
840
912
  /** id of the gallery that will be published */
@@ -846,12 +918,12 @@ interface GetActiveGalleryRevisionRequest {
846
918
  galleryId?: string;
847
919
  }
848
920
  interface GetActiveGalleryRevisionResponse {
849
- galleryActiveRevision?: Date;
921
+ galleryActiveRevision?: Date | null;
850
922
  htmlSiteRevision?: string | null;
851
923
  }
852
924
  interface GetGalleryRevisionRequest {
853
925
  galleryId?: string;
854
- revision?: Date;
926
+ revision?: Date | null;
855
927
  }
856
928
  interface GetGalleryRevisionResponse {
857
929
  htmlSiteRevision?: string | null;
@@ -932,7 +1004,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
932
1004
  /** ID of the entity associated with the event. */
933
1005
  entityId?: string;
934
1006
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
935
- eventTime?: Date;
1007
+ eventTime?: Date | null;
936
1008
  /**
937
1009
  * Whether the event was triggered as a result of a privacy regulation application
938
1010
  * (for example, GDPR).
@@ -961,7 +1033,7 @@ interface EntityCreatedEvent {
961
1033
  entity?: string;
962
1034
  }
963
1035
  interface RestoreInfo {
964
- deletedDate?: Date;
1036
+ deletedDate?: Date | null;
965
1037
  }
966
1038
  interface EntityUpdatedEvent {
967
1039
  /**
@@ -1018,121 +1090,6 @@ declare enum WebhookIdentityType {
1018
1090
  WIX_USER = "WIX_USER",
1019
1091
  APP = "APP"
1020
1092
  }
1021
- interface UpdateDocumentsEvent extends UpdateDocumentsEventOperationOneOf {
1022
- /** insert/update documents */
1023
- update?: DocumentUpdateOperation;
1024
- /** delete by document ids */
1025
- deleteByIds?: DeleteByIdsOperation;
1026
- /** delete documents matching filter */
1027
- deleteByFilter?: DeleteByFilterOperation;
1028
- /** update documents matching filter */
1029
- updateByFilter?: UpdateByFilterOperation;
1030
- /** update only existing documents */
1031
- updateExisting?: UpdateExistingOperation;
1032
- /** application which owns documents */
1033
- appDefId?: string | null;
1034
- /** type of the documents */
1035
- documentType?: string | null;
1036
- /** language of the documents */
1037
- language?: string | null;
1038
- /** site documents belong to */
1039
- msId?: string | null;
1040
- }
1041
- /** @oneof */
1042
- interface UpdateDocumentsEventOperationOneOf {
1043
- /** insert/update documents */
1044
- update?: DocumentUpdateOperation;
1045
- /** delete by document ids */
1046
- deleteByIds?: DeleteByIdsOperation;
1047
- /** delete documents matching filter */
1048
- deleteByFilter?: DeleteByFilterOperation;
1049
- /** update documents matching filter */
1050
- updateByFilter?: UpdateByFilterOperation;
1051
- /** update only existing documents */
1052
- updateExisting?: UpdateExistingOperation;
1053
- }
1054
- interface DocumentUpdateOperation {
1055
- /** documents to index or update */
1056
- documents?: IndexDocument[];
1057
- }
1058
- interface IndexDocument {
1059
- /** data bag with non-searchable fields (url, image) */
1060
- payload?: DocumentPayload;
1061
- /** what type of users should documents be visible to */
1062
- exposure?: Enum;
1063
- /** document with mandatory fields (id, title, description) and with fields specific to the type of the document */
1064
- document?: Record<string, any> | null;
1065
- /** what member groups is the document exposed to. Used only with GROUP_PROTECTED exposure */
1066
- permittedMemberGroups?: string[];
1067
- /** if true SEO is disabled for this document */
1068
- seoHidden?: boolean | null;
1069
- /** if true the page is a lightbox popup */
1070
- isPopup?: boolean | null;
1071
- }
1072
- interface DocumentPayload {
1073
- /** url of the page representing the document */
1074
- url?: string | null;
1075
- /** image which represents the document */
1076
- documentImage?: DocumentImage;
1077
- }
1078
- interface DocumentImage {
1079
- /** the name of the image */
1080
- name?: string;
1081
- /** the width of the image */
1082
- width?: number;
1083
- /** the height of the image */
1084
- height?: number;
1085
- }
1086
- declare enum Enum {
1087
- /** Default value. Means that permission not set */
1088
- UNKNOWN = "UNKNOWN",
1089
- /** Protected exposure. Exposed to members and owners */
1090
- PROTECTED = "PROTECTED",
1091
- /** Private exposure. Exposed to owners */
1092
- PRIVATE = "PRIVATE",
1093
- /** Public exposure. Visible to everyone */
1094
- PUBLIC = "PUBLIC",
1095
- /** Used for partial updates, to state that exposure is not changing */
1096
- UNCHANGED = "UNCHANGED",
1097
- /** Protected to members of permitted groups and owners */
1098
- GROUP_PROTECTED = "GROUP_PROTECTED"
1099
- }
1100
- interface DeleteByIdsOperation {
1101
- /** ids of the documents to delete */
1102
- documentIds?: string[];
1103
- }
1104
- interface DeleteByFilterOperation {
1105
- /** documents matching this filter wil be deleted. only filterable documents defined in document_type can be used for filtering */
1106
- filter?: Record<string, any> | null;
1107
- }
1108
- interface UpdateByFilterOperation {
1109
- /** documents matching this filter will be updated */
1110
- filter?: Record<string, any> | null;
1111
- /** partial document to apply */
1112
- document?: IndexDocument;
1113
- }
1114
- interface UpdateExistingOperation {
1115
- /** documents to update */
1116
- documents?: IndexDocument[];
1117
- }
1118
- interface SearchIndexingNotification {
1119
- /** new state of indexing for the site specified in ms_id */
1120
- indexState?: SearchIndexingNotificationState;
1121
- /** type of the document the notification is targeted for. Applies to all types if not provided */
1122
- documentType?: string | null;
1123
- /** languaInternalDocumentUpdateByFilterOperationge the notification is targeted for. Applies to all languages if not provided */
1124
- language?: string | null;
1125
- /** site for which notification is targeted */
1126
- msId?: string | null;
1127
- }
1128
- declare enum SearchIndexingNotificationState {
1129
- /** default state */
1130
- Unknown = "Unknown",
1131
- /** metasite does not require site search indexing */
1132
- Off = "Off",
1133
- /** metasite requires site search indexing */
1134
- On = "On"
1135
- }
1136
1093
  interface ListGalleriesItemsRequest {
1137
1094
  /** IDs of the media items to retrieve. */
1138
1095
  itemsId?: ItemId[];
@@ -1174,10 +1131,11 @@ interface ListGalleriesRequest {
1174
1131
  limit?: number | null;
1175
1132
  }
1176
1133
  declare enum State {
1134
+ /** Undefined state. */
1177
1135
  UNDEFINED = "UNDEFINED",
1178
- /** The gallery in the Editor segment */
1136
+ /** The gallery in the Editor. */
1179
1137
  SAVED = "SAVED",
1180
- /** The gallery in the LiveSite segment */
1138
+ /** The gallery in the LiveSite. */
1181
1139
  PUBLISHED = "PUBLISHED"
1182
1140
  }
1183
1141
  interface ListGalleriesResponse {
@@ -1338,6 +1296,121 @@ interface PublishGalleryResponse {
1338
1296
  /** Published gallery. */
1339
1297
  gallery?: Gallery;
1340
1298
  }
1299
+ interface UpdateDocumentsEvent extends UpdateDocumentsEventOperationOneOf {
1300
+ /** insert/update documents */
1301
+ update?: DocumentUpdateOperation;
1302
+ /** delete by document ids */
1303
+ deleteByIds?: DeleteByIdsOperation;
1304
+ /** delete documents matching filter */
1305
+ deleteByFilter?: DeleteByFilterOperation;
1306
+ /** update documents matching filter */
1307
+ updateByFilter?: UpdateByFilterOperation;
1308
+ /** update only existing documents */
1309
+ updateExisting?: UpdateExistingOperation;
1310
+ /** application which owns documents */
1311
+ appDefId?: string | null;
1312
+ /** type of the documents */
1313
+ documentType?: string | null;
1314
+ /** language of the documents */
1315
+ language?: string | null;
1316
+ /** site documents belong to */
1317
+ msId?: string | null;
1318
+ }
1319
+ /** @oneof */
1320
+ interface UpdateDocumentsEventOperationOneOf {
1321
+ /** insert/update documents */
1322
+ update?: DocumentUpdateOperation;
1323
+ /** delete by document ids */
1324
+ deleteByIds?: DeleteByIdsOperation;
1325
+ /** delete documents matching filter */
1326
+ deleteByFilter?: DeleteByFilterOperation;
1327
+ /** update documents matching filter */
1328
+ updateByFilter?: UpdateByFilterOperation;
1329
+ /** update only existing documents */
1330
+ updateExisting?: UpdateExistingOperation;
1331
+ }
1332
+ interface DocumentUpdateOperation {
1333
+ /** documents to index or update */
1334
+ documents?: IndexDocument[];
1335
+ }
1336
+ interface IndexDocument {
1337
+ /** data bag with non-searchable fields (url, image) */
1338
+ payload?: DocumentPayload;
1339
+ /** what type of users should documents be visible to */
1340
+ exposure?: Enum;
1341
+ /** document with mandatory fields (id, title, description) and with fields specific to the type of the document */
1342
+ document?: Record<string, any> | null;
1343
+ /** what member groups is the document exposed to. Used only with GROUP_PROTECTED exposure */
1344
+ permittedMemberGroups?: string[];
1345
+ /** if true SEO is disabled for this document */
1346
+ seoHidden?: boolean | null;
1347
+ /** if true the page is a lightbox popup */
1348
+ isPopup?: boolean | null;
1349
+ }
1350
+ interface DocumentPayload {
1351
+ /** url of the page representing the document */
1352
+ url?: string | null;
1353
+ /** image which represents the document */
1354
+ documentImage?: DocumentImage;
1355
+ }
1356
+ interface DocumentImage {
1357
+ /** the name of the image */
1358
+ name?: string;
1359
+ /** the width of the image */
1360
+ width?: number;
1361
+ /** the height of the image */
1362
+ height?: number;
1363
+ }
1364
+ declare enum Enum {
1365
+ /** Default value. Means that permission not set */
1366
+ UNKNOWN = "UNKNOWN",
1367
+ /** Protected exposure. Exposed to members and owners */
1368
+ PROTECTED = "PROTECTED",
1369
+ /** Private exposure. Exposed to owners */
1370
+ PRIVATE = "PRIVATE",
1371
+ /** Public exposure. Visible to everyone */
1372
+ PUBLIC = "PUBLIC",
1373
+ /** Used for partial updates, to state that exposure is not changing */
1374
+ UNCHANGED = "UNCHANGED",
1375
+ /** Protected to members of permitted groups and owners */
1376
+ GROUP_PROTECTED = "GROUP_PROTECTED"
1377
+ }
1378
+ interface DeleteByIdsOperation {
1379
+ /** ids of the documents to delete */
1380
+ documentIds?: string[];
1381
+ }
1382
+ interface DeleteByFilterOperation {
1383
+ /** documents matching this filter wil be deleted. only filterable documents defined in document_type can be used for filtering */
1384
+ filter?: Record<string, any> | null;
1385
+ }
1386
+ interface UpdateByFilterOperation {
1387
+ /** documents matching this filter will be updated */
1388
+ filter?: Record<string, any> | null;
1389
+ /** partial document to apply */
1390
+ document?: IndexDocument;
1391
+ }
1392
+ interface UpdateExistingOperation {
1393
+ /** documents to update */
1394
+ documents?: IndexDocument[];
1395
+ }
1396
+ interface SearchIndexingNotification {
1397
+ /** new state of indexing for the site specified in ms_id */
1398
+ indexState?: SearchIndexingNotificationState;
1399
+ /** type of the document the notification is targeted for. Applies to all types if not provided */
1400
+ documentType?: string | null;
1401
+ /** languaInternalDocumentUpdateByFilterOperationge the notification is targeted for. Applies to all languages if not provided */
1402
+ language?: string | null;
1403
+ /** site for which notification is targeted */
1404
+ msId?: string | null;
1405
+ }
1406
+ declare enum SearchIndexingNotificationState {
1407
+ /** default state */
1408
+ Unknown = "Unknown",
1409
+ /** metasite does not require site search indexing */
1410
+ Off = "Off",
1411
+ /** metasite requires site search indexing */
1412
+ On = "On"
1413
+ }
1341
1414
  interface PointNonNullableFields {
1342
1415
  x: number;
1343
1416
  y: number;
@@ -1490,7 +1563,7 @@ interface EventMetadata extends BaseEventMetadata {
1490
1563
  /** ID of the entity associated with the event. */
1491
1564
  entityId?: string;
1492
1565
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1493
- eventTime?: Date;
1566
+ eventTime?: Date | null;
1494
1567
  /**
1495
1568
  * Whether the event was triggered as a result of a privacy regulation application
1496
1569
  * (for example, GDPR).
@@ -1512,10 +1585,6 @@ interface GalleryCreatedEnvelope {
1512
1585
  entity: Gallery;
1513
1586
  metadata: EventMetadata;
1514
1587
  }
1515
- interface GalleryUpdatedEnvelope {
1516
- entity: Gallery;
1517
- metadata: EventMetadata;
1518
- }
1519
1588
  interface GalleryDeletedEnvelope {
1520
1589
  metadata: EventMetadata;
1521
1590
  }
@@ -1523,12 +1592,16 @@ interface GalleryItemCreatedEnvelope {
1523
1592
  data: GalleryItemCreated;
1524
1593
  metadata: EventMetadata;
1525
1594
  }
1595
+ interface GalleryItemDeletedEnvelope {
1596
+ data: GalleryItemDeleted;
1597
+ metadata: EventMetadata;
1598
+ }
1526
1599
  interface GalleryItemUpdatedEnvelope {
1527
1600
  data: GalleryItemUpdated;
1528
1601
  metadata: EventMetadata;
1529
1602
  }
1530
- interface GalleryItemDeletedEnvelope {
1531
- data: GalleryItemDeleted;
1603
+ interface GalleryUpdatedEnvelope {
1604
+ entity: Gallery;
1532
1605
  metadata: EventMetadata;
1533
1606
  }
1534
1607
  interface ListGalleriesOptions {
@@ -1600,7 +1673,7 @@ interface UpdateGallery {
1600
1673
  * Date and time the gallery was created.
1601
1674
  * @readonly
1602
1675
  */
1603
- _createdDate?: Date;
1676
+ _createdDate?: Date | null;
1604
1677
  }
1605
1678
  interface DeleteGalleryItemsOptions {
1606
1679
  /** ID of the media item to delete. */
@@ -1641,18 +1714,21 @@ interface UpdateGalleryItem {
1641
1714
  description?: string | null;
1642
1715
  /** Link from the item. You can link to Wix sites or external URLs. */
1643
1716
  link?: Link;
1644
- /** @readonly */
1717
+ /**
1718
+ * Type of item.
1719
+ * @readonly
1720
+ */
1645
1721
  type?: Type;
1646
1722
  /**
1647
1723
  * Date and time the item was created.
1648
1724
  * @readonly
1649
1725
  */
1650
- _createdDate?: Date;
1726
+ _createdDate?: Date | null;
1651
1727
  /**
1652
1728
  * Date and time the item was last updated.
1653
1729
  * @readonly
1654
1730
  */
1655
- _updatedDate?: Date;
1731
+ _updatedDate?: Date | null;
1656
1732
  /** Item tags. */
1657
1733
  tags?: Tags;
1658
1734
  }
@@ -1818,30 +1894,12 @@ interface DeleteGalleryItemSignature {
1818
1894
  */
1819
1895
  (identifiers: DeleteGalleryItemIdentifiers): Promise<DeleteGalleryItemResponse & DeleteGalleryItemResponseNonNullableFields>;
1820
1896
  }
1821
- declare const onGalleryCreated$1: EventDefinition$1<GalleryCreatedEnvelope, "wix.pro_gallery.gallery_v2_created">;
1822
- declare const onGalleryUpdated$1: EventDefinition$1<GalleryUpdatedEnvelope, "wix.pro_gallery.gallery_v2_updated">;
1823
- declare const onGalleryDeleted$1: EventDefinition$1<GalleryDeletedEnvelope, "wix.pro_gallery.gallery_v2_deleted">;
1824
- declare const onGalleryItemCreated$1: EventDefinition$1<GalleryItemCreatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_created">;
1825
- declare const onGalleryItemUpdated$1: EventDefinition$1<GalleryItemUpdatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_updated">;
1826
- declare const onGalleryItemDeleted$1: EventDefinition$1<GalleryItemDeletedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_deleted">;
1827
-
1828
- type EventDefinition<Payload = unknown, Type extends string = string> = {
1829
- __type: 'event-definition';
1830
- type: Type;
1831
- isDomainEvent?: boolean;
1832
- transformations?: (envelope: unknown) => Payload;
1833
- __payload: Payload;
1834
- };
1835
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1836
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
1837
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
1838
-
1839
- declare global {
1840
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1841
- interface SymbolConstructor {
1842
- readonly observable: symbol;
1843
- }
1844
- }
1897
+ declare const onGalleryCreated$1: EventDefinition<GalleryCreatedEnvelope, "wix.pro_gallery.gallery_v2_created">;
1898
+ declare const onGalleryDeleted$1: EventDefinition<GalleryDeletedEnvelope, "wix.pro_gallery.gallery_v2_deleted">;
1899
+ declare const onGalleryItemCreated$1: EventDefinition<GalleryItemCreatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_created">;
1900
+ declare const onGalleryItemDeleted$1: EventDefinition<GalleryItemDeletedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_deleted">;
1901
+ declare const onGalleryItemUpdated$1: EventDefinition<GalleryItemUpdatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_updated">;
1902
+ declare const onGalleryUpdated$1: EventDefinition<GalleryUpdatedEnvelope, "wix.pro_gallery.gallery_v2_updated">;
1845
1903
 
1846
1904
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1847
1905
 
@@ -1867,15 +1925,6 @@ type _publicOnGalleryCreatedType = typeof onGalleryCreated$1;
1867
1925
  */
1868
1926
  declare const onGalleryCreated: ReturnType<typeof createEventModule<_publicOnGalleryCreatedType>>;
1869
1927
 
1870
- type _publicOnGalleryUpdatedType = typeof onGalleryUpdated$1;
1871
- /**
1872
- * Triggered when a gallery is updated.
1873
- *
1874
- * > __Note:__ The event data doesn't include gallery items or their IDs.
1875
- * > To receive information about the updated items you need to listen to the [Gallery Item Updated webhook](https://dev.wix.com/api/rest/site-content/pro-gallery/gallery-item-updated-webhook).
1876
- */
1877
- declare const onGalleryUpdated: ReturnType<typeof createEventModule<_publicOnGalleryUpdatedType>>;
1878
-
1879
1928
  type _publicOnGalleryDeletedType = typeof onGalleryDeleted$1;
1880
1929
  /**
1881
1930
  * Triggered when a gallery is deleted.
@@ -1888,20 +1937,29 @@ type _publicOnGalleryItemCreatedType = typeof onGalleryItemCreated$1;
1888
1937
  */
1889
1938
  declare const onGalleryItemCreated: ReturnType<typeof createEventModule<_publicOnGalleryItemCreatedType>>;
1890
1939
 
1940
+ type _publicOnGalleryItemDeletedType = typeof onGalleryItemDeleted$1;
1941
+ /**
1942
+ * Triggered when a media item in a specified gallery is deleted.
1943
+ *
1944
+ * > __Note:__ The event is triggered when a gallery item is deleted individually and when a gallery item is deleted because its gallery is deleted.
1945
+ * > The property `originatedFrom` has the value `Gallery Deleted` if the entire gallery is deleted. If the gallery item is deleted individually, this field is empty.
1946
+ */
1947
+ declare const onGalleryItemDeleted: ReturnType<typeof createEventModule<_publicOnGalleryItemDeletedType>>;
1948
+
1891
1949
  type _publicOnGalleryItemUpdatedType = typeof onGalleryItemUpdated$1;
1892
1950
  /**
1893
1951
  * Triggered when a media item in a specified gallery is updated.
1894
1952
  */
1895
1953
  declare const onGalleryItemUpdated: ReturnType<typeof createEventModule<_publicOnGalleryItemUpdatedType>>;
1896
1954
 
1897
- type _publicOnGalleryItemDeletedType = typeof onGalleryItemDeleted$1;
1955
+ type _publicOnGalleryUpdatedType = typeof onGalleryUpdated$1;
1898
1956
  /**
1899
- * Triggered when a media item in a specified gallery is deleted.
1957
+ * Triggered when a gallery is updated.
1900
1958
  *
1901
- * > __Note:__ The event is triggered when a gallery item is deleted individually and when a gallery item is deleted because its gallery is deleted.
1902
- * > The property `originatedFrom` has the value `Gallery Deleted` if the entire gallery is deleted. If the gallery item is deleted individually, this field is empty.
1959
+ * > __Note:__ The event data doesn't include gallery items or their IDs.
1960
+ * > To receive information about the updated items you need to listen to the [Gallery Item Updated webhook](https://dev.wix.com/api/rest/site-content/pro-gallery/gallery-item-updated-webhook).
1903
1961
  */
1904
- declare const onGalleryItemDeleted: ReturnType<typeof createEventModule<_publicOnGalleryItemDeletedType>>;
1962
+ declare const onGalleryUpdated: ReturnType<typeof createEventModule<_publicOnGalleryUpdatedType>>;
1905
1963
 
1906
1964
  type context_ActionEvent = ActionEvent;
1907
1965
  type context_AddressLink = AddressLink;