@paddle/paddle-node-sdk 2.0.0-rc.0 → 2.0.0-rc.2
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/CHANGELOG.md +27 -7
- package/dist/cjs/entities/customer/auth-token.js +10 -0
- package/dist/cjs/entities/customer/index.js +1 -0
- package/dist/cjs/entities/index.js +5 -0
- package/dist/cjs/entities/notification-settings/notification-settings.js +1 -0
- package/dist/cjs/entities/payment-method/index.js +18 -0
- package/dist/cjs/entities/payment-method/payment-method-collection.js +11 -0
- package/dist/cjs/entities/payment-method/payment-method.js +18 -0
- package/dist/cjs/entities/shared/index.js +3 -0
- package/dist/cjs/entities/shared/paypal.js +10 -0
- package/dist/cjs/entities/shared/simulation-event-request.js +9 -0
- package/dist/cjs/entities/shared/simulation-event-response.js +10 -0
- package/dist/cjs/entities/simulation/index.js +18 -0
- package/dist/cjs/entities/simulation/simulation-collection.js +11 -0
- package/dist/cjs/entities/simulation/simulation.js +18 -0
- package/dist/cjs/entities/simulation-run/index.js +18 -0
- package/dist/cjs/entities/simulation-run/simulation-run-collection.js +11 -0
- package/dist/cjs/entities/simulation-run/simulation-run.js +16 -0
- package/dist/cjs/entities/simulation-run-event/index.js +18 -0
- package/dist/cjs/entities/simulation-run-event/simulation-run-event-collection.js +11 -0
- package/dist/cjs/entities/simulation-run-event/simulation-run-event.js +21 -0
- package/dist/cjs/entities/simulation-types/index.js +17 -0
- package/dist/cjs/entities/simulation-types/simulation-type.js +14 -0
- package/dist/cjs/enums/index.js +5 -0
- package/dist/cjs/enums/notification-settings/index.js +1 -0
- package/dist/cjs/enums/notification-settings/traffic-source.js +2 -0
- package/dist/cjs/enums/payment-method/deletion-reason.js +2 -0
- package/dist/cjs/enums/payment-method/index.js +19 -0
- package/dist/cjs/enums/payment-method/origin.js +2 -0
- package/dist/cjs/enums/payment-method/type.js +2 -0
- package/dist/cjs/enums/simulation/index.js +17 -0
- package/dist/cjs/enums/simulation/simulation-scenario-type.js +2 -0
- package/dist/cjs/enums/simulation-run/index.js +17 -0
- package/dist/cjs/enums/simulation-run/simulation-run-status.js +2 -0
- package/dist/cjs/enums/simulation-run-event/index.js +17 -0
- package/dist/cjs/enums/simulation-run-event/simulation-run-event-status.js +2 -0
- package/dist/cjs/enums/simulation-type/index.js +17 -0
- package/dist/cjs/enums/simulation-type/simulation-kind.js +2 -0
- package/dist/cjs/notifications/entities/index.js +1 -0
- package/dist/cjs/notifications/entities/payment-method/index.js +18 -0
- package/dist/cjs/notifications/entities/payment-method/payment-method-deleted-notification.js +16 -0
- package/dist/cjs/notifications/entities/payment-method/payment-method-notification.js +15 -0
- package/dist/cjs/notifications/entities/subscription/index.js +1 -0
- package/dist/cjs/notifications/entities/subscription/subscription-created-notification.js +42 -0
- package/dist/cjs/notifications/entities/subscription/subscription-notification.js +0 -1
- package/dist/cjs/notifications/events/index.js +1 -0
- package/dist/cjs/notifications/events/payment-method/index.js +18 -0
- package/dist/cjs/notifications/events/payment-method/payment-method-deleted-event.js +14 -0
- package/dist/cjs/notifications/events/payment-method/payment-method-saved-event.js +14 -0
- package/dist/cjs/notifications/events/subscription/subscription-created-event.js +1 -1
- package/dist/cjs/notifications/helpers/types.js +2 -0
- package/dist/cjs/notifications/helpers/webhooks.js +4 -0
- package/dist/cjs/notifications/types/index.js +1 -0
- package/dist/cjs/notifications/types/payment-method/index.js +18 -0
- package/dist/cjs/notifications/types/payment-method/payment-method-deleted-notification-response.js +2 -0
- package/dist/cjs/notifications/types/payment-method/payment-method-notification-response.js +2 -0
- package/dist/cjs/notifications/types/subscription/index.js +1 -0
- package/dist/cjs/notifications/types/subscription/subscription-created-notification-response.js +2 -0
- package/dist/cjs/paddle.js +5 -0
- package/dist/cjs/resources/customers/index.js +11 -0
- package/dist/cjs/resources/index.js +5 -0
- package/dist/cjs/resources/payment-methods/index.js +67 -0
- package/dist/cjs/resources/payment-methods/operations/index.js +17 -0
- package/dist/cjs/resources/payment-methods/operations/list-customer-payment-method-query-parameters.js +2 -0
- package/dist/cjs/resources/simulation-run-events/index.js +69 -0
- package/dist/cjs/resources/simulation-run-events/operations/index.js +17 -0
- package/dist/cjs/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.js +2 -0
- package/dist/cjs/resources/simulation-runs/index.js +66 -0
- package/dist/cjs/resources/simulation-runs/operations/get-simulation-run-query-parameters.js +2 -0
- package/dist/cjs/resources/simulation-runs/operations/index.js +18 -0
- package/dist/cjs/resources/simulation-runs/operations/list-simulation-run-query-parameters.js +2 -0
- package/dist/cjs/resources/simulation-types/index.js +27 -0
- package/dist/cjs/resources/simulations/index.js +69 -0
- package/dist/cjs/resources/simulations/operations/create-simulation-request-body.js +2 -0
- package/dist/cjs/resources/simulations/operations/index.js +19 -0
- package/dist/cjs/resources/simulations/operations/list-simulation-query-parameters.js +2 -0
- package/dist/cjs/resources/simulations/operations/update-simulation-request-body.js +2 -0
- package/dist/cjs/types/customer/auth-token-response.js +2 -0
- package/dist/cjs/types/customer/index.js +1 -0
- package/dist/cjs/types/index.js +5 -0
- package/dist/cjs/types/payment-method/index.js +17 -0
- package/dist/cjs/types/payment-method/payment-method.js +2 -0
- package/dist/cjs/types/shared/index.js +4 -0
- package/dist/cjs/types/shared/paypal.js +2 -0
- package/dist/cjs/types/shared/simulation-event-request.js +2 -0
- package/dist/cjs/types/shared/simulation-event-response.js +2 -0
- package/dist/cjs/types/shared/simulation-payload.js +2 -0
- package/dist/cjs/types/simulation/index.js +17 -0
- package/dist/cjs/types/simulation/simulation-response.js +2 -0
- package/dist/cjs/types/simulation-run/index.js +17 -0
- package/dist/cjs/types/simulation-run/simulation-run-event.js +2 -0
- package/dist/cjs/types/simulation-run/simulation-run-response.js +2 -0
- package/dist/cjs/types/simulation-run-event/index.js +17 -0
- package/dist/cjs/types/simulation-run-event/simulation-run-event-response.js +2 -0
- package/dist/cjs/types/simulation-type/index.js +17 -0
- package/dist/cjs/types/simulation-type/simulation-type.js +2 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/entities/customer/auth-token.js +6 -0
- package/dist/esm/entities/customer/index.js +1 -0
- package/dist/esm/entities/index.js +5 -0
- package/dist/esm/entities/notification-settings/notification-settings.js +1 -0
- package/dist/esm/entities/payment-method/index.js +2 -0
- package/dist/esm/entities/payment-method/payment-method-collection.js +7 -0
- package/dist/esm/entities/payment-method/payment-method.js +14 -0
- package/dist/esm/entities/shared/index.js +3 -0
- package/dist/esm/entities/shared/paypal.js +6 -0
- package/dist/esm/entities/shared/simulation-event-request.js +5 -0
- package/dist/esm/entities/shared/simulation-event-response.js +6 -0
- package/dist/esm/entities/simulation/index.js +2 -0
- package/dist/esm/entities/simulation/simulation-collection.js +7 -0
- package/dist/esm/entities/simulation/simulation.js +14 -0
- package/dist/esm/entities/simulation-run/index.js +2 -0
- package/dist/esm/entities/simulation-run/simulation-run-collection.js +7 -0
- package/dist/esm/entities/simulation-run/simulation-run.js +12 -0
- package/dist/esm/entities/simulation-run-event/index.js +2 -0
- package/dist/esm/entities/simulation-run-event/simulation-run-event-collection.js +7 -0
- package/dist/esm/entities/simulation-run-event/simulation-run-event.js +17 -0
- package/dist/esm/entities/simulation-types/index.js +1 -0
- package/dist/esm/entities/simulation-types/simulation-type.js +10 -0
- package/dist/esm/enums/index.js +5 -0
- package/dist/esm/enums/notification-settings/index.js +1 -0
- package/dist/esm/enums/notification-settings/traffic-source.js +1 -0
- package/dist/esm/enums/payment-method/deletion-reason.js +1 -0
- package/dist/esm/enums/payment-method/index.js +3 -0
- package/dist/esm/enums/payment-method/origin.js +1 -0
- package/dist/esm/enums/payment-method/type.js +1 -0
- package/dist/esm/enums/simulation/index.js +1 -0
- package/dist/esm/enums/simulation/simulation-scenario-type.js +1 -0
- package/dist/esm/enums/simulation-run/index.js +1 -0
- package/dist/esm/enums/simulation-run/simulation-run-status.js +1 -0
- package/dist/esm/enums/simulation-run-event/index.js +1 -0
- package/dist/esm/enums/simulation-run-event/simulation-run-event-status.js +1 -0
- package/dist/esm/enums/simulation-type/index.js +1 -0
- package/dist/esm/enums/simulation-type/simulation-kind.js +1 -0
- package/dist/esm/notifications/entities/index.js +1 -0
- package/dist/esm/notifications/entities/payment-method/index.js +2 -0
- package/dist/esm/notifications/entities/payment-method/payment-method-deleted-notification.js +12 -0
- package/dist/esm/notifications/entities/payment-method/payment-method-notification.js +11 -0
- package/dist/esm/notifications/entities/subscription/index.js +1 -0
- package/dist/esm/notifications/entities/subscription/subscription-created-notification.js +38 -0
- package/dist/esm/notifications/entities/subscription/subscription-notification.js +0 -1
- package/dist/esm/notifications/events/index.js +1 -0
- package/dist/esm/notifications/events/payment-method/index.js +2 -0
- package/dist/esm/notifications/events/payment-method/payment-method-deleted-event.js +10 -0
- package/dist/esm/notifications/events/payment-method/payment-method-saved-event.js +10 -0
- package/dist/esm/notifications/events/subscription/subscription-created-event.js +2 -2
- package/dist/esm/notifications/helpers/types.js +2 -0
- package/dist/esm/notifications/helpers/webhooks.js +5 -1
- package/dist/esm/notifications/types/index.js +1 -0
- package/dist/esm/notifications/types/payment-method/index.js +2 -0
- package/dist/esm/notifications/types/payment-method/payment-method-deleted-notification-response.js +1 -0
- package/dist/esm/notifications/types/payment-method/payment-method-notification-response.js +1 -0
- package/dist/esm/notifications/types/subscription/index.js +1 -0
- package/dist/esm/notifications/types/subscription/subscription-created-notification-response.js +1 -0
- package/dist/esm/paddle.js +6 -1
- package/dist/esm/resources/customers/index.js +12 -1
- package/dist/esm/resources/index.js +5 -0
- package/dist/esm/resources/payment-methods/index.js +49 -0
- package/dist/esm/resources/payment-methods/operations/index.js +1 -0
- package/dist/esm/resources/payment-methods/operations/list-customer-payment-method-query-parameters.js +1 -0
- package/dist/esm/resources/simulation-run-events/index.js +51 -0
- package/dist/esm/resources/simulation-run-events/operations/index.js +1 -0
- package/dist/esm/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.js +1 -0
- package/dist/esm/resources/simulation-runs/index.js +48 -0
- package/dist/esm/resources/simulation-runs/operations/get-simulation-run-query-parameters.js +1 -0
- package/dist/esm/resources/simulation-runs/operations/index.js +2 -0
- package/dist/esm/resources/simulation-runs/operations/list-simulation-run-query-parameters.js +1 -0
- package/dist/esm/resources/simulation-types/index.js +23 -0
- package/dist/esm/resources/simulations/index.js +51 -0
- package/dist/esm/resources/simulations/operations/create-simulation-request-body.js +1 -0
- package/dist/esm/resources/simulations/operations/index.js +3 -0
- package/dist/esm/resources/simulations/operations/list-simulation-query-parameters.js +1 -0
- package/dist/esm/resources/simulations/operations/update-simulation-request-body.js +1 -0
- package/dist/esm/types/customer/auth-token-response.js +1 -0
- package/dist/esm/types/customer/index.js +1 -0
- package/dist/esm/types/index.js +5 -0
- package/dist/esm/types/payment-method/index.js +1 -0
- package/dist/esm/types/payment-method/payment-method.js +1 -0
- package/dist/esm/types/shared/index.js +4 -0
- package/dist/esm/types/shared/paypal.js +1 -0
- package/dist/esm/types/shared/simulation-event-request.js +1 -0
- package/dist/esm/types/shared/simulation-event-response.js +1 -0
- package/dist/esm/types/shared/simulation-payload.js +1 -0
- package/dist/esm/types/simulation/index.js +1 -0
- package/dist/esm/types/simulation/simulation-response.js +1 -0
- package/dist/esm/types/simulation-run/index.js +1 -0
- package/dist/esm/types/simulation-run/simulation-run-event.js +1 -0
- package/dist/esm/types/simulation-run/simulation-run-response.js +1 -0
- package/dist/esm/types/simulation-run-event/index.js +1 -0
- package/dist/esm/types/simulation-run-event/simulation-run-event-response.js +1 -0
- package/dist/esm/types/simulation-type/index.js +1 -0
- package/dist/esm/types/simulation-type/simulation-type.js +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/entities/customer/auth-token.d.ts +6 -0
- package/dist/types/entities/customer/index.d.ts +1 -0
- package/dist/types/entities/index.d.ts +5 -0
- package/dist/types/entities/notification-settings/notification-settings.d.ts +2 -1
- package/dist/types/entities/payment-method/index.d.ts +2 -0
- package/dist/types/entities/payment-method/payment-method-collection.d.ts +6 -0
- package/dist/types/entities/payment-method/payment-method.d.ts +15 -0
- package/dist/types/entities/shared/index.d.ts +3 -0
- package/dist/types/entities/shared/paypal.d.ts +6 -0
- package/dist/types/entities/shared/simulation-event-request.d.ts +5 -0
- package/dist/types/entities/shared/simulation-event-response.d.ts +6 -0
- package/dist/types/entities/simulation/index.d.ts +2 -0
- package/dist/types/entities/simulation/simulation-collection.d.ts +6 -0
- package/dist/types/entities/simulation/simulation.d.ts +15 -0
- package/dist/types/entities/simulation-run/index.d.ts +2 -0
- package/dist/types/entities/simulation-run/simulation-run-collection.d.ts +6 -0
- package/dist/types/entities/simulation-run/simulation-run.d.ts +13 -0
- package/dist/types/entities/simulation-run-event/index.d.ts +2 -0
- package/dist/types/entities/simulation-run-event/simulation-run-event-collection.d.ts +6 -0
- package/dist/types/entities/simulation-run-event/simulation-run-event.d.ts +15 -0
- package/dist/types/entities/simulation-types/index.d.ts +1 -0
- package/dist/types/entities/simulation-types/simulation-type.d.ts +12 -0
- package/dist/types/enums/index.d.ts +5 -0
- package/dist/types/enums/notification-settings/index.d.ts +1 -0
- package/dist/types/enums/notification-settings/traffic-source.d.ts +1 -0
- package/dist/types/enums/payment-method/deletion-reason.d.ts +1 -0
- package/dist/types/enums/payment-method/index.d.ts +3 -0
- package/dist/types/enums/payment-method/origin.d.ts +1 -0
- package/dist/types/enums/payment-method/type.d.ts +1 -0
- package/dist/types/enums/simulation/index.d.ts +1 -0
- package/dist/types/enums/simulation/simulation-scenario-type.d.ts +1 -0
- package/dist/types/enums/simulation-run/index.d.ts +1 -0
- package/dist/types/enums/simulation-run/simulation-run-status.d.ts +1 -0
- package/dist/types/enums/simulation-run-event/index.d.ts +1 -0
- package/dist/types/enums/simulation-run-event/simulation-run-event-status.d.ts +1 -0
- package/dist/types/enums/simulation-type/index.d.ts +1 -0
- package/dist/types/enums/simulation-type/simulation-kind.d.ts +1 -0
- package/dist/types/notifications/entities/index.d.ts +1 -0
- package/dist/types/notifications/entities/payment-method/index.d.ts +2 -0
- package/dist/types/notifications/entities/payment-method/payment-method-deleted-notification.d.ts +13 -0
- package/dist/types/notifications/entities/payment-method/payment-method-notification.d.ts +12 -0
- package/dist/types/notifications/entities/subscription/index.d.ts +1 -0
- package/dist/types/notifications/entities/subscription/subscription-created-notification.d.ts +34 -0
- package/dist/types/notifications/entities/subscription/subscription-notification.d.ts +0 -1
- package/dist/types/notifications/events/index.d.ts +1 -0
- package/dist/types/notifications/events/payment-method/index.d.ts +2 -0
- package/dist/types/notifications/events/payment-method/payment-method-deleted-event.d.ts +10 -0
- package/dist/types/notifications/events/payment-method/payment-method-saved-event.d.ts +10 -0
- package/dist/types/notifications/events/subscription/subscription-activated-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-canceled-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-created-event.d.ts +4 -4
- package/dist/types/notifications/events/subscription/subscription-imported-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-past-due-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-paused-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-resumed-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-trialing-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-updated-event.d.ts +1 -1
- package/dist/types/notifications/helpers/types.d.ts +5 -3
- package/dist/types/notifications/types/index.d.ts +1 -0
- package/dist/types/notifications/types/payment-method/index.d.ts +2 -0
- package/dist/types/notifications/types/payment-method/payment-method-deleted-notification-response.d.ts +11 -0
- package/dist/types/notifications/types/payment-method/payment-method-notification-response.d.ts +10 -0
- package/dist/types/notifications/types/subscription/index.d.ts +1 -0
- package/dist/types/notifications/types/subscription/subscription-created-notification-response.d.ts +28 -0
- package/dist/types/notifications/types/subscription/subscription-notification-response.d.ts +0 -1
- package/dist/types/paddle.d.ts +6 -1
- package/dist/types/resources/customers/index.d.ts +2 -1
- package/dist/types/resources/index.d.ts +5 -0
- package/dist/types/resources/notification-settings/operations/create-notification-settings-request-body.d.ts +2 -1
- package/dist/types/resources/notification-settings/operations/list-notification-settings-query-parameters.d.ts +2 -0
- package/dist/types/resources/notification-settings/operations/update-notification-settings-request-body.d.ts +2 -0
- package/dist/types/resources/payment-methods/index.d.ts +9 -0
- package/dist/types/resources/payment-methods/operations/index.d.ts +1 -0
- package/dist/types/resources/payment-methods/operations/list-customer-payment-method-query-parameters.d.ts +7 -0
- package/dist/types/resources/simulation-run-events/index.d.ts +9 -0
- package/dist/types/resources/simulation-run-events/operations/index.d.ts +1 -0
- package/dist/types/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.d.ts +6 -0
- package/dist/types/resources/simulation-runs/index.d.ts +9 -0
- package/dist/types/resources/simulation-runs/operations/get-simulation-run-query-parameters.d.ts +3 -0
- package/dist/types/resources/simulation-runs/operations/index.d.ts +2 -0
- package/dist/types/resources/simulation-runs/operations/list-simulation-run-query-parameters.d.ts +7 -0
- package/dist/types/resources/simulation-types/index.d.ts +5 -0
- package/dist/types/resources/simulations/index.d.ts +10 -0
- package/dist/types/resources/simulations/operations/create-simulation-request-body.d.ts +10 -0
- package/dist/types/resources/simulations/operations/index.d.ts +3 -0
- package/dist/types/resources/simulations/operations/list-simulation-query-parameters.d.ts +9 -0
- package/dist/types/resources/simulations/operations/update-simulation-request-body.d.ts +12 -0
- package/dist/types/types/customer/auth-token-response.d.ts +4 -0
- package/dist/types/types/customer/index.d.ts +1 -0
- package/dist/types/types/events/events-response.d.ts +9 -3
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/notification-settings/notification-settings-response.d.ts +2 -1
- package/dist/types/types/payment-method/index.d.ts +1 -0
- package/dist/types/types/payment-method/payment-method.d.ts +13 -0
- package/dist/types/types/shared/index.d.ts +4 -0
- package/dist/types/types/shared/paypal.d.ts +4 -0
- package/dist/types/types/shared/simulation-event-request.d.ts +3 -0
- package/dist/types/types/shared/simulation-event-response.d.ts +4 -0
- package/dist/types/types/shared/simulation-payload.d.ts +58 -0
- package/dist/types/types/simulation/index.d.ts +1 -0
- package/dist/types/types/simulation/simulation-response.d.ts +13 -0
- package/dist/types/types/simulation-run/index.d.ts +1 -0
- package/dist/types/types/simulation-run/simulation-run-event.d.ts +17 -0
- package/dist/types/types/simulation-run/simulation-run-response.d.ts +11 -0
- package/dist/types/types/simulation-run-event/index.d.ts +1 -0
- package/dist/types/types/simulation-run-event/simulation-run-event-response.d.ts +13 -0
- package/dist/types/types/simulation-type/index.d.ts +1 -0
- package/dist/types/types/simulation-type/simulation-type.d.ts +10 -0
- package/dist/types/types/subscription/subscription-update-item.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentMethodNotification = void 0;
|
|
4
|
+
class PaymentMethodNotification {
|
|
5
|
+
constructor(paymentMethod) {
|
|
6
|
+
this.id = paymentMethod.id;
|
|
7
|
+
this.customerId = paymentMethod.customer_id;
|
|
8
|
+
this.addressId = paymentMethod.address_id;
|
|
9
|
+
this.type = paymentMethod.type;
|
|
10
|
+
this.origin = paymentMethod.origin;
|
|
11
|
+
this.savedAt = paymentMethod.saved_at;
|
|
12
|
+
this.updatedAt = paymentMethod.updated_at;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.PaymentMethodNotification = PaymentMethodNotification;
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./subscription-created-notification.js"), exports);
|
|
17
18
|
__exportStar(require("./subscription-discount-notification.js"), exports);
|
|
18
19
|
__exportStar(require("./subscription-time-period-notification.js"), exports);
|
|
19
20
|
__exportStar(require("./subscription-scheduled-change-notification.js"), exports);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionCreatedNotification = void 0;
|
|
4
|
+
const index_js_1 = require("../shared/index.js");
|
|
5
|
+
const subscription_discount_notification_js_1 = require("./subscription-discount-notification.js");
|
|
6
|
+
const subscription_item_notification_js_1 = require("./subscription-item-notification.js");
|
|
7
|
+
const subscription_scheduled_change_notification_js_1 = require("./subscription-scheduled-change-notification.js");
|
|
8
|
+
const subscription_time_period_notification_js_1 = require("./subscription-time-period-notification.js");
|
|
9
|
+
class SubscriptionCreatedNotification {
|
|
10
|
+
constructor(subscription) {
|
|
11
|
+
this.id = subscription.id;
|
|
12
|
+
this.status = subscription.status;
|
|
13
|
+
this.transactionId = subscription.transaction_id;
|
|
14
|
+
this.customerId = subscription.customer_id;
|
|
15
|
+
this.addressId = subscription.address_id;
|
|
16
|
+
this.businessId = subscription.business_id ? subscription.business_id : null;
|
|
17
|
+
this.currencyCode = subscription.currency_code;
|
|
18
|
+
this.createdAt = subscription.created_at;
|
|
19
|
+
this.updatedAt = subscription.updated_at;
|
|
20
|
+
this.startedAt = subscription.started_at ? subscription.started_at : null;
|
|
21
|
+
this.firstBilledAt = subscription.first_billed_at ? subscription.first_billed_at : null;
|
|
22
|
+
this.nextBilledAt = subscription.next_billed_at ? subscription.next_billed_at : null;
|
|
23
|
+
this.pausedAt = subscription.paused_at ? subscription.paused_at : null;
|
|
24
|
+
this.canceledAt = subscription.canceled_at ? subscription.canceled_at : null;
|
|
25
|
+
this.discount = subscription.discount ? new subscription_discount_notification_js_1.SubscriptionDiscountNotification(subscription.discount) : null;
|
|
26
|
+
this.collectionMode = subscription.collection_mode;
|
|
27
|
+
this.billingDetails = subscription.billing_details
|
|
28
|
+
? new index_js_1.BillingDetailsNotification(subscription.billing_details)
|
|
29
|
+
: null;
|
|
30
|
+
this.currentBillingPeriod = subscription.current_billing_period
|
|
31
|
+
? new subscription_time_period_notification_js_1.SubscriptionTimePeriodNotification(subscription.current_billing_period)
|
|
32
|
+
: null;
|
|
33
|
+
this.billingCycle = new index_js_1.TimePeriodNotification(subscription.billing_cycle);
|
|
34
|
+
this.scheduledChange = subscription.scheduled_change
|
|
35
|
+
? new subscription_scheduled_change_notification_js_1.SubscriptionScheduledChangeNotification(subscription.scheduled_change)
|
|
36
|
+
: null;
|
|
37
|
+
this.items = subscription.items.map((item) => new subscription_item_notification_js_1.SubscriptionItemNotification(item));
|
|
38
|
+
this.customData = subscription.custom_data ? subscription.custom_data : null;
|
|
39
|
+
this.importMeta = subscription.import_meta ? new index_js_1.ImportMetaNotification(subscription.import_meta) : null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.SubscriptionCreatedNotification = SubscriptionCreatedNotification;
|
|
@@ -10,7 +10,6 @@ class SubscriptionNotification {
|
|
|
10
10
|
constructor(subscription) {
|
|
11
11
|
this.id = subscription.id;
|
|
12
12
|
this.status = subscription.status;
|
|
13
|
-
this.transactionId = subscription.transaction_id ? subscription.transaction_id : null;
|
|
14
13
|
this.customerId = subscription.customer_id;
|
|
15
14
|
this.addressId = subscription.address_id;
|
|
16
15
|
this.businessId = subscription.business_id ? subscription.business_id : null;
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./adjustment/index.js"), exports);
|
|
|
19
19
|
__exportStar(require("./business/index.js"), exports);
|
|
20
20
|
__exportStar(require("./customer/index.js"), exports);
|
|
21
21
|
__exportStar(require("./discount/index.js"), exports);
|
|
22
|
+
__exportStar(require("./payment-method/index.js"), exports);
|
|
22
23
|
__exportStar(require("./payout/index.js"), exports);
|
|
23
24
|
__exportStar(require("./price/index.js"), exports);
|
|
24
25
|
__exportStar(require("./product/index.js"), exports);
|
|
@@ -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("./payment-method-deleted-event.js"), exports);
|
|
18
|
+
__exportStar(require("./payment-method-saved-event.js"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentMethodDeletedEvent = void 0;
|
|
4
|
+
const event_js_1 = require("../../../entities/events/event.js");
|
|
5
|
+
const index_js_1 = require("../../entities/index.js");
|
|
6
|
+
const index_js_2 = require("../../helpers/index.js");
|
|
7
|
+
class PaymentMethodDeletedEvent extends event_js_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = index_js_2.EventName.PaymentMethodDeleted;
|
|
11
|
+
this.data = new index_js_1.PaymentMethodDeletedNotification(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.PaymentMethodDeletedEvent = PaymentMethodDeletedEvent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentMethodSavedEvent = void 0;
|
|
4
|
+
const event_js_1 = require("../../../entities/events/event.js");
|
|
5
|
+
const index_js_1 = require("../../entities/index.js");
|
|
6
|
+
const index_js_2 = require("../../helpers/index.js");
|
|
7
|
+
class PaymentMethodSavedEvent extends event_js_1.Event {
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response);
|
|
10
|
+
this.eventType = index_js_2.EventName.PaymentMethodSaved;
|
|
11
|
+
this.data = new index_js_1.PaymentMethodNotification(response.data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.PaymentMethodSavedEvent = PaymentMethodSavedEvent;
|
|
@@ -8,7 +8,7 @@ class SubscriptionCreatedEvent extends event_js_1.Event {
|
|
|
8
8
|
constructor(response) {
|
|
9
9
|
super(response);
|
|
10
10
|
this.eventType = index_js_1.EventName.SubscriptionCreated;
|
|
11
|
-
this.data = new index_js_2.
|
|
11
|
+
this.data = new index_js_2.SubscriptionCreatedNotification(response.data);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
exports.SubscriptionCreatedEvent = SubscriptionCreatedEvent;
|
|
@@ -17,6 +17,8 @@ var EventName;
|
|
|
17
17
|
EventName["DiscountCreated"] = "discount.created";
|
|
18
18
|
EventName["DiscountUpdated"] = "discount.updated";
|
|
19
19
|
EventName["DiscountImported"] = "discount.imported";
|
|
20
|
+
EventName["PaymentMethodDeleted"] = "payment_method.deleted";
|
|
21
|
+
EventName["PaymentMethodSaved"] = "payment_method.saved";
|
|
20
22
|
EventName["PayoutCreated"] = "payout.created";
|
|
21
23
|
EventName["PayoutPaid"] = "payout.paid";
|
|
22
24
|
EventName["PriceCreated"] = "price.created";
|
|
@@ -62,6 +62,10 @@ class Webhooks {
|
|
|
62
62
|
return new index_js_1.DiscountImportedEvent(data);
|
|
63
63
|
case types_js_1.EventName.DiscountUpdated:
|
|
64
64
|
return new index_js_1.DiscountUpdatedEvent(data);
|
|
65
|
+
case types_js_1.EventName.PaymentMethodDeleted:
|
|
66
|
+
return new index_js_1.PaymentMethodDeletedEvent(data);
|
|
67
|
+
case types_js_1.EventName.PaymentMethodSaved:
|
|
68
|
+
return new index_js_1.PaymentMethodSavedEvent(data);
|
|
65
69
|
case types_js_1.EventName.PayoutCreated:
|
|
66
70
|
return new index_js_1.PayoutCreatedEvent(data);
|
|
67
71
|
case types_js_1.EventName.PayoutPaid:
|
|
@@ -23,6 +23,7 @@ __exportStar(require("./business/index.js"), exports);
|
|
|
23
23
|
__exportStar(require("./subscription/index.js"), exports);
|
|
24
24
|
__exportStar(require("./address/index.js"), exports);
|
|
25
25
|
__exportStar(require("./discount/index.js"), exports);
|
|
26
|
+
__exportStar(require("./payment-method/index.js"), exports);
|
|
26
27
|
__exportStar(require("./payout/index.js"), exports);
|
|
27
28
|
__exportStar(require("./report/index.js"), exports);
|
|
28
29
|
__exportStar(require("./shared/index.js"), exports);
|
|
@@ -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("./payment-method-deleted-notification-response.js"), exports);
|
|
18
|
+
__exportStar(require("./payment-method-notification-response.js"), exports);
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./subscription-created-notification-response.js"), exports);
|
|
17
18
|
__exportStar(require("./subscription-discount-notification-response.js"), exports);
|
|
18
19
|
__exportStar(require("./subscription-time-period-notification-response.js"), exports);
|
|
19
20
|
__exportStar(require("./subscription-scheduled-change-notification-response.js"), exports);
|
package/dist/cjs/paddle.js
CHANGED
|
@@ -22,6 +22,7 @@ class Paddle {
|
|
|
22
22
|
this.businesses = new index_js_2.BusinessesResource(this.client);
|
|
23
23
|
this.discounts = new index_js_2.DiscountsResource(this.client);
|
|
24
24
|
this.subscriptions = new index_js_2.SubscriptionsResource(this.client);
|
|
25
|
+
this.paymentMethods = new index_js_2.PaymentMethodsResource(this.client);
|
|
25
26
|
this.pricingPreview = new index_js_2.PricingPreviewResource(this.client);
|
|
26
27
|
this.events = new index_js_3.EventsResource(this.client);
|
|
27
28
|
this.webhooks = new index_js_4.Webhooks();
|
|
@@ -29,6 +30,10 @@ class Paddle {
|
|
|
29
30
|
this.notificationSettings = new index_js_2.NotificationSettingsResource(this.client);
|
|
30
31
|
this.notifications = new index_js_2.NotificationsResource(this.client);
|
|
31
32
|
this.reports = new index_js_2.ReportsResource(this.client);
|
|
33
|
+
this.simulationTypes = new index_js_2.SimulationTypesResource(this.client);
|
|
34
|
+
this.simulations = new index_js_2.SimulationsResource(this.client);
|
|
35
|
+
this.simulationRuns = new index_js_2.SimulationRunsResource(this.client);
|
|
36
|
+
this.simulationRunEvents = new index_js_2.SimulationRunEventsResource(this.client);
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
exports.Paddle = Paddle;
|
|
@@ -32,6 +32,7 @@ const CustomerPaths = {
|
|
|
32
32
|
get: '/customers/{customer_id}',
|
|
33
33
|
update: '/customers/{customer_id}',
|
|
34
34
|
getCustomerBalance: '/customers/{customer_id}/credit-balances',
|
|
35
|
+
generate: '/customers/{customer_id}/auth-token',
|
|
35
36
|
};
|
|
36
37
|
__exportStar(require("./operations/index.js"), exports);
|
|
37
38
|
class CustomersResource extends index_js_1.BaseResource {
|
|
@@ -82,5 +83,15 @@ class CustomersResource extends index_js_1.BaseResource {
|
|
|
82
83
|
return yield this.update(customerId, { status: 'archived' });
|
|
83
84
|
});
|
|
84
85
|
}
|
|
86
|
+
generateAuthToken(customerId) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.generate, {
|
|
89
|
+
customer_id: customerId,
|
|
90
|
+
}).deriveUrl();
|
|
91
|
+
const response = yield this.client.post(urlWithPathParams, undefined);
|
|
92
|
+
const data = this.handleResponse(response);
|
|
93
|
+
return new index_js_2.AuthToken(data);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
85
96
|
}
|
|
86
97
|
exports.CustomersResource = CustomersResource;
|
|
@@ -23,8 +23,13 @@ __exportStar(require("./prices/index.js"), exports);
|
|
|
23
23
|
__exportStar(require("./products/index.js"), exports);
|
|
24
24
|
__exportStar(require("./subscriptions/index.js"), exports);
|
|
25
25
|
__exportStar(require("./transactions/index.js"), exports);
|
|
26
|
+
__exportStar(require("./payment-methods/index.js"), exports);
|
|
26
27
|
__exportStar(require("./pricing-preview/index.js"), exports);
|
|
27
28
|
__exportStar(require("./event-types/index.js"), exports);
|
|
28
29
|
__exportStar(require("./notification-settings/index.js"), exports);
|
|
29
30
|
__exportStar(require("./notifications/index.js"), exports);
|
|
30
31
|
__exportStar(require("./reports/index.js"), exports);
|
|
32
|
+
__exportStar(require("./simulation-types/index.js"), exports);
|
|
33
|
+
__exportStar(require("./simulations/index.js"), exports);
|
|
34
|
+
__exportStar(require("./simulation-runs/index.js"), exports);
|
|
35
|
+
__exportStar(require("./simulation-run-events/index.js"), exports);
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.PaymentMethodsResource = void 0;
|
|
27
|
+
const index_js_1 = require("../../entities/index.js");
|
|
28
|
+
const index_js_2 = require("../../internal/base/index.js");
|
|
29
|
+
__exportStar(require("./operations"), exports);
|
|
30
|
+
const PaymentMethodPaths = {
|
|
31
|
+
list: '/customers/{customer_id}/payment-methods',
|
|
32
|
+
get: '/customers/{customer_id}/payment-methods/{payment_method_id}',
|
|
33
|
+
delete: '/customers/{customer_id}/payment-methods/{payment_method_id}',
|
|
34
|
+
};
|
|
35
|
+
class PaymentMethodsResource extends index_js_2.BaseResource {
|
|
36
|
+
list(customerId, queryParams) {
|
|
37
|
+
const queryParameters = new index_js_2.QueryParameters(queryParams);
|
|
38
|
+
const urlWithPathParams = new index_js_2.PathParameters(PaymentMethodPaths.list, {
|
|
39
|
+
customer_id: customerId,
|
|
40
|
+
}).deriveUrl();
|
|
41
|
+
return new index_js_1.PaymentMethodCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
|
|
42
|
+
}
|
|
43
|
+
get(customerId, paymentMethodId) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const urlWithPathParams = new index_js_2.PathParameters(PaymentMethodPaths.get, {
|
|
46
|
+
customer_id: customerId,
|
|
47
|
+
payment_method_id: paymentMethodId,
|
|
48
|
+
}).deriveUrl();
|
|
49
|
+
const response = yield this.client.get(urlWithPathParams);
|
|
50
|
+
const data = this.handleResponse(response);
|
|
51
|
+
return new index_js_1.PaymentMethod(data);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
delete(customerId, paymentMethodId) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const urlWithPathParams = new index_js_2.PathParameters(PaymentMethodPaths.delete, {
|
|
57
|
+
customer_id: customerId,
|
|
58
|
+
payment_method_id: paymentMethodId,
|
|
59
|
+
}).deriveUrl();
|
|
60
|
+
const response = yield this.client.delete(urlWithPathParams);
|
|
61
|
+
if (response) {
|
|
62
|
+
this.handleResponse(response);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.PaymentMethodsResource = PaymentMethodsResource;
|
|
@@ -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("./list-customer-payment-method-query-parameters.js"), exports);
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SimulationRunEventsResource = void 0;
|
|
27
|
+
const index_js_1 = require("../../entities/index.js");
|
|
28
|
+
const index_js_2 = require("../../internal/base/index.js");
|
|
29
|
+
__exportStar(require("./operations/index.js"), exports);
|
|
30
|
+
const SimulationRunEventPaths = {
|
|
31
|
+
list: '/simulations/{simulation_id}/runs/{simulation_run_id}/events',
|
|
32
|
+
get: '/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}',
|
|
33
|
+
replay: '/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}/replay',
|
|
34
|
+
};
|
|
35
|
+
class SimulationRunEventsResource extends index_js_2.BaseResource {
|
|
36
|
+
list(simulationId, simulationRunId, queryParams) {
|
|
37
|
+
const queryParameters = new index_js_2.QueryParameters(queryParams);
|
|
38
|
+
const urlWithPathParams = new index_js_2.PathParameters(SimulationRunEventPaths.list, {
|
|
39
|
+
simulation_id: simulationId,
|
|
40
|
+
simulation_run_id: simulationRunId,
|
|
41
|
+
}).deriveUrl();
|
|
42
|
+
return new index_js_1.SimulationRunEventCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
|
|
43
|
+
}
|
|
44
|
+
get(simulationId, simulationRunId, simulationEventId) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const urlWithPathParams = new index_js_2.PathParameters(SimulationRunEventPaths.get, {
|
|
47
|
+
simulation_id: simulationId,
|
|
48
|
+
simulation_run_id: simulationRunId,
|
|
49
|
+
simulation_event_id: simulationEventId,
|
|
50
|
+
}).deriveUrl();
|
|
51
|
+
const response = yield this.client.get(urlWithPathParams);
|
|
52
|
+
const data = this.handleResponse(response);
|
|
53
|
+
return new index_js_1.SimulationRunEvent(data);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
replay(simulationId, simulationRunId, simulationEventId) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const urlWithPathParams = new index_js_2.PathParameters(SimulationRunEventPaths.replay, {
|
|
59
|
+
simulation_id: simulationId,
|
|
60
|
+
simulation_run_id: simulationRunId,
|
|
61
|
+
simulation_event_id: simulationEventId,
|
|
62
|
+
}).deriveUrl();
|
|
63
|
+
const response = yield this.client.post(urlWithPathParams, undefined);
|
|
64
|
+
const data = this.handleResponse(response);
|
|
65
|
+
return new index_js_1.SimulationRunEvent(data);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.SimulationRunEventsResource = SimulationRunEventsResource;
|
|
@@ -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("./list-simulation-run-events-query-parameters.js"), exports);
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SimulationRunsResource = void 0;
|
|
27
|
+
const index_js_1 = require("../../entities/index.js");
|
|
28
|
+
const index_js_2 = require("../../internal/base/index.js");
|
|
29
|
+
__exportStar(require("./operations/index.js"), exports);
|
|
30
|
+
const SimulationRunPaths = {
|
|
31
|
+
list: '/simulations/{simulation_id}/runs',
|
|
32
|
+
create: '/simulations/{simulation_id}/runs',
|
|
33
|
+
get: '/simulations/{simulation_id}/runs/{simulation_run_id}',
|
|
34
|
+
};
|
|
35
|
+
class SimulationRunsResource extends index_js_2.BaseResource {
|
|
36
|
+
list(simulationId, queryParams) {
|
|
37
|
+
const queryParameters = new index_js_2.QueryParameters(queryParams);
|
|
38
|
+
const urlWithPathParams = new index_js_2.PathParameters(SimulationRunPaths.list, {
|
|
39
|
+
simulation_id: simulationId,
|
|
40
|
+
}).deriveUrl();
|
|
41
|
+
return new index_js_1.SimulationRunCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
|
|
42
|
+
}
|
|
43
|
+
create(simulationId) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const urlWithPathParams = new index_js_2.PathParameters(SimulationRunPaths.create, {
|
|
46
|
+
simulation_id: simulationId,
|
|
47
|
+
}).deriveUrl();
|
|
48
|
+
const response = yield this.client.post(urlWithPathParams, undefined);
|
|
49
|
+
const data = this.handleResponse(response);
|
|
50
|
+
return new index_js_1.SimulationRun(data);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
get(simulationId, simulationRunId, queryParams) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const queryParameters = new index_js_2.QueryParameters(queryParams);
|
|
56
|
+
const urlWithPathParams = new index_js_2.PathParameters(SimulationRunPaths.get, {
|
|
57
|
+
simulation_id: simulationId,
|
|
58
|
+
simulation_run_id: simulationRunId,
|
|
59
|
+
}).deriveUrl();
|
|
60
|
+
const response = yield this.client.get(urlWithPathParams, queryParameters);
|
|
61
|
+
const data = this.handleResponse(response);
|
|
62
|
+
return new index_js_1.SimulationRun(data);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.SimulationRunsResource = SimulationRunsResource;
|
|
@@ -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("./get-simulation-run-query-parameters.js"), exports);
|
|
18
|
+
__exportStar(require("./list-simulation-run-query-parameters.js"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SimulationTypesResource = void 0;
|
|
13
|
+
const index_js_1 = require("../../internal/base/index.js");
|
|
14
|
+
const index_js_2 = require("../../entities/index.js");
|
|
15
|
+
const SimulationTypesPaths = {
|
|
16
|
+
list: '/simulation-types',
|
|
17
|
+
};
|
|
18
|
+
class SimulationTypesResource extends index_js_1.BaseResource {
|
|
19
|
+
list() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const response = yield this.client.get(SimulationTypesPaths.list);
|
|
22
|
+
const data = this.handleResponse(response);
|
|
23
|
+
return data.map((simulationType) => new index_js_2.SimulationType(simulationType));
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.SimulationTypesResource = SimulationTypesResource;
|