@getivy/node-sdk 0.1.0-alpha.9 → 1.1.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/CHANGELOG.md +334 -0
- package/README.md +16 -26
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +25 -15
- package/core.js.map +1 -1
- package/core.mjs +26 -16
- package/core.mjs.map +1 -1
- package/index.d.mts +36 -18
- package/index.d.ts +36 -18
- package/index.d.ts.map +1 -1
- package/index.js +27 -8
- package/index.js.map +1 -1
- package/index.mjs +27 -8
- package/index.mjs.map +1 -1
- package/package.json +11 -33
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/balance.d.ts +8 -5
- package/resources/balance.d.ts.map +1 -1
- package/resources/banks.d.ts +82 -67
- package/resources/banks.d.ts.map +1 -1
- package/resources/beneficiary-payouts.d.ts +61 -0
- package/resources/beneficiary-payouts.d.ts.map +1 -0
- package/resources/beneficiary-payouts.js +16 -0
- package/resources/beneficiary-payouts.js.map +1 -0
- package/resources/beneficiary-payouts.mjs +12 -0
- package/resources/beneficiary-payouts.mjs.map +1 -0
- package/resources/capabilities.d.ts +1 -10
- package/resources/capabilities.d.ts.map +1 -1
- package/resources/charges.d.ts +28 -19
- package/resources/charges.d.ts.map +1 -1
- package/resources/checkoutsession.d.ts +275 -1360
- package/resources/checkoutsession.d.ts.map +1 -1
- package/resources/customers.d.ts +140 -10
- package/resources/customers.d.ts.map +1 -1
- package/resources/customers.js +9 -2
- package/resources/customers.js.map +1 -1
- package/resources/customers.mjs +9 -2
- package/resources/customers.mjs.map +1 -1
- package/resources/data/accounts.d.ts +83 -0
- package/resources/data/accounts.d.ts.map +1 -0
- package/resources/data/accounts.js +15 -0
- package/resources/data/accounts.js.map +1 -0
- package/resources/data/accounts.mjs +11 -0
- package/resources/data/accounts.mjs.map +1 -0
- package/resources/data/balances.d.ts +48 -0
- package/resources/data/balances.d.ts.map +1 -0
- package/resources/data/balances.js +15 -0
- package/resources/data/balances.js.map +1 -0
- package/resources/data/balances.mjs +11 -0
- package/resources/data/balances.mjs.map +1 -0
- package/resources/data/consent.d.ts +80 -0
- package/resources/data/consent.d.ts.map +1 -0
- package/resources/data/consent.js +21 -0
- package/resources/data/consent.js.map +1 -0
- package/resources/data/consent.mjs +17 -0
- package/resources/data/consent.mjs.map +1 -0
- package/resources/data/data.d.ts +26 -0
- package/resources/data/data.d.ts.map +1 -0
- package/resources/data/data.js +55 -0
- package/resources/data/data.js.map +1 -0
- package/resources/data/data.mjs +28 -0
- package/resources/data/data.mjs.map +1 -0
- package/resources/data/index.d.ts +7 -0
- package/resources/data/index.d.ts.map +1 -0
- package/resources/data/index.js +17 -0
- package/resources/data/index.js.map +1 -0
- package/resources/data/index.mjs +8 -0
- package/resources/data/index.mjs.map +1 -0
- package/resources/data/session.d.ts +258 -0
- package/resources/data/session.d.ts.map +1 -0
- package/resources/data/session.js +21 -0
- package/resources/data/session.js.map +1 -0
- package/resources/data/session.mjs +17 -0
- package/resources/data/session.mjs.map +1 -0
- package/resources/data/transactions.d.ts +175 -0
- package/resources/data/transactions.d.ts.map +1 -0
- package/resources/data/transactions.js +16 -0
- package/resources/data/transactions.js.map +1 -0
- package/resources/data/transactions.mjs +12 -0
- package/resources/data/transactions.mjs.map +1 -0
- package/resources/data.d.ts +2 -0
- package/resources/data.d.ts.map +1 -0
- package/resources/data.js +19 -0
- package/resources/data.js.map +1 -0
- package/resources/data.mjs +3 -0
- package/resources/data.mjs.map +1 -0
- package/resources/deposits.d.ts +165 -0
- package/resources/deposits.d.ts.map +1 -0
- package/resources/deposits.js +15 -0
- package/resources/deposits.js.map +1 -0
- package/resources/deposits.mjs +11 -0
- package/resources/deposits.mjs.map +1 -0
- package/resources/fx.d.ts +90 -0
- package/resources/fx.d.ts.map +1 -0
- package/resources/fx.js +22 -0
- package/resources/fx.js.map +1 -0
- package/resources/fx.mjs +18 -0
- package/resources/fx.mjs.map +1 -0
- package/resources/index.d.ts +13 -8
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +15 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -2
- package/resources/index.mjs.map +1 -1
- package/resources/mandates.d.ts +55 -17
- package/resources/mandates.d.ts.map +1 -1
- package/resources/orders.d.ts +720 -743
- package/resources/orders.d.ts.map +1 -1
- package/resources/orders.js +13 -3
- package/resources/orders.js.map +1 -1
- package/resources/orders.mjs +13 -3
- package/resources/orders.mjs.map +1 -1
- package/resources/payouts.d.ts +219 -103
- package/resources/payouts.d.ts.map +1 -1
- package/resources/payouts.js +3 -4
- package/resources/payouts.js.map +1 -1
- package/resources/payouts.mjs +3 -4
- package/resources/payouts.mjs.map +1 -1
- package/resources/refunds.d.ts +53 -97
- package/resources/refunds.d.ts.map +1 -1
- package/resources/refunds.js +8 -12
- package/resources/refunds.js.map +1 -1
- package/resources/refunds.mjs +8 -12
- package/resources/refunds.mjs.map +1 -1
- package/resources/returns.d.ts +104 -0
- package/resources/returns.d.ts.map +1 -0
- package/resources/returns.js +21 -0
- package/resources/returns.js.map +1 -0
- package/resources/returns.mjs +17 -0
- package/resources/returns.mjs.map +1 -0
- package/resources/subaccounts.d.ts +15 -5
- package/resources/subaccounts.d.ts.map +1 -1
- package/resources/subaccounts.js.map +1 -1
- package/resources/subaccounts.mjs.map +1 -1
- package/resources/transactions.d.ts +174 -0
- package/resources/transactions.d.ts.map +1 -0
- package/resources/transactions.js +15 -0
- package/resources/transactions.js.map +1 -0
- package/resources/transactions.mjs +11 -0
- package/resources/transactions.mjs.map +1 -0
- package/resources/webhook/index.d.ts +3 -0
- package/resources/webhook/index.d.ts.map +1 -0
- package/resources/webhook/index.js +9 -0
- package/resources/webhook/index.js.map +1 -0
- package/resources/webhook/index.mjs +4 -0
- package/resources/webhook/index.mjs.map +1 -0
- package/resources/webhook/subscription.d.ts +152 -0
- package/resources/webhook/subscription.d.ts.map +1 -0
- package/resources/{webhooksubscription.js → webhook/subscription.js} +6 -6
- package/resources/webhook/subscription.js.map +1 -0
- package/resources/{webhooksubscription.mjs → webhook/subscription.mjs} +4 -4
- package/resources/webhook/subscription.mjs.map +1 -0
- package/resources/webhook/webhook.d.ts +28 -0
- package/resources/webhook/webhook.d.ts.map +1 -0
- package/resources/webhook/webhook.js +45 -0
- package/resources/webhook/webhook.js.map +1 -0
- package/resources/webhook/webhook.mjs +18 -0
- package/resources/webhook/webhook.mjs.map +1 -0
- package/resources/webhook.d.ts +2 -0
- package/resources/webhook.d.ts.map +1 -0
- package/resources/webhook.js +19 -0
- package/resources/webhook.js.map +1 -0
- package/resources/webhook.mjs +3 -0
- package/resources/webhook.mjs.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/_shims/index.d.ts +2 -0
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +5 -1
- package/src/core.ts +44 -16
- package/src/index.ts +111 -60
- package/src/resource.ts +1 -1
- package/src/resources/balance.ts +8 -5
- package/src/resources/banks.ts +130 -67
- package/src/resources/beneficiary-payouts.ts +78 -0
- package/src/resources/capabilities.ts +1 -10
- package/src/resources/charges.ts +30 -21
- package/src/resources/checkoutsession.ts +1224 -3096
- package/src/resources/customers.ts +164 -9
- package/src/resources/data/accounts.ts +113 -0
- package/src/resources/data/balances.ts +60 -0
- package/src/resources/data/consent.ts +110 -0
- package/src/resources/data/data.ts +75 -0
- package/src/resources/data/index.ts +20 -0
- package/src/resources/data/session.ts +1317 -0
- package/src/resources/data/transactions.ts +235 -0
- package/src/resources/data.ts +3 -0
- package/src/resources/deposits.ts +231 -0
- package/src/resources/fx.ts +119 -0
- package/src/resources/index.ts +33 -28
- package/src/resources/mandates.ts +79 -17
- package/src/resources/orders.ts +1449 -1075
- package/src/resources/payouts.ts +273 -103
- package/src/resources/refunds.ts +70 -111
- package/src/resources/returns.ts +140 -0
- package/src/resources/subaccounts.ts +26 -4
- package/src/resources/transactions.ts +234 -0
- package/src/resources/webhook/index.ts +16 -0
- package/src/resources/{webhooksubscription.ts → webhook/subscription.ts} +164 -112
- package/src/resources/webhook/webhook.ts +69 -0
- package/src/resources/webhook.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/reports.d.ts +0 -120
- package/resources/reports.d.ts.map +0 -1
- package/resources/reports.js +0 -31
- package/resources/reports.js.map +0 -1
- package/resources/reports.mjs +0 -27
- package/resources/reports.mjs.map +0 -1
- package/resources/webhooksubscription.d.ts +0 -155
- package/resources/webhooksubscription.d.ts.map +0 -1
- package/resources/webhooksubscription.js.map +0 -1
- package/resources/webhooksubscription.mjs.map +0 -1
- package/src/resources/reports.ts +0 -172
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
4
|
-
import * as Core from '
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import * as Core from '../../core';
|
|
5
5
|
|
|
6
|
-
export class
|
|
6
|
+
export class Subscription extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Creates a webhook subscription that sends various events from Ivy to a specified
|
|
9
9
|
* url. There can be multiple subscriptions per app.
|
|
10
10
|
*/
|
|
11
11
|
create(
|
|
12
|
-
body:
|
|
12
|
+
body: SubscriptionCreateParams,
|
|
13
13
|
options?: Core.RequestOptions,
|
|
14
|
-
): Core.APIPromise<
|
|
14
|
+
): Core.APIPromise<SubscriptionCreateResponse> {
|
|
15
15
|
return this._client.post('/api/service/webhook-subscription/create', { body, ...options });
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -20,9 +20,9 @@ export class Webhooksubscription extends APIResource {
|
|
|
20
20
|
* used via the app or via the API by providing an API key.
|
|
21
21
|
*/
|
|
22
22
|
update(
|
|
23
|
-
body:
|
|
23
|
+
body: SubscriptionUpdateParams,
|
|
24
24
|
options?: Core.RequestOptions,
|
|
25
|
-
): Core.APIPromise<
|
|
25
|
+
): Core.APIPromise<SubscriptionUpdateResponse> {
|
|
26
26
|
return this._client.post('/api/service/webhook-subscription/update', { body, ...options });
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -31,9 +31,9 @@ export class Webhooksubscription extends APIResource {
|
|
|
31
31
|
* results are paginated and provided in chronological order.
|
|
32
32
|
*/
|
|
33
33
|
list(
|
|
34
|
-
body:
|
|
34
|
+
body: SubscriptionListParams,
|
|
35
35
|
options?: Core.RequestOptions,
|
|
36
|
-
): Core.APIPromise<
|
|
36
|
+
): Core.APIPromise<SubscriptionListResponse> {
|
|
37
37
|
return this._client.post('/api/service/webhook-subscription/list', { body, ...options });
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -41,30 +41,27 @@ export class Webhooksubscription extends APIResource {
|
|
|
41
41
|
* Deletes a webhook subscription.
|
|
42
42
|
*/
|
|
43
43
|
delete(
|
|
44
|
-
body:
|
|
44
|
+
body: SubscriptionDeleteParams,
|
|
45
45
|
options?: Core.RequestOptions,
|
|
46
|
-
): Core.APIPromise<
|
|
46
|
+
): Core.APIPromise<SubscriptionDeleteResponse> {
|
|
47
47
|
return this._client.post('/api/service/webhook-subscription/delete', { body, ...options });
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Sends a test ping to verify webhook subscription endpoint connectivity.
|
|
52
52
|
*/
|
|
53
53
|
ping(
|
|
54
|
-
body:
|
|
54
|
+
body: SubscriptionPingParams,
|
|
55
55
|
options?: Core.RequestOptions,
|
|
56
|
-
): Core.APIPromise<
|
|
56
|
+
): Core.APIPromise<SubscriptionPingResponse> {
|
|
57
57
|
return this._client.post('/api/service/webhook-subscription/ping', { body, ...options });
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export interface
|
|
62
|
-
|
|
63
|
-
* The unique id for the webhook subscription.
|
|
64
|
-
*/
|
|
65
|
-
id: string;
|
|
61
|
+
export interface SubscriptionCreateResponse {
|
|
62
|
+
id: unknown;
|
|
66
63
|
|
|
67
|
-
createdAt:
|
|
64
|
+
createdAt: unknown;
|
|
68
65
|
|
|
69
66
|
events: Array<
|
|
70
67
|
| 'test'
|
|
@@ -74,6 +71,9 @@ export interface WebhooksubscriptionCreateResponse {
|
|
|
74
71
|
| 'order_updated'
|
|
75
72
|
| 'refund_succeeded'
|
|
76
73
|
| 'refund_failed'
|
|
74
|
+
| 'refund.initiated'
|
|
75
|
+
| 'refund.succeeded'
|
|
76
|
+
| 'refund.failed'
|
|
77
77
|
| 'payout_report_requested'
|
|
78
78
|
| 'data_session_completed'
|
|
79
79
|
| 'checkout_session_created'
|
|
@@ -86,37 +86,32 @@ export interface WebhooksubscriptionCreateResponse {
|
|
|
86
86
|
| 'mandate_setup_succeeded'
|
|
87
87
|
| 'mandate_setup_failed'
|
|
88
88
|
| 'mandate_revoked'
|
|
89
|
+
| 'user_payout.initiated'
|
|
89
90
|
| 'user_payout.failed'
|
|
90
91
|
| 'user_payout.paid'
|
|
91
|
-
| '
|
|
92
|
+
| 'payout.initiated'
|
|
93
|
+
| 'payout.failed'
|
|
94
|
+
| 'payout.paid'
|
|
95
|
+
| 'deposit.received'
|
|
96
|
+
| 'return.initiated'
|
|
97
|
+
| 'return.succeeded'
|
|
98
|
+
| 'return.failed'
|
|
99
|
+
| 'return.returned'
|
|
92
100
|
>;
|
|
93
101
|
|
|
94
|
-
|
|
95
|
-
* The unique id for the webhook subscription.
|
|
96
|
-
*/
|
|
97
|
-
merchant: string;
|
|
102
|
+
merchant: unknown;
|
|
98
103
|
|
|
99
|
-
|
|
100
|
-
* @deprecated The unique id for the webhook subscription.
|
|
101
|
-
*/
|
|
102
|
-
merchantApp: string;
|
|
104
|
+
merchantApp: unknown;
|
|
103
105
|
|
|
104
|
-
updatedAt:
|
|
106
|
+
updatedAt: unknown;
|
|
105
107
|
|
|
106
|
-
/**
|
|
107
|
-
* The url that will listen to the webhook events coming from Ivy. Must be unique
|
|
108
|
-
* for the merchant app.
|
|
109
|
-
*/
|
|
110
108
|
url: string;
|
|
111
109
|
}
|
|
112
110
|
|
|
113
|
-
export interface
|
|
114
|
-
|
|
115
|
-
* The unique id for the webhook subscription.
|
|
116
|
-
*/
|
|
117
|
-
id: string;
|
|
111
|
+
export interface SubscriptionUpdateResponse {
|
|
112
|
+
id: unknown;
|
|
118
113
|
|
|
119
|
-
createdAt:
|
|
114
|
+
createdAt: unknown;
|
|
120
115
|
|
|
121
116
|
events: Array<
|
|
122
117
|
| 'test'
|
|
@@ -126,6 +121,9 @@ export interface WebhooksubscriptionUpdateResponse {
|
|
|
126
121
|
| 'order_updated'
|
|
127
122
|
| 'refund_succeeded'
|
|
128
123
|
| 'refund_failed'
|
|
124
|
+
| 'refund.initiated'
|
|
125
|
+
| 'refund.succeeded'
|
|
126
|
+
| 'refund.failed'
|
|
129
127
|
| 'payout_report_requested'
|
|
130
128
|
| 'data_session_completed'
|
|
131
129
|
| 'checkout_session_created'
|
|
@@ -138,48 +136,55 @@ export interface WebhooksubscriptionUpdateResponse {
|
|
|
138
136
|
| 'mandate_setup_succeeded'
|
|
139
137
|
| 'mandate_setup_failed'
|
|
140
138
|
| 'mandate_revoked'
|
|
139
|
+
| 'user_payout.initiated'
|
|
141
140
|
| 'user_payout.failed'
|
|
142
141
|
| 'user_payout.paid'
|
|
143
|
-
| '
|
|
142
|
+
| 'payout.initiated'
|
|
143
|
+
| 'payout.failed'
|
|
144
|
+
| 'payout.paid'
|
|
145
|
+
| 'deposit.received'
|
|
146
|
+
| 'return.initiated'
|
|
147
|
+
| 'return.succeeded'
|
|
148
|
+
| 'return.failed'
|
|
149
|
+
| 'return.returned'
|
|
144
150
|
>;
|
|
145
151
|
|
|
146
|
-
|
|
147
|
-
* The unique id for the webhook subscription.
|
|
148
|
-
*/
|
|
149
|
-
merchant: string;
|
|
152
|
+
merchant: unknown;
|
|
150
153
|
|
|
151
|
-
|
|
152
|
-
* @deprecated The unique id for the webhook subscription.
|
|
153
|
-
*/
|
|
154
|
-
merchantApp: string;
|
|
154
|
+
merchantApp: unknown;
|
|
155
155
|
|
|
156
|
-
updatedAt:
|
|
156
|
+
updatedAt: unknown;
|
|
157
157
|
|
|
158
|
-
/**
|
|
159
|
-
* The url that will listen to the webhook events coming from Ivy. Must be unique
|
|
160
|
-
* for the merchant app.
|
|
161
|
-
*/
|
|
162
158
|
url: string;
|
|
163
159
|
}
|
|
164
160
|
|
|
165
|
-
export interface
|
|
161
|
+
export interface SubscriptionListResponse {
|
|
162
|
+
/**
|
|
163
|
+
* The total number of webhook subscriptions
|
|
164
|
+
*/
|
|
166
165
|
count: number;
|
|
167
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Whether there are more webhook subscriptions to retrieve
|
|
169
|
+
*/
|
|
168
170
|
hasNext: boolean;
|
|
169
171
|
|
|
170
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Array of webhook subscription objects
|
|
174
|
+
*/
|
|
175
|
+
items: Array<SubscriptionListResponse.Item>;
|
|
171
176
|
|
|
177
|
+
/**
|
|
178
|
+
* The number of webhook subscriptions skipped
|
|
179
|
+
*/
|
|
172
180
|
skip: number;
|
|
173
181
|
}
|
|
174
182
|
|
|
175
|
-
export namespace
|
|
183
|
+
export namespace SubscriptionListResponse {
|
|
176
184
|
export interface Item {
|
|
177
|
-
|
|
178
|
-
* The unique id for the webhook subscription.
|
|
179
|
-
*/
|
|
180
|
-
id: string;
|
|
185
|
+
id: unknown;
|
|
181
186
|
|
|
182
|
-
createdAt:
|
|
187
|
+
createdAt: unknown;
|
|
183
188
|
|
|
184
189
|
events: Array<
|
|
185
190
|
| 'test'
|
|
@@ -189,6 +194,9 @@ export namespace WebhooksubscriptionListResponse {
|
|
|
189
194
|
| 'order_updated'
|
|
190
195
|
| 'refund_succeeded'
|
|
191
196
|
| 'refund_failed'
|
|
197
|
+
| 'refund.initiated'
|
|
198
|
+
| 'refund.succeeded'
|
|
199
|
+
| 'refund.failed'
|
|
192
200
|
| 'payout_report_requested'
|
|
193
201
|
| 'data_session_completed'
|
|
194
202
|
| 'checkout_session_created'
|
|
@@ -201,64 +209,73 @@ export namespace WebhooksubscriptionListResponse {
|
|
|
201
209
|
| 'mandate_setup_succeeded'
|
|
202
210
|
| 'mandate_setup_failed'
|
|
203
211
|
| 'mandate_revoked'
|
|
212
|
+
| 'user_payout.initiated'
|
|
204
213
|
| 'user_payout.failed'
|
|
205
214
|
| 'user_payout.paid'
|
|
206
|
-
| '
|
|
215
|
+
| 'payout.initiated'
|
|
216
|
+
| 'payout.failed'
|
|
217
|
+
| 'payout.paid'
|
|
218
|
+
| 'deposit.received'
|
|
219
|
+
| 'return.initiated'
|
|
220
|
+
| 'return.succeeded'
|
|
221
|
+
| 'return.failed'
|
|
222
|
+
| 'return.returned'
|
|
207
223
|
>;
|
|
208
224
|
|
|
209
|
-
|
|
210
|
-
* The unique id for the webhook subscription.
|
|
211
|
-
*/
|
|
212
|
-
merchant: string;
|
|
225
|
+
merchant: unknown;
|
|
213
226
|
|
|
214
|
-
|
|
215
|
-
* @deprecated The unique id for the webhook subscription.
|
|
216
|
-
*/
|
|
217
|
-
merchantApp: string;
|
|
227
|
+
merchantApp: unknown;
|
|
218
228
|
|
|
219
|
-
updatedAt:
|
|
229
|
+
updatedAt: unknown;
|
|
220
230
|
|
|
221
|
-
/**
|
|
222
|
-
* The url that will listen to the webhook events coming from Ivy. Must be unique
|
|
223
|
-
* for the merchant app.
|
|
224
|
-
*/
|
|
225
231
|
url: string;
|
|
226
232
|
}
|
|
227
233
|
}
|
|
228
234
|
|
|
229
|
-
export interface
|
|
235
|
+
export interface SubscriptionDeleteResponse {
|
|
236
|
+
/**
|
|
237
|
+
* Whether the webhook subscription was successfully deleted
|
|
238
|
+
*/
|
|
230
239
|
success: boolean;
|
|
231
240
|
}
|
|
232
241
|
|
|
233
|
-
export interface
|
|
242
|
+
export interface SubscriptionPingResponse {
|
|
234
243
|
/**
|
|
235
|
-
* The unique identifier of the webhook
|
|
244
|
+
* The unique identifier of the webhook subscription
|
|
236
245
|
*/
|
|
237
|
-
id:
|
|
246
|
+
id: unknown;
|
|
238
247
|
|
|
239
|
-
|
|
248
|
+
/**
|
|
249
|
+
* The timestamp when the ping was executed
|
|
250
|
+
*/
|
|
251
|
+
date: unknown;
|
|
240
252
|
|
|
241
253
|
/**
|
|
242
|
-
* The response
|
|
254
|
+
* The response from the webhook endpoint
|
|
243
255
|
*/
|
|
244
|
-
response:
|
|
256
|
+
response: unknown;
|
|
245
257
|
|
|
246
258
|
/**
|
|
247
|
-
* The status code returned by the
|
|
259
|
+
* The HTTP status code returned by the webhook endpoint
|
|
248
260
|
*/
|
|
249
261
|
statusCode: number;
|
|
250
262
|
|
|
251
263
|
/**
|
|
252
|
-
*
|
|
264
|
+
* Whether the ping was successful
|
|
253
265
|
*/
|
|
254
266
|
success: boolean;
|
|
255
267
|
}
|
|
256
268
|
|
|
257
|
-
export interface
|
|
269
|
+
export interface SubscriptionCreateParams {
|
|
270
|
+
/**
|
|
271
|
+
* The endpoint where webhook events are sent.
|
|
272
|
+
*/
|
|
273
|
+
url: string;
|
|
274
|
+
|
|
258
275
|
/**
|
|
259
276
|
* The events to subscribe the url to.
|
|
260
277
|
*/
|
|
261
|
-
events
|
|
278
|
+
events?: Array<
|
|
262
279
|
| 'test'
|
|
263
280
|
| 'merchant_updated'
|
|
264
281
|
| 'merchant_app_updated'
|
|
@@ -266,6 +283,9 @@ export interface WebhooksubscriptionCreateParams {
|
|
|
266
283
|
| 'order_updated'
|
|
267
284
|
| 'refund_succeeded'
|
|
268
285
|
| 'refund_failed'
|
|
286
|
+
| 'refund.initiated'
|
|
287
|
+
| 'refund.succeeded'
|
|
288
|
+
| 'refund.failed'
|
|
269
289
|
| 'payout_report_requested'
|
|
270
290
|
| 'data_session_completed'
|
|
271
291
|
| 'checkout_session_created'
|
|
@@ -278,20 +298,29 @@ export interface WebhooksubscriptionCreateParams {
|
|
|
278
298
|
| 'mandate_setup_succeeded'
|
|
279
299
|
| 'mandate_setup_failed'
|
|
280
300
|
| 'mandate_revoked'
|
|
301
|
+
| 'user_payout.initiated'
|
|
281
302
|
| 'user_payout.failed'
|
|
282
303
|
| 'user_payout.paid'
|
|
283
|
-
| '
|
|
304
|
+
| 'payout.initiated'
|
|
305
|
+
| 'payout.failed'
|
|
306
|
+
| 'payout.paid'
|
|
307
|
+
| 'deposit.received'
|
|
308
|
+
| 'return.initiated'
|
|
309
|
+
| 'return.succeeded'
|
|
310
|
+
| 'return.failed'
|
|
311
|
+
| 'return.returned'
|
|
284
312
|
>;
|
|
313
|
+
}
|
|
285
314
|
|
|
315
|
+
export interface SubscriptionUpdateParams {
|
|
286
316
|
/**
|
|
287
|
-
* The
|
|
317
|
+
* The unique identifier of the webhook subscription to update
|
|
288
318
|
*/
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
export interface WebhooksubscriptionUpdateParams {
|
|
293
|
-
id: string;
|
|
319
|
+
id: unknown;
|
|
294
320
|
|
|
321
|
+
/**
|
|
322
|
+
* The new events to subscribe the url to
|
|
323
|
+
*/
|
|
295
324
|
events?: Array<
|
|
296
325
|
| 'test'
|
|
297
326
|
| 'merchant_updated'
|
|
@@ -300,6 +329,9 @@ export interface WebhooksubscriptionUpdateParams {
|
|
|
300
329
|
| 'order_updated'
|
|
301
330
|
| 'refund_succeeded'
|
|
302
331
|
| 'refund_failed'
|
|
332
|
+
| 'refund.initiated'
|
|
333
|
+
| 'refund.succeeded'
|
|
334
|
+
| 'refund.failed'
|
|
303
335
|
| 'payout_report_requested'
|
|
304
336
|
| 'data_session_completed'
|
|
305
337
|
| 'checkout_session_created'
|
|
@@ -312,42 +344,62 @@ export interface WebhooksubscriptionUpdateParams {
|
|
|
312
344
|
| 'mandate_setup_succeeded'
|
|
313
345
|
| 'mandate_setup_failed'
|
|
314
346
|
| 'mandate_revoked'
|
|
347
|
+
| 'user_payout.initiated'
|
|
315
348
|
| 'user_payout.failed'
|
|
316
349
|
| 'user_payout.paid'
|
|
317
|
-
| '
|
|
350
|
+
| 'payout.initiated'
|
|
351
|
+
| 'payout.failed'
|
|
352
|
+
| 'payout.paid'
|
|
353
|
+
| 'deposit.received'
|
|
354
|
+
| 'return.initiated'
|
|
355
|
+
| 'return.succeeded'
|
|
356
|
+
| 'return.failed'
|
|
357
|
+
| 'return.returned'
|
|
318
358
|
>;
|
|
319
359
|
|
|
360
|
+
/**
|
|
361
|
+
* The new endpoint where webhook events are sent
|
|
362
|
+
*/
|
|
320
363
|
url?: string;
|
|
321
364
|
}
|
|
322
365
|
|
|
323
|
-
export interface
|
|
366
|
+
export interface SubscriptionListParams {
|
|
367
|
+
/**
|
|
368
|
+
* The maximum number of webhook subscriptions to return
|
|
369
|
+
*/
|
|
324
370
|
limit?: number;
|
|
325
371
|
|
|
372
|
+
/**
|
|
373
|
+
* The number of webhook subscriptions to skip
|
|
374
|
+
*/
|
|
326
375
|
skip?: number;
|
|
327
376
|
}
|
|
328
377
|
|
|
329
|
-
export interface
|
|
330
|
-
|
|
378
|
+
export interface SubscriptionDeleteParams {
|
|
379
|
+
/**
|
|
380
|
+
* The unique identifier of the webhook subscription to delete
|
|
381
|
+
*/
|
|
382
|
+
id: unknown;
|
|
331
383
|
}
|
|
332
384
|
|
|
333
|
-
export interface
|
|
385
|
+
export interface SubscriptionPingParams {
|
|
334
386
|
/**
|
|
335
|
-
* The unique identifier
|
|
387
|
+
* The unique identifier of the webhook subscription to ping
|
|
336
388
|
*/
|
|
337
|
-
id:
|
|
389
|
+
id: unknown;
|
|
338
390
|
}
|
|
339
391
|
|
|
340
|
-
export declare namespace
|
|
392
|
+
export declare namespace Subscription {
|
|
341
393
|
export {
|
|
342
|
-
type
|
|
343
|
-
type
|
|
344
|
-
type
|
|
345
|
-
type
|
|
346
|
-
type
|
|
347
|
-
type
|
|
348
|
-
type
|
|
349
|
-
type
|
|
350
|
-
type
|
|
351
|
-
type
|
|
394
|
+
type SubscriptionCreateResponse as SubscriptionCreateResponse,
|
|
395
|
+
type SubscriptionUpdateResponse as SubscriptionUpdateResponse,
|
|
396
|
+
type SubscriptionListResponse as SubscriptionListResponse,
|
|
397
|
+
type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
|
|
398
|
+
type SubscriptionPingResponse as SubscriptionPingResponse,
|
|
399
|
+
type SubscriptionCreateParams as SubscriptionCreateParams,
|
|
400
|
+
type SubscriptionUpdateParams as SubscriptionUpdateParams,
|
|
401
|
+
type SubscriptionListParams as SubscriptionListParams,
|
|
402
|
+
type SubscriptionDeleteParams as SubscriptionDeleteParams,
|
|
403
|
+
type SubscriptionPingParams as SubscriptionPingParams,
|
|
352
404
|
};
|
|
353
405
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import * as Core from '../../core';
|
|
5
|
+
import * as SubscriptionAPI from './subscription';
|
|
6
|
+
import {
|
|
7
|
+
Subscription,
|
|
8
|
+
SubscriptionCreateParams,
|
|
9
|
+
SubscriptionCreateResponse,
|
|
10
|
+
SubscriptionDeleteParams,
|
|
11
|
+
SubscriptionDeleteResponse,
|
|
12
|
+
SubscriptionListParams,
|
|
13
|
+
SubscriptionListResponse,
|
|
14
|
+
SubscriptionPingParams,
|
|
15
|
+
SubscriptionPingResponse,
|
|
16
|
+
SubscriptionUpdateParams,
|
|
17
|
+
SubscriptionUpdateResponse,
|
|
18
|
+
} from './subscription';
|
|
19
|
+
|
|
20
|
+
export class Webhook extends APIResource {
|
|
21
|
+
subscription: SubscriptionAPI.Subscription = new SubscriptionAPI.Subscription(this._client);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This endpoint allows you to trigger a specific webhook by its ID.
|
|
25
|
+
*/
|
|
26
|
+
trigger(
|
|
27
|
+
body: WebhookTriggerParams,
|
|
28
|
+
options?: Core.RequestOptions,
|
|
29
|
+
): Core.APIPromise<WebhookTriggerResponse> {
|
|
30
|
+
return this._client.post('/api/service/webhook/trigger', { body, ...options });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface WebhookTriggerResponse {
|
|
35
|
+
/**
|
|
36
|
+
* Indicates whether the webhook was successfully triggered
|
|
37
|
+
*/
|
|
38
|
+
success: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface WebhookTriggerParams {
|
|
42
|
+
/**
|
|
43
|
+
* The unique identifier for the webhook to trigger.
|
|
44
|
+
*/
|
|
45
|
+
id: unknown;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Webhook.Subscription = Subscription;
|
|
49
|
+
|
|
50
|
+
export declare namespace Webhook {
|
|
51
|
+
export {
|
|
52
|
+
type WebhookTriggerResponse as WebhookTriggerResponse,
|
|
53
|
+
type WebhookTriggerParams as WebhookTriggerParams,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
Subscription as Subscription,
|
|
58
|
+
type SubscriptionCreateResponse as SubscriptionCreateResponse,
|
|
59
|
+
type SubscriptionUpdateResponse as SubscriptionUpdateResponse,
|
|
60
|
+
type SubscriptionListResponse as SubscriptionListResponse,
|
|
61
|
+
type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
|
|
62
|
+
type SubscriptionPingResponse as SubscriptionPingResponse,
|
|
63
|
+
type SubscriptionCreateParams as SubscriptionCreateParams,
|
|
64
|
+
type SubscriptionUpdateParams as SubscriptionUpdateParams,
|
|
65
|
+
type SubscriptionListParams as SubscriptionListParams,
|
|
66
|
+
type SubscriptionDeleteParams as SubscriptionDeleteParams,
|
|
67
|
+
type SubscriptionPingParams as SubscriptionPingParams,
|
|
68
|
+
};
|
|
69
|
+
}
|
package/src/resources.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './resources/index';
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '
|
|
1
|
+
export const VERSION = '1.1.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "1.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/version.js
CHANGED
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '
|
|
1
|
+
export const VERSION = '1.1.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|