@wix/media 1.0.125 → 1.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context.js +1 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/meta.js +1 -0
- package/build/cjs/meta.js.map +1 -0
- package/package.json +6 -6
- package/type-bundles/context.bundle.d.ts +565 -263
- package/type-bundles/index.bundle.d.ts +565 -263
- package/type-bundles/meta.bundle.d.ts +24 -24
|
@@ -1,39 +1,131 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type HostModule<T, H extends Host> = {
|
|
2
|
+
__type: 'host';
|
|
3
|
+
create(host: H): T;
|
|
4
|
+
};
|
|
5
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
+
type Host<Environment = unknown> = {
|
|
7
|
+
channel: {
|
|
8
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
|
+
disconnect: () => void;
|
|
10
|
+
} | Promise<{
|
|
11
|
+
disconnect: () => void;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
environment?: Environment;
|
|
15
|
+
/**
|
|
16
|
+
* Optional name of the environment, use for logging
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
21
|
+
*/
|
|
22
|
+
apiBaseUrl?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
25
|
+
* like internationalization, billing, etc.
|
|
26
|
+
*/
|
|
27
|
+
essentials?: {
|
|
28
|
+
/**
|
|
29
|
+
* The language of the currently viewed session
|
|
30
|
+
*/
|
|
31
|
+
language?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The locale of the currently viewed session
|
|
34
|
+
*/
|
|
35
|
+
locale?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Any headers that should be passed through to the API requests
|
|
38
|
+
*/
|
|
39
|
+
passThroughHeaders?: Record<string, string>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
44
|
+
interface HttpClient {
|
|
45
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
46
|
fetchWithAuth: typeof fetch;
|
|
5
47
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
48
|
+
getActiveToken?: () => string | undefined;
|
|
6
49
|
}
|
|
7
|
-
type RequestOptionsFactory
|
|
8
|
-
type HttpResponse
|
|
50
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
51
|
+
type HttpResponse<T = any> = {
|
|
9
52
|
data: T;
|
|
10
53
|
status: number;
|
|
11
54
|
statusText: string;
|
|
12
55
|
headers: any;
|
|
13
56
|
request?: any;
|
|
14
57
|
};
|
|
15
|
-
type RequestOptions
|
|
58
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
16
59
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
60
|
url: string;
|
|
18
61
|
data?: Data;
|
|
19
62
|
params?: URLSearchParams;
|
|
20
|
-
} & APIMetadata
|
|
21
|
-
type APIMetadata
|
|
63
|
+
} & APIMetadata;
|
|
64
|
+
type APIMetadata = {
|
|
22
65
|
methodFqn?: string;
|
|
23
66
|
entityFqdn?: string;
|
|
24
67
|
packageName?: string;
|
|
25
68
|
};
|
|
26
|
-
type BuildRESTFunction
|
|
27
|
-
type EventDefinition
|
|
69
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
70
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
71
|
__type: 'event-definition';
|
|
29
72
|
type: Type;
|
|
30
73
|
isDomainEvent?: boolean;
|
|
31
74
|
transformations?: (envelope: unknown) => Payload;
|
|
32
75
|
__payload: Payload;
|
|
33
76
|
};
|
|
34
|
-
declare function EventDefinition
|
|
35
|
-
type EventHandler
|
|
36
|
-
type BuildEventDefinition
|
|
77
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
78
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
79
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
80
|
+
|
|
81
|
+
type ServicePluginMethodInput = {
|
|
82
|
+
request: any;
|
|
83
|
+
metadata: any;
|
|
84
|
+
};
|
|
85
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
86
|
+
type ServicePluginMethodMetadata = {
|
|
87
|
+
name: string;
|
|
88
|
+
primaryHttpMappingPath: string;
|
|
89
|
+
transformations: {
|
|
90
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
91
|
+
toREST: (...args: unknown[]) => unknown;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
95
|
+
__type: 'service-plugin-definition';
|
|
96
|
+
componentType: string;
|
|
97
|
+
methods: ServicePluginMethodMetadata[];
|
|
98
|
+
__contract: Contract;
|
|
99
|
+
};
|
|
100
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
101
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
102
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
103
|
+
|
|
104
|
+
type RequestContext = {
|
|
105
|
+
isSSR: boolean;
|
|
106
|
+
host: string;
|
|
107
|
+
protocol?: string;
|
|
108
|
+
};
|
|
109
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
110
|
+
/**
|
|
111
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
112
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
113
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
114
|
+
*/
|
|
115
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
116
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
117
|
+
_?: T;
|
|
118
|
+
url?: string;
|
|
119
|
+
method?: Method;
|
|
120
|
+
params?: any;
|
|
121
|
+
data?: any;
|
|
122
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
123
|
+
};
|
|
124
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
125
|
+
__isAmbassador: boolean;
|
|
126
|
+
};
|
|
127
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
128
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
37
129
|
|
|
38
130
|
declare global {
|
|
39
131
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -42,6 +134,348 @@ declare global {
|
|
|
42
134
|
}
|
|
43
135
|
}
|
|
44
136
|
|
|
137
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
141
|
+
|
|
142
|
+
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)).
|
|
143
|
+
|
|
144
|
+
@example
|
|
145
|
+
```
|
|
146
|
+
import type {EmptyObject} from 'type-fest';
|
|
147
|
+
|
|
148
|
+
// The following illustrates the problem with `{}`.
|
|
149
|
+
const foo1: {} = {}; // Pass
|
|
150
|
+
const foo2: {} = []; // Pass
|
|
151
|
+
const foo3: {} = 42; // Pass
|
|
152
|
+
const foo4: {} = {a: 1}; // Pass
|
|
153
|
+
|
|
154
|
+
// With `EmptyObject` only the first case is valid.
|
|
155
|
+
const bar1: EmptyObject = {}; // Pass
|
|
156
|
+
const bar2: EmptyObject = 42; // Fail
|
|
157
|
+
const bar3: EmptyObject = []; // Fail
|
|
158
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
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}.
|
|
162
|
+
|
|
163
|
+
@category Object
|
|
164
|
+
*/
|
|
165
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
Returns a boolean for whether the two given types are equal.
|
|
169
|
+
|
|
170
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
171
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
172
|
+
|
|
173
|
+
Use-cases:
|
|
174
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
175
|
+
|
|
176
|
+
@example
|
|
177
|
+
```
|
|
178
|
+
import type {IsEqual} from 'type-fest';
|
|
179
|
+
|
|
180
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
181
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
182
|
+
type Includes<Value extends readonly any[], Item> =
|
|
183
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
184
|
+
? IsEqual<Value[0], Item> extends true
|
|
185
|
+
? true
|
|
186
|
+
: Includes<rest, Item>
|
|
187
|
+
: false;
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
@category Type Guard
|
|
191
|
+
@category Utilities
|
|
192
|
+
*/
|
|
193
|
+
type IsEqual<A, B> =
|
|
194
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
195
|
+
(<G>() => G extends B ? 1 : 2)
|
|
196
|
+
? true
|
|
197
|
+
: false;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
Filter out keys from an object.
|
|
201
|
+
|
|
202
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
203
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
204
|
+
Returns `Key` otherwise.
|
|
205
|
+
|
|
206
|
+
@example
|
|
207
|
+
```
|
|
208
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
209
|
+
//=> never
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
@example
|
|
213
|
+
```
|
|
214
|
+
type Filtered = Filter<'bar', string>;
|
|
215
|
+
//=> never
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
@example
|
|
219
|
+
```
|
|
220
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
221
|
+
//=> 'bar'
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
@see {Except}
|
|
225
|
+
*/
|
|
226
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
227
|
+
|
|
228
|
+
type ExceptOptions = {
|
|
229
|
+
/**
|
|
230
|
+
Disallow assigning non-specified properties.
|
|
231
|
+
|
|
232
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
233
|
+
|
|
234
|
+
@default false
|
|
235
|
+
*/
|
|
236
|
+
requireExactProps?: boolean;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
Create a type from an object type without certain keys.
|
|
241
|
+
|
|
242
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
243
|
+
|
|
244
|
+
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.
|
|
245
|
+
|
|
246
|
+
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)).
|
|
247
|
+
|
|
248
|
+
@example
|
|
249
|
+
```
|
|
250
|
+
import type {Except} from 'type-fest';
|
|
251
|
+
|
|
252
|
+
type Foo = {
|
|
253
|
+
a: number;
|
|
254
|
+
b: string;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
258
|
+
//=> {b: string}
|
|
259
|
+
|
|
260
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
261
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
262
|
+
|
|
263
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
264
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
265
|
+
|
|
266
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
267
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
@category Object
|
|
271
|
+
*/
|
|
272
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
273
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
274
|
+
} & (Options['requireExactProps'] extends true
|
|
275
|
+
? Partial<Record<KeysType, never>>
|
|
276
|
+
: {});
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
Returns a boolean for whether the given type is `never`.
|
|
280
|
+
|
|
281
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
282
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
283
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
284
|
+
|
|
285
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
286
|
+
|
|
287
|
+
@example
|
|
288
|
+
```
|
|
289
|
+
import type {IsNever, And} from 'type-fest';
|
|
290
|
+
|
|
291
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
292
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
293
|
+
And<
|
|
294
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
295
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
296
|
+
>;
|
|
297
|
+
|
|
298
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
299
|
+
AreStringsEqual<I, O> extends true
|
|
300
|
+
? never
|
|
301
|
+
: void;
|
|
302
|
+
|
|
303
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
304
|
+
if (input === output) {
|
|
305
|
+
process.exit(0);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
endIfEqual('abc', 'abc');
|
|
310
|
+
//=> never
|
|
311
|
+
|
|
312
|
+
endIfEqual('abc', '123');
|
|
313
|
+
//=> void
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
@category Type Guard
|
|
317
|
+
@category Utilities
|
|
318
|
+
*/
|
|
319
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
323
|
+
|
|
324
|
+
@see {@link IsNever}
|
|
325
|
+
|
|
326
|
+
@example
|
|
327
|
+
```
|
|
328
|
+
import type {IfNever} from 'type-fest';
|
|
329
|
+
|
|
330
|
+
type ShouldBeTrue = IfNever<never>;
|
|
331
|
+
//=> true
|
|
332
|
+
|
|
333
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
334
|
+
//=> 'bar'
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
@category Type Guard
|
|
338
|
+
@category Utilities
|
|
339
|
+
*/
|
|
340
|
+
type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
341
|
+
IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
346
|
+
|
|
347
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
348
|
+
|
|
349
|
+
@example
|
|
350
|
+
```
|
|
351
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
352
|
+
|
|
353
|
+
interface Example {
|
|
354
|
+
a: string;
|
|
355
|
+
b: string | number;
|
|
356
|
+
c?: string;
|
|
357
|
+
d: {};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
361
|
+
//=> 'a'
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
365
|
+
|
|
366
|
+
@example
|
|
367
|
+
```
|
|
368
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
369
|
+
|
|
370
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
371
|
+
//=> 'a' | 'c'
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
@category Object
|
|
375
|
+
*/
|
|
376
|
+
type ConditionalKeys<Base, Condition> =
|
|
377
|
+
{
|
|
378
|
+
// Map through all the keys of the given base type.
|
|
379
|
+
[Key in keyof Base]-?:
|
|
380
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
381
|
+
Base[Key] extends Condition
|
|
382
|
+
// Retain this key
|
|
383
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
384
|
+
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
|
|
385
|
+
// Discard this key since the condition fails.
|
|
386
|
+
: never;
|
|
387
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
388
|
+
}[keyof Base];
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
392
|
+
|
|
393
|
+
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.
|
|
394
|
+
|
|
395
|
+
@example
|
|
396
|
+
```
|
|
397
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
398
|
+
|
|
399
|
+
class Awesome {
|
|
400
|
+
name: string;
|
|
401
|
+
successes: number;
|
|
402
|
+
failures: bigint;
|
|
403
|
+
|
|
404
|
+
run() {}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
408
|
+
//=> {run: () => void}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
@example
|
|
412
|
+
```
|
|
413
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
414
|
+
|
|
415
|
+
interface Example {
|
|
416
|
+
a: string;
|
|
417
|
+
b: string | number;
|
|
418
|
+
c: () => void;
|
|
419
|
+
d: {};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
423
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
@category Object
|
|
427
|
+
*/
|
|
428
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
429
|
+
Base,
|
|
430
|
+
ConditionalKeys<Base, Condition>
|
|
431
|
+
>;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
435
|
+
* can either be a REST module or a host module.
|
|
436
|
+
* This type is recursive, so it can describe nested modules.
|
|
437
|
+
*/
|
|
438
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
439
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
443
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
444
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
445
|
+
* do not match the given host (as they will not work with the given host).
|
|
446
|
+
*/
|
|
447
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
448
|
+
done: T;
|
|
449
|
+
recurse: T extends {
|
|
450
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
451
|
+
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
452
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
453
|
+
-1,
|
|
454
|
+
0,
|
|
455
|
+
1,
|
|
456
|
+
2,
|
|
457
|
+
3,
|
|
458
|
+
4,
|
|
459
|
+
5
|
|
460
|
+
][Depth]> : never;
|
|
461
|
+
}, EmptyObject>;
|
|
462
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
463
|
+
type PublicMetadata = {
|
|
464
|
+
PACKAGE_NAME?: string;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
declare global {
|
|
468
|
+
interface ContextualClient {
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* A type used to create concerete types from SDK descriptors in
|
|
473
|
+
* case a contextual client is available.
|
|
474
|
+
*/
|
|
475
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
476
|
+
host: Host;
|
|
477
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
478
|
+
|
|
45
479
|
interface EnterpriseCategory {
|
|
46
480
|
/**
|
|
47
481
|
* Id of the category
|
|
@@ -60,12 +494,12 @@ interface EnterpriseCategory {
|
|
|
60
494
|
* Date and time the category was created.
|
|
61
495
|
* @readonly
|
|
62
496
|
*/
|
|
63
|
-
_createdDate?: Date;
|
|
497
|
+
_createdDate?: Date | null;
|
|
64
498
|
/**
|
|
65
499
|
* Date and time the category was updated.
|
|
66
500
|
* @readonly
|
|
67
501
|
*/
|
|
68
|
-
_updatedDate?: Date;
|
|
502
|
+
_updatedDate?: Date | null;
|
|
69
503
|
}
|
|
70
504
|
declare enum PublishStatus$1 {
|
|
71
505
|
UNDEFINED = "UNDEFINED",
|
|
@@ -179,7 +613,7 @@ interface DomainEvent$3 extends DomainEventBodyOneOf$3 {
|
|
|
179
613
|
/** ID of the entity associated with the event. */
|
|
180
614
|
entityId?: string;
|
|
181
615
|
/** Event timestamp. */
|
|
182
|
-
eventTime?: Date;
|
|
616
|
+
eventTime?: Date | null;
|
|
183
617
|
/**
|
|
184
618
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
185
619
|
* (for example, GDPR).
|
|
@@ -314,7 +748,7 @@ interface EventMetadata$3 extends BaseEventMetadata$3 {
|
|
|
314
748
|
/** ID of the entity associated with the event. */
|
|
315
749
|
entityId?: string;
|
|
316
750
|
/** Event timestamp. */
|
|
317
|
-
eventTime?: Date;
|
|
751
|
+
eventTime?: Date | null;
|
|
318
752
|
/**
|
|
319
753
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
320
754
|
* (for example, GDPR).
|
|
@@ -362,12 +796,12 @@ interface UpdateCategory {
|
|
|
362
796
|
* Date and time the category was created.
|
|
363
797
|
* @readonly
|
|
364
798
|
*/
|
|
365
|
-
_createdDate?: Date;
|
|
799
|
+
_createdDate?: Date | null;
|
|
366
800
|
/**
|
|
367
801
|
* Date and time the category was updated.
|
|
368
802
|
* @readonly
|
|
369
803
|
*/
|
|
370
|
-
_updatedDate?: Date;
|
|
804
|
+
_updatedDate?: Date | null;
|
|
371
805
|
}
|
|
372
806
|
interface GetCategoryOptions {
|
|
373
807
|
/** number of sub category levels */
|
|
@@ -380,7 +814,7 @@ interface EnterpriseOnboardingOptions {
|
|
|
380
814
|
accountName?: string;
|
|
381
815
|
}
|
|
382
816
|
|
|
383
|
-
declare function createCategory$1(httpClient: HttpClient
|
|
817
|
+
declare function createCategory$1(httpClient: HttpClient): CreateCategorySignature;
|
|
384
818
|
interface CreateCategorySignature {
|
|
385
819
|
/**
|
|
386
820
|
* Fetch a list of random media from different providers, using site information to customize results when available
|
|
@@ -389,7 +823,7 @@ interface CreateCategorySignature {
|
|
|
389
823
|
*/
|
|
390
824
|
(category: EnterpriseCategory): Promise<EnterpriseCategory & EnterpriseCategoryNonNullableFields>;
|
|
391
825
|
}
|
|
392
|
-
declare function deleteCategory$1(httpClient: HttpClient
|
|
826
|
+
declare function deleteCategory$1(httpClient: HttpClient): DeleteCategorySignature;
|
|
393
827
|
interface DeleteCategorySignature {
|
|
394
828
|
/**
|
|
395
829
|
* Delete a category including all its subcategories - but not the items
|
|
@@ -397,7 +831,7 @@ interface DeleteCategorySignature {
|
|
|
397
831
|
*/
|
|
398
832
|
(categoryId: string): Promise<void>;
|
|
399
833
|
}
|
|
400
|
-
declare function updateCategory$1(httpClient: HttpClient
|
|
834
|
+
declare function updateCategory$1(httpClient: HttpClient): UpdateCategorySignature;
|
|
401
835
|
interface UpdateCategorySignature {
|
|
402
836
|
/**
|
|
403
837
|
* Update category details
|
|
@@ -406,7 +840,7 @@ interface UpdateCategorySignature {
|
|
|
406
840
|
*/
|
|
407
841
|
(_id: string, category: UpdateCategory): Promise<EnterpriseCategory & EnterpriseCategoryNonNullableFields>;
|
|
408
842
|
}
|
|
409
|
-
declare function getCategory$1(httpClient: HttpClient
|
|
843
|
+
declare function getCategory$1(httpClient: HttpClient): GetCategorySignature;
|
|
410
844
|
interface GetCategorySignature {
|
|
411
845
|
/**
|
|
412
846
|
* Get information about a specific category
|
|
@@ -415,7 +849,7 @@ interface GetCategorySignature {
|
|
|
415
849
|
*/
|
|
416
850
|
(categoryId: string, options?: GetCategoryOptions | undefined): Promise<EnterpriseCategoryTree & EnterpriseCategoryTreeNonNullableFields>;
|
|
417
851
|
}
|
|
418
|
-
declare function enterpriseOnboarding$1(httpClient: HttpClient
|
|
852
|
+
declare function enterpriseOnboarding$1(httpClient: HttpClient): EnterpriseOnboardingSignature;
|
|
419
853
|
interface EnterpriseOnboardingSignature {
|
|
420
854
|
/**
|
|
421
855
|
* Create the enterprise category under "enterprise-media" main category
|
|
@@ -424,25 +858,25 @@ interface EnterpriseOnboardingSignature {
|
|
|
424
858
|
*/
|
|
425
859
|
(accountId: string, options?: EnterpriseOnboardingOptions | undefined): Promise<EnterpriseOnboardingResponse & EnterpriseOnboardingResponseNonNullableFields>;
|
|
426
860
|
}
|
|
427
|
-
declare function getMediaManagerCategories$1(httpClient: HttpClient
|
|
861
|
+
declare function getMediaManagerCategories$1(httpClient: HttpClient): GetMediaManagerCategoriesSignature;
|
|
428
862
|
interface GetMediaManagerCategoriesSignature {
|
|
429
863
|
/**
|
|
430
864
|
* Get the account category tree details
|
|
431
865
|
*/
|
|
432
866
|
(): Promise<GetMediaManagerCategoriesResponse & GetMediaManagerCategoriesResponseNonNullableFields>;
|
|
433
867
|
}
|
|
434
|
-
declare const onEnterpriseCategoryCreated$1: EventDefinition
|
|
435
|
-
declare const onEnterpriseCategoryDeleted$1: EventDefinition
|
|
436
|
-
declare const onEnterpriseCategoryUpdated$1: EventDefinition
|
|
868
|
+
declare const onEnterpriseCategoryCreated$1: EventDefinition<EnterpriseCategoryCreatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_category_created">;
|
|
869
|
+
declare const onEnterpriseCategoryDeleted$1: EventDefinition<EnterpriseCategoryDeletedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_category_deleted">;
|
|
870
|
+
declare const onEnterpriseCategoryUpdated$1: EventDefinition<EnterpriseCategoryUpdatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_category_updated">;
|
|
437
871
|
|
|
438
|
-
declare function createEventModule$3<T extends EventDefinition
|
|
872
|
+
declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
439
873
|
|
|
440
|
-
declare const createCategory: BuildRESTFunction
|
|
441
|
-
declare const deleteCategory: BuildRESTFunction
|
|
442
|
-
declare const updateCategory: BuildRESTFunction
|
|
443
|
-
declare const getCategory: BuildRESTFunction
|
|
444
|
-
declare const enterpriseOnboarding: BuildRESTFunction
|
|
445
|
-
declare const getMediaManagerCategories: BuildRESTFunction
|
|
874
|
+
declare const createCategory: MaybeContext<BuildRESTFunction<typeof createCategory$1> & typeof createCategory$1>;
|
|
875
|
+
declare const deleteCategory: MaybeContext<BuildRESTFunction<typeof deleteCategory$1> & typeof deleteCategory$1>;
|
|
876
|
+
declare const updateCategory: MaybeContext<BuildRESTFunction<typeof updateCategory$1> & typeof updateCategory$1>;
|
|
877
|
+
declare const getCategory: MaybeContext<BuildRESTFunction<typeof getCategory$1> & typeof getCategory$1>;
|
|
878
|
+
declare const enterpriseOnboarding: MaybeContext<BuildRESTFunction<typeof enterpriseOnboarding$1> & typeof enterpriseOnboarding$1>;
|
|
879
|
+
declare const getMediaManagerCategories: MaybeContext<BuildRESTFunction<typeof getMediaManagerCategories$1> & typeof getMediaManagerCategories$1>;
|
|
446
880
|
|
|
447
881
|
type _publicOnEnterpriseCategoryCreatedType = typeof onEnterpriseCategoryCreated$1;
|
|
448
882
|
/** */
|
|
@@ -503,50 +937,6 @@ declare namespace index_d$3 {
|
|
|
503
937
|
export { type ActionEvent$3 as ActionEvent, type BaseEventMetadata$3 as BaseEventMetadata, type index_d$3_CreateCategoryRequest as CreateCategoryRequest, type index_d$3_CreateCategoryResponse as CreateCategoryResponse, type index_d$3_CreateCategoryResponseNonNullableFields as CreateCategoryResponseNonNullableFields, type index_d$3_DeleteCategoryRequest as DeleteCategoryRequest, type index_d$3_DeleteCategoryResponse as DeleteCategoryResponse, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type index_d$3_EnterpriseCategory as EnterpriseCategory, type index_d$3_EnterpriseCategoryCreatedEnvelope as EnterpriseCategoryCreatedEnvelope, type index_d$3_EnterpriseCategoryDeletedEnvelope as EnterpriseCategoryDeletedEnvelope, type index_d$3_EnterpriseCategoryNonNullableFields as EnterpriseCategoryNonNullableFields, type index_d$3_EnterpriseCategoryTree as EnterpriseCategoryTree, type index_d$3_EnterpriseCategoryTreeNonNullableFields as EnterpriseCategoryTreeNonNullableFields, type index_d$3_EnterpriseCategoryUpdatedEnvelope as EnterpriseCategoryUpdatedEnvelope, type index_d$3_EnterpriseOnboardingOptions as EnterpriseOnboardingOptions, type index_d$3_EnterpriseOnboardingRequest as EnterpriseOnboardingRequest, type index_d$3_EnterpriseOnboardingResponse as EnterpriseOnboardingResponse, type index_d$3_EnterpriseOnboardingResponseNonNullableFields as EnterpriseOnboardingResponseNonNullableFields, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type EventMetadata$3 as EventMetadata, type index_d$3_GetCategoryOptions as GetCategoryOptions, type index_d$3_GetCategoryRequest as GetCategoryRequest, type index_d$3_GetCategoryResponse as GetCategoryResponse, type index_d$3_GetCategoryResponseNonNullableFields as GetCategoryResponseNonNullableFields, type index_d$3_GetMediaManagerCategoriesRequest as GetMediaManagerCategoriesRequest, type index_d$3_GetMediaManagerCategoriesResponse as GetMediaManagerCategoriesResponse, type index_d$3_GetMediaManagerCategoriesResponseNonNullableFields as GetMediaManagerCategoriesResponseNonNullableFields, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type index_d$3_LinkItemsToCategoryRequest as LinkItemsToCategoryRequest, type index_d$3_LinkItemsToCategoryResponse as LinkItemsToCategoryResponse, MediaType$2 as MediaType, type MessageEnvelope$3 as MessageEnvelope, PublishStatus$1 as PublishStatus, type index_d$3_UnlinkItemsFromCategoryRequest as UnlinkItemsFromCategoryRequest, type index_d$3_UnlinkItemsFromCategoryResponse as UnlinkItemsFromCategoryResponse, type index_d$3_UpdateCategory as UpdateCategory, type index_d$3_UpdateCategoryRequest as UpdateCategoryRequest, type index_d$3_UpdateCategoryResponse as UpdateCategoryResponse, type index_d$3_UpdateCategoryResponseNonNullableFields as UpdateCategoryResponseNonNullableFields, WebhookIdentityType$3 as WebhookIdentityType, type index_d$3__publicOnEnterpriseCategoryCreatedType as _publicOnEnterpriseCategoryCreatedType, type index_d$3__publicOnEnterpriseCategoryDeletedType as _publicOnEnterpriseCategoryDeletedType, type index_d$3__publicOnEnterpriseCategoryUpdatedType as _publicOnEnterpriseCategoryUpdatedType, index_d$3_createCategory as createCategory, index_d$3_deleteCategory as deleteCategory, index_d$3_enterpriseOnboarding as enterpriseOnboarding, index_d$3_getCategory as getCategory, index_d$3_getMediaManagerCategories as getMediaManagerCategories, index_d$3_onEnterpriseCategoryCreated as onEnterpriseCategoryCreated, index_d$3_onEnterpriseCategoryDeleted as onEnterpriseCategoryDeleted, index_d$3_onEnterpriseCategoryUpdated as onEnterpriseCategoryUpdated, onEnterpriseCategoryCreated$1 as publicOnEnterpriseCategoryCreated, onEnterpriseCategoryDeleted$1 as publicOnEnterpriseCategoryDeleted, onEnterpriseCategoryUpdated$1 as publicOnEnterpriseCategoryUpdated, index_d$3_updateCategory as updateCategory };
|
|
504
938
|
}
|
|
505
939
|
|
|
506
|
-
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
507
|
-
interface HttpClient$2 {
|
|
508
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
509
|
-
fetchWithAuth: typeof fetch;
|
|
510
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
511
|
-
}
|
|
512
|
-
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
513
|
-
type HttpResponse$2<T = any> = {
|
|
514
|
-
data: T;
|
|
515
|
-
status: number;
|
|
516
|
-
statusText: string;
|
|
517
|
-
headers: any;
|
|
518
|
-
request?: any;
|
|
519
|
-
};
|
|
520
|
-
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
521
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
522
|
-
url: string;
|
|
523
|
-
data?: Data;
|
|
524
|
-
params?: URLSearchParams;
|
|
525
|
-
} & APIMetadata$2;
|
|
526
|
-
type APIMetadata$2 = {
|
|
527
|
-
methodFqn?: string;
|
|
528
|
-
entityFqdn?: string;
|
|
529
|
-
packageName?: string;
|
|
530
|
-
};
|
|
531
|
-
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
532
|
-
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
533
|
-
__type: 'event-definition';
|
|
534
|
-
type: Type;
|
|
535
|
-
isDomainEvent?: boolean;
|
|
536
|
-
transformations?: (envelope: unknown) => Payload;
|
|
537
|
-
__payload: Payload;
|
|
538
|
-
};
|
|
539
|
-
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
540
|
-
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
541
|
-
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
542
|
-
|
|
543
|
-
declare global {
|
|
544
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
545
|
-
interface SymbolConstructor {
|
|
546
|
-
readonly observable: symbol;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
940
|
/**
|
|
551
941
|
* Duration for video fits better if there will be type specific media item.. however, is it ok to implement
|
|
552
942
|
* an additional one of field called details?
|
|
@@ -595,12 +985,12 @@ interface EnterpriseMediaItem {
|
|
|
595
985
|
* Date and time the item was created.
|
|
596
986
|
* @readonly
|
|
597
987
|
*/
|
|
598
|
-
_createdDate?: Date;
|
|
988
|
+
_createdDate?: Date | null;
|
|
599
989
|
/**
|
|
600
990
|
* Date and time the item was updated.
|
|
601
991
|
* @readonly
|
|
602
992
|
*/
|
|
603
|
-
_updatedDate?: Date;
|
|
993
|
+
_updatedDate?: Date | null;
|
|
604
994
|
/**
|
|
605
995
|
* An internal id used with different wix media systems
|
|
606
996
|
* @readonly
|
|
@@ -673,7 +1063,7 @@ interface Archive$1 {
|
|
|
673
1063
|
* Archive URL expiration date (when relevant).
|
|
674
1064
|
* @readonly
|
|
675
1065
|
*/
|
|
676
|
-
urlExpirationDate?: Date;
|
|
1066
|
+
urlExpirationDate?: Date | null;
|
|
677
1067
|
/** Archive size in bytes. */
|
|
678
1068
|
sizeInBytes?: string | null;
|
|
679
1069
|
/** Archive filename. */
|
|
@@ -692,7 +1082,7 @@ interface Model3D$1 {
|
|
|
692
1082
|
* 3D URL expiration date (when relevant).
|
|
693
1083
|
* @readonly
|
|
694
1084
|
*/
|
|
695
|
-
urlExpirationDate?: Date;
|
|
1085
|
+
urlExpirationDate?: Date | null;
|
|
696
1086
|
/**
|
|
697
1087
|
* 3D filename.
|
|
698
1088
|
* @readonly
|
|
@@ -997,7 +1387,7 @@ interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
|
|
|
997
1387
|
/** ID of the entity associated with the event. */
|
|
998
1388
|
entityId?: string;
|
|
999
1389
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
1000
|
-
eventTime?: Date;
|
|
1390
|
+
eventTime?: Date | null;
|
|
1001
1391
|
/**
|
|
1002
1392
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
1003
1393
|
* (for example, GDPR).
|
|
@@ -1026,7 +1416,7 @@ interface EntityCreatedEvent$2 {
|
|
|
1026
1416
|
entity?: string;
|
|
1027
1417
|
}
|
|
1028
1418
|
interface RestoreInfo$2 {
|
|
1029
|
-
deletedDate?: Date;
|
|
1419
|
+
deletedDate?: Date | null;
|
|
1030
1420
|
}
|
|
1031
1421
|
interface EntityUpdatedEvent$2 {
|
|
1032
1422
|
/**
|
|
@@ -1175,7 +1565,7 @@ interface EventMetadata$2 extends BaseEventMetadata$2 {
|
|
|
1175
1565
|
/** ID of the entity associated with the event. */
|
|
1176
1566
|
entityId?: string;
|
|
1177
1567
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
1178
|
-
eventTime?: Date;
|
|
1568
|
+
eventTime?: Date | null;
|
|
1179
1569
|
/**
|
|
1180
1570
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
1181
1571
|
* (for example, GDPR).
|
|
@@ -1347,12 +1737,12 @@ interface UpdateItem {
|
|
|
1347
1737
|
* Date and time the item was created.
|
|
1348
1738
|
* @readonly
|
|
1349
1739
|
*/
|
|
1350
|
-
_createdDate?: Date;
|
|
1740
|
+
_createdDate?: Date | null;
|
|
1351
1741
|
/**
|
|
1352
1742
|
* Date and time the item was updated.
|
|
1353
1743
|
* @readonly
|
|
1354
1744
|
*/
|
|
1355
|
-
_updatedDate?: Date;
|
|
1745
|
+
_updatedDate?: Date | null;
|
|
1356
1746
|
/**
|
|
1357
1747
|
* An internal id used with different wix media systems
|
|
1358
1748
|
* @readonly
|
|
@@ -1376,21 +1766,21 @@ interface OverwriteItemCategoriesOptions {
|
|
|
1376
1766
|
categoryIds?: string[];
|
|
1377
1767
|
}
|
|
1378
1768
|
|
|
1379
|
-
declare function itemUploadCallback$1(httpClient: HttpClient
|
|
1769
|
+
declare function itemUploadCallback$1(httpClient: HttpClient): ItemUploadCallbackSignature;
|
|
1380
1770
|
interface ItemUploadCallbackSignature {
|
|
1381
1771
|
/**
|
|
1382
1772
|
* Internal API called by the public media backend, notify about a file that was created enterprise public media server
|
|
1383
1773
|
*/
|
|
1384
1774
|
(options?: ItemUploadCallbackOptions | undefined): Promise<ItemUploadCallbackResponse>;
|
|
1385
1775
|
}
|
|
1386
|
-
declare function generateFileUploadUrl$3(httpClient: HttpClient
|
|
1776
|
+
declare function generateFileUploadUrl$3(httpClient: HttpClient): GenerateFileUploadUrlSignature$1;
|
|
1387
1777
|
interface GenerateFileUploadUrlSignature$1 {
|
|
1388
1778
|
/**
|
|
1389
1779
|
* Generate an upload url that will make public media to call the enterprise callback endpoint
|
|
1390
1780
|
*/
|
|
1391
1781
|
(options?: GenerateFileUploadUrlOptions$1 | undefined): Promise<GenerateFileUploadUrlResponse$1 & GenerateFileUploadUrlResponseNonNullableFields$1>;
|
|
1392
1782
|
}
|
|
1393
|
-
declare function importFile$3(httpClient: HttpClient
|
|
1783
|
+
declare function importFile$3(httpClient: HttpClient): ImportFileSignature$1;
|
|
1394
1784
|
interface ImportFileSignature$1 {
|
|
1395
1785
|
/**
|
|
1396
1786
|
* Import a file using a url
|
|
@@ -1398,7 +1788,7 @@ interface ImportFileSignature$1 {
|
|
|
1398
1788
|
*/
|
|
1399
1789
|
(url: string, options?: ImportFileOptions$1 | undefined): Promise<ImportFileResponse$1 & ImportFileResponseNonNullableFields$1>;
|
|
1400
1790
|
}
|
|
1401
|
-
declare function searchItems$1(httpClient: HttpClient
|
|
1791
|
+
declare function searchItems$1(httpClient: HttpClient): SearchItemsSignature;
|
|
1402
1792
|
interface SearchItemsSignature {
|
|
1403
1793
|
/**
|
|
1404
1794
|
* Search items, all filters only support equality
|
|
@@ -1406,7 +1796,7 @@ interface SearchItemsSignature {
|
|
|
1406
1796
|
*/
|
|
1407
1797
|
(options?: SearchItemsOptions | undefined): Promise<SearchItemsResponse & SearchItemsResponseNonNullableFields>;
|
|
1408
1798
|
}
|
|
1409
|
-
declare function queryItems$1(httpClient: HttpClient
|
|
1799
|
+
declare function queryItems$1(httpClient: HttpClient): QueryItemsSignature;
|
|
1410
1800
|
interface QueryItemsSignature {
|
|
1411
1801
|
/**
|
|
1412
1802
|
* Query items allowing to sort by specified fields, all filters only support equality
|
|
@@ -1414,7 +1804,7 @@ interface QueryItemsSignature {
|
|
|
1414
1804
|
*/
|
|
1415
1805
|
(): ItemsQueryBuilder;
|
|
1416
1806
|
}
|
|
1417
|
-
declare function updateItem$1(httpClient: HttpClient
|
|
1807
|
+
declare function updateItem$1(httpClient: HttpClient): UpdateItemSignature;
|
|
1418
1808
|
interface UpdateItemSignature {
|
|
1419
1809
|
/**
|
|
1420
1810
|
* Update an item
|
|
@@ -1423,7 +1813,7 @@ interface UpdateItemSignature {
|
|
|
1423
1813
|
*/
|
|
1424
1814
|
(_id: string, item: UpdateItem): Promise<EnterpriseMediaItem & EnterpriseMediaItemNonNullableFields>;
|
|
1425
1815
|
}
|
|
1426
|
-
declare function bulkUpdateItem$1(httpClient: HttpClient
|
|
1816
|
+
declare function bulkUpdateItem$1(httpClient: HttpClient): BulkUpdateItemSignature;
|
|
1427
1817
|
interface BulkUpdateItemSignature {
|
|
1428
1818
|
/**
|
|
1429
1819
|
* Bulk update an item
|
|
@@ -1431,7 +1821,7 @@ interface BulkUpdateItemSignature {
|
|
|
1431
1821
|
*/
|
|
1432
1822
|
(updateItemRequests: UpdateItemRequest[], options?: BulkUpdateItemOptions | undefined): Promise<BulkUpdateItemResponse & BulkUpdateItemResponseNonNullableFields>;
|
|
1433
1823
|
}
|
|
1434
|
-
declare function getItem$1(httpClient: HttpClient
|
|
1824
|
+
declare function getItem$1(httpClient: HttpClient): GetItemSignature;
|
|
1435
1825
|
interface GetItemSignature {
|
|
1436
1826
|
/**
|
|
1437
1827
|
* Get item details
|
|
@@ -1440,7 +1830,7 @@ interface GetItemSignature {
|
|
|
1440
1830
|
*/
|
|
1441
1831
|
(itemId: string): Promise<EnterpriseMediaItem & EnterpriseMediaItemNonNullableFields>;
|
|
1442
1832
|
}
|
|
1443
|
-
declare function linkItemToCategories$1(httpClient: HttpClient
|
|
1833
|
+
declare function linkItemToCategories$1(httpClient: HttpClient): LinkItemToCategoriesSignature;
|
|
1444
1834
|
interface LinkItemToCategoriesSignature {
|
|
1445
1835
|
/**
|
|
1446
1836
|
* Link the item to multiple categories
|
|
@@ -1448,7 +1838,7 @@ interface LinkItemToCategoriesSignature {
|
|
|
1448
1838
|
*/
|
|
1449
1839
|
(itemId: string, options?: LinkItemToCategoriesOptions | undefined): Promise<LinkItemToCategoriesResponse>;
|
|
1450
1840
|
}
|
|
1451
|
-
declare function unlinkItemFromCategories$1(httpClient: HttpClient
|
|
1841
|
+
declare function unlinkItemFromCategories$1(httpClient: HttpClient): UnlinkItemFromCategoriesSignature;
|
|
1452
1842
|
interface UnlinkItemFromCategoriesSignature {
|
|
1453
1843
|
/**
|
|
1454
1844
|
* Unlink the item from multiple categories
|
|
@@ -1456,7 +1846,7 @@ interface UnlinkItemFromCategoriesSignature {
|
|
|
1456
1846
|
*/
|
|
1457
1847
|
(itemId: string, options?: UnlinkItemFromCategoriesOptions | undefined): Promise<UnlinkItemFromCategoriesResponse>;
|
|
1458
1848
|
}
|
|
1459
|
-
declare function overwriteItemCategories$1(httpClient: HttpClient
|
|
1849
|
+
declare function overwriteItemCategories$1(httpClient: HttpClient): OverwriteItemCategoriesSignature;
|
|
1460
1850
|
interface OverwriteItemCategoriesSignature {
|
|
1461
1851
|
/**
|
|
1462
1852
|
* Overwrite item categories
|
|
@@ -1464,24 +1854,24 @@ interface OverwriteItemCategoriesSignature {
|
|
|
1464
1854
|
*/
|
|
1465
1855
|
(itemId: string, options?: OverwriteItemCategoriesOptions | undefined): Promise<OverwriteItemCategoriesResponse>;
|
|
1466
1856
|
}
|
|
1467
|
-
declare const onEnterpriseItemCreated$1: EventDefinition
|
|
1468
|
-
declare const onEnterpriseItemUpdated$1: EventDefinition
|
|
1469
|
-
declare const onEnterpriseItemItemCategoriesChanged$1: EventDefinition
|
|
1470
|
-
declare const onEnterpriseItemPublishStatusChanged$1: EventDefinition
|
|
1857
|
+
declare const onEnterpriseItemCreated$1: EventDefinition<EnterpriseItemCreatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_created">;
|
|
1858
|
+
declare const onEnterpriseItemUpdated$1: EventDefinition<EnterpriseItemUpdatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_updated">;
|
|
1859
|
+
declare const onEnterpriseItemItemCategoriesChanged$1: EventDefinition<EnterpriseItemItemCategoriesChangedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_item_categories_changed">;
|
|
1860
|
+
declare const onEnterpriseItemPublishStatusChanged$1: EventDefinition<EnterpriseItemPublishStatusChangedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_publish_status_changed">;
|
|
1471
1861
|
|
|
1472
|
-
declare function createEventModule$2<T extends EventDefinition
|
|
1862
|
+
declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
1473
1863
|
|
|
1474
|
-
declare const itemUploadCallback: BuildRESTFunction
|
|
1475
|
-
declare const generateFileUploadUrl$2: BuildRESTFunction
|
|
1476
|
-
declare const importFile$2: BuildRESTFunction
|
|
1477
|
-
declare const searchItems: BuildRESTFunction
|
|
1478
|
-
declare const queryItems: BuildRESTFunction
|
|
1479
|
-
declare const updateItem: BuildRESTFunction
|
|
1480
|
-
declare const bulkUpdateItem: BuildRESTFunction
|
|
1481
|
-
declare const getItem: BuildRESTFunction
|
|
1482
|
-
declare const linkItemToCategories: BuildRESTFunction
|
|
1483
|
-
declare const unlinkItemFromCategories: BuildRESTFunction
|
|
1484
|
-
declare const overwriteItemCategories: BuildRESTFunction
|
|
1864
|
+
declare const itemUploadCallback: MaybeContext<BuildRESTFunction<typeof itemUploadCallback$1> & typeof itemUploadCallback$1>;
|
|
1865
|
+
declare const generateFileUploadUrl$2: MaybeContext<BuildRESTFunction<typeof generateFileUploadUrl$3> & typeof generateFileUploadUrl$3>;
|
|
1866
|
+
declare const importFile$2: MaybeContext<BuildRESTFunction<typeof importFile$3> & typeof importFile$3>;
|
|
1867
|
+
declare const searchItems: MaybeContext<BuildRESTFunction<typeof searchItems$1> & typeof searchItems$1>;
|
|
1868
|
+
declare const queryItems: MaybeContext<BuildRESTFunction<typeof queryItems$1> & typeof queryItems$1>;
|
|
1869
|
+
declare const updateItem: MaybeContext<BuildRESTFunction<typeof updateItem$1> & typeof updateItem$1>;
|
|
1870
|
+
declare const bulkUpdateItem: MaybeContext<BuildRESTFunction<typeof bulkUpdateItem$1> & typeof bulkUpdateItem$1>;
|
|
1871
|
+
declare const getItem: MaybeContext<BuildRESTFunction<typeof getItem$1> & typeof getItem$1>;
|
|
1872
|
+
declare const linkItemToCategories: MaybeContext<BuildRESTFunction<typeof linkItemToCategories$1> & typeof linkItemToCategories$1>;
|
|
1873
|
+
declare const unlinkItemFromCategories: MaybeContext<BuildRESTFunction<typeof unlinkItemFromCategories$1> & typeof unlinkItemFromCategories$1>;
|
|
1874
|
+
declare const overwriteItemCategories: MaybeContext<BuildRESTFunction<typeof overwriteItemCategories$1> & typeof overwriteItemCategories$1>;
|
|
1485
1875
|
|
|
1486
1876
|
type _publicOnEnterpriseItemCreatedType = typeof onEnterpriseItemCreated$1;
|
|
1487
1877
|
/**
|
|
@@ -1579,50 +1969,6 @@ declare namespace index_d$2 {
|
|
|
1579
1969
|
export { type ActionEvent$2 as ActionEvent, type ApplicationError$1 as ApplicationError, type Archive$1 as Archive, type BaseEventMetadata$2 as BaseEventMetadata, type BulkActionMetadata$1 as BulkActionMetadata, type index_d$2_BulkItemUpdateResult as BulkItemUpdateResult, type index_d$2_BulkUpdateItemOptions as BulkUpdateItemOptions, type index_d$2_BulkUpdateItemRequest as BulkUpdateItemRequest, type index_d$2_BulkUpdateItemResponse as BulkUpdateItemResponse, type index_d$2_BulkUpdateItemResponseNonNullableFields as BulkUpdateItemResponseNonNullableFields, type Cursors$2 as Cursors, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type index_d$2_EnterpriseItemCreatedEnvelope as EnterpriseItemCreatedEnvelope, type index_d$2_EnterpriseItemItemCategoriesChangedEnvelope as EnterpriseItemItemCategoriesChangedEnvelope, type index_d$2_EnterpriseItemPublishStatusChangedEnvelope as EnterpriseItemPublishStatusChangedEnvelope, type index_d$2_EnterpriseItemUpdatedEnvelope as EnterpriseItemUpdatedEnvelope, type index_d$2_EnterpriseMediaItem as EnterpriseMediaItem, type index_d$2_EnterpriseMediaItemNonNullableFields as EnterpriseMediaItemNonNullableFields, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type GenerateFileUploadUrlOptions$1 as GenerateFileUploadUrlOptions, type GenerateFileUploadUrlRequest$1 as GenerateFileUploadUrlRequest, type GenerateFileUploadUrlResponse$1 as GenerateFileUploadUrlResponse, type GenerateFileUploadUrlResponseNonNullableFields$1 as GenerateFileUploadUrlResponseNonNullableFields, type index_d$2_GetItemRequest as GetItemRequest, type index_d$2_GetItemResponse as GetItemResponse, type index_d$2_GetItemResponseNonNullableFields as GetItemResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type ImportFileOptions$1 as ImportFileOptions, type ImportFileRequest$1 as ImportFileRequest, type ImportFileResponse$1 as ImportFileResponse, type ImportFileResponseNonNullableFields$1 as ImportFileResponseNonNullableFields, type index_d$2_ItemAssets as ItemAssets, type index_d$2_ItemAssetsAssetsOneOf as ItemAssetsAssetsOneOf, type index_d$2_ItemCategoriesChanged as ItemCategoriesChanged, type ItemMetadata$1 as ItemMetadata, type index_d$2_ItemUploadCallbackOptions as ItemUploadCallbackOptions, type index_d$2_ItemUploadCallbackRequest as ItemUploadCallbackRequest, type index_d$2_ItemUploadCallbackResponse as ItemUploadCallbackResponse, type index_d$2_ItemsQueryBuilder as ItemsQueryBuilder, type index_d$2_ItemsQueryResult as ItemsQueryResult, type index_d$2_LinkItemToCategoriesOptions as LinkItemToCategoriesOptions, type index_d$2_LinkItemToCategoriesRequest as LinkItemToCategoriesRequest, type index_d$2_LinkItemToCategoriesResponse as LinkItemToCategoriesResponse, MediaType$1 as MediaType, type MessageEnvelope$2 as MessageEnvelope, type Model3D$1 as Model3D, type index_d$2_OverwriteItemCategoriesOptions as OverwriteItemCategoriesOptions, type index_d$2_OverwriteItemCategoriesRequest as OverwriteItemCategoriesRequest, type index_d$2_OverwriteItemCategoriesResponse as OverwriteItemCategoriesResponse, type index_d$2_Paging as Paging, type PagingMetadataV2$2 as PagingMetadataV2, index_d$2_PublishStatus as PublishStatus, type index_d$2_PublishStatusChanged as PublishStatusChanged, type index_d$2_QueryItemsRequest as QueryItemsRequest, type index_d$2_QueryItemsResponse as QueryItemsResponse, type index_d$2_QueryItemsResponseNonNullableFields as QueryItemsResponseNonNullableFields, type index_d$2_QueryV2 as QueryV2, type index_d$2_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type RestoreInfo$2 as RestoreInfo, type index_d$2_Search as Search, type index_d$2_SearchDetails as SearchDetails, type index_d$2_SearchItemsOptions as SearchItemsOptions, type index_d$2_SearchItemsRequest as SearchItemsRequest, type index_d$2_SearchItemsResponse as SearchItemsResponse, type index_d$2_SearchItemsResponseNonNullableFields as SearchItemsResponseNonNullableFields, type index_d$2_SearchPagingMethodOneOf as SearchPagingMethodOneOf, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, type index_d$2_UnlinkItemFromCategoriesOptions as UnlinkItemFromCategoriesOptions, type index_d$2_UnlinkItemFromCategoriesRequest as UnlinkItemFromCategoriesRequest, type index_d$2_UnlinkItemFromCategoriesResponse as UnlinkItemFromCategoriesResponse, type index_d$2_UpdateItem as UpdateItem, type index_d$2_UpdateItemRequest as UpdateItemRequest, type index_d$2_UpdateItemResponse as UpdateItemResponse, type index_d$2_UpdateItemResponseNonNullableFields as UpdateItemResponseNonNullableFields, type VideoResolution$1 as VideoResolution, WebhookIdentityType$2 as WebhookIdentityType, type index_d$2__publicOnEnterpriseItemCreatedType as _publicOnEnterpriseItemCreatedType, type index_d$2__publicOnEnterpriseItemItemCategoriesChangedType as _publicOnEnterpriseItemItemCategoriesChangedType, type index_d$2__publicOnEnterpriseItemPublishStatusChangedType as _publicOnEnterpriseItemPublishStatusChangedType, type index_d$2__publicOnEnterpriseItemUpdatedType as _publicOnEnterpriseItemUpdatedType, index_d$2_bulkUpdateItem as bulkUpdateItem, generateFileUploadUrl$2 as generateFileUploadUrl, index_d$2_getItem as getItem, importFile$2 as importFile, index_d$2_itemUploadCallback as itemUploadCallback, index_d$2_linkItemToCategories as linkItemToCategories, index_d$2_onEnterpriseItemCreated as onEnterpriseItemCreated, index_d$2_onEnterpriseItemItemCategoriesChanged as onEnterpriseItemItemCategoriesChanged, index_d$2_onEnterpriseItemPublishStatusChanged as onEnterpriseItemPublishStatusChanged, index_d$2_onEnterpriseItemUpdated as onEnterpriseItemUpdated, index_d$2_overwriteItemCategories as overwriteItemCategories, onEnterpriseItemCreated$1 as publicOnEnterpriseItemCreated, onEnterpriseItemItemCategoriesChanged$1 as publicOnEnterpriseItemItemCategoriesChanged, onEnterpriseItemPublishStatusChanged$1 as publicOnEnterpriseItemPublishStatusChanged, onEnterpriseItemUpdated$1 as publicOnEnterpriseItemUpdated, index_d$2_queryItems as queryItems, index_d$2_searchItems as searchItems, index_d$2_unlinkItemFromCategories as unlinkItemFromCategories, index_d$2_updateItem as updateItem };
|
|
1580
1970
|
}
|
|
1581
1971
|
|
|
1582
|
-
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
1583
|
-
interface HttpClient$1 {
|
|
1584
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
1585
|
-
fetchWithAuth: typeof fetch;
|
|
1586
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1587
|
-
}
|
|
1588
|
-
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
1589
|
-
type HttpResponse$1<T = any> = {
|
|
1590
|
-
data: T;
|
|
1591
|
-
status: number;
|
|
1592
|
-
statusText: string;
|
|
1593
|
-
headers: any;
|
|
1594
|
-
request?: any;
|
|
1595
|
-
};
|
|
1596
|
-
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
1597
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1598
|
-
url: string;
|
|
1599
|
-
data?: Data;
|
|
1600
|
-
params?: URLSearchParams;
|
|
1601
|
-
} & APIMetadata$1;
|
|
1602
|
-
type APIMetadata$1 = {
|
|
1603
|
-
methodFqn?: string;
|
|
1604
|
-
entityFqdn?: string;
|
|
1605
|
-
packageName?: string;
|
|
1606
|
-
};
|
|
1607
|
-
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
1608
|
-
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
1609
|
-
__type: 'event-definition';
|
|
1610
|
-
type: Type;
|
|
1611
|
-
isDomainEvent?: boolean;
|
|
1612
|
-
transformations?: (envelope: unknown) => Payload;
|
|
1613
|
-
__payload: Payload;
|
|
1614
|
-
};
|
|
1615
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
1616
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
1617
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
1618
|
-
|
|
1619
|
-
declare global {
|
|
1620
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1621
|
-
interface SymbolConstructor {
|
|
1622
|
-
readonly observable: symbol;
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
1972
|
interface FileDescriptor {
|
|
1627
1973
|
/**
|
|
1628
1974
|
* File ID. Generated when a file is uploaded to the Media Manager.
|
|
@@ -1687,12 +2033,12 @@ interface FileDescriptor {
|
|
|
1687
2033
|
* Date and time the file was created.
|
|
1688
2034
|
* @readonly
|
|
1689
2035
|
*/
|
|
1690
|
-
_createdDate?: Date;
|
|
2036
|
+
_createdDate?: Date | null;
|
|
1691
2037
|
/**
|
|
1692
2038
|
* Date and time the file was updated.
|
|
1693
2039
|
* @readonly
|
|
1694
2040
|
*/
|
|
1695
|
-
_updatedDate?: Date;
|
|
2041
|
+
_updatedDate?: Date | null;
|
|
1696
2042
|
/**
|
|
1697
2043
|
* The Wix site ID where the media file is stored.
|
|
1698
2044
|
* @readonly
|
|
@@ -1862,7 +2208,7 @@ interface Archive {
|
|
|
1862
2208
|
* Archive URL expiration date (when relevant).
|
|
1863
2209
|
* @readonly
|
|
1864
2210
|
*/
|
|
1865
|
-
urlExpirationDate?: Date;
|
|
2211
|
+
urlExpirationDate?: Date | null;
|
|
1866
2212
|
/** Archive size in bytes. */
|
|
1867
2213
|
sizeInBytes?: string | null;
|
|
1868
2214
|
/** Archive filename. */
|
|
@@ -1881,7 +2227,7 @@ interface Model3D {
|
|
|
1881
2227
|
* 3D URL expiration date (when relevant).
|
|
1882
2228
|
* @readonly
|
|
1883
2229
|
*/
|
|
1884
|
-
urlExpirationDate?: Date;
|
|
2230
|
+
urlExpirationDate?: Date | null;
|
|
1885
2231
|
/**
|
|
1886
2232
|
* 3D filename.
|
|
1887
2233
|
* @readonly
|
|
@@ -2528,7 +2874,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
|
|
|
2528
2874
|
/** ID of the entity associated with the event. */
|
|
2529
2875
|
entityId?: string;
|
|
2530
2876
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
2531
|
-
eventTime?: Date;
|
|
2877
|
+
eventTime?: Date | null;
|
|
2532
2878
|
/**
|
|
2533
2879
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
2534
2880
|
* (for example, GDPR).
|
|
@@ -2557,7 +2903,7 @@ interface EntityCreatedEvent$1 {
|
|
|
2557
2903
|
entity?: string;
|
|
2558
2904
|
}
|
|
2559
2905
|
interface RestoreInfo$1 {
|
|
2560
|
-
deletedDate?: Date;
|
|
2906
|
+
deletedDate?: Date | null;
|
|
2561
2907
|
}
|
|
2562
2908
|
interface EntityUpdatedEvent$1 {
|
|
2563
2909
|
/**
|
|
@@ -2767,7 +3113,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
|
|
|
2767
3113
|
/** ID of the entity associated with the event. */
|
|
2768
3114
|
entityId?: string;
|
|
2769
3115
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
2770
|
-
eventTime?: Date;
|
|
3116
|
+
eventTime?: Date | null;
|
|
2771
3117
|
/**
|
|
2772
3118
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
2773
3119
|
* (for example, GDPR).
|
|
@@ -3030,7 +3376,7 @@ interface ListDeletedFilesOptions {
|
|
|
3030
3376
|
paging?: CursorPaging$1;
|
|
3031
3377
|
}
|
|
3032
3378
|
|
|
3033
|
-
declare function generateFilesDownloadUrl$1(httpClient: HttpClient
|
|
3379
|
+
declare function generateFilesDownloadUrl$1(httpClient: HttpClient): GenerateFilesDownloadUrlSignature;
|
|
3034
3380
|
interface GenerateFilesDownloadUrlSignature {
|
|
3035
3381
|
/**
|
|
3036
3382
|
* Generates a URL for downloading a compressed file containing specific files in the Media Manager.
|
|
@@ -3049,7 +3395,7 @@ interface GenerateFilesDownloadUrlSignature {
|
|
|
3049
3395
|
*/
|
|
3050
3396
|
(fileIds: string[]): Promise<GenerateFilesDownloadUrlResponse & GenerateFilesDownloadUrlResponseNonNullableFields>;
|
|
3051
3397
|
}
|
|
3052
|
-
declare function generateFileDownloadUrl$1(httpClient: HttpClient
|
|
3398
|
+
declare function generateFileDownloadUrl$1(httpClient: HttpClient): GenerateFileDownloadUrlSignature;
|
|
3053
3399
|
interface GenerateFileDownloadUrlSignature {
|
|
3054
3400
|
/**
|
|
3055
3401
|
* Generates one or more temporary URLs for downloading a specific file in the Media Manager.
|
|
@@ -3071,7 +3417,7 @@ interface GenerateFileDownloadUrlSignature {
|
|
|
3071
3417
|
*/
|
|
3072
3418
|
(fileId: string, options?: GenerateFileDownloadUrlOptions | undefined): Promise<GenerateFileDownloadUrlResponse & GenerateFileDownloadUrlResponseNonNullableFields>;
|
|
3073
3419
|
}
|
|
3074
|
-
declare function getFileDescriptor$1(httpClient: HttpClient
|
|
3420
|
+
declare function getFileDescriptor$1(httpClient: HttpClient): GetFileDescriptorSignature;
|
|
3075
3421
|
interface GetFileDescriptorSignature {
|
|
3076
3422
|
/**
|
|
3077
3423
|
* Gets information about the specified file in the Media Manager.
|
|
@@ -3088,7 +3434,7 @@ interface GetFileDescriptorSignature {
|
|
|
3088
3434
|
*/
|
|
3089
3435
|
(fileId: string): Promise<FileDescriptor & FileDescriptorNonNullableFields>;
|
|
3090
3436
|
}
|
|
3091
|
-
declare function getFileDescriptors$1(httpClient: HttpClient
|
|
3437
|
+
declare function getFileDescriptors$1(httpClient: HttpClient): GetFileDescriptorsSignature;
|
|
3092
3438
|
interface GetFileDescriptorsSignature {
|
|
3093
3439
|
/**
|
|
3094
3440
|
* Gets information about the specified files in the Media Manager.
|
|
@@ -3104,7 +3450,7 @@ interface GetFileDescriptorsSignature {
|
|
|
3104
3450
|
*/
|
|
3105
3451
|
(fileIds: string[]): Promise<GetFileDescriptorsResponse & GetFileDescriptorsResponseNonNullableFields>;
|
|
3106
3452
|
}
|
|
3107
|
-
declare function updateFileDescriptor$1(httpClient: HttpClient
|
|
3453
|
+
declare function updateFileDescriptor$1(httpClient: HttpClient): UpdateFileDescriptorSignature;
|
|
3108
3454
|
interface UpdateFileDescriptorSignature {
|
|
3109
3455
|
/**
|
|
3110
3456
|
* Updates a file.
|
|
@@ -3118,7 +3464,7 @@ interface UpdateFileDescriptorSignature {
|
|
|
3118
3464
|
*/
|
|
3119
3465
|
(file: FileDescriptor): Promise<FileDescriptor & FileDescriptorNonNullableFields>;
|
|
3120
3466
|
}
|
|
3121
|
-
declare function generateFileUploadUrl$1(httpClient: HttpClient
|
|
3467
|
+
declare function generateFileUploadUrl$1(httpClient: HttpClient): GenerateFileUploadUrlSignature;
|
|
3122
3468
|
interface GenerateFileUploadUrlSignature {
|
|
3123
3469
|
/**
|
|
3124
3470
|
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
@@ -3135,7 +3481,7 @@ interface GenerateFileUploadUrlSignature {
|
|
|
3135
3481
|
*/
|
|
3136
3482
|
(mimeType: string | null, options?: GenerateFileUploadUrlOptions | undefined): Promise<GenerateFileUploadUrlResponse & GenerateFileUploadUrlResponseNonNullableFields>;
|
|
3137
3483
|
}
|
|
3138
|
-
declare function generateFileResumableUploadUrl$1(httpClient: HttpClient
|
|
3484
|
+
declare function generateFileResumableUploadUrl$1(httpClient: HttpClient): GenerateFileResumableUploadUrlSignature;
|
|
3139
3485
|
interface GenerateFileResumableUploadUrlSignature {
|
|
3140
3486
|
/**
|
|
3141
3487
|
* Generates a resumable upload URL to allow external clients to upload large files over 10MB to the Media Manager.
|
|
@@ -3152,7 +3498,7 @@ interface GenerateFileResumableUploadUrlSignature {
|
|
|
3152
3498
|
*/
|
|
3153
3499
|
(mimeType: string | null, options?: GenerateFileResumableUploadUrlOptions | undefined): Promise<GenerateFileResumableUploadUrlResponse & GenerateFileResumableUploadUrlResponseNonNullableFields>;
|
|
3154
3500
|
}
|
|
3155
|
-
declare function importFile$1(httpClient: HttpClient
|
|
3501
|
+
declare function importFile$1(httpClient: HttpClient): ImportFileSignature;
|
|
3156
3502
|
interface ImportFileSignature {
|
|
3157
3503
|
/**
|
|
3158
3504
|
* Imports a file to the Media Manager using an external URL.
|
|
@@ -3175,7 +3521,7 @@ interface ImportFileSignature {
|
|
|
3175
3521
|
*/
|
|
3176
3522
|
(url: string, options?: ImportFileOptions | undefined): Promise<ImportFileResponse & ImportFileResponseNonNullableFields>;
|
|
3177
3523
|
}
|
|
3178
|
-
declare function bulkImportFiles$1(httpClient: HttpClient
|
|
3524
|
+
declare function bulkImportFiles$1(httpClient: HttpClient): BulkImportFilesSignature;
|
|
3179
3525
|
interface BulkImportFilesSignature {
|
|
3180
3526
|
/**
|
|
3181
3527
|
* > **Deprecated.**
|
|
@@ -3202,7 +3548,7 @@ interface BulkImportFilesSignature {
|
|
|
3202
3548
|
*/
|
|
3203
3549
|
(importFileRequests: ImportFileRequest[]): Promise<BulkImportFilesResponse & BulkImportFilesResponseNonNullableFields>;
|
|
3204
3550
|
}
|
|
3205
|
-
declare function bulkImportFile$1(httpClient: HttpClient
|
|
3551
|
+
declare function bulkImportFile$1(httpClient: HttpClient): BulkImportFileSignature;
|
|
3206
3552
|
interface BulkImportFileSignature {
|
|
3207
3553
|
/**
|
|
3208
3554
|
* Imports a bulk of files to the Media Manager using external urls.
|
|
@@ -3224,7 +3570,7 @@ interface BulkImportFileSignature {
|
|
|
3224
3570
|
*/
|
|
3225
3571
|
(importFileRequests: ImportFileRequest[], options?: BulkImportFileOptions | undefined): Promise<BulkImportFileResponse & BulkImportFileResponseNonNullableFields>;
|
|
3226
3572
|
}
|
|
3227
|
-
declare function listFiles$1(httpClient: HttpClient
|
|
3573
|
+
declare function listFiles$1(httpClient: HttpClient): ListFilesSignature;
|
|
3228
3574
|
interface ListFilesSignature {
|
|
3229
3575
|
/**
|
|
3230
3576
|
* Retrieves a list of files in the Media Manager.
|
|
@@ -3238,7 +3584,7 @@ interface ListFilesSignature {
|
|
|
3238
3584
|
*/
|
|
3239
3585
|
(options?: ListFilesOptions | undefined): Promise<ListFilesResponse & ListFilesResponseNonNullableFields>;
|
|
3240
3586
|
}
|
|
3241
|
-
declare function searchFiles$1(httpClient: HttpClient
|
|
3587
|
+
declare function searchFiles$1(httpClient: HttpClient): SearchFilesSignature;
|
|
3242
3588
|
interface SearchFilesSignature {
|
|
3243
3589
|
/**
|
|
3244
3590
|
* Searches all folders in the Media Manager and returns a list of files that match the terms specified in the optional parameters.
|
|
@@ -3250,7 +3596,7 @@ interface SearchFilesSignature {
|
|
|
3250
3596
|
*/
|
|
3251
3597
|
(options?: SearchFilesOptions | undefined): Promise<SearchFilesResponse & SearchFilesResponseNonNullableFields>;
|
|
3252
3598
|
}
|
|
3253
|
-
declare function generateVideoStreamingUrl$1(httpClient: HttpClient
|
|
3599
|
+
declare function generateVideoStreamingUrl$1(httpClient: HttpClient): GenerateVideoStreamingUrlSignature;
|
|
3254
3600
|
interface GenerateVideoStreamingUrlSignature {
|
|
3255
3601
|
/**
|
|
3256
3602
|
* Generates a URL for streaming a specific video file in the Media Manager.
|
|
@@ -3267,7 +3613,7 @@ interface GenerateVideoStreamingUrlSignature {
|
|
|
3267
3613
|
*/
|
|
3268
3614
|
(fileId: string, options?: GenerateVideoStreamingUrlOptions | undefined): Promise<GenerateVideoStreamingUrlResponse & GenerateVideoStreamingUrlResponseNonNullableFields>;
|
|
3269
3615
|
}
|
|
3270
|
-
declare function bulkDeleteFiles$1(httpClient: HttpClient
|
|
3616
|
+
declare function bulkDeleteFiles$1(httpClient: HttpClient): BulkDeleteFilesSignature;
|
|
3271
3617
|
interface BulkDeleteFilesSignature {
|
|
3272
3618
|
/**
|
|
3273
3619
|
* Deletes the specified files from the Media Manager.
|
|
@@ -3291,7 +3637,7 @@ interface BulkDeleteFilesSignature {
|
|
|
3291
3637
|
*/
|
|
3292
3638
|
(fileIds: string[], options?: BulkDeleteFilesOptions | undefined): Promise<void>;
|
|
3293
3639
|
}
|
|
3294
|
-
declare function bulkRestoreFilesFromTrashBin$1(httpClient: HttpClient
|
|
3640
|
+
declare function bulkRestoreFilesFromTrashBin$1(httpClient: HttpClient): BulkRestoreFilesFromTrashBinSignature;
|
|
3295
3641
|
interface BulkRestoreFilesFromTrashBinSignature {
|
|
3296
3642
|
/**
|
|
3297
3643
|
* Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
|
|
@@ -3304,7 +3650,7 @@ interface BulkRestoreFilesFromTrashBinSignature {
|
|
|
3304
3650
|
*/
|
|
3305
3651
|
(fileIds: string[]): Promise<void>;
|
|
3306
3652
|
}
|
|
3307
|
-
declare function listDeletedFiles$1(httpClient: HttpClient
|
|
3653
|
+
declare function listDeletedFiles$1(httpClient: HttpClient): ListDeletedFilesSignature;
|
|
3308
3654
|
interface ListDeletedFilesSignature {
|
|
3309
3655
|
/**
|
|
3310
3656
|
* Retrieves a list of files in the Media Manager's trash bin.
|
|
@@ -3318,29 +3664,29 @@ interface ListDeletedFilesSignature {
|
|
|
3318
3664
|
*/
|
|
3319
3665
|
(options?: ListDeletedFilesOptions | undefined): Promise<ListDeletedFilesResponse & ListDeletedFilesResponseNonNullableFields>;
|
|
3320
3666
|
}
|
|
3321
|
-
declare const onFileDescriptorUpdated$1: EventDefinition
|
|
3322
|
-
declare const onFileDescriptorDeleted$1: EventDefinition
|
|
3323
|
-
declare const onFileDescriptorFileReady$1: EventDefinition
|
|
3324
|
-
declare const onFileDescriptorFileFailed$1: EventDefinition
|
|
3667
|
+
declare const onFileDescriptorUpdated$1: EventDefinition<FileDescriptorUpdatedEnvelope, "wix.media.site_media.v1.file_descriptor_updated">;
|
|
3668
|
+
declare const onFileDescriptorDeleted$1: EventDefinition<FileDescriptorDeletedEnvelope, "wix.media.site_media.v1.file_descriptor_deleted">;
|
|
3669
|
+
declare const onFileDescriptorFileReady$1: EventDefinition<FileDescriptorFileReadyEnvelope, "wix.media.site_media.v1.file_descriptor_file_ready">;
|
|
3670
|
+
declare const onFileDescriptorFileFailed$1: EventDefinition<FileDescriptorFileFailedEnvelope, "wix.media.site_media.v1.file_descriptor_file_failed">;
|
|
3325
3671
|
|
|
3326
|
-
declare function createEventModule$1<T extends EventDefinition
|
|
3672
|
+
declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
3327
3673
|
|
|
3328
|
-
declare const generateFilesDownloadUrl: BuildRESTFunction
|
|
3329
|
-
declare const generateFileDownloadUrl: BuildRESTFunction
|
|
3330
|
-
declare const getFileDescriptor: BuildRESTFunction
|
|
3331
|
-
declare const getFileDescriptors: BuildRESTFunction
|
|
3332
|
-
declare const updateFileDescriptor: BuildRESTFunction
|
|
3333
|
-
declare const generateFileUploadUrl: BuildRESTFunction
|
|
3334
|
-
declare const generateFileResumableUploadUrl: BuildRESTFunction
|
|
3335
|
-
declare const importFile: BuildRESTFunction
|
|
3336
|
-
declare const bulkImportFiles: BuildRESTFunction
|
|
3337
|
-
declare const bulkImportFile: BuildRESTFunction
|
|
3338
|
-
declare const listFiles: BuildRESTFunction
|
|
3339
|
-
declare const searchFiles: BuildRESTFunction
|
|
3340
|
-
declare const generateVideoStreamingUrl: BuildRESTFunction
|
|
3341
|
-
declare const bulkDeleteFiles: BuildRESTFunction
|
|
3342
|
-
declare const bulkRestoreFilesFromTrashBin: BuildRESTFunction
|
|
3343
|
-
declare const listDeletedFiles: BuildRESTFunction
|
|
3674
|
+
declare const generateFilesDownloadUrl: MaybeContext<BuildRESTFunction<typeof generateFilesDownloadUrl$1> & typeof generateFilesDownloadUrl$1>;
|
|
3675
|
+
declare const generateFileDownloadUrl: MaybeContext<BuildRESTFunction<typeof generateFileDownloadUrl$1> & typeof generateFileDownloadUrl$1>;
|
|
3676
|
+
declare const getFileDescriptor: MaybeContext<BuildRESTFunction<typeof getFileDescriptor$1> & typeof getFileDescriptor$1>;
|
|
3677
|
+
declare const getFileDescriptors: MaybeContext<BuildRESTFunction<typeof getFileDescriptors$1> & typeof getFileDescriptors$1>;
|
|
3678
|
+
declare const updateFileDescriptor: MaybeContext<BuildRESTFunction<typeof updateFileDescriptor$1> & typeof updateFileDescriptor$1>;
|
|
3679
|
+
declare const generateFileUploadUrl: MaybeContext<BuildRESTFunction<typeof generateFileUploadUrl$1> & typeof generateFileUploadUrl$1>;
|
|
3680
|
+
declare const generateFileResumableUploadUrl: MaybeContext<BuildRESTFunction<typeof generateFileResumableUploadUrl$1> & typeof generateFileResumableUploadUrl$1>;
|
|
3681
|
+
declare const importFile: MaybeContext<BuildRESTFunction<typeof importFile$1> & typeof importFile$1>;
|
|
3682
|
+
declare const bulkImportFiles: MaybeContext<BuildRESTFunction<typeof bulkImportFiles$1> & typeof bulkImportFiles$1>;
|
|
3683
|
+
declare const bulkImportFile: MaybeContext<BuildRESTFunction<typeof bulkImportFile$1> & typeof bulkImportFile$1>;
|
|
3684
|
+
declare const listFiles: MaybeContext<BuildRESTFunction<typeof listFiles$1> & typeof listFiles$1>;
|
|
3685
|
+
declare const searchFiles: MaybeContext<BuildRESTFunction<typeof searchFiles$1> & typeof searchFiles$1>;
|
|
3686
|
+
declare const generateVideoStreamingUrl: MaybeContext<BuildRESTFunction<typeof generateVideoStreamingUrl$1> & typeof generateVideoStreamingUrl$1>;
|
|
3687
|
+
declare const bulkDeleteFiles: MaybeContext<BuildRESTFunction<typeof bulkDeleteFiles$1> & typeof bulkDeleteFiles$1>;
|
|
3688
|
+
declare const bulkRestoreFilesFromTrashBin: MaybeContext<BuildRESTFunction<typeof bulkRestoreFilesFromTrashBin$1> & typeof bulkRestoreFilesFromTrashBin$1>;
|
|
3689
|
+
declare const listDeletedFiles: MaybeContext<BuildRESTFunction<typeof listDeletedFiles$1> & typeof listDeletedFiles$1>;
|
|
3344
3690
|
|
|
3345
3691
|
type _publicOnFileDescriptorUpdatedType = typeof onFileDescriptorUpdated$1;
|
|
3346
3692
|
/** */
|
|
@@ -3489,50 +3835,6 @@ declare namespace index_d$1 {
|
|
|
3489
3835
|
export { type ActionEvent$1 as ActionEvent, type index_d$1_ApplicationError as ApplicationError, type index_d$1_Archive as Archive, type index_d$1_AudioV2 as AudioV2, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$1_BulkActionMetadata as BulkActionMetadata, type index_d$1_BulkAnnotateImagesRequest as BulkAnnotateImagesRequest, type index_d$1_BulkAnnotateImagesResponse as BulkAnnotateImagesResponse, type index_d$1_BulkDeleteFilesOptions as BulkDeleteFilesOptions, type index_d$1_BulkDeleteFilesRequest as BulkDeleteFilesRequest, type index_d$1_BulkDeleteFilesResponse as BulkDeleteFilesResponse, type index_d$1_BulkImportFileOptions as BulkImportFileOptions, type index_d$1_BulkImportFileRequest as BulkImportFileRequest, type index_d$1_BulkImportFileResponse as BulkImportFileResponse, type index_d$1_BulkImportFileResponseNonNullableFields as BulkImportFileResponseNonNullableFields, type index_d$1_BulkImportFileResult as BulkImportFileResult, type index_d$1_BulkImportFilesRequest as BulkImportFilesRequest, type index_d$1_BulkImportFilesResponse as BulkImportFilesResponse, type index_d$1_BulkImportFilesResponseNonNullableFields as BulkImportFilesResponseNonNullableFields, type index_d$1_BulkRestoreFilesFromTrashBinRequest as BulkRestoreFilesFromTrashBinRequest, type index_d$1_BulkRestoreFilesFromTrashBinResponse as BulkRestoreFilesFromTrashBinResponse, type index_d$1_Color as Color, type index_d$1_ColorRGB as ColorRGB, type index_d$1_Colors as Colors, index_d$1_ContentDisposition as ContentDisposition, type CursorPaging$1 as CursorPaging, type Cursors$1 as Cursors, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type index_d$1_DownloadUrl as DownloadUrl, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type index_d$1_ExternalInfo as ExternalInfo, type index_d$1_FaceRecognition as FaceRecognition, type index_d$1_FileDescriptor as FileDescriptor, type index_d$1_FileDescriptorDeletedEnvelope as FileDescriptorDeletedEnvelope, type index_d$1_FileDescriptorFileFailedEnvelope as FileDescriptorFileFailedEnvelope, type index_d$1_FileDescriptorFileReadyEnvelope as FileDescriptorFileReadyEnvelope, type index_d$1_FileDescriptorNonNullableFields as FileDescriptorNonNullableFields, type index_d$1_FileDescriptorUpdatedEnvelope as FileDescriptorUpdatedEnvelope, type index_d$1_FileFailed as FileFailed, type index_d$1_FileMedia as FileMedia, type index_d$1_FileMediaMediaOneOf as FileMediaMediaOneOf, type index_d$1_FileReady as FileReady, type index_d$1_GenerateFileDownloadUrlOptions as GenerateFileDownloadUrlOptions, type index_d$1_GenerateFileDownloadUrlRequest as GenerateFileDownloadUrlRequest, type index_d$1_GenerateFileDownloadUrlResponse as GenerateFileDownloadUrlResponse, type index_d$1_GenerateFileDownloadUrlResponseNonNullableFields as GenerateFileDownloadUrlResponseNonNullableFields, type index_d$1_GenerateFileResumableUploadUrlOptions as GenerateFileResumableUploadUrlOptions, type index_d$1_GenerateFileResumableUploadUrlRequest as GenerateFileResumableUploadUrlRequest, type index_d$1_GenerateFileResumableUploadUrlResponse as GenerateFileResumableUploadUrlResponse, type index_d$1_GenerateFileResumableUploadUrlResponseNonNullableFields as GenerateFileResumableUploadUrlResponseNonNullableFields, type index_d$1_GenerateFileUploadUrlOptions as GenerateFileUploadUrlOptions, type index_d$1_GenerateFileUploadUrlRequest as GenerateFileUploadUrlRequest, type index_d$1_GenerateFileUploadUrlResponse as GenerateFileUploadUrlResponse, type index_d$1_GenerateFileUploadUrlResponseNonNullableFields as GenerateFileUploadUrlResponseNonNullableFields, type index_d$1_GenerateFilesDownloadUrlRequest as GenerateFilesDownloadUrlRequest, type index_d$1_GenerateFilesDownloadUrlResponse as GenerateFilesDownloadUrlResponse, type index_d$1_GenerateFilesDownloadUrlResponseNonNullableFields as GenerateFilesDownloadUrlResponseNonNullableFields, type index_d$1_GenerateVideoStreamingUrlOptions as GenerateVideoStreamingUrlOptions, type index_d$1_GenerateVideoStreamingUrlRequest as GenerateVideoStreamingUrlRequest, type index_d$1_GenerateVideoStreamingUrlResponse as GenerateVideoStreamingUrlResponse, type index_d$1_GenerateVideoStreamingUrlResponseNonNullableFields as GenerateVideoStreamingUrlResponseNonNullableFields, type index_d$1_GenerateWebSocketTokenRequest as GenerateWebSocketTokenRequest, type index_d$1_GenerateWebSocketTokenResponse as GenerateWebSocketTokenResponse, type index_d$1_GetFileDescriptorRequest as GetFileDescriptorRequest, type index_d$1_GetFileDescriptorResponse as GetFileDescriptorResponse, type index_d$1_GetFileDescriptorResponseNonNullableFields as GetFileDescriptorResponseNonNullableFields, type index_d$1_GetFileDescriptorsRequest as GetFileDescriptorsRequest, type index_d$1_GetFileDescriptorsResponse as GetFileDescriptorsResponse, type index_d$1_GetFileDescriptorsResponseNonNullableFields as GetFileDescriptorsResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type index_d$1_IdentityInfo as IdentityInfo, index_d$1_IdentityType as IdentityType, index_d$1_ImageAnnotationType as ImageAnnotationType, type index_d$1_ImageMedia as ImageMedia, type index_d$1_ImportFileOptions as ImportFileOptions, type index_d$1_ImportFileRequest as ImportFileRequest, type index_d$1_ImportFileResponse as ImportFileResponse, type index_d$1_ImportFileResponseNonNullableFields as ImportFileResponseNonNullableFields, type index_d$1_ItemMetadata as ItemMetadata, type index_d$1_ListDeletedFilesOptions as ListDeletedFilesOptions, type index_d$1_ListDeletedFilesRequest as ListDeletedFilesRequest, type index_d$1_ListDeletedFilesResponse as ListDeletedFilesResponse, type index_d$1_ListDeletedFilesResponseNonNullableFields as ListDeletedFilesResponseNonNullableFields, type index_d$1_ListFilesOptions as ListFilesOptions, type index_d$1_ListFilesRequest as ListFilesRequest, type index_d$1_ListFilesResponse as ListFilesResponse, type index_d$1_ListFilesResponseNonNullableFields as ListFilesResponseNonNullableFields, index_d$1_MediaType as MediaType, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_Model3D as Model3D, Namespace$1 as Namespace, index_d$1_OperationStatus as OperationStatus, type index_d$1_OtherMedia as OtherMedia, type PagingMetadataV2$1 as PagingMetadataV2, type RestoreInfo$1 as RestoreInfo, RootFolder$1 as RootFolder, type index_d$1_SearchFilesOptions as SearchFilesOptions, type index_d$1_SearchFilesRequest as SearchFilesRequest, type index_d$1_SearchFilesResponse as SearchFilesResponse, type index_d$1_SearchFilesResponseNonNullableFields as SearchFilesResponseNonNullableFields, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, State$1 as State, index_d$1_StreamFormat as StreamFormat, type index_d$1_UpdateFileDescriptorRequest as UpdateFileDescriptorRequest, type index_d$1_UpdateFileDescriptorResponse as UpdateFileDescriptorResponse, type index_d$1_UpdateFileDescriptorResponseNonNullableFields as UpdateFileDescriptorResponseNonNullableFields, type index_d$1_UpdateFileRequest as UpdateFileRequest, type index_d$1_UpdateFileResponse as UpdateFileResponse, index_d$1_UploadProtocol as UploadProtocol, type index_d$1_VideoResolution as VideoResolution, WebhookIdentityType$1 as WebhookIdentityType, type index_d$1__publicOnFileDescriptorDeletedType as _publicOnFileDescriptorDeletedType, type index_d$1__publicOnFileDescriptorFileFailedType as _publicOnFileDescriptorFileFailedType, type index_d$1__publicOnFileDescriptorFileReadyType as _publicOnFileDescriptorFileReadyType, type index_d$1__publicOnFileDescriptorUpdatedType as _publicOnFileDescriptorUpdatedType, index_d$1_bulkDeleteFiles as bulkDeleteFiles, index_d$1_bulkImportFile as bulkImportFile, index_d$1_bulkImportFiles as bulkImportFiles, index_d$1_bulkRestoreFilesFromTrashBin as bulkRestoreFilesFromTrashBin, index_d$1_generateFileDownloadUrl as generateFileDownloadUrl, index_d$1_generateFileResumableUploadUrl as generateFileResumableUploadUrl, index_d$1_generateFileUploadUrl as generateFileUploadUrl, index_d$1_generateFilesDownloadUrl as generateFilesDownloadUrl, index_d$1_generateVideoStreamingUrl as generateVideoStreamingUrl, index_d$1_getFileDescriptor as getFileDescriptor, index_d$1_getFileDescriptors as getFileDescriptors, index_d$1_importFile as importFile, index_d$1_listDeletedFiles as listDeletedFiles, index_d$1_listFiles as listFiles, index_d$1_onFileDescriptorDeleted as onFileDescriptorDeleted, index_d$1_onFileDescriptorFileFailed as onFileDescriptorFileFailed, index_d$1_onFileDescriptorFileReady as onFileDescriptorFileReady, index_d$1_onFileDescriptorUpdated as onFileDescriptorUpdated, onFileDescriptorDeleted$1 as publicOnFileDescriptorDeleted, onFileDescriptorFileFailed$1 as publicOnFileDescriptorFileFailed, onFileDescriptorFileReady$1 as publicOnFileDescriptorFileReady, onFileDescriptorUpdated$1 as publicOnFileDescriptorUpdated, index_d$1_searchFiles as searchFiles, index_d$1_updateFileDescriptor as updateFileDescriptor };
|
|
3490
3836
|
}
|
|
3491
3837
|
|
|
3492
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
3493
|
-
interface HttpClient {
|
|
3494
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
3495
|
-
fetchWithAuth: typeof fetch;
|
|
3496
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
3497
|
-
}
|
|
3498
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
3499
|
-
type HttpResponse<T = any> = {
|
|
3500
|
-
data: T;
|
|
3501
|
-
status: number;
|
|
3502
|
-
statusText: string;
|
|
3503
|
-
headers: any;
|
|
3504
|
-
request?: any;
|
|
3505
|
-
};
|
|
3506
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
3507
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3508
|
-
url: string;
|
|
3509
|
-
data?: Data;
|
|
3510
|
-
params?: URLSearchParams;
|
|
3511
|
-
} & APIMetadata;
|
|
3512
|
-
type APIMetadata = {
|
|
3513
|
-
methodFqn?: string;
|
|
3514
|
-
entityFqdn?: string;
|
|
3515
|
-
packageName?: string;
|
|
3516
|
-
};
|
|
3517
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
3518
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
3519
|
-
__type: 'event-definition';
|
|
3520
|
-
type: Type;
|
|
3521
|
-
isDomainEvent?: boolean;
|
|
3522
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3523
|
-
__payload: Payload;
|
|
3524
|
-
};
|
|
3525
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
3526
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
3527
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
3528
|
-
|
|
3529
|
-
declare global {
|
|
3530
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3531
|
-
interface SymbolConstructor {
|
|
3532
|
-
readonly observable: symbol;
|
|
3533
|
-
}
|
|
3534
|
-
}
|
|
3535
|
-
|
|
3536
3838
|
interface Folder {
|
|
3537
3839
|
/** Folder ID. Generated when a folder is created in the Media Manager. */
|
|
3538
3840
|
_id?: string;
|
|
@@ -3544,12 +3846,12 @@ interface Folder {
|
|
|
3544
3846
|
* Date the folder was created.
|
|
3545
3847
|
* @readonly
|
|
3546
3848
|
*/
|
|
3547
|
-
_createdDate?: Date;
|
|
3849
|
+
_createdDate?: Date | null;
|
|
3548
3850
|
/**
|
|
3549
3851
|
* Date the folder was updated.
|
|
3550
3852
|
* @readonly
|
|
3551
3853
|
*/
|
|
3552
|
-
_updatedDate?: Date;
|
|
3854
|
+
_updatedDate?: Date | null;
|
|
3553
3855
|
/**
|
|
3554
3856
|
* State of the folder.
|
|
3555
3857
|
* @readonly
|
|
@@ -3770,7 +4072,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
3770
4072
|
/** ID of the entity associated with the event. */
|
|
3771
4073
|
entityId?: string;
|
|
3772
4074
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
3773
|
-
eventTime?: Date;
|
|
4075
|
+
eventTime?: Date | null;
|
|
3774
4076
|
/**
|
|
3775
4077
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
3776
4078
|
* (for example, GDPR).
|
|
@@ -3799,7 +4101,7 @@ interface EntityCreatedEvent {
|
|
|
3799
4101
|
entity?: string;
|
|
3800
4102
|
}
|
|
3801
4103
|
interface RestoreInfo {
|
|
3802
|
-
deletedDate?: Date;
|
|
4104
|
+
deletedDate?: Date | null;
|
|
3803
4105
|
}
|
|
3804
4106
|
interface EntityUpdatedEvent {
|
|
3805
4107
|
/**
|
|
@@ -3912,7 +4214,7 @@ interface EventMetadata extends BaseEventMetadata {
|
|
|
3912
4214
|
/** ID of the entity associated with the event. */
|
|
3913
4215
|
entityId?: string;
|
|
3914
4216
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
3915
|
-
eventTime?: Date;
|
|
4217
|
+
eventTime?: Date | null;
|
|
3916
4218
|
/**
|
|
3917
4219
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
3918
4220
|
* (for example, GDPR).
|
|
@@ -3996,12 +4298,12 @@ interface UpdateFolder {
|
|
|
3996
4298
|
* Date the folder was created.
|
|
3997
4299
|
* @readonly
|
|
3998
4300
|
*/
|
|
3999
|
-
_createdDate?: Date;
|
|
4301
|
+
_createdDate?: Date | null;
|
|
4000
4302
|
/**
|
|
4001
4303
|
* Date the folder was updated.
|
|
4002
4304
|
* @readonly
|
|
4003
4305
|
*/
|
|
4004
|
-
_updatedDate?: Date;
|
|
4306
|
+
_updatedDate?: Date | null;
|
|
4005
4307
|
/**
|
|
4006
4308
|
* State of the folder.
|
|
4007
4309
|
* @readonly
|
|
@@ -4157,15 +4459,15 @@ declare const onFolderDeleted$1: EventDefinition<FolderDeletedEnvelope, "wix.med
|
|
|
4157
4459
|
|
|
4158
4460
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
4159
4461
|
|
|
4160
|
-
declare const createFolder: BuildRESTFunction<typeof createFolder$1> & typeof createFolder$1
|
|
4161
|
-
declare const getFolder: BuildRESTFunction<typeof getFolder$1> & typeof getFolder$1
|
|
4162
|
-
declare const listFolders: BuildRESTFunction<typeof listFolders$1> & typeof listFolders$1
|
|
4163
|
-
declare const searchFolders: BuildRESTFunction<typeof searchFolders$1> & typeof searchFolders$1
|
|
4164
|
-
declare const updateFolder: BuildRESTFunction<typeof updateFolder$1> & typeof updateFolder$1
|
|
4165
|
-
declare const generateFolderDownloadUrl: BuildRESTFunction<typeof generateFolderDownloadUrl$1> & typeof generateFolderDownloadUrl$1
|
|
4166
|
-
declare const bulkDeleteFolders: BuildRESTFunction<typeof bulkDeleteFolders$1> & typeof bulkDeleteFolders$1
|
|
4167
|
-
declare const bulkRestoreFoldersFromTrashBin: BuildRESTFunction<typeof bulkRestoreFoldersFromTrashBin$1> & typeof bulkRestoreFoldersFromTrashBin$1
|
|
4168
|
-
declare const listDeletedFolders: BuildRESTFunction<typeof listDeletedFolders$1> & typeof listDeletedFolders$1
|
|
4462
|
+
declare const createFolder: MaybeContext<BuildRESTFunction<typeof createFolder$1> & typeof createFolder$1>;
|
|
4463
|
+
declare const getFolder: MaybeContext<BuildRESTFunction<typeof getFolder$1> & typeof getFolder$1>;
|
|
4464
|
+
declare const listFolders: MaybeContext<BuildRESTFunction<typeof listFolders$1> & typeof listFolders$1>;
|
|
4465
|
+
declare const searchFolders: MaybeContext<BuildRESTFunction<typeof searchFolders$1> & typeof searchFolders$1>;
|
|
4466
|
+
declare const updateFolder: MaybeContext<BuildRESTFunction<typeof updateFolder$1> & typeof updateFolder$1>;
|
|
4467
|
+
declare const generateFolderDownloadUrl: MaybeContext<BuildRESTFunction<typeof generateFolderDownloadUrl$1> & typeof generateFolderDownloadUrl$1>;
|
|
4468
|
+
declare const bulkDeleteFolders: MaybeContext<BuildRESTFunction<typeof bulkDeleteFolders$1> & typeof bulkDeleteFolders$1>;
|
|
4469
|
+
declare const bulkRestoreFoldersFromTrashBin: MaybeContext<BuildRESTFunction<typeof bulkRestoreFoldersFromTrashBin$1> & typeof bulkRestoreFoldersFromTrashBin$1>;
|
|
4470
|
+
declare const listDeletedFolders: MaybeContext<BuildRESTFunction<typeof listDeletedFolders$1> & typeof listDeletedFolders$1>;
|
|
4169
4471
|
|
|
4170
4472
|
type _publicOnFolderCreatedType = typeof onFolderCreated$1;
|
|
4171
4473
|
/** */
|