@wix/auto_sdk_gbp_media-uploads 1.0.0

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 (52) hide show
  1. package/build/cjs/index.d.ts +126 -0
  2. package/build/cjs/index.js +362 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +448 -0
  5. package/build/cjs/index.typings.js +332 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +338 -0
  8. package/build/cjs/meta.js +305 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/schemas.d.ts +195 -0
  11. package/build/cjs/schemas.js +307 -0
  12. package/build/cjs/schemas.js.map +1 -0
  13. package/build/es/index.d.mts +126 -0
  14. package/build/es/index.mjs +331 -0
  15. package/build/es/index.mjs.map +1 -0
  16. package/build/es/index.typings.d.mts +448 -0
  17. package/build/es/index.typings.mjs +301 -0
  18. package/build/es/index.typings.mjs.map +1 -0
  19. package/build/es/meta.d.mts +338 -0
  20. package/build/es/meta.mjs +271 -0
  21. package/build/es/meta.mjs.map +1 -0
  22. package/build/es/package.json +3 -0
  23. package/build/es/schemas.d.mts +195 -0
  24. package/build/es/schemas.mjs +265 -0
  25. package/build/es/schemas.mjs.map +1 -0
  26. package/build/internal/cjs/index.d.ts +126 -0
  27. package/build/internal/cjs/index.js +362 -0
  28. package/build/internal/cjs/index.js.map +1 -0
  29. package/build/internal/cjs/index.typings.d.ts +462 -0
  30. package/build/internal/cjs/index.typings.js +332 -0
  31. package/build/internal/cjs/index.typings.js.map +1 -0
  32. package/build/internal/cjs/meta.d.ts +352 -0
  33. package/build/internal/cjs/meta.js +305 -0
  34. package/build/internal/cjs/meta.js.map +1 -0
  35. package/build/internal/cjs/schemas.d.ts +195 -0
  36. package/build/internal/cjs/schemas.js +307 -0
  37. package/build/internal/cjs/schemas.js.map +1 -0
  38. package/build/internal/es/index.d.mts +126 -0
  39. package/build/internal/es/index.mjs +331 -0
  40. package/build/internal/es/index.mjs.map +1 -0
  41. package/build/internal/es/index.typings.d.mts +462 -0
  42. package/build/internal/es/index.typings.mjs +301 -0
  43. package/build/internal/es/index.typings.mjs.map +1 -0
  44. package/build/internal/es/meta.d.mts +352 -0
  45. package/build/internal/es/meta.mjs +271 -0
  46. package/build/internal/es/meta.mjs.map +1 -0
  47. package/build/internal/es/schemas.d.mts +195 -0
  48. package/build/internal/es/schemas.mjs +265 -0
  49. package/build/internal/es/schemas.mjs.map +1 -0
  50. package/meta/package.json +3 -0
  51. package/package.json +61 -0
  52. package/schemas/package.json +3 -0
@@ -0,0 +1,338 @@
1
+ import { BulkCreateMediaUploadsRequest as BulkCreateMediaUploadsRequest$1, BulkCreateMediaUploadsResponse as BulkCreateMediaUploadsResponse$1, ListMediaUploadsRequest as ListMediaUploadsRequest$1, ListMediaUploadsResponse as ListMediaUploadsResponse$1, DismissMediaUploadFailuresRequest as DismissMediaUploadFailuresRequest$1, DismissMediaUploadFailuresResponse as DismissMediaUploadFailuresResponse$1 } from './index.typings.mjs';
2
+ import '@wix/sdk-types';
3
+
4
+ /**
5
+ * One queued photo change on a Google Business Profile location: either an
6
+ * addition or a removal.
7
+ *
8
+ * Photo changes are queued and applied gradually rather than immediately,
9
+ * because Google accepts only about 10 edits per minute per Business Profile.
10
+ *
11
+ * Anything you can read here is either still waiting to be applied or has
12
+ * failed. A change that succeeded leaves nothing behind, so an empty list means
13
+ * the queue finished and everything worked. See `state`.
14
+ */
15
+ interface MediaUpload {
16
+ /**
17
+ * Queued change ID.
18
+ * @format GUID
19
+ * @readonly
20
+ */
21
+ id?: string;
22
+ /**
23
+ * ID of the location this change applies to. This is Google's location
24
+ * identifier.
25
+ * @immutable
26
+ * @minLength 1
27
+ * @maxLength 255
28
+ */
29
+ locationId?: string;
30
+ /**
31
+ * Groups the changes queued by one Bulk Create Media Uploads call. Useful for
32
+ * troubleshooting, since one save can produce more than one batch.
33
+ * @format GUID
34
+ * @readonly
35
+ */
36
+ batchId?: string;
37
+ /**
38
+ * Your own key for this photo: `logo`, `cover`, or `photo:<id>`.
39
+ *
40
+ * Set it to something stable and meaningful to you. It's how a failure is
41
+ * matched back to the photo that caused it, and it's part of what makes a
42
+ * repeated submission a duplicate rather than a second change.
43
+ * @maxLength 255
44
+ */
45
+ slotKey?: string;
46
+ /**
47
+ * Publicly reachable URL Google fetches the image from. Additions only.
48
+ *
49
+ * Keep it reachable well beyond the upload itself. A failure report renders
50
+ * this URL as a thumbnail, possibly weeks later.
51
+ * @maxLength 2048
52
+ */
53
+ sourceUrl?: string;
54
+ /** Where the photo appears on the profile. Additions only. */
55
+ category?: MediaCategoryWithLiterals;
56
+ /** Media type of the photo. Additions only. */
57
+ format?: MediaFormatWithLiterals;
58
+ /** Whether this change adds a photo to the profile or removes one. */
59
+ operation?: MediaUploadOperationWithLiterals;
60
+ /**
61
+ * Position in the order the queue applies changes, assigned by the server.
62
+ *
63
+ * Every removal comes before every addition, because Google rejects new photos
64
+ * on a profile that's already at its limit, so the old ones have to go first.
65
+ * Additions then follow as logo, cover, and gallery in the order given.
66
+ * @readonly
67
+ */
68
+ sequence?: number;
69
+ /**
70
+ * Whether this change is waiting, being applied, or has failed.
71
+ * @readonly
72
+ */
73
+ state?: MediaUploadStateWithLiterals;
74
+ /**
75
+ * How many times this change has been attempted.
76
+ * @readonly
77
+ */
78
+ attempts?: number;
79
+ /**
80
+ * Google's identifier for the photo to remove. Removals only.
81
+ * @maxLength 255
82
+ */
83
+ mediaKey?: string;
84
+ /**
85
+ * Why this change failed. Present only when `state` is `FAILED`.
86
+ * @readonly
87
+ */
88
+ failure?: MediaUploadFailure;
89
+ /**
90
+ * Date and time the change was queued.
91
+ * @readonly
92
+ */
93
+ createdDate?: Date | null;
94
+ /**
95
+ * Date and time the change was last updated.
96
+ * @readonly
97
+ */
98
+ updatedDate?: Date | null;
99
+ /**
100
+ * Revision number, incremented on every update.
101
+ * @readonly
102
+ */
103
+ revision?: string;
104
+ }
105
+ /**
106
+ * Where a media item is shown on the listing. Mirrors Google's mybusiness v4
107
+ * LocationAssociation.Category.
108
+ */
109
+ declare enum MediaCategory {
110
+ COVER = "COVER",
111
+ PROFILE = "PROFILE",
112
+ LOGO = "LOGO",
113
+ EXTERIOR = "EXTERIOR",
114
+ INTERIOR = "INTERIOR",
115
+ PRODUCT = "PRODUCT",
116
+ AT_WORK = "AT_WORK",
117
+ FOOD_AND_DRINK = "FOOD_AND_DRINK",
118
+ MENU = "MENU",
119
+ COMMON_AREA = "COMMON_AREA",
120
+ ROOMS = "ROOMS",
121
+ TEAMS = "TEAMS",
122
+ ADDITIONAL = "ADDITIONAL"
123
+ }
124
+ /** @enumType */
125
+ type MediaCategoryWithLiterals = MediaCategory | 'COVER' | 'PROFILE' | 'LOGO' | 'EXTERIOR' | 'INTERIOR' | 'PRODUCT' | 'AT_WORK' | 'FOOD_AND_DRINK' | 'MENU' | 'COMMON_AREA' | 'ROOMS' | 'TEAMS' | 'ADDITIONAL';
126
+ /** Format of a media item. Mirrors Google's mybusiness v4 MediaFormat. */
127
+ declare enum MediaFormat {
128
+ PHOTO = "PHOTO",
129
+ VIDEO = "VIDEO"
130
+ }
131
+ /** @enumType */
132
+ type MediaFormatWithLiterals = MediaFormat | 'PHOTO' | 'VIDEO';
133
+ /**
134
+ * Whether a queued change adds a photo to the profile or removes one.
135
+ *
136
+ * Removals are edits too and draw on the same per-minute budget as additions,
137
+ * which is why both go through the same queue.
138
+ */
139
+ declare enum MediaUploadOperation {
140
+ /** Add a photo to the profile. */
141
+ CREATE = "CREATE",
142
+ /** Remove a photo from the profile. */
143
+ DELETE = "DELETE"
144
+ }
145
+ /** @enumType */
146
+ type MediaUploadOperationWithLiterals = MediaUploadOperation | 'CREATE' | 'DELETE';
147
+ /**
148
+ * Where a queued photo change is in its lifecycle.
149
+ *
150
+ * There's no state for success. A change that succeeds is removed from the
151
+ * queue, because Google's own media list is the record of what's live. So an
152
+ * empty queue means everything worked, and failures stay until the next
153
+ * submission for that location replaces them or you dismiss them.
154
+ *
155
+ * One consequence is worth knowing: because success leaves nothing behind, an
156
+ * addition that succeeded and one that never ran look the same afterwards. When
157
+ * the queue can't confirm an addition reached Google, it fails the change as
158
+ * `UPLOAD_UNVERIFIED` instead of retrying it, so you don't end up with the same
159
+ * photo twice. Removals carry no such risk and are retried freely.
160
+ */
161
+ declare enum MediaUploadState {
162
+ /** Waiting its turn in the queue. */
163
+ PENDING = "PENDING",
164
+ /**
165
+ * Being applied to Google now. A change that stays here isn't one that never
166
+ * ran: its outcome isn't known yet.
167
+ */
168
+ UPLOADING = "UPLOADING",
169
+ /** Failed, and won't be retried. Kept until replaced or dismissed. */
170
+ FAILED = "FAILED"
171
+ }
172
+ /** @enumType */
173
+ type MediaUploadStateWithLiterals = MediaUploadState | 'PENDING' | 'UPLOADING' | 'FAILED';
174
+ /** Why a queued photo change failed. */
175
+ interface MediaUploadFailure {
176
+ /** Why the change failed, in terms you can show a site owner. */
177
+ reason?: MediaUploadFailureReasonWithLiterals;
178
+ }
179
+ /**
180
+ * Why a photo change failed, in terms you can show a site owner.
181
+ *
182
+ * This is often the only account of the upload they'll ever see, and they may
183
+ * read it long after the fact, so it's worth surfacing rather than logging.
184
+ */
185
+ declare enum MediaUploadFailureReason {
186
+ /** Below Google's minimum dimensions. */
187
+ IMAGE_TOO_SMALL = "IMAGE_TOO_SMALL",
188
+ /** Cover/logo ratio outside Google's accepted range. */
189
+ ASPECT_RATIO_REJECTED = "ASPECT_RATIO_REJECTED",
190
+ /** File type Google will not accept. */
191
+ FORMAT_UNSUPPORTED = "FORMAT_UNSUPPORTED",
192
+ /** Google could not fetch the image URL. */
193
+ SOURCE_UNREACHABLE = "SOURCE_UNREACHABLE",
194
+ /**
195
+ * Access to the Google account was lost. The site owner needs to connect
196
+ * again.
197
+ */
198
+ PERMISSION_REVOKED = "PERMISSION_REVOKED",
199
+ /** Google was still rate limiting after the queue used up its retries. */
200
+ RATE_LIMIT_EXHAUSTED = "RATE_LIMIT_EXHAUSTED",
201
+ /**
202
+ * The change may or may not have reached Google, and the queue chose not to
203
+ * risk a duplicate by trying again. Additions only.
204
+ *
205
+ * Unlike every other reason here, this doesn't say anything is wrong with the
206
+ * photo. It says the outcome couldn't be confirmed. Word it for the site owner
207
+ * that way: "we couldn't confirm this photo was added", not "this photo was
208
+ * rejected".
209
+ */
210
+ UPLOAD_UNVERIFIED = "UPLOAD_UNVERIFIED"
211
+ }
212
+ /** @enumType */
213
+ type MediaUploadFailureReasonWithLiterals = MediaUploadFailureReason | 'IMAGE_TOO_SMALL' | 'ASPECT_RATIO_REJECTED' | 'FORMAT_UNSUPPORTED' | 'SOURCE_UNREACHABLE' | 'PERMISSION_REVOKED' | 'RATE_LIMIT_EXHAUSTED' | 'UPLOAD_UNVERIFIED';
214
+ interface BulkCreateMediaUploadsRequest {
215
+ /**
216
+ * Photo changes to queue. All must share one `locationId` and one `operation`.
217
+ *
218
+ * Per item set `locationId`, `operation`, `slotKey`, and then either
219
+ * `sourceUrl`, `category` and `format` to add, or `mediaKey` to remove. Every
220
+ * other field is assigned by the server and ignored if you send it.
221
+ *
222
+ * Up to 52 items: 50 gallery photos plus a logo and a cover.
223
+ * @minSize 1
224
+ * @maxSize 52
225
+ */
226
+ mediaUploads: MediaUpload[];
227
+ /** Whether to return each queued item in `results.item`. */
228
+ returnEntity?: boolean;
229
+ }
230
+ interface BulkCreateMediaUploadsResponse {
231
+ /**
232
+ * Results in the order the items were sent. An item that was already queued is
233
+ * reported as a success carrying the existing item's `id`.
234
+ * @minSize 1
235
+ * @maxSize 52
236
+ */
237
+ results?: BulkCreateMediaUploadResult[];
238
+ /** How many items succeeded and failed. */
239
+ bulkActionMetadata?: BulkActionMetadata;
240
+ }
241
+ interface ItemMetadata {
242
+ /**
243
+ * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.
244
+ * @format GUID
245
+ */
246
+ id?: string | null;
247
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
248
+ originalIndex?: number;
249
+ /** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */
250
+ success?: boolean;
251
+ /** Details about the error in case of failure. */
252
+ error?: ApplicationError;
253
+ }
254
+ interface ApplicationError {
255
+ /** Error code. */
256
+ code?: string;
257
+ /** Description of the error. */
258
+ description?: string;
259
+ /** Data related to the error. */
260
+ data?: Record<string, any> | null;
261
+ }
262
+ interface BulkCreateMediaUploadResult {
263
+ /** Whether this item was queued, and why not if it wasn't. */
264
+ itemMetadata?: ItemMetadata;
265
+ /** The queued item. Returned only when `returnEntity` is `true`. */
266
+ item?: MediaUpload;
267
+ }
268
+ interface BulkActionMetadata {
269
+ /** Number of items that were successfully processed. */
270
+ totalSuccesses?: number;
271
+ /** Number of items that couldn't be processed. */
272
+ totalFailures?: number;
273
+ /** Number of failures without details because detailed failure threshold was exceeded. */
274
+ undetailedFailures?: number;
275
+ }
276
+ interface ListMediaUploadsRequest {
277
+ /**
278
+ * ID of the location. This is Google's location identifier.
279
+ * @minLength 1
280
+ * @maxLength 255
281
+ */
282
+ locationId: string;
283
+ }
284
+ interface ListMediaUploadsResponse {
285
+ /**
286
+ * Every outstanding change for the location, in the order it will be applied.
287
+ * An empty list means the queue finished and nothing failed.
288
+ *
289
+ * Never paged and never truncated. If the set is somehow too large to return,
290
+ * the call fails with `FAILED_PRECONDITION` rather than returning part of it.
291
+ * @maxSize 500
292
+ */
293
+ mediaUploads?: MediaUpload[];
294
+ }
295
+ interface DismissMediaUploadFailuresRequest {
296
+ /**
297
+ * ID of the location. This is Google's location identifier.
298
+ * @minLength 1
299
+ * @maxLength 255
300
+ */
301
+ locationId: string;
302
+ }
303
+ interface DismissMediaUploadFailuresResponse {
304
+ /** How many failed changes were cleared. */
305
+ dismissedCount?: number;
306
+ }
307
+ /** @docsIgnore */
308
+ type BulkCreateMediaUploadsApplicationErrors = {
309
+ code?: 'MEDIA_UPLOAD_INVALID_SOURCE_URL';
310
+ description?: string;
311
+ data?: Record<string, any>;
312
+ };
313
+ /** @docsIgnore */
314
+ type ListMediaUploadsApplicationErrors = {
315
+ code?: 'MEDIA_UPLOAD_LIST_TOO_LARGE';
316
+ description?: string;
317
+ data?: Record<string, any>;
318
+ };
319
+
320
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
321
+ getUrl: (context: any) => string;
322
+ httpMethod: K;
323
+ path: string;
324
+ pathParams: M;
325
+ __requestType: T;
326
+ __originalRequestType: S;
327
+ __responseType: Q;
328
+ __originalResponseType: R;
329
+ };
330
+ declare function bulkCreateMediaUploads(): __PublicMethodMetaInfo<'POST', {}, BulkCreateMediaUploadsRequest$1, BulkCreateMediaUploadsRequest, BulkCreateMediaUploadsResponse$1, BulkCreateMediaUploadsResponse>;
331
+ declare function listMediaUploads(): __PublicMethodMetaInfo<'GET', {
332
+ locationId: string;
333
+ }, ListMediaUploadsRequest$1, ListMediaUploadsRequest, ListMediaUploadsResponse$1, ListMediaUploadsResponse>;
334
+ declare function dismissMediaUploadFailures(): __PublicMethodMetaInfo<'POST', {
335
+ locationId: string;
336
+ }, DismissMediaUploadFailuresRequest$1, DismissMediaUploadFailuresRequest, DismissMediaUploadFailuresResponse$1, DismissMediaUploadFailuresResponse>;
337
+
338
+ export { type ApplicationError as ApplicationErrorOriginal, type BulkActionMetadata as BulkActionMetadataOriginal, type BulkCreateMediaUploadResult as BulkCreateMediaUploadResultOriginal, type BulkCreateMediaUploadsApplicationErrors as BulkCreateMediaUploadsApplicationErrorsOriginal, type BulkCreateMediaUploadsRequest as BulkCreateMediaUploadsRequestOriginal, type BulkCreateMediaUploadsResponse as BulkCreateMediaUploadsResponseOriginal, type DismissMediaUploadFailuresRequest as DismissMediaUploadFailuresRequestOriginal, type DismissMediaUploadFailuresResponse as DismissMediaUploadFailuresResponseOriginal, type ItemMetadata as ItemMetadataOriginal, type ListMediaUploadsApplicationErrors as ListMediaUploadsApplicationErrorsOriginal, type ListMediaUploadsRequest as ListMediaUploadsRequestOriginal, type ListMediaUploadsResponse as ListMediaUploadsResponseOriginal, MediaCategory as MediaCategoryOriginal, type MediaCategoryWithLiterals as MediaCategoryWithLiteralsOriginal, MediaFormat as MediaFormatOriginal, type MediaFormatWithLiterals as MediaFormatWithLiteralsOriginal, type MediaUploadFailure as MediaUploadFailureOriginal, MediaUploadFailureReason as MediaUploadFailureReasonOriginal, type MediaUploadFailureReasonWithLiterals as MediaUploadFailureReasonWithLiteralsOriginal, MediaUploadOperation as MediaUploadOperationOriginal, type MediaUploadOperationWithLiterals as MediaUploadOperationWithLiteralsOriginal, type MediaUpload as MediaUploadOriginal, MediaUploadState as MediaUploadStateOriginal, type MediaUploadStateWithLiterals as MediaUploadStateWithLiteralsOriginal, type __PublicMethodMetaInfo, bulkCreateMediaUploads, dismissMediaUploadFailures, listMediaUploads };
@@ -0,0 +1,271 @@
1
+ // src/gbp-location-v1-media-upload-media-uploads.http.ts
2
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
3
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
4
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
5
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
6
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
+ function resolveWixGbpLocationV1MediaUploadServiceUrl(opts) {
8
+ const domainToMappings = {
9
+ "bo._base_domain_": [
10
+ {
11
+ srcPath: "/_api/gbp-location-service",
12
+ destPath: ""
13
+ }
14
+ ],
15
+ "wixbo.ai": [
16
+ {
17
+ srcPath: "/_api/gbp-location-service",
18
+ destPath: ""
19
+ }
20
+ ],
21
+ "wix-bo.com": [
22
+ {
23
+ srcPath: "/_api/gbp-location-service",
24
+ destPath: ""
25
+ }
26
+ ],
27
+ "manage._base_domain_": [
28
+ {
29
+ srcPath: "/_api/gbp-location-service",
30
+ destPath: ""
31
+ }
32
+ ],
33
+ "www.wixapis.com": [
34
+ {
35
+ srcPath: "/gbp/v1/accounts",
36
+ destPath: "/v1/accounts"
37
+ },
38
+ {
39
+ srcPath: "/gbp/v1/address-schema",
40
+ destPath: "/v1/address-schema"
41
+ },
42
+ {
43
+ srcPath: "/gbp/v1/attribute-metadata",
44
+ destPath: "/v1/attribute-metadata"
45
+ },
46
+ {
47
+ srcPath: "/gbp/v1/bulk",
48
+ destPath: "/v1/bulk"
49
+ },
50
+ {
51
+ srcPath: "/gbp/v1/establishments",
52
+ destPath: "/v1/establishments"
53
+ },
54
+ {
55
+ srcPath: "/gbp/v1/google-locations",
56
+ destPath: "/v1/google-locations"
57
+ },
58
+ {
59
+ srcPath: "/gbp/v1/locations",
60
+ destPath: "/v1/locations"
61
+ },
62
+ {
63
+ srcPath: "/gbp/v1/regions",
64
+ destPath: "/v1/regions"
65
+ }
66
+ ]
67
+ };
68
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
69
+ }
70
+ var PACKAGE_NAME = "@wix/auto_sdk_gbp_media-uploads";
71
+ function bulkCreateMediaUploads(payload) {
72
+ function __bulkCreateMediaUploads({ host }) {
73
+ const serializedData = transformPaths(payload, [
74
+ {
75
+ transformFn: transformSDKTimestampToRESTTimestamp,
76
+ paths: [
77
+ { path: "mediaUploads.createdDate" },
78
+ { path: "mediaUploads.updatedDate" }
79
+ ]
80
+ }
81
+ ]);
82
+ const metadata = {
83
+ entityFqdn: "wix.gbp.location.v1.media_upload",
84
+ method: "POST",
85
+ methodFqn: "wix.gbp.location.v1.MediaUploadService.BulkCreateMediaUploads",
86
+ packageName: PACKAGE_NAME,
87
+ migrationOptions: {
88
+ optInTransformResponse: true
89
+ },
90
+ url: resolveWixGbpLocationV1MediaUploadServiceUrl({
91
+ protoPath: "/v1/bulk/media-uploads/create",
92
+ data: serializedData,
93
+ host
94
+ }),
95
+ data: serializedData,
96
+ transformResponse: (payload2) => transformPaths(payload2, [
97
+ {
98
+ transformFn: transformRESTTimestampToSDKTimestamp,
99
+ paths: [
100
+ { path: "results.item.createdDate" },
101
+ { path: "results.item.updatedDate" }
102
+ ]
103
+ }
104
+ ])
105
+ };
106
+ return metadata;
107
+ }
108
+ return __bulkCreateMediaUploads;
109
+ }
110
+ function listMediaUploads(payload) {
111
+ function __listMediaUploads({ host }) {
112
+ const metadata = {
113
+ entityFqdn: "wix.gbp.location.v1.media_upload",
114
+ method: "GET",
115
+ methodFqn: "wix.gbp.location.v1.MediaUploadService.ListMediaUploads",
116
+ packageName: PACKAGE_NAME,
117
+ migrationOptions: {
118
+ optInTransformResponse: true
119
+ },
120
+ url: resolveWixGbpLocationV1MediaUploadServiceUrl({
121
+ protoPath: "/v1/locations/{locationId}/media-uploads",
122
+ data: payload,
123
+ host
124
+ }),
125
+ params: toURLSearchParams(payload),
126
+ transformResponse: (payload2) => transformPaths(payload2, [
127
+ {
128
+ transformFn: transformRESTTimestampToSDKTimestamp,
129
+ paths: [
130
+ { path: "mediaUploads.createdDate" },
131
+ { path: "mediaUploads.updatedDate" }
132
+ ]
133
+ }
134
+ ])
135
+ };
136
+ return metadata;
137
+ }
138
+ return __listMediaUploads;
139
+ }
140
+ function dismissMediaUploadFailures(payload) {
141
+ function __dismissMediaUploadFailures({ host }) {
142
+ const metadata = {
143
+ entityFqdn: "wix.gbp.location.v1.media_upload",
144
+ method: "POST",
145
+ methodFqn: "wix.gbp.location.v1.MediaUploadService.DismissMediaUploadFailures",
146
+ packageName: PACKAGE_NAME,
147
+ migrationOptions: {
148
+ optInTransformResponse: true
149
+ },
150
+ url: resolveWixGbpLocationV1MediaUploadServiceUrl({
151
+ protoPath: "/v1/locations/{locationId}/media-uploads/dismiss-failures",
152
+ data: payload,
153
+ host
154
+ }),
155
+ data: payload
156
+ };
157
+ return metadata;
158
+ }
159
+ return __dismissMediaUploadFailures;
160
+ }
161
+
162
+ // src/gbp-location-v1-media-upload-media-uploads.types.ts
163
+ var MediaCategory = /* @__PURE__ */ ((MediaCategory2) => {
164
+ MediaCategory2["COVER"] = "COVER";
165
+ MediaCategory2["PROFILE"] = "PROFILE";
166
+ MediaCategory2["LOGO"] = "LOGO";
167
+ MediaCategory2["EXTERIOR"] = "EXTERIOR";
168
+ MediaCategory2["INTERIOR"] = "INTERIOR";
169
+ MediaCategory2["PRODUCT"] = "PRODUCT";
170
+ MediaCategory2["AT_WORK"] = "AT_WORK";
171
+ MediaCategory2["FOOD_AND_DRINK"] = "FOOD_AND_DRINK";
172
+ MediaCategory2["MENU"] = "MENU";
173
+ MediaCategory2["COMMON_AREA"] = "COMMON_AREA";
174
+ MediaCategory2["ROOMS"] = "ROOMS";
175
+ MediaCategory2["TEAMS"] = "TEAMS";
176
+ MediaCategory2["ADDITIONAL"] = "ADDITIONAL";
177
+ return MediaCategory2;
178
+ })(MediaCategory || {});
179
+ var MediaFormat = /* @__PURE__ */ ((MediaFormat2) => {
180
+ MediaFormat2["PHOTO"] = "PHOTO";
181
+ MediaFormat2["VIDEO"] = "VIDEO";
182
+ return MediaFormat2;
183
+ })(MediaFormat || {});
184
+ var MediaUploadOperation = /* @__PURE__ */ ((MediaUploadOperation2) => {
185
+ MediaUploadOperation2["CREATE"] = "CREATE";
186
+ MediaUploadOperation2["DELETE"] = "DELETE";
187
+ return MediaUploadOperation2;
188
+ })(MediaUploadOperation || {});
189
+ var MediaUploadState = /* @__PURE__ */ ((MediaUploadState2) => {
190
+ MediaUploadState2["PENDING"] = "PENDING";
191
+ MediaUploadState2["UPLOADING"] = "UPLOADING";
192
+ MediaUploadState2["FAILED"] = "FAILED";
193
+ return MediaUploadState2;
194
+ })(MediaUploadState || {});
195
+ var MediaUploadFailureReason = /* @__PURE__ */ ((MediaUploadFailureReason2) => {
196
+ MediaUploadFailureReason2["IMAGE_TOO_SMALL"] = "IMAGE_TOO_SMALL";
197
+ MediaUploadFailureReason2["ASPECT_RATIO_REJECTED"] = "ASPECT_RATIO_REJECTED";
198
+ MediaUploadFailureReason2["FORMAT_UNSUPPORTED"] = "FORMAT_UNSUPPORTED";
199
+ MediaUploadFailureReason2["SOURCE_UNREACHABLE"] = "SOURCE_UNREACHABLE";
200
+ MediaUploadFailureReason2["PERMISSION_REVOKED"] = "PERMISSION_REVOKED";
201
+ MediaUploadFailureReason2["RATE_LIMIT_EXHAUSTED"] = "RATE_LIMIT_EXHAUSTED";
202
+ MediaUploadFailureReason2["UPLOAD_UNVERIFIED"] = "UPLOAD_UNVERIFIED";
203
+ return MediaUploadFailureReason2;
204
+ })(MediaUploadFailureReason || {});
205
+
206
+ // src/gbp-location-v1-media-upload-media-uploads.meta.ts
207
+ function bulkCreateMediaUploads2() {
208
+ const payload = {};
209
+ const getRequestOptions = bulkCreateMediaUploads(payload);
210
+ const getUrl = (context) => {
211
+ const { url } = getRequestOptions(context);
212
+ return url;
213
+ };
214
+ return {
215
+ getUrl,
216
+ httpMethod: "POST",
217
+ path: "/v1/bulk/media-uploads/create",
218
+ pathParams: {},
219
+ __requestType: null,
220
+ __originalRequestType: null,
221
+ __responseType: null,
222
+ __originalResponseType: null
223
+ };
224
+ }
225
+ function listMediaUploads2() {
226
+ const payload = { locationId: ":locationId" };
227
+ const getRequestOptions = listMediaUploads(payload);
228
+ const getUrl = (context) => {
229
+ const { url } = getRequestOptions(context);
230
+ return url;
231
+ };
232
+ return {
233
+ getUrl,
234
+ httpMethod: "GET",
235
+ path: "/v1/locations/{locationId}/media-uploads",
236
+ pathParams: { locationId: "locationId" },
237
+ __requestType: null,
238
+ __originalRequestType: null,
239
+ __responseType: null,
240
+ __originalResponseType: null
241
+ };
242
+ }
243
+ function dismissMediaUploadFailures2() {
244
+ const payload = { locationId: ":locationId" };
245
+ const getRequestOptions = dismissMediaUploadFailures(payload);
246
+ const getUrl = (context) => {
247
+ const { url } = getRequestOptions(context);
248
+ return url;
249
+ };
250
+ return {
251
+ getUrl,
252
+ httpMethod: "POST",
253
+ path: "/v1/locations/{locationId}/media-uploads/dismiss-failures",
254
+ pathParams: { locationId: "locationId" },
255
+ __requestType: null,
256
+ __originalRequestType: null,
257
+ __responseType: null,
258
+ __originalResponseType: null
259
+ };
260
+ }
261
+ export {
262
+ MediaCategory as MediaCategoryOriginal,
263
+ MediaFormat as MediaFormatOriginal,
264
+ MediaUploadFailureReason as MediaUploadFailureReasonOriginal,
265
+ MediaUploadOperation as MediaUploadOperationOriginal,
266
+ MediaUploadState as MediaUploadStateOriginal,
267
+ bulkCreateMediaUploads2 as bulkCreateMediaUploads,
268
+ dismissMediaUploadFailures2 as dismissMediaUploadFailures,
269
+ listMediaUploads2 as listMediaUploads
270
+ };
271
+ //# sourceMappingURL=meta.mjs.map