@paid-ai/paid-node 1.3.0 → 1.5.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.
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +30 -20
- package/dist/cjs/api/resources/cost/client/Client.d.ts +38 -0
- package/dist/cjs/api/resources/cost/client/Client.js +139 -0
- package/dist/cjs/api/resources/cost/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/cost/client/index.js +17 -0
- package/dist/cjs/api/resources/cost/client/requests/CostIngestRequest.d.ts +17 -0
- package/dist/cjs/api/resources/cost/client/requests/CostIngestRequest.js +3 -0
- package/dist/cjs/api/resources/cost/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/cost/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/cost/index.d.ts +1 -0
- package/dist/cjs/api/resources/cost/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/index.js +6 -1
- package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +1 -0
- package/dist/cjs/api/resources/pricing/client/Client.d.ts +71 -0
- package/dist/cjs/api/resources/pricing/client/Client.js +284 -0
- package/dist/cjs/api/resources/pricing/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pricing/client/index.js +17 -0
- package/dist/cjs/api/resources/pricing/client/requests/GetPricingRequest.d.ts +9 -0
- package/dist/cjs/api/resources/pricing/client/requests/GetPricingRequest.js +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/ListPricingRequest.d.ts +10 -0
- package/dist/cjs/api/resources/pricing/client/requests/ListPricingRequest.js +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.d.ts +20 -0
- package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.js +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/pricing/index.d.ts +1 -0
- package/dist/cjs/api/resources/pricing/index.js +17 -0
- package/dist/cjs/api/resources/valueReceipts/client/Client.d.ts +85 -0
- package/dist/cjs/api/resources/valueReceipts/client/Client.js +362 -1
- package/dist/cjs/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.ts +7 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.d.ts +28 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/valueReceipts/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueReceipts/index.js +1 -0
- package/dist/cjs/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.d.ts +5 -0
- package/dist/cjs/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.js +8 -0
- package/dist/cjs/api/resources/valueReceipts/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueReceipts/types/index.js +17 -0
- package/dist/cjs/api/types/Cost.d.ts +10 -0
- package/dist/cjs/api/types/Cost.js +3 -0
- package/dist/cjs/api/types/CostIngestResponse.d.ts +6 -0
- package/dist/cjs/api/types/CostIngestResponse.js +3 -0
- package/dist/cjs/api/types/CostOverride.d.ts +8 -0
- package/dist/cjs/api/types/CostOverride.js +3 -0
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +1 -0
- package/dist/cjs/api/types/CreditBalance.d.ts +6 -0
- package/dist/cjs/api/types/CreditBenefitInput.d.ts +30 -0
- package/dist/cjs/api/types/CreditBenefitInput.js +20 -0
- package/dist/cjs/api/types/CreditBenefitOutput.d.ts +13 -0
- package/dist/cjs/api/types/CreditBenefitOutput.js +3 -0
- package/dist/cjs/api/types/CreditGrant.d.ts +11 -0
- package/dist/cjs/api/types/CreditGrant.js +3 -0
- package/dist/cjs/api/types/OneTimePerUnitInput.d.ts +21 -0
- package/dist/cjs/api/types/OneTimePerUnitInput.js +18 -0
- package/dist/cjs/api/types/Order.d.ts +2 -0
- package/dist/cjs/api/types/OrderBillingFrequencyOverride.d.ts +14 -0
- package/dist/cjs/api/types/OrderBillingFrequencyOverride.js +14 -0
- package/dist/cjs/api/types/PrecomputedCost.d.ts +17 -0
- package/dist/cjs/api/types/PrecomputedCost.js +3 -0
- package/dist/cjs/api/types/PricingInput.d.ts +46 -0
- package/dist/cjs/api/types/PricingInput.js +3 -0
- package/dist/cjs/api/types/PricingListResponse.d.ts +4 -0
- package/dist/cjs/api/types/PricingListResponse.js +3 -0
- package/dist/cjs/api/types/PricingOutput.d.ts +36 -0
- package/dist/cjs/api/types/PricingOutput.js +23 -0
- package/dist/cjs/api/types/PricingPricePointOutput.d.ts +29 -0
- package/dist/cjs/api/types/PricingPricePointOutput.js +17 -0
- package/dist/cjs/api/types/PricingResponse.d.ts +7 -0
- package/dist/cjs/api/types/PricingResponse.js +3 -0
- package/dist/cjs/api/types/ProductAttribution.d.ts +2 -0
- package/dist/cjs/api/types/ProductAttribution.js +3 -0
- package/dist/cjs/api/types/RecurringGraduatedInput.d.ts +22 -0
- package/dist/cjs/api/types/RecurringGraduatedInput.js +18 -0
- package/dist/cjs/api/types/RecurringPerUnitInput.d.ts +22 -0
- package/dist/cjs/api/types/RecurringPerUnitInput.js +18 -0
- package/dist/cjs/api/types/RecurringPercentOfTotalInput.d.ts +23 -0
- package/dist/cjs/api/types/RecurringPercentOfTotalInput.js +18 -0
- package/dist/cjs/api/types/RecurringVolumeInput.d.ts +22 -0
- package/dist/cjs/api/types/RecurringVolumeInput.js +18 -0
- package/dist/cjs/api/types/SeatBasedGraduatedInput.d.ts +22 -0
- package/dist/cjs/api/types/SeatBasedGraduatedInput.js +18 -0
- package/dist/cjs/api/types/SeatBasedPerUnitInput.d.ts +22 -0
- package/dist/cjs/api/types/SeatBasedPerUnitInput.js +18 -0
- package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.d.ts +25 -0
- package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.js +18 -0
- package/dist/cjs/api/types/SeatBasedVolumeInput.d.ts +22 -0
- package/dist/cjs/api/types/SeatBasedVolumeInput.js +18 -0
- package/dist/cjs/api/types/SimplePricePoint.d.ts +29 -0
- package/dist/cjs/api/types/SimplePricePoint.js +17 -0
- package/dist/cjs/api/types/SuccessResponse.d.ts +3 -0
- package/dist/cjs/api/types/SuccessResponse.js +3 -0
- package/dist/cjs/api/types/TieredPricePoint.d.ts +29 -0
- package/dist/cjs/api/types/TieredPricePoint.js +17 -0
- package/dist/cjs/api/types/TokenUsage.d.ts +12 -0
- package/dist/cjs/api/types/TokenUsage.js +3 -0
- package/dist/cjs/api/types/UsageCost.d.ts +15 -0
- package/dist/cjs/api/types/UsageCost.js +3 -0
- package/dist/cjs/api/types/UsageCostPlusInput.d.ts +23 -0
- package/dist/cjs/api/types/UsageCostPlusInput.js +18 -0
- package/dist/cjs/api/types/UsageGraduatedInput.d.ts +23 -0
- package/dist/cjs/api/types/UsageGraduatedInput.js +18 -0
- package/dist/cjs/api/types/UsagePerUnitInput.d.ts +23 -0
- package/dist/cjs/api/types/UsagePerUnitInput.js +18 -0
- package/dist/cjs/api/types/UsagePrepaidCreditsInput.d.ts +26 -0
- package/dist/cjs/api/types/UsagePrepaidCreditsInput.js +18 -0
- package/dist/cjs/api/types/UsageVolumeInput.d.ts +23 -0
- package/dist/cjs/api/types/UsageVolumeInput.js +18 -0
- package/dist/cjs/api/types/ValueReceiptDetail.d.ts +2 -0
- package/dist/cjs/api/types/ValueReceiptSummary.d.ts +2 -0
- package/dist/cjs/api/types/ValueReceiptSyncResponse.d.ts +6 -0
- package/dist/cjs/api/types/ValueReceiptSyncResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +34 -0
- package/dist/cjs/api/types/index.js +34 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +12 -2
- package/dist/esm/api/resources/cost/client/Client.d.mts +38 -0
- package/dist/esm/api/resources/cost/client/Client.mjs +102 -0
- package/dist/esm/api/resources/cost/client/index.d.mts +1 -0
- package/dist/esm/api/resources/cost/client/index.mjs +1 -0
- package/dist/esm/api/resources/cost/client/requests/CostIngestRequest.d.mts +17 -0
- package/dist/esm/api/resources/cost/client/requests/CostIngestRequest.mjs +2 -0
- package/dist/esm/api/resources/cost/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/cost/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/cost/index.d.mts +1 -0
- package/dist/esm/api/resources/cost/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/index.mjs +5 -0
- package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +1 -0
- package/dist/esm/api/resources/pricing/client/Client.d.mts +71 -0
- package/dist/esm/api/resources/pricing/client/Client.mjs +247 -0
- package/dist/esm/api/resources/pricing/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pricing/client/index.mjs +1 -0
- package/dist/esm/api/resources/pricing/client/requests/GetPricingRequest.d.mts +9 -0
- package/dist/esm/api/resources/pricing/client/requests/GetPricingRequest.mjs +2 -0
- package/dist/esm/api/resources/pricing/client/requests/ListPricingRequest.d.mts +10 -0
- package/dist/esm/api/resources/pricing/client/requests/ListPricingRequest.mjs +2 -0
- package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.d.mts +20 -0
- package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.mjs +2 -0
- package/dist/esm/api/resources/pricing/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/pricing/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pricing/index.d.mts +1 -0
- package/dist/esm/api/resources/pricing/index.mjs +1 -0
- package/dist/esm/api/resources/valueReceipts/client/Client.d.mts +85 -0
- package/dist/esm/api/resources/valueReceipts/client/Client.mjs +362 -1
- package/dist/esm/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.mts +7 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.d.mts +28 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/valueReceipts/index.d.mts +1 -0
- package/dist/esm/api/resources/valueReceipts/index.mjs +1 -0
- package/dist/esm/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.d.mts +5 -0
- package/dist/esm/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.mjs +5 -0
- package/dist/esm/api/resources/valueReceipts/types/index.d.mts +1 -0
- package/dist/esm/api/resources/valueReceipts/types/index.mjs +1 -0
- package/dist/esm/api/types/Cost.d.mts +10 -0
- package/dist/esm/api/types/Cost.mjs +2 -0
- package/dist/esm/api/types/CostIngestResponse.d.mts +6 -0
- package/dist/esm/api/types/CostIngestResponse.mjs +2 -0
- package/dist/esm/api/types/CostOverride.d.mts +8 -0
- package/dist/esm/api/types/CostOverride.mjs +2 -0
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +1 -0
- package/dist/esm/api/types/CreditBalance.d.mts +6 -0
- package/dist/esm/api/types/CreditBenefitInput.d.mts +30 -0
- package/dist/esm/api/types/CreditBenefitInput.mjs +17 -0
- package/dist/esm/api/types/CreditBenefitOutput.d.mts +13 -0
- package/dist/esm/api/types/CreditBenefitOutput.mjs +2 -0
- package/dist/esm/api/types/CreditGrant.d.mts +11 -0
- package/dist/esm/api/types/CreditGrant.mjs +2 -0
- package/dist/esm/api/types/OneTimePerUnitInput.d.mts +21 -0
- package/dist/esm/api/types/OneTimePerUnitInput.mjs +15 -0
- package/dist/esm/api/types/Order.d.mts +2 -0
- package/dist/esm/api/types/OrderBillingFrequencyOverride.d.mts +14 -0
- package/dist/esm/api/types/OrderBillingFrequencyOverride.mjs +11 -0
- package/dist/esm/api/types/PrecomputedCost.d.mts +17 -0
- package/dist/esm/api/types/PrecomputedCost.mjs +2 -0
- package/dist/esm/api/types/PricingInput.d.mts +46 -0
- package/dist/esm/api/types/PricingInput.mjs +2 -0
- package/dist/esm/api/types/PricingListResponse.d.mts +4 -0
- package/dist/esm/api/types/PricingListResponse.mjs +2 -0
- package/dist/esm/api/types/PricingOutput.d.mts +36 -0
- package/dist/esm/api/types/PricingOutput.mjs +20 -0
- package/dist/esm/api/types/PricingPricePointOutput.d.mts +29 -0
- package/dist/esm/api/types/PricingPricePointOutput.mjs +14 -0
- package/dist/esm/api/types/PricingResponse.d.mts +7 -0
- package/dist/esm/api/types/PricingResponse.mjs +2 -0
- package/dist/esm/api/types/ProductAttribution.d.mts +2 -0
- package/dist/esm/api/types/ProductAttribution.mjs +2 -0
- package/dist/esm/api/types/RecurringGraduatedInput.d.mts +22 -0
- package/dist/esm/api/types/RecurringGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/RecurringPerUnitInput.d.mts +22 -0
- package/dist/esm/api/types/RecurringPerUnitInput.mjs +15 -0
- package/dist/esm/api/types/RecurringPercentOfTotalInput.d.mts +23 -0
- package/dist/esm/api/types/RecurringPercentOfTotalInput.mjs +15 -0
- package/dist/esm/api/types/RecurringVolumeInput.d.mts +22 -0
- package/dist/esm/api/types/RecurringVolumeInput.mjs +15 -0
- package/dist/esm/api/types/SeatBasedGraduatedInput.d.mts +22 -0
- package/dist/esm/api/types/SeatBasedGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/SeatBasedPerUnitInput.d.mts +22 -0
- package/dist/esm/api/types/SeatBasedPerUnitInput.mjs +15 -0
- package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.d.mts +25 -0
- package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.mjs +15 -0
- package/dist/esm/api/types/SeatBasedVolumeInput.d.mts +22 -0
- package/dist/esm/api/types/SeatBasedVolumeInput.mjs +15 -0
- package/dist/esm/api/types/SimplePricePoint.d.mts +29 -0
- package/dist/esm/api/types/SimplePricePoint.mjs +14 -0
- package/dist/esm/api/types/SuccessResponse.d.mts +3 -0
- package/dist/esm/api/types/SuccessResponse.mjs +2 -0
- package/dist/esm/api/types/TieredPricePoint.d.mts +29 -0
- package/dist/esm/api/types/TieredPricePoint.mjs +14 -0
- package/dist/esm/api/types/TokenUsage.d.mts +12 -0
- package/dist/esm/api/types/TokenUsage.mjs +2 -0
- package/dist/esm/api/types/UsageCost.d.mts +15 -0
- package/dist/esm/api/types/UsageCost.mjs +2 -0
- package/dist/esm/api/types/UsageCostPlusInput.d.mts +23 -0
- package/dist/esm/api/types/UsageCostPlusInput.mjs +15 -0
- package/dist/esm/api/types/UsageGraduatedInput.d.mts +23 -0
- package/dist/esm/api/types/UsageGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/UsagePerUnitInput.d.mts +23 -0
- package/dist/esm/api/types/UsagePerUnitInput.mjs +15 -0
- package/dist/esm/api/types/UsagePrepaidCreditsInput.d.mts +26 -0
- package/dist/esm/api/types/UsagePrepaidCreditsInput.mjs +15 -0
- package/dist/esm/api/types/UsageVolumeInput.d.mts +23 -0
- package/dist/esm/api/types/UsageVolumeInput.mjs +15 -0
- package/dist/esm/api/types/ValueReceiptDetail.d.mts +2 -0
- package/dist/esm/api/types/ValueReceiptSummary.d.mts +2 -0
- package/dist/esm/api/types/ValueReceiptSyncResponse.d.mts +6 -0
- package/dist/esm/api/types/ValueReceiptSyncResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +34 -0
- package/dist/esm/api/types/index.mjs +34 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +610 -7
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as Paid from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* productAttributeId: "productAttributeId",
|
|
6
|
+
* pricing: {
|
|
7
|
+
* pricingType: "RecurringPerUnit",
|
|
8
|
+
* billingFrequency: "Monthly",
|
|
9
|
+
* pricePoints: [{
|
|
10
|
+
* currency: "currency",
|
|
11
|
+
* unitPrice: 1.1
|
|
12
|
+
* }]
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
export interface UpdatePricingRequest {
|
|
17
|
+
productAttributeId: string;
|
|
18
|
+
pricing: Paid.PricingInput;
|
|
19
|
+
creditBenefits?: Paid.CreditBenefitInput[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -10,6 +10,24 @@ export declare namespace ValueReceipts {
|
|
|
10
10
|
export declare class ValueReceipts {
|
|
11
11
|
protected readonly _options: ValueReceipts.Options;
|
|
12
12
|
constructor(_options: ValueReceipts.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Find or create a value receipt by natural key (customer + product/order + dates), then populate it with current data inline. Returns the ID, status, and public URL. Posted (sealed) VRs are returned as-is without re-populating.
|
|
15
|
+
*
|
|
16
|
+
* @param {Paid.SyncValueReceiptRequest} request
|
|
17
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Paid.BadRequestError}
|
|
20
|
+
* @throws {@link Paid.NotFoundError}
|
|
21
|
+
* @throws {@link Paid.InternalServerError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.valueReceipts.syncValueReceipt({
|
|
25
|
+
* startDate: "2024-01-15T09:30:00Z",
|
|
26
|
+
* endDate: "2024-01-15T09:30:00Z"
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
syncValueReceipt(request: Paid.SyncValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptSyncResponse>;
|
|
30
|
+
private __syncValueReceipt;
|
|
13
31
|
/**
|
|
14
32
|
* List value receipts for the organization
|
|
15
33
|
*
|
|
@@ -39,6 +57,73 @@ export declare class ValueReceipts {
|
|
|
39
57
|
*/
|
|
40
58
|
getValueReceiptById(request: Paid.GetValueReceiptByIdRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptDetail>;
|
|
41
59
|
private __getValueReceiptById;
|
|
60
|
+
/**
|
|
61
|
+
* Re-populate an existing draft value receipt with current data inline. Returns the slim sync response. Sealed VRs cannot be refreshed.
|
|
62
|
+
*
|
|
63
|
+
* @param {Paid.RefreshValueReceiptRequest} request
|
|
64
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link Paid.BadRequestError}
|
|
67
|
+
* @throws {@link Paid.NotFoundError}
|
|
68
|
+
* @throws {@link Paid.ConflictError}
|
|
69
|
+
* @throws {@link Paid.InternalServerError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.valueReceipts.refreshValueReceipt({
|
|
73
|
+
* id: "id"
|
|
74
|
+
* })
|
|
75
|
+
*/
|
|
76
|
+
refreshValueReceipt(request: Paid.RefreshValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptSyncResponse>;
|
|
77
|
+
private __refreshValueReceipt;
|
|
78
|
+
/**
|
|
79
|
+
* Transition a draft value receipt to sealed (posted) status. Sealed VRs are immutable — they cannot be updated or re-populated.
|
|
80
|
+
*
|
|
81
|
+
* @param {Paid.SealValueReceiptRequest} request
|
|
82
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
83
|
+
*
|
|
84
|
+
* @throws {@link Paid.NotFoundError}
|
|
85
|
+
* @throws {@link Paid.ConflictError}
|
|
86
|
+
* @throws {@link Paid.InternalServerError}
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* await client.valueReceipts.sealValueReceipt({
|
|
90
|
+
* id: "id"
|
|
91
|
+
* })
|
|
92
|
+
*/
|
|
93
|
+
sealValueReceipt(request: Paid.SealValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.SuccessResponse>;
|
|
94
|
+
private __sealValueReceipt;
|
|
95
|
+
/**
|
|
96
|
+
* Soft-archive a value receipt. Archived VRs are hidden from list by default.
|
|
97
|
+
*
|
|
98
|
+
* @param {Paid.ArchiveValueReceiptRequest} request
|
|
99
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
100
|
+
*
|
|
101
|
+
* @throws {@link Paid.NotFoundError}
|
|
102
|
+
* @throws {@link Paid.InternalServerError}
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* await client.valueReceipts.archiveValueReceipt({
|
|
106
|
+
* id: "id"
|
|
107
|
+
* })
|
|
108
|
+
*/
|
|
109
|
+
archiveValueReceipt(request: Paid.ArchiveValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.SuccessResponse>;
|
|
110
|
+
private __archiveValueReceipt;
|
|
111
|
+
/**
|
|
112
|
+
* Restore an archived value receipt.
|
|
113
|
+
*
|
|
114
|
+
* @param {Paid.UnarchiveValueReceiptRequest} request
|
|
115
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
116
|
+
*
|
|
117
|
+
* @throws {@link Paid.NotFoundError}
|
|
118
|
+
* @throws {@link Paid.InternalServerError}
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* await client.valueReceipts.unarchiveValueReceipt({
|
|
122
|
+
* id: "id"
|
|
123
|
+
* })
|
|
124
|
+
*/
|
|
125
|
+
unarchiveValueReceipt(request: Paid.UnarchiveValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.SuccessResponse>;
|
|
126
|
+
private __unarchiveValueReceipt;
|
|
42
127
|
/**
|
|
43
128
|
* Make a value receipt publicly accessible via URL.
|
|
44
129
|
*
|
|
@@ -28,6 +28,77 @@ export class ValueReceipts {
|
|
|
28
28
|
constructor(_options) {
|
|
29
29
|
this._options = _options;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Find or create a value receipt by natural key (customer + product/order + dates), then populate it with current data inline. Returns the ID, status, and public URL. Posted (sealed) VRs are returned as-is without re-populating.
|
|
33
|
+
*
|
|
34
|
+
* @param {Paid.SyncValueReceiptRequest} request
|
|
35
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link Paid.BadRequestError}
|
|
38
|
+
* @throws {@link Paid.NotFoundError}
|
|
39
|
+
* @throws {@link Paid.InternalServerError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.valueReceipts.syncValueReceipt({
|
|
43
|
+
* startDate: "2024-01-15T09:30:00Z",
|
|
44
|
+
* endDate: "2024-01-15T09:30:00Z"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
syncValueReceipt(request, requestOptions) {
|
|
48
|
+
return core.HttpResponsePromise.fromPromise(this.__syncValueReceipt(request, requestOptions));
|
|
49
|
+
}
|
|
50
|
+
__syncValueReceipt(request, requestOptions) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
53
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
54
|
+
const _response = yield core.fetcher({
|
|
55
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "value-receipts/sync"),
|
|
56
|
+
method: "POST",
|
|
57
|
+
headers: _headers,
|
|
58
|
+
contentType: "application/json",
|
|
59
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
60
|
+
requestType: "json",
|
|
61
|
+
body: request,
|
|
62
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
63
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
64
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
65
|
+
});
|
|
66
|
+
if (_response.ok) {
|
|
67
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
68
|
+
}
|
|
69
|
+
if (_response.error.reason === "status-code") {
|
|
70
|
+
switch (_response.error.statusCode) {
|
|
71
|
+
case 400:
|
|
72
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
73
|
+
case 404:
|
|
74
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
75
|
+
case 500:
|
|
76
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
77
|
+
default:
|
|
78
|
+
throw new errors.PaidError({
|
|
79
|
+
statusCode: _response.error.statusCode,
|
|
80
|
+
body: _response.error.body,
|
|
81
|
+
rawResponse: _response.rawResponse,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
switch (_response.error.reason) {
|
|
86
|
+
case "non-json":
|
|
87
|
+
throw new errors.PaidError({
|
|
88
|
+
statusCode: _response.error.statusCode,
|
|
89
|
+
body: _response.error.rawBody,
|
|
90
|
+
rawResponse: _response.rawResponse,
|
|
91
|
+
});
|
|
92
|
+
case "timeout":
|
|
93
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/sync.");
|
|
94
|
+
case "unknown":
|
|
95
|
+
throw new errors.PaidError({
|
|
96
|
+
message: _response.error.errorMessage,
|
|
97
|
+
rawResponse: _response.rawResponse,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
31
102
|
/**
|
|
32
103
|
* List value receipts for the organization
|
|
33
104
|
*
|
|
@@ -45,7 +116,7 @@ export class ValueReceipts {
|
|
|
45
116
|
__listValueReceipts() {
|
|
46
117
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
47
118
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
48
|
-
const { limit, offset, customerId, orderId } = request;
|
|
119
|
+
const { limit, offset, customerId, externalCustomerId, orderId, productId, archived } = request;
|
|
49
120
|
const _queryParams = {};
|
|
50
121
|
if (limit != null) {
|
|
51
122
|
_queryParams.limit = limit.toString();
|
|
@@ -56,9 +127,18 @@ export class ValueReceipts {
|
|
|
56
127
|
if (customerId != null) {
|
|
57
128
|
_queryParams.customerId = customerId;
|
|
58
129
|
}
|
|
130
|
+
if (externalCustomerId != null) {
|
|
131
|
+
_queryParams.externalCustomerId = externalCustomerId;
|
|
132
|
+
}
|
|
59
133
|
if (orderId != null) {
|
|
60
134
|
_queryParams.orderId = orderId;
|
|
61
135
|
}
|
|
136
|
+
if (productId != null) {
|
|
137
|
+
_queryParams.productId = productId;
|
|
138
|
+
}
|
|
139
|
+
if (archived != null) {
|
|
140
|
+
_queryParams.archived = archived;
|
|
141
|
+
}
|
|
62
142
|
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
63
143
|
const _response = yield core.fetcher({
|
|
64
144
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "value-receipts/"),
|
|
@@ -166,6 +246,287 @@ export class ValueReceipts {
|
|
|
166
246
|
}
|
|
167
247
|
});
|
|
168
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Re-populate an existing draft value receipt with current data inline. Returns the slim sync response. Sealed VRs cannot be refreshed.
|
|
251
|
+
*
|
|
252
|
+
* @param {Paid.RefreshValueReceiptRequest} request
|
|
253
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
254
|
+
*
|
|
255
|
+
* @throws {@link Paid.BadRequestError}
|
|
256
|
+
* @throws {@link Paid.NotFoundError}
|
|
257
|
+
* @throws {@link Paid.ConflictError}
|
|
258
|
+
* @throws {@link Paid.InternalServerError}
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* await client.valueReceipts.refreshValueReceipt({
|
|
262
|
+
* id: "id"
|
|
263
|
+
* })
|
|
264
|
+
*/
|
|
265
|
+
refreshValueReceipt(request, requestOptions) {
|
|
266
|
+
return core.HttpResponsePromise.fromPromise(this.__refreshValueReceipt(request, requestOptions));
|
|
267
|
+
}
|
|
268
|
+
__refreshValueReceipt(request, requestOptions) {
|
|
269
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
271
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
272
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
273
|
+
const _response = yield core.fetcher({
|
|
274
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `value-receipts/${core.url.encodePathParam(id)}/refresh`),
|
|
275
|
+
method: "POST",
|
|
276
|
+
headers: _headers,
|
|
277
|
+
contentType: "application/json",
|
|
278
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
279
|
+
requestType: "json",
|
|
280
|
+
body: _body,
|
|
281
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
282
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
283
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
284
|
+
});
|
|
285
|
+
if (_response.ok) {
|
|
286
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
287
|
+
}
|
|
288
|
+
if (_response.error.reason === "status-code") {
|
|
289
|
+
switch (_response.error.statusCode) {
|
|
290
|
+
case 400:
|
|
291
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
292
|
+
case 404:
|
|
293
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
294
|
+
case 409:
|
|
295
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
296
|
+
case 500:
|
|
297
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
298
|
+
default:
|
|
299
|
+
throw new errors.PaidError({
|
|
300
|
+
statusCode: _response.error.statusCode,
|
|
301
|
+
body: _response.error.body,
|
|
302
|
+
rawResponse: _response.rawResponse,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
switch (_response.error.reason) {
|
|
307
|
+
case "non-json":
|
|
308
|
+
throw new errors.PaidError({
|
|
309
|
+
statusCode: _response.error.statusCode,
|
|
310
|
+
body: _response.error.rawBody,
|
|
311
|
+
rawResponse: _response.rawResponse,
|
|
312
|
+
});
|
|
313
|
+
case "timeout":
|
|
314
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/refresh.");
|
|
315
|
+
case "unknown":
|
|
316
|
+
throw new errors.PaidError({
|
|
317
|
+
message: _response.error.errorMessage,
|
|
318
|
+
rawResponse: _response.rawResponse,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Transition a draft value receipt to sealed (posted) status. Sealed VRs are immutable — they cannot be updated or re-populated.
|
|
325
|
+
*
|
|
326
|
+
* @param {Paid.SealValueReceiptRequest} request
|
|
327
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
328
|
+
*
|
|
329
|
+
* @throws {@link Paid.NotFoundError}
|
|
330
|
+
* @throws {@link Paid.ConflictError}
|
|
331
|
+
* @throws {@link Paid.InternalServerError}
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* await client.valueReceipts.sealValueReceipt({
|
|
335
|
+
* id: "id"
|
|
336
|
+
* })
|
|
337
|
+
*/
|
|
338
|
+
sealValueReceipt(request, requestOptions) {
|
|
339
|
+
return core.HttpResponsePromise.fromPromise(this.__sealValueReceipt(request, requestOptions));
|
|
340
|
+
}
|
|
341
|
+
__sealValueReceipt(request, requestOptions) {
|
|
342
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
343
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
344
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
345
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
346
|
+
const _response = yield core.fetcher({
|
|
347
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `value-receipts/${core.url.encodePathParam(id)}/seal`),
|
|
348
|
+
method: "POST",
|
|
349
|
+
headers: _headers,
|
|
350
|
+
contentType: "application/json",
|
|
351
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
352
|
+
requestType: "json",
|
|
353
|
+
body: _body,
|
|
354
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
355
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
356
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
357
|
+
});
|
|
358
|
+
if (_response.ok) {
|
|
359
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
360
|
+
}
|
|
361
|
+
if (_response.error.reason === "status-code") {
|
|
362
|
+
switch (_response.error.statusCode) {
|
|
363
|
+
case 404:
|
|
364
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
365
|
+
case 409:
|
|
366
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
367
|
+
case 500:
|
|
368
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
369
|
+
default:
|
|
370
|
+
throw new errors.PaidError({
|
|
371
|
+
statusCode: _response.error.statusCode,
|
|
372
|
+
body: _response.error.body,
|
|
373
|
+
rawResponse: _response.rawResponse,
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
switch (_response.error.reason) {
|
|
378
|
+
case "non-json":
|
|
379
|
+
throw new errors.PaidError({
|
|
380
|
+
statusCode: _response.error.statusCode,
|
|
381
|
+
body: _response.error.rawBody,
|
|
382
|
+
rawResponse: _response.rawResponse,
|
|
383
|
+
});
|
|
384
|
+
case "timeout":
|
|
385
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/seal.");
|
|
386
|
+
case "unknown":
|
|
387
|
+
throw new errors.PaidError({
|
|
388
|
+
message: _response.error.errorMessage,
|
|
389
|
+
rawResponse: _response.rawResponse,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Soft-archive a value receipt. Archived VRs are hidden from list by default.
|
|
396
|
+
*
|
|
397
|
+
* @param {Paid.ArchiveValueReceiptRequest} request
|
|
398
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
399
|
+
*
|
|
400
|
+
* @throws {@link Paid.NotFoundError}
|
|
401
|
+
* @throws {@link Paid.InternalServerError}
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* await client.valueReceipts.archiveValueReceipt({
|
|
405
|
+
* id: "id"
|
|
406
|
+
* })
|
|
407
|
+
*/
|
|
408
|
+
archiveValueReceipt(request, requestOptions) {
|
|
409
|
+
return core.HttpResponsePromise.fromPromise(this.__archiveValueReceipt(request, requestOptions));
|
|
410
|
+
}
|
|
411
|
+
__archiveValueReceipt(request, requestOptions) {
|
|
412
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
414
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
415
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
416
|
+
const _response = yield core.fetcher({
|
|
417
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `value-receipts/${core.url.encodePathParam(id)}/archive`),
|
|
418
|
+
method: "POST",
|
|
419
|
+
headers: _headers,
|
|
420
|
+
contentType: "application/json",
|
|
421
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
422
|
+
requestType: "json",
|
|
423
|
+
body: _body,
|
|
424
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
425
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
426
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
427
|
+
});
|
|
428
|
+
if (_response.ok) {
|
|
429
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
430
|
+
}
|
|
431
|
+
if (_response.error.reason === "status-code") {
|
|
432
|
+
switch (_response.error.statusCode) {
|
|
433
|
+
case 404:
|
|
434
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
435
|
+
case 500:
|
|
436
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
437
|
+
default:
|
|
438
|
+
throw new errors.PaidError({
|
|
439
|
+
statusCode: _response.error.statusCode,
|
|
440
|
+
body: _response.error.body,
|
|
441
|
+
rawResponse: _response.rawResponse,
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
switch (_response.error.reason) {
|
|
446
|
+
case "non-json":
|
|
447
|
+
throw new errors.PaidError({
|
|
448
|
+
statusCode: _response.error.statusCode,
|
|
449
|
+
body: _response.error.rawBody,
|
|
450
|
+
rawResponse: _response.rawResponse,
|
|
451
|
+
});
|
|
452
|
+
case "timeout":
|
|
453
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/archive.");
|
|
454
|
+
case "unknown":
|
|
455
|
+
throw new errors.PaidError({
|
|
456
|
+
message: _response.error.errorMessage,
|
|
457
|
+
rawResponse: _response.rawResponse,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Restore an archived value receipt.
|
|
464
|
+
*
|
|
465
|
+
* @param {Paid.UnarchiveValueReceiptRequest} request
|
|
466
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
467
|
+
*
|
|
468
|
+
* @throws {@link Paid.NotFoundError}
|
|
469
|
+
* @throws {@link Paid.InternalServerError}
|
|
470
|
+
*
|
|
471
|
+
* @example
|
|
472
|
+
* await client.valueReceipts.unarchiveValueReceipt({
|
|
473
|
+
* id: "id"
|
|
474
|
+
* })
|
|
475
|
+
*/
|
|
476
|
+
unarchiveValueReceipt(request, requestOptions) {
|
|
477
|
+
return core.HttpResponsePromise.fromPromise(this.__unarchiveValueReceipt(request, requestOptions));
|
|
478
|
+
}
|
|
479
|
+
__unarchiveValueReceipt(request, requestOptions) {
|
|
480
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
481
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
482
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
483
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
484
|
+
const _response = yield core.fetcher({
|
|
485
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `value-receipts/${core.url.encodePathParam(id)}/unarchive`),
|
|
486
|
+
method: "POST",
|
|
487
|
+
headers: _headers,
|
|
488
|
+
contentType: "application/json",
|
|
489
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
490
|
+
requestType: "json",
|
|
491
|
+
body: _body,
|
|
492
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
493
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
494
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
495
|
+
});
|
|
496
|
+
if (_response.ok) {
|
|
497
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
498
|
+
}
|
|
499
|
+
if (_response.error.reason === "status-code") {
|
|
500
|
+
switch (_response.error.statusCode) {
|
|
501
|
+
case 404:
|
|
502
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
503
|
+
case 500:
|
|
504
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
505
|
+
default:
|
|
506
|
+
throw new errors.PaidError({
|
|
507
|
+
statusCode: _response.error.statusCode,
|
|
508
|
+
body: _response.error.body,
|
|
509
|
+
rawResponse: _response.rawResponse,
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
switch (_response.error.reason) {
|
|
514
|
+
case "non-json":
|
|
515
|
+
throw new errors.PaidError({
|
|
516
|
+
statusCode: _response.error.statusCode,
|
|
517
|
+
body: _response.error.rawBody,
|
|
518
|
+
rawResponse: _response.rawResponse,
|
|
519
|
+
});
|
|
520
|
+
case "timeout":
|
|
521
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/unarchive.");
|
|
522
|
+
case "unknown":
|
|
523
|
+
throw new errors.PaidError({
|
|
524
|
+
message: _response.error.errorMessage,
|
|
525
|
+
rawResponse: _response.rawResponse,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
}
|
|
169
530
|
/**
|
|
170
531
|
* Make a value receipt publicly accessible via URL.
|
|
171
532
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Paid from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {}
|
|
@@ -5,6 +6,12 @@
|
|
|
5
6
|
export interface ListValueReceiptsRequest {
|
|
6
7
|
limit?: number;
|
|
7
8
|
offset?: number;
|
|
9
|
+
/** Filter by customer display ID. */
|
|
8
10
|
customerId?: string;
|
|
11
|
+
/** Filter by customer external ID. */
|
|
12
|
+
externalCustomerId?: string;
|
|
9
13
|
orderId?: string;
|
|
14
|
+
productId?: string;
|
|
15
|
+
/** Include archived value receipts. Defaults to false. */
|
|
16
|
+
archived?: Paid.ListValueReceiptsRequestArchived;
|
|
10
17
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* startDate: "2024-01-15T09:30:00Z",
|
|
5
|
+
* endDate: "2024-01-15T09:30:00Z"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SyncValueReceiptRequest {
|
|
9
|
+
/** Mutually exclusive with externalCustomerId. Exactly one is required. */
|
|
10
|
+
customerId?: string;
|
|
11
|
+
/** Mutually exclusive with customerId. Exactly one is required. */
|
|
12
|
+
externalCustomerId?: string;
|
|
13
|
+
startDate: string;
|
|
14
|
+
endDate: string;
|
|
15
|
+
/** Mutually exclusive with orderId. Provide at most one. */
|
|
16
|
+
product?: SyncValueReceiptRequest.Product;
|
|
17
|
+
/** Mutually exclusive with product. Provide at most one. */
|
|
18
|
+
orderId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace SyncValueReceiptRequest {
|
|
21
|
+
/**
|
|
22
|
+
* Mutually exclusive with orderId. Provide at most one.
|
|
23
|
+
*/
|
|
24
|
+
interface Product {
|
|
25
|
+
productId: string;
|
|
26
|
+
currency?: string;
|
|
27
|
+
}
|
|
28
|
+
}
|