@wix/portfolio 1.0.98 → 1.0.99
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 +8 -8
- package/type-bundles/context.bundle.d.ts +3169 -783
- package/type-bundles/index.bundle.d.ts +3169 -783
- package/type-bundles/meta.bundle.d.ts +6 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type HostModule<T, H extends Host> = {
|
|
1
|
+
type HostModule$5<T, H extends Host$5> = {
|
|
2
2
|
__type: 'host';
|
|
3
3
|
create(host: H): T;
|
|
4
4
|
};
|
|
5
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
-
type Host<Environment = unknown> = {
|
|
5
|
+
type HostModuleAPI$5<T extends HostModule$5<any, any>> = T extends HostModule$5<infer U, any> ? U : never;
|
|
6
|
+
type Host$5<Environment = unknown> = {
|
|
7
7
|
channel: {
|
|
8
8
|
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
9
|
disconnect: () => void;
|
|
@@ -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
|
*/
|
|
@@ -36,92 +40,92 @@ type Host<Environment = unknown> = {
|
|
|
36
40
|
};
|
|
37
41
|
};
|
|
38
42
|
|
|
39
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
40
|
-
interface HttpClient {
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
43
|
+
type RESTFunctionDescriptor$5<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$5) => T;
|
|
44
|
+
interface HttpClient$5 {
|
|
45
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$5<TResponse, TData>): Promise<HttpResponse$5<TResponse>>;
|
|
42
46
|
fetchWithAuth: typeof fetch;
|
|
43
47
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
48
|
getActiveToken?: () => string | undefined;
|
|
45
49
|
}
|
|
46
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
47
|
-
type HttpResponse<T = any> = {
|
|
50
|
+
type RequestOptionsFactory$5<TResponse = any, TData = any> = (context: any) => RequestOptions$5<TResponse, TData>;
|
|
51
|
+
type HttpResponse$5<T = any> = {
|
|
48
52
|
data: T;
|
|
49
53
|
status: number;
|
|
50
54
|
statusText: string;
|
|
51
55
|
headers: any;
|
|
52
56
|
request?: any;
|
|
53
57
|
};
|
|
54
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
58
|
+
type RequestOptions$5<_TResponse = any, Data = any> = {
|
|
55
59
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
56
60
|
url: string;
|
|
57
61
|
data?: Data;
|
|
58
62
|
params?: URLSearchParams;
|
|
59
|
-
} & APIMetadata;
|
|
60
|
-
type APIMetadata = {
|
|
63
|
+
} & APIMetadata$5;
|
|
64
|
+
type APIMetadata$5 = {
|
|
61
65
|
methodFqn?: string;
|
|
62
66
|
entityFqdn?: string;
|
|
63
67
|
packageName?: string;
|
|
64
68
|
};
|
|
65
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
66
|
-
type EventDefinition$
|
|
69
|
+
type BuildRESTFunction$5<T extends RESTFunctionDescriptor$5> = T extends RESTFunctionDescriptor$5<infer U> ? U : never;
|
|
70
|
+
type EventDefinition$5<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$5<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$5<Payload, Type>;
|
|
78
|
+
type EventHandler$5<T extends EventDefinition$5> = (payload: T['__payload']) => void | Promise<void>;
|
|
79
|
+
type BuildEventDefinition$5<T extends EventDefinition$5<any, string>> = (handler: EventHandler$5<T>) => void;
|
|
76
80
|
|
|
77
|
-
type ServicePluginMethodInput = {
|
|
81
|
+
type ServicePluginMethodInput$5 = {
|
|
78
82
|
request: any;
|
|
79
83
|
metadata: any;
|
|
80
84
|
};
|
|
81
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
82
|
-
type ServicePluginMethodMetadata = {
|
|
85
|
+
type ServicePluginContract$5 = Record<string, (payload: ServicePluginMethodInput$5) => unknown | Promise<unknown>>;
|
|
86
|
+
type ServicePluginMethodMetadata$5 = {
|
|
83
87
|
name: string;
|
|
84
88
|
primaryHttpMappingPath: string;
|
|
85
89
|
transformations: {
|
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
90
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$5;
|
|
87
91
|
toREST: (...args: unknown[]) => unknown;
|
|
88
92
|
};
|
|
89
93
|
};
|
|
90
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
94
|
+
type ServicePluginDefinition$5<Contract extends ServicePluginContract$5> = {
|
|
91
95
|
__type: 'service-plugin-definition';
|
|
92
96
|
componentType: string;
|
|
93
|
-
methods: ServicePluginMethodMetadata[];
|
|
97
|
+
methods: ServicePluginMethodMetadata$5[];
|
|
94
98
|
__contract: Contract;
|
|
95
99
|
};
|
|
96
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
97
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
98
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
100
|
+
declare function ServicePluginDefinition$5<Contract extends ServicePluginContract$5>(componentType: string, methods: ServicePluginMethodMetadata$5[]): ServicePluginDefinition$5<Contract>;
|
|
101
|
+
type BuildServicePluginDefinition$5<T extends ServicePluginDefinition$5<any>> = (implementation: T['__contract']) => void;
|
|
102
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$5 = "wix_spi_error";
|
|
99
103
|
|
|
100
|
-
type RequestContext = {
|
|
104
|
+
type RequestContext$5 = {
|
|
101
105
|
isSSR: boolean;
|
|
102
106
|
host: string;
|
|
103
107
|
protocol?: string;
|
|
104
108
|
};
|
|
105
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
109
|
+
type ResponseTransformer$5 = (data: any, headers?: any) => any;
|
|
106
110
|
/**
|
|
107
111
|
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
108
112
|
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
109
113
|
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
110
114
|
*/
|
|
111
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
112
|
-
type AmbassadorRequestOptions<T = any> = {
|
|
115
|
+
type Method$5 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
116
|
+
type AmbassadorRequestOptions$5<T = any> = {
|
|
113
117
|
_?: T;
|
|
114
118
|
url?: string;
|
|
115
|
-
method?: Method;
|
|
119
|
+
method?: Method$5;
|
|
116
120
|
params?: any;
|
|
117
121
|
data?: any;
|
|
118
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
122
|
+
transformResponse?: ResponseTransformer$5 | ResponseTransformer$5[];
|
|
119
123
|
};
|
|
120
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
124
|
+
type AmbassadorFactory$5<Request, Response> = (payload: Request) => ((context: RequestContext$5) => AmbassadorRequestOptions$5<Response>) & {
|
|
121
125
|
__isAmbassador: boolean;
|
|
122
126
|
};
|
|
123
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
124
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
127
|
+
type AmbassadorFunctionDescriptor$5<Request = any, Response = any> = AmbassadorFactory$5<Request, Response>;
|
|
128
|
+
type BuildAmbassadorFunction$5<T extends AmbassadorFunctionDescriptor$5> = T extends AmbassadorFunctionDescriptor$5<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
125
129
|
|
|
126
130
|
declare global {
|
|
127
131
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -130,7 +134,7 @@ declare global {
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
|
|
133
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
137
|
+
declare const emptyObjectSymbol$5: unique symbol;
|
|
134
138
|
|
|
135
139
|
/**
|
|
136
140
|
Represents a strictly empty plain object, the `{}` value.
|
|
@@ -158,7 +162,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
|
|
|
158
162
|
|
|
159
163
|
@category Object
|
|
160
164
|
*/
|
|
161
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
165
|
+
type EmptyObject$5 = {[emptyObjectSymbol$5]?: never};
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
168
|
Returns a boolean for whether the two given types are equal.
|
|
@@ -186,7 +190,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
186
190
|
@category Type Guard
|
|
187
191
|
@category Utilities
|
|
188
192
|
*/
|
|
189
|
-
type IsEqual<A, B> =
|
|
193
|
+
type IsEqual$5<A, B> =
|
|
190
194
|
(<G>() => G extends A ? 1 : 2) extends
|
|
191
195
|
(<G>() => G extends B ? 1 : 2)
|
|
192
196
|
? true
|
|
@@ -219,9 +223,9 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
219
223
|
|
|
220
224
|
@see {Except}
|
|
221
225
|
*/
|
|
222
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
226
|
+
type Filter$5<KeyType, ExcludeType> = IsEqual$5<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
227
|
|
|
224
|
-
type ExceptOptions = {
|
|
228
|
+
type ExceptOptions$5 = {
|
|
225
229
|
/**
|
|
226
230
|
Disallow assigning non-specified properties.
|
|
227
231
|
|
|
@@ -265,12 +269,78 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
|
265
269
|
|
|
266
270
|
@category Object
|
|
267
271
|
*/
|
|
268
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
269
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
272
|
+
type Except$5<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$5 = {requireExactProps: false}> = {
|
|
273
|
+
[KeyType in keyof ObjectType as Filter$5<KeyType, KeysType>]: ObjectType[KeyType];
|
|
270
274
|
} & (Options['requireExactProps'] extends true
|
|
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$5<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$5<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
341
|
+
IsNever$5<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$5<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$5<Base[Key], IfNever$5<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`.
|
|
@@ -357,9 +425,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
|
357
425
|
|
|
358
426
|
@category Object
|
|
359
427
|
*/
|
|
360
|
-
type ConditionalExcept<Base, Condition> = Except<
|
|
428
|
+
type ConditionalExcept$5<Base, Condition> = Except$5<
|
|
361
429
|
Base,
|
|
362
|
-
ConditionalKeys<Base, Condition>
|
|
430
|
+
ConditionalKeys$5<Base, Condition>
|
|
363
431
|
>;
|
|
364
432
|
|
|
365
433
|
/**
|
|
@@ -367,8 +435,8 @@ 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$
|
|
371
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
|
438
|
+
type Descriptors$5 = RESTFunctionDescriptor$5 | AmbassadorFunctionDescriptor$5 | HostModule$5<any, any> | EventDefinition$5<any> | ServicePluginDefinition$5<any> | {
|
|
439
|
+
[key: string]: Descriptors$5 | PublicMetadata$5 | any;
|
|
372
440
|
};
|
|
373
441
|
/**
|
|
374
442
|
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
@@ -376,12 +444,12 @@ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostM
|
|
|
376
444
|
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
377
445
|
* do not match the given host (as they will not work with the given host).
|
|
378
446
|
*/
|
|
379
|
-
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
447
|
+
type BuildDescriptors$5<T extends Descriptors$5, H extends Host$5<any> | undefined, Depth extends number = 5> = {
|
|
380
448
|
done: T;
|
|
381
449
|
recurse: T extends {
|
|
382
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
383
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$
|
|
384
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
450
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$5;
|
|
451
|
+
} ? never : T extends AmbassadorFunctionDescriptor$5 ? BuildAmbassadorFunction$5<T> : T extends RESTFunctionDescriptor$5 ? BuildRESTFunction$5<T> : T extends EventDefinition$5<any> ? BuildEventDefinition$5<T> : T extends ServicePluginDefinition$5<any> ? BuildServicePluginDefinition$5<T> : T extends HostModule$5<any, any> ? HostModuleAPI$5<T> : ConditionalExcept$5<{
|
|
452
|
+
[Key in keyof T]: T[Key] extends Descriptors$5 ? BuildDescriptors$5<T[Key], H, [
|
|
385
453
|
-1,
|
|
386
454
|
0,
|
|
387
455
|
1,
|
|
@@ -390,9 +458,9 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
|
|
|
390
458
|
4,
|
|
391
459
|
5
|
|
392
460
|
][Depth]> : never;
|
|
393
|
-
}, EmptyObject>;
|
|
461
|
+
}, EmptyObject$5>;
|
|
394
462
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
-
type PublicMetadata = {
|
|
463
|
+
type PublicMetadata$5 = {
|
|
396
464
|
PACKAGE_NAME?: string;
|
|
397
465
|
};
|
|
398
466
|
|
|
@@ -404,9 +472,9 @@ declare global {
|
|
|
404
472
|
* A type used to create concerete types from SDK descriptors in
|
|
405
473
|
* case a contextual client is available.
|
|
406
474
|
*/
|
|
407
|
-
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
408
|
-
host: Host;
|
|
409
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
475
|
+
type MaybeContext$5<T extends Descriptors$5> = globalThis.ContextualClient extends {
|
|
476
|
+
host: Host$5;
|
|
477
|
+
} ? BuildDescriptors$5<T, globalThis.ContextualClient['host']> : T;
|
|
410
478
|
|
|
411
479
|
interface Collection {
|
|
412
480
|
/**
|
|
@@ -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 {
|
|
@@ -1092,7 +1160,7 @@ interface CollectionsQueryBuilder {
|
|
|
1092
1160
|
find: () => Promise<CollectionsQueryResult>;
|
|
1093
1161
|
}
|
|
1094
1162
|
|
|
1095
|
-
declare function createCollection$1(httpClient: HttpClient): CreateCollectionSignature;
|
|
1163
|
+
declare function createCollection$1(httpClient: HttpClient$5): CreateCollectionSignature;
|
|
1096
1164
|
interface CreateCollectionSignature {
|
|
1097
1165
|
/**
|
|
1098
1166
|
* Creates a collection.
|
|
@@ -1101,7 +1169,7 @@ interface CreateCollectionSignature {
|
|
|
1101
1169
|
*/
|
|
1102
1170
|
(collection: Collection): Promise<Collection & CollectionNonNullableFields>;
|
|
1103
1171
|
}
|
|
1104
|
-
declare function getCollection$1(httpClient: HttpClient): GetCollectionSignature;
|
|
1172
|
+
declare function getCollection$1(httpClient: HttpClient$5): GetCollectionSignature;
|
|
1105
1173
|
interface GetCollectionSignature {
|
|
1106
1174
|
/**
|
|
1107
1175
|
* Retrieves a collection.
|
|
@@ -1110,14 +1178,14 @@ interface GetCollectionSignature {
|
|
|
1110
1178
|
*/
|
|
1111
1179
|
(collectionId: string, options?: GetCollectionOptions | undefined): Promise<Collection & CollectionNonNullableFields>;
|
|
1112
1180
|
}
|
|
1113
|
-
declare function listCollections$1(httpClient: HttpClient): ListCollectionsSignature;
|
|
1181
|
+
declare function listCollections$1(httpClient: HttpClient$5): ListCollectionsSignature;
|
|
1114
1182
|
interface ListCollectionsSignature {
|
|
1115
1183
|
/**
|
|
1116
1184
|
* Retrieves a list all collections in a portfolio.
|
|
1117
1185
|
*/
|
|
1118
1186
|
(options?: ListCollectionsOptions | undefined): Promise<ListCollectionsResponse & ListCollectionsResponseNonNullableFields>;
|
|
1119
1187
|
}
|
|
1120
|
-
declare function updateCollection$1(httpClient: HttpClient): UpdateCollectionSignature;
|
|
1188
|
+
declare function updateCollection$1(httpClient: HttpClient$5): UpdateCollectionSignature;
|
|
1121
1189
|
interface UpdateCollectionSignature {
|
|
1122
1190
|
/**
|
|
1123
1191
|
* Updates a collection.
|
|
@@ -1126,7 +1194,7 @@ interface UpdateCollectionSignature {
|
|
|
1126
1194
|
*/
|
|
1127
1195
|
(_id: string | null, collection: UpdateCollection): Promise<Collection & CollectionNonNullableFields>;
|
|
1128
1196
|
}
|
|
1129
|
-
declare function deleteCollection$1(httpClient: HttpClient): DeleteCollectionSignature;
|
|
1197
|
+
declare function deleteCollection$1(httpClient: HttpClient$5): DeleteCollectionSignature;
|
|
1130
1198
|
interface DeleteCollectionSignature {
|
|
1131
1199
|
/**
|
|
1132
1200
|
* Deletes a collection.
|
|
@@ -1134,7 +1202,7 @@ interface DeleteCollectionSignature {
|
|
|
1134
1202
|
*/
|
|
1135
1203
|
(collectionId: string): Promise<DeleteCollectionResponse & DeleteCollectionResponseNonNullableFields>;
|
|
1136
1204
|
}
|
|
1137
|
-
declare function queryCollections$1(httpClient: HttpClient): QueryCollectionsSignature;
|
|
1205
|
+
declare function queryCollections$1(httpClient: HttpClient$5): QueryCollectionsSignature;
|
|
1138
1206
|
interface QueryCollectionsSignature {
|
|
1139
1207
|
/**
|
|
1140
1208
|
* Retrieves a list of collections, given the provided paging, filtering, and sorting. Up to 100 collections can be returned per request.
|
|
@@ -1146,36 +1214,18 @@ 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$5<CollectionCreatedEnvelope, "wix.portfolio.collections.v1.collection_created">;
|
|
1218
|
+
declare const onCollectionUpdated$1: EventDefinition$5<CollectionUpdatedEnvelope, "wix.portfolio.collections.v1.collection_updated">;
|
|
1219
|
+
declare const onCollectionDeleted$1: EventDefinition$5<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$5<any, string>>(eventDefinition: T): BuildEventDefinition$5<T> & T;
|
|
1172
1222
|
|
|
1173
|
-
declare const createCollection: MaybeContext<BuildRESTFunction<typeof createCollection$1> & typeof createCollection$1>;
|
|
1174
|
-
declare const getCollection: MaybeContext<BuildRESTFunction<typeof getCollection$1> & typeof getCollection$1>;
|
|
1175
|
-
declare const listCollections: MaybeContext<BuildRESTFunction<typeof listCollections$1> & typeof listCollections$1>;
|
|
1176
|
-
declare const updateCollection: MaybeContext<BuildRESTFunction<typeof updateCollection$1> & typeof updateCollection$1>;
|
|
1177
|
-
declare const deleteCollection: MaybeContext<BuildRESTFunction<typeof deleteCollection$1> & typeof deleteCollection$1>;
|
|
1178
|
-
declare const queryCollections: MaybeContext<BuildRESTFunction<typeof queryCollections$1> & typeof queryCollections$1>;
|
|
1223
|
+
declare const createCollection: MaybeContext$5<BuildRESTFunction$5<typeof createCollection$1> & typeof createCollection$1>;
|
|
1224
|
+
declare const getCollection: MaybeContext$5<BuildRESTFunction$5<typeof getCollection$1> & typeof getCollection$1>;
|
|
1225
|
+
declare const listCollections: MaybeContext$5<BuildRESTFunction$5<typeof listCollections$1> & typeof listCollections$1>;
|
|
1226
|
+
declare const updateCollection: MaybeContext$5<BuildRESTFunction$5<typeof updateCollection$1> & typeof updateCollection$1>;
|
|
1227
|
+
declare const deleteCollection: MaybeContext$5<BuildRESTFunction$5<typeof deleteCollection$1> & typeof deleteCollection$1>;
|
|
1228
|
+
declare const queryCollections: MaybeContext$5<BuildRESTFunction$5<typeof queryCollections$1> & typeof queryCollections$1>;
|
|
1179
1229
|
|
|
1180
1230
|
type _publicOnCollectionCreatedType = typeof onCollectionCreated$1;
|
|
1181
1231
|
/**
|
|
@@ -1241,338 +1291,1294 @@ declare namespace index_d$5 {
|
|
|
1241
1291
|
export { type ActionEvent$5 as ActionEvent, type index_d$5_AdminRemoveMenuItemsResponse as AdminRemoveMenuItemsResponse, type App$2 as App, type BaseEventMetadata$3 as BaseEventMetadata, type index_d$5_Collection as Collection, type index_d$5_CollectionCreatedEnvelope as CollectionCreatedEnvelope, type index_d$5_CollectionDeletedEnvelope as CollectionDeletedEnvelope, type index_d$5_CollectionNonNullableFields as CollectionNonNullableFields, type index_d$5_CollectionUpdatedEnvelope as CollectionUpdatedEnvelope, type index_d$5_CollectionsQueryBuilder as CollectionsQueryBuilder, type index_d$5_CollectionsQueryResult as CollectionsQueryResult, type index_d$5_CreateCollectionRequest as CreateCollectionRequest, type index_d$5_CreateCollectionResponse as CreateCollectionResponse, type index_d$5_CreateCollectionResponseNonNullableFields as CreateCollectionResponseNonNullableFields, type CursorPaging$4 as CursorPaging, type Cursors$4 as Cursors, type index_d$5_DeleteCollectionRequest as DeleteCollectionRequest, type index_d$5_DeleteCollectionResponse as DeleteCollectionResponse, type index_d$5_DeleteCollectionResponseNonNullableFields as DeleteCollectionResponseNonNullableFields, type DomainEvent$5 as DomainEvent, type DomainEventBodyOneOf$5 as DomainEventBodyOneOf, type Empty$3 as Empty, type EntityCreatedEvent$5 as EntityCreatedEvent, type EntityDeletedEvent$5 as EntityDeletedEvent, type EntityUpdatedEvent$5 as EntityUpdatedEvent, type EventMetadata$3 as EventMetadata, type File$2 as File, type index_d$5_GetCollectionOptions as GetCollectionOptions, type index_d$5_GetCollectionRequest as GetCollectionRequest, type index_d$5_GetCollectionResponse as GetCollectionResponse, type index_d$5_GetCollectionResponseNonNullableFields as GetCollectionResponseNonNullableFields, type IdentificationData$5 as IdentificationData, type IdentificationDataIdOneOf$5 as IdentificationDataIdOneOf, type Image$3 as Image, ImageType$3 as ImageType, type InvalidateCache$2 as InvalidateCache, type InvalidateCacheGetByOneOf$2 as InvalidateCacheGetByOneOf, type Keyword$2 as Keyword, type index_d$5_ListCollectionsOptions as ListCollectionsOptions, type index_d$5_ListCollectionsRequest as ListCollectionsRequest, type index_d$5_ListCollectionsResponse as ListCollectionsResponse, type index_d$5_ListCollectionsResponseNonNullableFields as ListCollectionsResponseNonNullableFields, type MessageEnvelope$5 as MessageEnvelope, type Page$2 as Page, type Paging$3 as Paging, type PagingMetadataV2$4 as PagingMetadataV2, type Point$3 as Point, type index_d$5_QueryCollectionsOptions as QueryCollectionsOptions, type index_d$5_QueryCollectionsRequest as QueryCollectionsRequest, type index_d$5_QueryCollectionsResponse as QueryCollectionsResponse, type index_d$5_QueryCollectionsResponseNonNullableFields as QueryCollectionsResponseNonNullableFields, type QueryV2$3 as QueryV2, type QueryV2PagingMethodOneOf$3 as QueryV2PagingMethodOneOf, type RestoreInfo$5 as RestoreInfo, type SeoSchema$2 as SeoSchema, type Settings$2 as Settings, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, type Tag$2 as Tag, type URI$2 as URI, type UnsharpMasking$3 as UnsharpMasking, type index_d$5_UpdateCollection as UpdateCollection, type index_d$5_UpdateCollectionRequest as UpdateCollectionRequest, type index_d$5_UpdateCollectionResponse as UpdateCollectionResponse, type index_d$5_UpdateCollectionResponseNonNullableFields as UpdateCollectionResponseNonNullableFields, WebhookIdentityType$5 as WebhookIdentityType, type index_d$5__publicOnCollectionCreatedType as _publicOnCollectionCreatedType, type index_d$5__publicOnCollectionDeletedType as _publicOnCollectionDeletedType, type index_d$5__publicOnCollectionUpdatedType as _publicOnCollectionUpdatedType, index_d$5_createCollection as createCollection, index_d$5_deleteCollection as deleteCollection, index_d$5_getCollection as getCollection, index_d$5_listCollections as listCollections, index_d$5_onCollectionCreated as onCollectionCreated, index_d$5_onCollectionDeleted as onCollectionDeleted, index_d$5_onCollectionUpdated as onCollectionUpdated, onCollectionCreated$1 as publicOnCollectionCreated, onCollectionDeleted$1 as publicOnCollectionDeleted, onCollectionUpdated$1 as publicOnCollectionUpdated, index_d$5_queryCollections as queryCollections, index_d$5_updateCollection as updateCollection };
|
|
1242
1292
|
}
|
|
1243
1293
|
|
|
1244
|
-
|
|
1294
|
+
type HostModule$4<T, H extends Host$4> = {
|
|
1295
|
+
__type: 'host';
|
|
1296
|
+
create(host: H): T;
|
|
1297
|
+
};
|
|
1298
|
+
type HostModuleAPI$4<T extends HostModule$4<any, any>> = T extends HostModule$4<infer U, any> ? U : never;
|
|
1299
|
+
type Host$4<Environment = unknown> = {
|
|
1300
|
+
channel: {
|
|
1301
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
1302
|
+
disconnect: () => void;
|
|
1303
|
+
} | Promise<{
|
|
1304
|
+
disconnect: () => void;
|
|
1305
|
+
}>;
|
|
1306
|
+
};
|
|
1307
|
+
environment?: Environment;
|
|
1245
1308
|
/**
|
|
1246
|
-
*
|
|
1247
|
-
* @readonly
|
|
1309
|
+
* Optional name of the environment, use for logging
|
|
1248
1310
|
*/
|
|
1249
|
-
|
|
1250
|
-
/** Portfolio's project item settings. */
|
|
1251
|
-
projectItemSettings?: ProjectItemSettings;
|
|
1252
|
-
/** Portfolio's media settings. */
|
|
1253
|
-
mediaSettings?: MediaSettings;
|
|
1311
|
+
name?: string;
|
|
1254
1312
|
/**
|
|
1255
|
-
*
|
|
1256
|
-
* @readonly
|
|
1313
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
1257
1314
|
*/
|
|
1258
|
-
|
|
1315
|
+
apiBaseUrl?: string;
|
|
1259
1316
|
/**
|
|
1260
|
-
*
|
|
1261
|
-
*
|
|
1317
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
1318
|
+
* like internationalization, billing, etc.
|
|
1262
1319
|
*/
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
}
|
|
1286
|
-
interface SiteMenuSettings {
|
|
1287
|
-
/** Whether to automatically update the site menu */
|
|
1288
|
-
autoUpdateMenu?: boolean | null;
|
|
1289
|
-
}
|
|
1290
|
-
interface CreatePortfolioSettingsRequest {
|
|
1291
|
-
/** The portfolio settings to create. */
|
|
1292
|
-
portfolioSettings: PortfolioSettings;
|
|
1293
|
-
}
|
|
1294
|
-
interface CreatePortfolioSettingsResponse {
|
|
1295
|
-
/** Newly created portfolio settings. */
|
|
1296
|
-
portfolioSettings?: PortfolioSettings;
|
|
1297
|
-
}
|
|
1298
|
-
interface GetPortfolioSettingsRequest {
|
|
1299
|
-
}
|
|
1300
|
-
interface GetPortfolioSettingsResponse {
|
|
1301
|
-
/** Portfolio settings. */
|
|
1302
|
-
portfolioSettings?: PortfolioSettings;
|
|
1303
|
-
}
|
|
1304
|
-
interface UpdatePortfolioSettingsRequest {
|
|
1305
|
-
/** The portfolio settings to update. */
|
|
1306
|
-
portfolioSettings: PortfolioSettings;
|
|
1307
|
-
}
|
|
1308
|
-
interface UpdatePortfolioSettingsResponse {
|
|
1309
|
-
/** Updated portfolio settings. */
|
|
1310
|
-
updatedPortfolioSettings?: PortfolioSettings;
|
|
1320
|
+
essentials?: {
|
|
1321
|
+
/**
|
|
1322
|
+
* The language of the currently viewed session
|
|
1323
|
+
*/
|
|
1324
|
+
language?: string;
|
|
1325
|
+
/**
|
|
1326
|
+
* The locale of the currently viewed session
|
|
1327
|
+
*/
|
|
1328
|
+
locale?: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* Any headers that should be passed through to the API requests
|
|
1331
|
+
*/
|
|
1332
|
+
passThroughHeaders?: Record<string, string>;
|
|
1333
|
+
};
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
|
|
1337
|
+
interface HttpClient$4 {
|
|
1338
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
|
|
1339
|
+
fetchWithAuth: typeof fetch;
|
|
1340
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1341
|
+
getActiveToken?: () => string | undefined;
|
|
1311
1342
|
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1343
|
+
type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
|
|
1344
|
+
type HttpResponse$4<T = any> = {
|
|
1345
|
+
data: T;
|
|
1346
|
+
status: number;
|
|
1347
|
+
statusText: string;
|
|
1348
|
+
headers: any;
|
|
1349
|
+
request?: any;
|
|
1350
|
+
};
|
|
1351
|
+
type RequestOptions$4<_TResponse = any, Data = any> = {
|
|
1352
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1353
|
+
url: string;
|
|
1354
|
+
data?: Data;
|
|
1355
|
+
params?: URLSearchParams;
|
|
1356
|
+
} & APIMetadata$4;
|
|
1357
|
+
type APIMetadata$4 = {
|
|
1358
|
+
methodFqn?: string;
|
|
1326
1359
|
entityFqdn?: string;
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
*/
|
|
1341
|
-
triggeredByAnonymizeRequest?: boolean | null;
|
|
1342
|
-
/** If present, indicates the action that triggered the event. */
|
|
1343
|
-
originatedFrom?: string | null;
|
|
1344
|
-
/**
|
|
1345
|
-
* A sequence number defining the order of updates to the underlying entity.
|
|
1346
|
-
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1347
|
-
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1348
|
-
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1349
|
-
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1350
|
-
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1351
|
-
*/
|
|
1352
|
-
entityEventSequence?: string | null;
|
|
1353
|
-
}
|
|
1354
|
-
/** @oneof */
|
|
1355
|
-
interface DomainEventBodyOneOf$4 {
|
|
1356
|
-
createdEvent?: EntityCreatedEvent$4;
|
|
1357
|
-
updatedEvent?: EntityUpdatedEvent$4;
|
|
1358
|
-
deletedEvent?: EntityDeletedEvent$4;
|
|
1359
|
-
actionEvent?: ActionEvent$4;
|
|
1360
|
-
}
|
|
1361
|
-
interface EntityCreatedEvent$4 {
|
|
1362
|
-
entity?: string;
|
|
1363
|
-
}
|
|
1364
|
-
interface RestoreInfo$4 {
|
|
1365
|
-
deletedDate?: Date;
|
|
1366
|
-
}
|
|
1367
|
-
interface EntityUpdatedEvent$4 {
|
|
1368
|
-
/**
|
|
1369
|
-
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
1370
|
-
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
1371
|
-
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
1372
|
-
*/
|
|
1373
|
-
currentEntity?: string;
|
|
1374
|
-
}
|
|
1375
|
-
interface EntityDeletedEvent$4 {
|
|
1376
|
-
/** Entity that was deleted */
|
|
1377
|
-
deletedEntity?: string | null;
|
|
1378
|
-
}
|
|
1379
|
-
interface ActionEvent$4 {
|
|
1380
|
-
body?: string;
|
|
1381
|
-
}
|
|
1382
|
-
interface MessageEnvelope$4 {
|
|
1383
|
-
/** App instance ID. */
|
|
1384
|
-
instanceId?: string | null;
|
|
1385
|
-
/** Event type. */
|
|
1386
|
-
eventType?: string;
|
|
1387
|
-
/** The identification type and identity data. */
|
|
1388
|
-
identity?: IdentificationData$4;
|
|
1389
|
-
/** Stringify payload. */
|
|
1390
|
-
data?: string;
|
|
1391
|
-
}
|
|
1392
|
-
interface IdentificationData$4 extends IdentificationDataIdOneOf$4 {
|
|
1393
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
1394
|
-
anonymousVisitorId?: string;
|
|
1395
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
1396
|
-
memberId?: string;
|
|
1397
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1398
|
-
wixUserId?: string;
|
|
1399
|
-
/** ID of an app. */
|
|
1400
|
-
appId?: string;
|
|
1401
|
-
/** @readonly */
|
|
1402
|
-
identityType?: WebhookIdentityType$4;
|
|
1403
|
-
}
|
|
1404
|
-
/** @oneof */
|
|
1405
|
-
interface IdentificationDataIdOneOf$4 {
|
|
1406
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
1407
|
-
anonymousVisitorId?: string;
|
|
1408
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
1409
|
-
memberId?: string;
|
|
1410
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1411
|
-
wixUserId?: string;
|
|
1412
|
-
/** ID of an app. */
|
|
1413
|
-
appId?: string;
|
|
1414
|
-
}
|
|
1415
|
-
declare enum WebhookIdentityType$4 {
|
|
1416
|
-
UNKNOWN = "UNKNOWN",
|
|
1417
|
-
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1418
|
-
MEMBER = "MEMBER",
|
|
1419
|
-
WIX_USER = "WIX_USER",
|
|
1420
|
-
APP = "APP"
|
|
1421
|
-
}
|
|
1422
|
-
interface ProjectItemSettingsNonNullableFields {
|
|
1423
|
-
addItemDirection: AddItemDirection;
|
|
1424
|
-
defaultItemName: DefaultItemName;
|
|
1425
|
-
}
|
|
1426
|
-
interface PortfolioSettingsNonNullableFields {
|
|
1427
|
-
projectItemSettings?: ProjectItemSettingsNonNullableFields;
|
|
1428
|
-
}
|
|
1429
|
-
interface CreatePortfolioSettingsResponseNonNullableFields {
|
|
1430
|
-
portfolioSettings?: PortfolioSettingsNonNullableFields;
|
|
1431
|
-
}
|
|
1432
|
-
interface GetPortfolioSettingsResponseNonNullableFields {
|
|
1433
|
-
portfolioSettings?: PortfolioSettingsNonNullableFields;
|
|
1434
|
-
}
|
|
1435
|
-
interface UpdatePortfolioSettingsResponseNonNullableFields {
|
|
1436
|
-
updatedPortfolioSettings?: PortfolioSettingsNonNullableFields;
|
|
1437
|
-
}
|
|
1360
|
+
packageName?: string;
|
|
1361
|
+
};
|
|
1362
|
+
type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
|
|
1363
|
+
type EventDefinition$4<Payload = unknown, Type extends string = string> = {
|
|
1364
|
+
__type: 'event-definition';
|
|
1365
|
+
type: Type;
|
|
1366
|
+
isDomainEvent?: boolean;
|
|
1367
|
+
transformations?: (envelope: unknown) => Payload;
|
|
1368
|
+
__payload: Payload;
|
|
1369
|
+
};
|
|
1370
|
+
declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
1371
|
+
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
1372
|
+
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
1438
1373
|
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
(portfolioSettings: PortfolioSettings): Promise<UpdatePortfolioSettingsResponse & UpdatePortfolioSettingsResponseNonNullableFields>;
|
|
1462
|
-
}
|
|
1374
|
+
type ServicePluginMethodInput$4 = {
|
|
1375
|
+
request: any;
|
|
1376
|
+
metadata: any;
|
|
1377
|
+
};
|
|
1378
|
+
type ServicePluginContract$4 = Record<string, (payload: ServicePluginMethodInput$4) => unknown | Promise<unknown>>;
|
|
1379
|
+
type ServicePluginMethodMetadata$4 = {
|
|
1380
|
+
name: string;
|
|
1381
|
+
primaryHttpMappingPath: string;
|
|
1382
|
+
transformations: {
|
|
1383
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$4;
|
|
1384
|
+
toREST: (...args: unknown[]) => unknown;
|
|
1385
|
+
};
|
|
1386
|
+
};
|
|
1387
|
+
type ServicePluginDefinition$4<Contract extends ServicePluginContract$4> = {
|
|
1388
|
+
__type: 'service-plugin-definition';
|
|
1389
|
+
componentType: string;
|
|
1390
|
+
methods: ServicePluginMethodMetadata$4[];
|
|
1391
|
+
__contract: Contract;
|
|
1392
|
+
};
|
|
1393
|
+
declare function ServicePluginDefinition$4<Contract extends ServicePluginContract$4>(componentType: string, methods: ServicePluginMethodMetadata$4[]): ServicePluginDefinition$4<Contract>;
|
|
1394
|
+
type BuildServicePluginDefinition$4<T extends ServicePluginDefinition$4<any>> = (implementation: T['__contract']) => void;
|
|
1395
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$4 = "wix_spi_error";
|
|
1463
1396
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1397
|
+
type RequestContext$4 = {
|
|
1398
|
+
isSSR: boolean;
|
|
1399
|
+
host: string;
|
|
1400
|
+
protocol?: string;
|
|
1401
|
+
};
|
|
1402
|
+
type ResponseTransformer$4 = (data: any, headers?: any) => any;
|
|
1403
|
+
/**
|
|
1404
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
1405
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
1406
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
1407
|
+
*/
|
|
1408
|
+
type Method$4 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
1409
|
+
type AmbassadorRequestOptions$4<T = any> = {
|
|
1410
|
+
_?: T;
|
|
1411
|
+
url?: string;
|
|
1412
|
+
method?: Method$4;
|
|
1413
|
+
params?: any;
|
|
1414
|
+
data?: any;
|
|
1415
|
+
transformResponse?: ResponseTransformer$4 | ResponseTransformer$4[];
|
|
1416
|
+
};
|
|
1417
|
+
type AmbassadorFactory$4<Request, Response> = (payload: Request) => ((context: RequestContext$4) => AmbassadorRequestOptions$4<Response>) & {
|
|
1418
|
+
__isAmbassador: boolean;
|
|
1419
|
+
};
|
|
1420
|
+
type AmbassadorFunctionDescriptor$4<Request = any, Response = any> = AmbassadorFactory$4<Request, Response>;
|
|
1421
|
+
type BuildAmbassadorFunction$4<T extends AmbassadorFunctionDescriptor$4> = T extends AmbassadorFunctionDescriptor$4<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
1467
1422
|
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
type index_d$4_DefaultItemName = DefaultItemName;
|
|
1474
|
-
declare const index_d$4_DefaultItemName: typeof DefaultItemName;
|
|
1475
|
-
type index_d$4_GetPortfolioSettingsRequest = GetPortfolioSettingsRequest;
|
|
1476
|
-
type index_d$4_GetPortfolioSettingsResponse = GetPortfolioSettingsResponse;
|
|
1477
|
-
type index_d$4_GetPortfolioSettingsResponseNonNullableFields = GetPortfolioSettingsResponseNonNullableFields;
|
|
1478
|
-
type index_d$4_MediaSettings = MediaSettings;
|
|
1479
|
-
type index_d$4_PortfolioSettings = PortfolioSettings;
|
|
1480
|
-
type index_d$4_PortfolioSettingsNonNullableFields = PortfolioSettingsNonNullableFields;
|
|
1481
|
-
type index_d$4_ProjectItemSettings = ProjectItemSettings;
|
|
1482
|
-
type index_d$4_SiteMenuSettings = SiteMenuSettings;
|
|
1483
|
-
type index_d$4_UpdatePortfolioSettingsRequest = UpdatePortfolioSettingsRequest;
|
|
1484
|
-
type index_d$4_UpdatePortfolioSettingsResponse = UpdatePortfolioSettingsResponse;
|
|
1485
|
-
type index_d$4_UpdatePortfolioSettingsResponseNonNullableFields = UpdatePortfolioSettingsResponseNonNullableFields;
|
|
1486
|
-
declare const index_d$4_createPortfolioSettings: typeof createPortfolioSettings;
|
|
1487
|
-
declare const index_d$4_getPortfolioSettings: typeof getPortfolioSettings;
|
|
1488
|
-
declare const index_d$4_updatePortfolioSettings: typeof updatePortfolioSettings;
|
|
1489
|
-
declare namespace index_d$4 {
|
|
1490
|
-
export { type ActionEvent$4 as ActionEvent, index_d$4_AddItemDirection as AddItemDirection, type index_d$4_CreatePortfolioSettingsRequest as CreatePortfolioSettingsRequest, type index_d$4_CreatePortfolioSettingsResponse as CreatePortfolioSettingsResponse, type index_d$4_CreatePortfolioSettingsResponseNonNullableFields as CreatePortfolioSettingsResponseNonNullableFields, index_d$4_DefaultItemName as DefaultItemName, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, type index_d$4_GetPortfolioSettingsRequest as GetPortfolioSettingsRequest, type index_d$4_GetPortfolioSettingsResponse as GetPortfolioSettingsResponse, type index_d$4_GetPortfolioSettingsResponseNonNullableFields as GetPortfolioSettingsResponseNonNullableFields, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, type index_d$4_MediaSettings as MediaSettings, type MessageEnvelope$4 as MessageEnvelope, type index_d$4_PortfolioSettings as PortfolioSettings, type index_d$4_PortfolioSettingsNonNullableFields as PortfolioSettingsNonNullableFields, type index_d$4_ProjectItemSettings as ProjectItemSettings, type RestoreInfo$4 as RestoreInfo, type index_d$4_SiteMenuSettings as SiteMenuSettings, type index_d$4_UpdatePortfolioSettingsRequest as UpdatePortfolioSettingsRequest, type index_d$4_UpdatePortfolioSettingsResponse as UpdatePortfolioSettingsResponse, type index_d$4_UpdatePortfolioSettingsResponseNonNullableFields as UpdatePortfolioSettingsResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, index_d$4_createPortfolioSettings as createPortfolioSettings, index_d$4_getPortfolioSettings as getPortfolioSettings, index_d$4_updatePortfolioSettings as updatePortfolioSettings };
|
|
1423
|
+
declare global {
|
|
1424
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1425
|
+
interface SymbolConstructor {
|
|
1426
|
+
readonly observable: symbol;
|
|
1427
|
+
}
|
|
1491
1428
|
}
|
|
1492
1429
|
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1430
|
+
declare const emptyObjectSymbol$4: unique symbol;
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
1434
|
+
|
|
1435
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
1436
|
+
|
|
1437
|
+
@example
|
|
1438
|
+
```
|
|
1439
|
+
import type {EmptyObject} from 'type-fest';
|
|
1440
|
+
|
|
1441
|
+
// The following illustrates the problem with `{}`.
|
|
1442
|
+
const foo1: {} = {}; // Pass
|
|
1443
|
+
const foo2: {} = []; // Pass
|
|
1444
|
+
const foo3: {} = 42; // Pass
|
|
1445
|
+
const foo4: {} = {a: 1}; // Pass
|
|
1446
|
+
|
|
1447
|
+
// With `EmptyObject` only the first case is valid.
|
|
1448
|
+
const bar1: EmptyObject = {}; // Pass
|
|
1449
|
+
const bar2: EmptyObject = 42; // Fail
|
|
1450
|
+
const bar3: EmptyObject = []; // Fail
|
|
1451
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
1452
|
+
```
|
|
1453
|
+
|
|
1454
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
1455
|
+
|
|
1456
|
+
@category Object
|
|
1457
|
+
*/
|
|
1458
|
+
type EmptyObject$4 = {[emptyObjectSymbol$4]?: never};
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
Returns a boolean for whether the two given types are equal.
|
|
1462
|
+
|
|
1463
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
1464
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
1465
|
+
|
|
1466
|
+
Use-cases:
|
|
1467
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
1468
|
+
|
|
1469
|
+
@example
|
|
1470
|
+
```
|
|
1471
|
+
import type {IsEqual} from 'type-fest';
|
|
1472
|
+
|
|
1473
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
1474
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
1475
|
+
type Includes<Value extends readonly any[], Item> =
|
|
1476
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
1477
|
+
? IsEqual<Value[0], Item> extends true
|
|
1478
|
+
? true
|
|
1479
|
+
: Includes<rest, Item>
|
|
1480
|
+
: false;
|
|
1481
|
+
```
|
|
1482
|
+
|
|
1483
|
+
@category Type Guard
|
|
1484
|
+
@category Utilities
|
|
1485
|
+
*/
|
|
1486
|
+
type IsEqual$4<A, B> =
|
|
1487
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
1488
|
+
(<G>() => G extends B ? 1 : 2)
|
|
1489
|
+
? true
|
|
1490
|
+
: false;
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
Filter out keys from an object.
|
|
1494
|
+
|
|
1495
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
1496
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
1497
|
+
Returns `Key` otherwise.
|
|
1498
|
+
|
|
1499
|
+
@example
|
|
1500
|
+
```
|
|
1501
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
1502
|
+
//=> never
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
@example
|
|
1506
|
+
```
|
|
1507
|
+
type Filtered = Filter<'bar', string>;
|
|
1508
|
+
//=> never
|
|
1509
|
+
```
|
|
1510
|
+
|
|
1511
|
+
@example
|
|
1512
|
+
```
|
|
1513
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
1514
|
+
//=> 'bar'
|
|
1515
|
+
```
|
|
1516
|
+
|
|
1517
|
+
@see {Except}
|
|
1518
|
+
*/
|
|
1519
|
+
type Filter$4<KeyType, ExcludeType> = IsEqual$4<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
1520
|
+
|
|
1521
|
+
type ExceptOptions$4 = {
|
|
1522
|
+
/**
|
|
1523
|
+
Disallow assigning non-specified properties.
|
|
1524
|
+
|
|
1525
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
1526
|
+
|
|
1527
|
+
@default false
|
|
1528
|
+
*/
|
|
1529
|
+
requireExactProps?: boolean;
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
Create a type from an object type without certain keys.
|
|
1534
|
+
|
|
1535
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
1536
|
+
|
|
1537
|
+
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
1538
|
+
|
|
1539
|
+
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
1540
|
+
|
|
1541
|
+
@example
|
|
1542
|
+
```
|
|
1543
|
+
import type {Except} from 'type-fest';
|
|
1544
|
+
|
|
1545
|
+
type Foo = {
|
|
1546
|
+
a: number;
|
|
1547
|
+
b: string;
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
1551
|
+
//=> {b: string}
|
|
1552
|
+
|
|
1553
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
1554
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
1555
|
+
|
|
1556
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
1557
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
1558
|
+
|
|
1559
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
1560
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
1561
|
+
```
|
|
1562
|
+
|
|
1563
|
+
@category Object
|
|
1564
|
+
*/
|
|
1565
|
+
type Except$4<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$4 = {requireExactProps: false}> = {
|
|
1566
|
+
[KeyType in keyof ObjectType as Filter$4<KeyType, KeysType>]: ObjectType[KeyType];
|
|
1567
|
+
} & (Options['requireExactProps'] extends true
|
|
1568
|
+
? Partial<Record<KeysType, never>>
|
|
1569
|
+
: {});
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
Returns a boolean for whether the given type is `never`.
|
|
1573
|
+
|
|
1574
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
1575
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
1576
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
1577
|
+
|
|
1578
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
1579
|
+
|
|
1580
|
+
@example
|
|
1581
|
+
```
|
|
1582
|
+
import type {IsNever, And} from 'type-fest';
|
|
1583
|
+
|
|
1584
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
1585
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
1586
|
+
And<
|
|
1587
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
1588
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
1589
|
+
>;
|
|
1590
|
+
|
|
1591
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
1592
|
+
AreStringsEqual<I, O> extends true
|
|
1593
|
+
? never
|
|
1594
|
+
: void;
|
|
1595
|
+
|
|
1596
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
1597
|
+
if (input === output) {
|
|
1598
|
+
process.exit(0);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
endIfEqual('abc', 'abc');
|
|
1603
|
+
//=> never
|
|
1604
|
+
|
|
1605
|
+
endIfEqual('abc', '123');
|
|
1606
|
+
//=> void
|
|
1607
|
+
```
|
|
1608
|
+
|
|
1609
|
+
@category Type Guard
|
|
1610
|
+
@category Utilities
|
|
1611
|
+
*/
|
|
1612
|
+
type IsNever$4<T> = [T] extends [never] ? true : false;
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
1616
|
+
|
|
1617
|
+
@see {@link IsNever}
|
|
1618
|
+
|
|
1619
|
+
@example
|
|
1620
|
+
```
|
|
1621
|
+
import type {IfNever} from 'type-fest';
|
|
1622
|
+
|
|
1623
|
+
type ShouldBeTrue = IfNever<never>;
|
|
1624
|
+
//=> true
|
|
1625
|
+
|
|
1626
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
1627
|
+
//=> 'bar'
|
|
1628
|
+
```
|
|
1629
|
+
|
|
1630
|
+
@category Type Guard
|
|
1631
|
+
@category Utilities
|
|
1632
|
+
*/
|
|
1633
|
+
type IfNever$4<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
1634
|
+
IsNever$4<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
1635
|
+
);
|
|
1636
|
+
|
|
1637
|
+
/**
|
|
1638
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
1639
|
+
|
|
1640
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
1641
|
+
|
|
1642
|
+
@example
|
|
1643
|
+
```
|
|
1644
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
1645
|
+
|
|
1646
|
+
interface Example {
|
|
1647
|
+
a: string;
|
|
1648
|
+
b: string | number;
|
|
1649
|
+
c?: string;
|
|
1650
|
+
d: {};
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
1654
|
+
//=> 'a'
|
|
1655
|
+
```
|
|
1656
|
+
|
|
1657
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
1658
|
+
|
|
1659
|
+
@example
|
|
1660
|
+
```
|
|
1661
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
1662
|
+
|
|
1663
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
1664
|
+
//=> 'a' | 'c'
|
|
1665
|
+
```
|
|
1666
|
+
|
|
1667
|
+
@category Object
|
|
1668
|
+
*/
|
|
1669
|
+
type ConditionalKeys$4<Base, Condition> =
|
|
1670
|
+
{
|
|
1671
|
+
// Map through all the keys of the given base type.
|
|
1672
|
+
[Key in keyof Base]-?:
|
|
1673
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
1674
|
+
Base[Key] extends Condition
|
|
1675
|
+
// Retain this key
|
|
1676
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
1677
|
+
? IfNever$4<Base[Key], IfNever$4<Condition, Key, never>, Key>
|
|
1678
|
+
// Discard this key since the condition fails.
|
|
1679
|
+
: never;
|
|
1680
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
1681
|
+
}[keyof Base];
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
1685
|
+
|
|
1686
|
+
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
1687
|
+
|
|
1688
|
+
@example
|
|
1689
|
+
```
|
|
1690
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
1691
|
+
|
|
1692
|
+
class Awesome {
|
|
1693
|
+
name: string;
|
|
1694
|
+
successes: number;
|
|
1695
|
+
failures: bigint;
|
|
1696
|
+
|
|
1697
|
+
run() {}
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
1701
|
+
//=> {run: () => void}
|
|
1702
|
+
```
|
|
1703
|
+
|
|
1704
|
+
@example
|
|
1705
|
+
```
|
|
1706
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
1707
|
+
|
|
1708
|
+
interface Example {
|
|
1709
|
+
a: string;
|
|
1710
|
+
b: string | number;
|
|
1711
|
+
c: () => void;
|
|
1712
|
+
d: {};
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
1716
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
1717
|
+
```
|
|
1718
|
+
|
|
1719
|
+
@category Object
|
|
1720
|
+
*/
|
|
1721
|
+
type ConditionalExcept$4<Base, Condition> = Except$4<
|
|
1722
|
+
Base,
|
|
1723
|
+
ConditionalKeys$4<Base, Condition>
|
|
1724
|
+
>;
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
1728
|
+
* can either be a REST module or a host module.
|
|
1729
|
+
* This type is recursive, so it can describe nested modules.
|
|
1730
|
+
*/
|
|
1731
|
+
type Descriptors$4 = RESTFunctionDescriptor$4 | AmbassadorFunctionDescriptor$4 | HostModule$4<any, any> | EventDefinition$4<any> | ServicePluginDefinition$4<any> | {
|
|
1732
|
+
[key: string]: Descriptors$4 | PublicMetadata$4 | any;
|
|
1733
|
+
};
|
|
1734
|
+
/**
|
|
1735
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
1736
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
1737
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
1738
|
+
* do not match the given host (as they will not work with the given host).
|
|
1739
|
+
*/
|
|
1740
|
+
type BuildDescriptors$4<T extends Descriptors$4, H extends Host$4<any> | undefined, Depth extends number = 5> = {
|
|
1741
|
+
done: T;
|
|
1742
|
+
recurse: T extends {
|
|
1743
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$4;
|
|
1744
|
+
} ? never : T extends AmbassadorFunctionDescriptor$4 ? BuildAmbassadorFunction$4<T> : T extends RESTFunctionDescriptor$4 ? BuildRESTFunction$4<T> : T extends EventDefinition$4<any> ? BuildEventDefinition$4<T> : T extends ServicePluginDefinition$4<any> ? BuildServicePluginDefinition$4<T> : T extends HostModule$4<any, any> ? HostModuleAPI$4<T> : ConditionalExcept$4<{
|
|
1745
|
+
[Key in keyof T]: T[Key] extends Descriptors$4 ? BuildDescriptors$4<T[Key], H, [
|
|
1746
|
+
-1,
|
|
1747
|
+
0,
|
|
1748
|
+
1,
|
|
1749
|
+
2,
|
|
1750
|
+
3,
|
|
1751
|
+
4,
|
|
1752
|
+
5
|
|
1753
|
+
][Depth]> : never;
|
|
1754
|
+
}, EmptyObject$4>;
|
|
1755
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
1756
|
+
type PublicMetadata$4 = {
|
|
1757
|
+
PACKAGE_NAME?: string;
|
|
1758
|
+
};
|
|
1759
|
+
|
|
1760
|
+
declare global {
|
|
1761
|
+
interface ContextualClient {
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* A type used to create concerete types from SDK descriptors in
|
|
1766
|
+
* case a contextual client is available.
|
|
1767
|
+
*/
|
|
1768
|
+
type MaybeContext$4<T extends Descriptors$4> = globalThis.ContextualClient extends {
|
|
1769
|
+
host: Host$4;
|
|
1770
|
+
} ? BuildDescriptors$4<T, globalThis.ContextualClient['host']> : T;
|
|
1771
|
+
|
|
1772
|
+
interface PortfolioSettings {
|
|
1773
|
+
/**
|
|
1774
|
+
* Revision number. Increments by 1 each time the portfolio settings object is updated. To prevent conflicting changes, the existing revision must be passed when updating the portfolio settings object.
|
|
1775
|
+
* @readonly
|
|
1776
|
+
*/
|
|
1777
|
+
revision?: string | null;
|
|
1778
|
+
/** Portfolio's project item settings. */
|
|
1779
|
+
projectItemSettings?: ProjectItemSettings;
|
|
1780
|
+
/** Portfolio's media settings. */
|
|
1781
|
+
mediaSettings?: MediaSettings;
|
|
1782
|
+
/**
|
|
1783
|
+
* Date and time the portfolio settings were created.
|
|
1784
|
+
* @readonly
|
|
1785
|
+
*/
|
|
1786
|
+
_createdDate?: Date;
|
|
1787
|
+
/**
|
|
1788
|
+
* Date and time the portfolio settings were updated.
|
|
1789
|
+
* @readonly
|
|
1790
|
+
*/
|
|
1791
|
+
_updatedDate?: Date;
|
|
1792
|
+
}
|
|
1793
|
+
interface ProjectItemSettings {
|
|
1794
|
+
addItemDirection?: AddItemDirection;
|
|
1795
|
+
/** The default item name ? */
|
|
1796
|
+
defaultItemName?: DefaultItemName;
|
|
1797
|
+
}
|
|
1798
|
+
declare enum AddItemDirection {
|
|
1799
|
+
/** Add new items to the start of the gallery. */
|
|
1800
|
+
GALLERY_START = "GALLERY_START",
|
|
1801
|
+
/** Add new items to the end of the gallery. */
|
|
1802
|
+
GALLERY_END = "GALLERY_END"
|
|
1803
|
+
}
|
|
1804
|
+
declare enum DefaultItemName {
|
|
1805
|
+
/** Use the file name as the default item name */
|
|
1806
|
+
FILE_NAME = "FILE_NAME",
|
|
1807
|
+
/** Use an empty string as the default item name */
|
|
1808
|
+
EMPTY = "EMPTY"
|
|
1809
|
+
}
|
|
1810
|
+
interface MediaSettings {
|
|
1811
|
+
/** The folder ID for the media */
|
|
1812
|
+
folderId?: string | null;
|
|
1813
|
+
}
|
|
1814
|
+
interface SiteMenuSettings {
|
|
1815
|
+
/** Whether to automatically update the site menu */
|
|
1816
|
+
autoUpdateMenu?: boolean | null;
|
|
1817
|
+
}
|
|
1818
|
+
interface CreatePortfolioSettingsRequest {
|
|
1819
|
+
/** The portfolio settings to create. */
|
|
1820
|
+
portfolioSettings: PortfolioSettings;
|
|
1821
|
+
}
|
|
1822
|
+
interface CreatePortfolioSettingsResponse {
|
|
1823
|
+
/** Newly created portfolio settings. */
|
|
1824
|
+
portfolioSettings?: PortfolioSettings;
|
|
1825
|
+
}
|
|
1826
|
+
interface GetPortfolioSettingsRequest {
|
|
1827
|
+
}
|
|
1828
|
+
interface GetPortfolioSettingsResponse {
|
|
1829
|
+
/** Portfolio settings. */
|
|
1830
|
+
portfolioSettings?: PortfolioSettings;
|
|
1831
|
+
}
|
|
1832
|
+
interface UpdatePortfolioSettingsRequest {
|
|
1833
|
+
/** The portfolio settings to update. */
|
|
1834
|
+
portfolioSettings: PortfolioSettings;
|
|
1835
|
+
}
|
|
1836
|
+
interface UpdatePortfolioSettingsResponse {
|
|
1837
|
+
/** Updated portfolio settings. */
|
|
1838
|
+
updatedPortfolioSettings?: PortfolioSettings;
|
|
1839
|
+
}
|
|
1840
|
+
interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
|
|
1841
|
+
createdEvent?: EntityCreatedEvent$4;
|
|
1842
|
+
updatedEvent?: EntityUpdatedEvent$4;
|
|
1843
|
+
deletedEvent?: EntityDeletedEvent$4;
|
|
1844
|
+
actionEvent?: ActionEvent$4;
|
|
1845
|
+
/**
|
|
1846
|
+
* Unique event ID.
|
|
1847
|
+
* Allows clients to ignore duplicate webhooks.
|
|
1848
|
+
*/
|
|
1849
|
+
_id?: string;
|
|
1850
|
+
/**
|
|
1851
|
+
* Assumes actions are also always typed to an entity_type
|
|
1852
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1853
|
+
*/
|
|
1854
|
+
entityFqdn?: string;
|
|
1855
|
+
/**
|
|
1856
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1857
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1858
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
1859
|
+
*/
|
|
1860
|
+
slug?: string;
|
|
1861
|
+
/** ID of the entity associated with the event. */
|
|
1862
|
+
entityId?: string;
|
|
1863
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
1864
|
+
eventTime?: Date;
|
|
1865
|
+
/**
|
|
1866
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1867
|
+
* (for example, GDPR).
|
|
1868
|
+
*/
|
|
1869
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1870
|
+
/** If present, indicates the action that triggered the event. */
|
|
1871
|
+
originatedFrom?: string | null;
|
|
1872
|
+
/**
|
|
1873
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
1874
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1875
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1876
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1877
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1878
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1879
|
+
*/
|
|
1880
|
+
entityEventSequence?: string | null;
|
|
1881
|
+
}
|
|
1882
|
+
/** @oneof */
|
|
1883
|
+
interface DomainEventBodyOneOf$4 {
|
|
1884
|
+
createdEvent?: EntityCreatedEvent$4;
|
|
1885
|
+
updatedEvent?: EntityUpdatedEvent$4;
|
|
1886
|
+
deletedEvent?: EntityDeletedEvent$4;
|
|
1887
|
+
actionEvent?: ActionEvent$4;
|
|
1888
|
+
}
|
|
1889
|
+
interface EntityCreatedEvent$4 {
|
|
1890
|
+
entity?: string;
|
|
1891
|
+
}
|
|
1892
|
+
interface RestoreInfo$4 {
|
|
1893
|
+
deletedDate?: Date;
|
|
1894
|
+
}
|
|
1895
|
+
interface EntityUpdatedEvent$4 {
|
|
1896
|
+
/**
|
|
1897
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
1898
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
1899
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
1900
|
+
*/
|
|
1901
|
+
currentEntity?: string;
|
|
1902
|
+
}
|
|
1903
|
+
interface EntityDeletedEvent$4 {
|
|
1904
|
+
/** Entity that was deleted */
|
|
1905
|
+
deletedEntity?: string | null;
|
|
1906
|
+
}
|
|
1907
|
+
interface ActionEvent$4 {
|
|
1908
|
+
body?: string;
|
|
1909
|
+
}
|
|
1910
|
+
interface MessageEnvelope$4 {
|
|
1911
|
+
/** App instance ID. */
|
|
1912
|
+
instanceId?: string | null;
|
|
1913
|
+
/** Event type. */
|
|
1914
|
+
eventType?: string;
|
|
1915
|
+
/** The identification type and identity data. */
|
|
1916
|
+
identity?: IdentificationData$4;
|
|
1917
|
+
/** Stringify payload. */
|
|
1918
|
+
data?: string;
|
|
1919
|
+
}
|
|
1920
|
+
interface IdentificationData$4 extends IdentificationDataIdOneOf$4 {
|
|
1921
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1922
|
+
anonymousVisitorId?: string;
|
|
1923
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1924
|
+
memberId?: string;
|
|
1925
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1926
|
+
wixUserId?: string;
|
|
1927
|
+
/** ID of an app. */
|
|
1928
|
+
appId?: string;
|
|
1929
|
+
/** @readonly */
|
|
1930
|
+
identityType?: WebhookIdentityType$4;
|
|
1931
|
+
}
|
|
1932
|
+
/** @oneof */
|
|
1933
|
+
interface IdentificationDataIdOneOf$4 {
|
|
1934
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1935
|
+
anonymousVisitorId?: string;
|
|
1936
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1937
|
+
memberId?: string;
|
|
1938
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1939
|
+
wixUserId?: string;
|
|
1940
|
+
/** ID of an app. */
|
|
1941
|
+
appId?: string;
|
|
1942
|
+
}
|
|
1943
|
+
declare enum WebhookIdentityType$4 {
|
|
1944
|
+
UNKNOWN = "UNKNOWN",
|
|
1945
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1946
|
+
MEMBER = "MEMBER",
|
|
1947
|
+
WIX_USER = "WIX_USER",
|
|
1948
|
+
APP = "APP"
|
|
1949
|
+
}
|
|
1950
|
+
interface ProjectItemSettingsNonNullableFields {
|
|
1951
|
+
addItemDirection: AddItemDirection;
|
|
1952
|
+
defaultItemName: DefaultItemName;
|
|
1953
|
+
}
|
|
1954
|
+
interface PortfolioSettingsNonNullableFields {
|
|
1955
|
+
projectItemSettings?: ProjectItemSettingsNonNullableFields;
|
|
1956
|
+
}
|
|
1957
|
+
interface CreatePortfolioSettingsResponseNonNullableFields {
|
|
1958
|
+
portfolioSettings?: PortfolioSettingsNonNullableFields;
|
|
1959
|
+
}
|
|
1960
|
+
interface GetPortfolioSettingsResponseNonNullableFields {
|
|
1961
|
+
portfolioSettings?: PortfolioSettingsNonNullableFields;
|
|
1962
|
+
}
|
|
1963
|
+
interface UpdatePortfolioSettingsResponseNonNullableFields {
|
|
1964
|
+
updatedPortfolioSettings?: PortfolioSettingsNonNullableFields;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
declare function createPortfolioSettings$1(httpClient: HttpClient$4): CreatePortfolioSettingsSignature;
|
|
1968
|
+
interface CreatePortfolioSettingsSignature {
|
|
1969
|
+
/**
|
|
1970
|
+
* Creates a site's portfolio settings.
|
|
1971
|
+
* @param - The portfolio settings to create.
|
|
1972
|
+
* @returns Newly created portfolio settings.
|
|
1973
|
+
*/
|
|
1974
|
+
(portfolioSettings: PortfolioSettings): Promise<PortfolioSettings & PortfolioSettingsNonNullableFields>;
|
|
1975
|
+
}
|
|
1976
|
+
declare function getPortfolioSettings$1(httpClient: HttpClient$4): GetPortfolioSettingsSignature;
|
|
1977
|
+
interface GetPortfolioSettingsSignature {
|
|
1978
|
+
/**
|
|
1979
|
+
* Retrieves a site's portfolio settings.
|
|
1980
|
+
*/
|
|
1981
|
+
(): Promise<GetPortfolioSettingsResponse & GetPortfolioSettingsResponseNonNullableFields>;
|
|
1982
|
+
}
|
|
1983
|
+
declare function updatePortfolioSettings$1(httpClient: HttpClient$4): UpdatePortfolioSettingsSignature;
|
|
1984
|
+
interface UpdatePortfolioSettingsSignature {
|
|
1985
|
+
/**
|
|
1986
|
+
* Updates a site's portfolio settings.
|
|
1987
|
+
* @param - The portfolio settings to update.
|
|
1988
|
+
*/
|
|
1989
|
+
(portfolioSettings: PortfolioSettings): Promise<UpdatePortfolioSettingsResponse & UpdatePortfolioSettingsResponseNonNullableFields>;
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
declare const createPortfolioSettings: MaybeContext$4<BuildRESTFunction$4<typeof createPortfolioSettings$1> & typeof createPortfolioSettings$1>;
|
|
1993
|
+
declare const getPortfolioSettings: MaybeContext$4<BuildRESTFunction$4<typeof getPortfolioSettings$1> & typeof getPortfolioSettings$1>;
|
|
1994
|
+
declare const updatePortfolioSettings: MaybeContext$4<BuildRESTFunction$4<typeof updatePortfolioSettings$1> & typeof updatePortfolioSettings$1>;
|
|
1995
|
+
|
|
1996
|
+
type index_d$4_AddItemDirection = AddItemDirection;
|
|
1997
|
+
declare const index_d$4_AddItemDirection: typeof AddItemDirection;
|
|
1998
|
+
type index_d$4_CreatePortfolioSettingsRequest = CreatePortfolioSettingsRequest;
|
|
1999
|
+
type index_d$4_CreatePortfolioSettingsResponse = CreatePortfolioSettingsResponse;
|
|
2000
|
+
type index_d$4_CreatePortfolioSettingsResponseNonNullableFields = CreatePortfolioSettingsResponseNonNullableFields;
|
|
2001
|
+
type index_d$4_DefaultItemName = DefaultItemName;
|
|
2002
|
+
declare const index_d$4_DefaultItemName: typeof DefaultItemName;
|
|
2003
|
+
type index_d$4_GetPortfolioSettingsRequest = GetPortfolioSettingsRequest;
|
|
2004
|
+
type index_d$4_GetPortfolioSettingsResponse = GetPortfolioSettingsResponse;
|
|
2005
|
+
type index_d$4_GetPortfolioSettingsResponseNonNullableFields = GetPortfolioSettingsResponseNonNullableFields;
|
|
2006
|
+
type index_d$4_MediaSettings = MediaSettings;
|
|
2007
|
+
type index_d$4_PortfolioSettings = PortfolioSettings;
|
|
2008
|
+
type index_d$4_PortfolioSettingsNonNullableFields = PortfolioSettingsNonNullableFields;
|
|
2009
|
+
type index_d$4_ProjectItemSettings = ProjectItemSettings;
|
|
2010
|
+
type index_d$4_SiteMenuSettings = SiteMenuSettings;
|
|
2011
|
+
type index_d$4_UpdatePortfolioSettingsRequest = UpdatePortfolioSettingsRequest;
|
|
2012
|
+
type index_d$4_UpdatePortfolioSettingsResponse = UpdatePortfolioSettingsResponse;
|
|
2013
|
+
type index_d$4_UpdatePortfolioSettingsResponseNonNullableFields = UpdatePortfolioSettingsResponseNonNullableFields;
|
|
2014
|
+
declare const index_d$4_createPortfolioSettings: typeof createPortfolioSettings;
|
|
2015
|
+
declare const index_d$4_getPortfolioSettings: typeof getPortfolioSettings;
|
|
2016
|
+
declare const index_d$4_updatePortfolioSettings: typeof updatePortfolioSettings;
|
|
2017
|
+
declare namespace index_d$4 {
|
|
2018
|
+
export { type ActionEvent$4 as ActionEvent, index_d$4_AddItemDirection as AddItemDirection, type index_d$4_CreatePortfolioSettingsRequest as CreatePortfolioSettingsRequest, type index_d$4_CreatePortfolioSettingsResponse as CreatePortfolioSettingsResponse, type index_d$4_CreatePortfolioSettingsResponseNonNullableFields as CreatePortfolioSettingsResponseNonNullableFields, index_d$4_DefaultItemName as DefaultItemName, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, type index_d$4_GetPortfolioSettingsRequest as GetPortfolioSettingsRequest, type index_d$4_GetPortfolioSettingsResponse as GetPortfolioSettingsResponse, type index_d$4_GetPortfolioSettingsResponseNonNullableFields as GetPortfolioSettingsResponseNonNullableFields, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, type index_d$4_MediaSettings as MediaSettings, type MessageEnvelope$4 as MessageEnvelope, type index_d$4_PortfolioSettings as PortfolioSettings, type index_d$4_PortfolioSettingsNonNullableFields as PortfolioSettingsNonNullableFields, type index_d$4_ProjectItemSettings as ProjectItemSettings, type RestoreInfo$4 as RestoreInfo, type index_d$4_SiteMenuSettings as SiteMenuSettings, type index_d$4_UpdatePortfolioSettingsRequest as UpdatePortfolioSettingsRequest, type index_d$4_UpdatePortfolioSettingsResponse as UpdatePortfolioSettingsResponse, type index_d$4_UpdatePortfolioSettingsResponseNonNullableFields as UpdatePortfolioSettingsResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, index_d$4_createPortfolioSettings as createPortfolioSettings, index_d$4_getPortfolioSettings as getPortfolioSettings, index_d$4_updatePortfolioSettings as updatePortfolioSettings };
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
type HostModule$3<T, H extends Host$3> = {
|
|
2022
|
+
__type: 'host';
|
|
2023
|
+
create(host: H): T;
|
|
2024
|
+
};
|
|
2025
|
+
type HostModuleAPI$3<T extends HostModule$3<any, any>> = T extends HostModule$3<infer U, any> ? U : never;
|
|
2026
|
+
type Host$3<Environment = unknown> = {
|
|
2027
|
+
channel: {
|
|
2028
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
2029
|
+
disconnect: () => void;
|
|
2030
|
+
} | Promise<{
|
|
2031
|
+
disconnect: () => void;
|
|
2032
|
+
}>;
|
|
2033
|
+
};
|
|
2034
|
+
environment?: Environment;
|
|
2035
|
+
/**
|
|
2036
|
+
* Optional name of the environment, use for logging
|
|
2037
|
+
*/
|
|
2038
|
+
name?: string;
|
|
2039
|
+
/**
|
|
2040
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
2041
|
+
*/
|
|
2042
|
+
apiBaseUrl?: string;
|
|
2043
|
+
/**
|
|
2044
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
2045
|
+
* like internationalization, billing, etc.
|
|
2046
|
+
*/
|
|
2047
|
+
essentials?: {
|
|
2048
|
+
/**
|
|
2049
|
+
* The language of the currently viewed session
|
|
2050
|
+
*/
|
|
2051
|
+
language?: string;
|
|
2052
|
+
/**
|
|
2053
|
+
* The locale of the currently viewed session
|
|
2054
|
+
*/
|
|
2055
|
+
locale?: string;
|
|
2056
|
+
/**
|
|
2057
|
+
* Any headers that should be passed through to the API requests
|
|
2058
|
+
*/
|
|
2059
|
+
passThroughHeaders?: Record<string, string>;
|
|
2060
|
+
};
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
2064
|
+
interface HttpClient$3 {
|
|
2065
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
2066
|
+
fetchWithAuth: typeof fetch;
|
|
2067
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
2068
|
+
getActiveToken?: () => string | undefined;
|
|
2069
|
+
}
|
|
2070
|
+
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
2071
|
+
type HttpResponse$3<T = any> = {
|
|
2072
|
+
data: T;
|
|
2073
|
+
status: number;
|
|
2074
|
+
statusText: string;
|
|
2075
|
+
headers: any;
|
|
2076
|
+
request?: any;
|
|
2077
|
+
};
|
|
2078
|
+
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
2079
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
2080
|
+
url: string;
|
|
2081
|
+
data?: Data;
|
|
2082
|
+
params?: URLSearchParams;
|
|
2083
|
+
} & APIMetadata$3;
|
|
2084
|
+
type APIMetadata$3 = {
|
|
2085
|
+
methodFqn?: string;
|
|
2086
|
+
entityFqdn?: string;
|
|
2087
|
+
packageName?: string;
|
|
2088
|
+
};
|
|
2089
|
+
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
2090
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
2091
|
+
__type: 'event-definition';
|
|
2092
|
+
type: Type;
|
|
2093
|
+
isDomainEvent?: boolean;
|
|
2094
|
+
transformations?: (envelope: unknown) => Payload;
|
|
2095
|
+
__payload: Payload;
|
|
2096
|
+
};
|
|
2097
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
2098
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
2099
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
2100
|
+
|
|
2101
|
+
type ServicePluginMethodInput$3 = {
|
|
2102
|
+
request: any;
|
|
2103
|
+
metadata: any;
|
|
2104
|
+
};
|
|
2105
|
+
type ServicePluginContract$3 = Record<string, (payload: ServicePluginMethodInput$3) => unknown | Promise<unknown>>;
|
|
2106
|
+
type ServicePluginMethodMetadata$3 = {
|
|
2107
|
+
name: string;
|
|
2108
|
+
primaryHttpMappingPath: string;
|
|
2109
|
+
transformations: {
|
|
2110
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$3;
|
|
2111
|
+
toREST: (...args: unknown[]) => unknown;
|
|
2112
|
+
};
|
|
2113
|
+
};
|
|
2114
|
+
type ServicePluginDefinition$3<Contract extends ServicePluginContract$3> = {
|
|
2115
|
+
__type: 'service-plugin-definition';
|
|
2116
|
+
componentType: string;
|
|
2117
|
+
methods: ServicePluginMethodMetadata$3[];
|
|
2118
|
+
__contract: Contract;
|
|
2119
|
+
};
|
|
2120
|
+
declare function ServicePluginDefinition$3<Contract extends ServicePluginContract$3>(componentType: string, methods: ServicePluginMethodMetadata$3[]): ServicePluginDefinition$3<Contract>;
|
|
2121
|
+
type BuildServicePluginDefinition$3<T extends ServicePluginDefinition$3<any>> = (implementation: T['__contract']) => void;
|
|
2122
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$3 = "wix_spi_error";
|
|
2123
|
+
|
|
2124
|
+
type RequestContext$3 = {
|
|
2125
|
+
isSSR: boolean;
|
|
2126
|
+
host: string;
|
|
2127
|
+
protocol?: string;
|
|
2128
|
+
};
|
|
2129
|
+
type ResponseTransformer$3 = (data: any, headers?: any) => any;
|
|
2130
|
+
/**
|
|
2131
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
2132
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
2133
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
2134
|
+
*/
|
|
2135
|
+
type Method$3 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
2136
|
+
type AmbassadorRequestOptions$3<T = any> = {
|
|
2137
|
+
_?: T;
|
|
2138
|
+
url?: string;
|
|
2139
|
+
method?: Method$3;
|
|
2140
|
+
params?: any;
|
|
2141
|
+
data?: any;
|
|
2142
|
+
transformResponse?: ResponseTransformer$3 | ResponseTransformer$3[];
|
|
2143
|
+
};
|
|
2144
|
+
type AmbassadorFactory$3<Request, Response> = (payload: Request) => ((context: RequestContext$3) => AmbassadorRequestOptions$3<Response>) & {
|
|
2145
|
+
__isAmbassador: boolean;
|
|
2146
|
+
};
|
|
2147
|
+
type AmbassadorFunctionDescriptor$3<Request = any, Response = any> = AmbassadorFactory$3<Request, Response>;
|
|
2148
|
+
type BuildAmbassadorFunction$3<T extends AmbassadorFunctionDescriptor$3> = T extends AmbassadorFunctionDescriptor$3<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
2149
|
+
|
|
2150
|
+
declare global {
|
|
2151
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2152
|
+
interface SymbolConstructor {
|
|
2153
|
+
readonly observable: symbol;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
declare const emptyObjectSymbol$3: unique symbol;
|
|
2158
|
+
|
|
2159
|
+
/**
|
|
2160
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
2161
|
+
|
|
2162
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
2163
|
+
|
|
2164
|
+
@example
|
|
2165
|
+
```
|
|
2166
|
+
import type {EmptyObject} from 'type-fest';
|
|
2167
|
+
|
|
2168
|
+
// The following illustrates the problem with `{}`.
|
|
2169
|
+
const foo1: {} = {}; // Pass
|
|
2170
|
+
const foo2: {} = []; // Pass
|
|
2171
|
+
const foo3: {} = 42; // Pass
|
|
2172
|
+
const foo4: {} = {a: 1}; // Pass
|
|
2173
|
+
|
|
2174
|
+
// With `EmptyObject` only the first case is valid.
|
|
2175
|
+
const bar1: EmptyObject = {}; // Pass
|
|
2176
|
+
const bar2: EmptyObject = 42; // Fail
|
|
2177
|
+
const bar3: EmptyObject = []; // Fail
|
|
2178
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
2179
|
+
```
|
|
2180
|
+
|
|
2181
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
2182
|
+
|
|
2183
|
+
@category Object
|
|
2184
|
+
*/
|
|
2185
|
+
type EmptyObject$3 = {[emptyObjectSymbol$3]?: never};
|
|
2186
|
+
|
|
2187
|
+
/**
|
|
2188
|
+
Returns a boolean for whether the two given types are equal.
|
|
2189
|
+
|
|
2190
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
2191
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
2192
|
+
|
|
2193
|
+
Use-cases:
|
|
2194
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
2195
|
+
|
|
2196
|
+
@example
|
|
2197
|
+
```
|
|
2198
|
+
import type {IsEqual} from 'type-fest';
|
|
2199
|
+
|
|
2200
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
2201
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
2202
|
+
type Includes<Value extends readonly any[], Item> =
|
|
2203
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
2204
|
+
? IsEqual<Value[0], Item> extends true
|
|
2205
|
+
? true
|
|
2206
|
+
: Includes<rest, Item>
|
|
2207
|
+
: false;
|
|
2208
|
+
```
|
|
2209
|
+
|
|
2210
|
+
@category Type Guard
|
|
2211
|
+
@category Utilities
|
|
2212
|
+
*/
|
|
2213
|
+
type IsEqual$3<A, B> =
|
|
2214
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
2215
|
+
(<G>() => G extends B ? 1 : 2)
|
|
2216
|
+
? true
|
|
2217
|
+
: false;
|
|
2218
|
+
|
|
2219
|
+
/**
|
|
2220
|
+
Filter out keys from an object.
|
|
2221
|
+
|
|
2222
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
2223
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
2224
|
+
Returns `Key` otherwise.
|
|
2225
|
+
|
|
2226
|
+
@example
|
|
2227
|
+
```
|
|
2228
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
2229
|
+
//=> never
|
|
2230
|
+
```
|
|
2231
|
+
|
|
2232
|
+
@example
|
|
2233
|
+
```
|
|
2234
|
+
type Filtered = Filter<'bar', string>;
|
|
2235
|
+
//=> never
|
|
2236
|
+
```
|
|
2237
|
+
|
|
2238
|
+
@example
|
|
2239
|
+
```
|
|
2240
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
2241
|
+
//=> 'bar'
|
|
2242
|
+
```
|
|
2243
|
+
|
|
2244
|
+
@see {Except}
|
|
2245
|
+
*/
|
|
2246
|
+
type Filter$3<KeyType, ExcludeType> = IsEqual$3<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
2247
|
+
|
|
2248
|
+
type ExceptOptions$3 = {
|
|
2249
|
+
/**
|
|
2250
|
+
Disallow assigning non-specified properties.
|
|
2251
|
+
|
|
2252
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
2253
|
+
|
|
2254
|
+
@default false
|
|
2255
|
+
*/
|
|
2256
|
+
requireExactProps?: boolean;
|
|
2257
|
+
};
|
|
2258
|
+
|
|
2259
|
+
/**
|
|
2260
|
+
Create a type from an object type without certain keys.
|
|
2261
|
+
|
|
2262
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
2263
|
+
|
|
2264
|
+
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
2265
|
+
|
|
2266
|
+
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
2267
|
+
|
|
2268
|
+
@example
|
|
2269
|
+
```
|
|
2270
|
+
import type {Except} from 'type-fest';
|
|
2271
|
+
|
|
2272
|
+
type Foo = {
|
|
2273
|
+
a: number;
|
|
2274
|
+
b: string;
|
|
2275
|
+
};
|
|
2276
|
+
|
|
2277
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
2278
|
+
//=> {b: string}
|
|
2279
|
+
|
|
2280
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
2281
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
2282
|
+
|
|
2283
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
2284
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
2285
|
+
|
|
2286
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
2287
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
2288
|
+
```
|
|
2289
|
+
|
|
2290
|
+
@category Object
|
|
2291
|
+
*/
|
|
2292
|
+
type Except$3<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$3 = {requireExactProps: false}> = {
|
|
2293
|
+
[KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
|
|
2294
|
+
} & (Options['requireExactProps'] extends true
|
|
2295
|
+
? Partial<Record<KeysType, never>>
|
|
2296
|
+
: {});
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
Returns a boolean for whether the given type is `never`.
|
|
2300
|
+
|
|
2301
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
2302
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
2303
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
2304
|
+
|
|
2305
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
2306
|
+
|
|
2307
|
+
@example
|
|
2308
|
+
```
|
|
2309
|
+
import type {IsNever, And} from 'type-fest';
|
|
2310
|
+
|
|
2311
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
2312
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
2313
|
+
And<
|
|
2314
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
2315
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
2316
|
+
>;
|
|
2317
|
+
|
|
2318
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
2319
|
+
AreStringsEqual<I, O> extends true
|
|
2320
|
+
? never
|
|
2321
|
+
: void;
|
|
2322
|
+
|
|
2323
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
2324
|
+
if (input === output) {
|
|
2325
|
+
process.exit(0);
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
endIfEqual('abc', 'abc');
|
|
2330
|
+
//=> never
|
|
2331
|
+
|
|
2332
|
+
endIfEqual('abc', '123');
|
|
2333
|
+
//=> void
|
|
2334
|
+
```
|
|
2335
|
+
|
|
2336
|
+
@category Type Guard
|
|
2337
|
+
@category Utilities
|
|
2338
|
+
*/
|
|
2339
|
+
type IsNever$3<T> = [T] extends [never] ? true : false;
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
2343
|
+
|
|
2344
|
+
@see {@link IsNever}
|
|
2345
|
+
|
|
2346
|
+
@example
|
|
2347
|
+
```
|
|
2348
|
+
import type {IfNever} from 'type-fest';
|
|
2349
|
+
|
|
2350
|
+
type ShouldBeTrue = IfNever<never>;
|
|
2351
|
+
//=> true
|
|
2352
|
+
|
|
2353
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
2354
|
+
//=> 'bar'
|
|
2355
|
+
```
|
|
2356
|
+
|
|
2357
|
+
@category Type Guard
|
|
2358
|
+
@category Utilities
|
|
2359
|
+
*/
|
|
2360
|
+
type IfNever$3<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
2361
|
+
IsNever$3<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
2362
|
+
);
|
|
2363
|
+
|
|
2364
|
+
/**
|
|
2365
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
2366
|
+
|
|
2367
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
2368
|
+
|
|
2369
|
+
@example
|
|
2370
|
+
```
|
|
2371
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
2372
|
+
|
|
2373
|
+
interface Example {
|
|
2374
|
+
a: string;
|
|
2375
|
+
b: string | number;
|
|
2376
|
+
c?: string;
|
|
2377
|
+
d: {};
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
2381
|
+
//=> 'a'
|
|
2382
|
+
```
|
|
2383
|
+
|
|
2384
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
2385
|
+
|
|
2386
|
+
@example
|
|
2387
|
+
```
|
|
2388
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
2389
|
+
|
|
2390
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
2391
|
+
//=> 'a' | 'c'
|
|
2392
|
+
```
|
|
2393
|
+
|
|
2394
|
+
@category Object
|
|
2395
|
+
*/
|
|
2396
|
+
type ConditionalKeys$3<Base, Condition> =
|
|
2397
|
+
{
|
|
2398
|
+
// Map through all the keys of the given base type.
|
|
2399
|
+
[Key in keyof Base]-?:
|
|
2400
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
2401
|
+
Base[Key] extends Condition
|
|
2402
|
+
// Retain this key
|
|
2403
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
2404
|
+
? IfNever$3<Base[Key], IfNever$3<Condition, Key, never>, Key>
|
|
2405
|
+
// Discard this key since the condition fails.
|
|
2406
|
+
: never;
|
|
2407
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
2408
|
+
}[keyof Base];
|
|
2409
|
+
|
|
2410
|
+
/**
|
|
2411
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
2412
|
+
|
|
2413
|
+
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
2414
|
+
|
|
2415
|
+
@example
|
|
2416
|
+
```
|
|
2417
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
2418
|
+
|
|
2419
|
+
class Awesome {
|
|
2420
|
+
name: string;
|
|
2421
|
+
successes: number;
|
|
2422
|
+
failures: bigint;
|
|
2423
|
+
|
|
2424
|
+
run() {}
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
2428
|
+
//=> {run: () => void}
|
|
2429
|
+
```
|
|
2430
|
+
|
|
2431
|
+
@example
|
|
2432
|
+
```
|
|
2433
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
2434
|
+
|
|
2435
|
+
interface Example {
|
|
2436
|
+
a: string;
|
|
2437
|
+
b: string | number;
|
|
2438
|
+
c: () => void;
|
|
2439
|
+
d: {};
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
2443
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
2444
|
+
```
|
|
2445
|
+
|
|
2446
|
+
@category Object
|
|
2447
|
+
*/
|
|
2448
|
+
type ConditionalExcept$3<Base, Condition> = Except$3<
|
|
2449
|
+
Base,
|
|
2450
|
+
ConditionalKeys$3<Base, Condition>
|
|
2451
|
+
>;
|
|
2452
|
+
|
|
2453
|
+
/**
|
|
2454
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
2455
|
+
* can either be a REST module or a host module.
|
|
2456
|
+
* This type is recursive, so it can describe nested modules.
|
|
2457
|
+
*/
|
|
2458
|
+
type Descriptors$3 = RESTFunctionDescriptor$3 | AmbassadorFunctionDescriptor$3 | HostModule$3<any, any> | EventDefinition$3<any> | ServicePluginDefinition$3<any> | {
|
|
2459
|
+
[key: string]: Descriptors$3 | PublicMetadata$3 | any;
|
|
2460
|
+
};
|
|
2461
|
+
/**
|
|
2462
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
2463
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
2464
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
2465
|
+
* do not match the given host (as they will not work with the given host).
|
|
2466
|
+
*/
|
|
2467
|
+
type BuildDescriptors$3<T extends Descriptors$3, H extends Host$3<any> | undefined, Depth extends number = 5> = {
|
|
2468
|
+
done: T;
|
|
2469
|
+
recurse: T extends {
|
|
2470
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$3;
|
|
2471
|
+
} ? never : T extends AmbassadorFunctionDescriptor$3 ? BuildAmbassadorFunction$3<T> : T extends RESTFunctionDescriptor$3 ? BuildRESTFunction$3<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$3<any> ? BuildServicePluginDefinition$3<T> : T extends HostModule$3<any, any> ? HostModuleAPI$3<T> : ConditionalExcept$3<{
|
|
2472
|
+
[Key in keyof T]: T[Key] extends Descriptors$3 ? BuildDescriptors$3<T[Key], H, [
|
|
2473
|
+
-1,
|
|
2474
|
+
0,
|
|
2475
|
+
1,
|
|
2476
|
+
2,
|
|
2477
|
+
3,
|
|
2478
|
+
4,
|
|
2479
|
+
5
|
|
2480
|
+
][Depth]> : never;
|
|
2481
|
+
}, EmptyObject$3>;
|
|
2482
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
2483
|
+
type PublicMetadata$3 = {
|
|
2484
|
+
PACKAGE_NAME?: string;
|
|
2485
|
+
};
|
|
2486
|
+
|
|
2487
|
+
declare global {
|
|
2488
|
+
interface ContextualClient {
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
/**
|
|
2492
|
+
* A type used to create concerete types from SDK descriptors in
|
|
2493
|
+
* case a contextual client is available.
|
|
2494
|
+
*/
|
|
2495
|
+
type MaybeContext$3<T extends Descriptors$3> = globalThis.ContextualClient extends {
|
|
2496
|
+
host: Host$3;
|
|
2497
|
+
} ? BuildDescriptors$3<T, globalThis.ContextualClient['host']> : T;
|
|
2498
|
+
|
|
2499
|
+
/** ProjectItem is the main entity of ProjectItemsService */
|
|
2500
|
+
interface Item extends ItemMetadataOneOf {
|
|
2501
|
+
/** Information about the Wix Media image. */
|
|
2502
|
+
image?: Image$2;
|
|
2503
|
+
/** Information about the Wix Media video. */
|
|
2504
|
+
video?: Video$2;
|
|
2505
|
+
/** Project ID. */
|
|
2506
|
+
projectId?: string | null;
|
|
2507
|
+
/**
|
|
2508
|
+
* Item ID.
|
|
2509
|
+
* @readonly
|
|
2510
|
+
*/
|
|
2511
|
+
_id?: string | null;
|
|
2512
|
+
/**
|
|
2513
|
+
* Sort order of the project item within the specified project. <br />
|
|
2514
|
+
*
|
|
2515
|
+
* Default: [Epoch](https://www.epoch101.com/) timestamp. <br />
|
|
2516
|
+
*/
|
|
2517
|
+
sortOrder?: number | null;
|
|
2518
|
+
/** Item title. */
|
|
2519
|
+
title?: string | null;
|
|
2520
|
+
/** Item description. */
|
|
2521
|
+
description?: string | null;
|
|
2522
|
+
/**
|
|
2523
|
+
* Item data type. One of:
|
|
2524
|
+
* <br />
|
|
2525
|
+
* +`"IMAGE"`
|
|
2526
|
+
* <br />
|
|
2527
|
+
* +`"VIDEO"`
|
|
2528
|
+
* @readonly
|
|
2529
|
+
*/
|
|
2530
|
+
type?: Type;
|
|
2531
|
+
/**
|
|
2532
|
+
* Date and time the item was created.
|
|
2533
|
+
* @readonly
|
|
2534
|
+
*/
|
|
2535
|
+
_createdDate?: Date;
|
|
2536
|
+
/**
|
|
2537
|
+
* Date and time the item was last updated.
|
|
2538
|
+
* @readonly
|
|
2539
|
+
*/
|
|
2540
|
+
_updatedDate?: Date;
|
|
2541
|
+
/** Project item link. */
|
|
2542
|
+
link?: Link;
|
|
2543
|
+
}
|
|
2544
|
+
/** @oneof */
|
|
2545
|
+
interface ItemMetadataOneOf {
|
|
2546
|
+
/** Information about the Wix Media image. */
|
|
2547
|
+
image?: Image$2;
|
|
2548
|
+
/** Information about the Wix Media video. */
|
|
2549
|
+
video?: Video$2;
|
|
2550
|
+
}
|
|
2551
|
+
declare enum Type {
|
|
2552
|
+
/** Undefined item type. */
|
|
2553
|
+
UNDEFINED = "UNDEFINED",
|
|
2554
|
+
/** Image item type. */
|
|
2555
|
+
IMAGE = "IMAGE",
|
|
2556
|
+
/** Video item type. */
|
|
2557
|
+
VIDEO = "VIDEO"
|
|
2558
|
+
}
|
|
2559
|
+
interface Image$2 {
|
|
2560
|
+
/** Information about the Wix Media image. */
|
|
2561
|
+
imageInfo?: string;
|
|
2562
|
+
/** Focal point of the image. */
|
|
2563
|
+
focalPoint?: Point$2;
|
|
2564
|
+
}
|
|
2565
|
+
declare enum ImageType$2 {
|
|
2566
|
+
UNDEFINED = "UNDEFINED",
|
|
2567
|
+
WIX_MEDIA = "WIX_MEDIA",
|
|
2568
|
+
EXTERNAL = "EXTERNAL"
|
|
2569
|
+
}
|
|
2570
|
+
interface Point$2 {
|
|
2571
|
+
/** X-coordinate of the focal point. */
|
|
2572
|
+
x?: number;
|
|
2573
|
+
/** Y-coordinate of the focal point. */
|
|
2574
|
+
y?: number;
|
|
2575
|
+
}
|
|
2576
|
+
interface UnsharpMasking$2 {
|
|
2577
|
+
/**
|
|
2578
|
+
* Unsharp masking amount. Controls the sharpening strength. <br />
|
|
2579
|
+
*
|
|
2580
|
+
* Min: `0` <br />
|
|
2581
|
+
* Max: `5`
|
|
1576
2582
|
*/
|
|
1577
2583
|
amount?: number | null;
|
|
1578
2584
|
/** Unsharp masking radius in pixels. Controls the sharpening width. */
|
|
@@ -2262,7 +3268,7 @@ interface DuplicateProjectItemsOptions {
|
|
|
2262
3268
|
targetProjectId: string;
|
|
2263
3269
|
}
|
|
2264
3270
|
|
|
2265
|
-
declare function createProjectItem$1(httpClient: HttpClient): CreateProjectItemSignature;
|
|
3271
|
+
declare function createProjectItem$1(httpClient: HttpClient$3): CreateProjectItemSignature;
|
|
2266
3272
|
interface CreateProjectItemSignature {
|
|
2267
3273
|
/**
|
|
2268
3274
|
* Creates a project item.
|
|
@@ -2271,14 +3277,14 @@ interface CreateProjectItemSignature {
|
|
|
2271
3277
|
*/
|
|
2272
3278
|
(item: Item): Promise<Item & ItemNonNullableFields>;
|
|
2273
3279
|
}
|
|
2274
|
-
declare function bulkCreateProjectItems$1(httpClient: HttpClient): BulkCreateProjectItemsSignature;
|
|
3280
|
+
declare function bulkCreateProjectItems$1(httpClient: HttpClient$3): BulkCreateProjectItemsSignature;
|
|
2275
3281
|
interface BulkCreateProjectItemsSignature {
|
|
2276
3282
|
/**
|
|
2277
3283
|
* Creates multiple project items.
|
|
2278
3284
|
*/
|
|
2279
3285
|
(options?: BulkCreateProjectItemsOptions | undefined): Promise<BulkCreateProjectItemsResponse & BulkCreateProjectItemsResponseNonNullableFields>;
|
|
2280
3286
|
}
|
|
2281
|
-
declare function getProjectItem$1(httpClient: HttpClient): GetProjectItemSignature;
|
|
3287
|
+
declare function getProjectItem$1(httpClient: HttpClient$3): GetProjectItemSignature;
|
|
2282
3288
|
interface GetProjectItemSignature {
|
|
2283
3289
|
/**
|
|
2284
3290
|
* Retrieves a project item.
|
|
@@ -2287,7 +3293,7 @@ interface GetProjectItemSignature {
|
|
|
2287
3293
|
*/
|
|
2288
3294
|
(itemId: string): Promise<Item & ItemNonNullableFields>;
|
|
2289
3295
|
}
|
|
2290
|
-
declare function listProjectItems$1(httpClient: HttpClient): ListProjectItemsSignature;
|
|
3296
|
+
declare function listProjectItems$1(httpClient: HttpClient$3): ListProjectItemsSignature;
|
|
2291
3297
|
interface ListProjectItemsSignature {
|
|
2292
3298
|
/**
|
|
2293
3299
|
* Retrieves a list of all project items in the specified project.
|
|
@@ -2297,7 +3303,7 @@ interface ListProjectItemsSignature {
|
|
|
2297
3303
|
*/
|
|
2298
3304
|
(projectId: string, options?: ListProjectItemsOptions | undefined): Promise<ListProjectItemsResponse & ListProjectItemsResponseNonNullableFields>;
|
|
2299
3305
|
}
|
|
2300
|
-
declare function updateProjectItem$1(httpClient: HttpClient): UpdateProjectItemSignature;
|
|
3306
|
+
declare function updateProjectItem$1(httpClient: HttpClient$3): UpdateProjectItemSignature;
|
|
2301
3307
|
interface UpdateProjectItemSignature {
|
|
2302
3308
|
/**
|
|
2303
3309
|
* Updates a project item.
|
|
@@ -2306,14 +3312,14 @@ interface UpdateProjectItemSignature {
|
|
|
2306
3312
|
*/
|
|
2307
3313
|
(_id: string | null, item: UpdateProjectItem): Promise<Item & ItemNonNullableFields>;
|
|
2308
3314
|
}
|
|
2309
|
-
declare function bulkUpdateProjectItems$1(httpClient: HttpClient): BulkUpdateProjectItemsSignature;
|
|
3315
|
+
declare function bulkUpdateProjectItems$1(httpClient: HttpClient$3): BulkUpdateProjectItemsSignature;
|
|
2310
3316
|
interface BulkUpdateProjectItemsSignature {
|
|
2311
3317
|
/**
|
|
2312
3318
|
* Updates multiple project items.
|
|
2313
3319
|
*/
|
|
2314
3320
|
(options?: BulkUpdateProjectItemsOptions | undefined): Promise<BulkUpdateProjectItemsResponse & BulkUpdateProjectItemsResponseNonNullableFields>;
|
|
2315
3321
|
}
|
|
2316
|
-
declare function deleteProjectItem$1(httpClient: HttpClient): DeleteProjectItemSignature;
|
|
3322
|
+
declare function deleteProjectItem$1(httpClient: HttpClient$3): DeleteProjectItemSignature;
|
|
2317
3323
|
interface DeleteProjectItemSignature {
|
|
2318
3324
|
/**
|
|
2319
3325
|
* Deletes a project item.
|
|
@@ -2321,14 +3327,14 @@ interface DeleteProjectItemSignature {
|
|
|
2321
3327
|
*/
|
|
2322
3328
|
(itemId: string): Promise<DeleteProjectItemResponse & DeleteProjectItemResponseNonNullableFields>;
|
|
2323
3329
|
}
|
|
2324
|
-
declare function bulkDeleteProjectItems$1(httpClient: HttpClient): BulkDeleteProjectItemsSignature;
|
|
3330
|
+
declare function bulkDeleteProjectItems$1(httpClient: HttpClient$3): BulkDeleteProjectItemsSignature;
|
|
2325
3331
|
interface BulkDeleteProjectItemsSignature {
|
|
2326
3332
|
/**
|
|
2327
3333
|
* Deletes multiple project items.
|
|
2328
3334
|
*/
|
|
2329
3335
|
(options: BulkDeleteProjectItemsOptions): Promise<BulkDeleteProjectItemsResponse & BulkDeleteProjectItemsResponseNonNullableFields>;
|
|
2330
3336
|
}
|
|
2331
|
-
declare function duplicateProjectItems$1(httpClient: HttpClient): DuplicateProjectItemsSignature;
|
|
3337
|
+
declare function duplicateProjectItems$1(httpClient: HttpClient$3): DuplicateProjectItemsSignature;
|
|
2332
3338
|
interface DuplicateProjectItemsSignature {
|
|
2333
3339
|
/**
|
|
2334
3340
|
* Duplicates project items from one project (the origin) to another project (the target).
|
|
@@ -2342,124 +3348,584 @@ interface DuplicateProjectItemsSignature {
|
|
|
2342
3348
|
*/
|
|
2343
3349
|
(originProjectId: string, options: DuplicateProjectItemsOptions): Promise<DuplicateProjectItemsResponse & DuplicateProjectItemsResponseNonNullableFields>;
|
|
2344
3350
|
}
|
|
2345
|
-
declare const onProjectItemCreated$1: EventDefinition$
|
|
2346
|
-
declare const onProjectItemUpdated$1: EventDefinition$
|
|
2347
|
-
declare const onProjectItemDeleted$1: EventDefinition$
|
|
3351
|
+
declare const onProjectItemCreated$1: EventDefinition$3<ProjectItemCreatedEnvelope, "wix.portfolio.project_items.v1.project_item_created">;
|
|
3352
|
+
declare const onProjectItemUpdated$1: EventDefinition$3<ProjectItemUpdatedEnvelope, "wix.portfolio.project_items.v1.project_item_updated">;
|
|
3353
|
+
declare const onProjectItemDeleted$1: EventDefinition$3<ProjectItemDeletedEnvelope, "wix.portfolio.project_items.v1.project_item_deleted">;
|
|
3354
|
+
|
|
3355
|
+
declare function createEventModule$2<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
|
|
3356
|
+
|
|
3357
|
+
declare const createProjectItem: MaybeContext$3<BuildRESTFunction$3<typeof createProjectItem$1> & typeof createProjectItem$1>;
|
|
3358
|
+
declare const bulkCreateProjectItems: MaybeContext$3<BuildRESTFunction$3<typeof bulkCreateProjectItems$1> & typeof bulkCreateProjectItems$1>;
|
|
3359
|
+
declare const getProjectItem: MaybeContext$3<BuildRESTFunction$3<typeof getProjectItem$1> & typeof getProjectItem$1>;
|
|
3360
|
+
declare const listProjectItems: MaybeContext$3<BuildRESTFunction$3<typeof listProjectItems$1> & typeof listProjectItems$1>;
|
|
3361
|
+
declare const updateProjectItem: MaybeContext$3<BuildRESTFunction$3<typeof updateProjectItem$1> & typeof updateProjectItem$1>;
|
|
3362
|
+
declare const bulkUpdateProjectItems: MaybeContext$3<BuildRESTFunction$3<typeof bulkUpdateProjectItems$1> & typeof bulkUpdateProjectItems$1>;
|
|
3363
|
+
declare const deleteProjectItem: MaybeContext$3<BuildRESTFunction$3<typeof deleteProjectItem$1> & typeof deleteProjectItem$1>;
|
|
3364
|
+
declare const bulkDeleteProjectItems: MaybeContext$3<BuildRESTFunction$3<typeof bulkDeleteProjectItems$1> & typeof bulkDeleteProjectItems$1>;
|
|
3365
|
+
declare const duplicateProjectItems: MaybeContext$3<BuildRESTFunction$3<typeof duplicateProjectItems$1> & typeof duplicateProjectItems$1>;
|
|
3366
|
+
|
|
3367
|
+
type _publicOnProjectItemCreatedType = typeof onProjectItemCreated$1;
|
|
3368
|
+
/** */
|
|
3369
|
+
declare const onProjectItemCreated: ReturnType<typeof createEventModule$2<_publicOnProjectItemCreatedType>>;
|
|
3370
|
+
|
|
3371
|
+
type _publicOnProjectItemUpdatedType = typeof onProjectItemUpdated$1;
|
|
3372
|
+
/** */
|
|
3373
|
+
declare const onProjectItemUpdated: ReturnType<typeof createEventModule$2<_publicOnProjectItemUpdatedType>>;
|
|
3374
|
+
|
|
3375
|
+
type _publicOnProjectItemDeletedType = typeof onProjectItemDeleted$1;
|
|
3376
|
+
/** */
|
|
3377
|
+
declare const onProjectItemDeleted: ReturnType<typeof createEventModule$2<_publicOnProjectItemDeletedType>>;
|
|
3378
|
+
|
|
3379
|
+
type index_d$3_BulkCreateProjectItemResult = BulkCreateProjectItemResult;
|
|
3380
|
+
type index_d$3_BulkCreateProjectItemsOptions = BulkCreateProjectItemsOptions;
|
|
3381
|
+
type index_d$3_BulkCreateProjectItemsRequest = BulkCreateProjectItemsRequest;
|
|
3382
|
+
type index_d$3_BulkCreateProjectItemsResponse = BulkCreateProjectItemsResponse;
|
|
3383
|
+
type index_d$3_BulkCreateProjectItemsResponseNonNullableFields = BulkCreateProjectItemsResponseNonNullableFields;
|
|
3384
|
+
type index_d$3_BulkDeleteProjectItemResult = BulkDeleteProjectItemResult;
|
|
3385
|
+
type index_d$3_BulkDeleteProjectItemsOptions = BulkDeleteProjectItemsOptions;
|
|
3386
|
+
type index_d$3_BulkDeleteProjectItemsRequest = BulkDeleteProjectItemsRequest;
|
|
3387
|
+
type index_d$3_BulkDeleteProjectItemsResponse = BulkDeleteProjectItemsResponse;
|
|
3388
|
+
type index_d$3_BulkDeleteProjectItemsResponseNonNullableFields = BulkDeleteProjectItemsResponseNonNullableFields;
|
|
3389
|
+
type index_d$3_BulkUpdateProjectItemResult = BulkUpdateProjectItemResult;
|
|
3390
|
+
type index_d$3_BulkUpdateProjectItemsOptions = BulkUpdateProjectItemsOptions;
|
|
3391
|
+
type index_d$3_BulkUpdateProjectItemsRequest = BulkUpdateProjectItemsRequest;
|
|
3392
|
+
type index_d$3_BulkUpdateProjectItemsResponse = BulkUpdateProjectItemsResponse;
|
|
3393
|
+
type index_d$3_BulkUpdateProjectItemsResponseNonNullableFields = BulkUpdateProjectItemsResponseNonNullableFields;
|
|
3394
|
+
type index_d$3_CreateProjectGalleryRequest = CreateProjectGalleryRequest;
|
|
3395
|
+
type index_d$3_CreateProjectGalleryResponse = CreateProjectGalleryResponse;
|
|
3396
|
+
type index_d$3_CreateProjectItemRequest = CreateProjectItemRequest;
|
|
3397
|
+
type index_d$3_CreateProjectItemResponse = CreateProjectItemResponse;
|
|
3398
|
+
type index_d$3_CreateProjectItemResponseNonNullableFields = CreateProjectItemResponseNonNullableFields;
|
|
3399
|
+
type index_d$3_DeleteProjectItemRequest = DeleteProjectItemRequest;
|
|
3400
|
+
type index_d$3_DeleteProjectItemResponse = DeleteProjectItemResponse;
|
|
3401
|
+
type index_d$3_DeleteProjectItemResponseNonNullableFields = DeleteProjectItemResponseNonNullableFields;
|
|
3402
|
+
type index_d$3_DuplicateProjectItemsOptions = DuplicateProjectItemsOptions;
|
|
3403
|
+
type index_d$3_DuplicateProjectItemsRequest = DuplicateProjectItemsRequest;
|
|
3404
|
+
type index_d$3_DuplicateProjectItemsResponse = DuplicateProjectItemsResponse;
|
|
3405
|
+
type index_d$3_DuplicateProjectItemsResponseNonNullableFields = DuplicateProjectItemsResponseNonNullableFields;
|
|
3406
|
+
type index_d$3_GenerateTokenForProjectItemsRequest = GenerateTokenForProjectItemsRequest;
|
|
3407
|
+
type index_d$3_GenerateTokenForProjectItemsResponse = GenerateTokenForProjectItemsResponse;
|
|
3408
|
+
type index_d$3_GetProjectItemRequest = GetProjectItemRequest;
|
|
3409
|
+
type index_d$3_GetProjectItemResponse = GetProjectItemResponse;
|
|
3410
|
+
type index_d$3_GetProjectItemResponseNonNullableFields = GetProjectItemResponseNonNullableFields;
|
|
3411
|
+
type index_d$3_Item = Item;
|
|
3412
|
+
type index_d$3_ItemMetadataOneOf = ItemMetadataOneOf;
|
|
3413
|
+
type index_d$3_ItemNonNullableFields = ItemNonNullableFields;
|
|
3414
|
+
type index_d$3_Link = Link;
|
|
3415
|
+
type index_d$3_ListProjectItemsOptions = ListProjectItemsOptions;
|
|
3416
|
+
type index_d$3_ListProjectItemsRequest = ListProjectItemsRequest;
|
|
3417
|
+
type index_d$3_ListProjectItemsResponse = ListProjectItemsResponse;
|
|
3418
|
+
type index_d$3_ListProjectItemsResponseNonNullableFields = ListProjectItemsResponseNonNullableFields;
|
|
3419
|
+
type index_d$3_MaskedItem = MaskedItem;
|
|
3420
|
+
type index_d$3_ProjectItemCreatedEnvelope = ProjectItemCreatedEnvelope;
|
|
3421
|
+
type index_d$3_ProjectItemDeletedEnvelope = ProjectItemDeletedEnvelope;
|
|
3422
|
+
type index_d$3_ProjectItemMediaToken = ProjectItemMediaToken;
|
|
3423
|
+
type index_d$3_ProjectItemUpdatedEnvelope = ProjectItemUpdatedEnvelope;
|
|
3424
|
+
type index_d$3_QueryProjectItemsRequest = QueryProjectItemsRequest;
|
|
3425
|
+
type index_d$3_QueryProjectItemsResponse = QueryProjectItemsResponse;
|
|
3426
|
+
type index_d$3_Tags = Tags;
|
|
3427
|
+
type index_d$3_Type = Type;
|
|
3428
|
+
declare const index_d$3_Type: typeof Type;
|
|
3429
|
+
type index_d$3_UpdateProjectItem = UpdateProjectItem;
|
|
3430
|
+
type index_d$3_UpdateProjectItemRequest = UpdateProjectItemRequest;
|
|
3431
|
+
type index_d$3_UpdateProjectItemResponse = UpdateProjectItemResponse;
|
|
3432
|
+
type index_d$3_UpdateProjectItemResponseNonNullableFields = UpdateProjectItemResponseNonNullableFields;
|
|
3433
|
+
type index_d$3__publicOnProjectItemCreatedType = _publicOnProjectItemCreatedType;
|
|
3434
|
+
type index_d$3__publicOnProjectItemDeletedType = _publicOnProjectItemDeletedType;
|
|
3435
|
+
type index_d$3__publicOnProjectItemUpdatedType = _publicOnProjectItemUpdatedType;
|
|
3436
|
+
declare const index_d$3_bulkCreateProjectItems: typeof bulkCreateProjectItems;
|
|
3437
|
+
declare const index_d$3_bulkDeleteProjectItems: typeof bulkDeleteProjectItems;
|
|
3438
|
+
declare const index_d$3_bulkUpdateProjectItems: typeof bulkUpdateProjectItems;
|
|
3439
|
+
declare const index_d$3_createProjectItem: typeof createProjectItem;
|
|
3440
|
+
declare const index_d$3_deleteProjectItem: typeof deleteProjectItem;
|
|
3441
|
+
declare const index_d$3_duplicateProjectItems: typeof duplicateProjectItems;
|
|
3442
|
+
declare const index_d$3_getProjectItem: typeof getProjectItem;
|
|
3443
|
+
declare const index_d$3_listProjectItems: typeof listProjectItems;
|
|
3444
|
+
declare const index_d$3_onProjectItemCreated: typeof onProjectItemCreated;
|
|
3445
|
+
declare const index_d$3_onProjectItemDeleted: typeof onProjectItemDeleted;
|
|
3446
|
+
declare const index_d$3_onProjectItemUpdated: typeof onProjectItemUpdated;
|
|
3447
|
+
declare const index_d$3_updateProjectItem: typeof updateProjectItem;
|
|
3448
|
+
declare namespace index_d$3 {
|
|
3449
|
+
export { type ActionEvent$3 as ActionEvent, type App$1 as App, type ApplicationError$1 as ApplicationError, type BaseEventMetadata$2 as BaseEventMetadata, type BulkActionMetadata$1 as BulkActionMetadata, type index_d$3_BulkCreateProjectItemResult as BulkCreateProjectItemResult, type index_d$3_BulkCreateProjectItemsOptions as BulkCreateProjectItemsOptions, type index_d$3_BulkCreateProjectItemsRequest as BulkCreateProjectItemsRequest, type index_d$3_BulkCreateProjectItemsResponse as BulkCreateProjectItemsResponse, type index_d$3_BulkCreateProjectItemsResponseNonNullableFields as BulkCreateProjectItemsResponseNonNullableFields, type index_d$3_BulkDeleteProjectItemResult as BulkDeleteProjectItemResult, type index_d$3_BulkDeleteProjectItemsOptions as BulkDeleteProjectItemsOptions, type index_d$3_BulkDeleteProjectItemsRequest as BulkDeleteProjectItemsRequest, type index_d$3_BulkDeleteProjectItemsResponse as BulkDeleteProjectItemsResponse, type index_d$3_BulkDeleteProjectItemsResponseNonNullableFields as BulkDeleteProjectItemsResponseNonNullableFields, type index_d$3_BulkUpdateProjectItemResult as BulkUpdateProjectItemResult, type index_d$3_BulkUpdateProjectItemsOptions as BulkUpdateProjectItemsOptions, type index_d$3_BulkUpdateProjectItemsRequest as BulkUpdateProjectItemsRequest, type index_d$3_BulkUpdateProjectItemsResponse as BulkUpdateProjectItemsResponse, type index_d$3_BulkUpdateProjectItemsResponseNonNullableFields as BulkUpdateProjectItemsResponseNonNullableFields, type index_d$3_CreateProjectGalleryRequest as CreateProjectGalleryRequest, type index_d$3_CreateProjectGalleryResponse as CreateProjectGalleryResponse, type index_d$3_CreateProjectItemRequest as CreateProjectItemRequest, type index_d$3_CreateProjectItemResponse as CreateProjectItemResponse, type index_d$3_CreateProjectItemResponseNonNullableFields as CreateProjectItemResponseNonNullableFields, type CursorPaging$3 as CursorPaging, type Cursors$3 as Cursors, type index_d$3_DeleteProjectItemRequest as DeleteProjectItemRequest, type index_d$3_DeleteProjectItemResponse as DeleteProjectItemResponse, type index_d$3_DeleteProjectItemResponseNonNullableFields as DeleteProjectItemResponseNonNullableFields, type DeletedProjectRestored$1 as DeletedProjectRestored, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type index_d$3_DuplicateProjectItemsOptions as DuplicateProjectItemsOptions, type index_d$3_DuplicateProjectItemsRequest as DuplicateProjectItemsRequest, type index_d$3_DuplicateProjectItemsResponse as DuplicateProjectItemsResponse, type index_d$3_DuplicateProjectItemsResponseNonNullableFields as DuplicateProjectItemsResponseNonNullableFields, type Empty$2 as Empty, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type File$1 as File, type index_d$3_GenerateTokenForProjectItemsRequest as GenerateTokenForProjectItemsRequest, type index_d$3_GenerateTokenForProjectItemsResponse as GenerateTokenForProjectItemsResponse, type index_d$3_GetProjectItemRequest as GetProjectItemRequest, type index_d$3_GetProjectItemResponse as GetProjectItemResponse, type index_d$3_GetProjectItemResponseNonNullableFields as GetProjectItemResponseNonNullableFields, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type Image$2 as Image, ImageType$2 as ImageType, type InvalidateCache$1 as InvalidateCache, type InvalidateCacheGetByOneOf$1 as InvalidateCacheGetByOneOf, type index_d$3_Item as Item, type ItemMetadata$1 as ItemMetadata, type index_d$3_ItemMetadataOneOf as ItemMetadataOneOf, type index_d$3_ItemNonNullableFields as ItemNonNullableFields, type index_d$3_Link as Link, type index_d$3_ListProjectItemsOptions as ListProjectItemsOptions, type index_d$3_ListProjectItemsRequest as ListProjectItemsRequest, type index_d$3_ListProjectItemsResponse as ListProjectItemsResponse, type index_d$3_ListProjectItemsResponseNonNullableFields as ListProjectItemsResponseNonNullableFields, type index_d$3_MaskedItem as MaskedItem, type MessageEnvelope$3 as MessageEnvelope, type Page$1 as Page, type Paging$2 as Paging, type PagingMetadataV2$3 as PagingMetadataV2, type Point$2 as Point, type index_d$3_ProjectItemCreatedEnvelope as ProjectItemCreatedEnvelope, type index_d$3_ProjectItemDeletedEnvelope as ProjectItemDeletedEnvelope, type index_d$3_ProjectItemMediaToken as ProjectItemMediaToken, type index_d$3_ProjectItemUpdatedEnvelope as ProjectItemUpdatedEnvelope, type index_d$3_QueryProjectItemsRequest as QueryProjectItemsRequest, type index_d$3_QueryProjectItemsResponse as QueryProjectItemsResponse, type QueryV2$2 as QueryV2, type QueryV2PagingMethodOneOf$2 as QueryV2PagingMethodOneOf, type RestoreInfo$3 as RestoreInfo, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, type index_d$3_Tags as Tags, index_d$3_Type as Type, type URI$1 as URI, type UnsharpMasking$2 as UnsharpMasking, type index_d$3_UpdateProjectItem as UpdateProjectItem, type index_d$3_UpdateProjectItemRequest as UpdateProjectItemRequest, type index_d$3_UpdateProjectItemResponse as UpdateProjectItemResponse, type index_d$3_UpdateProjectItemResponseNonNullableFields as UpdateProjectItemResponseNonNullableFields, type Video$2 as Video, type VideoResolution$2 as VideoResolution, WebhookIdentityType$3 as WebhookIdentityType, type index_d$3__publicOnProjectItemCreatedType as _publicOnProjectItemCreatedType, type index_d$3__publicOnProjectItemDeletedType as _publicOnProjectItemDeletedType, type index_d$3__publicOnProjectItemUpdatedType as _publicOnProjectItemUpdatedType, index_d$3_bulkCreateProjectItems as bulkCreateProjectItems, index_d$3_bulkDeleteProjectItems as bulkDeleteProjectItems, index_d$3_bulkUpdateProjectItems as bulkUpdateProjectItems, index_d$3_createProjectItem as createProjectItem, index_d$3_deleteProjectItem as deleteProjectItem, index_d$3_duplicateProjectItems as duplicateProjectItems, index_d$3_getProjectItem as getProjectItem, index_d$3_listProjectItems as listProjectItems, index_d$3_onProjectItemCreated as onProjectItemCreated, index_d$3_onProjectItemDeleted as onProjectItemDeleted, index_d$3_onProjectItemUpdated as onProjectItemUpdated, onProjectItemCreated$1 as publicOnProjectItemCreated, onProjectItemDeleted$1 as publicOnProjectItemDeleted, onProjectItemUpdated$1 as publicOnProjectItemUpdated, index_d$3_updateProjectItem as updateProjectItem };
|
|
3450
|
+
}
|
|
3451
|
+
|
|
3452
|
+
type HostModule$2<T, H extends Host$2> = {
|
|
3453
|
+
__type: 'host';
|
|
3454
|
+
create(host: H): T;
|
|
3455
|
+
};
|
|
3456
|
+
type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
|
|
3457
|
+
type Host$2<Environment = unknown> = {
|
|
3458
|
+
channel: {
|
|
3459
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
3460
|
+
disconnect: () => void;
|
|
3461
|
+
} | Promise<{
|
|
3462
|
+
disconnect: () => void;
|
|
3463
|
+
}>;
|
|
3464
|
+
};
|
|
3465
|
+
environment?: Environment;
|
|
3466
|
+
/**
|
|
3467
|
+
* Optional name of the environment, use for logging
|
|
3468
|
+
*/
|
|
3469
|
+
name?: string;
|
|
3470
|
+
/**
|
|
3471
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
3472
|
+
*/
|
|
3473
|
+
apiBaseUrl?: string;
|
|
3474
|
+
/**
|
|
3475
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
3476
|
+
* like internationalization, billing, etc.
|
|
3477
|
+
*/
|
|
3478
|
+
essentials?: {
|
|
3479
|
+
/**
|
|
3480
|
+
* The language of the currently viewed session
|
|
3481
|
+
*/
|
|
3482
|
+
language?: string;
|
|
3483
|
+
/**
|
|
3484
|
+
* The locale of the currently viewed session
|
|
3485
|
+
*/
|
|
3486
|
+
locale?: string;
|
|
3487
|
+
/**
|
|
3488
|
+
* Any headers that should be passed through to the API requests
|
|
3489
|
+
*/
|
|
3490
|
+
passThroughHeaders?: Record<string, string>;
|
|
3491
|
+
};
|
|
3492
|
+
};
|
|
3493
|
+
|
|
3494
|
+
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
3495
|
+
interface HttpClient$2 {
|
|
3496
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
3497
|
+
fetchWithAuth: typeof fetch;
|
|
3498
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
3499
|
+
getActiveToken?: () => string | undefined;
|
|
3500
|
+
}
|
|
3501
|
+
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
3502
|
+
type HttpResponse$2<T = any> = {
|
|
3503
|
+
data: T;
|
|
3504
|
+
status: number;
|
|
3505
|
+
statusText: string;
|
|
3506
|
+
headers: any;
|
|
3507
|
+
request?: any;
|
|
3508
|
+
};
|
|
3509
|
+
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
3510
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3511
|
+
url: string;
|
|
3512
|
+
data?: Data;
|
|
3513
|
+
params?: URLSearchParams;
|
|
3514
|
+
} & APIMetadata$2;
|
|
3515
|
+
type APIMetadata$2 = {
|
|
3516
|
+
methodFqn?: string;
|
|
3517
|
+
entityFqdn?: string;
|
|
3518
|
+
packageName?: string;
|
|
3519
|
+
};
|
|
3520
|
+
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
3521
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
3522
|
+
__type: 'event-definition';
|
|
3523
|
+
type: Type;
|
|
3524
|
+
isDomainEvent?: boolean;
|
|
3525
|
+
transformations?: (envelope: unknown) => Payload;
|
|
3526
|
+
__payload: Payload;
|
|
3527
|
+
};
|
|
3528
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
3529
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
3530
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
3531
|
+
|
|
3532
|
+
type ServicePluginMethodInput$2 = {
|
|
3533
|
+
request: any;
|
|
3534
|
+
metadata: any;
|
|
3535
|
+
};
|
|
3536
|
+
type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
|
|
3537
|
+
type ServicePluginMethodMetadata$2 = {
|
|
3538
|
+
name: string;
|
|
3539
|
+
primaryHttpMappingPath: string;
|
|
3540
|
+
transformations: {
|
|
3541
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
|
|
3542
|
+
toREST: (...args: unknown[]) => unknown;
|
|
3543
|
+
};
|
|
3544
|
+
};
|
|
3545
|
+
type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
|
|
3546
|
+
__type: 'service-plugin-definition';
|
|
3547
|
+
componentType: string;
|
|
3548
|
+
methods: ServicePluginMethodMetadata$2[];
|
|
3549
|
+
__contract: Contract;
|
|
3550
|
+
};
|
|
3551
|
+
declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
|
|
3552
|
+
type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
|
|
3553
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
|
|
3554
|
+
|
|
3555
|
+
type RequestContext$2 = {
|
|
3556
|
+
isSSR: boolean;
|
|
3557
|
+
host: string;
|
|
3558
|
+
protocol?: string;
|
|
3559
|
+
};
|
|
3560
|
+
type ResponseTransformer$2 = (data: any, headers?: any) => any;
|
|
3561
|
+
/**
|
|
3562
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
3563
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
3564
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
3565
|
+
*/
|
|
3566
|
+
type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
3567
|
+
type AmbassadorRequestOptions$2<T = any> = {
|
|
3568
|
+
_?: T;
|
|
3569
|
+
url?: string;
|
|
3570
|
+
method?: Method$2;
|
|
3571
|
+
params?: any;
|
|
3572
|
+
data?: any;
|
|
3573
|
+
transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
|
|
3574
|
+
};
|
|
3575
|
+
type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
|
|
3576
|
+
__isAmbassador: boolean;
|
|
3577
|
+
};
|
|
3578
|
+
type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
|
|
3579
|
+
type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
3580
|
+
|
|
3581
|
+
declare global {
|
|
3582
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3583
|
+
interface SymbolConstructor {
|
|
3584
|
+
readonly observable: symbol;
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
declare const emptyObjectSymbol$2: unique symbol;
|
|
3589
|
+
|
|
3590
|
+
/**
|
|
3591
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
3592
|
+
|
|
3593
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
3594
|
+
|
|
3595
|
+
@example
|
|
3596
|
+
```
|
|
3597
|
+
import type {EmptyObject} from 'type-fest';
|
|
3598
|
+
|
|
3599
|
+
// The following illustrates the problem with `{}`.
|
|
3600
|
+
const foo1: {} = {}; // Pass
|
|
3601
|
+
const foo2: {} = []; // Pass
|
|
3602
|
+
const foo3: {} = 42; // Pass
|
|
3603
|
+
const foo4: {} = {a: 1}; // Pass
|
|
3604
|
+
|
|
3605
|
+
// With `EmptyObject` only the first case is valid.
|
|
3606
|
+
const bar1: EmptyObject = {}; // Pass
|
|
3607
|
+
const bar2: EmptyObject = 42; // Fail
|
|
3608
|
+
const bar3: EmptyObject = []; // Fail
|
|
3609
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
3610
|
+
```
|
|
3611
|
+
|
|
3612
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
3613
|
+
|
|
3614
|
+
@category Object
|
|
3615
|
+
*/
|
|
3616
|
+
type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
|
|
3617
|
+
|
|
3618
|
+
/**
|
|
3619
|
+
Returns a boolean for whether the two given types are equal.
|
|
3620
|
+
|
|
3621
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
3622
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
3623
|
+
|
|
3624
|
+
Use-cases:
|
|
3625
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
3626
|
+
|
|
3627
|
+
@example
|
|
3628
|
+
```
|
|
3629
|
+
import type {IsEqual} from 'type-fest';
|
|
3630
|
+
|
|
3631
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
3632
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
3633
|
+
type Includes<Value extends readonly any[], Item> =
|
|
3634
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
3635
|
+
? IsEqual<Value[0], Item> extends true
|
|
3636
|
+
? true
|
|
3637
|
+
: Includes<rest, Item>
|
|
3638
|
+
: false;
|
|
3639
|
+
```
|
|
3640
|
+
|
|
3641
|
+
@category Type Guard
|
|
3642
|
+
@category Utilities
|
|
3643
|
+
*/
|
|
3644
|
+
type IsEqual$2<A, B> =
|
|
3645
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
3646
|
+
(<G>() => G extends B ? 1 : 2)
|
|
3647
|
+
? true
|
|
3648
|
+
: false;
|
|
2348
3649
|
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
3650
|
+
/**
|
|
3651
|
+
Filter out keys from an object.
|
|
3652
|
+
|
|
3653
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
3654
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
3655
|
+
Returns `Key` otherwise.
|
|
3656
|
+
|
|
3657
|
+
@example
|
|
3658
|
+
```
|
|
3659
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
3660
|
+
//=> never
|
|
3661
|
+
```
|
|
3662
|
+
|
|
3663
|
+
@example
|
|
3664
|
+
```
|
|
3665
|
+
type Filtered = Filter<'bar', string>;
|
|
3666
|
+
//=> never
|
|
3667
|
+
```
|
|
3668
|
+
|
|
3669
|
+
@example
|
|
3670
|
+
```
|
|
3671
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
3672
|
+
//=> 'bar'
|
|
3673
|
+
```
|
|
3674
|
+
|
|
3675
|
+
@see {Except}
|
|
3676
|
+
*/
|
|
3677
|
+
type Filter$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
3678
|
+
|
|
3679
|
+
type ExceptOptions$2 = {
|
|
3680
|
+
/**
|
|
3681
|
+
Disallow assigning non-specified properties.
|
|
3682
|
+
|
|
3683
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
3684
|
+
|
|
3685
|
+
@default false
|
|
3686
|
+
*/
|
|
3687
|
+
requireExactProps?: boolean;
|
|
2355
3688
|
};
|
|
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
3689
|
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
3690
|
+
/**
|
|
3691
|
+
Create a type from an object type without certain keys.
|
|
3692
|
+
|
|
3693
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
3694
|
+
|
|
3695
|
+
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
3696
|
+
|
|
3697
|
+
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
3698
|
+
|
|
3699
|
+
@example
|
|
3700
|
+
```
|
|
3701
|
+
import type {Except} from 'type-fest';
|
|
3702
|
+
|
|
3703
|
+
type Foo = {
|
|
3704
|
+
a: number;
|
|
3705
|
+
b: string;
|
|
3706
|
+
};
|
|
3707
|
+
|
|
3708
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
3709
|
+
//=> {b: string}
|
|
3710
|
+
|
|
3711
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
3712
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
3713
|
+
|
|
3714
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
3715
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
3716
|
+
|
|
3717
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
3718
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
3719
|
+
```
|
|
3720
|
+
|
|
3721
|
+
@category Object
|
|
3722
|
+
*/
|
|
3723
|
+
type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
|
|
3724
|
+
[KeyType in keyof ObjectType as Filter$2<KeyType, KeysType>]: ObjectType[KeyType];
|
|
3725
|
+
} & (Options['requireExactProps'] extends true
|
|
3726
|
+
? Partial<Record<KeysType, never>>
|
|
3727
|
+
: {});
|
|
3728
|
+
|
|
3729
|
+
/**
|
|
3730
|
+
Returns a boolean for whether the given type is `never`.
|
|
3731
|
+
|
|
3732
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
3733
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
3734
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
3735
|
+
|
|
3736
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
3737
|
+
|
|
3738
|
+
@example
|
|
3739
|
+
```
|
|
3740
|
+
import type {IsNever, And} from 'type-fest';
|
|
3741
|
+
|
|
3742
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
3743
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
3744
|
+
And<
|
|
3745
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
3746
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
3747
|
+
>;
|
|
3748
|
+
|
|
3749
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
3750
|
+
AreStringsEqual<I, O> extends true
|
|
3751
|
+
? never
|
|
3752
|
+
: void;
|
|
3753
|
+
|
|
3754
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
3755
|
+
if (input === output) {
|
|
3756
|
+
process.exit(0);
|
|
2364
3757
|
}
|
|
2365
3758
|
}
|
|
2366
3759
|
|
|
2367
|
-
|
|
3760
|
+
endIfEqual('abc', 'abc');
|
|
3761
|
+
//=> never
|
|
2368
3762
|
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
declare const listProjectItems: MaybeContext<BuildRESTFunction<typeof listProjectItems$1> & typeof listProjectItems$1>;
|
|
2373
|
-
declare const updateProjectItem: MaybeContext<BuildRESTFunction<typeof updateProjectItem$1> & typeof updateProjectItem$1>;
|
|
2374
|
-
declare const bulkUpdateProjectItems: MaybeContext<BuildRESTFunction<typeof bulkUpdateProjectItems$1> & typeof bulkUpdateProjectItems$1>;
|
|
2375
|
-
declare const deleteProjectItem: MaybeContext<BuildRESTFunction<typeof deleteProjectItem$1> & typeof deleteProjectItem$1>;
|
|
2376
|
-
declare const bulkDeleteProjectItems: MaybeContext<BuildRESTFunction<typeof bulkDeleteProjectItems$1> & typeof bulkDeleteProjectItems$1>;
|
|
2377
|
-
declare const duplicateProjectItems: MaybeContext<BuildRESTFunction<typeof duplicateProjectItems$1> & typeof duplicateProjectItems$1>;
|
|
3763
|
+
endIfEqual('abc', '123');
|
|
3764
|
+
//=> void
|
|
3765
|
+
```
|
|
2378
3766
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
3767
|
+
@category Type Guard
|
|
3768
|
+
@category Utilities
|
|
3769
|
+
*/
|
|
3770
|
+
type IsNever$2<T> = [T] extends [never] ? true : false;
|
|
2382
3771
|
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
declare const onProjectItemUpdated: ReturnType<typeof createEventModule$2<_publicOnProjectItemUpdatedType>>;
|
|
3772
|
+
/**
|
|
3773
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
2386
3774
|
|
|
2387
|
-
|
|
2388
|
-
/** */
|
|
2389
|
-
declare const onProjectItemDeleted: ReturnType<typeof createEventModule$2<_publicOnProjectItemDeletedType>>;
|
|
3775
|
+
@see {@link IsNever}
|
|
2390
3776
|
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
type
|
|
2394
|
-
|
|
2395
|
-
type
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
type
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
type
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
type
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
type
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
type
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
type
|
|
2434
|
-
|
|
2435
|
-
type
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
type
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
3777
|
+
@example
|
|
3778
|
+
```
|
|
3779
|
+
import type {IfNever} from 'type-fest';
|
|
3780
|
+
|
|
3781
|
+
type ShouldBeTrue = IfNever<never>;
|
|
3782
|
+
//=> true
|
|
3783
|
+
|
|
3784
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
3785
|
+
//=> 'bar'
|
|
3786
|
+
```
|
|
3787
|
+
|
|
3788
|
+
@category Type Guard
|
|
3789
|
+
@category Utilities
|
|
3790
|
+
*/
|
|
3791
|
+
type IfNever$2<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
3792
|
+
IsNever$2<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
3793
|
+
);
|
|
3794
|
+
|
|
3795
|
+
/**
|
|
3796
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
3797
|
+
|
|
3798
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
3799
|
+
|
|
3800
|
+
@example
|
|
3801
|
+
```
|
|
3802
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
3803
|
+
|
|
3804
|
+
interface Example {
|
|
3805
|
+
a: string;
|
|
3806
|
+
b: string | number;
|
|
3807
|
+
c?: string;
|
|
3808
|
+
d: {};
|
|
3809
|
+
}
|
|
3810
|
+
|
|
3811
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
3812
|
+
//=> 'a'
|
|
3813
|
+
```
|
|
3814
|
+
|
|
3815
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
3816
|
+
|
|
3817
|
+
@example
|
|
3818
|
+
```
|
|
3819
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
3820
|
+
|
|
3821
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
3822
|
+
//=> 'a' | 'c'
|
|
3823
|
+
```
|
|
3824
|
+
|
|
3825
|
+
@category Object
|
|
3826
|
+
*/
|
|
3827
|
+
type ConditionalKeys$2<Base, Condition> =
|
|
3828
|
+
{
|
|
3829
|
+
// Map through all the keys of the given base type.
|
|
3830
|
+
[Key in keyof Base]-?:
|
|
3831
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
3832
|
+
Base[Key] extends Condition
|
|
3833
|
+
// Retain this key
|
|
3834
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
3835
|
+
? IfNever$2<Base[Key], IfNever$2<Condition, Key, never>, Key>
|
|
3836
|
+
// Discard this key since the condition fails.
|
|
3837
|
+
: never;
|
|
3838
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
3839
|
+
}[keyof Base];
|
|
3840
|
+
|
|
3841
|
+
/**
|
|
3842
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
3843
|
+
|
|
3844
|
+
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
3845
|
+
|
|
3846
|
+
@example
|
|
3847
|
+
```
|
|
3848
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
3849
|
+
|
|
3850
|
+
class Awesome {
|
|
3851
|
+
name: string;
|
|
3852
|
+
successes: number;
|
|
3853
|
+
failures: bigint;
|
|
3854
|
+
|
|
3855
|
+
run() {}
|
|
3856
|
+
}
|
|
3857
|
+
|
|
3858
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
3859
|
+
//=> {run: () => void}
|
|
3860
|
+
```
|
|
3861
|
+
|
|
3862
|
+
@example
|
|
3863
|
+
```
|
|
3864
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
3865
|
+
|
|
3866
|
+
interface Example {
|
|
3867
|
+
a: string;
|
|
3868
|
+
b: string | number;
|
|
3869
|
+
c: () => void;
|
|
3870
|
+
d: {};
|
|
3871
|
+
}
|
|
3872
|
+
|
|
3873
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
3874
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
3875
|
+
```
|
|
3876
|
+
|
|
3877
|
+
@category Object
|
|
3878
|
+
*/
|
|
3879
|
+
type ConditionalExcept$2<Base, Condition> = Except$2<
|
|
3880
|
+
Base,
|
|
3881
|
+
ConditionalKeys$2<Base, Condition>
|
|
3882
|
+
>;
|
|
3883
|
+
|
|
3884
|
+
/**
|
|
3885
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
3886
|
+
* can either be a REST module or a host module.
|
|
3887
|
+
* This type is recursive, so it can describe nested modules.
|
|
3888
|
+
*/
|
|
3889
|
+
type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$2<any> | ServicePluginDefinition$2<any> | {
|
|
3890
|
+
[key: string]: Descriptors$2 | PublicMetadata$2 | any;
|
|
3891
|
+
};
|
|
3892
|
+
/**
|
|
3893
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
3894
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
3895
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
3896
|
+
* do not match the given host (as they will not work with the given host).
|
|
3897
|
+
*/
|
|
3898
|
+
type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
|
|
3899
|
+
done: T;
|
|
3900
|
+
recurse: T extends {
|
|
3901
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
|
|
3902
|
+
} ? never : T extends AmbassadorFunctionDescriptor$2 ? BuildAmbassadorFunction$2<T> : T extends RESTFunctionDescriptor$2 ? BuildRESTFunction$2<T> : T extends EventDefinition$2<any> ? BuildEventDefinition$2<T> : T extends ServicePluginDefinition$2<any> ? BuildServicePluginDefinition$2<T> : T extends HostModule$2<any, any> ? HostModuleAPI$2<T> : ConditionalExcept$2<{
|
|
3903
|
+
[Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
|
|
3904
|
+
-1,
|
|
3905
|
+
0,
|
|
3906
|
+
1,
|
|
3907
|
+
2,
|
|
3908
|
+
3,
|
|
3909
|
+
4,
|
|
3910
|
+
5
|
|
3911
|
+
][Depth]> : never;
|
|
3912
|
+
}, EmptyObject$2>;
|
|
3913
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
3914
|
+
type PublicMetadata$2 = {
|
|
3915
|
+
PACKAGE_NAME?: string;
|
|
3916
|
+
};
|
|
3917
|
+
|
|
3918
|
+
declare global {
|
|
3919
|
+
interface ContextualClient {
|
|
3920
|
+
}
|
|
2462
3921
|
}
|
|
3922
|
+
/**
|
|
3923
|
+
* A type used to create concerete types from SDK descriptors in
|
|
3924
|
+
* case a contextual client is available.
|
|
3925
|
+
*/
|
|
3926
|
+
type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
|
|
3927
|
+
host: Host$2;
|
|
3928
|
+
} ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
|
|
2463
3929
|
|
|
2464
3930
|
interface Project$1 extends ProjectCoverOneOf$1 {
|
|
2465
3931
|
/** Project cover image. */
|
|
@@ -2639,7 +4105,7 @@ interface Keyword$1 {
|
|
|
2639
4105
|
term?: string;
|
|
2640
4106
|
/** Whether the keyword is the main focus keyword. */
|
|
2641
4107
|
isMain?: boolean;
|
|
2642
|
-
/**
|
|
4108
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
2643
4109
|
origin?: string | null;
|
|
2644
4110
|
}
|
|
2645
4111
|
interface Tag$1 {
|
|
@@ -3721,14 +5187,14 @@ interface QueryProjectsWithCollectionInfoOptions {
|
|
|
3721
5187
|
includePageUrl?: boolean | null;
|
|
3722
5188
|
}
|
|
3723
5189
|
|
|
3724
|
-
declare function getProjectPageData$1(httpClient: HttpClient): GetProjectPageDataSignature;
|
|
5190
|
+
declare function getProjectPageData$1(httpClient: HttpClient$2): GetProjectPageDataSignature;
|
|
3725
5191
|
interface GetProjectPageDataSignature {
|
|
3726
5192
|
/**
|
|
3727
5193
|
* Get project data for a specific project
|
|
3728
5194
|
*/
|
|
3729
5195
|
(identifiers: GetProjectPageDataIdentifiers): Promise<GetProjectPageDataResponse & GetProjectPageDataResponseNonNullableFields>;
|
|
3730
5196
|
}
|
|
3731
|
-
declare function createProject$1(httpClient: HttpClient): CreateProjectSignature;
|
|
5197
|
+
declare function createProject$1(httpClient: HttpClient$2): CreateProjectSignature;
|
|
3732
5198
|
interface CreateProjectSignature {
|
|
3733
5199
|
/**
|
|
3734
5200
|
* Creates a project.
|
|
@@ -3737,7 +5203,7 @@ interface CreateProjectSignature {
|
|
|
3737
5203
|
*/
|
|
3738
5204
|
(project: Project$1): Promise<Project$1 & ProjectNonNullableFields$1>;
|
|
3739
5205
|
}
|
|
3740
|
-
declare function getProject$1(httpClient: HttpClient): GetProjectSignature;
|
|
5206
|
+
declare function getProject$1(httpClient: HttpClient$2): GetProjectSignature;
|
|
3741
5207
|
interface GetProjectSignature {
|
|
3742
5208
|
/**
|
|
3743
5209
|
* Retrieves a project.
|
|
@@ -3746,14 +5212,14 @@ interface GetProjectSignature {
|
|
|
3746
5212
|
*/
|
|
3747
5213
|
(projectId: string, options?: GetProjectOptions | undefined): Promise<Project$1 & ProjectNonNullableFields$1>;
|
|
3748
5214
|
}
|
|
3749
|
-
declare function listProjects$1(httpClient: HttpClient): ListProjectsSignature;
|
|
5215
|
+
declare function listProjects$1(httpClient: HttpClient$2): ListProjectsSignature;
|
|
3750
5216
|
interface ListProjectsSignature {
|
|
3751
5217
|
/**
|
|
3752
5218
|
* Retrieves a list of all projects in a portfolio.
|
|
3753
5219
|
*/
|
|
3754
5220
|
(options?: ListProjectsOptions | undefined): Promise<ListProjectsResponse & ListProjectsResponseNonNullableFields>;
|
|
3755
5221
|
}
|
|
3756
|
-
declare function updateProject$1(httpClient: HttpClient): UpdateProjectSignature;
|
|
5222
|
+
declare function updateProject$1(httpClient: HttpClient$2): UpdateProjectSignature;
|
|
3757
5223
|
interface UpdateProjectSignature {
|
|
3758
5224
|
/**
|
|
3759
5225
|
* Updates a project.
|
|
@@ -3762,14 +5228,14 @@ interface UpdateProjectSignature {
|
|
|
3762
5228
|
*/
|
|
3763
5229
|
(_id: string | null, project: UpdateProject): Promise<Project$1 & ProjectNonNullableFields$1>;
|
|
3764
5230
|
}
|
|
3765
|
-
declare function bulkUpdateProjects$1(httpClient: HttpClient): BulkUpdateProjectsSignature;
|
|
5231
|
+
declare function bulkUpdateProjects$1(httpClient: HttpClient$2): BulkUpdateProjectsSignature;
|
|
3766
5232
|
interface BulkUpdateProjectsSignature {
|
|
3767
5233
|
/**
|
|
3768
5234
|
* Updates multiple projects.
|
|
3769
5235
|
*/
|
|
3770
5236
|
(options?: BulkUpdateProjectsOptions | undefined): Promise<BulkUpdateProjectsResponse & BulkUpdateProjectsResponseNonNullableFields>;
|
|
3771
5237
|
}
|
|
3772
|
-
declare function deleteProject$1(httpClient: HttpClient): DeleteProjectSignature;
|
|
5238
|
+
declare function deleteProject$1(httpClient: HttpClient$2): DeleteProjectSignature;
|
|
3773
5239
|
interface DeleteProjectSignature {
|
|
3774
5240
|
/**
|
|
3775
5241
|
* Deletes a project.
|
|
@@ -3777,165 +5243,625 @@ interface DeleteProjectSignature {
|
|
|
3777
5243
|
*/
|
|
3778
5244
|
(projectId: string): Promise<DeleteProjectResponse & DeleteProjectResponseNonNullableFields>;
|
|
3779
5245
|
}
|
|
3780
|
-
declare function queryProjects$1(httpClient: HttpClient): QueryProjectsSignature;
|
|
3781
|
-
interface QueryProjectsSignature {
|
|
3782
|
-
/**
|
|
3783
|
-
* Retrieves a list of projects, given the provided paging, filtering, and sorting. Up to 100 projects can be returned per request.
|
|
3784
|
-
*
|
|
3785
|
-
* The default `sort` is `id` in `ASC`.
|
|
3786
|
-
*
|
|
3787
|
-
* For a detailed list of supported operations, see [Projects: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/portfolio/projects/sort-and-filter).
|
|
3788
|
-
* To learn how to query projects, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).
|
|
3789
|
-
*/
|
|
3790
|
-
(options?: QueryProjectsOptions | undefined): ProjectsQueryBuilder;
|
|
5246
|
+
declare function queryProjects$1(httpClient: HttpClient$2): QueryProjectsSignature;
|
|
5247
|
+
interface QueryProjectsSignature {
|
|
5248
|
+
/**
|
|
5249
|
+
* Retrieves a list of projects, given the provided paging, filtering, and sorting. Up to 100 projects can be returned per request.
|
|
5250
|
+
*
|
|
5251
|
+
* The default `sort` is `id` in `ASC`.
|
|
5252
|
+
*
|
|
5253
|
+
* For a detailed list of supported operations, see [Projects: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/portfolio/projects/sort-and-filter).
|
|
5254
|
+
* To learn how to query projects, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).
|
|
5255
|
+
*/
|
|
5256
|
+
(options?: QueryProjectsOptions | undefined): ProjectsQueryBuilder;
|
|
5257
|
+
}
|
|
5258
|
+
declare function updateProjectOrderInCollection$3(httpClient: HttpClient$2): UpdateProjectOrderInCollectionSignature$1;
|
|
5259
|
+
interface UpdateProjectOrderInCollectionSignature$1 {
|
|
5260
|
+
/**
|
|
5261
|
+
* Deprecated - please use ProjectsInCollectionsService.UpdateProjectOrderInCollection instead
|
|
5262
|
+
* our Client still use it
|
|
5263
|
+
* @param - Sort order of the project within the specified collection.
|
|
5264
|
+
* @deprecated
|
|
5265
|
+
*/
|
|
5266
|
+
(identifiers: UpdateProjectOrderInCollectionIdentifiers$1, sortOrder: number | null): Promise<UpdateProjectOrderInCollectionResponse$1 & UpdateProjectOrderInCollectionResponseNonNullableFields$1>;
|
|
5267
|
+
}
|
|
5268
|
+
declare function queryProjectsWithCollectionInfo$1(httpClient: HttpClient$2): QueryProjectsWithCollectionInfoSignature;
|
|
5269
|
+
interface QueryProjectsWithCollectionInfoSignature {
|
|
5270
|
+
/**
|
|
5271
|
+
* Deprecated - please use ProjectsInCollectionsService.QueryProjectsInCollections instead
|
|
5272
|
+
* our Client still use it
|
|
5273
|
+
* @param - WQL expression
|
|
5274
|
+
* @deprecated
|
|
5275
|
+
*/
|
|
5276
|
+
(query: QueryV2$1, options?: QueryProjectsWithCollectionInfoOptions | undefined): Promise<QueryProjectWithCollectionInfoResponse & QueryProjectWithCollectionInfoResponseNonNullableFields>;
|
|
5277
|
+
}
|
|
5278
|
+
declare const onProjectCreated$1: EventDefinition$2<ProjectCreatedEnvelope, "wix.portfolio.projects.v1.project_created">;
|
|
5279
|
+
declare const onProjectUpdated$1: EventDefinition$2<ProjectUpdatedEnvelope, "wix.portfolio.projects.v1.project_updated">;
|
|
5280
|
+
declare const onProjectDeleted$1: EventDefinition$2<ProjectDeletedEnvelope, "wix.portfolio.projects.v1.project_deleted">;
|
|
5281
|
+
|
|
5282
|
+
declare function createEventModule$1<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
|
5283
|
+
|
|
5284
|
+
declare const getProjectPageData: MaybeContext$2<BuildRESTFunction$2<typeof getProjectPageData$1> & typeof getProjectPageData$1>;
|
|
5285
|
+
declare const createProject: MaybeContext$2<BuildRESTFunction$2<typeof createProject$1> & typeof createProject$1>;
|
|
5286
|
+
declare const getProject: MaybeContext$2<BuildRESTFunction$2<typeof getProject$1> & typeof getProject$1>;
|
|
5287
|
+
declare const listProjects: MaybeContext$2<BuildRESTFunction$2<typeof listProjects$1> & typeof listProjects$1>;
|
|
5288
|
+
declare const updateProject: MaybeContext$2<BuildRESTFunction$2<typeof updateProject$1> & typeof updateProject$1>;
|
|
5289
|
+
declare const bulkUpdateProjects: MaybeContext$2<BuildRESTFunction$2<typeof bulkUpdateProjects$1> & typeof bulkUpdateProjects$1>;
|
|
5290
|
+
declare const deleteProject: MaybeContext$2<BuildRESTFunction$2<typeof deleteProject$1> & typeof deleteProject$1>;
|
|
5291
|
+
declare const queryProjects: MaybeContext$2<BuildRESTFunction$2<typeof queryProjects$1> & typeof queryProjects$1>;
|
|
5292
|
+
declare const updateProjectOrderInCollection$2: MaybeContext$2<BuildRESTFunction$2<typeof updateProjectOrderInCollection$3> & typeof updateProjectOrderInCollection$3>;
|
|
5293
|
+
declare const queryProjectsWithCollectionInfo: MaybeContext$2<BuildRESTFunction$2<typeof queryProjectsWithCollectionInfo$1> & typeof queryProjectsWithCollectionInfo$1>;
|
|
5294
|
+
|
|
5295
|
+
type _publicOnProjectCreatedType = typeof onProjectCreated$1;
|
|
5296
|
+
/**
|
|
5297
|
+
* Triggered when a project is created.
|
|
5298
|
+
*/
|
|
5299
|
+
declare const onProjectCreated: ReturnType<typeof createEventModule$1<_publicOnProjectCreatedType>>;
|
|
5300
|
+
|
|
5301
|
+
type _publicOnProjectUpdatedType = typeof onProjectUpdated$1;
|
|
5302
|
+
/** */
|
|
5303
|
+
declare const onProjectUpdated: ReturnType<typeof createEventModule$1<_publicOnProjectUpdatedType>>;
|
|
5304
|
+
|
|
5305
|
+
type _publicOnProjectDeletedType = typeof onProjectDeleted$1;
|
|
5306
|
+
/**
|
|
5307
|
+
* Triggered when a project is deleted.
|
|
5308
|
+
*/
|
|
5309
|
+
declare const onProjectDeleted: ReturnType<typeof createEventModule$1<_publicOnProjectDeletedType>>;
|
|
5310
|
+
|
|
5311
|
+
type index_d$2_App = App;
|
|
5312
|
+
type index_d$2_ApplicationError = ApplicationError;
|
|
5313
|
+
type index_d$2_BulkActionMetadata = BulkActionMetadata;
|
|
5314
|
+
type index_d$2_BulkUpdateProjectsOptions = BulkUpdateProjectsOptions;
|
|
5315
|
+
type index_d$2_BulkUpdateProjectsRequest = BulkUpdateProjectsRequest;
|
|
5316
|
+
type index_d$2_BulkUpdateProjectsResponse = BulkUpdateProjectsResponse;
|
|
5317
|
+
type index_d$2_BulkUpdateProjectsResponseNonNullableFields = BulkUpdateProjectsResponseNonNullableFields;
|
|
5318
|
+
type index_d$2_BulkUpdateProjectsResult = BulkUpdateProjectsResult;
|
|
5319
|
+
type index_d$2_CreateNewPortfolioAppRequest = CreateNewPortfolioAppRequest;
|
|
5320
|
+
type index_d$2_CreateNewPortfolioAppResponse = CreateNewPortfolioAppResponse;
|
|
5321
|
+
type index_d$2_CreateProjectRequest = CreateProjectRequest;
|
|
5322
|
+
type index_d$2_CreateProjectResponse = CreateProjectResponse;
|
|
5323
|
+
type index_d$2_CreateProjectResponseNonNullableFields = CreateProjectResponseNonNullableFields;
|
|
5324
|
+
type index_d$2_DeleteProjectRequest = DeleteProjectRequest;
|
|
5325
|
+
type index_d$2_DeleteProjectResponse = DeleteProjectResponse;
|
|
5326
|
+
type index_d$2_DeleteProjectResponseNonNullableFields = DeleteProjectResponseNonNullableFields;
|
|
5327
|
+
type index_d$2_DeletedProjectRestored = DeletedProjectRestored;
|
|
5328
|
+
type index_d$2_File = File;
|
|
5329
|
+
type index_d$2_GetProjectOptions = GetProjectOptions;
|
|
5330
|
+
type index_d$2_GetProjectPageDataIdentifiers = GetProjectPageDataIdentifiers;
|
|
5331
|
+
type index_d$2_GetProjectPageDataRequest = GetProjectPageDataRequest;
|
|
5332
|
+
type index_d$2_GetProjectPageDataResponse = GetProjectPageDataResponse;
|
|
5333
|
+
type index_d$2_GetProjectPageDataResponseNonNullableFields = GetProjectPageDataResponseNonNullableFields;
|
|
5334
|
+
type index_d$2_GetProjectRequest = GetProjectRequest;
|
|
5335
|
+
type index_d$2_GetProjectResponse = GetProjectResponse;
|
|
5336
|
+
type index_d$2_GetProjectResponseNonNullableFields = GetProjectResponseNonNullableFields;
|
|
5337
|
+
type index_d$2_InvalidateCache = InvalidateCache;
|
|
5338
|
+
type index_d$2_InvalidateCacheGetByOneOf = InvalidateCacheGetByOneOf;
|
|
5339
|
+
type index_d$2_ItemMetadata = ItemMetadata;
|
|
5340
|
+
type index_d$2_ListProjectsOptions = ListProjectsOptions;
|
|
5341
|
+
type index_d$2_ListProjectsRequest = ListProjectsRequest;
|
|
5342
|
+
type index_d$2_ListProjectsResponse = ListProjectsResponse;
|
|
5343
|
+
type index_d$2_ListProjectsResponseNonNullableFields = ListProjectsResponseNonNullableFields;
|
|
5344
|
+
type index_d$2_MaskedProject = MaskedProject;
|
|
5345
|
+
type index_d$2_MenuSettingUpdatedEvent = MenuSettingUpdatedEvent;
|
|
5346
|
+
type index_d$2_Page = Page;
|
|
5347
|
+
type index_d$2_ProjectCreatedEnvelope = ProjectCreatedEnvelope;
|
|
5348
|
+
type index_d$2_ProjectDeletedEnvelope = ProjectDeletedEnvelope;
|
|
5349
|
+
type index_d$2_ProjectSlug = ProjectSlug;
|
|
5350
|
+
type index_d$2_ProjectUpdatedEnvelope = ProjectUpdatedEnvelope;
|
|
5351
|
+
type index_d$2_ProjectsQueryBuilder = ProjectsQueryBuilder;
|
|
5352
|
+
type index_d$2_ProjectsQueryResult = ProjectsQueryResult;
|
|
5353
|
+
type index_d$2_QueryProjectWithCollectionInfoRequest = QueryProjectWithCollectionInfoRequest;
|
|
5354
|
+
type index_d$2_QueryProjectWithCollectionInfoResponse = QueryProjectWithCollectionInfoResponse;
|
|
5355
|
+
type index_d$2_QueryProjectWithCollectionInfoResponseNonNullableFields = QueryProjectWithCollectionInfoResponseNonNullableFields;
|
|
5356
|
+
type index_d$2_QueryProjectsOptions = QueryProjectsOptions;
|
|
5357
|
+
type index_d$2_QueryProjectsRequest = QueryProjectsRequest;
|
|
5358
|
+
type index_d$2_QueryProjectsResponse = QueryProjectsResponse;
|
|
5359
|
+
type index_d$2_QueryProjectsResponseNonNullableFields = QueryProjectsResponseNonNullableFields;
|
|
5360
|
+
type index_d$2_QueryProjectsWithCollectionInfoOptions = QueryProjectsWithCollectionInfoOptions;
|
|
5361
|
+
type index_d$2_RestoreProjectFromTrashBinRequest = RestoreProjectFromTrashBinRequest;
|
|
5362
|
+
type index_d$2_RestoreProjectFromTrashBinResponse = RestoreProjectFromTrashBinResponse;
|
|
5363
|
+
type index_d$2_SyncProjectWithCollectionMappings = SyncProjectWithCollectionMappings;
|
|
5364
|
+
type index_d$2_URI = URI;
|
|
5365
|
+
type index_d$2_UpdateProject = UpdateProject;
|
|
5366
|
+
type index_d$2_UpdateProjectRequest = UpdateProjectRequest;
|
|
5367
|
+
type index_d$2_UpdateProjectResponse = UpdateProjectResponse;
|
|
5368
|
+
type index_d$2_UpdateProjectResponseNonNullableFields = UpdateProjectResponseNonNullableFields;
|
|
5369
|
+
type index_d$2__publicOnProjectCreatedType = _publicOnProjectCreatedType;
|
|
5370
|
+
type index_d$2__publicOnProjectDeletedType = _publicOnProjectDeletedType;
|
|
5371
|
+
type index_d$2__publicOnProjectUpdatedType = _publicOnProjectUpdatedType;
|
|
5372
|
+
declare const index_d$2_bulkUpdateProjects: typeof bulkUpdateProjects;
|
|
5373
|
+
declare const index_d$2_createProject: typeof createProject;
|
|
5374
|
+
declare const index_d$2_deleteProject: typeof deleteProject;
|
|
5375
|
+
declare const index_d$2_getProject: typeof getProject;
|
|
5376
|
+
declare const index_d$2_getProjectPageData: typeof getProjectPageData;
|
|
5377
|
+
declare const index_d$2_listProjects: typeof listProjects;
|
|
5378
|
+
declare const index_d$2_onProjectCreated: typeof onProjectCreated;
|
|
5379
|
+
declare const index_d$2_onProjectDeleted: typeof onProjectDeleted;
|
|
5380
|
+
declare const index_d$2_onProjectUpdated: typeof onProjectUpdated;
|
|
5381
|
+
declare const index_d$2_queryProjects: typeof queryProjects;
|
|
5382
|
+
declare const index_d$2_queryProjectsWithCollectionInfo: typeof queryProjectsWithCollectionInfo;
|
|
5383
|
+
declare const index_d$2_updateProject: typeof updateProject;
|
|
5384
|
+
declare namespace index_d$2 {
|
|
5385
|
+
export { type ActionEvent$2 as ActionEvent, type index_d$2_App as App, type index_d$2_ApplicationError as ApplicationError, type Asset$1 as Asset, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$2_BulkActionMetadata as BulkActionMetadata, type index_d$2_BulkUpdateProjectsOptions as BulkUpdateProjectsOptions, type index_d$2_BulkUpdateProjectsRequest as BulkUpdateProjectsRequest, type index_d$2_BulkUpdateProjectsResponse as BulkUpdateProjectsResponse, type index_d$2_BulkUpdateProjectsResponseNonNullableFields as BulkUpdateProjectsResponseNonNullableFields, type index_d$2_BulkUpdateProjectsResult as BulkUpdateProjectsResult, type index_d$2_CreateNewPortfolioAppRequest as CreateNewPortfolioAppRequest, type index_d$2_CreateNewPortfolioAppResponse as CreateNewPortfolioAppResponse, type index_d$2_CreateProjectRequest as CreateProjectRequest, type index_d$2_CreateProjectResponse as CreateProjectResponse, type index_d$2_CreateProjectResponseNonNullableFields as CreateProjectResponseNonNullableFields, type CursorPaging$2 as CursorPaging, type Cursors$2 as Cursors, type DeleteContext$1 as DeleteContext, type index_d$2_DeleteProjectRequest as DeleteProjectRequest, type index_d$2_DeleteProjectResponse as DeleteProjectResponse, type index_d$2_DeleteProjectResponseNonNullableFields as DeleteProjectResponseNonNullableFields, DeleteStatus$1 as DeleteStatus, type index_d$2_DeletedProjectRestored as DeletedProjectRestored, type DetailsLink$1 as DetailsLink, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type index_d$2_File as File, type index_d$2_GetProjectOptions as GetProjectOptions, type index_d$2_GetProjectPageDataIdentifiers as GetProjectPageDataIdentifiers, type index_d$2_GetProjectPageDataRequest as GetProjectPageDataRequest, type index_d$2_GetProjectPageDataResponse as GetProjectPageDataResponse, type index_d$2_GetProjectPageDataResponseNonNullableFields as GetProjectPageDataResponseNonNullableFields, type index_d$2_GetProjectRequest as GetProjectRequest, type index_d$2_GetProjectResponse as GetProjectResponse, type index_d$2_GetProjectResponseNonNullableFields as GetProjectResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type Image$1 as Image, ImageType$1 as ImageType, type index_d$2_InvalidateCache as InvalidateCache, type index_d$2_InvalidateCacheGetByOneOf as InvalidateCacheGetByOneOf, type index_d$2_ItemMetadata as ItemMetadata, type Keyword$1 as Keyword, type index_d$2_ListProjectsOptions as ListProjectsOptions, type index_d$2_ListProjectsRequest as ListProjectsRequest, type index_d$2_ListProjectsResponse as ListProjectsResponse, type index_d$2_ListProjectsResponseNonNullableFields as ListProjectsResponseNonNullableFields, type index_d$2_MaskedProject as MaskedProject, type index_d$2_MenuSettingUpdatedEvent as MenuSettingUpdatedEvent, type MessageEnvelope$2 as MessageEnvelope, type MetaSiteSpecialEvent$1 as MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf$1 as MetaSiteSpecialEventPayloadOneOf, Namespace$1 as Namespace, type NamespaceChanged$1 as NamespaceChanged, type index_d$2_Page as Page, type Paging$1 as Paging, type PagingMetadataV2$2 as PagingMetadataV2, type Point$1 as Point, type Project$1 as Project, type ProjectCoverOneOf$1 as ProjectCoverOneOf, type index_d$2_ProjectCreatedEnvelope as ProjectCreatedEnvelope, type index_d$2_ProjectDeletedEnvelope as ProjectDeletedEnvelope, type ProjectDetail$1 as ProjectDetail, type ProjectDetailValueOneOf$1 as ProjectDetailValueOneOf, type ProjectInCollection$1 as ProjectInCollection, type ProjectNonNullableFields$1 as ProjectNonNullableFields, type index_d$2_ProjectSlug as ProjectSlug, type ProjectSource$1 as ProjectSource, type index_d$2_ProjectUpdatedEnvelope as ProjectUpdatedEnvelope, type index_d$2_ProjectsQueryBuilder as ProjectsQueryBuilder, type index_d$2_ProjectsQueryResult as ProjectsQueryResult, type index_d$2_QueryProjectWithCollectionInfoRequest as QueryProjectWithCollectionInfoRequest, type index_d$2_QueryProjectWithCollectionInfoResponse as QueryProjectWithCollectionInfoResponse, type index_d$2_QueryProjectWithCollectionInfoResponseNonNullableFields as QueryProjectWithCollectionInfoResponseNonNullableFields, type index_d$2_QueryProjectsOptions as QueryProjectsOptions, type index_d$2_QueryProjectsRequest as QueryProjectsRequest, type index_d$2_QueryProjectsResponse as QueryProjectsResponse, type index_d$2_QueryProjectsResponseNonNullableFields as QueryProjectsResponseNonNullableFields, type index_d$2_QueryProjectsWithCollectionInfoOptions as QueryProjectsWithCollectionInfoOptions, type QueryV2$1 as QueryV2, type QueryV2PagingMethodOneOf$1 as QueryV2PagingMethodOneOf, type RestoreInfo$2 as RestoreInfo, type index_d$2_RestoreProjectFromTrashBinRequest as RestoreProjectFromTrashBinRequest, type index_d$2_RestoreProjectFromTrashBinResponse as RestoreProjectFromTrashBinResponse, type SeoSchema$1 as SeoSchema, type ServiceProvisioned$1 as ServiceProvisioned, type ServiceRemoved$1 as ServiceRemoved, type Settings$1 as Settings, type SiteCreated$1 as SiteCreated, SiteCreatedContext$1 as SiteCreatedContext, type SiteDeleted$1 as SiteDeleted, type SiteHardDeleted$1 as SiteHardDeleted, type SiteMarkedAsTemplate$1 as SiteMarkedAsTemplate, type SiteMarkedAsWixSite$1 as SiteMarkedAsWixSite, type SitePublished$1 as SitePublished, type SiteRenamed$1 as SiteRenamed, type SiteTransferred$1 as SiteTransferred, type SiteUndeleted$1 as SiteUndeleted, type SiteUnpublished$1 as SiteUnpublished, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, State$1 as State, type StudioAssigned$1 as StudioAssigned, type StudioUnassigned$1 as StudioUnassigned, type index_d$2_SyncProjectWithCollectionMappings as SyncProjectWithCollectionMappings, SyncStatus$2 as SyncStatus, type Tag$1 as Tag, type index_d$2_URI as URI, type UnsharpMasking$1 as UnsharpMasking, type index_d$2_UpdateProject as UpdateProject, type UpdateProjectOrderInCollectionIdentifiers$1 as UpdateProjectOrderInCollectionIdentifiers, type UpdateProjectOrderInCollectionRequest$1 as UpdateProjectOrderInCollectionRequest, type UpdateProjectOrderInCollectionResponse$1 as UpdateProjectOrderInCollectionResponse, type UpdateProjectOrderInCollectionResponseNonNullableFields$1 as UpdateProjectOrderInCollectionResponseNonNullableFields, type index_d$2_UpdateProjectRequest as UpdateProjectRequest, type index_d$2_UpdateProjectResponse as UpdateProjectResponse, type index_d$2_UpdateProjectResponseNonNullableFields as UpdateProjectResponseNonNullableFields, type Video$1 as Video, type VideoResolution$1 as VideoResolution, WebhookIdentityType$2 as WebhookIdentityType, type index_d$2__publicOnProjectCreatedType as _publicOnProjectCreatedType, type index_d$2__publicOnProjectDeletedType as _publicOnProjectDeletedType, type index_d$2__publicOnProjectUpdatedType as _publicOnProjectUpdatedType, index_d$2_bulkUpdateProjects as bulkUpdateProjects, index_d$2_createProject as createProject, index_d$2_deleteProject as deleteProject, index_d$2_getProject as getProject, index_d$2_getProjectPageData as getProjectPageData, index_d$2_listProjects as listProjects, index_d$2_onProjectCreated as onProjectCreated, index_d$2_onProjectDeleted as onProjectDeleted, index_d$2_onProjectUpdated as onProjectUpdated, onProjectCreated$1 as publicOnProjectCreated, onProjectDeleted$1 as publicOnProjectDeleted, onProjectUpdated$1 as publicOnProjectUpdated, index_d$2_queryProjects as queryProjects, index_d$2_queryProjectsWithCollectionInfo as queryProjectsWithCollectionInfo, index_d$2_updateProject as updateProject, updateProjectOrderInCollection$2 as updateProjectOrderInCollection };
|
|
5386
|
+
}
|
|
5387
|
+
|
|
5388
|
+
type HostModule$1<T, H extends Host$1> = {
|
|
5389
|
+
__type: 'host';
|
|
5390
|
+
create(host: H): T;
|
|
5391
|
+
};
|
|
5392
|
+
type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
|
|
5393
|
+
type Host$1<Environment = unknown> = {
|
|
5394
|
+
channel: {
|
|
5395
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
5396
|
+
disconnect: () => void;
|
|
5397
|
+
} | Promise<{
|
|
5398
|
+
disconnect: () => void;
|
|
5399
|
+
}>;
|
|
5400
|
+
};
|
|
5401
|
+
environment?: Environment;
|
|
5402
|
+
/**
|
|
5403
|
+
* Optional name of the environment, use for logging
|
|
5404
|
+
*/
|
|
5405
|
+
name?: string;
|
|
5406
|
+
/**
|
|
5407
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
5408
|
+
*/
|
|
5409
|
+
apiBaseUrl?: string;
|
|
5410
|
+
/**
|
|
5411
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
5412
|
+
* like internationalization, billing, etc.
|
|
5413
|
+
*/
|
|
5414
|
+
essentials?: {
|
|
5415
|
+
/**
|
|
5416
|
+
* The language of the currently viewed session
|
|
5417
|
+
*/
|
|
5418
|
+
language?: string;
|
|
5419
|
+
/**
|
|
5420
|
+
* The locale of the currently viewed session
|
|
5421
|
+
*/
|
|
5422
|
+
locale?: string;
|
|
5423
|
+
/**
|
|
5424
|
+
* Any headers that should be passed through to the API requests
|
|
5425
|
+
*/
|
|
5426
|
+
passThroughHeaders?: Record<string, string>;
|
|
5427
|
+
};
|
|
5428
|
+
};
|
|
5429
|
+
|
|
5430
|
+
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
5431
|
+
interface HttpClient$1 {
|
|
5432
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
5433
|
+
fetchWithAuth: typeof fetch;
|
|
5434
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
5435
|
+
getActiveToken?: () => string | undefined;
|
|
5436
|
+
}
|
|
5437
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
5438
|
+
type HttpResponse$1<T = any> = {
|
|
5439
|
+
data: T;
|
|
5440
|
+
status: number;
|
|
5441
|
+
statusText: string;
|
|
5442
|
+
headers: any;
|
|
5443
|
+
request?: any;
|
|
5444
|
+
};
|
|
5445
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
5446
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
5447
|
+
url: string;
|
|
5448
|
+
data?: Data;
|
|
5449
|
+
params?: URLSearchParams;
|
|
5450
|
+
} & APIMetadata$1;
|
|
5451
|
+
type APIMetadata$1 = {
|
|
5452
|
+
methodFqn?: string;
|
|
5453
|
+
entityFqdn?: string;
|
|
5454
|
+
packageName?: string;
|
|
5455
|
+
};
|
|
5456
|
+
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
5457
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
5458
|
+
__type: 'event-definition';
|
|
5459
|
+
type: Type;
|
|
5460
|
+
isDomainEvent?: boolean;
|
|
5461
|
+
transformations?: (envelope: unknown) => Payload;
|
|
5462
|
+
__payload: Payload;
|
|
5463
|
+
};
|
|
5464
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
5465
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
5466
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
5467
|
+
|
|
5468
|
+
type ServicePluginMethodInput$1 = {
|
|
5469
|
+
request: any;
|
|
5470
|
+
metadata: any;
|
|
5471
|
+
};
|
|
5472
|
+
type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
|
|
5473
|
+
type ServicePluginMethodMetadata$1 = {
|
|
5474
|
+
name: string;
|
|
5475
|
+
primaryHttpMappingPath: string;
|
|
5476
|
+
transformations: {
|
|
5477
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
|
|
5478
|
+
toREST: (...args: unknown[]) => unknown;
|
|
5479
|
+
};
|
|
5480
|
+
};
|
|
5481
|
+
type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
|
|
5482
|
+
__type: 'service-plugin-definition';
|
|
5483
|
+
componentType: string;
|
|
5484
|
+
methods: ServicePluginMethodMetadata$1[];
|
|
5485
|
+
__contract: Contract;
|
|
5486
|
+
};
|
|
5487
|
+
declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
|
|
5488
|
+
type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
|
|
5489
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
|
|
5490
|
+
|
|
5491
|
+
type RequestContext$1 = {
|
|
5492
|
+
isSSR: boolean;
|
|
5493
|
+
host: string;
|
|
5494
|
+
protocol?: string;
|
|
5495
|
+
};
|
|
5496
|
+
type ResponseTransformer$1 = (data: any, headers?: any) => any;
|
|
5497
|
+
/**
|
|
5498
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
5499
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
5500
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
5501
|
+
*/
|
|
5502
|
+
type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
5503
|
+
type AmbassadorRequestOptions$1<T = any> = {
|
|
5504
|
+
_?: T;
|
|
5505
|
+
url?: string;
|
|
5506
|
+
method?: Method$1;
|
|
5507
|
+
params?: any;
|
|
5508
|
+
data?: any;
|
|
5509
|
+
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
5510
|
+
};
|
|
5511
|
+
type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
|
|
5512
|
+
__isAmbassador: boolean;
|
|
5513
|
+
};
|
|
5514
|
+
type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
|
|
5515
|
+
type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
5516
|
+
|
|
5517
|
+
declare global {
|
|
5518
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
5519
|
+
interface SymbolConstructor {
|
|
5520
|
+
readonly observable: symbol;
|
|
5521
|
+
}
|
|
5522
|
+
}
|
|
5523
|
+
|
|
5524
|
+
declare const emptyObjectSymbol$1: unique symbol;
|
|
5525
|
+
|
|
5526
|
+
/**
|
|
5527
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
5528
|
+
|
|
5529
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
5530
|
+
|
|
5531
|
+
@example
|
|
5532
|
+
```
|
|
5533
|
+
import type {EmptyObject} from 'type-fest';
|
|
5534
|
+
|
|
5535
|
+
// The following illustrates the problem with `{}`.
|
|
5536
|
+
const foo1: {} = {}; // Pass
|
|
5537
|
+
const foo2: {} = []; // Pass
|
|
5538
|
+
const foo3: {} = 42; // Pass
|
|
5539
|
+
const foo4: {} = {a: 1}; // Pass
|
|
5540
|
+
|
|
5541
|
+
// With `EmptyObject` only the first case is valid.
|
|
5542
|
+
const bar1: EmptyObject = {}; // Pass
|
|
5543
|
+
const bar2: EmptyObject = 42; // Fail
|
|
5544
|
+
const bar3: EmptyObject = []; // Fail
|
|
5545
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
5546
|
+
```
|
|
5547
|
+
|
|
5548
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
5549
|
+
|
|
5550
|
+
@category Object
|
|
5551
|
+
*/
|
|
5552
|
+
type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
|
|
5553
|
+
|
|
5554
|
+
/**
|
|
5555
|
+
Returns a boolean for whether the two given types are equal.
|
|
5556
|
+
|
|
5557
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
5558
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
5559
|
+
|
|
5560
|
+
Use-cases:
|
|
5561
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
5562
|
+
|
|
5563
|
+
@example
|
|
5564
|
+
```
|
|
5565
|
+
import type {IsEqual} from 'type-fest';
|
|
5566
|
+
|
|
5567
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
5568
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
5569
|
+
type Includes<Value extends readonly any[], Item> =
|
|
5570
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
5571
|
+
? IsEqual<Value[0], Item> extends true
|
|
5572
|
+
? true
|
|
5573
|
+
: Includes<rest, Item>
|
|
5574
|
+
: false;
|
|
5575
|
+
```
|
|
5576
|
+
|
|
5577
|
+
@category Type Guard
|
|
5578
|
+
@category Utilities
|
|
5579
|
+
*/
|
|
5580
|
+
type IsEqual$1<A, B> =
|
|
5581
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
5582
|
+
(<G>() => G extends B ? 1 : 2)
|
|
5583
|
+
? true
|
|
5584
|
+
: false;
|
|
5585
|
+
|
|
5586
|
+
/**
|
|
5587
|
+
Filter out keys from an object.
|
|
5588
|
+
|
|
5589
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
5590
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
5591
|
+
Returns `Key` otherwise.
|
|
5592
|
+
|
|
5593
|
+
@example
|
|
5594
|
+
```
|
|
5595
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
5596
|
+
//=> never
|
|
5597
|
+
```
|
|
5598
|
+
|
|
5599
|
+
@example
|
|
5600
|
+
```
|
|
5601
|
+
type Filtered = Filter<'bar', string>;
|
|
5602
|
+
//=> never
|
|
5603
|
+
```
|
|
5604
|
+
|
|
5605
|
+
@example
|
|
5606
|
+
```
|
|
5607
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
5608
|
+
//=> 'bar'
|
|
5609
|
+
```
|
|
5610
|
+
|
|
5611
|
+
@see {Except}
|
|
5612
|
+
*/
|
|
5613
|
+
type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
5614
|
+
|
|
5615
|
+
type ExceptOptions$1 = {
|
|
5616
|
+
/**
|
|
5617
|
+
Disallow assigning non-specified properties.
|
|
5618
|
+
|
|
5619
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
5620
|
+
|
|
5621
|
+
@default false
|
|
5622
|
+
*/
|
|
5623
|
+
requireExactProps?: boolean;
|
|
5624
|
+
};
|
|
5625
|
+
|
|
5626
|
+
/**
|
|
5627
|
+
Create a type from an object type without certain keys.
|
|
5628
|
+
|
|
5629
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
5630
|
+
|
|
5631
|
+
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
5632
|
+
|
|
5633
|
+
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
5634
|
+
|
|
5635
|
+
@example
|
|
5636
|
+
```
|
|
5637
|
+
import type {Except} from 'type-fest';
|
|
5638
|
+
|
|
5639
|
+
type Foo = {
|
|
5640
|
+
a: number;
|
|
5641
|
+
b: string;
|
|
5642
|
+
};
|
|
5643
|
+
|
|
5644
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
5645
|
+
//=> {b: string}
|
|
5646
|
+
|
|
5647
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
5648
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
5649
|
+
|
|
5650
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
5651
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
5652
|
+
|
|
5653
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
5654
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
5655
|
+
```
|
|
5656
|
+
|
|
5657
|
+
@category Object
|
|
5658
|
+
*/
|
|
5659
|
+
type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
|
|
5660
|
+
[KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
|
|
5661
|
+
} & (Options['requireExactProps'] extends true
|
|
5662
|
+
? Partial<Record<KeysType, never>>
|
|
5663
|
+
: {});
|
|
5664
|
+
|
|
5665
|
+
/**
|
|
5666
|
+
Returns a boolean for whether the given type is `never`.
|
|
5667
|
+
|
|
5668
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
5669
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
5670
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
5671
|
+
|
|
5672
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
5673
|
+
|
|
5674
|
+
@example
|
|
5675
|
+
```
|
|
5676
|
+
import type {IsNever, And} from 'type-fest';
|
|
5677
|
+
|
|
5678
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
5679
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
5680
|
+
And<
|
|
5681
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
5682
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
5683
|
+
>;
|
|
5684
|
+
|
|
5685
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
5686
|
+
AreStringsEqual<I, O> extends true
|
|
5687
|
+
? never
|
|
5688
|
+
: void;
|
|
5689
|
+
|
|
5690
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
5691
|
+
if (input === output) {
|
|
5692
|
+
process.exit(0);
|
|
5693
|
+
}
|
|
3791
5694
|
}
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
5695
|
+
|
|
5696
|
+
endIfEqual('abc', 'abc');
|
|
5697
|
+
//=> never
|
|
5698
|
+
|
|
5699
|
+
endIfEqual('abc', '123');
|
|
5700
|
+
//=> void
|
|
5701
|
+
```
|
|
5702
|
+
|
|
5703
|
+
@category Type Guard
|
|
5704
|
+
@category Utilities
|
|
5705
|
+
*/
|
|
5706
|
+
type IsNever$1<T> = [T] extends [never] ? true : false;
|
|
5707
|
+
|
|
5708
|
+
/**
|
|
5709
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
5710
|
+
|
|
5711
|
+
@see {@link IsNever}
|
|
5712
|
+
|
|
5713
|
+
@example
|
|
5714
|
+
```
|
|
5715
|
+
import type {IfNever} from 'type-fest';
|
|
5716
|
+
|
|
5717
|
+
type ShouldBeTrue = IfNever<never>;
|
|
5718
|
+
//=> true
|
|
5719
|
+
|
|
5720
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
5721
|
+
//=> 'bar'
|
|
5722
|
+
```
|
|
5723
|
+
|
|
5724
|
+
@category Type Guard
|
|
5725
|
+
@category Utilities
|
|
5726
|
+
*/
|
|
5727
|
+
type IfNever$1<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
5728
|
+
IsNever$1<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
5729
|
+
);
|
|
5730
|
+
|
|
5731
|
+
/**
|
|
5732
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
5733
|
+
|
|
5734
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
5735
|
+
|
|
5736
|
+
@example
|
|
5737
|
+
```
|
|
5738
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
5739
|
+
|
|
5740
|
+
interface Example {
|
|
5741
|
+
a: string;
|
|
5742
|
+
b: string | number;
|
|
5743
|
+
c?: string;
|
|
5744
|
+
d: {};
|
|
3801
5745
|
}
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
5746
|
+
|
|
5747
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
5748
|
+
//=> 'a'
|
|
5749
|
+
```
|
|
5750
|
+
|
|
5751
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
5752
|
+
|
|
5753
|
+
@example
|
|
5754
|
+
```
|
|
5755
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
5756
|
+
|
|
5757
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
5758
|
+
//=> 'a' | 'c'
|
|
5759
|
+
```
|
|
5760
|
+
|
|
5761
|
+
@category Object
|
|
5762
|
+
*/
|
|
5763
|
+
type ConditionalKeys$1<Base, Condition> =
|
|
5764
|
+
{
|
|
5765
|
+
// Map through all the keys of the given base type.
|
|
5766
|
+
[Key in keyof Base]-?:
|
|
5767
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
5768
|
+
Base[Key] extends Condition
|
|
5769
|
+
// Retain this key
|
|
5770
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
5771
|
+
? IfNever$1<Base[Key], IfNever$1<Condition, Key, never>, Key>
|
|
5772
|
+
// Discard this key since the condition fails.
|
|
5773
|
+
: never;
|
|
5774
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
5775
|
+
}[keyof Base];
|
|
5776
|
+
|
|
5777
|
+
/**
|
|
5778
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
5779
|
+
|
|
5780
|
+
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
5781
|
+
|
|
5782
|
+
@example
|
|
5783
|
+
```
|
|
5784
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
5785
|
+
|
|
5786
|
+
class Awesome {
|
|
5787
|
+
name: string;
|
|
5788
|
+
successes: number;
|
|
5789
|
+
failures: bigint;
|
|
5790
|
+
|
|
5791
|
+
run() {}
|
|
3811
5792
|
}
|
|
3812
|
-
declare const onProjectCreated$1: EventDefinition$4<ProjectCreatedEnvelope, "wix.portfolio.projects.v1.project_created">;
|
|
3813
|
-
declare const onProjectUpdated$1: EventDefinition$4<ProjectUpdatedEnvelope, "wix.portfolio.projects.v1.project_updated">;
|
|
3814
|
-
declare const onProjectDeleted$1: EventDefinition$4<ProjectDeletedEnvelope, "wix.portfolio.projects.v1.project_deleted">;
|
|
3815
5793
|
|
|
3816
|
-
type
|
|
3817
|
-
|
|
3818
|
-
|
|
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;
|
|
5794
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
5795
|
+
//=> {run: () => void}
|
|
5796
|
+
```
|
|
3826
5797
|
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
5798
|
+
@example
|
|
5799
|
+
```
|
|
5800
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
5801
|
+
|
|
5802
|
+
interface Example {
|
|
5803
|
+
a: string;
|
|
5804
|
+
b: string | number;
|
|
5805
|
+
c: () => void;
|
|
5806
|
+
d: {};
|
|
3832
5807
|
}
|
|
3833
5808
|
|
|
3834
|
-
|
|
5809
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
5810
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
5811
|
+
```
|
|
3835
5812
|
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
declare const deleteProject: MaybeContext<BuildRESTFunction<typeof deleteProject$1> & typeof deleteProject$1>;
|
|
3843
|
-
declare const queryProjects: MaybeContext<BuildRESTFunction<typeof queryProjects$1> & typeof queryProjects$1>;
|
|
3844
|
-
declare const updateProjectOrderInCollection$2: MaybeContext<BuildRESTFunction<typeof updateProjectOrderInCollection$3> & typeof updateProjectOrderInCollection$3>;
|
|
3845
|
-
declare const queryProjectsWithCollectionInfo: MaybeContext<BuildRESTFunction<typeof queryProjectsWithCollectionInfo$1> & typeof queryProjectsWithCollectionInfo$1>;
|
|
5813
|
+
@category Object
|
|
5814
|
+
*/
|
|
5815
|
+
type ConditionalExcept$1<Base, Condition> = Except$1<
|
|
5816
|
+
Base,
|
|
5817
|
+
ConditionalKeys$1<Base, Condition>
|
|
5818
|
+
>;
|
|
3846
5819
|
|
|
3847
|
-
type _publicOnProjectCreatedType = typeof onProjectCreated$1;
|
|
3848
5820
|
/**
|
|
3849
|
-
*
|
|
5821
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
5822
|
+
* can either be a REST module or a host module.
|
|
5823
|
+
* This type is recursive, so it can describe nested modules.
|
|
3850
5824
|
*/
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
/** */
|
|
3855
|
-
declare const onProjectUpdated: ReturnType<typeof createEventModule$1<_publicOnProjectUpdatedType>>;
|
|
3856
|
-
|
|
3857
|
-
type _publicOnProjectDeletedType = typeof onProjectDeleted$1;
|
|
5825
|
+
type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$1<any> | ServicePluginDefinition$1<any> | {
|
|
5826
|
+
[key: string]: Descriptors$1 | PublicMetadata$1 | any;
|
|
5827
|
+
};
|
|
3858
5828
|
/**
|
|
3859
|
-
*
|
|
5829
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
5830
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
5831
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
5832
|
+
* do not match the given host (as they will not work with the given host).
|
|
3860
5833
|
*/
|
|
3861
|
-
|
|
5834
|
+
type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
|
|
5835
|
+
done: T;
|
|
5836
|
+
recurse: T extends {
|
|
5837
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
|
|
5838
|
+
} ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
|
|
5839
|
+
[Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
|
|
5840
|
+
-1,
|
|
5841
|
+
0,
|
|
5842
|
+
1,
|
|
5843
|
+
2,
|
|
5844
|
+
3,
|
|
5845
|
+
4,
|
|
5846
|
+
5
|
|
5847
|
+
][Depth]> : never;
|
|
5848
|
+
}, EmptyObject$1>;
|
|
5849
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
5850
|
+
type PublicMetadata$1 = {
|
|
5851
|
+
PACKAGE_NAME?: string;
|
|
5852
|
+
};
|
|
3862
5853
|
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
type index_d$2_BulkUpdateProjectsOptions = BulkUpdateProjectsOptions;
|
|
3867
|
-
type index_d$2_BulkUpdateProjectsRequest = BulkUpdateProjectsRequest;
|
|
3868
|
-
type index_d$2_BulkUpdateProjectsResponse = BulkUpdateProjectsResponse;
|
|
3869
|
-
type index_d$2_BulkUpdateProjectsResponseNonNullableFields = BulkUpdateProjectsResponseNonNullableFields;
|
|
3870
|
-
type index_d$2_BulkUpdateProjectsResult = BulkUpdateProjectsResult;
|
|
3871
|
-
type index_d$2_CreateNewPortfolioAppRequest = CreateNewPortfolioAppRequest;
|
|
3872
|
-
type index_d$2_CreateNewPortfolioAppResponse = CreateNewPortfolioAppResponse;
|
|
3873
|
-
type index_d$2_CreateProjectRequest = CreateProjectRequest;
|
|
3874
|
-
type index_d$2_CreateProjectResponse = CreateProjectResponse;
|
|
3875
|
-
type index_d$2_CreateProjectResponseNonNullableFields = CreateProjectResponseNonNullableFields;
|
|
3876
|
-
type index_d$2_DeleteProjectRequest = DeleteProjectRequest;
|
|
3877
|
-
type index_d$2_DeleteProjectResponse = DeleteProjectResponse;
|
|
3878
|
-
type index_d$2_DeleteProjectResponseNonNullableFields = DeleteProjectResponseNonNullableFields;
|
|
3879
|
-
type index_d$2_DeletedProjectRestored = DeletedProjectRestored;
|
|
3880
|
-
type index_d$2_File = File;
|
|
3881
|
-
type index_d$2_GetProjectOptions = GetProjectOptions;
|
|
3882
|
-
type index_d$2_GetProjectPageDataIdentifiers = GetProjectPageDataIdentifiers;
|
|
3883
|
-
type index_d$2_GetProjectPageDataRequest = GetProjectPageDataRequest;
|
|
3884
|
-
type index_d$2_GetProjectPageDataResponse = GetProjectPageDataResponse;
|
|
3885
|
-
type index_d$2_GetProjectPageDataResponseNonNullableFields = GetProjectPageDataResponseNonNullableFields;
|
|
3886
|
-
type index_d$2_GetProjectRequest = GetProjectRequest;
|
|
3887
|
-
type index_d$2_GetProjectResponse = GetProjectResponse;
|
|
3888
|
-
type index_d$2_GetProjectResponseNonNullableFields = GetProjectResponseNonNullableFields;
|
|
3889
|
-
type index_d$2_InvalidateCache = InvalidateCache;
|
|
3890
|
-
type index_d$2_InvalidateCacheGetByOneOf = InvalidateCacheGetByOneOf;
|
|
3891
|
-
type index_d$2_ItemMetadata = ItemMetadata;
|
|
3892
|
-
type index_d$2_ListProjectsOptions = ListProjectsOptions;
|
|
3893
|
-
type index_d$2_ListProjectsRequest = ListProjectsRequest;
|
|
3894
|
-
type index_d$2_ListProjectsResponse = ListProjectsResponse;
|
|
3895
|
-
type index_d$2_ListProjectsResponseNonNullableFields = ListProjectsResponseNonNullableFields;
|
|
3896
|
-
type index_d$2_MaskedProject = MaskedProject;
|
|
3897
|
-
type index_d$2_MenuSettingUpdatedEvent = MenuSettingUpdatedEvent;
|
|
3898
|
-
type index_d$2_Page = Page;
|
|
3899
|
-
type index_d$2_ProjectCreatedEnvelope = ProjectCreatedEnvelope;
|
|
3900
|
-
type index_d$2_ProjectDeletedEnvelope = ProjectDeletedEnvelope;
|
|
3901
|
-
type index_d$2_ProjectSlug = ProjectSlug;
|
|
3902
|
-
type index_d$2_ProjectUpdatedEnvelope = ProjectUpdatedEnvelope;
|
|
3903
|
-
type index_d$2_ProjectsQueryBuilder = ProjectsQueryBuilder;
|
|
3904
|
-
type index_d$2_ProjectsQueryResult = ProjectsQueryResult;
|
|
3905
|
-
type index_d$2_QueryProjectWithCollectionInfoRequest = QueryProjectWithCollectionInfoRequest;
|
|
3906
|
-
type index_d$2_QueryProjectWithCollectionInfoResponse = QueryProjectWithCollectionInfoResponse;
|
|
3907
|
-
type index_d$2_QueryProjectWithCollectionInfoResponseNonNullableFields = QueryProjectWithCollectionInfoResponseNonNullableFields;
|
|
3908
|
-
type index_d$2_QueryProjectsOptions = QueryProjectsOptions;
|
|
3909
|
-
type index_d$2_QueryProjectsRequest = QueryProjectsRequest;
|
|
3910
|
-
type index_d$2_QueryProjectsResponse = QueryProjectsResponse;
|
|
3911
|
-
type index_d$2_QueryProjectsResponseNonNullableFields = QueryProjectsResponseNonNullableFields;
|
|
3912
|
-
type index_d$2_QueryProjectsWithCollectionInfoOptions = QueryProjectsWithCollectionInfoOptions;
|
|
3913
|
-
type index_d$2_RestoreProjectFromTrashBinRequest = RestoreProjectFromTrashBinRequest;
|
|
3914
|
-
type index_d$2_RestoreProjectFromTrashBinResponse = RestoreProjectFromTrashBinResponse;
|
|
3915
|
-
type index_d$2_SyncProjectWithCollectionMappings = SyncProjectWithCollectionMappings;
|
|
3916
|
-
type index_d$2_URI = URI;
|
|
3917
|
-
type index_d$2_UpdateProject = UpdateProject;
|
|
3918
|
-
type index_d$2_UpdateProjectRequest = UpdateProjectRequest;
|
|
3919
|
-
type index_d$2_UpdateProjectResponse = UpdateProjectResponse;
|
|
3920
|
-
type index_d$2_UpdateProjectResponseNonNullableFields = UpdateProjectResponseNonNullableFields;
|
|
3921
|
-
type index_d$2__publicOnProjectCreatedType = _publicOnProjectCreatedType;
|
|
3922
|
-
type index_d$2__publicOnProjectDeletedType = _publicOnProjectDeletedType;
|
|
3923
|
-
type index_d$2__publicOnProjectUpdatedType = _publicOnProjectUpdatedType;
|
|
3924
|
-
declare const index_d$2_bulkUpdateProjects: typeof bulkUpdateProjects;
|
|
3925
|
-
declare const index_d$2_createProject: typeof createProject;
|
|
3926
|
-
declare const index_d$2_deleteProject: typeof deleteProject;
|
|
3927
|
-
declare const index_d$2_getProject: typeof getProject;
|
|
3928
|
-
declare const index_d$2_getProjectPageData: typeof getProjectPageData;
|
|
3929
|
-
declare const index_d$2_listProjects: typeof listProjects;
|
|
3930
|
-
declare const index_d$2_onProjectCreated: typeof onProjectCreated;
|
|
3931
|
-
declare const index_d$2_onProjectDeleted: typeof onProjectDeleted;
|
|
3932
|
-
declare const index_d$2_onProjectUpdated: typeof onProjectUpdated;
|
|
3933
|
-
declare const index_d$2_queryProjects: typeof queryProjects;
|
|
3934
|
-
declare const index_d$2_queryProjectsWithCollectionInfo: typeof queryProjectsWithCollectionInfo;
|
|
3935
|
-
declare const index_d$2_updateProject: typeof updateProject;
|
|
3936
|
-
declare namespace index_d$2 {
|
|
3937
|
-
export { type ActionEvent$2 as ActionEvent, type index_d$2_App as App, type index_d$2_ApplicationError as ApplicationError, type Asset$1 as Asset, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$2_BulkActionMetadata as BulkActionMetadata, type index_d$2_BulkUpdateProjectsOptions as BulkUpdateProjectsOptions, type index_d$2_BulkUpdateProjectsRequest as BulkUpdateProjectsRequest, type index_d$2_BulkUpdateProjectsResponse as BulkUpdateProjectsResponse, type index_d$2_BulkUpdateProjectsResponseNonNullableFields as BulkUpdateProjectsResponseNonNullableFields, type index_d$2_BulkUpdateProjectsResult as BulkUpdateProjectsResult, type index_d$2_CreateNewPortfolioAppRequest as CreateNewPortfolioAppRequest, type index_d$2_CreateNewPortfolioAppResponse as CreateNewPortfolioAppResponse, type index_d$2_CreateProjectRequest as CreateProjectRequest, type index_d$2_CreateProjectResponse as CreateProjectResponse, type index_d$2_CreateProjectResponseNonNullableFields as CreateProjectResponseNonNullableFields, type CursorPaging$2 as CursorPaging, type Cursors$2 as Cursors, type DeleteContext$1 as DeleteContext, type index_d$2_DeleteProjectRequest as DeleteProjectRequest, type index_d$2_DeleteProjectResponse as DeleteProjectResponse, type index_d$2_DeleteProjectResponseNonNullableFields as DeleteProjectResponseNonNullableFields, DeleteStatus$1 as DeleteStatus, type index_d$2_DeletedProjectRestored as DeletedProjectRestored, type DetailsLink$1 as DetailsLink, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type index_d$2_File as File, type index_d$2_GetProjectOptions as GetProjectOptions, type index_d$2_GetProjectPageDataIdentifiers as GetProjectPageDataIdentifiers, type index_d$2_GetProjectPageDataRequest as GetProjectPageDataRequest, type index_d$2_GetProjectPageDataResponse as GetProjectPageDataResponse, type index_d$2_GetProjectPageDataResponseNonNullableFields as GetProjectPageDataResponseNonNullableFields, type index_d$2_GetProjectRequest as GetProjectRequest, type index_d$2_GetProjectResponse as GetProjectResponse, type index_d$2_GetProjectResponseNonNullableFields as GetProjectResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type Image$1 as Image, ImageType$1 as ImageType, type index_d$2_InvalidateCache as InvalidateCache, type index_d$2_InvalidateCacheGetByOneOf as InvalidateCacheGetByOneOf, type index_d$2_ItemMetadata as ItemMetadata, type Keyword$1 as Keyword, type index_d$2_ListProjectsOptions as ListProjectsOptions, type index_d$2_ListProjectsRequest as ListProjectsRequest, type index_d$2_ListProjectsResponse as ListProjectsResponse, type index_d$2_ListProjectsResponseNonNullableFields as ListProjectsResponseNonNullableFields, type index_d$2_MaskedProject as MaskedProject, type index_d$2_MenuSettingUpdatedEvent as MenuSettingUpdatedEvent, type MessageEnvelope$2 as MessageEnvelope, type MetaSiteSpecialEvent$1 as MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf$1 as MetaSiteSpecialEventPayloadOneOf, Namespace$1 as Namespace, type NamespaceChanged$1 as NamespaceChanged, type index_d$2_Page as Page, type Paging$1 as Paging, type PagingMetadataV2$2 as PagingMetadataV2, type Point$1 as Point, type Project$1 as Project, type ProjectCoverOneOf$1 as ProjectCoverOneOf, type index_d$2_ProjectCreatedEnvelope as ProjectCreatedEnvelope, type index_d$2_ProjectDeletedEnvelope as ProjectDeletedEnvelope, type ProjectDetail$1 as ProjectDetail, type ProjectDetailValueOneOf$1 as ProjectDetailValueOneOf, type ProjectInCollection$1 as ProjectInCollection, type ProjectNonNullableFields$1 as ProjectNonNullableFields, type index_d$2_ProjectSlug as ProjectSlug, type ProjectSource$1 as ProjectSource, type index_d$2_ProjectUpdatedEnvelope as ProjectUpdatedEnvelope, type index_d$2_ProjectsQueryBuilder as ProjectsQueryBuilder, type index_d$2_ProjectsQueryResult as ProjectsQueryResult, type index_d$2_QueryProjectWithCollectionInfoRequest as QueryProjectWithCollectionInfoRequest, type index_d$2_QueryProjectWithCollectionInfoResponse as QueryProjectWithCollectionInfoResponse, type index_d$2_QueryProjectWithCollectionInfoResponseNonNullableFields as QueryProjectWithCollectionInfoResponseNonNullableFields, type index_d$2_QueryProjectsOptions as QueryProjectsOptions, type index_d$2_QueryProjectsRequest as QueryProjectsRequest, type index_d$2_QueryProjectsResponse as QueryProjectsResponse, type index_d$2_QueryProjectsResponseNonNullableFields as QueryProjectsResponseNonNullableFields, type index_d$2_QueryProjectsWithCollectionInfoOptions as QueryProjectsWithCollectionInfoOptions, type QueryV2$1 as QueryV2, type QueryV2PagingMethodOneOf$1 as QueryV2PagingMethodOneOf, type RestoreInfo$2 as RestoreInfo, type index_d$2_RestoreProjectFromTrashBinRequest as RestoreProjectFromTrashBinRequest, type index_d$2_RestoreProjectFromTrashBinResponse as RestoreProjectFromTrashBinResponse, type SeoSchema$1 as SeoSchema, type ServiceProvisioned$1 as ServiceProvisioned, type ServiceRemoved$1 as ServiceRemoved, type Settings$1 as Settings, type SiteCreated$1 as SiteCreated, SiteCreatedContext$1 as SiteCreatedContext, type SiteDeleted$1 as SiteDeleted, type SiteHardDeleted$1 as SiteHardDeleted, type SiteMarkedAsTemplate$1 as SiteMarkedAsTemplate, type SiteMarkedAsWixSite$1 as SiteMarkedAsWixSite, type SitePublished$1 as SitePublished, type SiteRenamed$1 as SiteRenamed, type SiteTransferred$1 as SiteTransferred, type SiteUndeleted$1 as SiteUndeleted, type SiteUnpublished$1 as SiteUnpublished, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, State$1 as State, type StudioAssigned$1 as StudioAssigned, type StudioUnassigned$1 as StudioUnassigned, type index_d$2_SyncProjectWithCollectionMappings as SyncProjectWithCollectionMappings, SyncStatus$2 as SyncStatus, type Tag$1 as Tag, type index_d$2_URI as URI, type UnsharpMasking$1 as UnsharpMasking, type index_d$2_UpdateProject as UpdateProject, type UpdateProjectOrderInCollectionIdentifiers$1 as UpdateProjectOrderInCollectionIdentifiers, type UpdateProjectOrderInCollectionRequest$1 as UpdateProjectOrderInCollectionRequest, type UpdateProjectOrderInCollectionResponse$1 as UpdateProjectOrderInCollectionResponse, type UpdateProjectOrderInCollectionResponseNonNullableFields$1 as UpdateProjectOrderInCollectionResponseNonNullableFields, type index_d$2_UpdateProjectRequest as UpdateProjectRequest, type index_d$2_UpdateProjectResponse as UpdateProjectResponse, type index_d$2_UpdateProjectResponseNonNullableFields as UpdateProjectResponseNonNullableFields, type Video$1 as Video, type VideoResolution$1 as VideoResolution, WebhookIdentityType$2 as WebhookIdentityType, type index_d$2__publicOnProjectCreatedType as _publicOnProjectCreatedType, type index_d$2__publicOnProjectDeletedType as _publicOnProjectDeletedType, type index_d$2__publicOnProjectUpdatedType as _publicOnProjectUpdatedType, index_d$2_bulkUpdateProjects as bulkUpdateProjects, index_d$2_createProject as createProject, index_d$2_deleteProject as deleteProject, index_d$2_getProject as getProject, index_d$2_getProjectPageData as getProjectPageData, index_d$2_listProjects as listProjects, index_d$2_onProjectCreated as onProjectCreated, index_d$2_onProjectDeleted as onProjectDeleted, index_d$2_onProjectUpdated as onProjectUpdated, onProjectCreated$1 as publicOnProjectCreated, onProjectDeleted$1 as publicOnProjectDeleted, onProjectUpdated$1 as publicOnProjectUpdated, index_d$2_queryProjects as queryProjects, index_d$2_queryProjectsWithCollectionInfo as queryProjectsWithCollectionInfo, index_d$2_updateProject as updateProject, updateProjectOrderInCollection$2 as updateProjectOrderInCollection };
|
|
5854
|
+
declare global {
|
|
5855
|
+
interface ContextualClient {
|
|
5856
|
+
}
|
|
3938
5857
|
}
|
|
5858
|
+
/**
|
|
5859
|
+
* A type used to create concerete types from SDK descriptors in
|
|
5860
|
+
* case a contextual client is available.
|
|
5861
|
+
*/
|
|
5862
|
+
type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
|
|
5863
|
+
host: Host$1;
|
|
5864
|
+
} ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
|
|
3939
5865
|
|
|
3940
5866
|
interface ProjectInCollection {
|
|
3941
5867
|
/** Collection ID. */
|
|
@@ -4127,7 +6053,7 @@ interface Keyword {
|
|
|
4127
6053
|
term?: string;
|
|
4128
6054
|
/** Whether the keyword is the main focus keyword. */
|
|
4129
6055
|
isMain?: boolean;
|
|
4130
|
-
/**
|
|
6056
|
+
/** The source that added the keyword terms to the SEO settings. */
|
|
4131
6057
|
origin?: string | null;
|
|
4132
6058
|
}
|
|
4133
6059
|
interface Tag {
|
|
@@ -4565,120 +6491,580 @@ interface ProjectInCollectionsQueryBuilder {
|
|
|
4565
6491
|
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
4566
6492
|
* @documentationMaturity preview
|
|
4567
6493
|
*/
|
|
4568
|
-
descending: (...propertyNames: Array<'collectionId' | 'project.id' | 'project.slug' | 'sortOrder'>) => ProjectInCollectionsQueryBuilder;
|
|
4569
|
-
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
4570
|
-
* @documentationMaturity preview
|
|
6494
|
+
descending: (...propertyNames: Array<'collectionId' | 'project.id' | 'project.slug' | 'sortOrder'>) => ProjectInCollectionsQueryBuilder;
|
|
6495
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
6496
|
+
* @documentationMaturity preview
|
|
6497
|
+
*/
|
|
6498
|
+
limit: (limit: number) => ProjectInCollectionsQueryBuilder;
|
|
6499
|
+
/** @param cursor - A pointer to specific record
|
|
6500
|
+
* @documentationMaturity preview
|
|
6501
|
+
*/
|
|
6502
|
+
skipTo: (cursor: string) => ProjectInCollectionsQueryBuilder;
|
|
6503
|
+
/** @documentationMaturity preview */
|
|
6504
|
+
find: () => Promise<ProjectInCollectionsQueryResult>;
|
|
6505
|
+
}
|
|
6506
|
+
interface UpdateProjectOrderInCollectionIdentifiers {
|
|
6507
|
+
/** ID of the project to update. */
|
|
6508
|
+
projectId: string;
|
|
6509
|
+
/** Collection ID. */
|
|
6510
|
+
collectionId: string;
|
|
6511
|
+
}
|
|
6512
|
+
|
|
6513
|
+
declare function queryProjectInCollections$1(httpClient: HttpClient$1): QueryProjectInCollectionsSignature;
|
|
6514
|
+
interface QueryProjectInCollectionsSignature {
|
|
6515
|
+
/**
|
|
6516
|
+
* Retrieves a list of projects in the specified collections given the provided paging, filtering, and sorting. Up to 100 projects can be returned per request.
|
|
6517
|
+
*
|
|
6518
|
+
* The default `sort` is `project.id` in `ASC`.
|
|
6519
|
+
*
|
|
6520
|
+
* For additional field support for filters and sorting, see [Projects In Collections: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/portfolio/project-in-collection/sort-and-filter).
|
|
6521
|
+
*
|
|
6522
|
+
* To learn how to query projects in collections, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).
|
|
6523
|
+
*/
|
|
6524
|
+
(options?: QueryProjectInCollectionsOptions | undefined): ProjectInCollectionsQueryBuilder;
|
|
6525
|
+
}
|
|
6526
|
+
declare function updateProjectOrderInCollection$1(httpClient: HttpClient$1): UpdateProjectOrderInCollectionSignature;
|
|
6527
|
+
interface UpdateProjectOrderInCollectionSignature {
|
|
6528
|
+
/**
|
|
6529
|
+
* Updates the order of a project within the specified collection.
|
|
6530
|
+
* @param - Sort order of the project within the specified collection.
|
|
6531
|
+
*/
|
|
6532
|
+
(identifiers: UpdateProjectOrderInCollectionIdentifiers, sortOrder: number | null): Promise<UpdateProjectOrderInCollectionResponse & UpdateProjectOrderInCollectionResponseNonNullableFields>;
|
|
6533
|
+
}
|
|
6534
|
+
declare const onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1: EventDefinition$1<ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope, "wix.portfolio.projects.v1.project_in_collection_project_order_in_collection_updated_event">;
|
|
6535
|
+
|
|
6536
|
+
declare function createEventModule<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
6537
|
+
|
|
6538
|
+
declare const queryProjectInCollections: MaybeContext$1<BuildRESTFunction$1<typeof queryProjectInCollections$1> & typeof queryProjectInCollections$1>;
|
|
6539
|
+
declare const updateProjectOrderInCollection: MaybeContext$1<BuildRESTFunction$1<typeof updateProjectOrderInCollection$1> & typeof updateProjectOrderInCollection$1>;
|
|
6540
|
+
|
|
6541
|
+
type _publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType = typeof onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1;
|
|
6542
|
+
/** */
|
|
6543
|
+
declare const onProjectInCollectionProjectOrderInCollectionUpdatedEvent: ReturnType<typeof createEventModule<_publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType>>;
|
|
6544
|
+
|
|
6545
|
+
type index_d$1_BaseEventMetadata = BaseEventMetadata;
|
|
6546
|
+
type index_d$1_DetailsLink = DetailsLink;
|
|
6547
|
+
type index_d$1_EventMetadata = EventMetadata;
|
|
6548
|
+
type index_d$1_Image = Image;
|
|
6549
|
+
type index_d$1_ImageType = ImageType;
|
|
6550
|
+
declare const index_d$1_ImageType: typeof ImageType;
|
|
6551
|
+
type index_d$1_Keyword = Keyword;
|
|
6552
|
+
type index_d$1_Paging = Paging;
|
|
6553
|
+
type index_d$1_Point = Point;
|
|
6554
|
+
type index_d$1_Project = Project;
|
|
6555
|
+
type index_d$1_ProjectCoverOneOf = ProjectCoverOneOf;
|
|
6556
|
+
type index_d$1_ProjectDetail = ProjectDetail;
|
|
6557
|
+
type index_d$1_ProjectDetailValueOneOf = ProjectDetailValueOneOf;
|
|
6558
|
+
type index_d$1_ProjectInCollection = ProjectInCollection;
|
|
6559
|
+
type index_d$1_ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope = ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope;
|
|
6560
|
+
type index_d$1_ProjectInCollectionsQueryBuilder = ProjectInCollectionsQueryBuilder;
|
|
6561
|
+
type index_d$1_ProjectInCollectionsQueryResult = ProjectInCollectionsQueryResult;
|
|
6562
|
+
type index_d$1_ProjectOrderInCollectionUpdatedEvent = ProjectOrderInCollectionUpdatedEvent;
|
|
6563
|
+
type index_d$1_ProjectSource = ProjectSource;
|
|
6564
|
+
type index_d$1_QueryProjectInCollectionsOptions = QueryProjectInCollectionsOptions;
|
|
6565
|
+
type index_d$1_QueryProjectInCollectionsRequest = QueryProjectInCollectionsRequest;
|
|
6566
|
+
type index_d$1_QueryProjectInCollectionsResponse = QueryProjectInCollectionsResponse;
|
|
6567
|
+
type index_d$1_QueryProjectInCollectionsResponseNonNullableFields = QueryProjectInCollectionsResponseNonNullableFields;
|
|
6568
|
+
type index_d$1_QueryV2 = QueryV2;
|
|
6569
|
+
type index_d$1_QueryV2PagingMethodOneOf = QueryV2PagingMethodOneOf;
|
|
6570
|
+
type index_d$1_SeoSchema = SeoSchema;
|
|
6571
|
+
type index_d$1_Settings = Settings;
|
|
6572
|
+
type index_d$1_SortOrder = SortOrder;
|
|
6573
|
+
declare const index_d$1_SortOrder: typeof SortOrder;
|
|
6574
|
+
type index_d$1_Sorting = Sorting;
|
|
6575
|
+
type index_d$1_Tag = Tag;
|
|
6576
|
+
type index_d$1_UnsharpMasking = UnsharpMasking;
|
|
6577
|
+
type index_d$1_UpdateProjectOrderInCollectionIdentifiers = UpdateProjectOrderInCollectionIdentifiers;
|
|
6578
|
+
type index_d$1_UpdateProjectOrderInCollectionRequest = UpdateProjectOrderInCollectionRequest;
|
|
6579
|
+
type index_d$1_UpdateProjectOrderInCollectionResponse = UpdateProjectOrderInCollectionResponse;
|
|
6580
|
+
type index_d$1_UpdateProjectOrderInCollectionResponseNonNullableFields = UpdateProjectOrderInCollectionResponseNonNullableFields;
|
|
6581
|
+
type index_d$1_Video = Video;
|
|
6582
|
+
type index_d$1_VideoResolution = VideoResolution;
|
|
6583
|
+
type index_d$1__publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType = _publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType;
|
|
6584
|
+
declare const index_d$1_onProjectInCollectionProjectOrderInCollectionUpdatedEvent: typeof onProjectInCollectionProjectOrderInCollectionUpdatedEvent;
|
|
6585
|
+
declare const index_d$1_queryProjectInCollections: typeof queryProjectInCollections;
|
|
6586
|
+
declare const index_d$1_updateProjectOrderInCollection: typeof updateProjectOrderInCollection;
|
|
6587
|
+
declare namespace index_d$1 {
|
|
6588
|
+
export { type ActionEvent$1 as ActionEvent, type index_d$1_BaseEventMetadata as BaseEventMetadata, type CursorPaging$1 as CursorPaging, type Cursors$1 as Cursors, type index_d$1_DetailsLink as DetailsLink, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type index_d$1_EventMetadata as EventMetadata, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type index_d$1_Image as Image, index_d$1_ImageType as ImageType, type index_d$1_Keyword as Keyword, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_Paging as Paging, type PagingMetadataV2$1 as PagingMetadataV2, type index_d$1_Point as Point, type index_d$1_Project as Project, type index_d$1_ProjectCoverOneOf as ProjectCoverOneOf, type index_d$1_ProjectDetail as ProjectDetail, type index_d$1_ProjectDetailValueOneOf as ProjectDetailValueOneOf, type index_d$1_ProjectInCollection as ProjectInCollection, type index_d$1_ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope as ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope, type index_d$1_ProjectInCollectionsQueryBuilder as ProjectInCollectionsQueryBuilder, type index_d$1_ProjectInCollectionsQueryResult as ProjectInCollectionsQueryResult, type index_d$1_ProjectOrderInCollectionUpdatedEvent as ProjectOrderInCollectionUpdatedEvent, type index_d$1_ProjectSource as ProjectSource, type index_d$1_QueryProjectInCollectionsOptions as QueryProjectInCollectionsOptions, type index_d$1_QueryProjectInCollectionsRequest as QueryProjectInCollectionsRequest, type index_d$1_QueryProjectInCollectionsResponse as QueryProjectInCollectionsResponse, type index_d$1_QueryProjectInCollectionsResponseNonNullableFields as QueryProjectInCollectionsResponseNonNullableFields, type index_d$1_QueryV2 as QueryV2, type index_d$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type RestoreInfo$1 as RestoreInfo, type index_d$1_SeoSchema as SeoSchema, type index_d$1_Settings as Settings, index_d$1_SortOrder as SortOrder, type index_d$1_Sorting as Sorting, SyncStatus$1 as SyncStatus, type index_d$1_Tag as Tag, type index_d$1_UnsharpMasking as UnsharpMasking, type index_d$1_UpdateProjectOrderInCollectionIdentifiers as UpdateProjectOrderInCollectionIdentifiers, type index_d$1_UpdateProjectOrderInCollectionRequest as UpdateProjectOrderInCollectionRequest, type index_d$1_UpdateProjectOrderInCollectionResponse as UpdateProjectOrderInCollectionResponse, type index_d$1_UpdateProjectOrderInCollectionResponseNonNullableFields as UpdateProjectOrderInCollectionResponseNonNullableFields, type index_d$1_Video as Video, type index_d$1_VideoResolution as VideoResolution, WebhookIdentityType$1 as WebhookIdentityType, type index_d$1__publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType as _publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType, index_d$1_onProjectInCollectionProjectOrderInCollectionUpdatedEvent as onProjectInCollectionProjectOrderInCollectionUpdatedEvent, onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1 as publicOnProjectInCollectionProjectOrderInCollectionUpdatedEvent, index_d$1_queryProjectInCollections as queryProjectInCollections, index_d$1_updateProjectOrderInCollection as updateProjectOrderInCollection };
|
|
6589
|
+
}
|
|
6590
|
+
|
|
6591
|
+
type HostModule<T, H extends Host> = {
|
|
6592
|
+
__type: 'host';
|
|
6593
|
+
create(host: H): T;
|
|
6594
|
+
};
|
|
6595
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6596
|
+
type Host<Environment = unknown> = {
|
|
6597
|
+
channel: {
|
|
6598
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
6599
|
+
disconnect: () => void;
|
|
6600
|
+
} | Promise<{
|
|
6601
|
+
disconnect: () => void;
|
|
6602
|
+
}>;
|
|
6603
|
+
};
|
|
6604
|
+
environment?: Environment;
|
|
6605
|
+
/**
|
|
6606
|
+
* Optional name of the environment, use for logging
|
|
6607
|
+
*/
|
|
6608
|
+
name?: string;
|
|
6609
|
+
/**
|
|
6610
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
4571
6611
|
*/
|
|
4572
|
-
|
|
4573
|
-
/**
|
|
4574
|
-
*
|
|
6612
|
+
apiBaseUrl?: string;
|
|
6613
|
+
/**
|
|
6614
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
6615
|
+
* like internationalization, billing, etc.
|
|
4575
6616
|
*/
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
6617
|
+
essentials?: {
|
|
6618
|
+
/**
|
|
6619
|
+
* The language of the currently viewed session
|
|
6620
|
+
*/
|
|
6621
|
+
language?: string;
|
|
6622
|
+
/**
|
|
6623
|
+
* The locale of the currently viewed session
|
|
6624
|
+
*/
|
|
6625
|
+
locale?: string;
|
|
6626
|
+
/**
|
|
6627
|
+
* Any headers that should be passed through to the API requests
|
|
6628
|
+
*/
|
|
6629
|
+
passThroughHeaders?: Record<string, string>;
|
|
6630
|
+
};
|
|
6631
|
+
};
|
|
6632
|
+
|
|
6633
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
6634
|
+
interface HttpClient {
|
|
6635
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
6636
|
+
fetchWithAuth: typeof fetch;
|
|
6637
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6638
|
+
getActiveToken?: () => string | undefined;
|
|
4579
6639
|
}
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
6640
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
6641
|
+
type HttpResponse<T = any> = {
|
|
6642
|
+
data: T;
|
|
6643
|
+
status: number;
|
|
6644
|
+
statusText: string;
|
|
6645
|
+
headers: any;
|
|
6646
|
+
request?: any;
|
|
6647
|
+
};
|
|
6648
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
6649
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
6650
|
+
url: string;
|
|
6651
|
+
data?: Data;
|
|
6652
|
+
params?: URLSearchParams;
|
|
6653
|
+
} & APIMetadata;
|
|
6654
|
+
type APIMetadata = {
|
|
6655
|
+
methodFqn?: string;
|
|
6656
|
+
entityFqdn?: string;
|
|
6657
|
+
packageName?: string;
|
|
6658
|
+
};
|
|
6659
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
6660
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
6661
|
+
__type: 'event-definition';
|
|
6662
|
+
type: Type;
|
|
6663
|
+
isDomainEvent?: boolean;
|
|
6664
|
+
transformations?: (envelope: unknown) => Payload;
|
|
6665
|
+
__payload: Payload;
|
|
6666
|
+
};
|
|
6667
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
6668
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
6669
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
6670
|
+
|
|
6671
|
+
type ServicePluginMethodInput = {
|
|
6672
|
+
request: any;
|
|
6673
|
+
metadata: any;
|
|
6674
|
+
};
|
|
6675
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
6676
|
+
type ServicePluginMethodMetadata = {
|
|
6677
|
+
name: string;
|
|
6678
|
+
primaryHttpMappingPath: string;
|
|
6679
|
+
transformations: {
|
|
6680
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
6681
|
+
toREST: (...args: unknown[]) => unknown;
|
|
6682
|
+
};
|
|
6683
|
+
};
|
|
6684
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
6685
|
+
__type: 'service-plugin-definition';
|
|
6686
|
+
componentType: string;
|
|
6687
|
+
methods: ServicePluginMethodMetadata[];
|
|
6688
|
+
__contract: Contract;
|
|
6689
|
+
};
|
|
6690
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
6691
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
6692
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
6693
|
+
|
|
6694
|
+
type RequestContext = {
|
|
6695
|
+
isSSR: boolean;
|
|
6696
|
+
host: string;
|
|
6697
|
+
protocol?: string;
|
|
6698
|
+
};
|
|
6699
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
6700
|
+
/**
|
|
6701
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
6702
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
6703
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
6704
|
+
*/
|
|
6705
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
6706
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
6707
|
+
_?: T;
|
|
6708
|
+
url?: string;
|
|
6709
|
+
method?: Method;
|
|
6710
|
+
params?: any;
|
|
6711
|
+
data?: any;
|
|
6712
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
6713
|
+
};
|
|
6714
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
6715
|
+
__isAmbassador: boolean;
|
|
6716
|
+
};
|
|
6717
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
6718
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
6719
|
+
|
|
6720
|
+
declare global {
|
|
6721
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6722
|
+
interface SymbolConstructor {
|
|
6723
|
+
readonly observable: symbol;
|
|
6724
|
+
}
|
|
6725
|
+
}
|
|
6726
|
+
|
|
6727
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
6728
|
+
|
|
6729
|
+
/**
|
|
6730
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
6731
|
+
|
|
6732
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
6733
|
+
|
|
6734
|
+
@example
|
|
6735
|
+
```
|
|
6736
|
+
import type {EmptyObject} from 'type-fest';
|
|
6737
|
+
|
|
6738
|
+
// The following illustrates the problem with `{}`.
|
|
6739
|
+
const foo1: {} = {}; // Pass
|
|
6740
|
+
const foo2: {} = []; // Pass
|
|
6741
|
+
const foo3: {} = 42; // Pass
|
|
6742
|
+
const foo4: {} = {a: 1}; // Pass
|
|
6743
|
+
|
|
6744
|
+
// With `EmptyObject` only the first case is valid.
|
|
6745
|
+
const bar1: EmptyObject = {}; // Pass
|
|
6746
|
+
const bar2: EmptyObject = 42; // Fail
|
|
6747
|
+
const bar3: EmptyObject = []; // Fail
|
|
6748
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
6749
|
+
```
|
|
6750
|
+
|
|
6751
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
6752
|
+
|
|
6753
|
+
@category Object
|
|
6754
|
+
*/
|
|
6755
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
6756
|
+
|
|
6757
|
+
/**
|
|
6758
|
+
Returns a boolean for whether the two given types are equal.
|
|
6759
|
+
|
|
6760
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
6761
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
6762
|
+
|
|
6763
|
+
Use-cases:
|
|
6764
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
6765
|
+
|
|
6766
|
+
@example
|
|
6767
|
+
```
|
|
6768
|
+
import type {IsEqual} from 'type-fest';
|
|
6769
|
+
|
|
6770
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
6771
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
6772
|
+
type Includes<Value extends readonly any[], Item> =
|
|
6773
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
6774
|
+
? IsEqual<Value[0], Item> extends true
|
|
6775
|
+
? true
|
|
6776
|
+
: Includes<rest, Item>
|
|
6777
|
+
: false;
|
|
6778
|
+
```
|
|
6779
|
+
|
|
6780
|
+
@category Type Guard
|
|
6781
|
+
@category Utilities
|
|
6782
|
+
*/
|
|
6783
|
+
type IsEqual<A, B> =
|
|
6784
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
6785
|
+
(<G>() => G extends B ? 1 : 2)
|
|
6786
|
+
? true
|
|
6787
|
+
: false;
|
|
6788
|
+
|
|
6789
|
+
/**
|
|
6790
|
+
Filter out keys from an object.
|
|
6791
|
+
|
|
6792
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
6793
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
6794
|
+
Returns `Key` otherwise.
|
|
6795
|
+
|
|
6796
|
+
@example
|
|
6797
|
+
```
|
|
6798
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
6799
|
+
//=> never
|
|
6800
|
+
```
|
|
6801
|
+
|
|
6802
|
+
@example
|
|
6803
|
+
```
|
|
6804
|
+
type Filtered = Filter<'bar', string>;
|
|
6805
|
+
//=> never
|
|
6806
|
+
```
|
|
6807
|
+
|
|
6808
|
+
@example
|
|
6809
|
+
```
|
|
6810
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
6811
|
+
//=> 'bar'
|
|
6812
|
+
```
|
|
6813
|
+
|
|
6814
|
+
@see {Except}
|
|
6815
|
+
*/
|
|
6816
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
6817
|
+
|
|
6818
|
+
type ExceptOptions = {
|
|
6819
|
+
/**
|
|
6820
|
+
Disallow assigning non-specified properties.
|
|
6821
|
+
|
|
6822
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
6823
|
+
|
|
6824
|
+
@default false
|
|
6825
|
+
*/
|
|
6826
|
+
requireExactProps?: boolean;
|
|
6827
|
+
};
|
|
6828
|
+
|
|
6829
|
+
/**
|
|
6830
|
+
Create a type from an object type without certain keys.
|
|
6831
|
+
|
|
6832
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
6833
|
+
|
|
6834
|
+
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
6835
|
+
|
|
6836
|
+
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
6837
|
+
|
|
6838
|
+
@example
|
|
6839
|
+
```
|
|
6840
|
+
import type {Except} from 'type-fest';
|
|
6841
|
+
|
|
6842
|
+
type Foo = {
|
|
6843
|
+
a: number;
|
|
6844
|
+
b: string;
|
|
6845
|
+
};
|
|
6846
|
+
|
|
6847
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
6848
|
+
//=> {b: string}
|
|
6849
|
+
|
|
6850
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
6851
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
6852
|
+
|
|
6853
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
6854
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
6855
|
+
|
|
6856
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
6857
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
6858
|
+
```
|
|
6859
|
+
|
|
6860
|
+
@category Object
|
|
6861
|
+
*/
|
|
6862
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
6863
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
6864
|
+
} & (Options['requireExactProps'] extends true
|
|
6865
|
+
? Partial<Record<KeysType, never>>
|
|
6866
|
+
: {});
|
|
6867
|
+
|
|
6868
|
+
/**
|
|
6869
|
+
Returns a boolean for whether the given type is `never`.
|
|
6870
|
+
|
|
6871
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
6872
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
6873
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
6874
|
+
|
|
6875
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
6876
|
+
|
|
6877
|
+
@example
|
|
6878
|
+
```
|
|
6879
|
+
import type {IsNever, And} from 'type-fest';
|
|
6880
|
+
|
|
6881
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
6882
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
6883
|
+
And<
|
|
6884
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
6885
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
6886
|
+
>;
|
|
6887
|
+
|
|
6888
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
6889
|
+
AreStringsEqual<I, O> extends true
|
|
6890
|
+
? never
|
|
6891
|
+
: void;
|
|
6892
|
+
|
|
6893
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
6894
|
+
if (input === output) {
|
|
6895
|
+
process.exit(0);
|
|
6896
|
+
}
|
|
4585
6897
|
}
|
|
4586
6898
|
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
6899
|
+
endIfEqual('abc', 'abc');
|
|
6900
|
+
//=> never
|
|
6901
|
+
|
|
6902
|
+
endIfEqual('abc', '123');
|
|
6903
|
+
//=> void
|
|
6904
|
+
```
|
|
6905
|
+
|
|
6906
|
+
@category Type Guard
|
|
6907
|
+
@category Utilities
|
|
6908
|
+
*/
|
|
6909
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
6910
|
+
|
|
6911
|
+
/**
|
|
6912
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
6913
|
+
|
|
6914
|
+
@see {@link IsNever}
|
|
6915
|
+
|
|
6916
|
+
@example
|
|
6917
|
+
```
|
|
6918
|
+
import type {IfNever} from 'type-fest';
|
|
6919
|
+
|
|
6920
|
+
type ShouldBeTrue = IfNever<never>;
|
|
6921
|
+
//=> true
|
|
6922
|
+
|
|
6923
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
6924
|
+
//=> 'bar'
|
|
6925
|
+
```
|
|
6926
|
+
|
|
6927
|
+
@category Type Guard
|
|
6928
|
+
@category Utilities
|
|
6929
|
+
*/
|
|
6930
|
+
type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
6931
|
+
IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
6932
|
+
);
|
|
6933
|
+
|
|
6934
|
+
/**
|
|
6935
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
6936
|
+
|
|
6937
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
6938
|
+
|
|
6939
|
+
@example
|
|
6940
|
+
```
|
|
6941
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
6942
|
+
|
|
6943
|
+
interface Example {
|
|
6944
|
+
a: string;
|
|
6945
|
+
b: string | number;
|
|
6946
|
+
c?: string;
|
|
6947
|
+
d: {};
|
|
4599
6948
|
}
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
6949
|
+
|
|
6950
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
6951
|
+
//=> 'a'
|
|
6952
|
+
```
|
|
6953
|
+
|
|
6954
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
6955
|
+
|
|
6956
|
+
@example
|
|
6957
|
+
```
|
|
6958
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
6959
|
+
|
|
6960
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
6961
|
+
//=> 'a' | 'c'
|
|
6962
|
+
```
|
|
6963
|
+
|
|
6964
|
+
@category Object
|
|
6965
|
+
*/
|
|
6966
|
+
type ConditionalKeys<Base, Condition> =
|
|
6967
|
+
{
|
|
6968
|
+
// Map through all the keys of the given base type.
|
|
6969
|
+
[Key in keyof Base]-?:
|
|
6970
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
6971
|
+
Base[Key] extends Condition
|
|
6972
|
+
// Retain this key
|
|
6973
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
6974
|
+
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
|
|
6975
|
+
// Discard this key since the condition fails.
|
|
6976
|
+
: never;
|
|
6977
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
6978
|
+
}[keyof Base];
|
|
6979
|
+
|
|
6980
|
+
/**
|
|
6981
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
6982
|
+
|
|
6983
|
+
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
6984
|
+
|
|
6985
|
+
@example
|
|
6986
|
+
```
|
|
6987
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
6988
|
+
|
|
6989
|
+
class Awesome {
|
|
6990
|
+
name: string;
|
|
6991
|
+
successes: number;
|
|
6992
|
+
failures: bigint;
|
|
6993
|
+
|
|
6994
|
+
run() {}
|
|
4607
6995
|
}
|
|
4608
|
-
declare const onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1: EventDefinition$4<ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope, "wix.portfolio.projects.v1.project_in_collection_project_order_in_collection_updated_event">;
|
|
4609
6996
|
|
|
4610
|
-
type
|
|
4611
|
-
|
|
4612
|
-
|
|
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;
|
|
6997
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
6998
|
+
//=> {run: () => void}
|
|
6999
|
+
```
|
|
4620
7000
|
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
7001
|
+
@example
|
|
7002
|
+
```
|
|
7003
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
7004
|
+
|
|
7005
|
+
interface Example {
|
|
7006
|
+
a: string;
|
|
7007
|
+
b: string | number;
|
|
7008
|
+
c: () => void;
|
|
7009
|
+
d: {};
|
|
4626
7010
|
}
|
|
4627
7011
|
|
|
4628
|
-
|
|
7012
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
7013
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
7014
|
+
```
|
|
4629
7015
|
|
|
4630
|
-
|
|
4631
|
-
|
|
7016
|
+
@category Object
|
|
7017
|
+
*/
|
|
7018
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
7019
|
+
Base,
|
|
7020
|
+
ConditionalKeys<Base, Condition>
|
|
7021
|
+
>;
|
|
4632
7022
|
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
7023
|
+
/**
|
|
7024
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
7025
|
+
* can either be a REST module or a host module.
|
|
7026
|
+
* This type is recursive, so it can describe nested modules.
|
|
7027
|
+
*/
|
|
7028
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
7029
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
7030
|
+
};
|
|
7031
|
+
/**
|
|
7032
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
7033
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
7034
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
7035
|
+
* do not match the given host (as they will not work with the given host).
|
|
7036
|
+
*/
|
|
7037
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
7038
|
+
done: T;
|
|
7039
|
+
recurse: T extends {
|
|
7040
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
7041
|
+
} ? 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<{
|
|
7042
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
7043
|
+
-1,
|
|
7044
|
+
0,
|
|
7045
|
+
1,
|
|
7046
|
+
2,
|
|
7047
|
+
3,
|
|
7048
|
+
4,
|
|
7049
|
+
5
|
|
7050
|
+
][Depth]> : never;
|
|
7051
|
+
}, EmptyObject>;
|
|
7052
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
7053
|
+
type PublicMetadata = {
|
|
7054
|
+
PACKAGE_NAME?: string;
|
|
7055
|
+
};
|
|
4636
7056
|
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
type index_d$1_Image = Image;
|
|
4641
|
-
type index_d$1_ImageType = ImageType;
|
|
4642
|
-
declare const index_d$1_ImageType: typeof ImageType;
|
|
4643
|
-
type index_d$1_Keyword = Keyword;
|
|
4644
|
-
type index_d$1_Paging = Paging;
|
|
4645
|
-
type index_d$1_Point = Point;
|
|
4646
|
-
type index_d$1_Project = Project;
|
|
4647
|
-
type index_d$1_ProjectCoverOneOf = ProjectCoverOneOf;
|
|
4648
|
-
type index_d$1_ProjectDetail = ProjectDetail;
|
|
4649
|
-
type index_d$1_ProjectDetailValueOneOf = ProjectDetailValueOneOf;
|
|
4650
|
-
type index_d$1_ProjectInCollection = ProjectInCollection;
|
|
4651
|
-
type index_d$1_ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope = ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope;
|
|
4652
|
-
type index_d$1_ProjectInCollectionsQueryBuilder = ProjectInCollectionsQueryBuilder;
|
|
4653
|
-
type index_d$1_ProjectInCollectionsQueryResult = ProjectInCollectionsQueryResult;
|
|
4654
|
-
type index_d$1_ProjectOrderInCollectionUpdatedEvent = ProjectOrderInCollectionUpdatedEvent;
|
|
4655
|
-
type index_d$1_ProjectSource = ProjectSource;
|
|
4656
|
-
type index_d$1_QueryProjectInCollectionsOptions = QueryProjectInCollectionsOptions;
|
|
4657
|
-
type index_d$1_QueryProjectInCollectionsRequest = QueryProjectInCollectionsRequest;
|
|
4658
|
-
type index_d$1_QueryProjectInCollectionsResponse = QueryProjectInCollectionsResponse;
|
|
4659
|
-
type index_d$1_QueryProjectInCollectionsResponseNonNullableFields = QueryProjectInCollectionsResponseNonNullableFields;
|
|
4660
|
-
type index_d$1_QueryV2 = QueryV2;
|
|
4661
|
-
type index_d$1_QueryV2PagingMethodOneOf = QueryV2PagingMethodOneOf;
|
|
4662
|
-
type index_d$1_SeoSchema = SeoSchema;
|
|
4663
|
-
type index_d$1_Settings = Settings;
|
|
4664
|
-
type index_d$1_SortOrder = SortOrder;
|
|
4665
|
-
declare const index_d$1_SortOrder: typeof SortOrder;
|
|
4666
|
-
type index_d$1_Sorting = Sorting;
|
|
4667
|
-
type index_d$1_Tag = Tag;
|
|
4668
|
-
type index_d$1_UnsharpMasking = UnsharpMasking;
|
|
4669
|
-
type index_d$1_UpdateProjectOrderInCollectionIdentifiers = UpdateProjectOrderInCollectionIdentifiers;
|
|
4670
|
-
type index_d$1_UpdateProjectOrderInCollectionRequest = UpdateProjectOrderInCollectionRequest;
|
|
4671
|
-
type index_d$1_UpdateProjectOrderInCollectionResponse = UpdateProjectOrderInCollectionResponse;
|
|
4672
|
-
type index_d$1_UpdateProjectOrderInCollectionResponseNonNullableFields = UpdateProjectOrderInCollectionResponseNonNullableFields;
|
|
4673
|
-
type index_d$1_Video = Video;
|
|
4674
|
-
type index_d$1_VideoResolution = VideoResolution;
|
|
4675
|
-
type index_d$1__publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType = _publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType;
|
|
4676
|
-
declare const index_d$1_onProjectInCollectionProjectOrderInCollectionUpdatedEvent: typeof onProjectInCollectionProjectOrderInCollectionUpdatedEvent;
|
|
4677
|
-
declare const index_d$1_queryProjectInCollections: typeof queryProjectInCollections;
|
|
4678
|
-
declare const index_d$1_updateProjectOrderInCollection: typeof updateProjectOrderInCollection;
|
|
4679
|
-
declare namespace index_d$1 {
|
|
4680
|
-
export { type ActionEvent$1 as ActionEvent, type index_d$1_BaseEventMetadata as BaseEventMetadata, type CursorPaging$1 as CursorPaging, type Cursors$1 as Cursors, type index_d$1_DetailsLink as DetailsLink, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type index_d$1_EventMetadata as EventMetadata, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type index_d$1_Image as Image, index_d$1_ImageType as ImageType, type index_d$1_Keyword as Keyword, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_Paging as Paging, type PagingMetadataV2$1 as PagingMetadataV2, type index_d$1_Point as Point, type index_d$1_Project as Project, type index_d$1_ProjectCoverOneOf as ProjectCoverOneOf, type index_d$1_ProjectDetail as ProjectDetail, type index_d$1_ProjectDetailValueOneOf as ProjectDetailValueOneOf, type index_d$1_ProjectInCollection as ProjectInCollection, type index_d$1_ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope as ProjectInCollectionProjectOrderInCollectionUpdatedEnvelope, type index_d$1_ProjectInCollectionsQueryBuilder as ProjectInCollectionsQueryBuilder, type index_d$1_ProjectInCollectionsQueryResult as ProjectInCollectionsQueryResult, type index_d$1_ProjectOrderInCollectionUpdatedEvent as ProjectOrderInCollectionUpdatedEvent, type index_d$1_ProjectSource as ProjectSource, type index_d$1_QueryProjectInCollectionsOptions as QueryProjectInCollectionsOptions, type index_d$1_QueryProjectInCollectionsRequest as QueryProjectInCollectionsRequest, type index_d$1_QueryProjectInCollectionsResponse as QueryProjectInCollectionsResponse, type index_d$1_QueryProjectInCollectionsResponseNonNullableFields as QueryProjectInCollectionsResponseNonNullableFields, type index_d$1_QueryV2 as QueryV2, type index_d$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type RestoreInfo$1 as RestoreInfo, type index_d$1_SeoSchema as SeoSchema, type index_d$1_Settings as Settings, index_d$1_SortOrder as SortOrder, type index_d$1_Sorting as Sorting, SyncStatus$1 as SyncStatus, type index_d$1_Tag as Tag, type index_d$1_UnsharpMasking as UnsharpMasking, type index_d$1_UpdateProjectOrderInCollectionIdentifiers as UpdateProjectOrderInCollectionIdentifiers, type index_d$1_UpdateProjectOrderInCollectionRequest as UpdateProjectOrderInCollectionRequest, type index_d$1_UpdateProjectOrderInCollectionResponse as UpdateProjectOrderInCollectionResponse, type index_d$1_UpdateProjectOrderInCollectionResponseNonNullableFields as UpdateProjectOrderInCollectionResponseNonNullableFields, type index_d$1_Video as Video, type index_d$1_VideoResolution as VideoResolution, WebhookIdentityType$1 as WebhookIdentityType, type index_d$1__publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType as _publicOnProjectInCollectionProjectOrderInCollectionUpdatedEventType, index_d$1_onProjectInCollectionProjectOrderInCollectionUpdatedEvent as onProjectInCollectionProjectOrderInCollectionUpdatedEvent, onProjectInCollectionProjectOrderInCollectionUpdatedEvent$1 as publicOnProjectInCollectionProjectOrderInCollectionUpdatedEvent, index_d$1_queryProjectInCollections as queryProjectInCollections, index_d$1_updateProjectOrderInCollection as updateProjectOrderInCollection };
|
|
7057
|
+
declare global {
|
|
7058
|
+
interface ContextualClient {
|
|
7059
|
+
}
|
|
4681
7060
|
}
|
|
7061
|
+
/**
|
|
7062
|
+
* A type used to create concerete types from SDK descriptors in
|
|
7063
|
+
* case a contextual client is available.
|
|
7064
|
+
*/
|
|
7065
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
7066
|
+
host: Host;
|
|
7067
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
4682
7068
|
|
|
4683
7069
|
interface SyncedProject {
|
|
4684
7070
|
/** Project ID in Portfolio - if project was yet to be create, will be None */
|