@wix/media 1.0.59 → 1.0.60

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.
Files changed (142) hide show
  1. package/build/cjs/context.d.ts +4 -0
  2. package/build/cjs/context.js +31 -0
  3. package/build/cjs/context.js.map +1 -0
  4. package/build/cjs/index.d.ts +2 -0
  5. package/build/cjs/index.js +3 -1
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/index.typings.d.ts +2 -0
  8. package/build/cjs/index.typings.js +3 -1
  9. package/build/cjs/index.typings.js.map +1 -1
  10. package/build/cjs/meta.d.ts +2 -0
  11. package/build/cjs/meta.js +3 -1
  12. package/build/cjs/meta.js.map +1 -1
  13. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +8 -0
  14. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js +71 -0
  15. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +1 -0
  16. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +17 -0
  17. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js +245 -0
  18. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +1 -0
  19. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +24 -0
  20. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js +142 -0
  21. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +1 -0
  22. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +26 -0
  23. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js +49 -0
  24. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +1 -0
  25. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +221 -0
  26. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js +22 -0
  27. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +1 -0
  28. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +315 -0
  29. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js +407 -0
  30. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +1 -0
  31. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +13 -0
  32. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js +126 -0
  33. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +1 -0
  34. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +30 -0
  35. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js +446 -0
  36. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +1 -0
  37. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +33 -0
  38. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js +237 -0
  39. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +1 -0
  40. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +59 -0
  41. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js +81 -0
  42. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +1 -0
  43. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +949 -0
  44. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js +27 -0
  45. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +1 -0
  46. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +907 -0
  47. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js +748 -0
  48. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +1 -0
  49. package/build/cjs/src/media-site-media-v1-file-descriptor.context.d.ts +18 -0
  50. package/build/cjs/src/media-site-media-v1-file-descriptor.context.js +181 -0
  51. package/build/cjs/src/media-site-media-v1-file-descriptor.context.js.map +1 -0
  52. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +6 -4
  53. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
  54. package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +2 -1
  55. package/build/cjs/src/media-site-media-v1-file-descriptor.public.js +6 -1
  56. package/build/cjs/src/media-site-media-v1-file-descriptor.public.js.map +1 -1
  57. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +31 -24
  58. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +6 -30
  59. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
  60. package/build/cjs/src/media-site-media-v1-folder.context.d.ts +11 -0
  61. package/build/cjs/src/media-site-media-v1-folder.context.js +104 -0
  62. package/build/cjs/src/media-site-media-v1-folder.context.js.map +1 -0
  63. package/build/cjs/src/media-site-media-v1-folder.http.js +6 -4
  64. package/build/cjs/src/media-site-media-v1-folder.http.js.map +1 -1
  65. package/build/cjs/src/media-site-media-v1-folder.public.d.ts +2 -1
  66. package/build/cjs/src/media-site-media-v1-folder.public.js +5 -1
  67. package/build/cjs/src/media-site-media-v1-folder.public.js.map +1 -1
  68. package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +30 -24
  69. package/build/cjs/src/media-site-media-v1-folder.universal.js +5 -23
  70. package/build/cjs/src/media-site-media-v1-folder.universal.js.map +1 -1
  71. package/build/es/context.d.ts +4 -0
  72. package/build/es/context.js +5 -0
  73. package/build/es/context.js.map +1 -0
  74. package/build/es/index.d.ts +2 -0
  75. package/build/es/index.js +2 -0
  76. package/build/es/index.js.map +1 -1
  77. package/build/es/index.typings.d.ts +2 -0
  78. package/build/es/index.typings.js +2 -0
  79. package/build/es/index.typings.js.map +1 -1
  80. package/build/es/meta.d.ts +2 -0
  81. package/build/es/meta.js +2 -0
  82. package/build/es/meta.js.map +1 -1
  83. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +8 -0
  84. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js +62 -0
  85. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +1 -0
  86. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +17 -0
  87. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js +236 -0
  88. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +1 -0
  89. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +24 -0
  90. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js +110 -0
  91. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +1 -0
  92. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +26 -0
  93. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js +35 -0
  94. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +1 -0
  95. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +221 -0
  96. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js +19 -0
  97. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +1 -0
  98. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +315 -0
  99. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js +375 -0
  100. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +1 -0
  101. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +13 -0
  102. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js +112 -0
  103. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +1 -0
  104. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +30 -0
  105. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js +432 -0
  106. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +1 -0
  107. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +33 -0
  108. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js +200 -0
  109. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +1 -0
  110. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +59 -0
  111. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js +60 -0
  112. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +1 -0
  113. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +949 -0
  114. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js +24 -0
  115. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +1 -0
  116. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +907 -0
  117. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js +711 -0
  118. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +1 -0
  119. package/build/es/src/media-site-media-v1-file-descriptor.context.d.ts +18 -0
  120. package/build/es/src/media-site-media-v1-file-descriptor.context.js +162 -0
  121. package/build/es/src/media-site-media-v1-file-descriptor.context.js.map +1 -0
  122. package/build/es/src/media-site-media-v1-file-descriptor.http.js +6 -4
  123. package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
  124. package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +2 -1
  125. package/build/es/src/media-site-media-v1-file-descriptor.public.js +1 -0
  126. package/build/es/src/media-site-media-v1-file-descriptor.public.js.map +1 -1
  127. package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +31 -24
  128. package/build/es/src/media-site-media-v1-file-descriptor.universal.js +5 -29
  129. package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
  130. package/build/es/src/media-site-media-v1-folder.context.d.ts +11 -0
  131. package/build/es/src/media-site-media-v1-folder.context.js +92 -0
  132. package/build/es/src/media-site-media-v1-folder.context.js.map +1 -0
  133. package/build/es/src/media-site-media-v1-folder.http.js +6 -4
  134. package/build/es/src/media-site-media-v1-folder.http.js.map +1 -1
  135. package/build/es/src/media-site-media-v1-folder.public.d.ts +2 -1
  136. package/build/es/src/media-site-media-v1-folder.public.js +1 -0
  137. package/build/es/src/media-site-media-v1-folder.public.js.map +1 -1
  138. package/build/es/src/media-site-media-v1-folder.universal.d.ts +30 -24
  139. package/build/es/src/media-site-media-v1-folder.universal.js +4 -22
  140. package/build/es/src/media-site-media-v1-folder.universal.js.map +1 -1
  141. package/context/package.json +6 -0
  142. package/package.json +7 -5
@@ -0,0 +1,315 @@
1
+ import { EventDefinition } from '@wix/sdk-types';
2
+ export interface EnterpriseCategory {
3
+ /**
4
+ * Id of the category
5
+ * @readonly
6
+ */
7
+ _id?: string;
8
+ /** The display name that will be shown for the item */
9
+ displayName?: string | null;
10
+ /** Id of the parent category, will default to the account master category */
11
+ parentCategoryId?: string | null;
12
+ /** Sort order number of the category, will determine the order of the category with other categories under the same parent category */
13
+ sortOrder?: number | null;
14
+ /** Publish status of the category */
15
+ publishStatus?: PublishStatus;
16
+ /**
17
+ * Date and time the category was created.
18
+ * @readonly
19
+ */
20
+ _createdDate?: Date;
21
+ /**
22
+ * Date and time the category was updated.
23
+ * @readonly
24
+ */
25
+ _updatedDate?: Date;
26
+ }
27
+ export declare enum PublishStatus {
28
+ UNDEFINED = "UNDEFINED",
29
+ UNPUBLISHED = "UNPUBLISHED",
30
+ PUBLISHED = "PUBLISHED",
31
+ WIX_ONLY = "WIX_ONLY"
32
+ }
33
+ export declare enum MediaType {
34
+ MIXED = "MIXED",
35
+ IMAGE = "IMAGE",
36
+ VIDEO = "VIDEO",
37
+ AUDIO = "AUDIO",
38
+ DOCUMENT = "DOCUMENT",
39
+ VECTOR = "VECTOR",
40
+ ARCHIVE = "ARCHIVE",
41
+ MODEL3D = "MODEL3D"
42
+ }
43
+ export interface CreateCategoryRequest {
44
+ /** The category object that will be created */
45
+ category: EnterpriseCategory;
46
+ }
47
+ export interface CreateCategoryResponse {
48
+ /** A list of items matching the request */
49
+ category?: EnterpriseCategory;
50
+ }
51
+ export interface DeleteCategoryRequest {
52
+ /** Category id */
53
+ categoryId: string;
54
+ }
55
+ export interface DeleteCategoryResponse {
56
+ }
57
+ export interface UpdateCategoryRequest {
58
+ /** The category object that will be created */
59
+ category: EnterpriseCategory;
60
+ }
61
+ export interface UpdateCategoryResponse {
62
+ /** The updated category */
63
+ category?: EnterpriseCategory;
64
+ }
65
+ export interface GetCategoryRequest {
66
+ /** Category id */
67
+ categoryId: string;
68
+ /** number of sub category levels */
69
+ levels?: number | null;
70
+ /** filter categories by publish statuses. When empty will return PUBLISHED and UNPUBLISHED */
71
+ publishStatus?: PublishStatus;
72
+ }
73
+ export interface GetCategoryResponse {
74
+ /** The category details */
75
+ category?: EnterpriseCategoryTree;
76
+ }
77
+ export interface EnterpriseCategoryTree {
78
+ /** Category information */
79
+ category?: EnterpriseCategory;
80
+ /** Information about the sub categories */
81
+ subCategories?: EnterpriseCategoryTree[];
82
+ }
83
+ export interface EnterpriseOnboardingRequest {
84
+ /** The account id of the organization - will be used as the organization category id */
85
+ accountId: string;
86
+ /** The account name of the organization - will be used as the organization category name */
87
+ accountName?: string;
88
+ }
89
+ export interface EnterpriseOnboardingResponse {
90
+ /** The enterprise category */
91
+ category?: EnterpriseCategory;
92
+ }
93
+ export interface LinkItemsToCategoryRequest {
94
+ /** The category to link to */
95
+ categoryId?: string;
96
+ /** The item ids that will be added to the category */
97
+ itemIds?: string[];
98
+ }
99
+ export interface LinkItemsToCategoryResponse {
100
+ }
101
+ export interface UnlinkItemsFromCategoryRequest {
102
+ /** The category to link to */
103
+ categoryId?: string;
104
+ /** The item ids that will be added to the category */
105
+ itemIds?: string[];
106
+ }
107
+ export interface UnlinkItemsFromCategoryResponse {
108
+ }
109
+ export interface GetMediaManagerCategoriesRequest {
110
+ }
111
+ export interface GetMediaManagerCategoriesResponse {
112
+ /** The category details */
113
+ category?: EnterpriseCategoryTree;
114
+ }
115
+ export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
116
+ createdEvent?: EntityCreatedEvent<T>;
117
+ updatedEvent?: EntityUpdatedEvent<T>;
118
+ deletedEvent?: EntityDeletedEvent<T>;
119
+ actionEvent?: ActionEvent<T>;
120
+ /**
121
+ * Unique event ID.
122
+ * Allows clients to ignore duplicate webhooks.
123
+ */
124
+ _id?: string;
125
+ /**
126
+ * Assumes actions are also always typed to an entity_type
127
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
128
+ */
129
+ entityFqdn?: string;
130
+ /**
131
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
132
+ * This is although the created/updated/deleted notion is duplication of the oneof types
133
+ * Example: created/updated/deleted/started/completed/email_opened
134
+ */
135
+ slug?: string;
136
+ /** ID of the entity associated with the event. */
137
+ entityId?: string;
138
+ /** Event timestamp. */
139
+ eventTime?: Date;
140
+ /**
141
+ * Whether the event was triggered as a result of a privacy regulation application
142
+ * (for example, GDPR).
143
+ */
144
+ triggeredByAnonymizeRequest?: boolean | null;
145
+ /** If present, indicates the action that triggered the event. */
146
+ originatedFrom?: string | null;
147
+ /**
148
+ * A sequence number defining the order of updates to the underlying entity.
149
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
150
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
151
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
152
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
153
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
154
+ */
155
+ entityEventSequence?: string | null;
156
+ }
157
+ export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
158
+ }
159
+ export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
160
+ }
161
+ export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
162
+ }
163
+ export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
164
+ }
165
+ /** @oneof */
166
+ export interface DomainEventBodyOneOf<T> {
167
+ createdEvent?: EntityCreatedEvent<T>;
168
+ updatedEvent?: EntityUpdatedEvent<T>;
169
+ deletedEvent?: EntityDeletedEvent<T>;
170
+ actionEvent?: ActionEvent<T>;
171
+ }
172
+ export interface EntityCreatedEvent<T> {
173
+ entity?: T;
174
+ }
175
+ export interface EntityUpdatedEvent<T> {
176
+ /**
177
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
178
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
179
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
180
+ */
181
+ currentEntity?: T;
182
+ }
183
+ export interface EntityDeletedEvent<T> {
184
+ /** Entity that was deleted */
185
+ deletedEntity?: T | null;
186
+ }
187
+ export interface ActionEvent<T> {
188
+ body?: T;
189
+ }
190
+ export interface CreateCategoryResponseNonNullableFields {
191
+ category?: {
192
+ _id: string;
193
+ publishStatus: PublishStatus;
194
+ };
195
+ }
196
+ export interface UpdateCategoryResponseNonNullableFields {
197
+ category?: {
198
+ _id: string;
199
+ publishStatus: PublishStatus;
200
+ };
201
+ }
202
+ export interface GetCategoryResponseNonNullableFields {
203
+ category?: {
204
+ category?: {
205
+ _id: string;
206
+ publishStatus: PublishStatus;
207
+ };
208
+ subCategories: NonNullable<GetCategoryResponseNonNullableFields>['category'][];
209
+ };
210
+ }
211
+ export interface EnterpriseOnboardingResponseNonNullableFields {
212
+ category?: {
213
+ _id: string;
214
+ publishStatus: PublishStatus;
215
+ };
216
+ }
217
+ export interface GetMediaManagerCategoriesResponseNonNullableFields {
218
+ category?: {
219
+ category?: {
220
+ _id: string;
221
+ publishStatus: PublishStatus;
222
+ };
223
+ subCategories: NonNullable<GetMediaManagerCategoriesResponseNonNullableFields>['category'][];
224
+ };
225
+ }
226
+ export declare const onEnterpriseCategoryCreated: EventDefinition<DomainCreatedEvent<EnterpriseCategory>, "wix.media.enterprise_public_media.v1.enterprise_category_created">;
227
+ export declare const onEnterpriseCategoryDeleted: EventDefinition<DomainDeletedEvent<EnterpriseCategory>, "wix.media.enterprise_public_media.v1.enterprise_category_deleted">;
228
+ export declare const onEnterpriseCategoryUpdated: EventDefinition<DomainUpdatedEvent<EnterpriseCategory>, "wix.media.enterprise_public_media.v1.enterprise_category_updated">;
229
+ /**
230
+ * Fetch a list of random media from different providers, using site information to customize results when available
231
+ * @param category - The category object that will be created
232
+ * @public
233
+ * @documentationMaturity preview
234
+ * @requiredField category
235
+ * @requiredField category.displayName
236
+ * @returns A list of items matching the request
237
+ */
238
+ export declare function createCategory(category: EnterpriseCategory): Promise<EnterpriseCategory & NonNullable<CreateCategoryResponseNonNullableFields>['category']>;
239
+ /**
240
+ * Delete a category including all its subcategories - but not the items
241
+ * @param categoryId - Category id
242
+ * @public
243
+ * @documentationMaturity preview
244
+ * @requiredField categoryId
245
+ */
246
+ export declare function deleteCategory(categoryId: string): Promise<void>;
247
+ /**
248
+ * Update category details
249
+ * @param _id - Id of the category
250
+ * @public
251
+ * @documentationMaturity preview
252
+ * @requiredField _id
253
+ * @requiredField category
254
+ * @returns The updated category
255
+ */
256
+ export declare function updateCategory(_id: string, category: UpdateCategory): Promise<EnterpriseCategory & NonNullable<UpdateCategoryResponseNonNullableFields>['category']>;
257
+ export interface UpdateCategory {
258
+ /**
259
+ * Id of the category
260
+ * @readonly
261
+ */
262
+ _id?: string;
263
+ /** The display name that will be shown for the item */
264
+ displayName?: string | null;
265
+ /** Id of the parent category, will default to the account master category */
266
+ parentCategoryId?: string | null;
267
+ /** Sort order number of the category, will determine the order of the category with other categories under the same parent category */
268
+ sortOrder?: number | null;
269
+ /** Publish status of the category */
270
+ publishStatus?: PublishStatus;
271
+ /**
272
+ * Date and time the category was created.
273
+ * @readonly
274
+ */
275
+ _createdDate?: Date;
276
+ /**
277
+ * Date and time the category was updated.
278
+ * @readonly
279
+ */
280
+ _updatedDate?: Date;
281
+ }
282
+ /**
283
+ * Get information about a specific category
284
+ * @param categoryId - Category id
285
+ * @public
286
+ * @documentationMaturity preview
287
+ * @requiredField categoryId
288
+ * @returns The category details
289
+ */
290
+ export declare function getCategory(categoryId: string, options?: GetCategoryOptions): Promise<EnterpriseCategoryTree & NonNullable<GetCategoryResponseNonNullableFields>['category']>;
291
+ export interface GetCategoryOptions {
292
+ /** number of sub category levels */
293
+ levels?: number | null;
294
+ /** filter categories by publish statuses. When empty will return PUBLISHED and UNPUBLISHED */
295
+ publishStatus?: PublishStatus;
296
+ }
297
+ /**
298
+ * Create the enterprise category under "enterprise-media" main category
299
+ * the caller identity must be have the same accountId of the request
300
+ * @param accountId - The account id of the organization - will be used as the organization category id
301
+ * @public
302
+ * @documentationMaturity preview
303
+ * @requiredField accountId
304
+ */
305
+ export declare function enterpriseOnboarding(accountId: string, options?: EnterpriseOnboardingOptions): Promise<EnterpriseOnboardingResponse & EnterpriseOnboardingResponseNonNullableFields>;
306
+ export interface EnterpriseOnboardingOptions {
307
+ /** The account name of the organization - will be used as the organization category name */
308
+ accountName?: string;
309
+ }
310
+ /**
311
+ * Get the account category tree details
312
+ * @public
313
+ * @documentationMaturity preview
314
+ */
315
+ export declare function getMediaManagerCategories(): Promise<GetMediaManagerCategoriesResponse & GetMediaManagerCategoriesResponseNonNullableFields>;
@@ -0,0 +1,375 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { serializer } from '@wix/metro-runtime/velo';
11
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
12
+ import { EventDefinition } from '@wix/sdk-types';
13
+ import * as ambassadorWixMediaEnterprisePublicMediaV1EnterpriseCategory from './media-enterprise-public-media-v1-enterprise-category.http';
14
+ const _toVeloEntity = '$';
15
+ const _fromVeloEntity = '$';
16
+ export var PublishStatus;
17
+ (function (PublishStatus) {
18
+ PublishStatus["UNDEFINED"] = "UNDEFINED";
19
+ PublishStatus["UNPUBLISHED"] = "UNPUBLISHED";
20
+ PublishStatus["PUBLISHED"] = "PUBLISHED";
21
+ PublishStatus["WIX_ONLY"] = "WIX_ONLY";
22
+ })(PublishStatus || (PublishStatus = {}));
23
+ export var MediaType;
24
+ (function (MediaType) {
25
+ MediaType["MIXED"] = "MIXED";
26
+ MediaType["IMAGE"] = "IMAGE";
27
+ MediaType["VIDEO"] = "VIDEO";
28
+ MediaType["AUDIO"] = "AUDIO";
29
+ MediaType["DOCUMENT"] = "DOCUMENT";
30
+ MediaType["VECTOR"] = "VECTOR";
31
+ MediaType["ARCHIVE"] = "ARCHIVE";
32
+ MediaType["MODEL3D"] = "MODEL3D";
33
+ })(MediaType || (MediaType = {}));
34
+ const _createCategoryRequest = {};
35
+ const _createCategoryResponse = {};
36
+ const _deleteCategoryRequest = {};
37
+ const _deleteCategoryResponse = {};
38
+ const _enterpriseCategoryTree = { subCategories: '_enterpriseCategoryTree' };
39
+ const _enterpriseOnboardingRequest = {};
40
+ const _enterpriseOnboardingResponse = {};
41
+ const _getCategoryRequest = {};
42
+ const _getCategoryResponse = { category: '_enterpriseCategoryTree' };
43
+ const _getMediaManagerCategoriesRequest = {};
44
+ const _getMediaManagerCategoriesResponse = {
45
+ category: '_enterpriseCategoryTree',
46
+ };
47
+ const _updateCategoryRequest = {};
48
+ const _updateCategoryResponse = {};
49
+ export const onEnterpriseCategoryCreated = EventDefinition('wix.media.enterprise_public_media.v1.enterprise_category_created')();
50
+ export const onEnterpriseCategoryDeleted = EventDefinition('wix.media.enterprise_public_media.v1.enterprise_category_deleted')();
51
+ export const onEnterpriseCategoryUpdated = EventDefinition('wix.media.enterprise_public_media.v1.enterprise_category_updated')();
52
+ /**
53
+ * Fetch a list of random media from different providers, using site information to customize results when available
54
+ * @param category - The category object that will be created
55
+ * @public
56
+ * @documentationMaturity preview
57
+ * @requiredField category
58
+ * @requiredField category.displayName
59
+ * @returns A list of items matching the request
60
+ */
61
+ export function createCategory(category) {
62
+ var _a, _b, _c;
63
+ return __awaiter(this, arguments, void 0, function* () {
64
+ const requestTransformation = { category: '$[0]' };
65
+ const responseTransformation = '$.category';
66
+ // @ts-ignore
67
+ const { httpClient, sideEffects } = arguments[1];
68
+ const { toAmbassadorRequest } = serializer({
69
+ rootSchema: _createCategoryRequest,
70
+ depSchemas: {},
71
+ fqdnTransformation: {
72
+ paths: [...['category']],
73
+ transformation: _fromVeloEntity,
74
+ },
75
+ customTransformation: requestTransformation,
76
+ });
77
+ const { fromJSON } = serializer({
78
+ rootSchema: _createCategoryResponse,
79
+ depSchemas: {},
80
+ fqdnTransformation: {
81
+ paths: [...['category']],
82
+ transformation: _toVeloEntity,
83
+ },
84
+ customTransformation: responseTransformation,
85
+ });
86
+ const payload = toAmbassadorRequest([category]);
87
+ const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseCategory.createCategory(payload);
88
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
89
+ try {
90
+ const result = yield httpClient.request(reqOpts);
91
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
92
+ return fromJSON(result.data);
93
+ }
94
+ catch (err) {
95
+ const transformedError = sdkTransformError(err, {
96
+ spreadPathsToArguments: {},
97
+ explicitPathsToArguments: { category: '$[0]' },
98
+ singleArgumentUnchanged: false,
99
+ }, ['category']);
100
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
101
+ throw transformedError;
102
+ }
103
+ });
104
+ }
105
+ /**
106
+ * Delete a category including all its subcategories - but not the items
107
+ * @param categoryId - Category id
108
+ * @public
109
+ * @documentationMaturity preview
110
+ * @requiredField categoryId
111
+ */
112
+ export function deleteCategory(categoryId) {
113
+ var _a, _b, _c;
114
+ return __awaiter(this, arguments, void 0, function* () {
115
+ const requestTransformation = { categoryId: '$[0]' };
116
+ const responseTransformation = '$';
117
+ // @ts-ignore
118
+ const { httpClient, sideEffects } = arguments[1];
119
+ const { toAmbassadorRequest } = serializer({
120
+ rootSchema: _deleteCategoryRequest,
121
+ depSchemas: {},
122
+ fqdnTransformation: {
123
+ paths: [],
124
+ transformation: _fromVeloEntity,
125
+ },
126
+ customTransformation: requestTransformation,
127
+ });
128
+ const { fromJSON } = serializer({
129
+ rootSchema: _deleteCategoryResponse,
130
+ depSchemas: {},
131
+ fqdnTransformation: {
132
+ paths: [],
133
+ transformation: _toVeloEntity,
134
+ },
135
+ customTransformation: responseTransformation,
136
+ });
137
+ const payload = toAmbassadorRequest([categoryId]);
138
+ const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseCategory.deleteCategory(payload);
139
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
140
+ try {
141
+ const result = yield httpClient.request(reqOpts);
142
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
143
+ }
144
+ catch (err) {
145
+ const transformedError = sdkTransformError(err, {
146
+ spreadPathsToArguments: {},
147
+ explicitPathsToArguments: { categoryId: '$[0]' },
148
+ singleArgumentUnchanged: false,
149
+ }, ['categoryId']);
150
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
151
+ throw transformedError;
152
+ }
153
+ });
154
+ }
155
+ /**
156
+ * Update category details
157
+ * @param _id - Id of the category
158
+ * @public
159
+ * @documentationMaturity preview
160
+ * @requiredField _id
161
+ * @requiredField category
162
+ * @returns The updated category
163
+ */
164
+ export function updateCategory(_id, category) {
165
+ var _a, _b, _c;
166
+ return __awaiter(this, arguments, void 0, function* () {
167
+ const requestTransformation = { category: { '*': '$[1]', id: '$[0]' } };
168
+ const responseTransformation = '$.category';
169
+ // @ts-ignore
170
+ const { httpClient, sideEffects } = arguments[2];
171
+ const { toAmbassadorRequest } = serializer({
172
+ rootSchema: _updateCategoryRequest,
173
+ depSchemas: {},
174
+ fqdnTransformation: {
175
+ paths: [...['category']],
176
+ transformation: _fromVeloEntity,
177
+ },
178
+ customTransformation: requestTransformation,
179
+ });
180
+ const { fromJSON } = serializer({
181
+ rootSchema: _updateCategoryResponse,
182
+ depSchemas: {},
183
+ fqdnTransformation: {
184
+ paths: [...['category']],
185
+ transformation: _toVeloEntity,
186
+ },
187
+ customTransformation: responseTransformation,
188
+ });
189
+ const payload = toAmbassadorRequest([_id, category]);
190
+ const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseCategory.updateCategory(payload);
191
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
192
+ try {
193
+ const result = yield httpClient.request(reqOpts);
194
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
195
+ return fromJSON(result.data);
196
+ }
197
+ catch (err) {
198
+ const transformedError = sdkTransformError(err, {
199
+ spreadPathsToArguments: { category: '$[1]' },
200
+ explicitPathsToArguments: { 'category.id': '$[0]' },
201
+ singleArgumentUnchanged: false,
202
+ }, ['_id', 'category']);
203
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
204
+ throw transformedError;
205
+ }
206
+ });
207
+ }
208
+ /**
209
+ * Get information about a specific category
210
+ * @param categoryId - Category id
211
+ * @public
212
+ * @documentationMaturity preview
213
+ * @requiredField categoryId
214
+ * @returns The category details
215
+ */
216
+ export function getCategory(categoryId, options) {
217
+ var _a, _b, _c;
218
+ return __awaiter(this, arguments, void 0, function* () {
219
+ const requestTransformation = {
220
+ categoryId: '$[0]',
221
+ levels: '$[1].levels',
222
+ publishStatus: '$[1].publishStatus',
223
+ };
224
+ const responseTransformation = '$.category';
225
+ // @ts-ignore
226
+ const { httpClient, sideEffects } = arguments[2];
227
+ const { toAmbassadorRequest } = serializer({
228
+ rootSchema: _getCategoryRequest,
229
+ depSchemas: {},
230
+ fqdnTransformation: {
231
+ paths: [],
232
+ transformation: _fromVeloEntity,
233
+ },
234
+ customTransformation: requestTransformation,
235
+ });
236
+ const { fromJSON } = serializer({
237
+ rootSchema: _getCategoryResponse,
238
+ depSchemas: { _enterpriseCategoryTree },
239
+ fqdnTransformation: {
240
+ paths: [...['category.category']],
241
+ transformation: _toVeloEntity,
242
+ },
243
+ customTransformation: responseTransformation,
244
+ });
245
+ const payload = toAmbassadorRequest([categoryId, options]);
246
+ const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseCategory.getCategory(payload);
247
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
248
+ try {
249
+ const result = yield httpClient.request(reqOpts);
250
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
251
+ return fromJSON(result.data);
252
+ }
253
+ catch (err) {
254
+ const transformedError = sdkTransformError(err, {
255
+ spreadPathsToArguments: {},
256
+ explicitPathsToArguments: {
257
+ categoryId: '$[0]',
258
+ levels: '$[1].levels',
259
+ publishStatus: '$[1].publishStatus',
260
+ },
261
+ singleArgumentUnchanged: false,
262
+ }, ['categoryId', 'options']);
263
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
264
+ throw transformedError;
265
+ }
266
+ });
267
+ }
268
+ /**
269
+ * Create the enterprise category under "enterprise-media" main category
270
+ * the caller identity must be have the same accountId of the request
271
+ * @param accountId - The account id of the organization - will be used as the organization category id
272
+ * @public
273
+ * @documentationMaturity preview
274
+ * @requiredField accountId
275
+ */
276
+ export function enterpriseOnboarding(accountId, options) {
277
+ var _a, _b, _c;
278
+ return __awaiter(this, arguments, void 0, function* () {
279
+ const requestTransformation = {
280
+ accountId: '$[0]',
281
+ accountName: '$[1].accountName',
282
+ };
283
+ const responseTransformation = '$';
284
+ // @ts-ignore
285
+ const { httpClient, sideEffects } = arguments[2];
286
+ const { toAmbassadorRequest } = serializer({
287
+ rootSchema: _enterpriseOnboardingRequest,
288
+ depSchemas: {},
289
+ fqdnTransformation: {
290
+ paths: [],
291
+ transformation: _fromVeloEntity,
292
+ },
293
+ customTransformation: requestTransformation,
294
+ });
295
+ const { fromJSON } = serializer({
296
+ rootSchema: _enterpriseOnboardingResponse,
297
+ depSchemas: {},
298
+ fqdnTransformation: {
299
+ paths: [...['category']],
300
+ transformation: _toVeloEntity,
301
+ },
302
+ customTransformation: responseTransformation,
303
+ });
304
+ const payload = toAmbassadorRequest([accountId, options]);
305
+ const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseCategory.enterpriseOnboarding(payload);
306
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
307
+ try {
308
+ const result = yield httpClient.request(reqOpts);
309
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
310
+ return fromJSON(result.data);
311
+ }
312
+ catch (err) {
313
+ const transformedError = sdkTransformError(err, {
314
+ spreadPathsToArguments: {},
315
+ explicitPathsToArguments: {
316
+ accountId: '$[0]',
317
+ accountName: '$[1].accountName',
318
+ },
319
+ singleArgumentUnchanged: false,
320
+ }, ['accountId', 'options']);
321
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
322
+ throw transformedError;
323
+ }
324
+ });
325
+ }
326
+ /**
327
+ * Get the account category tree details
328
+ * @public
329
+ * @documentationMaturity preview
330
+ */
331
+ export function getMediaManagerCategories() {
332
+ var _a, _b, _c;
333
+ return __awaiter(this, arguments, void 0, function* () {
334
+ const requestTransformation = {};
335
+ const responseTransformation = '$';
336
+ // @ts-ignore
337
+ const { httpClient, sideEffects } = arguments[0];
338
+ const { toAmbassadorRequest } = serializer({
339
+ rootSchema: _getMediaManagerCategoriesRequest,
340
+ depSchemas: {},
341
+ fqdnTransformation: {
342
+ paths: [],
343
+ transformation: _fromVeloEntity,
344
+ },
345
+ customTransformation: requestTransformation,
346
+ });
347
+ const { fromJSON } = serializer({
348
+ rootSchema: _getMediaManagerCategoriesResponse,
349
+ depSchemas: { _enterpriseCategoryTree },
350
+ fqdnTransformation: {
351
+ paths: [...['category.category']],
352
+ transformation: _toVeloEntity,
353
+ },
354
+ customTransformation: responseTransformation,
355
+ });
356
+ const payload = toAmbassadorRequest([]);
357
+ const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseCategory.getMediaManagerCategories(payload);
358
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
359
+ try {
360
+ const result = yield httpClient.request(reqOpts);
361
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
362
+ return fromJSON(result.data);
363
+ }
364
+ catch (err) {
365
+ const transformedError = sdkTransformError(err, {
366
+ spreadPathsToArguments: {},
367
+ explicitPathsToArguments: {},
368
+ singleArgumentUnchanged: false,
369
+ }, []);
370
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
371
+ throw transformedError;
372
+ }
373
+ });
374
+ }
375
+ //# sourceMappingURL=media-enterprise-public-media-v1-enterprise-category.universal.js.map