@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 };
@@ -94,6 +94,49 @@ function createOrderPaymentRequest(payload) {
94
94
  }
95
95
  return __createOrderPaymentRequest;
96
96
  }
97
+ function bulkCreateOrderPaymentRequests(payload) {
98
+ function __bulkCreateOrderPaymentRequests({ host }) {
99
+ const serializedData = transformPaths(payload, [
100
+ {
101
+ transformFn: transformSDKTimestampToRESTTimestamp,
102
+ paths: [
103
+ { path: "orderPaymentRequests.expirationDate" },
104
+ { path: "orderPaymentRequests.createdDate" },
105
+ { path: "orderPaymentRequests.updatedDate" }
106
+ ]
107
+ }
108
+ ]);
109
+ const metadata = {
110
+ entityFqdn: "wix.ecom.v1.order_payment_request",
111
+ method: "POST",
112
+ methodFqn: "wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.BulkCreateOrderPaymentRequests",
113
+ packageName: PACKAGE_NAME,
114
+ migrationOptions: {
115
+ optInTransformResponse: true
116
+ },
117
+ url: resolveWixEcomOrderPaymentRequestApiV1OrderPaymentRequestsServiceUrl(
118
+ {
119
+ protoPath: "/v1/bulk/order-payment-requests/create",
120
+ data: serializedData,
121
+ host
122
+ }
123
+ ),
124
+ data: serializedData,
125
+ transformResponse: (payload2) => transformPaths(payload2, [
126
+ {
127
+ transformFn: transformRESTTimestampToSDKTimestamp,
128
+ paths: [
129
+ { path: "results.item.orderPaymentRequest.expirationDate" },
130
+ { path: "results.item.orderPaymentRequest.createdDate" },
131
+ { path: "results.item.orderPaymentRequest.updatedDate" }
132
+ ]
133
+ }
134
+ ])
135
+ };
136
+ return metadata;
137
+ }
138
+ return __bulkCreateOrderPaymentRequests;
139
+ }
97
140
  function getOrderPaymentRequest(payload) {
98
141
  function __getOrderPaymentRequest({ host }) {
99
142
  const metadata = {
@@ -369,6 +412,52 @@ async function createOrderPaymentRequest2(options) {
369
412
  throw transformedError;
370
413
  }
371
414
  }
415
+ async function bulkCreateOrderPaymentRequests2(orderPaymentRequests, options) {
416
+ const { httpClient, sideEffects } = arguments[2];
417
+ const payload = transformPaths2(
418
+ renameKeysFromSDKRequestToRESTRequest({
419
+ orderPaymentRequests,
420
+ returnEntity: options?.returnEntity
421
+ }),
422
+ [
423
+ {
424
+ transformFn: transformSDKImageToRESTImage,
425
+ paths: [{ path: "orderPaymentRequests.image" }]
426
+ }
427
+ ]
428
+ );
429
+ const reqOpts = bulkCreateOrderPaymentRequests(
430
+ payload
431
+ );
432
+ sideEffects?.onSiteCall?.();
433
+ try {
434
+ const result = await httpClient.request(reqOpts);
435
+ sideEffects?.onSuccess?.(result);
436
+ return renameKeysFromRESTResponseToSDKResponse(
437
+ transformPaths2(result.data, [
438
+ {
439
+ transformFn: transformRESTImageToSDKImage,
440
+ paths: [{ path: "results.item.orderPaymentRequest.image" }]
441
+ }
442
+ ])
443
+ );
444
+ } catch (err) {
445
+ const transformedError = sdkTransformError(
446
+ err,
447
+ {
448
+ spreadPathsToArguments: {},
449
+ explicitPathsToArguments: {
450
+ orderPaymentRequests: "$[0]",
451
+ returnEntity: "$[1].returnEntity"
452
+ },
453
+ singleArgumentUnchanged: false
454
+ },
455
+ ["orderPaymentRequests", "options"]
456
+ );
457
+ sideEffects?.onError?.(err);
458
+ throw transformedError;
459
+ }
460
+ }
372
461
  async function getOrderPaymentRequest2(orderPaymentRequestId) {
373
462
  const { httpClient, sideEffects } = arguments[1];
374
463
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -646,6 +735,7 @@ export {
646
735
  SortOrder,
647
736
  Status,
648
737
  WebhookIdentityType,
738
+ bulkCreateOrderPaymentRequests2 as bulkCreateOrderPaymentRequests,
649
739
  createOrderPaymentRequest2 as createOrderPaymentRequest,
650
740
  deleteOrderPaymentRequest2 as deleteOrderPaymentRequest,
651
741
  getOrderPaymentRequest2 as getOrderPaymentRequest,