@wix/pro-gallery 1.0.63 → 1.0.64
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/build/cjs/context.js +1 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/meta.js +1 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/context.js +1 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.js +1 -0
- package/build/es/index.js.map +1 -0
- package/build/es/meta.js +1 -0
- package/build/es/meta.js.map +1 -0
- package/package.json +3 -3
- package/type-bundles/context.bundle.d.ts +102 -52
- package/type-bundles/index.bundle.d.ts +102 -52
- package/type-bundles/meta.bundle.d.ts +6 -6
package/build/cjs/context.js
CHANGED
@@ -25,3 +25,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.proGallery = void 0;
|
27
27
|
exports.proGallery = __importStar(require("@wix/pro-gallery_pro-gallery/context"));
|
28
|
+
//# sourceMappingURL=context.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mFAAmE"}
|
package/build/cjs/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAA2D;AAElD,gCAAU"}
|
package/build/cjs/meta.js
CHANGED
@@ -25,3 +25,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.proGallery = void 0;
|
27
27
|
exports.proGallery = __importStar(require("@wix/pro-gallery_pro-gallery/meta"));
|
28
|
+
//# sourceMappingURL=meta.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAgE"}
|
package/build/es/context.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,sCAAsC,CAAC"}
|
package/build/es/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/build/es/meta.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,mCAAmC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wix/pro-gallery",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.64",
|
4
4
|
"publishConfig": {
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
6
6
|
"access": "public"
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"type-bundles"
|
22
22
|
],
|
23
23
|
"dependencies": {
|
24
|
-
"@wix/pro-gallery_pro-gallery": "1.0.
|
24
|
+
"@wix/pro-gallery_pro-gallery": "1.0.33"
|
25
25
|
},
|
26
26
|
"devDependencies": {
|
27
27
|
"glob": "^10.4.1",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"fqdn": ""
|
47
47
|
}
|
48
48
|
},
|
49
|
-
"falconPackageHash": "
|
49
|
+
"falconPackageHash": "40310c38601d3b94560f608d84d2e9e212e2f4fd0bcaa56d4b0b9dfd"
|
50
50
|
}
|
@@ -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
|
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
|
74
|
-
type EventHandler
|
75
|
-
type BuildEventDefinition
|
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> =
|
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
|
314
|
-
|
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
|
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
|
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. */
|
@@ -467,12 +535,12 @@ interface Item extends ItemMetadataOneOf {
|
|
467
535
|
* Date and time the item was created.
|
468
536
|
* @readonly
|
469
537
|
*/
|
470
|
-
_createdDate?: Date;
|
538
|
+
_createdDate?: Date | null;
|
471
539
|
/**
|
472
540
|
* Date and time the item was last updated.
|
473
541
|
* @readonly
|
474
542
|
*/
|
475
|
-
_updatedDate?: Date;
|
543
|
+
_updatedDate?: Date | null;
|
476
544
|
/** Item tags. */
|
477
545
|
tags?: Tags;
|
478
546
|
}
|
@@ -822,9 +890,9 @@ interface GalleryPublished {
|
|
822
890
|
galleryId?: string;
|
823
891
|
isRc?: boolean;
|
824
892
|
/** @readonly */
|
825
|
-
newRevision?: Date;
|
893
|
+
newRevision?: Date | null;
|
826
894
|
/** @readonly */
|
827
|
-
oldRevision?: Date;
|
895
|
+
oldRevision?: Date | null;
|
828
896
|
}
|
829
897
|
interface CleanDeletedGalleriesEvent {
|
830
898
|
/** @readonly */
|
@@ -834,7 +902,7 @@ interface CleanDeletedGalleriesEvent {
|
|
834
902
|
/** @readonly */
|
835
903
|
htmlSiteRevision?: string;
|
836
904
|
/** @readonly */
|
837
|
-
timeSitePublished?: Date;
|
905
|
+
timeSitePublished?: Date | null;
|
838
906
|
}
|
839
907
|
interface ProgallerypublisherPublishGalleryRequest {
|
840
908
|
/** id of the gallery that will be published */
|
@@ -846,12 +914,12 @@ interface GetActiveGalleryRevisionRequest {
|
|
846
914
|
galleryId?: string;
|
847
915
|
}
|
848
916
|
interface GetActiveGalleryRevisionResponse {
|
849
|
-
galleryActiveRevision?: Date;
|
917
|
+
galleryActiveRevision?: Date | null;
|
850
918
|
htmlSiteRevision?: string | null;
|
851
919
|
}
|
852
920
|
interface GetGalleryRevisionRequest {
|
853
921
|
galleryId?: string;
|
854
|
-
revision?: Date;
|
922
|
+
revision?: Date | null;
|
855
923
|
}
|
856
924
|
interface GetGalleryRevisionResponse {
|
857
925
|
htmlSiteRevision?: string | null;
|
@@ -932,7 +1000,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
932
1000
|
/** ID of the entity associated with the event. */
|
933
1001
|
entityId?: string;
|
934
1002
|
/** 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;
|
1003
|
+
eventTime?: Date | null;
|
936
1004
|
/**
|
937
1005
|
* Whether the event was triggered as a result of a privacy regulation application
|
938
1006
|
* (for example, GDPR).
|
@@ -961,7 +1029,7 @@ interface EntityCreatedEvent {
|
|
961
1029
|
entity?: string;
|
962
1030
|
}
|
963
1031
|
interface RestoreInfo {
|
964
|
-
deletedDate?: Date;
|
1032
|
+
deletedDate?: Date | null;
|
965
1033
|
}
|
966
1034
|
interface EntityUpdatedEvent {
|
967
1035
|
/**
|
@@ -1490,7 +1558,7 @@ interface EventMetadata extends BaseEventMetadata {
|
|
1490
1558
|
/** ID of the entity associated with the event. */
|
1491
1559
|
entityId?: string;
|
1492
1560
|
/** 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;
|
1561
|
+
eventTime?: Date | null;
|
1494
1562
|
/**
|
1495
1563
|
* Whether the event was triggered as a result of a privacy regulation application
|
1496
1564
|
* (for example, GDPR).
|
@@ -1600,7 +1668,7 @@ interface UpdateGallery {
|
|
1600
1668
|
* Date and time the gallery was created.
|
1601
1669
|
* @readonly
|
1602
1670
|
*/
|
1603
|
-
_createdDate?: Date;
|
1671
|
+
_createdDate?: Date | null;
|
1604
1672
|
}
|
1605
1673
|
interface DeleteGalleryItemsOptions {
|
1606
1674
|
/** ID of the media item to delete. */
|
@@ -1647,12 +1715,12 @@ interface UpdateGalleryItem {
|
|
1647
1715
|
* Date and time the item was created.
|
1648
1716
|
* @readonly
|
1649
1717
|
*/
|
1650
|
-
_createdDate?: Date;
|
1718
|
+
_createdDate?: Date | null;
|
1651
1719
|
/**
|
1652
1720
|
* Date and time the item was last updated.
|
1653
1721
|
* @readonly
|
1654
1722
|
*/
|
1655
|
-
_updatedDate?: Date;
|
1723
|
+
_updatedDate?: Date | null;
|
1656
1724
|
/** Item tags. */
|
1657
1725
|
tags?: Tags;
|
1658
1726
|
}
|
@@ -1818,30 +1886,12 @@ interface DeleteGalleryItemSignature {
|
|
1818
1886
|
*/
|
1819
1887
|
(identifiers: DeleteGalleryItemIdentifiers): Promise<DeleteGalleryItemResponse & DeleteGalleryItemResponseNonNullableFields>;
|
1820
1888
|
}
|
1821
|
-
declare const onGalleryCreated$1: EventDefinition
|
1822
|
-
declare const onGalleryUpdated$1: EventDefinition
|
1823
|
-
declare const onGalleryDeleted$1: EventDefinition
|
1824
|
-
declare const onGalleryItemCreated$1: EventDefinition
|
1825
|
-
declare const onGalleryItemUpdated$1: EventDefinition
|
1826
|
-
declare const onGalleryItemDeleted$1: EventDefinition
|
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
|
-
}
|
1889
|
+
declare const onGalleryCreated$1: EventDefinition<GalleryCreatedEnvelope, "wix.pro_gallery.gallery_v2_created">;
|
1890
|
+
declare const onGalleryUpdated$1: EventDefinition<GalleryUpdatedEnvelope, "wix.pro_gallery.gallery_v2_updated">;
|
1891
|
+
declare const onGalleryDeleted$1: EventDefinition<GalleryDeletedEnvelope, "wix.pro_gallery.gallery_v2_deleted">;
|
1892
|
+
declare const onGalleryItemCreated$1: EventDefinition<GalleryItemCreatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_created">;
|
1893
|
+
declare const onGalleryItemUpdated$1: EventDefinition<GalleryItemUpdatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_updated">;
|
1894
|
+
declare const onGalleryItemDeleted$1: EventDefinition<GalleryItemDeletedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_deleted">;
|
1845
1895
|
|
1846
1896
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
1847
1897
|
|
@@ -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
|
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
|
74
|
-
type EventHandler
|
75
|
-
type BuildEventDefinition
|
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> =
|
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
|
314
|
-
|
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
|
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
|
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. */
|
@@ -467,12 +535,12 @@ interface Item extends ItemMetadataOneOf {
|
|
467
535
|
* Date and time the item was created.
|
468
536
|
* @readonly
|
469
537
|
*/
|
470
|
-
_createdDate?: Date;
|
538
|
+
_createdDate?: Date | null;
|
471
539
|
/**
|
472
540
|
* Date and time the item was last updated.
|
473
541
|
* @readonly
|
474
542
|
*/
|
475
|
-
_updatedDate?: Date;
|
543
|
+
_updatedDate?: Date | null;
|
476
544
|
/** Item tags. */
|
477
545
|
tags?: Tags;
|
478
546
|
}
|
@@ -822,9 +890,9 @@ interface GalleryPublished {
|
|
822
890
|
galleryId?: string;
|
823
891
|
isRc?: boolean;
|
824
892
|
/** @readonly */
|
825
|
-
newRevision?: Date;
|
893
|
+
newRevision?: Date | null;
|
826
894
|
/** @readonly */
|
827
|
-
oldRevision?: Date;
|
895
|
+
oldRevision?: Date | null;
|
828
896
|
}
|
829
897
|
interface CleanDeletedGalleriesEvent {
|
830
898
|
/** @readonly */
|
@@ -834,7 +902,7 @@ interface CleanDeletedGalleriesEvent {
|
|
834
902
|
/** @readonly */
|
835
903
|
htmlSiteRevision?: string;
|
836
904
|
/** @readonly */
|
837
|
-
timeSitePublished?: Date;
|
905
|
+
timeSitePublished?: Date | null;
|
838
906
|
}
|
839
907
|
interface ProgallerypublisherPublishGalleryRequest {
|
840
908
|
/** id of the gallery that will be published */
|
@@ -846,12 +914,12 @@ interface GetActiveGalleryRevisionRequest {
|
|
846
914
|
galleryId?: string;
|
847
915
|
}
|
848
916
|
interface GetActiveGalleryRevisionResponse {
|
849
|
-
galleryActiveRevision?: Date;
|
917
|
+
galleryActiveRevision?: Date | null;
|
850
918
|
htmlSiteRevision?: string | null;
|
851
919
|
}
|
852
920
|
interface GetGalleryRevisionRequest {
|
853
921
|
galleryId?: string;
|
854
|
-
revision?: Date;
|
922
|
+
revision?: Date | null;
|
855
923
|
}
|
856
924
|
interface GetGalleryRevisionResponse {
|
857
925
|
htmlSiteRevision?: string | null;
|
@@ -932,7 +1000,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
932
1000
|
/** ID of the entity associated with the event. */
|
933
1001
|
entityId?: string;
|
934
1002
|
/** 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;
|
1003
|
+
eventTime?: Date | null;
|
936
1004
|
/**
|
937
1005
|
* Whether the event was triggered as a result of a privacy regulation application
|
938
1006
|
* (for example, GDPR).
|
@@ -961,7 +1029,7 @@ interface EntityCreatedEvent {
|
|
961
1029
|
entity?: string;
|
962
1030
|
}
|
963
1031
|
interface RestoreInfo {
|
964
|
-
deletedDate?: Date;
|
1032
|
+
deletedDate?: Date | null;
|
965
1033
|
}
|
966
1034
|
interface EntityUpdatedEvent {
|
967
1035
|
/**
|
@@ -1490,7 +1558,7 @@ interface EventMetadata extends BaseEventMetadata {
|
|
1490
1558
|
/** ID of the entity associated with the event. */
|
1491
1559
|
entityId?: string;
|
1492
1560
|
/** 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;
|
1561
|
+
eventTime?: Date | null;
|
1494
1562
|
/**
|
1495
1563
|
* Whether the event was triggered as a result of a privacy regulation application
|
1496
1564
|
* (for example, GDPR).
|
@@ -1600,7 +1668,7 @@ interface UpdateGallery {
|
|
1600
1668
|
* Date and time the gallery was created.
|
1601
1669
|
* @readonly
|
1602
1670
|
*/
|
1603
|
-
_createdDate?: Date;
|
1671
|
+
_createdDate?: Date | null;
|
1604
1672
|
}
|
1605
1673
|
interface DeleteGalleryItemsOptions {
|
1606
1674
|
/** ID of the media item to delete. */
|
@@ -1647,12 +1715,12 @@ interface UpdateGalleryItem {
|
|
1647
1715
|
* Date and time the item was created.
|
1648
1716
|
* @readonly
|
1649
1717
|
*/
|
1650
|
-
_createdDate?: Date;
|
1718
|
+
_createdDate?: Date | null;
|
1651
1719
|
/**
|
1652
1720
|
* Date and time the item was last updated.
|
1653
1721
|
* @readonly
|
1654
1722
|
*/
|
1655
|
-
_updatedDate?: Date;
|
1723
|
+
_updatedDate?: Date | null;
|
1656
1724
|
/** Item tags. */
|
1657
1725
|
tags?: Tags;
|
1658
1726
|
}
|
@@ -1818,30 +1886,12 @@ interface DeleteGalleryItemSignature {
|
|
1818
1886
|
*/
|
1819
1887
|
(identifiers: DeleteGalleryItemIdentifiers): Promise<DeleteGalleryItemResponse & DeleteGalleryItemResponseNonNullableFields>;
|
1820
1888
|
}
|
1821
|
-
declare const onGalleryCreated$1: EventDefinition
|
1822
|
-
declare const onGalleryUpdated$1: EventDefinition
|
1823
|
-
declare const onGalleryDeleted$1: EventDefinition
|
1824
|
-
declare const onGalleryItemCreated$1: EventDefinition
|
1825
|
-
declare const onGalleryItemUpdated$1: EventDefinition
|
1826
|
-
declare const onGalleryItemDeleted$1: EventDefinition
|
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
|
-
}
|
1889
|
+
declare const onGalleryCreated$1: EventDefinition<GalleryCreatedEnvelope, "wix.pro_gallery.gallery_v2_created">;
|
1890
|
+
declare const onGalleryUpdated$1: EventDefinition<GalleryUpdatedEnvelope, "wix.pro_gallery.gallery_v2_updated">;
|
1891
|
+
declare const onGalleryDeleted$1: EventDefinition<GalleryDeletedEnvelope, "wix.pro_gallery.gallery_v2_deleted">;
|
1892
|
+
declare const onGalleryItemCreated$1: EventDefinition<GalleryItemCreatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_created">;
|
1893
|
+
declare const onGalleryItemUpdated$1: EventDefinition<GalleryItemUpdatedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_updated">;
|
1894
|
+
declare const onGalleryItemDeleted$1: EventDefinition<GalleryItemDeletedEnvelope, "wix.pro_gallery.gallery_v2_gallery_item_deleted">;
|
1845
1895
|
|
1846
1896
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
1847
1897
|
|
@@ -23,7 +23,7 @@ interface Gallery$1 {
|
|
23
23
|
* Date and time the gallery was created.
|
24
24
|
* @readonly
|
25
25
|
*/
|
26
|
-
createdDate?: Date;
|
26
|
+
createdDate?: Date | null;
|
27
27
|
}
|
28
28
|
interface Item$1 extends ItemMetadataOneOf$1 {
|
29
29
|
/** Details about the image. */
|
@@ -57,12 +57,12 @@ interface Item$1 extends ItemMetadataOneOf$1 {
|
|
57
57
|
* Date and time the item was created.
|
58
58
|
* @readonly
|
59
59
|
*/
|
60
|
-
createdDate?: Date;
|
60
|
+
createdDate?: Date | null;
|
61
61
|
/**
|
62
62
|
* Date and time the item was last updated.
|
63
63
|
* @readonly
|
64
64
|
*/
|
65
|
-
updatedDate?: Date;
|
65
|
+
updatedDate?: Date | null;
|
66
66
|
/** Item tags. */
|
67
67
|
tags?: Tags$1;
|
68
68
|
}
|
@@ -572,7 +572,7 @@ interface Gallery {
|
|
572
572
|
* Date and time the gallery was created.
|
573
573
|
* @readonly
|
574
574
|
*/
|
575
|
-
_createdDate?: Date;
|
575
|
+
_createdDate?: Date | null;
|
576
576
|
}
|
577
577
|
interface Item extends ItemMetadataOneOf {
|
578
578
|
/** Details about the image. */
|
@@ -606,12 +606,12 @@ interface Item extends ItemMetadataOneOf {
|
|
606
606
|
* Date and time the item was created.
|
607
607
|
* @readonly
|
608
608
|
*/
|
609
|
-
_createdDate?: Date;
|
609
|
+
_createdDate?: Date | null;
|
610
610
|
/**
|
611
611
|
* Date and time the item was last updated.
|
612
612
|
* @readonly
|
613
613
|
*/
|
614
|
-
_updatedDate?: Date;
|
614
|
+
_updatedDate?: Date | null;
|
615
615
|
/** Item tags. */
|
616
616
|
tags?: Tags;
|
617
617
|
}
|