@wix/portfolio 1.0.98 → 1.0.100
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/portfolio",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.100",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"type-bundles"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wix/portfolio_collections": "1.0.
|
|
22
|
-
"@wix/portfolio_portfolio-settings": "1.0.
|
|
23
|
-
"@wix/portfolio_project-in-collections": "1.0.
|
|
24
|
-
"@wix/portfolio_project-items": "1.0.
|
|
25
|
-
"@wix/portfolio_projects": "1.0.
|
|
26
|
-
"@wix/portfolio_synced-project": "1.0.
|
|
21
|
+
"@wix/portfolio_collections": "1.0.31",
|
|
22
|
+
"@wix/portfolio_portfolio-settings": "1.0.17",
|
|
23
|
+
"@wix/portfolio_project-in-collections": "1.0.32",
|
|
24
|
+
"@wix/portfolio_project-items": "1.0.35",
|
|
25
|
+
"@wix/portfolio_projects": "1.0.44",
|
|
26
|
+
"@wix/portfolio_synced-project": "1.0.14"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"glob": "^10.4.1",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"fqdn": ""
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
"falconPackageHash": "
|
|
51
|
+
"falconPackageHash": "f527d5cf1f5f7f9402dfb9c8f44dd0c37485756113ffcdd117a2be98"
|
|
52
52
|
}
|
|
@@ -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,
|
|
@@ -504,7 +572,7 @@ interface Keyword$2 {
|
|
|
504
572
|
term?: string;
|
|
505
573
|
/** Whether the keyword is the main focus keyword. */
|
|
506
574
|
isMain?: boolean;
|
|
507
|
-
/**
|
|
575
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
508
576
|
origin?: string | null;
|
|
509
577
|
}
|
|
510
578
|
interface Tag$2 {
|
|
@@ -1146,29 +1214,11 @@ interface QueryCollectionsSignature {
|
|
|
1146
1214
|
*/
|
|
1147
1215
|
(options?: QueryCollectionsOptions | undefined): CollectionsQueryBuilder;
|
|
1148
1216
|
}
|
|
1149
|
-
declare const onCollectionCreated$1: EventDefinition
|
|
1150
|
-
declare const onCollectionUpdated$1: EventDefinition
|
|
1151
|
-
declare const onCollectionDeleted$1: EventDefinition
|
|
1152
|
-
|
|
1153
|
-
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
1154
|
-
__type: 'event-definition';
|
|
1155
|
-
type: Type;
|
|
1156
|
-
isDomainEvent?: boolean;
|
|
1157
|
-
transformations?: (envelope: unknown) => Payload;
|
|
1158
|
-
__payload: Payload;
|
|
1159
|
-
};
|
|
1160
|
-
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
1161
|
-
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
1162
|
-
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
1163
|
-
|
|
1164
|
-
declare global {
|
|
1165
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1166
|
-
interface SymbolConstructor {
|
|
1167
|
-
readonly observable: symbol;
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1217
|
+
declare const onCollectionCreated$1: EventDefinition<CollectionCreatedEnvelope, "wix.portfolio.collections.v1.collection_created">;
|
|
1218
|
+
declare const onCollectionUpdated$1: EventDefinition<CollectionUpdatedEnvelope, "wix.portfolio.collections.v1.collection_updated">;
|
|
1219
|
+
declare const onCollectionDeleted$1: EventDefinition<CollectionDeletedEnvelope, "wix.portfolio.collections.v1.collection_deleted">;
|
|
1170
1220
|
|
|
1171
|
-
declare function createEventModule$3<T extends EventDefinition
|
|
1221
|
+
declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
1172
1222
|
|
|
1173
1223
|
declare const createCollection: MaybeContext<BuildRESTFunction<typeof createCollection$1> & typeof createCollection$1>;
|
|
1174
1224
|
declare const getCollection: MaybeContext<BuildRESTFunction<typeof getCollection$1> & typeof getCollection$1>;
|
|
@@ -2342,29 +2392,11 @@ interface DuplicateProjectItemsSignature {
|
|
|
2342
2392
|
*/
|
|
2343
2393
|
(originProjectId: string, options: DuplicateProjectItemsOptions): Promise<DuplicateProjectItemsResponse & DuplicateProjectItemsResponseNonNullableFields>;
|
|
2344
2394
|
}
|
|
2345
|
-
declare const onProjectItemCreated$1: EventDefinition
|
|
2346
|
-
declare const onProjectItemUpdated$1: EventDefinition
|
|
2347
|
-
declare const onProjectItemDeleted$1: EventDefinition
|
|
2348
|
-
|
|
2349
|
-
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
2350
|
-
__type: 'event-definition';
|
|
2351
|
-
type: Type;
|
|
2352
|
-
isDomainEvent?: boolean;
|
|
2353
|
-
transformations?: (envelope: unknown) => Payload;
|
|
2354
|
-
__payload: Payload;
|
|
2355
|
-
};
|
|
2356
|
-
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
2357
|
-
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
2358
|
-
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
2359
|
-
|
|
2360
|
-
declare global {
|
|
2361
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2362
|
-
interface SymbolConstructor {
|
|
2363
|
-
readonly observable: symbol;
|
|
2364
|
-
}
|
|
2365
|
-
}
|
|
2395
|
+
declare const onProjectItemCreated$1: EventDefinition<ProjectItemCreatedEnvelope, "wix.portfolio.project_items.v1.project_item_created">;
|
|
2396
|
+
declare const onProjectItemUpdated$1: EventDefinition<ProjectItemUpdatedEnvelope, "wix.portfolio.project_items.v1.project_item_updated">;
|
|
2397
|
+
declare const onProjectItemDeleted$1: EventDefinition<ProjectItemDeletedEnvelope, "wix.portfolio.project_items.v1.project_item_deleted">;
|
|
2366
2398
|
|
|
2367
|
-
declare function createEventModule$2<T extends EventDefinition
|
|
2399
|
+
declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
2368
2400
|
|
|
2369
2401
|
declare const createProjectItem: MaybeContext<BuildRESTFunction<typeof createProjectItem$1> & typeof createProjectItem$1>;
|
|
2370
2402
|
declare const bulkCreateProjectItems: MaybeContext<BuildRESTFunction<typeof bulkCreateProjectItems$1> & typeof bulkCreateProjectItems$1>;
|
|
@@ -2639,7 +2671,7 @@ interface Keyword$1 {
|
|
|
2639
2671
|
term?: string;
|
|
2640
2672
|
/** Whether the keyword is the main focus keyword. */
|
|
2641
2673
|
isMain?: boolean;
|
|
2642
|
-
/**
|
|
2674
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
2643
2675
|
origin?: string | null;
|
|
2644
2676
|
}
|
|
2645
2677
|
interface Tag$1 {
|
|
@@ -3809,29 +3841,11 @@ interface QueryProjectsWithCollectionInfoSignature {
|
|
|
3809
3841
|
*/
|
|
3810
3842
|
(query: QueryV2$1, options?: QueryProjectsWithCollectionInfoOptions | undefined): Promise<QueryProjectWithCollectionInfoResponse & QueryProjectWithCollectionInfoResponseNonNullableFields>;
|
|
3811
3843
|
}
|
|
3812
|
-
declare const onProjectCreated$1: EventDefinition
|
|
3813
|
-
declare const onProjectUpdated$1: EventDefinition
|
|
3814
|
-
declare const onProjectDeleted$1: EventDefinition
|
|
3844
|
+
declare const onProjectCreated$1: EventDefinition<ProjectCreatedEnvelope, "wix.portfolio.projects.v1.project_created">;
|
|
3845
|
+
declare const onProjectUpdated$1: EventDefinition<ProjectUpdatedEnvelope, "wix.portfolio.projects.v1.project_updated">;
|
|
3846
|
+
declare const onProjectDeleted$1: EventDefinition<ProjectDeletedEnvelope, "wix.portfolio.projects.v1.project_deleted">;
|
|
3815
3847
|
|
|
3816
|
-
|
|
3817
|
-
__type: 'event-definition';
|
|
3818
|
-
type: Type;
|
|
3819
|
-
isDomainEvent?: boolean;
|
|
3820
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3821
|
-
__payload: Payload;
|
|
3822
|
-
};
|
|
3823
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
3824
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
3825
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
3826
|
-
|
|
3827
|
-
declare global {
|
|
3828
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3829
|
-
interface SymbolConstructor {
|
|
3830
|
-
readonly observable: symbol;
|
|
3831
|
-
}
|
|
3832
|
-
}
|
|
3833
|
-
|
|
3834
|
-
declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
3848
|
+
declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
3835
3849
|
|
|
3836
3850
|
declare const getProjectPageData: MaybeContext<BuildRESTFunction<typeof getProjectPageData$1> & typeof getProjectPageData$1>;
|
|
3837
3851
|
declare const createProject: MaybeContext<BuildRESTFunction<typeof createProject$1> & typeof createProject$1>;
|
|
@@ -4127,7 +4141,7 @@ interface Keyword {
|
|
|
4127
4141
|
term?: string;
|
|
4128
4142
|
/** Whether the keyword is the main focus keyword. */
|
|
4129
4143
|
isMain?: boolean;
|
|
4130
|
-
/**
|
|
4144
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
4131
4145
|
origin?: string | null;
|
|
4132
4146
|
}
|
|
4133
4147
|
interface Tag {
|
|
@@ -4605,25 +4619,7 @@ interface UpdateProjectOrderInCollectionSignature {
|
|
|
4605
4619
|
*/
|
|
4606
4620
|
(identifiers: UpdateProjectOrderInCollectionIdentifiers, sortOrder: number | null): Promise<UpdateProjectOrderInCollectionResponse & UpdateProjectOrderInCollectionResponseNonNullableFields>;
|
|
4607
4621
|
}
|
|
4608
|
-
declare const onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1: EventDefinition
|
|
4609
|
-
|
|
4610
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
4611
|
-
__type: 'event-definition';
|
|
4612
|
-
type: Type;
|
|
4613
|
-
isDomainEvent?: boolean;
|
|
4614
|
-
transformations?: (envelope: unknown) => Payload;
|
|
4615
|
-
__payload: Payload;
|
|
4616
|
-
};
|
|
4617
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
4618
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
4619
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
4620
|
-
|
|
4621
|
-
declare global {
|
|
4622
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4623
|
-
interface SymbolConstructor {
|
|
4624
|
-
readonly observable: symbol;
|
|
4625
|
-
}
|
|
4626
|
-
}
|
|
4622
|
+
declare const onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1: EventDefinition<ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope, "wix.portfolio.projects.v1.project_in_collection_project_order_in_collection_updated_event">;
|
|
4627
4623
|
|
|
4628
4624
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
4629
4625
|
|
|
@@ -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,
|
|
@@ -504,7 +572,7 @@ interface Keyword$2 {
|
|
|
504
572
|
term?: string;
|
|
505
573
|
/** Whether the keyword is the main focus keyword. */
|
|
506
574
|
isMain?: boolean;
|
|
507
|
-
/**
|
|
575
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
508
576
|
origin?: string | null;
|
|
509
577
|
}
|
|
510
578
|
interface Tag$2 {
|
|
@@ -1146,29 +1214,11 @@ interface QueryCollectionsSignature {
|
|
|
1146
1214
|
*/
|
|
1147
1215
|
(options?: QueryCollectionsOptions | undefined): CollectionsQueryBuilder;
|
|
1148
1216
|
}
|
|
1149
|
-
declare const onCollectionCreated$1: EventDefinition
|
|
1150
|
-
declare const onCollectionUpdated$1: EventDefinition
|
|
1151
|
-
declare const onCollectionDeleted$1: EventDefinition
|
|
1152
|
-
|
|
1153
|
-
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
1154
|
-
__type: 'event-definition';
|
|
1155
|
-
type: Type;
|
|
1156
|
-
isDomainEvent?: boolean;
|
|
1157
|
-
transformations?: (envelope: unknown) => Payload;
|
|
1158
|
-
__payload: Payload;
|
|
1159
|
-
};
|
|
1160
|
-
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
1161
|
-
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
1162
|
-
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
1163
|
-
|
|
1164
|
-
declare global {
|
|
1165
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1166
|
-
interface SymbolConstructor {
|
|
1167
|
-
readonly observable: symbol;
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1217
|
+
declare const onCollectionCreated$1: EventDefinition<CollectionCreatedEnvelope, "wix.portfolio.collections.v1.collection_created">;
|
|
1218
|
+
declare const onCollectionUpdated$1: EventDefinition<CollectionUpdatedEnvelope, "wix.portfolio.collections.v1.collection_updated">;
|
|
1219
|
+
declare const onCollectionDeleted$1: EventDefinition<CollectionDeletedEnvelope, "wix.portfolio.collections.v1.collection_deleted">;
|
|
1170
1220
|
|
|
1171
|
-
declare function createEventModule$3<T extends EventDefinition
|
|
1221
|
+
declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
1172
1222
|
|
|
1173
1223
|
declare const createCollection: MaybeContext<BuildRESTFunction<typeof createCollection$1> & typeof createCollection$1>;
|
|
1174
1224
|
declare const getCollection: MaybeContext<BuildRESTFunction<typeof getCollection$1> & typeof getCollection$1>;
|
|
@@ -2342,29 +2392,11 @@ interface DuplicateProjectItemsSignature {
|
|
|
2342
2392
|
*/
|
|
2343
2393
|
(originProjectId: string, options: DuplicateProjectItemsOptions): Promise<DuplicateProjectItemsResponse & DuplicateProjectItemsResponseNonNullableFields>;
|
|
2344
2394
|
}
|
|
2345
|
-
declare const onProjectItemCreated$1: EventDefinition
|
|
2346
|
-
declare const onProjectItemUpdated$1: EventDefinition
|
|
2347
|
-
declare const onProjectItemDeleted$1: EventDefinition
|
|
2348
|
-
|
|
2349
|
-
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
2350
|
-
__type: 'event-definition';
|
|
2351
|
-
type: Type;
|
|
2352
|
-
isDomainEvent?: boolean;
|
|
2353
|
-
transformations?: (envelope: unknown) => Payload;
|
|
2354
|
-
__payload: Payload;
|
|
2355
|
-
};
|
|
2356
|
-
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
2357
|
-
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
2358
|
-
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
2359
|
-
|
|
2360
|
-
declare global {
|
|
2361
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2362
|
-
interface SymbolConstructor {
|
|
2363
|
-
readonly observable: symbol;
|
|
2364
|
-
}
|
|
2365
|
-
}
|
|
2395
|
+
declare const onProjectItemCreated$1: EventDefinition<ProjectItemCreatedEnvelope, "wix.portfolio.project_items.v1.project_item_created">;
|
|
2396
|
+
declare const onProjectItemUpdated$1: EventDefinition<ProjectItemUpdatedEnvelope, "wix.portfolio.project_items.v1.project_item_updated">;
|
|
2397
|
+
declare const onProjectItemDeleted$1: EventDefinition<ProjectItemDeletedEnvelope, "wix.portfolio.project_items.v1.project_item_deleted">;
|
|
2366
2398
|
|
|
2367
|
-
declare function createEventModule$2<T extends EventDefinition
|
|
2399
|
+
declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
2368
2400
|
|
|
2369
2401
|
declare const createProjectItem: MaybeContext<BuildRESTFunction<typeof createProjectItem$1> & typeof createProjectItem$1>;
|
|
2370
2402
|
declare const bulkCreateProjectItems: MaybeContext<BuildRESTFunction<typeof bulkCreateProjectItems$1> & typeof bulkCreateProjectItems$1>;
|
|
@@ -2639,7 +2671,7 @@ interface Keyword$1 {
|
|
|
2639
2671
|
term?: string;
|
|
2640
2672
|
/** Whether the keyword is the main focus keyword. */
|
|
2641
2673
|
isMain?: boolean;
|
|
2642
|
-
/**
|
|
2674
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
2643
2675
|
origin?: string | null;
|
|
2644
2676
|
}
|
|
2645
2677
|
interface Tag$1 {
|
|
@@ -3809,29 +3841,11 @@ interface QueryProjectsWithCollectionInfoSignature {
|
|
|
3809
3841
|
*/
|
|
3810
3842
|
(query: QueryV2$1, options?: QueryProjectsWithCollectionInfoOptions | undefined): Promise<QueryProjectWithCollectionInfoResponse & QueryProjectWithCollectionInfoResponseNonNullableFields>;
|
|
3811
3843
|
}
|
|
3812
|
-
declare const onProjectCreated$1: EventDefinition
|
|
3813
|
-
declare const onProjectUpdated$1: EventDefinition
|
|
3814
|
-
declare const onProjectDeleted$1: EventDefinition
|
|
3844
|
+
declare const onProjectCreated$1: EventDefinition<ProjectCreatedEnvelope, "wix.portfolio.projects.v1.project_created">;
|
|
3845
|
+
declare const onProjectUpdated$1: EventDefinition<ProjectUpdatedEnvelope, "wix.portfolio.projects.v1.project_updated">;
|
|
3846
|
+
declare const onProjectDeleted$1: EventDefinition<ProjectDeletedEnvelope, "wix.portfolio.projects.v1.project_deleted">;
|
|
3815
3847
|
|
|
3816
|
-
|
|
3817
|
-
__type: 'event-definition';
|
|
3818
|
-
type: Type;
|
|
3819
|
-
isDomainEvent?: boolean;
|
|
3820
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3821
|
-
__payload: Payload;
|
|
3822
|
-
};
|
|
3823
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
3824
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
3825
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
3826
|
-
|
|
3827
|
-
declare global {
|
|
3828
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3829
|
-
interface SymbolConstructor {
|
|
3830
|
-
readonly observable: symbol;
|
|
3831
|
-
}
|
|
3832
|
-
}
|
|
3833
|
-
|
|
3834
|
-
declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
3848
|
+
declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
3835
3849
|
|
|
3836
3850
|
declare const getProjectPageData: MaybeContext<BuildRESTFunction<typeof getProjectPageData$1> & typeof getProjectPageData$1>;
|
|
3837
3851
|
declare const createProject: MaybeContext<BuildRESTFunction<typeof createProject$1> & typeof createProject$1>;
|
|
@@ -4127,7 +4141,7 @@ interface Keyword {
|
|
|
4127
4141
|
term?: string;
|
|
4128
4142
|
/** Whether the keyword is the main focus keyword. */
|
|
4129
4143
|
isMain?: boolean;
|
|
4130
|
-
/**
|
|
4144
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
4131
4145
|
origin?: string | null;
|
|
4132
4146
|
}
|
|
4133
4147
|
interface Tag {
|
|
@@ -4605,25 +4619,7 @@ interface UpdateProjectOrderInCollectionSignature {
|
|
|
4605
4619
|
*/
|
|
4606
4620
|
(identifiers: UpdateProjectOrderInCollectionIdentifiers, sortOrder: number | null): Promise<UpdateProjectOrderInCollectionResponse & UpdateProjectOrderInCollectionResponseNonNullableFields>;
|
|
4607
4621
|
}
|
|
4608
|
-
declare const onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1: EventDefinition
|
|
4609
|
-
|
|
4610
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
4611
|
-
__type: 'event-definition';
|
|
4612
|
-
type: Type;
|
|
4613
|
-
isDomainEvent?: boolean;
|
|
4614
|
-
transformations?: (envelope: unknown) => Payload;
|
|
4615
|
-
__payload: Payload;
|
|
4616
|
-
};
|
|
4617
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
4618
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
4619
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
4620
|
-
|
|
4621
|
-
declare global {
|
|
4622
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4623
|
-
interface SymbolConstructor {
|
|
4624
|
-
readonly observable: symbol;
|
|
4625
|
-
}
|
|
4626
|
-
}
|
|
4622
|
+
declare const onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1: EventDefinition<ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope, "wix.portfolio.projects.v1.project_in_collection_project_order_in_collection_updated_event">;
|
|
4627
4623
|
|
|
4628
4624
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
4629
4625
|
|
|
@@ -99,7 +99,7 @@ interface Keyword$5 {
|
|
|
99
99
|
term?: string;
|
|
100
100
|
/** Whether the keyword is the main focus keyword. */
|
|
101
101
|
isMain?: boolean;
|
|
102
|
-
/**
|
|
102
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
103
103
|
origin?: string | null;
|
|
104
104
|
}
|
|
105
105
|
interface Tag$5 {
|
|
@@ -405,7 +405,7 @@ interface Keyword$4 {
|
|
|
405
405
|
term?: string;
|
|
406
406
|
/** Whether the keyword is the main focus keyword. */
|
|
407
407
|
isMain?: boolean;
|
|
408
|
-
/**
|
|
408
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
409
409
|
origin?: string | null;
|
|
410
410
|
}
|
|
411
411
|
interface Tag$4 {
|
|
@@ -1822,7 +1822,7 @@ interface Keyword$3 {
|
|
|
1822
1822
|
term?: string;
|
|
1823
1823
|
/** Whether the keyword is the main focus keyword. */
|
|
1824
1824
|
isMain?: boolean;
|
|
1825
|
-
/**
|
|
1825
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
1826
1826
|
origin?: string | null;
|
|
1827
1827
|
}
|
|
1828
1828
|
interface Tag$3 {
|
|
@@ -2355,7 +2355,7 @@ interface Keyword$2 {
|
|
|
2355
2355
|
term?: string;
|
|
2356
2356
|
/** Whether the keyword is the main focus keyword. */
|
|
2357
2357
|
isMain?: boolean;
|
|
2358
|
-
/**
|
|
2358
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
2359
2359
|
origin?: string | null;
|
|
2360
2360
|
}
|
|
2361
2361
|
interface Tag$2 {
|
|
@@ -2973,7 +2973,7 @@ interface Keyword$1 {
|
|
|
2973
2973
|
term?: string;
|
|
2974
2974
|
/** Whether the keyword is the main focus keyword. */
|
|
2975
2975
|
isMain?: boolean;
|
|
2976
|
-
/**
|
|
2976
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
2977
2977
|
origin?: string | null;
|
|
2978
2978
|
}
|
|
2979
2979
|
interface Tag$1 {
|
|
@@ -3334,7 +3334,7 @@ interface Keyword {
|
|
|
3334
3334
|
term?: string;
|
|
3335
3335
|
/** Whether the keyword is the main focus keyword. */
|
|
3336
3336
|
isMain?: boolean;
|
|
3337
|
-
/**
|
|
3337
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
3338
3338
|
origin?: string | null;
|
|
3339
3339
|
}
|
|
3340
3340
|
interface Tag {
|