@wix/media 1.0.103 → 1.0.104

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.
@@ -1,221 +1,39 @@
1
- interface EnterpriseCategory {
2
- /**
3
- * Id of the category
4
- * @readonly
5
- */
6
- _id?: string;
7
- /** The display name that will be shown for the item */
8
- displayName?: string | null;
9
- /** Id of the parent category, will default to the account master category */
10
- parentCategoryId?: string | null;
11
- /** Sort order number of the category, will determine the order of the category with other categories under the same parent category */
12
- sortOrder?: number | null;
13
- /** Publish status of the category */
14
- publishStatus?: PublishStatus$1;
15
- /**
16
- * Date and time the category was created.
17
- * @readonly
18
- */
19
- _createdDate?: Date;
20
- /**
21
- * Date and time the category was updated.
22
- * @readonly
23
- */
24
- _updatedDate?: Date;
25
- }
26
- declare enum PublishStatus$1 {
27
- UNDEFINED = "UNDEFINED",
28
- UNPUBLISHED = "UNPUBLISHED",
29
- PUBLISHED = "PUBLISHED",
30
- WIX_ONLY = "WIX_ONLY"
31
- }
32
- interface EnterpriseCategoryTree {
33
- /** Category information */
34
- category?: EnterpriseCategory;
35
- /** Information about the sub categories */
36
- subCategories?: EnterpriseCategoryTree[];
37
- }
38
- interface EnterpriseOnboardingResponse {
39
- /** The enterprise category */
40
- category?: EnterpriseCategory;
41
- }
42
- interface GetMediaManagerCategoriesResponse {
43
- /** The category details */
44
- category?: EnterpriseCategoryTree;
45
- }
46
- interface IdentificationData$3 extends IdentificationDataIdOneOf$3 {
47
- /** ID of a site visitor that has not logged in to the site. */
48
- anonymousVisitorId?: string;
49
- /** ID of a site visitor that has logged in to the site. */
50
- memberId?: string;
51
- /** ID of a Wix user (site owner, contributor, etc.). */
52
- wixUserId?: string;
53
- /** ID of an app. */
54
- appId?: string;
55
- /** @readonly */
56
- identityType?: WebhookIdentityType$3;
57
- }
58
- /** @oneof */
59
- interface IdentificationDataIdOneOf$3 {
60
- /** ID of a site visitor that has not logged in to the site. */
61
- anonymousVisitorId?: string;
62
- /** ID of a site visitor that has logged in to the site. */
63
- memberId?: string;
64
- /** ID of a Wix user (site owner, contributor, etc.). */
65
- wixUserId?: string;
66
- /** ID of an app. */
67
- appId?: string;
68
- }
69
- declare enum WebhookIdentityType$3 {
70
- UNKNOWN = "UNKNOWN",
71
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
72
- MEMBER = "MEMBER",
73
- WIX_USER = "WIX_USER",
74
- APP = "APP"
75
- }
76
- interface EnterpriseOnboardingResponseNonNullableFields {
77
- category?: {
78
- _id: string;
79
- publishStatus: PublishStatus$1;
80
- };
81
- }
82
- interface GetMediaManagerCategoriesResponseNonNullableFields {
83
- category?: {
84
- category?: {
85
- _id: string;
86
- publishStatus: PublishStatus$1;
87
- };
88
- subCategories: NonNullable<GetMediaManagerCategoriesResponseNonNullableFields>['category'][];
89
- };
90
- }
91
- interface BaseEventMetadata$3 {
92
- /** App instance ID. */
93
- instanceId?: string | null;
94
- /** Event type. */
95
- eventType?: string;
96
- /** The identification type and identity data. */
97
- identity?: IdentificationData$3;
98
- }
99
- interface EventMetadata$3 extends BaseEventMetadata$3 {
100
- /**
101
- * Unique event ID.
102
- * Allows clients to ignore duplicate webhooks.
103
- */
104
- _id?: string;
105
- /**
106
- * Assumes actions are also always typed to an entity_type
107
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
108
- */
109
- entityFqdn?: string;
110
- /**
111
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
112
- * This is although the created/updated/deleted notion is duplication of the oneof types
113
- * Example: created/updated/deleted/started/completed/email_opened
114
- */
115
- slug?: string;
116
- /** ID of the entity associated with the event. */
117
- entityId?: string;
118
- /** Event timestamp. */
119
- eventTime?: Date;
120
- /**
121
- * Whether the event was triggered as a result of a privacy regulation application
122
- * (for example, GDPR).
123
- */
124
- triggeredByAnonymizeRequest?: boolean | null;
125
- /** If present, indicates the action that triggered the event. */
126
- originatedFrom?: string | null;
127
- /**
128
- * A sequence number defining the order of updates to the underlying entity.
129
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
130
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
131
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
132
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
133
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
134
- */
135
- entityEventSequence?: string | null;
136
- }
137
- interface EnterpriseCategoryCreatedEnvelope {
138
- entity: EnterpriseCategory;
139
- metadata: EventMetadata$3;
140
- }
141
- interface EnterpriseCategoryDeletedEnvelope {
142
- metadata: EventMetadata$3;
143
- }
144
- interface EnterpriseCategoryUpdatedEnvelope {
145
- entity: EnterpriseCategory;
146
- metadata: EventMetadata$3;
147
- }
148
- interface UpdateCategory {
149
- /**
150
- * Id of the category
151
- * @readonly
152
- */
153
- _id?: string;
154
- /** The display name that will be shown for the item */
155
- displayName?: string | null;
156
- /** Id of the parent category, will default to the account master category */
157
- parentCategoryId?: string | null;
158
- /** Sort order number of the category, will determine the order of the category with other categories under the same parent category */
159
- sortOrder?: number | null;
160
- /** Publish status of the category */
161
- publishStatus?: PublishStatus$1;
162
- /**
163
- * Date and time the category was created.
164
- * @readonly
165
- */
166
- _createdDate?: Date;
167
- /**
168
- * Date and time the category was updated.
169
- * @readonly
170
- */
171
- _updatedDate?: Date;
172
- }
173
- interface GetCategoryOptions {
174
- /** number of sub category levels */
175
- levels?: number | null;
176
- /** filter categories by publish statuses. When empty will return PUBLISHED and UNPUBLISHED */
177
- publishStatus?: PublishStatus$1;
178
- }
179
- interface EnterpriseOnboardingOptions {
180
- /** The account name of the organization - will be used as the organization category name */
181
- accountName?: string;
182
- }
183
-
184
- type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
185
- interface HttpClient$3 {
186
- request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
187
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
+ interface HttpClient {
3
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
188
6
  }
189
- type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
190
- type HttpResponse$3<T = any> = {
7
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
8
+ type HttpResponse<T = any> = {
191
9
  data: T;
192
10
  status: number;
193
11
  statusText: string;
194
12
  headers: any;
195
13
  request?: any;
196
14
  };
197
- type RequestOptions$3<_TResponse = any, Data = any> = {
15
+ type RequestOptions<_TResponse = any, Data = any> = {
198
16
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
199
17
  url: string;
200
18
  data?: Data;
201
19
  params?: URLSearchParams;
202
- } & APIMetadata$3;
203
- type APIMetadata$3 = {
20
+ } & APIMetadata;
21
+ type APIMetadata = {
204
22
  methodFqn?: string;
205
23
  entityFqdn?: string;
206
24
  packageName?: string;
207
25
  };
208
- type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
209
- type EventDefinition$3<Payload = unknown, Type extends string = string> = {
26
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
27
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
210
28
  __type: 'event-definition';
211
29
  type: Type;
212
30
  isDomainEvent?: boolean;
213
31
  transformations?: (envelope: unknown) => Payload;
214
32
  __payload: Payload;
215
33
  };
216
- declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
217
- type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
218
- type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
34
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
35
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
36
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
219
37
 
220
38
  declare global {
221
39
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -224,37 +42,19 @@ declare global {
224
42
  }
225
43
  }
226
44
 
227
- declare function createCategory$1(httpClient: HttpClient$3): (category: EnterpriseCategory) => Promise<EnterpriseCategory & {
228
- _id: string;
229
- publishStatus: PublishStatus$1;
230
- }>;
231
- declare function deleteCategory$1(httpClient: HttpClient$3): (categoryId: string) => Promise<void>;
232
- declare function updateCategory$1(httpClient: HttpClient$3): (_id: string, category: UpdateCategory) => Promise<EnterpriseCategory & {
233
- _id: string;
234
- publishStatus: PublishStatus$1;
235
- }>;
236
- declare function getCategory$1(httpClient: HttpClient$3): (categoryId: string, options?: GetCategoryOptions) => Promise<EnterpriseCategoryTree & {
237
- category?: {
238
- _id: string;
239
- publishStatus: PublishStatus$1;
240
- } | undefined;
241
- subCategories: (any | undefined)[];
242
- }>;
243
- declare function enterpriseOnboarding$1(httpClient: HttpClient$3): (accountId: string, options?: EnterpriseOnboardingOptions) => Promise<EnterpriseOnboardingResponse & EnterpriseOnboardingResponseNonNullableFields>;
244
- declare function getMediaManagerCategories$1(httpClient: HttpClient$3): () => Promise<GetMediaManagerCategoriesResponse & GetMediaManagerCategoriesResponseNonNullableFields>;
245
- declare const onEnterpriseCategoryCreated$1: EventDefinition$3<EnterpriseCategoryCreatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_category_created">;
246
- declare const onEnterpriseCategoryDeleted$1: EventDefinition$3<EnterpriseCategoryDeletedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_category_deleted">;
247
- declare const onEnterpriseCategoryUpdated$1: EventDefinition$3<EnterpriseCategoryUpdatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_category_updated">;
45
+ declare function createRESTModule$3<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
248
46
 
249
- declare const createCategory: BuildRESTFunction$3<typeof createCategory$1>;
250
- declare const deleteCategory: BuildRESTFunction$3<typeof deleteCategory$1>;
251
- declare const updateCategory: BuildRESTFunction$3<typeof updateCategory$1>;
252
- declare const getCategory: BuildRESTFunction$3<typeof getCategory$1>;
253
- declare const enterpriseOnboarding: BuildRESTFunction$3<typeof enterpriseOnboarding$1>;
254
- declare const getMediaManagerCategories: BuildRESTFunction$3<typeof getMediaManagerCategories$1>;
255
- declare const onEnterpriseCategoryCreated: BuildEventDefinition$3<typeof onEnterpriseCategoryCreated$1>;
256
- declare const onEnterpriseCategoryDeleted: BuildEventDefinition$3<typeof onEnterpriseCategoryDeleted$1>;
257
- declare const onEnterpriseCategoryUpdated: BuildEventDefinition$3<typeof onEnterpriseCategoryUpdated$1>;
47
+ declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
48
+
49
+ declare const createCategory: ReturnType<typeof createRESTModule$3<typeof publicCreateCategory>>;
50
+ declare const deleteCategory: ReturnType<typeof createRESTModule$3<typeof publicDeleteCategory>>;
51
+ declare const updateCategory: ReturnType<typeof createRESTModule$3<typeof publicUpdateCategory>>;
52
+ declare const getCategory: ReturnType<typeof createRESTModule$3<typeof publicGetCategory>>;
53
+ declare const enterpriseOnboarding: ReturnType<typeof createRESTModule$3<typeof publicEnterpriseOnboarding>>;
54
+ declare const getMediaManagerCategories: ReturnType<typeof createRESTModule$3<typeof publicGetMediaManagerCategories>>;
55
+ declare const onEnterpriseCategoryCreated: ReturnType<typeof createEventModule$3<typeof publicOnEnterpriseCategoryCreated>>;
56
+ declare const onEnterpriseCategoryDeleted: ReturnType<typeof createEventModule$3<typeof publicOnEnterpriseCategoryDeleted>>;
57
+ declare const onEnterpriseCategoryUpdated: ReturnType<typeof createEventModule$3<typeof publicOnEnterpriseCategoryUpdated>>;
258
58
 
259
59
  declare const context$3_createCategory: typeof createCategory;
260
60
  declare const context$3_deleteCategory: typeof deleteCategory;
@@ -269,754 +69,25 @@ declare namespace context$3 {
269
69
  export { context$3_createCategory as createCategory, context$3_deleteCategory as deleteCategory, context$3_enterpriseOnboarding as enterpriseOnboarding, context$3_getCategory as getCategory, context$3_getMediaManagerCategories as getMediaManagerCategories, context$3_onEnterpriseCategoryCreated as onEnterpriseCategoryCreated, context$3_onEnterpriseCategoryDeleted as onEnterpriseCategoryDeleted, context$3_onEnterpriseCategoryUpdated as onEnterpriseCategoryUpdated, context$3_updateCategory as updateCategory };
270
70
  }
271
71
 
272
- /**
273
- * Duration for video fits better if there will be type specific media item.. however, is it ok to implement
274
- * an additional one of field called details?
275
- */
276
- interface EnterpriseMediaItem {
277
- /**
278
- * Id of the item in public media
279
- * @readonly
280
- */
281
- _id?: string;
282
- /**
283
- * Media type of the item
284
- * @readonly
285
- */
286
- mediaType?: MediaType$1;
287
- /**
288
- * Size of the uploaded file in bytes.
289
- * @readonly
290
- */
291
- sizeInBytes?: string | null;
292
- /** The item title, part of searchable fields */
293
- title?: string | null;
294
- /**
295
- * The aspect ratio of the item
296
- * An object containing urls for different views of the item
297
- * @readonly
298
- */
299
- assets?: ItemAssets;
300
- /** Tags describing the image, part of searchable fields */
301
- displayTags?: string[] | null;
302
- /** Tags for internal client use, part of searchable fields */
303
- internalTags?: string[] | null;
304
- /**
305
- * Tags for filtering items in the search
306
- * @readonly
307
- */
308
- systemTags?: string[] | null;
309
- /**
310
- * Category ids this item belongs to
311
- * @readonly
312
- */
313
- parentCategoryIds?: string[] | null;
314
- /** Status of the item */
315
- publishStatus?: PublishStatus;
316
- /**
317
- * Date and time the item was created.
318
- * @readonly
319
- */
320
- _createdDate?: Date;
321
- /**
322
- * Date and time the item was updated.
323
- * @readonly
324
- */
325
- _updatedDate?: Date;
326
- /**
327
- * An internal id used with different wix media systems
328
- * @readonly
329
- */
330
- internalId?: string | null;
331
- }
332
- declare enum MediaType$1 {
333
- MIXED = "MIXED",
334
- IMAGE = "IMAGE",
335
- VIDEO = "VIDEO",
336
- AUDIO = "AUDIO",
337
- DOCUMENT = "DOCUMENT",
338
- VECTOR = "VECTOR",
339
- ARCHIVE = "ARCHIVE",
340
- MODEL3D = "MODEL3D"
341
- }
342
- interface ItemAssets extends ItemAssetsAssetsOneOf {
343
- /** Assets for image media type */
344
- image?: string;
345
- /** Assets for video media type */
346
- video?: string;
347
- /** Assets for vector media type */
348
- vector?: string;
349
- /** Assets for audio media type */
350
- audio?: string;
351
- /** Assets for document media type */
352
- document?: string;
353
- /** Information about the archive. */
354
- archive?: Archive$1;
355
- /** Information about the 3D Model. */
356
- model3d?: Model3D$1;
357
- }
358
- /** @oneof */
359
- interface ItemAssetsAssetsOneOf {
360
- /** Assets for image media type */
361
- image?: string;
362
- /** Assets for video media type */
363
- video?: string;
364
- /** Assets for vector media type */
365
- vector?: string;
366
- /** Assets for audio media type */
367
- audio?: string;
368
- /** Assets for document media type */
369
- document?: string;
370
- /** Information about the archive. */
371
- archive?: Archive$1;
372
- /** Information about the 3D Model. */
373
- model3d?: Model3D$1;
374
- }
375
- interface Archive$1 {
376
- /** WixMedia ID. */
377
- _id?: string;
378
- /** Archive URL. */
379
- url?: string;
380
- /**
381
- * Archive URL expiration date (when relevant).
382
- * @readonly
383
- */
384
- urlExpirationDate?: Date;
385
- /** Archive size in bytes. */
386
- sizeInBytes?: string | null;
387
- /** Archive filename. */
388
- filename?: string | null;
389
- }
390
- interface Model3D$1 {
391
- /** WixMedia 3D ID. */
392
- _id?: string;
393
- /** 3D URL. */
394
- url?: string;
395
- /** 3D thumbnail Image */
396
- thumbnail?: string;
397
- /** 3D alt text. */
398
- altText?: string | null;
399
- /**
400
- * 3D URL expiration date (when relevant).
401
- * @readonly
402
- */
403
- urlExpirationDate?: Date;
404
- /**
405
- * 3D filename.
406
- * @readonly
407
- */
408
- filename?: string | null;
409
- /**
410
- * 3D size in bytes.
411
- * @readonly
412
- */
413
- sizeInBytes?: string | null;
414
- }
415
- declare enum PublishStatus {
416
- UNDEFINED = "UNDEFINED",
417
- UNPUBLISHED = "UNPUBLISHED",
418
- PUBLISHED = "PUBLISHED",
419
- WIX_ONLY = "WIX_ONLY"
420
- }
421
- interface ItemCategoriesChanged {
422
- /** A list of the current item categories */
423
- itemCategoryIds?: string[] | null;
424
- /** A list of the categories that where unlinked from the item */
425
- unlinkedCategoryIds?: string[] | null;
426
- /** A list of the categories that where linked to the item */
427
- linkedCategoryIds?: string[] | null;
428
- /** The full updated item information */
429
- entity?: EnterpriseMediaItem;
430
- }
431
- interface GenerateFileUploadUrlResponse$1 {
432
- /** The upload url to upload the file to */
433
- uploadUrl?: string;
434
- }
435
- interface ImportFileResponse$1 {
436
- /**
437
- * Partial item - without the assets
438
- * At this stage of implementation only the 'internal_id' will be filled
439
- * all other required values will be fake values
440
- */
441
- item?: EnterpriseMediaItem;
442
- }
443
- interface Search extends SearchPagingMethodOneOf {
444
- /** Pointer to page of results using offset. Can not be used together with 'cursor_paging' */
445
- paging?: Paging;
446
- /** A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf) */
447
- filter?: Record<string, any> | null;
448
- /** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] */
449
- sort?: Sorting$2[];
450
- /** free text to match in searchable fields */
451
- search?: SearchDetails;
452
- }
453
- /** @oneof */
454
- interface SearchPagingMethodOneOf {
455
- /** Pointer to page of results using offset. Can not be used together with 'cursor_paging' */
456
- paging?: Paging;
457
- }
458
- interface Sorting$2 {
459
- /** Name of the field to sort by. */
460
- fieldName?: string;
461
- /** Sort order. */
462
- order?: SortOrder$2;
463
- }
464
- declare enum SortOrder$2 {
465
- ASC = "ASC",
466
- DESC = "DESC"
467
- }
468
- interface SearchDetails {
469
- /** search term or expression */
470
- expression?: string | null;
471
- }
472
- interface Paging {
473
- /** Number of items to load. */
474
- limit?: number | null;
475
- /** Number of items to skip in the current sort order. */
476
- offset?: number | null;
477
- }
478
- interface SearchItemsResponse {
479
- /** A list of items matching the request */
480
- items?: EnterpriseMediaItem[];
481
- /** Information about the search results. */
482
- pagingMetadata?: PagingMetadataV2$2;
483
- }
484
- interface PagingMetadataV2$2 {
485
- /** Number of items returned in the response. */
486
- count?: number | null;
487
- /** Offset that was requested. */
488
- offset?: number | null;
489
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
490
- total?: number | null;
491
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
492
- cursors?: Cursors$2;
493
- }
494
- interface Cursors$2 {
495
- /** Cursor pointing to next page in the list of results. */
496
- next?: string | null;
497
- }
498
- interface UpdateItemRequest {
499
- /** The category object that will be created */
500
- item: EnterpriseMediaItem;
501
- }
502
- interface PublishStatusChanged {
503
- /** The new item status */
504
- publishStatus?: PublishStatus;
505
- /** The full updated item information */
506
- entity?: EnterpriseMediaItem;
507
- }
508
- interface BulkUpdateItemResponse {
509
- /** Requests to update individual item */
510
- results?: BulkItemUpdateResult[];
511
- /** Metadata of the operation */
512
- bulkActionMetadata?: BulkActionMetadata$1;
513
- }
514
- interface BulkItemUpdateResult {
515
- /** updated item metadata */
516
- itemMetadata?: ItemMetadata$1;
517
- /** only returned if operation was successful and if returnEntity flag was on */
518
- item?: EnterpriseMediaItem;
519
- }
520
- interface ItemMetadata$1 {
521
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
522
- _id?: string | null;
523
- /** Index of the item within the request array. Allows for correlation between request and response items. */
524
- originalIndex?: number;
525
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
526
- success?: boolean;
527
- /** Details about the error in case of failure. */
528
- error?: ApplicationError$1;
529
- }
530
- interface ApplicationError$1 {
531
- /** Error code. */
532
- code?: string;
533
- /** Description of the error. */
534
- description?: string;
535
- /** Data related to the error. */
536
- data?: Record<string, any> | null;
537
- }
538
- interface BulkActionMetadata$1 {
539
- /** Number of items that were successfully processed. */
540
- totalSuccesses?: number;
541
- /** Number of items that couldn't be processed. */
542
- totalFailures?: number;
543
- /** Number of failures without details because detailed failure threshold was exceeded. */
544
- undetailedFailures?: number;
545
- }
546
- interface LinkItemToCategoriesResponse {
547
- /** The linked category ids */
548
- linkedCategoryIds?: string[] | null;
549
- }
550
- interface UnlinkItemFromCategoriesResponse {
551
- /** The unlinked category ids */
552
- unlinkedCategoryIds?: string[] | null;
553
- }
554
- interface OverwriteItemCategoriesResponse {
555
- /** The linked category ids */
556
- linkedCategoryIds?: string[] | null;
557
- /** The unlinked category ids */
558
- unlinkedCategoryIds?: string[] | null;
559
- }
560
- interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
561
- /** ID of a site visitor that has not logged in to the site. */
562
- anonymousVisitorId?: string;
563
- /** ID of a site visitor that has logged in to the site. */
564
- memberId?: string;
565
- /** ID of a Wix user (site owner, contributor, etc.). */
566
- wixUserId?: string;
567
- /** ID of an app. */
568
- appId?: string;
569
- /** @readonly */
570
- identityType?: WebhookIdentityType$2;
571
- }
572
- /** @oneof */
573
- interface IdentificationDataIdOneOf$2 {
574
- /** ID of a site visitor that has not logged in to the site. */
575
- anonymousVisitorId?: string;
576
- /** ID of a site visitor that has logged in to the site. */
577
- memberId?: string;
578
- /** ID of a Wix user (site owner, contributor, etc.). */
579
- wixUserId?: string;
580
- /** ID of an app. */
581
- appId?: string;
582
- }
583
- declare enum WebhookIdentityType$2 {
584
- UNKNOWN = "UNKNOWN",
585
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
586
- MEMBER = "MEMBER",
587
- WIX_USER = "WIX_USER",
588
- APP = "APP"
589
- }
590
- interface GenerateFileUploadUrlResponseNonNullableFields$1 {
591
- uploadUrl: string;
592
- }
593
- interface ImportFileResponseNonNullableFields$1 {
594
- item?: {
595
- _id: string;
596
- mediaType: MediaType$1;
597
- assets?: {
598
- image: string;
599
- video: string;
600
- vector: string;
601
- audio: string;
602
- document: string;
603
- archive?: {
604
- _id: string;
605
- url: string;
606
- };
607
- model3d?: {
608
- _id: string;
609
- url: string;
610
- thumbnail: string;
611
- };
612
- };
613
- publishStatus: PublishStatus;
614
- };
615
- }
616
- interface SearchItemsResponseNonNullableFields {
617
- items: {
618
- _id: string;
619
- mediaType: MediaType$1;
620
- assets?: {
621
- image: string;
622
- video: string;
623
- vector: string;
624
- audio: string;
625
- document: string;
626
- archive?: {
627
- _id: string;
628
- url: string;
629
- };
630
- model3d?: {
631
- _id: string;
632
- url: string;
633
- thumbnail: string;
634
- };
635
- };
636
- publishStatus: PublishStatus;
637
- }[];
638
- }
639
- interface BulkUpdateItemResponseNonNullableFields {
640
- results: {
641
- itemMetadata?: {
642
- originalIndex: number;
643
- success: boolean;
644
- error?: {
645
- code: string;
646
- description: string;
647
- };
648
- };
649
- item?: {
650
- _id: string;
651
- mediaType: MediaType$1;
652
- assets?: {
653
- image: string;
654
- video: string;
655
- vector: string;
656
- audio: string;
657
- document: string;
658
- archive?: {
659
- _id: string;
660
- url: string;
661
- };
662
- model3d?: {
663
- _id: string;
664
- url: string;
665
- thumbnail: string;
666
- };
667
- };
668
- publishStatus: PublishStatus;
669
- };
670
- }[];
671
- bulkActionMetadata?: {
672
- totalSuccesses: number;
673
- totalFailures: number;
674
- undetailedFailures: number;
675
- };
676
- }
677
- interface BaseEventMetadata$2 {
678
- /** App instance ID. */
679
- instanceId?: string | null;
680
- /** Event type. */
681
- eventType?: string;
682
- /** The identification type and identity data. */
683
- identity?: IdentificationData$2;
684
- }
685
- interface EventMetadata$2 extends BaseEventMetadata$2 {
686
- /**
687
- * Unique event ID.
688
- * Allows clients to ignore duplicate webhooks.
689
- */
690
- _id?: string;
691
- /**
692
- * Assumes actions are also always typed to an entity_type
693
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
694
- */
695
- entityFqdn?: string;
696
- /**
697
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
698
- * This is although the created/updated/deleted notion is duplication of the oneof types
699
- * Example: created/updated/deleted/started/completed/email_opened
700
- */
701
- slug?: string;
702
- /** ID of the entity associated with the event. */
703
- entityId?: string;
704
- /** Event timestamp. */
705
- eventTime?: Date;
706
- /**
707
- * Whether the event was triggered as a result of a privacy regulation application
708
- * (for example, GDPR).
709
- */
710
- triggeredByAnonymizeRequest?: boolean | null;
711
- /** If present, indicates the action that triggered the event. */
712
- originatedFrom?: string | null;
713
- /**
714
- * A sequence number defining the order of updates to the underlying entity.
715
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
716
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
717
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
718
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
719
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
720
- */
721
- entityEventSequence?: string | null;
722
- }
723
- interface EnterpriseItemCreatedEnvelope {
724
- entity: EnterpriseMediaItem;
725
- metadata: EventMetadata$2;
726
- }
727
- interface EnterpriseItemUpdatedEnvelope {
728
- entity: EnterpriseMediaItem;
729
- metadata: EventMetadata$2;
730
- }
731
- interface EnterpriseItemItemCategoriesChangedEnvelope {
732
- data: ItemCategoriesChanged;
733
- metadata: EventMetadata$2;
734
- }
735
- interface EnterpriseItemPublishStatusChangedEnvelope {
736
- data: PublishStatusChanged;
737
- metadata: EventMetadata$2;
738
- }
739
- interface ItemUploadCallbackOptions {
740
- /** The item id of the created item */
741
- itemId?: string;
742
- /** The callback passed to the upload endpoint */
743
- callbackToken?: string;
744
- }
745
- interface GenerateFileUploadUrlOptions$1 {
746
- /** The uploaded original file name including the extension */
747
- fileName?: string;
748
- /** The file mime-type - will be used to identify the type of media */
749
- contentType?: string;
750
- /** The file size in bytes */
751
- sizeInBytes?: number;
752
- /**
753
- * An optional list of categories to link the created item to
754
- * The item will be linked to the account category automatically
755
- */
756
- categoryIds?: string[] | null;
757
- }
758
- interface ImportFileOptions$1 {
759
- /** The uploaded original file name including the extension - will be used as the initial display name */
760
- fileName?: string | null;
761
- /** The file mime-type - will be used to identify the type of media */
762
- contentType?: string | null;
763
- /** The file size in bytes */
764
- sizeInBytes?: number | null;
765
- /**
766
- * An optional list of categories to link the created item to
767
- * The item will be linked to the account category automatically
768
- */
769
- categoryIds?: string[] | null;
770
- /** The media type of the uploaded file */
771
- mediaType?: MediaType$1;
772
- /**
773
- * A unique identifier of the client that imported the file
774
- * This information will exist in the system_tags field prefixed by '_external_uploader:{uploader_system_tag}'
775
- */
776
- uploaderSystemTag?: string | null;
777
- /**
778
- * An additional container for external information
779
- * mostly used to pass identifying information of related entities in external services
780
- * This information will exist in the system_tags field prefixed by '_external_uploader_info:{uploader_info_system_tag}'
781
- */
782
- uploaderInfoSystemTag?: string | null;
783
- }
784
- interface SearchItemsOptions {
785
- /** Items search query */
786
- query?: Search;
787
- }
788
- interface QueryOffsetResult {
789
- currentPage: number | undefined;
790
- totalPages: number | undefined;
791
- totalCount: number | undefined;
792
- hasNext: () => boolean;
793
- hasPrev: () => boolean;
794
- length: number;
795
- pageSize: number;
796
- }
797
- interface ItemsQueryResult extends QueryOffsetResult {
798
- items: EnterpriseMediaItem[];
799
- query: ItemsQueryBuilder;
800
- next: () => Promise<ItemsQueryResult>;
801
- prev: () => Promise<ItemsQueryResult>;
802
- }
803
- interface ItemsQueryBuilder {
804
- /** @param propertyName - Property whose value is compared with `value`.
805
- * @param value - Value to compare against.
806
- * @documentationMaturity preview
807
- */
808
- eq: (propertyName: 'sizeInBytes' | 'title' | '_createdDate' | '_updatedDate', value: any) => ItemsQueryBuilder;
809
- /** @param propertyName - Property whose value is compared with `values`.
810
- * @param values - List of values to compare against.
811
- * @documentationMaturity preview
812
- */
813
- hasSome: (propertyName: 'parentCategoryIds', value: any[]) => ItemsQueryBuilder;
814
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
815
- * @documentationMaturity preview
816
- */
817
- ascending: (...propertyNames: Array<'sizeInBytes' | 'title' | '_createdDate' | '_updatedDate'>) => ItemsQueryBuilder;
818
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
819
- * @documentationMaturity preview
820
- */
821
- descending: (...propertyNames: Array<'sizeInBytes' | 'title' | '_createdDate' | '_updatedDate'>) => ItemsQueryBuilder;
822
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
823
- * @documentationMaturity preview
824
- */
825
- limit: (limit: number) => ItemsQueryBuilder;
826
- /** @param skip - Number of items to skip in the query results before returning the results.
827
- * @documentationMaturity preview
828
- */
829
- skip: (skip: number) => ItemsQueryBuilder;
830
- /** @documentationMaturity preview */
831
- find: () => Promise<ItemsQueryResult>;
832
- }
833
- interface UpdateItem {
834
- /**
835
- * Id of the item in public media
836
- * @readonly
837
- */
838
- _id?: string;
839
- /**
840
- * Media type of the item
841
- * @readonly
842
- */
843
- mediaType?: MediaType$1;
844
- /**
845
- * Size of the uploaded file in bytes.
846
- * @readonly
847
- */
848
- sizeInBytes?: string | null;
849
- /** The item title, part of searchable fields */
850
- title?: string | null;
851
- /**
852
- * The aspect ratio of the item
853
- * An object containing urls for different views of the item
854
- * @readonly
855
- */
856
- assets?: ItemAssets;
857
- /** Tags describing the image, part of searchable fields */
858
- displayTags?: string[] | null;
859
- /** Tags for internal client use, part of searchable fields */
860
- internalTags?: string[] | null;
861
- /**
862
- * Tags for filtering items in the search
863
- * @readonly
864
- */
865
- systemTags?: string[] | null;
866
- /**
867
- * Category ids this item belongs to
868
- * @readonly
869
- */
870
- parentCategoryIds?: string[] | null;
871
- /** Status of the item */
872
- publishStatus?: PublishStatus;
873
- /**
874
- * Date and time the item was created.
875
- * @readonly
876
- */
877
- _createdDate?: Date;
878
- /**
879
- * Date and time the item was updated.
880
- * @readonly
881
- */
882
- _updatedDate?: Date;
883
- /**
884
- * An internal id used with different wix media systems
885
- * @readonly
886
- */
887
- internalId?: string | null;
888
- }
889
- interface BulkUpdateItemOptions {
890
- /** Should the response return the updated item */
891
- returnEntity?: boolean;
892
- }
893
- interface LinkItemToCategoriesOptions {
894
- /** The category ids that the item will be linked to */
895
- categoryIds?: string[];
896
- }
897
- interface UnlinkItemFromCategoriesOptions {
898
- /** The category ids that the item will be unlinked from */
899
- categoryIds?: string[];
900
- }
901
- interface OverwriteItemCategoriesOptions {
902
- /** The category ids the item will be linked to after this operation */
903
- categoryIds?: string[];
904
- }
905
-
906
- type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
907
- interface HttpClient$2 {
908
- request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
909
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
910
- }
911
- type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
912
- type HttpResponse$2<T = any> = {
913
- data: T;
914
- status: number;
915
- statusText: string;
916
- headers: any;
917
- request?: any;
918
- };
919
- type RequestOptions$2<_TResponse = any, Data = any> = {
920
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
921
- url: string;
922
- data?: Data;
923
- params?: URLSearchParams;
924
- } & APIMetadata$2;
925
- type APIMetadata$2 = {
926
- methodFqn?: string;
927
- entityFqdn?: string;
928
- packageName?: string;
929
- };
930
- type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
931
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
932
- __type: 'event-definition';
933
- type: Type;
934
- isDomainEvent?: boolean;
935
- transformations?: (envelope: unknown) => Payload;
936
- __payload: Payload;
937
- };
938
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
939
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
940
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
941
-
942
- declare global {
943
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
944
- interface SymbolConstructor {
945
- readonly observable: symbol;
946
- }
947
- }
72
+ declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
948
73
 
949
- declare function itemUploadCallback$1(httpClient: HttpClient$2): (options?: ItemUploadCallbackOptions) => Promise<void>;
950
- declare function generateFileUploadUrl$3(httpClient: HttpClient$2): (options?: GenerateFileUploadUrlOptions$1) => Promise<GenerateFileUploadUrlResponse$1 & GenerateFileUploadUrlResponseNonNullableFields$1>;
951
- declare function importFile$3(httpClient: HttpClient$2): (url: string, options?: ImportFileOptions$1) => Promise<ImportFileResponse$1 & ImportFileResponseNonNullableFields$1>;
952
- declare function searchItems$1(httpClient: HttpClient$2): (options?: SearchItemsOptions) => Promise<SearchItemsResponse & SearchItemsResponseNonNullableFields>;
953
- declare function queryItems$1(httpClient: HttpClient$2): () => ItemsQueryBuilder;
954
- declare function updateItem$1(httpClient: HttpClient$2): (_id: string, item: UpdateItem) => Promise<EnterpriseMediaItem & {
955
- _id: string;
956
- mediaType: MediaType$1;
957
- assets?: {
958
- image: string;
959
- video: string;
960
- vector: string;
961
- audio: string;
962
- document: string;
963
- archive?: {
964
- _id: string;
965
- url: string;
966
- } | undefined;
967
- model3d?: {
968
- _id: string;
969
- url: string;
970
- thumbnail: string;
971
- } | undefined;
972
- } | undefined;
973
- publishStatus: PublishStatus;
974
- }>;
975
- declare function bulkUpdateItem$1(httpClient: HttpClient$2): (updateItemRequests: UpdateItemRequest[], options?: BulkUpdateItemOptions) => Promise<BulkUpdateItemResponse & BulkUpdateItemResponseNonNullableFields>;
976
- declare function getItem$1(httpClient: HttpClient$2): (itemId: string) => Promise<EnterpriseMediaItem & {
977
- _id: string;
978
- mediaType: MediaType$1;
979
- assets?: {
980
- image: string;
981
- video: string;
982
- vector: string;
983
- audio: string;
984
- document: string;
985
- archive?: {
986
- _id: string;
987
- url: string;
988
- } | undefined;
989
- model3d?: {
990
- _id: string;
991
- url: string;
992
- thumbnail: string;
993
- } | undefined;
994
- } | undefined;
995
- publishStatus: PublishStatus;
996
- }>;
997
- declare function linkItemToCategories$1(httpClient: HttpClient$2): (itemId: string, options?: LinkItemToCategoriesOptions) => Promise<LinkItemToCategoriesResponse>;
998
- declare function unlinkItemFromCategories$1(httpClient: HttpClient$2): (itemId: string, options?: UnlinkItemFromCategoriesOptions) => Promise<UnlinkItemFromCategoriesResponse>;
999
- declare function overwriteItemCategories$1(httpClient: HttpClient$2): (itemId: string, options?: OverwriteItemCategoriesOptions) => Promise<OverwriteItemCategoriesResponse>;
1000
- declare const onEnterpriseItemCreated$1: EventDefinition$2<EnterpriseItemCreatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_created">;
1001
- declare const onEnterpriseItemUpdated$1: EventDefinition$2<EnterpriseItemUpdatedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_updated">;
1002
- declare const onEnterpriseItemItemCategoriesChanged$1: EventDefinition$2<EnterpriseItemItemCategoriesChangedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_item_categories_changed">;
1003
- declare const onEnterpriseItemPublishStatusChanged$1: EventDefinition$2<EnterpriseItemPublishStatusChangedEnvelope, "wix.media.enterprise_public_media.v1.enterprise_item_publish_status_changed">;
74
+ declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1004
75
 
1005
- declare const itemUploadCallback: BuildRESTFunction$2<typeof itemUploadCallback$1>;
1006
- declare const generateFileUploadUrl$2: BuildRESTFunction$2<typeof generateFileUploadUrl$3>;
1007
- declare const importFile$2: BuildRESTFunction$2<typeof importFile$3>;
1008
- declare const searchItems: BuildRESTFunction$2<typeof searchItems$1>;
1009
- declare const queryItems: BuildRESTFunction$2<typeof queryItems$1>;
1010
- declare const updateItem: BuildRESTFunction$2<typeof updateItem$1>;
1011
- declare const bulkUpdateItem: BuildRESTFunction$2<typeof bulkUpdateItem$1>;
1012
- declare const getItem: BuildRESTFunction$2<typeof getItem$1>;
1013
- declare const linkItemToCategories: BuildRESTFunction$2<typeof linkItemToCategories$1>;
1014
- declare const unlinkItemFromCategories: BuildRESTFunction$2<typeof unlinkItemFromCategories$1>;
1015
- declare const overwriteItemCategories: BuildRESTFunction$2<typeof overwriteItemCategories$1>;
1016
- declare const onEnterpriseItemCreated: BuildEventDefinition$2<typeof onEnterpriseItemCreated$1>;
1017
- declare const onEnterpriseItemUpdated: BuildEventDefinition$2<typeof onEnterpriseItemUpdated$1>;
1018
- declare const onEnterpriseItemItemCategoriesChanged: BuildEventDefinition$2<typeof onEnterpriseItemItemCategoriesChanged$1>;
1019
- declare const onEnterpriseItemPublishStatusChanged: BuildEventDefinition$2<typeof onEnterpriseItemPublishStatusChanged$1>;
76
+ declare const itemUploadCallback: ReturnType<typeof createRESTModule$2<typeof publicItemUploadCallback>>;
77
+ declare const generateFileUploadUrl$1: ReturnType<typeof createRESTModule$2<typeof publicGenerateFileUploadUrl>>;
78
+ declare const importFile$1: ReturnType<typeof createRESTModule$2<typeof publicImportFile>>;
79
+ declare const searchItems: ReturnType<typeof createRESTModule$2<typeof publicSearchItems>>;
80
+ declare const queryItems: ReturnType<typeof createRESTModule$2<typeof publicQueryItems>>;
81
+ declare const updateItem: ReturnType<typeof createRESTModule$2<typeof publicUpdateItem>>;
82
+ declare const bulkUpdateItem: ReturnType<typeof createRESTModule$2<typeof publicBulkUpdateItem>>;
83
+ declare const getItem: ReturnType<typeof createRESTModule$2<typeof publicGetItem>>;
84
+ declare const linkItemToCategories: ReturnType<typeof createRESTModule$2<typeof publicLinkItemToCategories>>;
85
+ declare const unlinkItemFromCategories: ReturnType<typeof createRESTModule$2<typeof publicUnlinkItemFromCategories>>;
86
+ declare const overwriteItemCategories: ReturnType<typeof createRESTModule$2<typeof publicOverwriteItemCategories>>;
87
+ declare const onEnterpriseItemCreated: ReturnType<typeof createEventModule$2<typeof publicOnEnterpriseItemCreated>>;
88
+ declare const onEnterpriseItemUpdated: ReturnType<typeof createEventModule$2<typeof publicOnEnterpriseItemUpdated>>;
89
+ declare const onEnterpriseItemItemCategoriesChanged: ReturnType<typeof createEventModule$2<typeof publicOnEnterpriseItemItemCategoriesChanged>>;
90
+ declare const onEnterpriseItemPublishStatusChanged: ReturnType<typeof createEventModule$2<typeof publicOnEnterpriseItemPublishStatusChanged>>;
1020
91
 
1021
92
  declare const context$2_bulkUpdateItem: typeof bulkUpdateItem;
1022
93
  declare const context$2_getItem: typeof getItem;
@@ -1032,1462 +103,33 @@ declare const context$2_searchItems: typeof searchItems;
1032
103
  declare const context$2_unlinkItemFromCategories: typeof unlinkItemFromCategories;
1033
104
  declare const context$2_updateItem: typeof updateItem;
1034
105
  declare namespace context$2 {
1035
- export { context$2_bulkUpdateItem as bulkUpdateItem, generateFileUploadUrl$2 as generateFileUploadUrl, context$2_getItem as getItem, importFile$2 as importFile, context$2_itemUploadCallback as itemUploadCallback, context$2_linkItemToCategories as linkItemToCategories, context$2_onEnterpriseItemCreated as onEnterpriseItemCreated, context$2_onEnterpriseItemItemCategoriesChanged as onEnterpriseItemItemCategoriesChanged, context$2_onEnterpriseItemPublishStatusChanged as onEnterpriseItemPublishStatusChanged, context$2_onEnterpriseItemUpdated as onEnterpriseItemUpdated, context$2_overwriteItemCategories as overwriteItemCategories, context$2_queryItems as queryItems, context$2_searchItems as searchItems, context$2_unlinkItemFromCategories as unlinkItemFromCategories, context$2_updateItem as updateItem };
1036
- }
1037
-
1038
- interface FileDescriptor {
1039
- /**
1040
- * File ID. Generated when a file is uploaded to the Media Manager.
1041
- * @readonly
1042
- */
1043
- _id?: string;
1044
- /** File name as it appears in the Media Manager. */
1045
- displayName?: string;
1046
- /**
1047
- * Static URL of the file.
1048
- * @readonly
1049
- */
1050
- url?: string;
1051
- /** ID of the file's parent folder. */
1052
- parentFolderId?: string | null;
1053
- /**
1054
- * File hash.
1055
- * @readonly
1056
- */
1057
- hash?: string;
1058
- /**
1059
- * Size of the uploaded file in bytes.
1060
- * @readonly
1061
- */
1062
- sizeInBytes?: string | null;
1063
- /**
1064
- * Whether the link to the uploaded file is public or private. Private links require a token.
1065
- * @readonly
1066
- */
1067
- private?: boolean;
1068
- /**
1069
- * Media file type.
1070
- * @readonly
1071
- */
1072
- mediaType?: MediaType;
1073
- /**
1074
- * Media file content.
1075
- * @readonly
1076
- */
1077
- media?: FileMedia;
1078
- /**
1079
- * Status of the file that was uploaded.
1080
- * * `FAILED`: The file failed to upload, for example, during media post processing.
1081
- * * `READY`: The file uploaded, finished all processing, and is ready for use.
1082
- * * `PENDING`: The file is processing and the URLs are not yet available. This response is returned when importing a file.
1083
- * @readonly
1084
- */
1085
- operationStatus?: OperationStatus;
1086
- /**
1087
- * URL where the file was uploaded from.
1088
- * @readonly
1089
- */
1090
- sourceUrl?: string | null;
1091
- /**
1092
- * URL of the file's thumbnail.
1093
- * @readonly
1094
- */
1095
- thumbnailUrl?: string | null;
1096
- /** Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images. */
1097
- labels?: string[];
1098
- /**
1099
- * Date and time the file was created.
1100
- * @readonly
1101
- */
1102
- _createdDate?: Date;
1103
- /**
1104
- * Date and time the file was updated.
1105
- * @readonly
1106
- */
1107
- _updatedDate?: Date;
1108
- /**
1109
- * The Wix site ID where the media file is stored.
1110
- * @readonly
1111
- */
1112
- siteId?: string;
1113
- /**
1114
- * State of the file.
1115
- * @readonly
1116
- */
1117
- state?: State$1;
1118
- }
1119
- declare enum MediaType {
1120
- UNKNOWN = "UNKNOWN",
1121
- IMAGE = "IMAGE",
1122
- VIDEO = "VIDEO",
1123
- AUDIO = "AUDIO",
1124
- DOCUMENT = "DOCUMENT",
1125
- VECTOR = "VECTOR",
1126
- ARCHIVE = "ARCHIVE",
1127
- MODEL3D = "MODEL3D",
1128
- OTHER = "OTHER"
1129
- }
1130
- interface FileMedia extends FileMediaMediaOneOf {
1131
- /** Information about the image. */
1132
- image?: ImageMedia;
1133
- /** Information about the video. */
1134
- video?: string;
1135
- /** Information about the audio. */
1136
- audio?: AudioV2;
1137
- /** Information about the document. */
1138
- document?: string;
1139
- /** Information about the vector. */
1140
- vector?: ImageMedia;
1141
- /** Information about the archive. */
1142
- archive?: Archive;
1143
- /** Information about the 3D Model. */
1144
- model3d?: Model3D;
1145
- }
1146
- /** @oneof */
1147
- interface FileMediaMediaOneOf {
1148
- /** Information about the image. */
1149
- image?: ImageMedia;
1150
- /** Information about the video. */
1151
- video?: string;
1152
- /** Information about the audio. */
1153
- audio?: AudioV2;
1154
- /** Information about the document. */
1155
- document?: string;
1156
- /** Information about the vector. */
1157
- vector?: ImageMedia;
1158
- /** Information about the archive. */
1159
- archive?: Archive;
1160
- /** Information about the 3D Model. */
1161
- model3d?: Model3D;
1162
- }
1163
- interface ImageMedia {
1164
- /** Image data. */
1165
- image?: string;
1166
- /** Image colors. */
1167
- colors?: Colors;
1168
- /** Information about faces in the image. Use to crop images without cutting out faces. */
1169
- faces?: FaceRecognition[];
1170
- /**
1171
- * Information about the image preview.
1172
- * You can use this to display a preview for private images.
1173
- */
1174
- previewImage?: string;
1175
- /**
1176
- * Optional, An AI generated description of the image
1177
- * @readonly
1178
- */
1179
- caption?: string | null;
1180
- /**
1181
- * Optional, return true or false if the image has text, or empty for unknown
1182
- * @readonly
1183
- */
1184
- containsText?: boolean | null;
1185
- }
1186
- interface Colors {
1187
- /** Main color of the image. */
1188
- prominent?: Color;
1189
- /** Color palette of the image. */
1190
- palette?: Color[];
1191
- }
1192
- interface Color {
1193
- /** HEX color. */
1194
- hex?: string | null;
1195
- /** RGB color. */
1196
- rgb?: ColorRGB;
1197
- }
1198
- interface ColorRGB {
1199
- /** Red channel. */
1200
- r?: number | null;
1201
- /** Green channel. */
1202
- g?: number | null;
1203
- /** Blue channel. */
1204
- b?: number | null;
1205
- }
1206
- /**
1207
- * Using this object you can crop images while centering on faces
1208
- * ------------------------
1209
- * | |
1210
- * | x,y |
1211
- * | *-------- |
1212
- * | | . . | |
1213
- * | | | | height |
1214
- * | | \ / | |
1215
- * | | | |
1216
- * | --------- |
1217
- * | width |
1218
- * | |
1219
- * |______________________|
1220
- */
1221
- interface FaceRecognition {
1222
- /** The accuracy percentage of the face recognition. The likelihood that a face is detected. */
1223
- confidence?: number;
1224
- /** Top left x pixel coordinate of the face. */
1225
- x?: number;
1226
- /** Top left y pixel coordinate of the face. */
1227
- y?: number;
1228
- /** Face pixel height. */
1229
- height?: number;
1230
- /** Face pixel width. */
1231
- width?: number;
1232
- }
1233
- interface AudioV2 {
1234
- /** WixMedia ID. */
1235
- _id?: string;
1236
- /** Audio formats available for this file. */
1237
- assets?: string[];
1238
- /**
1239
- * Audio bitrate.
1240
- * @readonly
1241
- */
1242
- bitrate?: number | null;
1243
- /**
1244
- * Audio format.
1245
- * @readonly
1246
- */
1247
- format?: string | null;
1248
- /**
1249
- * Audio duration in seconds.
1250
- * @readonly
1251
- */
1252
- duration?: number | null;
1253
- /**
1254
- * Audio size in bytes.
1255
- * @readonly
1256
- */
1257
- sizeInBytes?: string | null;
1258
- }
1259
- interface Archive {
1260
- /** WixMedia ID. */
1261
- _id?: string;
1262
- /** Archive URL. */
1263
- url?: string;
1264
- /**
1265
- * Archive URL expiration date (when relevant).
1266
- * @readonly
1267
- */
1268
- urlExpirationDate?: Date;
1269
- /** Archive size in bytes. */
1270
- sizeInBytes?: string | null;
1271
- /** Archive filename. */
1272
- filename?: string | null;
1273
- }
1274
- interface Model3D {
1275
- /** WixMedia 3D ID. */
1276
- _id?: string;
1277
- /** 3D URL. */
1278
- url?: string;
1279
- /** 3D thumbnail Image */
1280
- thumbnail?: string;
1281
- /** 3D alt text. */
1282
- altText?: string | null;
1283
- /**
1284
- * 3D URL expiration date (when relevant).
1285
- * @readonly
1286
- */
1287
- urlExpirationDate?: Date;
1288
- /**
1289
- * 3D filename.
1290
- * @readonly
1291
- */
1292
- filename?: string | null;
1293
- /**
1294
- * 3D size in bytes.
1295
- * @readonly
1296
- */
1297
- sizeInBytes?: string | null;
1298
- }
1299
- declare enum OperationStatus {
1300
- /** File upload or processing failed */
1301
- FAILED = "FAILED",
1302
- /** File is ready for consumption */
1303
- READY = "READY",
1304
- /** File is waiting for processing or currently being processed */
1305
- PENDING = "PENDING"
1306
- }
1307
- declare enum State$1 {
1308
- /** File is ready for consumption */
1309
- OK = "OK",
1310
- /** Deleted file */
1311
- DELETED = "DELETED"
1312
- }
1313
- interface FileReady {
1314
- /** File entity that is ready with full information */
1315
- file?: FileDescriptor;
1316
- /** External information passed in the file import or upload. */
1317
- externalInfo?: ExternalInfo;
1318
- /** The File was restored from the trash-bin */
1319
- triggeredByUndelete?: boolean;
1320
- }
1321
- interface ExternalInfo {
1322
- /** External information to pass in the File Ready or File Failed events. */
1323
- origin?: string;
1324
- /** External IDs to pass in the File Ready or File Failed events. */
1325
- externalIds?: string[];
1326
- }
1327
- interface FileFailed {
1328
- /** External information passed in the file import or upload. */
1329
- externalInfo?: ExternalInfo;
1330
- }
1331
- interface GenerateFilesDownloadUrlResponse {
1332
- /** URL for downloading the compressed file containing the specified files in the Media Manager. */
1333
- downloadUrl?: string;
1334
- }
1335
- declare enum ContentDisposition {
1336
- /** Using the link in the browser will download the file */
1337
- ATTACHMENT = "ATTACHMENT",
1338
- /** Using the link in the browser will open the file in the browser */
1339
- INLINE = "INLINE"
1340
- }
1341
- interface GenerateFileDownloadUrlResponse {
1342
- /** URL for downloading a specific file in the Media Manager. */
1343
- downloadUrls?: DownloadUrl[];
1344
- }
1345
- interface DownloadUrl {
1346
- /** The file download URL. */
1347
- url?: string;
1348
- /**
1349
- * Key for downloading a different asset (format and quality) of a file.
1350
- * Default: `src`, key representing the original file's format and quality.
1351
- */
1352
- assetKey?: string;
1353
- }
1354
- interface GetFileDescriptorsResponse {
1355
- /** Information about the requested files. */
1356
- files?: FileDescriptor[];
1357
- }
1358
- interface GenerateFileUploadUrlResponse {
1359
- /** The URL for uploading a file to the Media Manager. */
1360
- uploadUrl?: string;
1361
- }
1362
- declare enum UploadProtocol {
1363
- /** The upload protocol to use for implementing the resumable upload. */
1364
- TUS = "TUS"
1365
- }
1366
- interface GenerateFileResumableUploadUrlResponse {
1367
- /**
1368
- * The upload protocol to use for implementing the resumable upload.
1369
- *
1370
- * Supported values: `"TUS"`
1371
- */
1372
- uploadProtocol?: UploadProtocol;
1373
- /** The URL for uploading a file to the Media Manager. */
1374
- uploadUrl?: string;
1375
- /** Single-use upload token. */
1376
- uploadToken?: string;
1377
- }
1378
- interface ImportFileRequest {
1379
- /** Publicly accessible external file URL. */
1380
- url: string;
1381
- /** Media type of the file to import. */
1382
- mediaType?: MediaType;
1383
- /** File name that appears in the Media Manager. */
1384
- displayName?: string | null;
1385
- /**
1386
- * ID of the file's parent folder. <br />
1387
- * This folder is the path root for the `filePath`. <br />
1388
- * Default: `media-root`.
1389
- */
1390
- parentFolderId?: string | null;
1391
- /** Whether the link to the imported file is public or private. */
1392
- private?: boolean | null;
1393
- /** Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images. */
1394
- labels?: string[] | null;
1395
- /** File mime type. */
1396
- mimeType?: string;
1397
- /** Information sent to the `onFileDescriptorFileReady( )` and `onFileDescriptorFileFailed( )` events. See the Importing Files article to learn more. */
1398
- externalInfo?: ExternalInfo;
1399
- /** Optional parameters that should be sent with the external URL. */
1400
- urlParams?: Record<string, any> | null;
1401
- /** Optional headers that should be sent with the external URL. */
1402
- urlHeaders?: Record<string, any> | null;
1403
- /**
1404
- * Path to the folder where the file will be stored.
1405
- * For example, `/videos/2024/december`. <br/>
1406
- * If `parentFolderId` is defined, the parent folder is used as the path root. Otherwise, the root is `media-root`.
1407
- * The folders in the path will be created if they don't already exist. <br />
1408
- */
1409
- filePath?: string | null;
1410
- }
1411
- interface ImportFileResponse {
1412
- /** Information about the imported file. */
1413
- file?: FileDescriptor;
1414
- }
1415
- interface BulkImportFilesResponse {
1416
- /** Information about the imported files. */
1417
- files?: FileDescriptor[];
1418
- }
1419
- interface BulkImportFileResponse {
1420
- /** Items created by bulk action. */
1421
- results?: BulkImportFileResult[];
1422
- /** Bulk action metadata. */
1423
- bulkActionMetadata?: BulkActionMetadata;
1424
- }
1425
- interface BulkImportFileResult {
1426
- /** Item metadata. */
1427
- itemMetadata?: ItemMetadata;
1428
- /** Imported file. This field is returned if the operation was successful and `returnEntity` is not set to `false`. */
1429
- item?: FileDescriptor;
1430
- }
1431
- interface ItemMetadata {
1432
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1433
- _id?: string | null;
1434
- /** Index of the item within the request array. Allows for correlation between request and response items. */
1435
- originalIndex?: number;
1436
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1437
- success?: boolean;
1438
- /** Details about the error in case of failure. */
1439
- error?: ApplicationError;
1440
- }
1441
- interface ApplicationError {
1442
- /** Error code. */
1443
- code?: string;
1444
- /** Description of the error. */
1445
- description?: string;
1446
- /** Data related to the error. */
1447
- data?: Record<string, any> | null;
1448
- }
1449
- interface BulkActionMetadata {
1450
- /** Number of items that were successfully processed. */
1451
- totalSuccesses?: number;
1452
- /** Number of items that couldn't be processed. */
1453
- totalFailures?: number;
1454
- /** Number of failures without details because detailed failure threshold was exceeded. */
1455
- undetailedFailures?: number;
1456
- }
1457
- interface Sorting$1 {
1458
- /** Name of the field to sort by. */
1459
- fieldName?: string;
1460
- /** Sort order. */
1461
- order?: SortOrder$1;
1462
- }
1463
- declare enum SortOrder$1 {
1464
- ASC = "ASC",
1465
- DESC = "DESC"
1466
- }
1467
- interface CursorPaging$1 {
1468
- /** Maximum number of items to return in the results. */
1469
- limit?: number | null;
1470
- /**
1471
- * Pointer to the next or previous page in the list of results.
1472
- *
1473
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
1474
- * Not relevant for the first request.
1475
- */
1476
- cursor?: string | null;
1477
- }
1478
- interface ListFilesResponse {
1479
- /** List of files in the Media Manager. */
1480
- files?: FileDescriptor[];
1481
- /** The next cursor if it exists. */
1482
- nextCursor?: PagingMetadataV2$1;
1483
- }
1484
- interface PagingMetadataV2$1 {
1485
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
1486
- total?: number | null;
1487
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
1488
- cursors?: Cursors$1;
1489
- }
1490
- interface Cursors$1 {
1491
- /** Cursor string pointing to the next page in the list of results. */
1492
- next?: string | null;
1493
- }
1494
- declare enum RootFolder$1 {
1495
- /** Root of all site media */
1496
- MEDIA_ROOT = "MEDIA_ROOT",
1497
- /** Root of the trash system folder */
1498
- TRASH_ROOT = "TRASH_ROOT",
1499
- /** Root of all visitor uploads */
1500
- VISITOR_UPLOADS_ROOT = "VISITOR_UPLOADS_ROOT"
1501
- }
1502
- interface SearchFilesResponse {
1503
- /** Files matching the query. */
1504
- files?: FileDescriptor[];
1505
- /** The next cursor if it exists. */
1506
- nextCursor?: PagingMetadataV2$1;
1507
- }
1508
- declare enum StreamFormat {
1509
- UNKNOWN = "UNKNOWN",
1510
- HLS = "HLS",
1511
- DASH = "DASH"
1512
- }
1513
- interface GenerateVideoStreamingUrlResponse {
1514
- /** URL for streaming a specific file in the Media Manager. */
1515
- downloadUrl?: DownloadUrl;
1516
- }
1517
- interface ListDeletedFilesResponse {
1518
- /** List of files in the Media Manager's trash bin. */
1519
- files?: FileDescriptor[];
1520
- /** The next cursor if it exists. */
1521
- nextCursor?: PagingMetadataV2$1;
1522
- }
1523
- interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
1524
- /** ID of a site visitor that has not logged in to the site. */
1525
- anonymousVisitorId?: string;
1526
- /** ID of a site visitor that has logged in to the site. */
1527
- memberId?: string;
1528
- /** ID of a Wix user (site owner, contributor, etc.). */
1529
- wixUserId?: string;
1530
- /** ID of an app. */
1531
- appId?: string;
1532
- /** @readonly */
1533
- identityType?: WebhookIdentityType$1;
1534
- }
1535
- /** @oneof */
1536
- interface IdentificationDataIdOneOf$1 {
1537
- /** ID of a site visitor that has not logged in to the site. */
1538
- anonymousVisitorId?: string;
1539
- /** ID of a site visitor that has logged in to the site. */
1540
- memberId?: string;
1541
- /** ID of a Wix user (site owner, contributor, etc.). */
1542
- wixUserId?: string;
1543
- /** ID of an app. */
1544
- appId?: string;
1545
- }
1546
- declare enum WebhookIdentityType$1 {
1547
- UNKNOWN = "UNKNOWN",
1548
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1549
- MEMBER = "MEMBER",
1550
- WIX_USER = "WIX_USER",
1551
- APP = "APP"
1552
- }
1553
- interface GenerateFilesDownloadUrlResponseNonNullableFields {
1554
- downloadUrl: string;
1555
- }
1556
- interface GenerateFileDownloadUrlResponseNonNullableFields {
1557
- downloadUrls: {
1558
- url: string;
1559
- assetKey: string;
1560
- }[];
1561
- }
1562
- interface GetFileDescriptorsResponseNonNullableFields {
1563
- files: {
1564
- _id: string;
1565
- displayName: string;
1566
- url: string;
1567
- hash: string;
1568
- private: boolean;
1569
- mediaType: MediaType;
1570
- media?: {
1571
- image?: {
1572
- image: string;
1573
- colors?: {
1574
- palette: Color[];
1575
- };
1576
- faces: {
1577
- confidence: number;
1578
- x: number;
1579
- y: number;
1580
- height: number;
1581
- width: number;
1582
- }[];
1583
- previewImage: string;
1584
- };
1585
- video: string;
1586
- audio?: {
1587
- _id: string;
1588
- assets: string;
1589
- };
1590
- document: string;
1591
- vector?: {
1592
- image: string;
1593
- colors?: {
1594
- palette: Color[];
1595
- };
1596
- faces: {
1597
- confidence: number;
1598
- x: number;
1599
- y: number;
1600
- height: number;
1601
- width: number;
1602
- }[];
1603
- previewImage: string;
1604
- };
1605
- archive?: {
1606
- _id: string;
1607
- url: string;
1608
- };
1609
- model3d?: {
1610
- _id: string;
1611
- url: string;
1612
- thumbnail: string;
1613
- };
1614
- };
1615
- operationStatus: OperationStatus;
1616
- labels: string[];
1617
- siteId: string;
1618
- state: State$1;
1619
- }[];
1620
- }
1621
- interface GenerateFileUploadUrlResponseNonNullableFields {
1622
- uploadUrl: string;
1623
- }
1624
- interface GenerateFileResumableUploadUrlResponseNonNullableFields {
1625
- uploadProtocol: UploadProtocol;
1626
- uploadUrl: string;
1627
- uploadToken: string;
1628
- }
1629
- interface ImportFileResponseNonNullableFields {
1630
- file?: {
1631
- _id: string;
1632
- displayName: string;
1633
- url: string;
1634
- hash: string;
1635
- private: boolean;
1636
- mediaType: MediaType;
1637
- media?: {
1638
- image?: {
1639
- image: string;
1640
- colors?: {
1641
- palette: Color[];
1642
- };
1643
- faces: {
1644
- confidence: number;
1645
- x: number;
1646
- y: number;
1647
- height: number;
1648
- width: number;
1649
- }[];
1650
- previewImage: string;
1651
- };
1652
- video: string;
1653
- audio?: {
1654
- _id: string;
1655
- assets: string;
1656
- };
1657
- document: string;
1658
- vector?: {
1659
- image: string;
1660
- colors?: {
1661
- palette: Color[];
1662
- };
1663
- faces: {
1664
- confidence: number;
1665
- x: number;
1666
- y: number;
1667
- height: number;
1668
- width: number;
1669
- }[];
1670
- previewImage: string;
1671
- };
1672
- archive?: {
1673
- _id: string;
1674
- url: string;
1675
- };
1676
- model3d?: {
1677
- _id: string;
1678
- url: string;
1679
- thumbnail: string;
1680
- };
1681
- };
1682
- operationStatus: OperationStatus;
1683
- labels: string[];
1684
- siteId: string;
1685
- state: State$1;
1686
- };
1687
- }
1688
- interface BulkImportFilesResponseNonNullableFields {
1689
- files: {
1690
- _id: string;
1691
- displayName: string;
1692
- url: string;
1693
- hash: string;
1694
- private: boolean;
1695
- mediaType: MediaType;
1696
- media?: {
1697
- image?: {
1698
- image: string;
1699
- colors?: {
1700
- palette: Color[];
1701
- };
1702
- faces: {
1703
- confidence: number;
1704
- x: number;
1705
- y: number;
1706
- height: number;
1707
- width: number;
1708
- }[];
1709
- previewImage: string;
1710
- };
1711
- video: string;
1712
- audio?: {
1713
- _id: string;
1714
- assets: string;
1715
- };
1716
- document: string;
1717
- vector?: {
1718
- image: string;
1719
- colors?: {
1720
- palette: Color[];
1721
- };
1722
- faces: {
1723
- confidence: number;
1724
- x: number;
1725
- y: number;
1726
- height: number;
1727
- width: number;
1728
- }[];
1729
- previewImage: string;
1730
- };
1731
- archive?: {
1732
- _id: string;
1733
- url: string;
1734
- };
1735
- model3d?: {
1736
- _id: string;
1737
- url: string;
1738
- thumbnail: string;
1739
- };
1740
- };
1741
- operationStatus: OperationStatus;
1742
- labels: string[];
1743
- siteId: string;
1744
- state: State$1;
1745
- }[];
1746
- }
1747
- interface BulkImportFileResponseNonNullableFields {
1748
- results: {
1749
- itemMetadata?: {
1750
- originalIndex: number;
1751
- success: boolean;
1752
- error?: {
1753
- code: string;
1754
- description: string;
1755
- };
1756
- };
1757
- item?: {
1758
- _id: string;
1759
- displayName: string;
1760
- url: string;
1761
- hash: string;
1762
- private: boolean;
1763
- mediaType: MediaType;
1764
- media?: {
1765
- image?: {
1766
- image: string;
1767
- colors?: {
1768
- palette: Color[];
1769
- };
1770
- faces: {
1771
- confidence: number;
1772
- x: number;
1773
- y: number;
1774
- height: number;
1775
- width: number;
1776
- }[];
1777
- previewImage: string;
1778
- };
1779
- video: string;
1780
- audio?: {
1781
- _id: string;
1782
- assets: string;
1783
- };
1784
- document: string;
1785
- vector?: {
1786
- image: string;
1787
- colors?: {
1788
- palette: Color[];
1789
- };
1790
- faces: {
1791
- confidence: number;
1792
- x: number;
1793
- y: number;
1794
- height: number;
1795
- width: number;
1796
- }[];
1797
- previewImage: string;
1798
- };
1799
- archive?: {
1800
- _id: string;
1801
- url: string;
1802
- };
1803
- model3d?: {
1804
- _id: string;
1805
- url: string;
1806
- thumbnail: string;
1807
- };
1808
- };
1809
- operationStatus: OperationStatus;
1810
- labels: string[];
1811
- siteId: string;
1812
- state: State$1;
1813
- };
1814
- }[];
1815
- bulkActionMetadata?: {
1816
- totalSuccesses: number;
1817
- totalFailures: number;
1818
- undetailedFailures: number;
1819
- };
1820
- }
1821
- interface ListFilesResponseNonNullableFields {
1822
- files: {
1823
- _id: string;
1824
- displayName: string;
1825
- url: string;
1826
- hash: string;
1827
- private: boolean;
1828
- mediaType: MediaType;
1829
- media?: {
1830
- image?: {
1831
- image: string;
1832
- colors?: {
1833
- palette: Color[];
1834
- };
1835
- faces: {
1836
- confidence: number;
1837
- x: number;
1838
- y: number;
1839
- height: number;
1840
- width: number;
1841
- }[];
1842
- previewImage: string;
1843
- };
1844
- video: string;
1845
- audio?: {
1846
- _id: string;
1847
- assets: string;
1848
- };
1849
- document: string;
1850
- vector?: {
1851
- image: string;
1852
- colors?: {
1853
- palette: Color[];
1854
- };
1855
- faces: {
1856
- confidence: number;
1857
- x: number;
1858
- y: number;
1859
- height: number;
1860
- width: number;
1861
- }[];
1862
- previewImage: string;
1863
- };
1864
- archive?: {
1865
- _id: string;
1866
- url: string;
1867
- };
1868
- model3d?: {
1869
- _id: string;
1870
- url: string;
1871
- thumbnail: string;
1872
- };
1873
- };
1874
- operationStatus: OperationStatus;
1875
- labels: string[];
1876
- siteId: string;
1877
- state: State$1;
1878
- }[];
1879
- }
1880
- interface SearchFilesResponseNonNullableFields {
1881
- files: {
1882
- _id: string;
1883
- displayName: string;
1884
- url: string;
1885
- hash: string;
1886
- private: boolean;
1887
- mediaType: MediaType;
1888
- media?: {
1889
- image?: {
1890
- image: string;
1891
- colors?: {
1892
- palette: Color[];
1893
- };
1894
- faces: {
1895
- confidence: number;
1896
- x: number;
1897
- y: number;
1898
- height: number;
1899
- width: number;
1900
- }[];
1901
- previewImage: string;
1902
- };
1903
- video: string;
1904
- audio?: {
1905
- _id: string;
1906
- assets: string;
1907
- };
1908
- document: string;
1909
- vector?: {
1910
- image: string;
1911
- colors?: {
1912
- palette: Color[];
1913
- };
1914
- faces: {
1915
- confidence: number;
1916
- x: number;
1917
- y: number;
1918
- height: number;
1919
- width: number;
1920
- }[];
1921
- previewImage: string;
1922
- };
1923
- archive?: {
1924
- _id: string;
1925
- url: string;
1926
- };
1927
- model3d?: {
1928
- _id: string;
1929
- url: string;
1930
- thumbnail: string;
1931
- };
1932
- };
1933
- operationStatus: OperationStatus;
1934
- labels: string[];
1935
- siteId: string;
1936
- state: State$1;
1937
- }[];
1938
- }
1939
- interface GenerateVideoStreamingUrlResponseNonNullableFields {
1940
- downloadUrl?: {
1941
- url: string;
1942
- assetKey: string;
1943
- };
1944
- }
1945
- interface ListDeletedFilesResponseNonNullableFields {
1946
- files: {
1947
- _id: string;
1948
- displayName: string;
1949
- url: string;
1950
- hash: string;
1951
- private: boolean;
1952
- mediaType: MediaType;
1953
- media?: {
1954
- image?: {
1955
- image: string;
1956
- colors?: {
1957
- palette: Color[];
1958
- };
1959
- faces: {
1960
- confidence: number;
1961
- x: number;
1962
- y: number;
1963
- height: number;
1964
- width: number;
1965
- }[];
1966
- previewImage: string;
1967
- };
1968
- video: string;
1969
- audio?: {
1970
- _id: string;
1971
- assets: string;
1972
- };
1973
- document: string;
1974
- vector?: {
1975
- image: string;
1976
- colors?: {
1977
- palette: Color[];
1978
- };
1979
- faces: {
1980
- confidence: number;
1981
- x: number;
1982
- y: number;
1983
- height: number;
1984
- width: number;
1985
- }[];
1986
- previewImage: string;
1987
- };
1988
- archive?: {
1989
- _id: string;
1990
- url: string;
1991
- };
1992
- model3d?: {
1993
- _id: string;
1994
- url: string;
1995
- thumbnail: string;
1996
- };
1997
- };
1998
- operationStatus: OperationStatus;
1999
- labels: string[];
2000
- siteId: string;
2001
- state: State$1;
2002
- }[];
2003
- }
2004
- interface BaseEventMetadata$1 {
2005
- /** App instance ID. */
2006
- instanceId?: string | null;
2007
- /** Event type. */
2008
- eventType?: string;
2009
- /** The identification type and identity data. */
2010
- identity?: IdentificationData$1;
2011
- }
2012
- interface EventMetadata$1 extends BaseEventMetadata$1 {
2013
- /**
2014
- * Unique event ID.
2015
- * Allows clients to ignore duplicate webhooks.
2016
- */
2017
- _id?: string;
2018
- /**
2019
- * Assumes actions are also always typed to an entity_type
2020
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2021
- */
2022
- entityFqdn?: string;
2023
- /**
2024
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2025
- * This is although the created/updated/deleted notion is duplication of the oneof types
2026
- * Example: created/updated/deleted/started/completed/email_opened
2027
- */
2028
- slug?: string;
2029
- /** ID of the entity associated with the event. */
2030
- entityId?: string;
2031
- /** Event timestamp. */
2032
- eventTime?: Date;
2033
- /**
2034
- * Whether the event was triggered as a result of a privacy regulation application
2035
- * (for example, GDPR).
2036
- */
2037
- triggeredByAnonymizeRequest?: boolean | null;
2038
- /** If present, indicates the action that triggered the event. */
2039
- originatedFrom?: string | null;
2040
- /**
2041
- * A sequence number defining the order of updates to the underlying entity.
2042
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
2043
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2044
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2045
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
2046
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2047
- */
2048
- entityEventSequence?: string | null;
2049
- }
2050
- interface FileDescriptorUpdatedEnvelope {
2051
- entity: FileDescriptor;
2052
- metadata: EventMetadata$1;
2053
- }
2054
- interface FileDescriptorDeletedEnvelope {
2055
- metadata: EventMetadata$1;
2056
- }
2057
- interface FileDescriptorFileReadyEnvelope {
2058
- data: FileReady;
2059
- metadata: EventMetadata$1;
2060
- }
2061
- interface FileDescriptorFileFailedEnvelope {
2062
- data: FileFailed;
2063
- metadata: EventMetadata$1;
2064
- }
2065
- interface GenerateFileDownloadUrlOptions {
2066
- /**
2067
- * Temporary file name used to identify the file type. For example, a file named "myFile.jpeg" identifies as an "image/jpeg" file type. <br />
2068
- *
2069
- * **Note:** The name that appears in the Media Manager is taken from the `filename` query parameter in the upload request.
2070
- */
2071
- downloadFileName?: string | null;
2072
- /**
2073
- * The time that it takes in minutes for the download URL to expire. <br />
2074
- * Default: `600`. <br />
2075
- * Limit: `525600` (1 year).
2076
- */
2077
- expirationInMinutes?: number | null;
2078
- /**
2079
- * The redirect URL for when the temporary download URL with a token expires. <br />
2080
- * Default: A 403 Forbidden response page.
2081
- */
2082
- expirationRedirectUrl?: string | null;
2083
- /**
2084
- * Keys for downloading different assets (format and quality) of a file.
2085
- * Default: `src`, key representing the original file's format and quality.
2086
- */
2087
- assetKeys?: string[] | null;
2088
- /**
2089
- * Whether the link downloads the file or opens the file in the browser.
2090
- *
2091
- * - `ATTACHMENT`: The link downloads the file.
2092
- * - `INLINE`: The link opens the file in the browser.
2093
- *
2094
- * Default: `ATTACHMENT`
2095
- */
2096
- contentDisposition?: ContentDisposition;
2097
- }
2098
- interface GenerateFileUploadUrlOptions {
2099
- /**
2100
- * Temporary file name used to identify the file type. For example, a file named "myFile.jpeg" identifies as an "image/jpeg" file type.
2101
- * <br /> **Note:** The name that appears in the Media Manager is taken from the `filename` query parameter in the upload request.
2102
- */
2103
- fileName?: string | null;
2104
- /**
2105
- * File size in bytes.
2106
- * @readonly
2107
- */
2108
- sizeInBytes?: string | null;
2109
- /**
2110
- * ID of the file's parent folder. <br />
2111
- * This folder is the path root for the `filePath`.<br />
2112
- * Default: `media-root`.
2113
- */
2114
- parentFolderId?: string | null;
2115
- /** Whether the link to the uploaded file is public or private. See `Private Files` in terminology. */
2116
- private?: boolean | null;
2117
- /** Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images. */
2118
- labels?: string[] | null;
2119
- /** Information sent to the `onFileDescriptorFileReady( )` and `onFileDescriptorFileFailed( )` events. See the Importing Files article to learn more. */
2120
- externalInfo?: ExternalInfo;
2121
- /**
2122
- * Path to the folder where the file will be stored.
2123
- * For example, `/videos/2024/december`. <br/>
2124
- * If `parentFolderId` is defined, the parent folder is used as the path root. Otherwise, the root is `media-root`.
2125
- * The folders in the path will be created if they don't already exist. <br />
2126
- */
2127
- filePath?: string | null;
2128
- }
2129
- interface GenerateFileResumableUploadUrlOptions {
2130
- /**
2131
- * Temporary file name used to identify the file type. For example, a file named "myFile.jpeg" identifies as an "image/jpeg" file type.
2132
- * <br /> **Note:** The name that appears in the Media Manager is taken from the `filename` query parameter in the upload request.
2133
- */
2134
- fileName?: string | null;
2135
- /**
2136
- * File size in bytes.
2137
- * @readonly
2138
- */
2139
- sizeInBytes?: string | null;
2140
- /**
2141
- * ID of the file's parent folder. <br />
2142
- * This folder is the path root for the `filePath`.<br />
2143
- * Default: `media-root`.
2144
- */
2145
- parentFolderId?: string | null;
2146
- /** Whether the link to the imported file is public or private. See `Private Files` in terminology. */
2147
- private?: boolean | null;
2148
- /** Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images. */
2149
- labels?: string[] | null;
2150
- /**
2151
- * The upload protocol to use for implementing the resumable upload.
2152
- *
2153
- * Supported values: `"TUS"`
2154
- */
2155
- uploadProtocol?: UploadProtocol;
2156
- /**
2157
- * Path to the folder where the file will be stored.
2158
- * For example, `/videos/2024/december`. <br/>
2159
- * If `parentFolderId` is defined, the parent folder is used as the path root. Otherwise, the root is `media-root`.
2160
- * The folders in the path will be created if they don't already exist. <br />
2161
- */
2162
- filePath?: string | null;
2163
- }
2164
- interface ImportFileOptions {
2165
- /** Media type of the file to import. */
2166
- mediaType?: MediaType;
2167
- /** File name that appears in the Media Manager. */
2168
- displayName?: string | null;
2169
- /**
2170
- * ID of the file's parent folder. <br />
2171
- * This folder is the path root for the `filePath`. <br />
2172
- * Default: `media-root`.
2173
- */
2174
- parentFolderId?: string | null;
2175
- /** Whether the link to the imported file is public or private. */
2176
- private?: boolean | null;
2177
- /** Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images. */
2178
- labels?: string[] | null;
2179
- /** File mime type. */
2180
- mimeType?: string;
2181
- /** Information sent to the `onFileDescriptorFileReady( )` and `onFileDescriptorFileFailed( )` events. See the Importing Files article to learn more. */
2182
- externalInfo?: ExternalInfo;
2183
- /** Optional parameters that should be sent with the external URL. */
2184
- urlParams?: Record<string, any> | null;
2185
- /** Optional headers that should be sent with the external URL. */
2186
- urlHeaders?: Record<string, any> | null;
2187
- /**
2188
- * Path to the folder where the file will be stored.
2189
- * For example, `/videos/2024/december`. <br/>
2190
- * If `parentFolderId` is defined, the parent folder is used as the path root. Otherwise, the root is `media-root`.
2191
- * The folders in the path will be created if they don't already exist. <br />
2192
- */
2193
- filePath?: string | null;
2194
- }
2195
- interface BulkImportFileOptions {
2196
- /**
2197
- * Whether to include the imported File Descriptor in the response. Set to `false` to exclude the File Descriptor from the returned object.
2198
- *
2199
- * Default: `true`
2200
- */
2201
- returnEntity?: boolean | null;
2202
- }
2203
- interface ListFilesOptions {
2204
- /**
2205
- * ID of the file's parent folder. <br />
2206
- * Default:`media-root`.
2207
- */
2208
- parentFolderId?: string | null;
2209
- /** Media file type. */
2210
- mediaTypes?: MediaType[];
2211
- /** Whether the link to the imported file is public or private. */
2212
- private?: boolean | null;
2213
- /**
2214
- * Field name and order to sort by. One of:
2215
- *
2216
- * - `displayName`
2217
- * - `_updatedDate`
2218
- * - `sizeInBytes`
2219
- *
2220
- * Default: `_updatedDate` in `"DESC"` order.
2221
- */
2222
- sort?: Sorting$1;
2223
- /** Cursor and paging information. */
2224
- paging?: CursorPaging$1;
2225
- }
2226
- interface SearchFilesOptions {
2227
- /**
2228
- * Term to search for. Possible terms include the value of a file's
2229
- * `displayName`, `mimeType`, and `label`. <br />
2230
- * For example, if a file's label is cat, the search term is 'cat'.
2231
- */
2232
- search?: string | null;
2233
- /**
2234
- * A root folder in the media manager to search in.
2235
- *
2236
- * Default: `MEDIA_ROOT`.
2237
- */
2238
- rootFolder?: RootFolder$1;
2239
- /** Media file type. */
2240
- mediaTypes?: MediaType[];
2241
- /**
2242
- * Whether the link to the imported file is public or private.
2243
- *
2244
- * Default: `false`.
2245
- */
2246
- private?: boolean | null;
2247
- /**
2248
- * Field name and order to sort by. One of:
2249
- *
2250
- * - `displayName`
2251
- * - `_updatedDate`
2252
- * - `sizeInBytes`
2253
- *
2254
- * Default: `_updatedDate` in `"DESC"` order.
2255
- */
2256
- sort?: Sorting$1;
2257
- /** Cursor and paging information. */
2258
- paging?: CursorPaging$1;
2259
- }
2260
- interface GenerateVideoStreamingUrlOptions {
2261
- /** Video stream format. */
2262
- format?: StreamFormat;
2263
- }
2264
- interface BulkDeleteFilesOptions {
2265
- /**
2266
- * Whether the specified files are permanently deleted. <br />
2267
- * Default: `false`
2268
- */
2269
- permanent?: boolean;
2270
- }
2271
- interface ListDeletedFilesOptions {
2272
- /**
2273
- * ID of the file's parent folder. <br />
2274
- * Default: `media-root`.
2275
- */
2276
- parentFolderId?: string | null;
2277
- /** Media file type. */
2278
- mediaTypes?: MediaType[];
2279
- /** Whether the link to the imported file is public or private. */
2280
- private?: boolean | null;
2281
- /**
2282
- * Field name and order to sort by. One of:
2283
- *
2284
- * - `displayName`
2285
- * - `_updatedDate`
2286
- * - `sizeInBytes`
2287
- *
2288
- * Default: `_updatedDate` in `"DESC"` order.
2289
- */
2290
- sort?: Sorting$1;
2291
- /** Cursor and paging information. */
2292
- paging?: CursorPaging$1;
2293
- }
2294
-
2295
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
2296
- interface HttpClient$1 {
2297
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
2298
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2299
- }
2300
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
2301
- type HttpResponse$1<T = any> = {
2302
- data: T;
2303
- status: number;
2304
- statusText: string;
2305
- headers: any;
2306
- request?: any;
2307
- };
2308
- type RequestOptions$1<_TResponse = any, Data = any> = {
2309
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2310
- url: string;
2311
- data?: Data;
2312
- params?: URLSearchParams;
2313
- } & APIMetadata$1;
2314
- type APIMetadata$1 = {
2315
- methodFqn?: string;
2316
- entityFqdn?: string;
2317
- packageName?: string;
2318
- };
2319
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
2320
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
2321
- __type: 'event-definition';
2322
- type: Type;
2323
- isDomainEvent?: boolean;
2324
- transformations?: (envelope: unknown) => Payload;
2325
- __payload: Payload;
2326
- };
2327
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
2328
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
2329
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
2330
-
2331
- declare global {
2332
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2333
- interface SymbolConstructor {
2334
- readonly observable: symbol;
2335
- }
2336
- }
2337
-
2338
- declare function generateFilesDownloadUrl$1(httpClient: HttpClient$1): (fileIds: string[]) => Promise<GenerateFilesDownloadUrlResponse & GenerateFilesDownloadUrlResponseNonNullableFields>;
2339
- declare function generateFileDownloadUrl$1(httpClient: HttpClient$1): (fileId: string, options?: GenerateFileDownloadUrlOptions) => Promise<GenerateFileDownloadUrlResponse & GenerateFileDownloadUrlResponseNonNullableFields>;
2340
- declare function getFileDescriptor$1(httpClient: HttpClient$1): (fileId: string) => Promise<FileDescriptor & {
2341
- _id: string;
2342
- displayName: string;
2343
- url: string;
2344
- hash: string;
2345
- private: boolean;
2346
- mediaType: MediaType;
2347
- media?: {
2348
- image?: {
2349
- image: string;
2350
- colors?: {
2351
- palette: Color[];
2352
- } | undefined;
2353
- faces: {
2354
- confidence: number;
2355
- x: number;
2356
- y: number;
2357
- height: number;
2358
- width: number;
2359
- }[];
2360
- previewImage: string;
2361
- } | undefined;
2362
- video: string;
2363
- audio?: {
2364
- _id: string;
2365
- assets: string;
2366
- } | undefined;
2367
- document: string;
2368
- vector?: {
2369
- image: string;
2370
- colors?: {
2371
- palette: Color[];
2372
- } | undefined;
2373
- faces: {
2374
- confidence: number;
2375
- x: number;
2376
- y: number;
2377
- height: number;
2378
- width: number;
2379
- }[];
2380
- previewImage: string;
2381
- } | undefined;
2382
- archive?: {
2383
- _id: string;
2384
- url: string;
2385
- } | undefined;
2386
- model3d?: {
2387
- _id: string;
2388
- url: string;
2389
- thumbnail: string;
2390
- } | undefined;
2391
- } | undefined;
2392
- operationStatus: OperationStatus;
2393
- labels: string[];
2394
- siteId: string;
2395
- state: State$1;
2396
- }>;
2397
- declare function getFileDescriptors$1(httpClient: HttpClient$1): (fileIds: string[]) => Promise<GetFileDescriptorsResponse & GetFileDescriptorsResponseNonNullableFields>;
2398
- declare function updateFileDescriptor$1(httpClient: HttpClient$1): (file: FileDescriptor) => Promise<FileDescriptor & {
2399
- _id: string;
2400
- displayName: string;
2401
- url: string;
2402
- hash: string;
2403
- private: boolean;
2404
- mediaType: MediaType;
2405
- media?: {
2406
- image?: {
2407
- image: string;
2408
- colors?: {
2409
- palette: Color[];
2410
- } | undefined;
2411
- faces: {
2412
- confidence: number;
2413
- x: number;
2414
- y: number;
2415
- height: number;
2416
- width: number;
2417
- }[];
2418
- previewImage: string;
2419
- } | undefined;
2420
- video: string;
2421
- audio?: {
2422
- _id: string;
2423
- assets: string;
2424
- } | undefined;
2425
- document: string;
2426
- vector?: {
2427
- image: string;
2428
- colors?: {
2429
- palette: Color[];
2430
- } | undefined;
2431
- faces: {
2432
- confidence: number;
2433
- x: number;
2434
- y: number;
2435
- height: number;
2436
- width: number;
2437
- }[];
2438
- previewImage: string;
2439
- } | undefined;
2440
- archive?: {
2441
- _id: string;
2442
- url: string;
2443
- } | undefined;
2444
- model3d?: {
2445
- _id: string;
2446
- url: string;
2447
- thumbnail: string;
2448
- } | undefined;
2449
- } | undefined;
2450
- operationStatus: OperationStatus;
2451
- labels: string[];
2452
- siteId: string;
2453
- state: State$1;
2454
- }>;
2455
- declare function generateFileUploadUrl$1(httpClient: HttpClient$1): (mimeType: string | null, options?: GenerateFileUploadUrlOptions) => Promise<GenerateFileUploadUrlResponse & GenerateFileUploadUrlResponseNonNullableFields>;
2456
- declare function generateFileResumableUploadUrl$1(httpClient: HttpClient$1): (mimeType: string | null, options?: GenerateFileResumableUploadUrlOptions) => Promise<GenerateFileResumableUploadUrlResponse & GenerateFileResumableUploadUrlResponseNonNullableFields>;
2457
- declare function importFile$1(httpClient: HttpClient$1): (url: string, options?: ImportFileOptions) => Promise<ImportFileResponse & ImportFileResponseNonNullableFields>;
2458
- declare function bulkImportFiles$1(httpClient: HttpClient$1): (importFileRequests: ImportFileRequest[]) => Promise<BulkImportFilesResponse & BulkImportFilesResponseNonNullableFields>;
2459
- declare function bulkImportFile$1(httpClient: HttpClient$1): (importFileRequests: ImportFileRequest[], options?: BulkImportFileOptions) => Promise<BulkImportFileResponse & BulkImportFileResponseNonNullableFields>;
2460
- declare function listFiles$1(httpClient: HttpClient$1): (options?: ListFilesOptions) => Promise<ListFilesResponse & ListFilesResponseNonNullableFields>;
2461
- declare function searchFiles$1(httpClient: HttpClient$1): (options?: SearchFilesOptions) => Promise<SearchFilesResponse & SearchFilesResponseNonNullableFields>;
2462
- declare function generateVideoStreamingUrl$1(httpClient: HttpClient$1): (fileId: string, options?: GenerateVideoStreamingUrlOptions) => Promise<GenerateVideoStreamingUrlResponse & GenerateVideoStreamingUrlResponseNonNullableFields>;
2463
- declare function bulkDeleteFiles$1(httpClient: HttpClient$1): (fileIds: string[], options?: BulkDeleteFilesOptions) => Promise<void>;
2464
- declare function bulkRestoreFilesFromTrashBin$1(httpClient: HttpClient$1): (fileIds: string[]) => Promise<void>;
2465
- declare function listDeletedFiles$1(httpClient: HttpClient$1): (options?: ListDeletedFilesOptions) => Promise<ListDeletedFilesResponse & ListDeletedFilesResponseNonNullableFields>;
2466
- declare const onFileDescriptorUpdated$1: EventDefinition$1<FileDescriptorUpdatedEnvelope, "wix.media.site_media.v1.file_descriptor_updated">;
2467
- declare const onFileDescriptorDeleted$1: EventDefinition$1<FileDescriptorDeletedEnvelope, "wix.media.site_media.v1.file_descriptor_deleted">;
2468
- declare const onFileDescriptorFileReady$1: EventDefinition$1<FileDescriptorFileReadyEnvelope, "wix.media.site_media.v1.file_descriptor_file_ready">;
2469
- declare const onFileDescriptorFileFailed$1: EventDefinition$1<FileDescriptorFileFailedEnvelope, "wix.media.site_media.v1.file_descriptor_file_failed">;
2470
-
2471
- declare const generateFilesDownloadUrl: BuildRESTFunction$1<typeof generateFilesDownloadUrl$1>;
2472
- declare const generateFileDownloadUrl: BuildRESTFunction$1<typeof generateFileDownloadUrl$1>;
2473
- declare const getFileDescriptor: BuildRESTFunction$1<typeof getFileDescriptor$1>;
2474
- declare const getFileDescriptors: BuildRESTFunction$1<typeof getFileDescriptors$1>;
2475
- declare const updateFileDescriptor: BuildRESTFunction$1<typeof updateFileDescriptor$1>;
2476
- declare const generateFileUploadUrl: BuildRESTFunction$1<typeof generateFileUploadUrl$1>;
2477
- declare const generateFileResumableUploadUrl: BuildRESTFunction$1<typeof generateFileResumableUploadUrl$1>;
2478
- declare const importFile: BuildRESTFunction$1<typeof importFile$1>;
2479
- declare const bulkImportFiles: BuildRESTFunction$1<typeof bulkImportFiles$1>;
2480
- declare const bulkImportFile: BuildRESTFunction$1<typeof bulkImportFile$1>;
2481
- declare const listFiles: BuildRESTFunction$1<typeof listFiles$1>;
2482
- declare const searchFiles: BuildRESTFunction$1<typeof searchFiles$1>;
2483
- declare const generateVideoStreamingUrl: BuildRESTFunction$1<typeof generateVideoStreamingUrl$1>;
2484
- declare const bulkDeleteFiles: BuildRESTFunction$1<typeof bulkDeleteFiles$1>;
2485
- declare const bulkRestoreFilesFromTrashBin: BuildRESTFunction$1<typeof bulkRestoreFilesFromTrashBin$1>;
2486
- declare const listDeletedFiles: BuildRESTFunction$1<typeof listDeletedFiles$1>;
2487
- declare const onFileDescriptorUpdated: BuildEventDefinition$1<typeof onFileDescriptorUpdated$1>;
2488
- declare const onFileDescriptorDeleted: BuildEventDefinition$1<typeof onFileDescriptorDeleted$1>;
2489
- declare const onFileDescriptorFileReady: BuildEventDefinition$1<typeof onFileDescriptorFileReady$1>;
2490
- declare const onFileDescriptorFileFailed: BuildEventDefinition$1<typeof onFileDescriptorFileFailed$1>;
106
+ export { context$2_bulkUpdateItem as bulkUpdateItem, generateFileUploadUrl$1 as generateFileUploadUrl, context$2_getItem as getItem, importFile$1 as importFile, context$2_itemUploadCallback as itemUploadCallback, context$2_linkItemToCategories as linkItemToCategories, context$2_onEnterpriseItemCreated as onEnterpriseItemCreated, context$2_onEnterpriseItemItemCategoriesChanged as onEnterpriseItemItemCategoriesChanged, context$2_onEnterpriseItemPublishStatusChanged as onEnterpriseItemPublishStatusChanged, context$2_onEnterpriseItemUpdated as onEnterpriseItemUpdated, context$2_overwriteItemCategories as overwriteItemCategories, context$2_queryItems as queryItems, context$2_searchItems as searchItems, context$2_unlinkItemFromCategories as unlinkItemFromCategories, context$2_updateItem as updateItem };
107
+ }
108
+
109
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
110
+
111
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
112
+
113
+ declare const generateFilesDownloadUrl: ReturnType<typeof createRESTModule$1<typeof publicGenerateFilesDownloadUrl>>;
114
+ declare const generateFileDownloadUrl: ReturnType<typeof createRESTModule$1<typeof publicGenerateFileDownloadUrl>>;
115
+ declare const getFileDescriptor: ReturnType<typeof createRESTModule$1<typeof publicGetFileDescriptor>>;
116
+ declare const getFileDescriptors: ReturnType<typeof createRESTModule$1<typeof publicGetFileDescriptors>>;
117
+ declare const updateFileDescriptor: ReturnType<typeof createRESTModule$1<typeof publicUpdateFileDescriptor>>;
118
+ declare const generateFileUploadUrl: ReturnType<typeof createRESTModule$1<typeof publicGenerateFileUploadUrl>>;
119
+ declare const generateFileResumableUploadUrl: ReturnType<typeof createRESTModule$1<typeof publicGenerateFileResumableUploadUrl>>;
120
+ declare const importFile: ReturnType<typeof createRESTModule$1<typeof publicImportFile>>;
121
+ declare const bulkImportFiles: ReturnType<typeof createRESTModule$1<typeof publicBulkImportFiles>>;
122
+ declare const bulkImportFile: ReturnType<typeof createRESTModule$1<typeof publicBulkImportFile>>;
123
+ declare const listFiles: ReturnType<typeof createRESTModule$1<typeof publicListFiles>>;
124
+ declare const searchFiles: ReturnType<typeof createRESTModule$1<typeof publicSearchFiles>>;
125
+ declare const generateVideoStreamingUrl: ReturnType<typeof createRESTModule$1<typeof publicGenerateVideoStreamingUrl>>;
126
+ declare const bulkDeleteFiles: ReturnType<typeof createRESTModule$1<typeof publicBulkDeleteFiles>>;
127
+ declare const bulkRestoreFilesFromTrashBin: ReturnType<typeof createRESTModule$1<typeof publicBulkRestoreFilesFromTrashBin>>;
128
+ declare const listDeletedFiles: ReturnType<typeof createRESTModule$1<typeof publicListDeletedFiles>>;
129
+ declare const onFileDescriptorUpdated: ReturnType<typeof createEventModule$1<typeof publicOnFileDescriptorUpdated>>;
130
+ declare const onFileDescriptorDeleted: ReturnType<typeof createEventModule$1<typeof publicOnFileDescriptorDeleted>>;
131
+ declare const onFileDescriptorFileReady: ReturnType<typeof createEventModule$1<typeof publicOnFileDescriptorFileReady>>;
132
+ declare const onFileDescriptorFileFailed: ReturnType<typeof createEventModule$1<typeof publicOnFileDescriptorFileFailed>>;
2491
133
 
2492
134
  declare const context$1_bulkDeleteFiles: typeof bulkDeleteFiles;
2493
135
  declare const context$1_bulkImportFile: typeof bulkImportFile;
@@ -2513,387 +155,22 @@ declare namespace context$1 {
2513
155
  export { context$1_bulkDeleteFiles as bulkDeleteFiles, context$1_bulkImportFile as bulkImportFile, context$1_bulkImportFiles as bulkImportFiles, context$1_bulkRestoreFilesFromTrashBin as bulkRestoreFilesFromTrashBin, context$1_generateFileDownloadUrl as generateFileDownloadUrl, context$1_generateFileResumableUploadUrl as generateFileResumableUploadUrl, context$1_generateFileUploadUrl as generateFileUploadUrl, context$1_generateFilesDownloadUrl as generateFilesDownloadUrl, context$1_generateVideoStreamingUrl as generateVideoStreamingUrl, context$1_getFileDescriptor as getFileDescriptor, context$1_getFileDescriptors as getFileDescriptors, context$1_importFile as importFile, context$1_listDeletedFiles as listDeletedFiles, context$1_listFiles as listFiles, context$1_onFileDescriptorDeleted as onFileDescriptorDeleted, context$1_onFileDescriptorFileFailed as onFileDescriptorFileFailed, context$1_onFileDescriptorFileReady as onFileDescriptorFileReady, context$1_onFileDescriptorUpdated as onFileDescriptorUpdated, context$1_searchFiles as searchFiles, context$1_updateFileDescriptor as updateFileDescriptor };
2514
156
  }
2515
157
 
2516
- interface Folder {
2517
- /** Folder ID. Generated when a folder is created in the Media Manager. */
2518
- _id?: string;
2519
- /** Folder name as it appears in the Media Manager. */
2520
- displayName?: string;
2521
- /** ID of the folder's parent folder. <br /> Default: `media-root` folder. */
2522
- parentFolderId?: string;
2523
- /**
2524
- * Date the folder was created.
2525
- * @readonly
2526
- */
2527
- _createdDate?: Date;
2528
- /**
2529
- * Date the folder was updated.
2530
- * @readonly
2531
- */
2532
- _updatedDate?: Date;
2533
- /**
2534
- * State of the folder.
2535
- * @readonly
2536
- */
2537
- state?: State;
2538
- }
2539
- declare enum State {
2540
- OK = "OK",
2541
- DELETED = "DELETED"
2542
- }
2543
- interface CreateFolderResponse {
2544
- /** Information about the newly created folder. */
2545
- folder?: Folder;
2546
- }
2547
- interface Sorting {
2548
- /** Name of the field to sort by. */
2549
- fieldName?: string;
2550
- /** Sort order. */
2551
- order?: SortOrder;
2552
- }
2553
- declare enum SortOrder {
2554
- ASC = "ASC",
2555
- DESC = "DESC"
2556
- }
2557
- interface CursorPaging {
2558
- /** Maximum number of items to return in the results. */
2559
- limit?: number | null;
2560
- /**
2561
- * Pointer to the next or previous page in the list of results.
2562
- *
2563
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
2564
- * Not relevant for the first request.
2565
- */
2566
- cursor?: string | null;
2567
- }
2568
- interface ListFoldersResponse {
2569
- /** Information about the folders in the requested folder. */
2570
- folders?: Folder[];
2571
- /** The next cursor if it exists. */
2572
- nextCursor?: PagingMetadataV2;
2573
- }
2574
- interface PagingMetadataV2 {
2575
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
2576
- total?: number | null;
2577
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
2578
- cursors?: Cursors;
2579
- }
2580
- interface Cursors {
2581
- /** Cursor string pointing to the next page in the list of results. */
2582
- next?: string | null;
2583
- }
2584
- declare enum RootFolder {
2585
- /** Root of all site media */
2586
- MEDIA_ROOT = "MEDIA_ROOT",
2587
- /** Root of the trash system folder */
2588
- TRASH_ROOT = "TRASH_ROOT",
2589
- /** Root of all visitor uploads */
2590
- VISITOR_UPLOADS_ROOT = "VISITOR_UPLOADS_ROOT"
2591
- }
2592
- interface SearchFoldersResponse {
2593
- /** Information about the folders in the requested folder. */
2594
- folders?: Folder[];
2595
- /** The next cursor if it exists. */
2596
- nextCursor?: PagingMetadataV2;
2597
- }
2598
- interface GenerateFolderDownloadUrlResponse {
2599
- /** URL for downloading a specific folder in the Media Manager. */
2600
- downloadUrl?: string;
2601
- }
2602
- interface ListDeletedFoldersResponse {
2603
- /** List of folders in the Media Manager's trash bin. */
2604
- folders?: Folder[];
2605
- /** The next cursor if it exists. */
2606
- nextCursor?: PagingMetadataV2;
2607
- }
2608
- interface IdentificationData extends IdentificationDataIdOneOf {
2609
- /** ID of a site visitor that has not logged in to the site. */
2610
- anonymousVisitorId?: string;
2611
- /** ID of a site visitor that has logged in to the site. */
2612
- memberId?: string;
2613
- /** ID of a Wix user (site owner, contributor, etc.). */
2614
- wixUserId?: string;
2615
- /** ID of an app. */
2616
- appId?: string;
2617
- /** @readonly */
2618
- identityType?: WebhookIdentityType;
2619
- }
2620
- /** @oneof */
2621
- interface IdentificationDataIdOneOf {
2622
- /** ID of a site visitor that has not logged in to the site. */
2623
- anonymousVisitorId?: string;
2624
- /** ID of a site visitor that has logged in to the site. */
2625
- memberId?: string;
2626
- /** ID of a Wix user (site owner, contributor, etc.). */
2627
- wixUserId?: string;
2628
- /** ID of an app. */
2629
- appId?: string;
2630
- }
2631
- declare enum WebhookIdentityType {
2632
- UNKNOWN = "UNKNOWN",
2633
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2634
- MEMBER = "MEMBER",
2635
- WIX_USER = "WIX_USER",
2636
- APP = "APP"
2637
- }
2638
- interface CreateFolderResponseNonNullableFields {
2639
- folder?: {
2640
- _id: string;
2641
- displayName: string;
2642
- parentFolderId: string;
2643
- state: State;
2644
- };
2645
- }
2646
- interface ListFoldersResponseNonNullableFields {
2647
- folders: {
2648
- _id: string;
2649
- displayName: string;
2650
- parentFolderId: string;
2651
- state: State;
2652
- }[];
2653
- }
2654
- interface SearchFoldersResponseNonNullableFields {
2655
- folders: {
2656
- _id: string;
2657
- displayName: string;
2658
- parentFolderId: string;
2659
- state: State;
2660
- }[];
2661
- }
2662
- interface GenerateFolderDownloadUrlResponseNonNullableFields {
2663
- downloadUrl: string;
2664
- }
2665
- interface ListDeletedFoldersResponseNonNullableFields {
2666
- folders: {
2667
- _id: string;
2668
- displayName: string;
2669
- parentFolderId: string;
2670
- state: State;
2671
- }[];
2672
- }
2673
- interface BaseEventMetadata {
2674
- /** App instance ID. */
2675
- instanceId?: string | null;
2676
- /** Event type. */
2677
- eventType?: string;
2678
- /** The identification type and identity data. */
2679
- identity?: IdentificationData;
2680
- }
2681
- interface EventMetadata extends BaseEventMetadata {
2682
- /**
2683
- * Unique event ID.
2684
- * Allows clients to ignore duplicate webhooks.
2685
- */
2686
- _id?: string;
2687
- /**
2688
- * Assumes actions are also always typed to an entity_type
2689
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2690
- */
2691
- entityFqdn?: string;
2692
- /**
2693
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2694
- * This is although the created/updated/deleted notion is duplication of the oneof types
2695
- * Example: created/updated/deleted/started/completed/email_opened
2696
- */
2697
- slug?: string;
2698
- /** ID of the entity associated with the event. */
2699
- entityId?: string;
2700
- /** Event timestamp. */
2701
- eventTime?: Date;
2702
- /**
2703
- * Whether the event was triggered as a result of a privacy regulation application
2704
- * (for example, GDPR).
2705
- */
2706
- triggeredByAnonymizeRequest?: boolean | null;
2707
- /** If present, indicates the action that triggered the event. */
2708
- originatedFrom?: string | null;
2709
- /**
2710
- * A sequence number defining the order of updates to the underlying entity.
2711
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
2712
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2713
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2714
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
2715
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2716
- */
2717
- entityEventSequence?: string | null;
2718
- }
2719
- interface FolderCreatedEnvelope {
2720
- entity: Folder;
2721
- metadata: EventMetadata;
2722
- }
2723
- interface FolderUpdatedEnvelope {
2724
- entity: Folder;
2725
- metadata: EventMetadata;
2726
- }
2727
- interface FolderDeletedEnvelope {
2728
- metadata: EventMetadata;
2729
- }
2730
- interface CreateFolderOptions {
2731
- /** ID of the folder's parent folder. */
2732
- parentFolderId?: string | null;
2733
- }
2734
- interface ListFoldersOptions {
2735
- /**
2736
- * ID of the folder's parent folder.
2737
- * <br /> Default: `media-root` folder.
2738
- */
2739
- parentFolderId?: string | null;
2740
- /**
2741
- * Field name and order to sort by. One of:
2742
- * - `displayName`
2743
- * - `_updatedDate`
2744
- *
2745
- * Default: `_updatedDate` in `"DESC"` order.
2746
- */
2747
- sort?: Sorting;
2748
- /** Cursor and paging information. */
2749
- paging?: CursorPaging;
2750
- }
2751
- interface SearchFoldersOptions {
2752
- /**
2753
- * A root folder in the media manager to search in. <br />
2754
- * Default: `MEDIA_ROOT`.
2755
- */
2756
- rootFolder?: RootFolder;
2757
- /**
2758
- * Field name and order to sort by. One of:
2759
- * - `displayName`
2760
- * - `_updatedDate`
2761
- *
2762
- * Default: `_updatedDate` in `"DESC"` order.
2763
- */
2764
- sort?: Sorting;
2765
- /** Cursor and paging information. */
2766
- paging?: CursorPaging;
2767
- /**
2768
- * Term to search for, such as the value of a folder's `displayName`.
2769
- *
2770
- * For example, if a folder's `displayName` is 'my-videos-folder', the search term is `'my-videos-folder'`.
2771
- */
2772
- search?: string | null;
2773
- }
2774
- interface UpdateFolder {
2775
- /** Folder ID. Generated when a folder is created in the Media Manager. */
2776
- _id?: string;
2777
- /** Folder name as it appears in the Media Manager. */
2778
- displayName?: string;
2779
- /** ID of the folder's parent folder. <br /> Default: `media-root` folder. */
2780
- parentFolderId?: string;
2781
- /**
2782
- * Date the folder was created.
2783
- * @readonly
2784
- */
2785
- _createdDate?: Date;
2786
- /**
2787
- * Date the folder was updated.
2788
- * @readonly
2789
- */
2790
- _updatedDate?: Date;
2791
- /**
2792
- * State of the folder.
2793
- * @readonly
2794
- */
2795
- state?: State;
2796
- }
2797
- interface BulkDeleteFoldersOptions {
2798
- /**
2799
- * Whether the specified folders are permanently deleted. <br />
2800
- * Default: `false`
2801
- */
2802
- permanent?: boolean;
2803
- }
2804
- interface ListDeletedFoldersOptions {
2805
- /** ID of the folder's parent folder. */
2806
- parentFolderId?: string | null;
2807
- /**
2808
- * Field name and order to sort by. One of:
2809
- * - `displayName`
2810
- * - `_updatedDate`
2811
- *
2812
- * Default: `_updatedDate` in `"DESC"` order.
2813
- */
2814
- sort?: Sorting;
2815
- /** Cursor and paging information. */
2816
- paging?: CursorPaging;
2817
- }
2818
-
2819
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2820
- interface HttpClient {
2821
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
2822
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2823
- }
2824
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
2825
- type HttpResponse<T = any> = {
2826
- data: T;
2827
- status: number;
2828
- statusText: string;
2829
- headers: any;
2830
- request?: any;
2831
- };
2832
- type RequestOptions<_TResponse = any, Data = any> = {
2833
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2834
- url: string;
2835
- data?: Data;
2836
- params?: URLSearchParams;
2837
- } & APIMetadata;
2838
- type APIMetadata = {
2839
- methodFqn?: string;
2840
- entityFqdn?: string;
2841
- packageName?: string;
2842
- };
2843
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
2844
- type EventDefinition<Payload = unknown, Type extends string = string> = {
2845
- __type: 'event-definition';
2846
- type: Type;
2847
- isDomainEvent?: boolean;
2848
- transformations?: (envelope: unknown) => Payload;
2849
- __payload: Payload;
2850
- };
2851
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
2852
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
2853
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
2854
-
2855
- declare global {
2856
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2857
- interface SymbolConstructor {
2858
- readonly observable: symbol;
2859
- }
2860
- }
158
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
2861
159
 
2862
- declare function createFolder$1(httpClient: HttpClient): (displayName: string, options?: CreateFolderOptions) => Promise<CreateFolderResponse & CreateFolderResponseNonNullableFields>;
2863
- declare function getFolder$1(httpClient: HttpClient): (folderId: string) => Promise<Folder & {
2864
- _id: string;
2865
- displayName: string;
2866
- parentFolderId: string;
2867
- state: State;
2868
- }>;
2869
- declare function listFolders$1(httpClient: HttpClient): (options?: ListFoldersOptions) => Promise<ListFoldersResponse & ListFoldersResponseNonNullableFields>;
2870
- declare function searchFolders$1(httpClient: HttpClient): (options?: SearchFoldersOptions) => Promise<SearchFoldersResponse & SearchFoldersResponseNonNullableFields>;
2871
- declare function updateFolder$1(httpClient: HttpClient): (_id: string, folder: UpdateFolder) => Promise<Folder & {
2872
- _id: string;
2873
- displayName: string;
2874
- parentFolderId: string;
2875
- state: State;
2876
- }>;
2877
- declare function generateFolderDownloadUrl$1(httpClient: HttpClient): (folderId: string) => Promise<GenerateFolderDownloadUrlResponse & GenerateFolderDownloadUrlResponseNonNullableFields>;
2878
- declare function bulkDeleteFolders$1(httpClient: HttpClient): (folderIds: string[], options?: BulkDeleteFoldersOptions) => Promise<void>;
2879
- declare function bulkRestoreFoldersFromTrashBin$1(httpClient: HttpClient): (folderIds: string[]) => Promise<void>;
2880
- declare function listDeletedFolders$1(httpClient: HttpClient): (options?: ListDeletedFoldersOptions) => Promise<ListDeletedFoldersResponse & ListDeletedFoldersResponseNonNullableFields>;
2881
- declare const onFolderCreated$1: EventDefinition<FolderCreatedEnvelope, "wix.media.site_media.v1.folder_created">;
2882
- declare const onFolderUpdated$1: EventDefinition<FolderUpdatedEnvelope, "wix.media.site_media.v1.folder_updated">;
2883
- declare const onFolderDeleted$1: EventDefinition<FolderDeletedEnvelope, "wix.media.site_media.v1.folder_deleted">;
160
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2884
161
 
2885
- declare const createFolder: BuildRESTFunction<typeof createFolder$1>;
2886
- declare const getFolder: BuildRESTFunction<typeof getFolder$1>;
2887
- declare const listFolders: BuildRESTFunction<typeof listFolders$1>;
2888
- declare const searchFolders: BuildRESTFunction<typeof searchFolders$1>;
2889
- declare const updateFolder: BuildRESTFunction<typeof updateFolder$1>;
2890
- declare const generateFolderDownloadUrl: BuildRESTFunction<typeof generateFolderDownloadUrl$1>;
2891
- declare const bulkDeleteFolders: BuildRESTFunction<typeof bulkDeleteFolders$1>;
2892
- declare const bulkRestoreFoldersFromTrashBin: BuildRESTFunction<typeof bulkRestoreFoldersFromTrashBin$1>;
2893
- declare const listDeletedFolders: BuildRESTFunction<typeof listDeletedFolders$1>;
2894
- declare const onFolderCreated: BuildEventDefinition<typeof onFolderCreated$1>;
2895
- declare const onFolderUpdated: BuildEventDefinition<typeof onFolderUpdated$1>;
2896
- declare const onFolderDeleted: BuildEventDefinition<typeof onFolderDeleted$1>;
162
+ declare const createFolder: ReturnType<typeof createRESTModule<typeof publicCreateFolder>>;
163
+ declare const getFolder: ReturnType<typeof createRESTModule<typeof publicGetFolder>>;
164
+ declare const listFolders: ReturnType<typeof createRESTModule<typeof publicListFolders>>;
165
+ declare const searchFolders: ReturnType<typeof createRESTModule<typeof publicSearchFolders>>;
166
+ declare const updateFolder: ReturnType<typeof createRESTModule<typeof publicUpdateFolder>>;
167
+ declare const generateFolderDownloadUrl: ReturnType<typeof createRESTModule<typeof publicGenerateFolderDownloadUrl>>;
168
+ declare const bulkDeleteFolders: ReturnType<typeof createRESTModule<typeof publicBulkDeleteFolders>>;
169
+ declare const bulkRestoreFoldersFromTrashBin: ReturnType<typeof createRESTModule<typeof publicBulkRestoreFoldersFromTrashBin>>;
170
+ declare const listDeletedFolders: ReturnType<typeof createRESTModule<typeof publicListDeletedFolders>>;
171
+ declare const onFolderCreated: ReturnType<typeof createEventModule<typeof publicOnFolderCreated>>;
172
+ declare const onFolderUpdated: ReturnType<typeof createEventModule<typeof publicOnFolderUpdated>>;
173
+ declare const onFolderDeleted: ReturnType<typeof createEventModule<typeof publicOnFolderDeleted>>;
2897
174
 
2898
175
  declare const context_bulkDeleteFolders: typeof bulkDeleteFolders;
2899
176
  declare const context_bulkRestoreFoldersFromTrashBin: typeof bulkRestoreFoldersFromTrashBin;