@wix/auto_sdk_get-paid_receipts 1.0.48 → 1.0.49
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.
- package/build/cjs/index.d.ts +18 -9
- package/build/cjs/index.js +14 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{receipts-v1-receipt-receipts.universal-DtIWy4Qk.d.ts → index.typings.d.ts} +201 -1
- package/build/cjs/index.typings.js +665 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/cjs/meta.js +12 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +18 -9
- package/build/es/index.mjs +14 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/{receipts-v1-receipt-receipts.universal-DtIWy4Qk.d.mts → index.typings.d.mts} +201 -1
- package/build/es/index.typings.mjs +628 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/es/meta.mjs +12 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +18 -9
- package/build/internal/cjs/index.js +14 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{receipts-v1-receipt-receipts.universal-DtIWy4Qk.d.ts → index.typings.d.ts} +201 -1
- package/build/internal/cjs/index.typings.js +665 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/cjs/meta.js +12 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +18 -9
- package/build/internal/es/index.mjs +14 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{receipts-v1-receipt-receipts.universal-DtIWy4Qk.d.mts → index.typings.d.mts} +201 -1
- package/build/internal/es/index.typings.mjs +628 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/build/internal/es/meta.mjs +12 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +4 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Receipt, CreateReceiptApplicationErrors, ReceiptsQueryBuilder, RegenerateReceiptDocumentApplicationErrors, SendReceiptEmailOptions, SendReceiptEmailApplicationErrors, GetLatestReceiptNumberOptions, GetLatestReceiptNumberResponse, UpdateExtendedFieldsOptions, UpdateExtendedFieldsResponse, ReceiptCreatedEnvelope, ReceiptSentEnvelope, ReceiptUpdatedEnvelope } from './index.typings.js';
|
|
3
|
+
export { ActionEvent, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, AddressStreetOneOf, BaseEventMetadata, BusinessDetails, CreateReceiptRequest, CreateReceiptResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, CustomField, CustomFields, Customer, Discount, Document, DocumentStatus, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, Failed, FooterCustomField, FullAddressContactDetails, GenerateReceiptDocument, GetLatestReceiptNumberRequest, GetReceiptRequest, GetReceiptResponse, IdentificationData, IdentificationDataIdOneOf, LineItem, LineItemTax, LineItemTotals, Locale, MessageEnvelope, Numbering, Payment, QueryReceiptsRequest, QueryReceiptsResponse, ReceiptDocumentHandled, ReceiptDocumentHandledResultOneOf, ReceiptDocumentProcess, ReceiptNumberingProcess, ReceiptOrderType, ReceiptsQueryResult, RegenerateReceiptDocumentRequest, RegenerateReceiptDocumentResponse, RegionalProperties, RequestOrigin, RestoreInfo, SendReceiptEmailRequest, SendReceiptEmailResponse, Sent, ShippingInfo, ShippingTax, SortOrder, Sorting, SourceReference, SourceReferenceOrderOneOf, StandardDetails, StreetAddress, Subdivision, SubdivisionType, Succeeded, Tax, Totals, UpdateExtendedFieldsRequest, UpdateReceiptRequest, UpdateReceiptResponse, VatId, VatType, WebhookIdentityType, WixEcom, WixPayment } from './index.typings.js';
|
|
4
4
|
|
|
5
|
+
type ReceiptNonNullablePaths = `numbering.displayNumber` | `regionalProperties.locale.languageCode` | `currency` | `sourceReference.wixPaymentOrder.orderId` | `sourceReference.wixPaymentOrder.transactionId` | `sourceReference.wixEcomOrder.orderId` | `sourceReference.wixEcomOrder.transactionId` | `sourceReference.appId` | `sourceReference.externalReferenceId` | `sourceReference.receiptOrderType` | `businessDetails.address.streetAddress.number` | `businessDetails.address.streetAddress.name` | `customer.contactDetails.vatId._id` | `customer.contactDetails.vatId.type` | `customer.billingAddress.streetAddress.number` | `customer.billingAddress.streetAddress.name` | `lineItems` | `shippingInfo.title` | `shippingInfo.priceBeforeTax` | `shippingInfo.priceAfterTax` | `shippingInfo.taxBreakdown` | `shippingInfo.taxBreakdown.${number}.name` | `shippingInfo.taxBreakdown.${number}.rate` | `shippingInfo.taxBreakdown.${number}.amount` | `additionalFees` | `additionalFees.${number}.name` | `additionalFees.${number}.priceBeforeTax` | `additionalFees.${number}.priceAfterTax` | `discounts` | `discounts.${number}.name` | `discounts.${number}.amount` | `payment.paymentMethod` | `payment.amount` | `taxBreakdown` | `taxBreakdown.${number}.name` | `taxBreakdown.${number}.rate` | `taxBreakdown.${number}.taxAmount` | `taxBreakdown.${number}.taxableAmount` | `customFields.headerCustomFields` | `customFields.headerCustomFields.${number}.value` | `customFields.businessCustomFields` | `customFields.customerCustomFields` | `customFields.footerCustomFields` | `customFields.footerCustomFields.${number}.title` | `document.status`;
|
|
5
6
|
declare function createReceipt$1(httpClient: HttpClient): CreateReceiptSignature;
|
|
6
7
|
interface CreateReceiptSignature {
|
|
7
8
|
/**
|
|
@@ -11,7 +12,9 @@ interface CreateReceiptSignature {
|
|
|
11
12
|
* @param - Receipt to create.
|
|
12
13
|
* @returns Created receipt.
|
|
13
14
|
*/
|
|
14
|
-
(receipt: Receipt): Promise<Receipt
|
|
15
|
+
(receipt: NonNullablePaths<Receipt, `currency` | `lineItems` | `lineItems.${number}._id` | `lineItems.${number}.price` | `lineItems.${number}.quantity` | `lineItems.${number}.totals` | `lineItems.${number}.totals.totalPriceBeforeTax` | `payment` | `payment.amount` | `payment.paymentMethod` | `payment.transactionDate` | `sourceReference` | `sourceReference.appId` | `sourceReference.externalReferenceId` | `sourceReference.receiptOrderType` | `sourceReference.wixEcomOrder.transactionId` | `sourceReference.wixPaymentOrder.transactionId` | `totals` | `totals.subtotal` | `totals.total`>): Promise<NonNullablePaths<Receipt, ReceiptNonNullablePaths> & {
|
|
16
|
+
__applicationErrorsType?: CreateReceiptApplicationErrors;
|
|
17
|
+
}>;
|
|
15
18
|
}
|
|
16
19
|
declare function getReceipt$1(httpClient: HttpClient): GetReceiptSignature;
|
|
17
20
|
interface GetReceiptSignature {
|
|
@@ -20,7 +23,7 @@ interface GetReceiptSignature {
|
|
|
20
23
|
* @param - Receipt ID.
|
|
21
24
|
* @returns Requested receipt.
|
|
22
25
|
*/
|
|
23
|
-
(receiptId: string): Promise<Receipt
|
|
26
|
+
(receiptId: string): Promise<NonNullablePaths<Receipt, ReceiptNonNullablePaths>>;
|
|
24
27
|
}
|
|
25
28
|
declare function queryReceipts$1(httpClient: HttpClient): QueryReceiptsSignature;
|
|
26
29
|
interface QueryReceiptsSignature {
|
|
@@ -37,7 +40,9 @@ interface RegenerateReceiptDocumentSignature {
|
|
|
37
40
|
* Note that you can access a receipt document with an `AVAILABLE` status with the URL provided in `document.downloadUrl` without regenerating.
|
|
38
41
|
* @param - Receipt ID.
|
|
39
42
|
*/
|
|
40
|
-
(receiptId: string): Promise<void
|
|
43
|
+
(receiptId: string): Promise<void & {
|
|
44
|
+
__applicationErrorsType?: RegenerateReceiptDocumentApplicationErrors;
|
|
45
|
+
}>;
|
|
41
46
|
}
|
|
42
47
|
declare function sendReceiptEmail$1(httpClient: HttpClient): SendReceiptEmailSignature;
|
|
43
48
|
interface SendReceiptEmailSignature {
|
|
@@ -50,7 +55,9 @@ interface SendReceiptEmailSignature {
|
|
|
50
55
|
* @param - Receipt ID to send.
|
|
51
56
|
* @param - Field options. The `contactId` object must be passed if one was not already specified upon receipt creation.
|
|
52
57
|
*/
|
|
53
|
-
(receiptId: string, options?: SendReceiptEmailOptions
|
|
58
|
+
(receiptId: string, options?: SendReceiptEmailOptions): Promise<void & {
|
|
59
|
+
__applicationErrorsType?: SendReceiptEmailApplicationErrors;
|
|
60
|
+
}>;
|
|
54
61
|
}
|
|
55
62
|
declare function getLatestReceiptNumber$1(httpClient: HttpClient): GetLatestReceiptNumberSignature;
|
|
56
63
|
interface GetLatestReceiptNumberSignature {
|
|
@@ -61,7 +68,7 @@ interface GetLatestReceiptNumberSignature {
|
|
|
61
68
|
* Receipt numbering is managed in the Receipts Settings API.
|
|
62
69
|
* @param - Field options.
|
|
63
70
|
*/
|
|
64
|
-
(options?: GetLatestReceiptNumberOptions
|
|
71
|
+
(options?: GetLatestReceiptNumberOptions): Promise<GetLatestReceiptNumberResponse>;
|
|
65
72
|
}
|
|
66
73
|
declare function updateExtendedFields$1(httpClient: HttpClient): UpdateExtendedFieldsSignature;
|
|
67
74
|
interface UpdateExtendedFieldsSignature {
|
|
@@ -71,7 +78,9 @@ interface UpdateExtendedFieldsSignature {
|
|
|
71
78
|
* @param - Identifier for the app whose extended fields are being updated.
|
|
72
79
|
* @param - Field options. The `namespaceData` object **must** be passed.
|
|
73
80
|
*/
|
|
74
|
-
(_id: string, namespace: string, options: UpdateExtendedFieldsOptions): Promise<UpdateExtendedFieldsResponse
|
|
81
|
+
(_id: string, namespace: string, options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`>): Promise<NonNullablePaths<UpdateExtendedFieldsResponse, {
|
|
82
|
+
[P in ReceiptNonNullablePaths]: `receipt.${P}`;
|
|
83
|
+
}[ReceiptNonNullablePaths]>>;
|
|
75
84
|
}
|
|
76
85
|
declare const onReceiptCreated$1: EventDefinition<ReceiptCreatedEnvelope, "wix.receipts.v1.receipt_created">;
|
|
77
86
|
declare const onReceiptSent$1: EventDefinition<ReceiptSentEnvelope, "wix.receipts.v1.receipt_sent">;
|
package/build/cjs/index.js
CHANGED
|
@@ -74,6 +74,18 @@ function resolveWixReceiptsV1ReceiptsUrl(opts) {
|
|
|
74
74
|
srcPath: "/receipts/v1/receipts",
|
|
75
75
|
destPath: "/v1/receipts"
|
|
76
76
|
}
|
|
77
|
+
],
|
|
78
|
+
"*.dev.wix-code.com": [
|
|
79
|
+
{
|
|
80
|
+
srcPath: "/receipts/v1/receipts",
|
|
81
|
+
destPath: "/v1/receipts"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
_: [
|
|
85
|
+
{
|
|
86
|
+
srcPath: "/receipts/v1/receipts",
|
|
87
|
+
destPath: "/v1/receipts"
|
|
88
|
+
}
|
|
77
89
|
]
|
|
78
90
|
};
|
|
79
91
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
@@ -529,6 +541,7 @@ async function regenerateReceiptDocument2(receiptId) {
|
|
|
529
541
|
try {
|
|
530
542
|
const result = await httpClient.request(reqOpts);
|
|
531
543
|
sideEffects?.onSuccess?.(result);
|
|
544
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
532
545
|
} catch (err) {
|
|
533
546
|
const transformedError = (0, import_transform_error.transformError)(
|
|
534
547
|
err,
|
|
@@ -554,6 +567,7 @@ async function sendReceiptEmail2(receiptId, options) {
|
|
|
554
567
|
try {
|
|
555
568
|
const result = await httpClient.request(reqOpts);
|
|
556
569
|
sideEffects?.onSuccess?.(result);
|
|
570
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
557
571
|
} catch (err) {
|
|
558
572
|
const transformedError = (0, import_transform_error.transformError)(
|
|
559
573
|
err,
|