@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
|
@@ -492,6 +492,248 @@ class Orders {
|
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
|
+
/**
|
|
496
|
+
* List seats for an order
|
|
497
|
+
*
|
|
498
|
+
* @param {Paid.ListOrderSeatsRequest} request
|
|
499
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
500
|
+
*
|
|
501
|
+
* @throws {@link Paid.BadRequestError}
|
|
502
|
+
* @throws {@link Paid.ForbiddenError}
|
|
503
|
+
* @throws {@link Paid.NotFoundError}
|
|
504
|
+
* @throws {@link Paid.InternalServerError}
|
|
505
|
+
*
|
|
506
|
+
* @example
|
|
507
|
+
* await client.orders.listOrderSeats({
|
|
508
|
+
* id: "id"
|
|
509
|
+
* })
|
|
510
|
+
*/
|
|
511
|
+
listOrderSeats(request, requestOptions) {
|
|
512
|
+
return core.HttpResponsePromise.fromPromise(this.__listOrderSeats(request, requestOptions));
|
|
513
|
+
}
|
|
514
|
+
__listOrderSeats(request, requestOptions) {
|
|
515
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
516
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
517
|
+
const { id, limit, offset, productExternalId, status } = request;
|
|
518
|
+
const _queryParams = {};
|
|
519
|
+
if (limit != null) {
|
|
520
|
+
_queryParams.limit = limit.toString();
|
|
521
|
+
}
|
|
522
|
+
if (offset != null) {
|
|
523
|
+
_queryParams.offset = offset.toString();
|
|
524
|
+
}
|
|
525
|
+
if (productExternalId != null) {
|
|
526
|
+
_queryParams.productExternalId = productExternalId;
|
|
527
|
+
}
|
|
528
|
+
if (status != null) {
|
|
529
|
+
_queryParams.status = status;
|
|
530
|
+
}
|
|
531
|
+
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);
|
|
532
|
+
const _response = yield core.fetcher({
|
|
533
|
+
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, `orders/${core.url.encodePathParam(id)}/seats`),
|
|
534
|
+
method: "GET",
|
|
535
|
+
headers: _headers,
|
|
536
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
537
|
+
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,
|
|
538
|
+
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,
|
|
539
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
540
|
+
});
|
|
541
|
+
if (_response.ok) {
|
|
542
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
543
|
+
}
|
|
544
|
+
if (_response.error.reason === "status-code") {
|
|
545
|
+
switch (_response.error.statusCode) {
|
|
546
|
+
case 400:
|
|
547
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
548
|
+
case 403:
|
|
549
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
550
|
+
case 404:
|
|
551
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
552
|
+
case 500:
|
|
553
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
554
|
+
default:
|
|
555
|
+
throw new errors.PaidError({
|
|
556
|
+
statusCode: _response.error.statusCode,
|
|
557
|
+
body: _response.error.body,
|
|
558
|
+
rawResponse: _response.rawResponse,
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
switch (_response.error.reason) {
|
|
563
|
+
case "non-json":
|
|
564
|
+
throw new errors.PaidError({
|
|
565
|
+
statusCode: _response.error.statusCode,
|
|
566
|
+
body: _response.error.rawBody,
|
|
567
|
+
rawResponse: _response.rawResponse,
|
|
568
|
+
});
|
|
569
|
+
case "timeout":
|
|
570
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /orders/{id}/seats.");
|
|
571
|
+
case "unknown":
|
|
572
|
+
throw new errors.PaidError({
|
|
573
|
+
message: _response.error.errorMessage,
|
|
574
|
+
rawResponse: _response.rawResponse,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Assign or unassign a single seat on an order
|
|
581
|
+
*
|
|
582
|
+
* @param {Paid.UpdateSeatAssignmentRequest} request
|
|
583
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
584
|
+
*
|
|
585
|
+
* @throws {@link Paid.BadRequestError}
|
|
586
|
+
* @throws {@link Paid.ForbiddenError}
|
|
587
|
+
* @throws {@link Paid.NotFoundError}
|
|
588
|
+
* @throws {@link Paid.ConflictError}
|
|
589
|
+
* @throws {@link Paid.InternalServerError}
|
|
590
|
+
*
|
|
591
|
+
* @example
|
|
592
|
+
* await client.orders.updateOrderSeatAssignment({
|
|
593
|
+
* id: "id",
|
|
594
|
+
* seatId: "seatId"
|
|
595
|
+
* })
|
|
596
|
+
*/
|
|
597
|
+
updateOrderSeatAssignment(request, requestOptions) {
|
|
598
|
+
return core.HttpResponsePromise.fromPromise(this.__updateOrderSeatAssignment(request, requestOptions));
|
|
599
|
+
}
|
|
600
|
+
__updateOrderSeatAssignment(request, requestOptions) {
|
|
601
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
602
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
603
|
+
const { id, seatId } = request, _body = __rest(request, ["id", "seatId"]);
|
|
604
|
+
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);
|
|
605
|
+
const _response = yield core.fetcher({
|
|
606
|
+
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, `orders/${core.url.encodePathParam(id)}/seats/${core.url.encodePathParam(seatId)}`),
|
|
607
|
+
method: "PUT",
|
|
608
|
+
headers: _headers,
|
|
609
|
+
contentType: "application/json",
|
|
610
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
611
|
+
requestType: "json",
|
|
612
|
+
body: _body,
|
|
613
|
+
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,
|
|
614
|
+
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,
|
|
615
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
616
|
+
});
|
|
617
|
+
if (_response.ok) {
|
|
618
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
619
|
+
}
|
|
620
|
+
if (_response.error.reason === "status-code") {
|
|
621
|
+
switch (_response.error.statusCode) {
|
|
622
|
+
case 400:
|
|
623
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
624
|
+
case 403:
|
|
625
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
626
|
+
case 404:
|
|
627
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
628
|
+
case 409:
|
|
629
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
630
|
+
case 500:
|
|
631
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
632
|
+
default:
|
|
633
|
+
throw new errors.PaidError({
|
|
634
|
+
statusCode: _response.error.statusCode,
|
|
635
|
+
body: _response.error.body,
|
|
636
|
+
rawResponse: _response.rawResponse,
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
switch (_response.error.reason) {
|
|
641
|
+
case "non-json":
|
|
642
|
+
throw new errors.PaidError({
|
|
643
|
+
statusCode: _response.error.statusCode,
|
|
644
|
+
body: _response.error.rawBody,
|
|
645
|
+
rawResponse: _response.rawResponse,
|
|
646
|
+
});
|
|
647
|
+
case "timeout":
|
|
648
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /orders/{id}/seats/{seatId}.");
|
|
649
|
+
case "unknown":
|
|
650
|
+
throw new errors.PaidError({
|
|
651
|
+
message: _response.error.errorMessage,
|
|
652
|
+
rawResponse: _response.rawResponse,
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Assign or unassign seats in batch for an order
|
|
659
|
+
*
|
|
660
|
+
* @param {Paid.BatchSeatAssignmentsRequest} request
|
|
661
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
662
|
+
*
|
|
663
|
+
* @throws {@link Paid.BadRequestError}
|
|
664
|
+
* @throws {@link Paid.ForbiddenError}
|
|
665
|
+
* @throws {@link Paid.NotFoundError}
|
|
666
|
+
* @throws {@link Paid.ConflictError}
|
|
667
|
+
* @throws {@link Paid.InternalServerError}
|
|
668
|
+
*
|
|
669
|
+
* @example
|
|
670
|
+
* await client.orders.batchOrderSeatAssignments({
|
|
671
|
+
* id: "id",
|
|
672
|
+
* assignments: [{
|
|
673
|
+
* seatId: "seatId"
|
|
674
|
+
* }]
|
|
675
|
+
* })
|
|
676
|
+
*/
|
|
677
|
+
batchOrderSeatAssignments(request, requestOptions) {
|
|
678
|
+
return core.HttpResponsePromise.fromPromise(this.__batchOrderSeatAssignments(request, requestOptions));
|
|
679
|
+
}
|
|
680
|
+
__batchOrderSeatAssignments(request, requestOptions) {
|
|
681
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
682
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
683
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
684
|
+
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);
|
|
685
|
+
const _response = yield core.fetcher({
|
|
686
|
+
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, `orders/${core.url.encodePathParam(id)}/seat-assignments`),
|
|
687
|
+
method: "POST",
|
|
688
|
+
headers: _headers,
|
|
689
|
+
contentType: "application/json",
|
|
690
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
691
|
+
requestType: "json",
|
|
692
|
+
body: _body,
|
|
693
|
+
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,
|
|
694
|
+
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,
|
|
695
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
696
|
+
});
|
|
697
|
+
if (_response.ok) {
|
|
698
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
699
|
+
}
|
|
700
|
+
if (_response.error.reason === "status-code") {
|
|
701
|
+
switch (_response.error.statusCode) {
|
|
702
|
+
case 400:
|
|
703
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
704
|
+
case 403:
|
|
705
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
706
|
+
case 404:
|
|
707
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
708
|
+
case 409:
|
|
709
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
710
|
+
case 500:
|
|
711
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
712
|
+
default:
|
|
713
|
+
throw new errors.PaidError({
|
|
714
|
+
statusCode: _response.error.statusCode,
|
|
715
|
+
body: _response.error.body,
|
|
716
|
+
rawResponse: _response.rawResponse,
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
switch (_response.error.reason) {
|
|
721
|
+
case "non-json":
|
|
722
|
+
throw new errors.PaidError({
|
|
723
|
+
statusCode: _response.error.statusCode,
|
|
724
|
+
body: _response.error.rawBody,
|
|
725
|
+
rawResponse: _response.rawResponse,
|
|
726
|
+
});
|
|
727
|
+
case "timeout":
|
|
728
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /orders/{id}/seat-assignments.");
|
|
729
|
+
case "unknown":
|
|
730
|
+
throw new errors.PaidError({
|
|
731
|
+
message: _response.error.errorMessage,
|
|
732
|
+
rawResponse: _response.rawResponse,
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
}
|
|
495
737
|
_getAuthorizationHeader() {
|
|
496
738
|
return __awaiter(this, void 0, void 0, function* () {
|
|
497
739
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "id",
|
|
5
|
+
* assignments: [{
|
|
6
|
+
* seatId: "seatId"
|
|
7
|
+
* }]
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface BatchSeatAssignmentsRequest {
|
|
11
|
+
id: string;
|
|
12
|
+
assignments: BatchSeatAssignmentsRequest.Assignments.Item[];
|
|
13
|
+
}
|
|
14
|
+
export declare namespace BatchSeatAssignmentsRequest {
|
|
15
|
+
type Assignments = Assignments.Item[];
|
|
16
|
+
namespace Assignments {
|
|
17
|
+
interface Item {
|
|
18
|
+
seatId: string;
|
|
19
|
+
userExternalId: string | null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as Paid from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* id: "id"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface ListOrderSeatsRequest {
|
|
9
|
+
id: string;
|
|
10
|
+
limit?: number;
|
|
11
|
+
offset?: number;
|
|
12
|
+
productExternalId?: string;
|
|
13
|
+
status?: Paid.ListOrderSeatsRequestStatus;
|
|
14
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
export type { BatchSeatAssignmentsRequest } from "./BatchSeatAssignmentsRequest.js";
|
|
1
2
|
export type { CreateOrderRequest } from "./CreateOrderRequest.js";
|
|
2
3
|
export type { DeleteOrderByIdRequest } from "./DeleteOrderByIdRequest.js";
|
|
3
4
|
export type { GetOrderByIdRequest } from "./GetOrderByIdRequest.js";
|
|
4
5
|
export type { GetOrderLinesRequest } from "./GetOrderLinesRequest.js";
|
|
6
|
+
export type { ListOrderSeatsRequest } from "./ListOrderSeatsRequest.js";
|
|
5
7
|
export type { ListOrdersRequest } from "./ListOrdersRequest.js";
|
|
6
8
|
export type { UpdateOrderRequest } from "./UpdateOrderRequest.js";
|
|
9
|
+
export type { UpdateSeatAssignmentRequest } from "./UpdateSeatAssignmentRequest.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.ListOrderSeatsRequestStatus = void 0;
|
|
5
|
+
exports.ListOrderSeatsRequestStatus = {
|
|
6
|
+
Assigned: "assigned",
|
|
7
|
+
Unassigned: "unassigned",
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListOrderSeatsRequestStatus.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("./ListOrderSeatsRequestStatus.js"), exports);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import * as Paid from "../../../index.js";
|
|
4
|
+
export declare namespace ValueReceipts {
|
|
5
|
+
interface Options extends BaseClientOptions {
|
|
6
|
+
}
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ValueReceipts {
|
|
11
|
+
protected readonly _options: ValueReceipts.Options;
|
|
12
|
+
constructor(_options: ValueReceipts.Options);
|
|
13
|
+
/**
|
|
14
|
+
* List value receipts for the organization
|
|
15
|
+
*
|
|
16
|
+
* @param {Paid.ListValueReceiptsRequest} request
|
|
17
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Paid.InternalServerError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.valueReceipts.listValueReceipts()
|
|
23
|
+
*/
|
|
24
|
+
listValueReceipts(request?: Paid.ListValueReceiptsRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptListResponse>;
|
|
25
|
+
private __listValueReceipts;
|
|
26
|
+
/**
|
|
27
|
+
* Get a value receipt by ID, including its publish/share state.
|
|
28
|
+
*
|
|
29
|
+
* @param {Paid.GetValueReceiptByIdRequest} request
|
|
30
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
|
+
*
|
|
32
|
+
* @throws {@link Paid.NotFoundError}
|
|
33
|
+
* @throws {@link Paid.InternalServerError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.valueReceipts.getValueReceiptById({
|
|
37
|
+
* id: "id"
|
|
38
|
+
* })
|
|
39
|
+
*/
|
|
40
|
+
getValueReceiptById(request: Paid.GetValueReceiptByIdRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptDetail>;
|
|
41
|
+
private __getValueReceiptById;
|
|
42
|
+
/**
|
|
43
|
+
* Make a value receipt publicly accessible via URL.
|
|
44
|
+
*
|
|
45
|
+
* @param {Paid.PublishValueReceiptBody} request
|
|
46
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
48
|
+
* @throws {@link Paid.NotFoundError}
|
|
49
|
+
* @throws {@link Paid.InternalServerError}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.valueReceipts.publishValueReceipt({
|
|
53
|
+
* id: "id"
|
|
54
|
+
* })
|
|
55
|
+
*/
|
|
56
|
+
publishValueReceipt(request: Paid.PublishValueReceiptBody, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptDetail>;
|
|
57
|
+
private __publishValueReceipt;
|
|
58
|
+
/**
|
|
59
|
+
* Revoke public access to a value receipt.
|
|
60
|
+
*
|
|
61
|
+
* @param {Paid.UnpublishValueReceiptRequest} request
|
|
62
|
+
* @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Paid.NotFoundError}
|
|
65
|
+
* @throws {@link Paid.InternalServerError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.valueReceipts.unpublishValueReceipt({
|
|
69
|
+
* id: "id"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
unpublishValueReceipt(request: Paid.UnpublishValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptDetail>;
|
|
73
|
+
private __unpublishValueReceipt;
|
|
74
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
75
|
+
}
|