@wix/auto_sdk_ecom_order-payment-requests 1.0.61 → 1.0.62

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 (49) hide show
  1. package/build/cjs/index.d.ts +16 -3
  2. package/build/cjs/index.js +100 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +90 -1
  5. package/build/cjs/index.typings.js +91 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +70 -2
  8. package/build/cjs/meta.js +65 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +5 -1
  11. package/build/cjs/schemas.js +13 -2
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +16 -3
  14. package/build/es/index.mjs +99 -0
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +90 -1
  17. package/build/es/index.typings.mjs +90 -0
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +70 -2
  20. package/build/es/meta.mjs +64 -0
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +5 -1
  23. package/build/es/schemas.mjs +10 -1
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +23 -5
  26. package/build/internal/cjs/index.js +100 -0
  27. package/build/internal/cjs/index.js.map +1 -1
  28. package/build/internal/cjs/index.typings.d.ts +99 -2
  29. package/build/internal/cjs/index.typings.js +91 -0
  30. package/build/internal/cjs/index.typings.js.map +1 -1
  31. package/build/internal/cjs/meta.d.ts +70 -2
  32. package/build/internal/cjs/meta.js +65 -0
  33. package/build/internal/cjs/meta.js.map +1 -1
  34. package/build/internal/cjs/schemas.d.ts +5 -1
  35. package/build/internal/cjs/schemas.js +13 -2
  36. package/build/internal/cjs/schemas.js.map +1 -1
  37. package/build/internal/es/index.d.mts +23 -5
  38. package/build/internal/es/index.mjs +99 -0
  39. package/build/internal/es/index.mjs.map +1 -1
  40. package/build/internal/es/index.typings.d.mts +99 -2
  41. package/build/internal/es/index.typings.mjs +90 -0
  42. package/build/internal/es/index.typings.mjs.map +1 -1
  43. package/build/internal/es/meta.d.mts +70 -2
  44. package/build/internal/es/meta.mjs +64 -0
  45. package/build/internal/es/meta.mjs.map +1 -1
  46. package/build/internal/es/schemas.d.mts +5 -1
  47. package/build/internal/es/schemas.mjs +10 -1
  48. package/build/internal/es/schemas.mjs.map +1 -1
  49. package/package.json +2 -2
@@ -217,6 +217,73 @@ interface CreateOrderPaymentRequestResponse {
217
217
  */
218
218
  orderPaymentRequestUrl?: string;
219
219
  }
220
+ interface BulkCreateOrderPaymentRequestsRequest {
221
+ /**
222
+ * Order payment requests to create.
223
+ * @minSize 1
224
+ * @maxSize 100
225
+ */
226
+ orderPaymentRequests: OrderPaymentRequest[];
227
+ /**
228
+ * Whether to return the created order payment requests and their payment page URLs in the response.
229
+ * Default: `false`.
230
+ */
231
+ returnEntity?: boolean;
232
+ }
233
+ interface BulkCreateOrderPaymentRequestsResponse {
234
+ /**
235
+ * Results of the bulk create operation in the same order as the request items.
236
+ * @minSize 1
237
+ * @maxSize 100
238
+ */
239
+ results?: BulkOrderPaymentRequestResult[];
240
+ /** Metadata about the bulk create operation. */
241
+ bulkActionMetadata?: BulkActionMetadata;
242
+ }
243
+ interface ItemMetadata {
244
+ /**
245
+ * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.
246
+ * @format GUID
247
+ */
248
+ _id?: string | null;
249
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
250
+ originalIndex?: number;
251
+ /** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */
252
+ success?: boolean;
253
+ /** Details about the error in case of failure. */
254
+ error?: ApplicationError;
255
+ }
256
+ interface ApplicationError {
257
+ /** Error code. */
258
+ code?: string;
259
+ /** Description of the error. */
260
+ description?: string;
261
+ /** Data related to the error. */
262
+ data?: Record<string, any> | null;
263
+ }
264
+ interface BulkOrderPaymentRequestItem {
265
+ /** Created order payment request. */
266
+ orderPaymentRequest?: OrderPaymentRequest;
267
+ /**
268
+ * Payment page URL for the created order payment request.
269
+ * @format WEB_URL
270
+ */
271
+ orderPaymentRequestUrl?: string;
272
+ }
273
+ interface BulkOrderPaymentRequestResult {
274
+ /** Metadata about this item, including its original request index and any error. */
275
+ itemMetadata?: ItemMetadata;
276
+ /** Created order payment request and its payment page URL. Returned when `returnEntity` is `true`. */
277
+ item?: BulkOrderPaymentRequestItem;
278
+ }
279
+ interface BulkActionMetadata {
280
+ /** Number of items that were successfully processed. */
281
+ totalSuccesses?: number;
282
+ /** Number of items that couldn't be processed. */
283
+ totalFailures?: number;
284
+ /** Number of failures without details because detailed failure threshold was exceeded. */
285
+ undetailedFailures?: number;
286
+ }
220
287
  interface GetOrderPaymentRequestRequest {
221
288
  /**
222
289
  * ID of the order payment request to retrieve.
@@ -804,6 +871,13 @@ interface CreateOrderPaymentRequestOptions {
804
871
  /** Order payment request to create. */
805
872
  orderPaymentRequest?: OrderPaymentRequest;
806
873
  }
874
+ interface BulkCreateOrderPaymentRequestsOptions {
875
+ /**
876
+ * Whether to return the created order payment requests and their payment page URLs in the response.
877
+ * Default: `false`.
878
+ */
879
+ returnEntity?: boolean;
880
+ }
807
881
  /**
808
882
  * Retrieves an order payment request.
809
883
  * @param orderPaymentRequestId - ID of the order payment request to retrieve.
@@ -1156,5 +1230,20 @@ interface UpdateExtendedFieldsOptions {
1156
1230
  /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */
1157
1231
  namespaceData: Record<string, any> | null;
1158
1232
  }
1233
+ /**
1234
+ * Voids the given order payment request.
1235
+ *
1236
+ * Only `UNPAID` order payment requests can be voided. Voiding an order payment request that is already `VOIDED` succeeds without making any changes. Voiding a `PAID` or `EXPIRED` order payment request fails.
1237
+ * @param orderPaymentRequestId - ID of the order payment request to void.
1238
+ * @public
1239
+ * @documentationMaturity preview
1240
+ * @requiredField orderPaymentRequestId
1241
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_UPDATE
1242
+ * @applicableIdentity APP
1243
+ * @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.VoidOrderPaymentRequest
1244
+ */
1245
+ declare function voidOrderPaymentRequest(orderPaymentRequestId: string): Promise<void & {
1246
+ __applicationErrorsType?: VoidOrderPaymentRequestApplicationErrors;
1247
+ }>;
1159
1248
 
1160
- export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActionLink, type ActionLinks, type BaseEventMetadata, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestCreatedEnvelope, type OrderPaymentRequestDeletedEnvelope, type OrderPaymentRequestExpired, type OrderPaymentRequestExpiredEnvelope, type OrderPaymentRequestPaid, type OrderPaymentRequestPaidEnvelope, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestUpdatedEnvelope, type OrderPaymentRequestVoided, type OrderPaymentRequestVoidedEnvelope, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, onOrderPaymentRequestCreated, onOrderPaymentRequestDeleted, onOrderPaymentRequestExpired, onOrderPaymentRequestPaid, onOrderPaymentRequestUpdated, onOrderPaymentRequestVoided, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils };
1249
+ export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActionLink, type ActionLinks, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateOrderPaymentRequestsOptions, type BulkCreateOrderPaymentRequestsRequest, type BulkCreateOrderPaymentRequestsResponse, type BulkOrderPaymentRequestItem, type BulkOrderPaymentRequestResult, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestCreatedEnvelope, type OrderPaymentRequestDeletedEnvelope, type OrderPaymentRequestExpired, type OrderPaymentRequestExpiredEnvelope, type OrderPaymentRequestPaid, type OrderPaymentRequestPaidEnvelope, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestUpdatedEnvelope, type OrderPaymentRequestVoided, type OrderPaymentRequestVoidedEnvelope, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, onOrderPaymentRequestCreated, onOrderPaymentRequestDeleted, onOrderPaymentRequestExpired, onOrderPaymentRequestPaid, onOrderPaymentRequestUpdated, onOrderPaymentRequestVoided, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils, voidOrderPaymentRequest };
@@ -24,6 +24,7 @@ __export(index_typings_exports, {
24
24
  SortOrder: () => SortOrder,
25
25
  Status: () => Status,
26
26
  WebhookIdentityType: () => WebhookIdentityType,
27
+ bulkCreateOrderPaymentRequests: () => bulkCreateOrderPaymentRequests2,
27
28
  createOrderPaymentRequest: () => createOrderPaymentRequest2,
28
29
  deleteOrderPaymentRequest: () => deleteOrderPaymentRequest2,
29
30
  getOrderPaymentRequest: () => getOrderPaymentRequest2,
@@ -130,6 +131,49 @@ function createOrderPaymentRequest(payload) {
130
131
  }
131
132
  return __createOrderPaymentRequest;
132
133
  }
134
+ function bulkCreateOrderPaymentRequests(payload) {
135
+ function __bulkCreateOrderPaymentRequests({ host }) {
136
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
137
+ {
138
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
139
+ paths: [
140
+ { path: "orderPaymentRequests.expirationDate" },
141
+ { path: "orderPaymentRequests.createdDate" },
142
+ { path: "orderPaymentRequests.updatedDate" }
143
+ ]
144
+ }
145
+ ]);
146
+ const metadata = {
147
+ entityFqdn: "wix.ecom.v1.order_payment_request",
148
+ method: "POST",
149
+ methodFqn: "wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.BulkCreateOrderPaymentRequests",
150
+ packageName: PACKAGE_NAME,
151
+ migrationOptions: {
152
+ optInTransformResponse: true
153
+ },
154
+ url: resolveWixEcomOrderPaymentRequestApiV1OrderPaymentRequestsServiceUrl(
155
+ {
156
+ protoPath: "/v1/bulk/order-payment-requests/create",
157
+ data: serializedData,
158
+ host
159
+ }
160
+ ),
161
+ data: serializedData,
162
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
163
+ {
164
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
165
+ paths: [
166
+ { path: "results.item.orderPaymentRequest.expirationDate" },
167
+ { path: "results.item.orderPaymentRequest.createdDate" },
168
+ { path: "results.item.orderPaymentRequest.updatedDate" }
169
+ ]
170
+ }
171
+ ])
172
+ };
173
+ return metadata;
174
+ }
175
+ return __bulkCreateOrderPaymentRequests;
176
+ }
133
177
  function getOrderPaymentRequest(payload) {
134
178
  function __getOrderPaymentRequest({ host }) {
135
179
  const metadata = {
@@ -405,6 +449,52 @@ async function createOrderPaymentRequest2(options) {
405
449
  throw transformedError;
406
450
  }
407
451
  }
452
+ async function bulkCreateOrderPaymentRequests2(orderPaymentRequests, options) {
453
+ const { httpClient, sideEffects } = arguments[2];
454
+ const payload = (0, import_transform_paths2.transformPaths)(
455
+ (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
456
+ orderPaymentRequests,
457
+ returnEntity: options?.returnEntity
458
+ }),
459
+ [
460
+ {
461
+ transformFn: import_image.transformSDKImageToRESTImage,
462
+ paths: [{ path: "orderPaymentRequests.image" }]
463
+ }
464
+ ]
465
+ );
466
+ const reqOpts = bulkCreateOrderPaymentRequests(
467
+ payload
468
+ );
469
+ sideEffects?.onSiteCall?.();
470
+ try {
471
+ const result = await httpClient.request(reqOpts);
472
+ sideEffects?.onSuccess?.(result);
473
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
474
+ (0, import_transform_paths2.transformPaths)(result.data, [
475
+ {
476
+ transformFn: import_image2.transformRESTImageToSDKImage,
477
+ paths: [{ path: "results.item.orderPaymentRequest.image" }]
478
+ }
479
+ ])
480
+ );
481
+ } catch (err) {
482
+ const transformedError = (0, import_transform_error.transformError)(
483
+ err,
484
+ {
485
+ spreadPathsToArguments: {},
486
+ explicitPathsToArguments: {
487
+ orderPaymentRequests: "$[0]",
488
+ returnEntity: "$[1].returnEntity"
489
+ },
490
+ singleArgumentUnchanged: false
491
+ },
492
+ ["orderPaymentRequests", "options"]
493
+ );
494
+ sideEffects?.onError?.(err);
495
+ throw transformedError;
496
+ }
497
+ }
408
498
  async function getOrderPaymentRequest2(orderPaymentRequestId) {
409
499
  const { httpClient, sideEffects } = arguments[1];
410
500
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -683,6 +773,7 @@ async function voidOrderPaymentRequest2(orderPaymentRequestId) {
683
773
  SortOrder,
684
774
  Status,
685
775
  WebhookIdentityType,
776
+ bulkCreateOrderPaymentRequests,
686
777
  createOrderPaymentRequest,
687
778
  deleteOrderPaymentRequest,
688
779
  getOrderPaymentRequest,