@paid-ai/paid-node 1.2.1 → 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 +3 -0
- package/dist/cjs/Client.js +7 -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/customers/client/Client.d.ts +19 -0
- package/dist/cjs/api/resources/customers/client/Client.js +86 -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 +4 -0
- package/dist/cjs/api/resources/index.js +5 -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/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/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/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 +12 -0
- package/dist/cjs/api/types/index.js +12 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -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/customers/client/Client.d.mts +19 -0
- package/dist/esm/api/resources/customers/client/Client.mjs +86 -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 +4 -0
- package/dist/esm/api/resources/index.mjs +4 -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/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/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/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 +12 -0
- package/dist/esm/api/types/index.mjs +12 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +452 -1
|
@@ -0,0 +1,18 @@
|
|
|
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("./TestWebhookRequestWebhookName.js"), exports);
|
|
18
|
+
__exportStar(require("./UpdateWebhookRequestWebhookName.js"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
2
|
+
export interface CheckoutDetails {
|
|
3
|
+
id: string;
|
|
4
|
+
url: string;
|
|
5
|
+
status: Paid.CheckoutStatus;
|
|
6
|
+
products: Paid.CheckoutProduct[];
|
|
7
|
+
customerId: string | null;
|
|
8
|
+
externalCustomerId: string | null;
|
|
9
|
+
successUrl: string;
|
|
10
|
+
cancelUrl: string | null;
|
|
11
|
+
expiresAt: string | null;
|
|
12
|
+
metadata: Record<string, unknown> | null;
|
|
13
|
+
collectAddress: boolean;
|
|
14
|
+
collectPhone: boolean;
|
|
15
|
+
singleUse: boolean;
|
|
16
|
+
allowedCurrencies: string[];
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
/** The resulting order ID once checkout has completed. Null until an order is created. */
|
|
20
|
+
orderId: string | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
2
|
+
export interface CustomerUser {
|
|
3
|
+
id: string;
|
|
4
|
+
externalId: string;
|
|
5
|
+
customerExternalId: string;
|
|
6
|
+
name: string | null;
|
|
7
|
+
email: string | null;
|
|
8
|
+
metadata: Record<string, unknown> | null;
|
|
9
|
+
status: Paid.CustomerUserStatus;
|
|
10
|
+
created: boolean;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
@@ -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.CustomerUserStatus = void 0;
|
|
5
|
+
exports.CustomerUserStatus = {
|
|
6
|
+
Active: "active",
|
|
7
|
+
Deactivated: "deactivated",
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
2
|
+
export interface OrderSeat {
|
|
3
|
+
id: string;
|
|
4
|
+
orderId: string;
|
|
5
|
+
productExternalId: string | null;
|
|
6
|
+
status: Paid.SeatAssignmentStatus;
|
|
7
|
+
assignee: Paid.SeatAssignee | null;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
}
|
|
@@ -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.SeatAssignmentStatus = void 0;
|
|
5
|
+
exports.SeatAssignmentStatus = {
|
|
6
|
+
Assigned: "assigned",
|
|
7
|
+
Unassigned: "unassigned",
|
|
8
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
2
|
+
export interface Webhook {
|
|
3
|
+
id: string;
|
|
4
|
+
name: Webhook.Name;
|
|
5
|
+
description: string;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
url: string | null;
|
|
8
|
+
lastSentAt: string | null;
|
|
9
|
+
lastStatus: Paid.WebhookDeliveryStatus | null;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace Webhook {
|
|
12
|
+
const Name: {
|
|
13
|
+
readonly BillingInvoiceCreated: "billing-invoice-created";
|
|
14
|
+
readonly BillingInvoicePaid: "billing-invoice-paid";
|
|
15
|
+
readonly BillingCheckoutCreated: "billing-checkout-created";
|
|
16
|
+
readonly BillingCheckoutCompleted: "billing-checkout-completed";
|
|
17
|
+
readonly BillingCheckoutExpired: "billing-checkout-expired";
|
|
18
|
+
readonly BillingPaymentSucceeded: "billing-payment-succeeded";
|
|
19
|
+
readonly BillingPaymentFailed: "billing-payment-failed";
|
|
20
|
+
readonly BillingCreditsDepleted: "billing-credits-depleted";
|
|
21
|
+
readonly BillingOverageIncurred: "billing-overage-incurred";
|
|
22
|
+
};
|
|
23
|
+
type Name = (typeof Name)[keyof typeof Name];
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Webhook = void 0;
|
|
5
|
+
var Webhook;
|
|
6
|
+
(function (Webhook) {
|
|
7
|
+
Webhook.Name = {
|
|
8
|
+
BillingInvoiceCreated: "billing-invoice-created",
|
|
9
|
+
BillingInvoicePaid: "billing-invoice-paid",
|
|
10
|
+
BillingCheckoutCreated: "billing-checkout-created",
|
|
11
|
+
BillingCheckoutCompleted: "billing-checkout-completed",
|
|
12
|
+
BillingCheckoutExpired: "billing-checkout-expired",
|
|
13
|
+
BillingPaymentSucceeded: "billing-payment-succeeded",
|
|
14
|
+
BillingPaymentFailed: "billing-payment-failed",
|
|
15
|
+
BillingCreditsDepleted: "billing-credits-depleted",
|
|
16
|
+
BillingOverageIncurred: "billing-overage-incurred",
|
|
17
|
+
};
|
|
18
|
+
})(Webhook || (exports.Webhook = Webhook = {}));
|
|
@@ -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.WebhookDeliveryStatus = void 0;
|
|
5
|
+
exports.WebhookDeliveryStatus = {
|
|
6
|
+
Success: "success",
|
|
7
|
+
Failed: "failed",
|
|
8
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./Attribution.js";
|
|
2
|
+
export * from "./BatchSeatAssignmentsResponse.js";
|
|
2
3
|
export * from "./BulkSignalsResponse.js";
|
|
3
4
|
export * from "./Checkout.js";
|
|
5
|
+
export * from "./CheckoutDetails.js";
|
|
4
6
|
export * from "./CheckoutListResponse.js";
|
|
5
7
|
export * from "./CheckoutProduct.js";
|
|
6
8
|
export * from "./CheckoutProductInput.js";
|
|
@@ -23,6 +25,8 @@ export * from "./CustomerCreationState.js";
|
|
|
23
25
|
export * from "./CustomerListResponse.js";
|
|
24
26
|
export * from "./CustomerPortal.js";
|
|
25
27
|
export * from "./CustomerPortalStatus.js";
|
|
28
|
+
export * from "./CustomerUser.js";
|
|
29
|
+
export * from "./CustomerUserStatus.js";
|
|
26
30
|
export * from "./EmptyResponse.js";
|
|
27
31
|
export * from "./ErrorResponse.js";
|
|
28
32
|
export * from "./Invoice.js";
|
|
@@ -34,11 +38,15 @@ export * from "./OrderCreationState.js";
|
|
|
34
38
|
export * from "./OrderLine.js";
|
|
35
39
|
export * from "./OrderLinesResponse.js";
|
|
36
40
|
export * from "./OrderListResponse.js";
|
|
41
|
+
export * from "./OrderSeat.js";
|
|
42
|
+
export * from "./OrderSeatListResponse.js";
|
|
37
43
|
export * from "./Pagination.js";
|
|
38
44
|
export * from "./Product.js";
|
|
39
45
|
export * from "./ProductByExternalId.js";
|
|
40
46
|
export * from "./ProductById.js";
|
|
41
47
|
export * from "./ProductListResponse.js";
|
|
48
|
+
export * from "./SeatAssignee.js";
|
|
49
|
+
export * from "./SeatAssignmentStatus.js";
|
|
42
50
|
export * from "./Signal.js";
|
|
43
51
|
export * from "./UpdateContactRequest.js";
|
|
44
52
|
export * from "./UpdateCustomerRequest.js";
|
|
@@ -46,3 +54,7 @@ export * from "./UpdateProductRequest.js";
|
|
|
46
54
|
export * from "./ValueReceiptDetail.js";
|
|
47
55
|
export * from "./ValueReceiptListResponse.js";
|
|
48
56
|
export * from "./ValueReceiptSummary.js";
|
|
57
|
+
export * from "./Webhook.js";
|
|
58
|
+
export * from "./WebhookDeliveryStatus.js";
|
|
59
|
+
export * from "./WebhookListResponse.js";
|
|
60
|
+
export * from "./WebhookTestResponse.js";
|
|
@@ -15,8 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Attribution.js"), exports);
|
|
18
|
+
__exportStar(require("./BatchSeatAssignmentsResponse.js"), exports);
|
|
18
19
|
__exportStar(require("./BulkSignalsResponse.js"), exports);
|
|
19
20
|
__exportStar(require("./Checkout.js"), exports);
|
|
21
|
+
__exportStar(require("./CheckoutDetails.js"), exports);
|
|
20
22
|
__exportStar(require("./CheckoutListResponse.js"), exports);
|
|
21
23
|
__exportStar(require("./CheckoutProduct.js"), exports);
|
|
22
24
|
__exportStar(require("./CheckoutProductInput.js"), exports);
|
|
@@ -39,6 +41,8 @@ __exportStar(require("./CustomerCreationState.js"), exports);
|
|
|
39
41
|
__exportStar(require("./CustomerListResponse.js"), exports);
|
|
40
42
|
__exportStar(require("./CustomerPortal.js"), exports);
|
|
41
43
|
__exportStar(require("./CustomerPortalStatus.js"), exports);
|
|
44
|
+
__exportStar(require("./CustomerUser.js"), exports);
|
|
45
|
+
__exportStar(require("./CustomerUserStatus.js"), exports);
|
|
42
46
|
__exportStar(require("./EmptyResponse.js"), exports);
|
|
43
47
|
__exportStar(require("./ErrorResponse.js"), exports);
|
|
44
48
|
__exportStar(require("./Invoice.js"), exports);
|
|
@@ -50,11 +54,15 @@ __exportStar(require("./OrderCreationState.js"), exports);
|
|
|
50
54
|
__exportStar(require("./OrderLine.js"), exports);
|
|
51
55
|
__exportStar(require("./OrderLinesResponse.js"), exports);
|
|
52
56
|
__exportStar(require("./OrderListResponse.js"), exports);
|
|
57
|
+
__exportStar(require("./OrderSeat.js"), exports);
|
|
58
|
+
__exportStar(require("./OrderSeatListResponse.js"), exports);
|
|
53
59
|
__exportStar(require("./Pagination.js"), exports);
|
|
54
60
|
__exportStar(require("./Product.js"), exports);
|
|
55
61
|
__exportStar(require("./ProductByExternalId.js"), exports);
|
|
56
62
|
__exportStar(require("./ProductById.js"), exports);
|
|
57
63
|
__exportStar(require("./ProductListResponse.js"), exports);
|
|
64
|
+
__exportStar(require("./SeatAssignee.js"), exports);
|
|
65
|
+
__exportStar(require("./SeatAssignmentStatus.js"), exports);
|
|
58
66
|
__exportStar(require("./Signal.js"), exports);
|
|
59
67
|
__exportStar(require("./UpdateContactRequest.js"), exports);
|
|
60
68
|
__exportStar(require("./UpdateCustomerRequest.js"), exports);
|
|
@@ -62,3 +70,7 @@ __exportStar(require("./UpdateProductRequest.js"), exports);
|
|
|
62
70
|
__exportStar(require("./ValueReceiptDetail.js"), exports);
|
|
63
71
|
__exportStar(require("./ValueReceiptListResponse.js"), exports);
|
|
64
72
|
__exportStar(require("./ValueReceiptSummary.js"), exports);
|
|
73
|
+
__exportStar(require("./Webhook.js"), exports);
|
|
74
|
+
__exportStar(require("./WebhookDeliveryStatus.js"), exports);
|
|
75
|
+
__exportStar(require("./WebhookListResponse.js"), exports);
|
|
76
|
+
__exportStar(require("./WebhookTestResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.3.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { Orders } from "./api/resources/orders/client/Client.mjs";
|
|
|
8
8
|
import { Products } from "./api/resources/products/client/Client.mjs";
|
|
9
9
|
import { Signals } from "./api/resources/signals/client/Client.mjs";
|
|
10
10
|
import { ValueReceipts } from "./api/resources/valueReceipts/client/Client.mjs";
|
|
11
|
+
import { Webhooks } from "./api/resources/webhooks/client/Client.mjs";
|
|
11
12
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
12
13
|
export declare namespace PaidClient {
|
|
13
14
|
interface Options extends BaseClientOptions {
|
|
@@ -27,6 +28,7 @@ export declare class PaidClient {
|
|
|
27
28
|
protected _checkouts: Checkouts | undefined;
|
|
28
29
|
protected _customerPortals: CustomerPortals | undefined;
|
|
29
30
|
protected _valueReceipts: ValueReceipts | undefined;
|
|
31
|
+
protected _webhooks: Webhooks | undefined;
|
|
30
32
|
constructor(_options: PaidClient.Options);
|
|
31
33
|
get products(): Products;
|
|
32
34
|
get customers(): Customers;
|
|
@@ -38,4 +40,5 @@ export declare class PaidClient {
|
|
|
38
40
|
get checkouts(): Checkouts;
|
|
39
41
|
get customerPortals(): CustomerPortals;
|
|
40
42
|
get valueReceipts(): ValueReceipts;
|
|
43
|
+
get webhooks(): Webhooks;
|
|
41
44
|
}
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { Orders } from "./api/resources/orders/client/Client.mjs";
|
|
|
9
9
|
import { Products } from "./api/resources/products/client/Client.mjs";
|
|
10
10
|
import { Signals } from "./api/resources/signals/client/Client.mjs";
|
|
11
11
|
import { ValueReceipts } from "./api/resources/valueReceipts/client/Client.mjs";
|
|
12
|
+
import { Webhooks } from "./api/resources/webhooks/client/Client.mjs";
|
|
12
13
|
import { mergeHeaders } from "./core/headers.mjs";
|
|
13
14
|
import * as core from "./core/index.mjs";
|
|
14
15
|
export class PaidClient {
|
|
@@ -16,8 +17,8 @@ export class PaidClient {
|
|
|
16
17
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
17
18
|
"X-Fern-Language": "JavaScript",
|
|
18
19
|
"X-Fern-SDK-Name": "@paid-ai/paid-node",
|
|
19
|
-
"X-Fern-SDK-Version": "1.
|
|
20
|
-
"User-Agent": "@paid-ai/paid-node/1.
|
|
20
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
21
|
+
"User-Agent": "@paid-ai/paid-node/1.3.0",
|
|
21
22
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
22
23
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
23
24
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -62,4 +63,8 @@ export class PaidClient {
|
|
|
62
63
|
var _a;
|
|
63
64
|
return ((_a = this._valueReceipts) !== null && _a !== void 0 ? _a : (this._valueReceipts = new ValueReceipts(this._options)));
|
|
64
65
|
}
|
|
66
|
+
get webhooks() {
|
|
67
|
+
var _a;
|
|
68
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
|
|
69
|
+
}
|
|
65
70
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as Paid from "../index.mjs";
|
|
4
|
+
export declare class ConflictError extends errors.PaidError {
|
|
5
|
+
constructor(body: Paid.ErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class ConflictError extends errors.PaidError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "ConflictError",
|
|
7
|
+
statusCode: 409,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -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
|
|
@@ -184,5 +184,24 @@ export declare class Customers {
|
|
|
184
184
|
*/
|
|
185
185
|
getCustomerCreditBalancesByExternalId(request: Paid.GetCustomerCreditBalancesByExternalIdRequest, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<Paid.CreditBalanceListResponse>;
|
|
186
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;
|
|
187
206
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
188
207
|
}
|
|
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
12
23
|
import * as core from "../../../../core/index.mjs";
|
|
13
24
|
import * as environments from "../../../../environments.mjs";
|
|
@@ -724,6 +735,81 @@ export class Customers {
|
|
|
724
735
|
}
|
|
725
736
|
});
|
|
726
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* Create or update a customer user using customer and user external IDs
|
|
740
|
+
*
|
|
741
|
+
* @param {Paid.UpsertCustomerUserRequest} request
|
|
742
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
743
|
+
*
|
|
744
|
+
* @throws {@link Paid.BadRequestError}
|
|
745
|
+
* @throws {@link Paid.ForbiddenError}
|
|
746
|
+
* @throws {@link Paid.NotFoundError}
|
|
747
|
+
* @throws {@link Paid.InternalServerError}
|
|
748
|
+
*
|
|
749
|
+
* @example
|
|
750
|
+
* await client.customers.upsertCustomerUserByExternalId({
|
|
751
|
+
* customerExternalId: "customerExternalId",
|
|
752
|
+
* userExternalId: "userExternalId"
|
|
753
|
+
* })
|
|
754
|
+
*/
|
|
755
|
+
upsertCustomerUserByExternalId(request, requestOptions) {
|
|
756
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertCustomerUserByExternalId(request, requestOptions));
|
|
757
|
+
}
|
|
758
|
+
__upsertCustomerUserByExternalId(request, requestOptions) {
|
|
759
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
760
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
761
|
+
const { customerExternalId, userExternalId } = request, _body = __rest(request, ["customerExternalId", "userExternalId"]);
|
|
762
|
+
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);
|
|
763
|
+
const _response = yield core.fetcher({
|
|
764
|
+
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)}`),
|
|
765
|
+
method: "PUT",
|
|
766
|
+
headers: _headers,
|
|
767
|
+
contentType: "application/json",
|
|
768
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
769
|
+
requestType: "json",
|
|
770
|
+
body: _body,
|
|
771
|
+
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,
|
|
772
|
+
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,
|
|
773
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
774
|
+
});
|
|
775
|
+
if (_response.ok) {
|
|
776
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
777
|
+
}
|
|
778
|
+
if (_response.error.reason === "status-code") {
|
|
779
|
+
switch (_response.error.statusCode) {
|
|
780
|
+
case 400:
|
|
781
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
782
|
+
case 403:
|
|
783
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
784
|
+
case 404:
|
|
785
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
786
|
+
case 500:
|
|
787
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
788
|
+
default:
|
|
789
|
+
throw new errors.PaidError({
|
|
790
|
+
statusCode: _response.error.statusCode,
|
|
791
|
+
body: _response.error.body,
|
|
792
|
+
rawResponse: _response.rawResponse,
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
switch (_response.error.reason) {
|
|
797
|
+
case "non-json":
|
|
798
|
+
throw new errors.PaidError({
|
|
799
|
+
statusCode: _response.error.statusCode,
|
|
800
|
+
body: _response.error.rawBody,
|
|
801
|
+
rawResponse: _response.rawResponse,
|
|
802
|
+
});
|
|
803
|
+
case "timeout":
|
|
804
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{customerExternalId}/users/{userExternalId}.");
|
|
805
|
+
case "unknown":
|
|
806
|
+
throw new errors.PaidError({
|
|
807
|
+
message: _response.error.errorMessage,
|
|
808
|
+
rawResponse: _response.rawResponse,
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
727
813
|
_getAuthorizationHeader() {
|
|
728
814
|
return __awaiter(this, void 0, void 0, function* () {
|
|
729
815
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as Paid from "../../../../index.mjs";
|
|
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.mjs";
|
|
9
9
|
export type { UpdateCustomerByExternalIdRequest } from "./UpdateCustomerByExternalIdRequest.mjs";
|
|
10
10
|
export type { UpdateCustomerByIdRequest } from "./UpdateCustomerByIdRequest.mjs";
|
|
11
|
+
export type { UpsertCustomerUserRequest } from "./UpsertCustomerUserRequest.mjs";
|
|
@@ -12,9 +12,13 @@ export * from "./invoices/client/requests/index.mjs";
|
|
|
12
12
|
export * as invoices from "./invoices/index.mjs";
|
|
13
13
|
export * from "./orders/client/requests/index.mjs";
|
|
14
14
|
export * as orders from "./orders/index.mjs";
|
|
15
|
+
export * from "./orders/types/index.mjs";
|
|
15
16
|
export * from "./products/client/requests/index.mjs";
|
|
16
17
|
export * as products from "./products/index.mjs";
|
|
17
18
|
export * from "./signals/client/requests/index.mjs";
|
|
18
19
|
export * as signals from "./signals/index.mjs";
|
|
19
20
|
export * from "./valueReceipts/client/requests/index.mjs";
|
|
20
21
|
export * as valueReceipts from "./valueReceipts/index.mjs";
|
|
22
|
+
export * from "./webhooks/client/requests/index.mjs";
|
|
23
|
+
export * as webhooks from "./webhooks/index.mjs";
|
|
24
|
+
export * from "./webhooks/types/index.mjs";
|
|
@@ -12,9 +12,13 @@ export * from "./invoices/client/requests/index.mjs";
|
|
|
12
12
|
export * as invoices from "./invoices/index.mjs";
|
|
13
13
|
export * from "./orders/client/requests/index.mjs";
|
|
14
14
|
export * as orders from "./orders/index.mjs";
|
|
15
|
+
export * from "./orders/types/index.mjs";
|
|
15
16
|
export * from "./products/client/requests/index.mjs";
|
|
16
17
|
export * as products from "./products/index.mjs";
|
|
17
18
|
export * from "./signals/client/requests/index.mjs";
|
|
18
19
|
export * as signals from "./signals/index.mjs";
|
|
19
20
|
export * from "./valueReceipts/client/requests/index.mjs";
|
|
20
21
|
export * as valueReceipts from "./valueReceipts/index.mjs";
|
|
22
|
+
export * from "./webhooks/client/requests/index.mjs";
|
|
23
|
+
export * as webhooks from "./webhooks/index.mjs";
|
|
24
|
+
export * from "./webhooks/types/index.mjs";
|