@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
|
@@ -64,6 +64,77 @@ class ValueReceipts {
|
|
|
64
64
|
constructor(_options) {
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* 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.
|
|
69
|
+
*
|
|
70
|
+
* @param {Paid.SyncValueReceiptRequest} request
|
|
71
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link Paid.BadRequestError}
|
|
74
|
+
* @throws {@link Paid.NotFoundError}
|
|
75
|
+
* @throws {@link Paid.InternalServerError}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.valueReceipts.syncValueReceipt({
|
|
79
|
+
* startDate: "2024-01-15T09:30:00Z",
|
|
80
|
+
* endDate: "2024-01-15T09:30:00Z"
|
|
81
|
+
* })
|
|
82
|
+
*/
|
|
83
|
+
syncValueReceipt(request, requestOptions) {
|
|
84
|
+
return core.HttpResponsePromise.fromPromise(this.__syncValueReceipt(request, requestOptions));
|
|
85
|
+
}
|
|
86
|
+
__syncValueReceipt(request, requestOptions) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
89
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
90
|
+
const _response = yield core.fetcher({
|
|
91
|
+
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"),
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: _headers,
|
|
94
|
+
contentType: "application/json",
|
|
95
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
96
|
+
requestType: "json",
|
|
97
|
+
body: request,
|
|
98
|
+
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,
|
|
99
|
+
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,
|
|
100
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
101
|
+
});
|
|
102
|
+
if (_response.ok) {
|
|
103
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
104
|
+
}
|
|
105
|
+
if (_response.error.reason === "status-code") {
|
|
106
|
+
switch (_response.error.statusCode) {
|
|
107
|
+
case 400:
|
|
108
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
109
|
+
case 404:
|
|
110
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
111
|
+
case 500:
|
|
112
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
113
|
+
default:
|
|
114
|
+
throw new errors.PaidError({
|
|
115
|
+
statusCode: _response.error.statusCode,
|
|
116
|
+
body: _response.error.body,
|
|
117
|
+
rawResponse: _response.rawResponse,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
switch (_response.error.reason) {
|
|
122
|
+
case "non-json":
|
|
123
|
+
throw new errors.PaidError({
|
|
124
|
+
statusCode: _response.error.statusCode,
|
|
125
|
+
body: _response.error.rawBody,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
127
|
+
});
|
|
128
|
+
case "timeout":
|
|
129
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/sync.");
|
|
130
|
+
case "unknown":
|
|
131
|
+
throw new errors.PaidError({
|
|
132
|
+
message: _response.error.errorMessage,
|
|
133
|
+
rawResponse: _response.rawResponse,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
67
138
|
/**
|
|
68
139
|
* List value receipts for the organization
|
|
69
140
|
*
|
|
@@ -81,7 +152,7 @@ class ValueReceipts {
|
|
|
81
152
|
__listValueReceipts() {
|
|
82
153
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
83
154
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
84
|
-
const { limit, offset, customerId, orderId } = request;
|
|
155
|
+
const { limit, offset, customerId, externalCustomerId, orderId, productId, archived } = request;
|
|
85
156
|
const _queryParams = {};
|
|
86
157
|
if (limit != null) {
|
|
87
158
|
_queryParams.limit = limit.toString();
|
|
@@ -92,9 +163,18 @@ class ValueReceipts {
|
|
|
92
163
|
if (customerId != null) {
|
|
93
164
|
_queryParams.customerId = customerId;
|
|
94
165
|
}
|
|
166
|
+
if (externalCustomerId != null) {
|
|
167
|
+
_queryParams.externalCustomerId = externalCustomerId;
|
|
168
|
+
}
|
|
95
169
|
if (orderId != null) {
|
|
96
170
|
_queryParams.orderId = orderId;
|
|
97
171
|
}
|
|
172
|
+
if (productId != null) {
|
|
173
|
+
_queryParams.productId = productId;
|
|
174
|
+
}
|
|
175
|
+
if (archived != null) {
|
|
176
|
+
_queryParams.archived = archived;
|
|
177
|
+
}
|
|
98
178
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
99
179
|
const _response = yield core.fetcher({
|
|
100
180
|
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/"),
|
|
@@ -202,6 +282,287 @@ class ValueReceipts {
|
|
|
202
282
|
}
|
|
203
283
|
});
|
|
204
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* Re-populate an existing draft value receipt with current data inline. Returns the slim sync response. Sealed VRs cannot be refreshed.
|
|
287
|
+
*
|
|
288
|
+
* @param {Paid.RefreshValueReceiptRequest} request
|
|
289
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
290
|
+
*
|
|
291
|
+
* @throws {@link Paid.BadRequestError}
|
|
292
|
+
* @throws {@link Paid.NotFoundError}
|
|
293
|
+
* @throws {@link Paid.ConflictError}
|
|
294
|
+
* @throws {@link Paid.InternalServerError}
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* await client.valueReceipts.refreshValueReceipt({
|
|
298
|
+
* id: "id"
|
|
299
|
+
* })
|
|
300
|
+
*/
|
|
301
|
+
refreshValueReceipt(request, requestOptions) {
|
|
302
|
+
return core.HttpResponsePromise.fromPromise(this.__refreshValueReceipt(request, requestOptions));
|
|
303
|
+
}
|
|
304
|
+
__refreshValueReceipt(request, requestOptions) {
|
|
305
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
306
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
307
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
308
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
309
|
+
const _response = yield core.fetcher({
|
|
310
|
+
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`),
|
|
311
|
+
method: "POST",
|
|
312
|
+
headers: _headers,
|
|
313
|
+
contentType: "application/json",
|
|
314
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
315
|
+
requestType: "json",
|
|
316
|
+
body: _body,
|
|
317
|
+
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,
|
|
318
|
+
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,
|
|
319
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
320
|
+
});
|
|
321
|
+
if (_response.ok) {
|
|
322
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
323
|
+
}
|
|
324
|
+
if (_response.error.reason === "status-code") {
|
|
325
|
+
switch (_response.error.statusCode) {
|
|
326
|
+
case 400:
|
|
327
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
328
|
+
case 404:
|
|
329
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
330
|
+
case 409:
|
|
331
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
332
|
+
case 500:
|
|
333
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
334
|
+
default:
|
|
335
|
+
throw new errors.PaidError({
|
|
336
|
+
statusCode: _response.error.statusCode,
|
|
337
|
+
body: _response.error.body,
|
|
338
|
+
rawResponse: _response.rawResponse,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
switch (_response.error.reason) {
|
|
343
|
+
case "non-json":
|
|
344
|
+
throw new errors.PaidError({
|
|
345
|
+
statusCode: _response.error.statusCode,
|
|
346
|
+
body: _response.error.rawBody,
|
|
347
|
+
rawResponse: _response.rawResponse,
|
|
348
|
+
});
|
|
349
|
+
case "timeout":
|
|
350
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/refresh.");
|
|
351
|
+
case "unknown":
|
|
352
|
+
throw new errors.PaidError({
|
|
353
|
+
message: _response.error.errorMessage,
|
|
354
|
+
rawResponse: _response.rawResponse,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Transition a draft value receipt to sealed (posted) status. Sealed VRs are immutable — they cannot be updated or re-populated.
|
|
361
|
+
*
|
|
362
|
+
* @param {Paid.SealValueReceiptRequest} request
|
|
363
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
364
|
+
*
|
|
365
|
+
* @throws {@link Paid.NotFoundError}
|
|
366
|
+
* @throws {@link Paid.ConflictError}
|
|
367
|
+
* @throws {@link Paid.InternalServerError}
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* await client.valueReceipts.sealValueReceipt({
|
|
371
|
+
* id: "id"
|
|
372
|
+
* })
|
|
373
|
+
*/
|
|
374
|
+
sealValueReceipt(request, requestOptions) {
|
|
375
|
+
return core.HttpResponsePromise.fromPromise(this.__sealValueReceipt(request, requestOptions));
|
|
376
|
+
}
|
|
377
|
+
__sealValueReceipt(request, requestOptions) {
|
|
378
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
379
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
380
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
381
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
382
|
+
const _response = yield core.fetcher({
|
|
383
|
+
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`),
|
|
384
|
+
method: "POST",
|
|
385
|
+
headers: _headers,
|
|
386
|
+
contentType: "application/json",
|
|
387
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
388
|
+
requestType: "json",
|
|
389
|
+
body: _body,
|
|
390
|
+
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,
|
|
391
|
+
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,
|
|
392
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
393
|
+
});
|
|
394
|
+
if (_response.ok) {
|
|
395
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
396
|
+
}
|
|
397
|
+
if (_response.error.reason === "status-code") {
|
|
398
|
+
switch (_response.error.statusCode) {
|
|
399
|
+
case 404:
|
|
400
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
401
|
+
case 409:
|
|
402
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
403
|
+
case 500:
|
|
404
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
405
|
+
default:
|
|
406
|
+
throw new errors.PaidError({
|
|
407
|
+
statusCode: _response.error.statusCode,
|
|
408
|
+
body: _response.error.body,
|
|
409
|
+
rawResponse: _response.rawResponse,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
switch (_response.error.reason) {
|
|
414
|
+
case "non-json":
|
|
415
|
+
throw new errors.PaidError({
|
|
416
|
+
statusCode: _response.error.statusCode,
|
|
417
|
+
body: _response.error.rawBody,
|
|
418
|
+
rawResponse: _response.rawResponse,
|
|
419
|
+
});
|
|
420
|
+
case "timeout":
|
|
421
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/seal.");
|
|
422
|
+
case "unknown":
|
|
423
|
+
throw new errors.PaidError({
|
|
424
|
+
message: _response.error.errorMessage,
|
|
425
|
+
rawResponse: _response.rawResponse,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Soft-archive a value receipt. Archived VRs are hidden from list by default.
|
|
432
|
+
*
|
|
433
|
+
* @param {Paid.ArchiveValueReceiptRequest} request
|
|
434
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
435
|
+
*
|
|
436
|
+
* @throws {@link Paid.NotFoundError}
|
|
437
|
+
* @throws {@link Paid.InternalServerError}
|
|
438
|
+
*
|
|
439
|
+
* @example
|
|
440
|
+
* await client.valueReceipts.archiveValueReceipt({
|
|
441
|
+
* id: "id"
|
|
442
|
+
* })
|
|
443
|
+
*/
|
|
444
|
+
archiveValueReceipt(request, requestOptions) {
|
|
445
|
+
return core.HttpResponsePromise.fromPromise(this.__archiveValueReceipt(request, requestOptions));
|
|
446
|
+
}
|
|
447
|
+
__archiveValueReceipt(request, requestOptions) {
|
|
448
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
450
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
451
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
452
|
+
const _response = yield core.fetcher({
|
|
453
|
+
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`),
|
|
454
|
+
method: "POST",
|
|
455
|
+
headers: _headers,
|
|
456
|
+
contentType: "application/json",
|
|
457
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
458
|
+
requestType: "json",
|
|
459
|
+
body: _body,
|
|
460
|
+
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,
|
|
461
|
+
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,
|
|
462
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
463
|
+
});
|
|
464
|
+
if (_response.ok) {
|
|
465
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
466
|
+
}
|
|
467
|
+
if (_response.error.reason === "status-code") {
|
|
468
|
+
switch (_response.error.statusCode) {
|
|
469
|
+
case 404:
|
|
470
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
471
|
+
case 500:
|
|
472
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
473
|
+
default:
|
|
474
|
+
throw new errors.PaidError({
|
|
475
|
+
statusCode: _response.error.statusCode,
|
|
476
|
+
body: _response.error.body,
|
|
477
|
+
rawResponse: _response.rawResponse,
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
switch (_response.error.reason) {
|
|
482
|
+
case "non-json":
|
|
483
|
+
throw new errors.PaidError({
|
|
484
|
+
statusCode: _response.error.statusCode,
|
|
485
|
+
body: _response.error.rawBody,
|
|
486
|
+
rawResponse: _response.rawResponse,
|
|
487
|
+
});
|
|
488
|
+
case "timeout":
|
|
489
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/archive.");
|
|
490
|
+
case "unknown":
|
|
491
|
+
throw new errors.PaidError({
|
|
492
|
+
message: _response.error.errorMessage,
|
|
493
|
+
rawResponse: _response.rawResponse,
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Restore an archived value receipt.
|
|
500
|
+
*
|
|
501
|
+
* @param {Paid.UnarchiveValueReceiptRequest} request
|
|
502
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
503
|
+
*
|
|
504
|
+
* @throws {@link Paid.NotFoundError}
|
|
505
|
+
* @throws {@link Paid.InternalServerError}
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* await client.valueReceipts.unarchiveValueReceipt({
|
|
509
|
+
* id: "id"
|
|
510
|
+
* })
|
|
511
|
+
*/
|
|
512
|
+
unarchiveValueReceipt(request, requestOptions) {
|
|
513
|
+
return core.HttpResponsePromise.fromPromise(this.__unarchiveValueReceipt(request, requestOptions));
|
|
514
|
+
}
|
|
515
|
+
__unarchiveValueReceipt(request, requestOptions) {
|
|
516
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
517
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
518
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
519
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
520
|
+
const _response = yield core.fetcher({
|
|
521
|
+
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`),
|
|
522
|
+
method: "POST",
|
|
523
|
+
headers: _headers,
|
|
524
|
+
contentType: "application/json",
|
|
525
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
526
|
+
requestType: "json",
|
|
527
|
+
body: _body,
|
|
528
|
+
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,
|
|
529
|
+
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,
|
|
530
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
531
|
+
});
|
|
532
|
+
if (_response.ok) {
|
|
533
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
534
|
+
}
|
|
535
|
+
if (_response.error.reason === "status-code") {
|
|
536
|
+
switch (_response.error.statusCode) {
|
|
537
|
+
case 404:
|
|
538
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
539
|
+
case 500:
|
|
540
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
541
|
+
default:
|
|
542
|
+
throw new errors.PaidError({
|
|
543
|
+
statusCode: _response.error.statusCode,
|
|
544
|
+
body: _response.error.body,
|
|
545
|
+
rawResponse: _response.rawResponse,
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
switch (_response.error.reason) {
|
|
550
|
+
case "non-json":
|
|
551
|
+
throw new errors.PaidError({
|
|
552
|
+
statusCode: _response.error.statusCode,
|
|
553
|
+
body: _response.error.rawBody,
|
|
554
|
+
rawResponse: _response.rawResponse,
|
|
555
|
+
});
|
|
556
|
+
case "timeout":
|
|
557
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/unarchive.");
|
|
558
|
+
case "unknown":
|
|
559
|
+
throw new errors.PaidError({
|
|
560
|
+
message: _response.error.errorMessage,
|
|
561
|
+
rawResponse: _response.rawResponse,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
205
566
|
/**
|
|
206
567
|
* Make a value receipt publicly accessible via URL.
|
|
207
568
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Paid from "../../../../index.js";
|
|
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
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
export type { ArchiveValueReceiptRequest } from "./ArchiveValueReceiptRequest.js";
|
|
1
2
|
export type { GetValueReceiptByIdRequest } from "./GetValueReceiptByIdRequest.js";
|
|
2
3
|
export type { ListValueReceiptsRequest } from "./ListValueReceiptsRequest.js";
|
|
3
4
|
export type { PublishValueReceiptBody } from "./PublishValueReceiptBody.js";
|
|
5
|
+
export type { RefreshValueReceiptRequest } from "./RefreshValueReceiptRequest.js";
|
|
6
|
+
export type { SealValueReceiptRequest } from "./SealValueReceiptRequest.js";
|
|
7
|
+
export type { SyncValueReceiptRequest } from "./SyncValueReceiptRequest.js";
|
|
8
|
+
export type { UnarchiveValueReceiptRequest } from "./UnarchiveValueReceiptRequest.js";
|
|
4
9
|
export type { UnpublishValueReceiptRequest } from "./UnpublishValueReceiptRequest.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ListValueReceiptsRequestArchived = void 0;
|
|
5
|
+
exports.ListValueReceiptsRequestArchived = {
|
|
6
|
+
True: "true",
|
|
7
|
+
False: "false",
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListValueReceiptsRequestArchived.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ListValueReceiptsRequestArchived.js"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
2
|
+
export type Cost = Paid.Cost.Cost | Paid.Cost.Usage;
|
|
3
|
+
export declare namespace Cost {
|
|
4
|
+
interface Cost extends Paid.PrecomputedCost {
|
|
5
|
+
type: "cost";
|
|
6
|
+
}
|
|
7
|
+
interface Usage extends Paid.UsageCost {
|
|
8
|
+
type: "usage";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
1
2
|
export interface CreditBalance {
|
|
2
3
|
creditsCurrencyId: string;
|
|
3
4
|
currencyName: string;
|
|
4
5
|
currencyKey: string;
|
|
6
|
+
/** Effective spendable balance across all grants in this pool, rollover-capped during rollover windows. Equals sum(grants[].available). */
|
|
5
7
|
available: number;
|
|
6
8
|
used: number;
|
|
7
9
|
total: number;
|
|
10
|
+
/** Aggregate min(periodStart) across grants in this pool. Does not correspond to any real billing period when grants overlap. Use grants[].periodStart instead. Will be removed in a future API version. */
|
|
8
11
|
periodStart: string | null;
|
|
12
|
+
/** Aggregate max(periodEnd) across grants in this pool. Does not correspond to any real billing period when grants overlap. Use grants[].periodEnd or grants[].expiresAt instead. Will be removed in a future API version. */
|
|
9
13
|
periodEnd: string | null;
|
|
14
|
+
/** Aggregate max(rolloverEndDate) across grants in this pool. Use grants[].rolloverEndDate or grants[].expiresAt instead. Will be removed in a future API version. */
|
|
10
15
|
rolloverEndDate: string | null;
|
|
11
16
|
recipient: CreditBalance.Recipient;
|
|
17
|
+
grants: Paid.CreditGrant[];
|
|
12
18
|
}
|
|
13
19
|
export declare namespace CreditBalance {
|
|
14
20
|
const Recipient: {
|