@paid-ai/paid-node 1.2.0 → 1.3.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 +12 -2
- package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
- package/dist/cjs/api/errors/ConflictError.js +50 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- package/dist/cjs/api/resources/checkouts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.ts +2 -0
- package/dist/cjs/api/resources/customers/client/Client.d.ts +21 -0
- package/dist/cjs/api/resources/customers/client/Client.js +92 -0
- package/dist/cjs/api/resources/customers/client/requests/UpsertCustomerUserRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/UpsertCustomerUserRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +6 -0
- package/dist/cjs/api/resources/index.js +7 -1
- package/dist/cjs/api/resources/orders/client/Client.d.ts +60 -0
- package/dist/cjs/api/resources/orders/client/Client.js +242 -0
- package/dist/cjs/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.d.ts +22 -0
- package/dist/cjs/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/ListOrderSeatsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/orders/client/requests/ListOrderSeatsRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.d.ts +12 -0
- package/dist/cjs/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/orders/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/index.js +1 -0
- package/dist/cjs/api/resources/orders/types/ListOrderSeatsRequestStatus.d.ts +5 -0
- package/dist/cjs/api/resources/orders/types/ListOrderSeatsRequestStatus.js +8 -0
- package/dist/cjs/api/resources/orders/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/types/index.js +17 -0
- package/dist/cjs/api/resources/valueReceipts/client/Client.d.ts +75 -0
- package/dist/cjs/api/resources/valueReceipts/client/Client.js +347 -0
- package/dist/cjs/api/resources/valueReceipts/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueReceipts/client/index.js +17 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.ts +10 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/valueReceipts/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueReceipts/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +63 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +282 -0
- package/dist/cjs/api/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/client/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.ts +14 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/webhooks/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/index.js +18 -0
- package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.ts +12 -0
- package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.js +15 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.ts +12 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.js +15 -0
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +18 -0
- package/dist/cjs/api/types/BatchSeatAssignmentsResponse.d.ts +4 -0
- package/dist/cjs/api/types/BatchSeatAssignmentsResponse.js +3 -0
- package/dist/cjs/api/types/Checkout.d.ts +1 -0
- package/dist/cjs/api/types/CheckoutDetails.d.ts +21 -0
- package/dist/cjs/api/types/CheckoutDetails.js +3 -0
- package/dist/cjs/api/types/CustomerUser.d.ts +13 -0
- package/dist/cjs/api/types/CustomerUser.js +3 -0
- package/dist/cjs/api/types/CustomerUserStatus.d.ts +5 -0
- package/dist/cjs/api/types/CustomerUserStatus.js +8 -0
- package/dist/cjs/api/types/OrderSeat.d.ts +10 -0
- package/dist/cjs/api/types/OrderSeat.js +3 -0
- package/dist/cjs/api/types/OrderSeatListResponse.d.ts +5 -0
- package/dist/cjs/api/types/OrderSeatListResponse.js +3 -0
- package/dist/cjs/api/types/SeatAssignee.d.ts +5 -0
- package/dist/cjs/api/types/SeatAssignee.js +3 -0
- package/dist/cjs/api/types/SeatAssignmentStatus.d.ts +5 -0
- package/dist/cjs/api/types/SeatAssignmentStatus.js +8 -0
- package/dist/cjs/api/types/ValueReceiptDetail.d.ts +19 -0
- package/dist/cjs/api/types/ValueReceiptDetail.js +3 -0
- package/dist/cjs/api/types/ValueReceiptListResponse.d.ts +5 -0
- package/dist/cjs/api/types/ValueReceiptListResponse.js +3 -0
- package/dist/cjs/api/types/ValueReceiptSummary.d.ts +16 -0
- package/dist/cjs/api/types/ValueReceiptSummary.js +3 -0
- package/dist/cjs/api/types/Webhook.d.ts +24 -0
- package/dist/cjs/api/types/Webhook.js +18 -0
- package/dist/cjs/api/types/WebhookDeliveryStatus.d.ts +5 -0
- package/dist/cjs/api/types/WebhookDeliveryStatus.js +8 -0
- package/dist/cjs/api/types/WebhookListResponse.d.ts +4 -0
- package/dist/cjs/api/types/WebhookListResponse.js +3 -0
- package/dist/cjs/api/types/WebhookTestResponse.d.ts +3 -0
- package/dist/cjs/api/types/WebhookTestResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +15 -0
- package/dist/cjs/api/types/index.js +15 -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/errors/ConflictError.d.mts +6 -0
- package/dist/esm/api/errors/ConflictError.mjs +13 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- package/dist/esm/api/resources/checkouts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.mts +2 -0
- package/dist/esm/api/resources/customers/client/Client.d.mts +21 -0
- package/dist/esm/api/resources/customers/client/Client.mjs +92 -0
- package/dist/esm/api/resources/customers/client/requests/UpsertCustomerUserRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/UpsertCustomerUserRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/index.d.mts +6 -0
- package/dist/esm/api/resources/index.mjs +6 -0
- package/dist/esm/api/resources/orders/client/Client.d.mts +60 -0
- package/dist/esm/api/resources/orders/client/Client.mjs +242 -0
- package/dist/esm/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.d.mts +22 -0
- package/dist/esm/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/ListOrderSeatsRequest.d.mts +14 -0
- package/dist/esm/api/resources/orders/client/requests/ListOrderSeatsRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.d.mts +12 -0
- package/dist/esm/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/orders/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/index.mjs +1 -0
- package/dist/esm/api/resources/orders/types/ListOrderSeatsRequestStatus.d.mts +5 -0
- package/dist/esm/api/resources/orders/types/ListOrderSeatsRequestStatus.mjs +5 -0
- package/dist/esm/api/resources/orders/types/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/types/index.mjs +1 -0
- package/dist/esm/api/resources/valueReceipts/client/Client.d.mts +75 -0
- package/dist/esm/api/resources/valueReceipts/client/Client.mjs +310 -0
- package/dist/esm/api/resources/valueReceipts/client/index.d.mts +1 -0
- package/dist/esm/api/resources/valueReceipts/client/index.mjs +1 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.mts +10 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.mts +10 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/index.mjs +1 -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/webhooks/client/Client.d.mts +63 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +245 -0
- package/dist/esm/api/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.mts +14 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/index.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.mts +12 -0
- package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.mjs +12 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.mts +12 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.mjs +12 -0
- package/dist/esm/api/resources/webhooks/types/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +2 -0
- package/dist/esm/api/types/BatchSeatAssignmentsResponse.d.mts +4 -0
- package/dist/esm/api/types/BatchSeatAssignmentsResponse.mjs +2 -0
- package/dist/esm/api/types/Checkout.d.mts +1 -0
- package/dist/esm/api/types/CheckoutDetails.d.mts +21 -0
- package/dist/esm/api/types/CheckoutDetails.mjs +2 -0
- package/dist/esm/api/types/CustomerUser.d.mts +13 -0
- package/dist/esm/api/types/CustomerUser.mjs +2 -0
- package/dist/esm/api/types/CustomerUserStatus.d.mts +5 -0
- package/dist/esm/api/types/CustomerUserStatus.mjs +5 -0
- package/dist/esm/api/types/OrderSeat.d.mts +10 -0
- package/dist/esm/api/types/OrderSeat.mjs +2 -0
- package/dist/esm/api/types/OrderSeatListResponse.d.mts +5 -0
- package/dist/esm/api/types/OrderSeatListResponse.mjs +2 -0
- package/dist/esm/api/types/SeatAssignee.d.mts +5 -0
- package/dist/esm/api/types/SeatAssignee.mjs +2 -0
- package/dist/esm/api/types/SeatAssignmentStatus.d.mts +5 -0
- package/dist/esm/api/types/SeatAssignmentStatus.mjs +5 -0
- package/dist/esm/api/types/ValueReceiptDetail.d.mts +19 -0
- package/dist/esm/api/types/ValueReceiptDetail.mjs +2 -0
- package/dist/esm/api/types/ValueReceiptListResponse.d.mts +5 -0
- package/dist/esm/api/types/ValueReceiptListResponse.mjs +2 -0
- package/dist/esm/api/types/ValueReceiptSummary.d.mts +16 -0
- package/dist/esm/api/types/ValueReceiptSummary.mjs +2 -0
- package/dist/esm/api/types/Webhook.d.mts +24 -0
- package/dist/esm/api/types/Webhook.mjs +15 -0
- package/dist/esm/api/types/WebhookDeliveryStatus.d.mts +5 -0
- package/dist/esm/api/types/WebhookDeliveryStatus.mjs +5 -0
- package/dist/esm/api/types/WebhookListResponse.d.mts +4 -0
- package/dist/esm/api/types/WebhookListResponse.mjs +2 -0
- package/dist/esm/api/types/WebhookTestResponse.d.mts +3 -0
- package/dist/esm/api/types/WebhookTestResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +15 -0
- package/dist/esm/api/types/index.mjs +15 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +711 -1
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import { Invoices } from "./api/resources/invoices/client/Client.js";
|
|
|
7
7
|
import { Orders } from "./api/resources/orders/client/Client.js";
|
|
8
8
|
import { Products } from "./api/resources/products/client/Client.js";
|
|
9
9
|
import { Signals } from "./api/resources/signals/client/Client.js";
|
|
10
|
+
import { ValueReceipts } from "./api/resources/valueReceipts/client/Client.js";
|
|
11
|
+
import { Webhooks } from "./api/resources/webhooks/client/Client.js";
|
|
10
12
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
11
13
|
export declare namespace PaidClient {
|
|
12
14
|
interface Options extends BaseClientOptions {
|
|
@@ -25,6 +27,8 @@ export declare class PaidClient {
|
|
|
25
27
|
protected _credits: Credits | undefined;
|
|
26
28
|
protected _checkouts: Checkouts | undefined;
|
|
27
29
|
protected _customerPortals: CustomerPortals | undefined;
|
|
30
|
+
protected _valueReceipts: ValueReceipts | undefined;
|
|
31
|
+
protected _webhooks: Webhooks | undefined;
|
|
28
32
|
constructor(_options: PaidClient.Options);
|
|
29
33
|
get products(): Products;
|
|
30
34
|
get customers(): Customers;
|
|
@@ -35,4 +39,6 @@ export declare class PaidClient {
|
|
|
35
39
|
get credits(): Credits;
|
|
36
40
|
get checkouts(): Checkouts;
|
|
37
41
|
get customerPortals(): CustomerPortals;
|
|
42
|
+
get valueReceipts(): ValueReceipts;
|
|
43
|
+
get webhooks(): Webhooks;
|
|
38
44
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -44,6 +44,8 @@ const Client_js_6 = require("./api/resources/invoices/client/Client.js");
|
|
|
44
44
|
const Client_js_7 = require("./api/resources/orders/client/Client.js");
|
|
45
45
|
const Client_js_8 = require("./api/resources/products/client/Client.js");
|
|
46
46
|
const Client_js_9 = require("./api/resources/signals/client/Client.js");
|
|
47
|
+
const Client_js_10 = require("./api/resources/valueReceipts/client/Client.js");
|
|
48
|
+
const Client_js_11 = require("./api/resources/webhooks/client/Client.js");
|
|
47
49
|
const headers_js_1 = require("./core/headers.js");
|
|
48
50
|
const core = __importStar(require("./core/index.js"));
|
|
49
51
|
class PaidClient {
|
|
@@ -51,8 +53,8 @@ class PaidClient {
|
|
|
51
53
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
52
54
|
"X-Fern-Language": "JavaScript",
|
|
53
55
|
"X-Fern-SDK-Name": "@paid-ai/paid-node",
|
|
54
|
-
"X-Fern-SDK-Version": "1.
|
|
55
|
-
"User-Agent": "@paid-ai/paid-node/1.
|
|
56
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
57
|
+
"User-Agent": "@paid-ai/paid-node/1.3.0",
|
|
56
58
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
57
59
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
58
60
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -93,5 +95,13 @@ class PaidClient {
|
|
|
93
95
|
var _a;
|
|
94
96
|
return ((_a = this._customerPortals) !== null && _a !== void 0 ? _a : (this._customerPortals = new Client_js_4.CustomerPortals(this._options)));
|
|
95
97
|
}
|
|
98
|
+
get valueReceipts() {
|
|
99
|
+
var _a;
|
|
100
|
+
return ((_a = this._valueReceipts) !== null && _a !== void 0 ? _a : (this._valueReceipts = new Client_js_10.ValueReceipts(this._options)));
|
|
101
|
+
}
|
|
102
|
+
get webhooks() {
|
|
103
|
+
var _a;
|
|
104
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_11.Webhooks(this._options)));
|
|
105
|
+
}
|
|
96
106
|
}
|
|
97
107
|
exports.PaidClient = PaidClient;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.js";
|
|
2
|
+
import * as errors from "../../errors/index.js";
|
|
3
|
+
import type * as Paid from "../index.js";
|
|
4
|
+
export declare class ConflictError extends errors.PaidError {
|
|
5
|
+
constructor(body: Paid.ErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ConflictError = void 0;
|
|
38
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
39
|
+
class ConflictError extends errors.PaidError {
|
|
40
|
+
constructor(body, rawResponse) {
|
|
41
|
+
super({
|
|
42
|
+
message: "ConflictError",
|
|
43
|
+
statusCode: 409,
|
|
44
|
+
body: body,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.ConflictError = ConflictError;
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BadRequestError.js"), exports);
|
|
18
|
+
__exportStar(require("./ConflictError.js"), exports);
|
|
18
19
|
__exportStar(require("./ForbiddenError.js"), exports);
|
|
19
20
|
__exportStar(require("./InternalServerError.js"), exports);
|
|
20
21
|
__exportStar(require("./NotFoundError.js"), exports);
|
|
@@ -61,7 +61,7 @@ export declare class Checkouts {
|
|
|
61
61
|
* id: "id"
|
|
62
62
|
* })
|
|
63
63
|
*/
|
|
64
|
-
getCheckout(request: Paid.GetCheckoutRequest, requestOptions?: Checkouts.RequestOptions): core.HttpResponsePromise<Paid.
|
|
64
|
+
getCheckout(request: Paid.GetCheckoutRequest, requestOptions?: Checkouts.RequestOptions): core.HttpResponsePromise<Paid.CheckoutDetails>;
|
|
65
65
|
private __getCheckout;
|
|
66
66
|
/**
|
|
67
67
|
* Archive a checkout by ID
|
|
@@ -84,6 +84,7 @@ export declare class Customers {
|
|
|
84
84
|
* @param {Paid.DeleteCustomerByIdRequest} request
|
|
85
85
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
86
|
*
|
|
87
|
+
* @throws {@link Paid.BadRequestError}
|
|
87
88
|
* @throws {@link Paid.ForbiddenError}
|
|
88
89
|
* @throws {@link Paid.NotFoundError}
|
|
89
90
|
* @throws {@link Paid.InternalServerError}
|
|
@@ -137,6 +138,7 @@ export declare class Customers {
|
|
|
137
138
|
* @param {Paid.DeleteCustomerByExternalIdRequest} request
|
|
138
139
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
139
140
|
*
|
|
141
|
+
* @throws {@link Paid.BadRequestError}
|
|
140
142
|
* @throws {@link Paid.ForbiddenError}
|
|
141
143
|
* @throws {@link Paid.NotFoundError}
|
|
142
144
|
* @throws {@link Paid.InternalServerError}
|
|
@@ -182,5 +184,24 @@ export declare class Customers {
|
|
|
182
184
|
*/
|
|
183
185
|
getCustomerCreditBalancesByExternalId(request: Paid.GetCustomerCreditBalancesByExternalIdRequest, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<Paid.CreditBalanceListResponse>;
|
|
184
186
|
private __getCustomerCreditBalancesByExternalId;
|
|
187
|
+
/**
|
|
188
|
+
* Create or update a customer user using customer and user external IDs
|
|
189
|
+
*
|
|
190
|
+
* @param {Paid.UpsertCustomerUserRequest} request
|
|
191
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
192
|
+
*
|
|
193
|
+
* @throws {@link Paid.BadRequestError}
|
|
194
|
+
* @throws {@link Paid.ForbiddenError}
|
|
195
|
+
* @throws {@link Paid.NotFoundError}
|
|
196
|
+
* @throws {@link Paid.InternalServerError}
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* await client.customers.upsertCustomerUserByExternalId({
|
|
200
|
+
* customerExternalId: "customerExternalId",
|
|
201
|
+
* userExternalId: "userExternalId"
|
|
202
|
+
* })
|
|
203
|
+
*/
|
|
204
|
+
upsertCustomerUserByExternalId(request: Paid.UpsertCustomerUserRequest, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<Paid.CustomerUser>;
|
|
205
|
+
private __upsertCustomerUserByExternalId;
|
|
185
206
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
186
207
|
}
|
|
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
45
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
57
|
exports.Customers = void 0;
|
|
47
58
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
@@ -345,6 +356,7 @@ class Customers {
|
|
|
345
356
|
* @param {Paid.DeleteCustomerByIdRequest} request
|
|
346
357
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
347
358
|
*
|
|
359
|
+
* @throws {@link Paid.BadRequestError}
|
|
348
360
|
* @throws {@link Paid.ForbiddenError}
|
|
349
361
|
* @throws {@link Paid.NotFoundError}
|
|
350
362
|
* @throws {@link Paid.InternalServerError}
|
|
@@ -376,6 +388,8 @@ class Customers {
|
|
|
376
388
|
}
|
|
377
389
|
if (_response.error.reason === "status-code") {
|
|
378
390
|
switch (_response.error.statusCode) {
|
|
391
|
+
case 400:
|
|
392
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
379
393
|
case 403:
|
|
380
394
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
381
395
|
case 404:
|
|
@@ -556,6 +570,7 @@ class Customers {
|
|
|
556
570
|
* @param {Paid.DeleteCustomerByExternalIdRequest} request
|
|
557
571
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
558
572
|
*
|
|
573
|
+
* @throws {@link Paid.BadRequestError}
|
|
559
574
|
* @throws {@link Paid.ForbiddenError}
|
|
560
575
|
* @throws {@link Paid.NotFoundError}
|
|
561
576
|
* @throws {@link Paid.InternalServerError}
|
|
@@ -587,6 +602,8 @@ class Customers {
|
|
|
587
602
|
}
|
|
588
603
|
if (_response.error.reason === "status-code") {
|
|
589
604
|
switch (_response.error.statusCode) {
|
|
605
|
+
case 400:
|
|
606
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
590
607
|
case 403:
|
|
591
608
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
592
609
|
case 404:
|
|
@@ -754,6 +771,81 @@ class Customers {
|
|
|
754
771
|
}
|
|
755
772
|
});
|
|
756
773
|
}
|
|
774
|
+
/**
|
|
775
|
+
* Create or update a customer user using customer and user external IDs
|
|
776
|
+
*
|
|
777
|
+
* @param {Paid.UpsertCustomerUserRequest} request
|
|
778
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
779
|
+
*
|
|
780
|
+
* @throws {@link Paid.BadRequestError}
|
|
781
|
+
* @throws {@link Paid.ForbiddenError}
|
|
782
|
+
* @throws {@link Paid.NotFoundError}
|
|
783
|
+
* @throws {@link Paid.InternalServerError}
|
|
784
|
+
*
|
|
785
|
+
* @example
|
|
786
|
+
* await client.customers.upsertCustomerUserByExternalId({
|
|
787
|
+
* customerExternalId: "customerExternalId",
|
|
788
|
+
* userExternalId: "userExternalId"
|
|
789
|
+
* })
|
|
790
|
+
*/
|
|
791
|
+
upsertCustomerUserByExternalId(request, requestOptions) {
|
|
792
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertCustomerUserByExternalId(request, requestOptions));
|
|
793
|
+
}
|
|
794
|
+
__upsertCustomerUserByExternalId(request, requestOptions) {
|
|
795
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
796
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
797
|
+
const { customerExternalId, userExternalId } = request, _body = __rest(request, ["customerExternalId", "userExternalId"]);
|
|
798
|
+
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);
|
|
799
|
+
const _response = yield core.fetcher({
|
|
800
|
+
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, `customers/${core.url.encodePathParam(customerExternalId)}/users/${core.url.encodePathParam(userExternalId)}`),
|
|
801
|
+
method: "PUT",
|
|
802
|
+
headers: _headers,
|
|
803
|
+
contentType: "application/json",
|
|
804
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
805
|
+
requestType: "json",
|
|
806
|
+
body: _body,
|
|
807
|
+
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,
|
|
808
|
+
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,
|
|
809
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
810
|
+
});
|
|
811
|
+
if (_response.ok) {
|
|
812
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
813
|
+
}
|
|
814
|
+
if (_response.error.reason === "status-code") {
|
|
815
|
+
switch (_response.error.statusCode) {
|
|
816
|
+
case 400:
|
|
817
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
818
|
+
case 403:
|
|
819
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
820
|
+
case 404:
|
|
821
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
822
|
+
case 500:
|
|
823
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
824
|
+
default:
|
|
825
|
+
throw new errors.PaidError({
|
|
826
|
+
statusCode: _response.error.statusCode,
|
|
827
|
+
body: _response.error.body,
|
|
828
|
+
rawResponse: _response.rawResponse,
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
switch (_response.error.reason) {
|
|
833
|
+
case "non-json":
|
|
834
|
+
throw new errors.PaidError({
|
|
835
|
+
statusCode: _response.error.statusCode,
|
|
836
|
+
body: _response.error.rawBody,
|
|
837
|
+
rawResponse: _response.rawResponse,
|
|
838
|
+
});
|
|
839
|
+
case "timeout":
|
|
840
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{customerExternalId}/users/{userExternalId}.");
|
|
841
|
+
case "unknown":
|
|
842
|
+
throw new errors.PaidError({
|
|
843
|
+
message: _response.error.errorMessage,
|
|
844
|
+
rawResponse: _response.rawResponse,
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
}
|
|
757
849
|
_getAuthorizationHeader() {
|
|
758
850
|
return __awaiter(this, void 0, void 0, function* () {
|
|
759
851
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as Paid from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* customerExternalId: "customerExternalId",
|
|
6
|
+
* userExternalId: "userExternalId"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface UpsertCustomerUserRequest {
|
|
10
|
+
customerExternalId: string;
|
|
11
|
+
userExternalId: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
email?: string | null;
|
|
14
|
+
metadata?: Record<string, unknown> | null;
|
|
15
|
+
status?: Paid.CustomerUserStatus;
|
|
16
|
+
}
|
|
@@ -8,3 +8,4 @@ export type { GetCustomerCreditBalancesRequest } from "./GetCustomerCreditBalanc
|
|
|
8
8
|
export type { ListCustomersRequest } from "./ListCustomersRequest.js";
|
|
9
9
|
export type { UpdateCustomerByExternalIdRequest } from "./UpdateCustomerByExternalIdRequest.js";
|
|
10
10
|
export type { UpdateCustomerByIdRequest } from "./UpdateCustomerByIdRequest.js";
|
|
11
|
+
export type { UpsertCustomerUserRequest } from "./UpsertCustomerUserRequest.js";
|
|
@@ -12,7 +12,13 @@ export * from "./invoices/client/requests/index.js";
|
|
|
12
12
|
export * as invoices from "./invoices/index.js";
|
|
13
13
|
export * from "./orders/client/requests/index.js";
|
|
14
14
|
export * as orders from "./orders/index.js";
|
|
15
|
+
export * from "./orders/types/index.js";
|
|
15
16
|
export * from "./products/client/requests/index.js";
|
|
16
17
|
export * as products from "./products/index.js";
|
|
17
18
|
export * from "./signals/client/requests/index.js";
|
|
18
19
|
export * as signals from "./signals/index.js";
|
|
20
|
+
export * from "./valueReceipts/client/requests/index.js";
|
|
21
|
+
export * as valueReceipts from "./valueReceipts/index.js";
|
|
22
|
+
export * from "./webhooks/client/requests/index.js";
|
|
23
|
+
export * as webhooks from "./webhooks/index.js";
|
|
24
|
+
export * from "./webhooks/types/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.signals = exports.products = exports.orders = exports.invoices = exports.customers = exports.customerPortals = exports.credits = exports.contacts = exports.checkouts = void 0;
|
|
39
|
+
exports.webhooks = exports.valueReceipts = exports.signals = exports.products = exports.orders = exports.invoices = exports.customers = exports.customerPortals = exports.credits = exports.contacts = exports.checkouts = void 0;
|
|
40
40
|
__exportStar(require("./checkouts/client/requests/index.js"), exports);
|
|
41
41
|
exports.checkouts = __importStar(require("./checkouts/index.js"));
|
|
42
42
|
__exportStar(require("./checkouts/types/index.js"), exports);
|
|
@@ -51,7 +51,13 @@ __exportStar(require("./invoices/client/requests/index.js"), exports);
|
|
|
51
51
|
exports.invoices = __importStar(require("./invoices/index.js"));
|
|
52
52
|
__exportStar(require("./orders/client/requests/index.js"), exports);
|
|
53
53
|
exports.orders = __importStar(require("./orders/index.js"));
|
|
54
|
+
__exportStar(require("./orders/types/index.js"), exports);
|
|
54
55
|
__exportStar(require("./products/client/requests/index.js"), exports);
|
|
55
56
|
exports.products = __importStar(require("./products/index.js"));
|
|
56
57
|
__exportStar(require("./signals/client/requests/index.js"), exports);
|
|
57
58
|
exports.signals = __importStar(require("./signals/index.js"));
|
|
59
|
+
__exportStar(require("./valueReceipts/client/requests/index.js"), exports);
|
|
60
|
+
exports.valueReceipts = __importStar(require("./valueReceipts/index.js"));
|
|
61
|
+
__exportStar(require("./webhooks/client/requests/index.js"), exports);
|
|
62
|
+
exports.webhooks = __importStar(require("./webhooks/index.js"));
|
|
63
|
+
__exportStar(require("./webhooks/types/index.js"), exports);
|
|
@@ -111,5 +111,65 @@ export declare class Orders {
|
|
|
111
111
|
*/
|
|
112
112
|
getOrderLines(request: Paid.GetOrderLinesRequest, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.OrderLinesResponse>;
|
|
113
113
|
private __getOrderLines;
|
|
114
|
+
/**
|
|
115
|
+
* List seats for an order
|
|
116
|
+
*
|
|
117
|
+
* @param {Paid.ListOrderSeatsRequest} request
|
|
118
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
|
+
*
|
|
120
|
+
* @throws {@link Paid.BadRequestError}
|
|
121
|
+
* @throws {@link Paid.ForbiddenError}
|
|
122
|
+
* @throws {@link Paid.NotFoundError}
|
|
123
|
+
* @throws {@link Paid.InternalServerError}
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* await client.orders.listOrderSeats({
|
|
127
|
+
* id: "id"
|
|
128
|
+
* })
|
|
129
|
+
*/
|
|
130
|
+
listOrderSeats(request: Paid.ListOrderSeatsRequest, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.OrderSeatListResponse>;
|
|
131
|
+
private __listOrderSeats;
|
|
132
|
+
/**
|
|
133
|
+
* Assign or unassign a single seat on an order
|
|
134
|
+
*
|
|
135
|
+
* @param {Paid.UpdateSeatAssignmentRequest} request
|
|
136
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
137
|
+
*
|
|
138
|
+
* @throws {@link Paid.BadRequestError}
|
|
139
|
+
* @throws {@link Paid.ForbiddenError}
|
|
140
|
+
* @throws {@link Paid.NotFoundError}
|
|
141
|
+
* @throws {@link Paid.ConflictError}
|
|
142
|
+
* @throws {@link Paid.InternalServerError}
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* await client.orders.updateOrderSeatAssignment({
|
|
146
|
+
* id: "id",
|
|
147
|
+
* seatId: "seatId"
|
|
148
|
+
* })
|
|
149
|
+
*/
|
|
150
|
+
updateOrderSeatAssignment(request: Paid.UpdateSeatAssignmentRequest, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.OrderSeat>;
|
|
151
|
+
private __updateOrderSeatAssignment;
|
|
152
|
+
/**
|
|
153
|
+
* Assign or unassign seats in batch for an order
|
|
154
|
+
*
|
|
155
|
+
* @param {Paid.BatchSeatAssignmentsRequest} request
|
|
156
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
157
|
+
*
|
|
158
|
+
* @throws {@link Paid.BadRequestError}
|
|
159
|
+
* @throws {@link Paid.ForbiddenError}
|
|
160
|
+
* @throws {@link Paid.NotFoundError}
|
|
161
|
+
* @throws {@link Paid.ConflictError}
|
|
162
|
+
* @throws {@link Paid.InternalServerError}
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* await client.orders.batchOrderSeatAssignments({
|
|
166
|
+
* id: "id",
|
|
167
|
+
* assignments: [{
|
|
168
|
+
* seatId: "seatId"
|
|
169
|
+
* }]
|
|
170
|
+
* })
|
|
171
|
+
*/
|
|
172
|
+
batchOrderSeatAssignments(request: Paid.BatchSeatAssignmentsRequest, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.BatchSeatAssignmentsResponse>;
|
|
173
|
+
private __batchOrderSeatAssignments;
|
|
114
174
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
115
175
|
}
|