@augustusbank/typescript-sdk 0.20.0 → 0.22.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 +28 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account-holders.d.mts +1555 -1184
- package/resources/account-holders.d.mts.map +1 -1
- package/resources/account-holders.d.ts +1555 -1184
- package/resources/account-holders.d.ts.map +1 -1
- package/resources/account-holders.js +59 -0
- package/resources/account-holders.js.map +1 -1
- package/resources/account-holders.mjs +59 -0
- package/resources/account-holders.mjs.map +1 -1
- package/resources/account-programs.d.mts +2 -2
- package/resources/account-programs.d.ts +2 -2
- package/resources/accounts.d.mts +206 -43
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +206 -43
- package/resources/accounts.d.ts.map +1 -1
- package/resources/accounts.js +53 -0
- package/resources/accounts.js.map +1 -1
- package/resources/accounts.mjs +53 -0
- package/resources/accounts.mjs.map +1 -1
- package/resources/api-keys.d.mts +1 -1
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +1 -1
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-versions.d.mts +3 -0
- package/resources/api-versions.d.mts.map +1 -1
- package/resources/api-versions.d.ts +3 -0
- package/resources/api-versions.d.ts.map +1 -1
- package/resources/conversions.d.mts +36 -81
- package/resources/conversions.d.mts.map +1 -1
- package/resources/conversions.d.ts +36 -81
- package/resources/conversions.d.ts.map +1 -1
- package/resources/conversions.js +25 -1
- package/resources/conversions.js.map +1 -1
- package/resources/conversions.mjs +25 -1
- package/resources/conversions.mjs.map +1 -1
- package/resources/counterparties.d.mts +1042 -0
- package/resources/counterparties.d.mts.map +1 -0
- package/resources/counterparties.d.ts +1042 -0
- package/resources/counterparties.d.ts.map +1 -0
- package/resources/counterparties.js +45 -0
- package/resources/counterparties.js.map +1 -0
- package/resources/counterparties.mjs +41 -0
- package/resources/counterparties.mjs.map +1 -0
- package/resources/deposits.d.mts +38 -186
- package/resources/deposits.d.mts.map +1 -1
- package/resources/deposits.d.ts +38 -186
- package/resources/deposits.d.ts.map +1 -1
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/payouts.d.mts +458 -276
- package/resources/payouts.d.mts.map +1 -1
- package/resources/payouts.d.ts +458 -276
- package/resources/payouts.d.ts.map +1 -1
- package/resources/payouts.js +27 -0
- package/resources/payouts.js.map +1 -1
- package/resources/payouts.mjs +27 -0
- package/resources/payouts.mjs.map +1 -1
- package/resources/quotes/indicative.d.mts +7 -11
- package/resources/quotes/indicative.d.mts.map +1 -1
- package/resources/quotes/indicative.d.ts +7 -11
- package/resources/quotes/indicative.d.ts.map +1 -1
- package/resources/quotes/quotes.d.mts +4 -8
- package/resources/quotes/quotes.d.mts.map +1 -1
- package/resources/quotes/quotes.d.ts +4 -8
- package/resources/quotes/quotes.d.ts.map +1 -1
- package/resources/quotes/quotes.js.map +1 -1
- package/resources/quotes/quotes.mjs.map +1 -1
- package/resources/returns.d.mts +84 -39
- package/resources/returns.d.mts.map +1 -1
- package/resources/returns.d.ts +84 -39
- package/resources/returns.d.ts.map +1 -1
- package/resources/returns.js +22 -0
- package/resources/returns.js.map +1 -1
- package/resources/returns.mjs +22 -0
- package/resources/returns.mjs.map +1 -1
- package/resources/scopes.d.mts +4 -1
- package/resources/scopes.d.mts.map +1 -1
- package/resources/scopes.d.ts +4 -1
- package/resources/scopes.d.ts.map +1 -1
- package/resources/simulations/account-programs.d.mts +281 -0
- package/resources/simulations/account-programs.d.mts.map +1 -0
- package/resources/simulations/account-programs.d.ts +281 -0
- package/resources/simulations/account-programs.d.ts.map +1 -0
- package/resources/simulations/account-programs.js +98 -0
- package/resources/simulations/account-programs.js.map +1 -0
- package/resources/simulations/account-programs.mjs +94 -0
- package/resources/simulations/account-programs.mjs.map +1 -0
- package/resources/simulations/accounts.d.mts +270 -0
- package/resources/simulations/accounts.d.mts.map +1 -0
- package/resources/simulations/accounts.d.ts +270 -0
- package/resources/simulations/accounts.d.ts.map +1 -0
- package/resources/simulations/accounts.js +91 -0
- package/resources/simulations/accounts.js.map +1 -0
- package/resources/simulations/accounts.mjs +87 -0
- package/resources/simulations/accounts.mjs.map +1 -0
- package/resources/simulations/deposits.d.mts +218 -0
- package/resources/simulations/deposits.d.mts.map +1 -0
- package/resources/simulations/deposits.d.ts +218 -0
- package/resources/simulations/deposits.d.ts.map +1 -0
- package/resources/simulations/deposits.js +25 -0
- package/resources/simulations/deposits.js.map +1 -0
- package/resources/simulations/deposits.mjs +21 -0
- package/resources/simulations/deposits.mjs.map +1 -0
- package/resources/simulations/index.d.mts +6 -0
- package/resources/simulations/index.d.mts.map +1 -0
- package/resources/simulations/index.d.ts +6 -0
- package/resources/simulations/index.d.ts.map +1 -0
- package/resources/simulations/index.js +15 -0
- package/resources/simulations/index.js.map +1 -0
- package/resources/simulations/index.mjs +7 -0
- package/resources/simulations/index.mjs.map +1 -0
- package/resources/simulations/payouts.d.mts +76 -0
- package/resources/simulations/payouts.d.mts.map +1 -0
- package/resources/simulations/payouts.d.ts +76 -0
- package/resources/simulations/payouts.d.ts.map +1 -0
- package/resources/simulations/payouts.js +39 -0
- package/resources/simulations/payouts.js.map +1 -0
- package/resources/simulations/payouts.mjs +35 -0
- package/resources/simulations/payouts.mjs.map +1 -0
- package/resources/simulations/simulations.d.mts +22 -0
- package/resources/simulations/simulations.d.mts.map +1 -0
- package/resources/simulations/simulations.d.ts +22 -0
- package/resources/simulations/simulations.d.ts.map +1 -0
- package/resources/simulations/simulations.js +29 -0
- package/resources/simulations/simulations.js.map +1 -0
- package/resources/simulations/simulations.mjs +24 -0
- package/resources/simulations/simulations.mjs.map +1 -0
- package/resources/simulations.d.mts +2 -0
- package/resources/simulations.d.mts.map +1 -0
- package/resources/simulations.d.ts +2 -0
- package/resources/simulations.d.ts.map +1 -0
- package/resources/simulations.js +6 -0
- package/resources/simulations.js.map +1 -0
- package/resources/simulations.mjs +3 -0
- package/resources/simulations.mjs.map +1 -0
- package/resources/transactions.d.mts +300 -180
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +300 -180
- package/resources/transactions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.d.mts +54 -4
- package/resources/webhook-subscriptions.d.mts.map +1 -1
- package/resources/webhook-subscriptions.d.ts +54 -4
- package/resources/webhook-subscriptions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.js +49 -0
- package/resources/webhook-subscriptions.js.map +1 -1
- package/resources/webhook-subscriptions.mjs +49 -0
- package/resources/webhook-subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.mts +736 -953
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +736 -953
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +32 -0
- package/src/resources/account-holders.ts +1701 -1282
- package/src/resources/account-programs.ts +2 -2
- package/src/resources/accounts.ts +236 -44
- package/src/resources/api-keys.ts +3 -0
- package/src/resources/api-versions.ts +3 -0
- package/src/resources/conversions.ts +36 -93
- package/src/resources/counterparties.ts +3127 -0
- package/src/resources/deposits.ts +54 -269
- package/src/resources/index.ts +13 -0
- package/src/resources/payouts.ts +2089 -367
- package/src/resources/quotes/indicative.ts +7 -12
- package/src/resources/quotes/quotes.ts +4 -9
- package/src/resources/returns.ts +144 -40
- package/src/resources/scopes.ts +7 -1
- package/src/resources/simulations/account-programs.ts +363 -0
- package/src/resources/simulations/accounts.ts +340 -0
- package/src/resources/simulations/deposits.ts +530 -0
- package/src/resources/simulations/index.ts +32 -0
- package/src/resources/simulations/payouts.ts +98 -0
- package/src/resources/simulations/simulations.ts +82 -0
- package/src/resources/simulations.ts +3 -0
- package/src/resources/transactions.ts +910 -232
- package/src/resources/webhook-subscriptions.ts +54 -4
- package/src/resources/webhooks.ts +948 -1126
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -5,22 +5,63 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
5
5
|
export declare class WebhookSubscriptions extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Creates a new webhook subscription.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const webhookSubscription =
|
|
12
|
+
* await client.webhookSubscriptions.create({
|
|
13
|
+
* events: ['payout.paid'],
|
|
14
|
+
* url: 'https://sandbox.example.com/webhooks/augustus',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
8
17
|
*/
|
|
9
18
|
create(body: WebhookSubscriptionCreateParams, options?: RequestOptions): APIPromise<WebhookSubscriptionCreateResponse>;
|
|
10
19
|
/**
|
|
11
20
|
* Retrieves a webhook subscription by ID.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const webhookSubscription =
|
|
25
|
+
* await client.webhookSubscriptions.retrieve(
|
|
26
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
12
29
|
*/
|
|
13
30
|
retrieve(id: string, options?: RequestOptions): APIPromise<WebhookSubscriptionRetrieveResponse>;
|
|
14
31
|
/**
|
|
15
32
|
* Updates the URL and/or subscribed events.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const webhookSubscription =
|
|
37
|
+
* await client.webhookSubscriptions.update(
|
|
38
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
16
41
|
*/
|
|
17
42
|
update(id: string, body: WebhookSubscriptionUpdateParams, options?: RequestOptions): APIPromise<WebhookSubscriptionUpdateResponse>;
|
|
18
43
|
/**
|
|
19
44
|
* Lists webhook subscriptions for the merchant with cursor-based pagination.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* // Automatically fetches more pages as needed.
|
|
49
|
+
* for await (const webhookSubscriptionListResponse of client.webhookSubscriptions.list()) {
|
|
50
|
+
* // ...
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
20
53
|
*/
|
|
21
54
|
list(query?: WebhookSubscriptionListParams | null | undefined, options?: RequestOptions): PagePromise<WebhookSubscriptionListResponsesCursorPage, WebhookSubscriptionListResponse>;
|
|
22
55
|
/**
|
|
23
56
|
* Permanently deletes a webhook subscription. This cannot be undone.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const webhookSubscription =
|
|
61
|
+
* await client.webhookSubscriptions.delete(
|
|
62
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
24
65
|
*/
|
|
25
66
|
delete(id: string, options?: RequestOptions): APIPromise<WebhookSubscriptionDeleteResponse>;
|
|
26
67
|
/**
|
|
@@ -29,6 +70,14 @@ export declare class WebhookSubscriptions extends APIResource {
|
|
|
29
70
|
* and signature verification in any environment without creating a real business
|
|
30
71
|
* event. Test-event failures do not affect the subscription's health counters or
|
|
31
72
|
* trigger failure-notification emails.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const response =
|
|
77
|
+
* await client.webhookSubscriptions.sendTestEvent(
|
|
78
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
32
81
|
*/
|
|
33
82
|
sendTestEvent(id: string, options?: RequestOptions): APIPromise<WebhookSubscriptionSendTestEventResponse>;
|
|
34
83
|
}
|
|
@@ -205,13 +254,14 @@ export interface WebhookSubscriptionCreateParams {
|
|
|
205
254
|
}
|
|
206
255
|
export interface WebhookSubscriptionUpdateParams {
|
|
207
256
|
/**
|
|
208
|
-
*
|
|
257
|
+
* New event types. Omit or send null to keep the current events. Use ["*"] for all
|
|
258
|
+
* events.
|
|
209
259
|
*/
|
|
210
|
-
events?: Array<'payout.created' | 'payout.initiated' | 'payout.paid' | 'payout.failed' | 'return.initiated' | 'return.paid' | 'return.failed' | 'return.returned' | 'deposit.received' | 'conversion.created' | 'conversion.completed' | 'conversion.failed' | 'account_holder.active' | 'account_holder.closed' | '*'
|
|
260
|
+
events?: Array<'payout.created' | 'payout.initiated' | 'payout.paid' | 'payout.failed' | 'return.initiated' | 'return.paid' | 'return.failed' | 'return.returned' | 'deposit.received' | 'conversion.created' | 'conversion.completed' | 'conversion.failed' | 'account_holder.active' | 'account_holder.closed' | '*'> | null;
|
|
211
261
|
/**
|
|
212
|
-
* The HTTPS URL
|
|
262
|
+
* The new HTTPS URL. Omit or send null to keep the current URL.
|
|
213
263
|
*/
|
|
214
|
-
url?: string;
|
|
264
|
+
url?: string | null;
|
|
215
265
|
}
|
|
216
266
|
export interface WebhookSubscriptionListParams extends CursorPageParams {
|
|
217
267
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-subscriptions.d.mts","sourceRoot":"","sources":["../src/resources/webhook-subscriptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,+BAA2B;AACpF,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,oBAAqB,SAAQ,WAAW;IACnD
|
|
1
|
+
{"version":3,"file":"webhook-subscriptions.d.mts","sourceRoot":"","sources":["../src/resources/webhook-subscriptions.ts"],"names":[],"mappings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AC3E,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,wCAAwC,IAAI,wCAAwC,EACzF,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
|
|
@@ -5,22 +5,63 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
5
5
|
export declare class WebhookSubscriptions extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Creates a new webhook subscription.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const webhookSubscription =
|
|
12
|
+
* await client.webhookSubscriptions.create({
|
|
13
|
+
* events: ['payout.paid'],
|
|
14
|
+
* url: 'https://sandbox.example.com/webhooks/augustus',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
8
17
|
*/
|
|
9
18
|
create(body: WebhookSubscriptionCreateParams, options?: RequestOptions): APIPromise<WebhookSubscriptionCreateResponse>;
|
|
10
19
|
/**
|
|
11
20
|
* Retrieves a webhook subscription by ID.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const webhookSubscription =
|
|
25
|
+
* await client.webhookSubscriptions.retrieve(
|
|
26
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
12
29
|
*/
|
|
13
30
|
retrieve(id: string, options?: RequestOptions): APIPromise<WebhookSubscriptionRetrieveResponse>;
|
|
14
31
|
/**
|
|
15
32
|
* Updates the URL and/or subscribed events.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const webhookSubscription =
|
|
37
|
+
* await client.webhookSubscriptions.update(
|
|
38
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
16
41
|
*/
|
|
17
42
|
update(id: string, body: WebhookSubscriptionUpdateParams, options?: RequestOptions): APIPromise<WebhookSubscriptionUpdateResponse>;
|
|
18
43
|
/**
|
|
19
44
|
* Lists webhook subscriptions for the merchant with cursor-based pagination.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* // Automatically fetches more pages as needed.
|
|
49
|
+
* for await (const webhookSubscriptionListResponse of client.webhookSubscriptions.list()) {
|
|
50
|
+
* // ...
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
20
53
|
*/
|
|
21
54
|
list(query?: WebhookSubscriptionListParams | null | undefined, options?: RequestOptions): PagePromise<WebhookSubscriptionListResponsesCursorPage, WebhookSubscriptionListResponse>;
|
|
22
55
|
/**
|
|
23
56
|
* Permanently deletes a webhook subscription. This cannot be undone.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const webhookSubscription =
|
|
61
|
+
* await client.webhookSubscriptions.delete(
|
|
62
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
24
65
|
*/
|
|
25
66
|
delete(id: string, options?: RequestOptions): APIPromise<WebhookSubscriptionDeleteResponse>;
|
|
26
67
|
/**
|
|
@@ -29,6 +70,14 @@ export declare class WebhookSubscriptions extends APIResource {
|
|
|
29
70
|
* and signature verification in any environment without creating a real business
|
|
30
71
|
* event. Test-event failures do not affect the subscription's health counters or
|
|
31
72
|
* trigger failure-notification emails.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const response =
|
|
77
|
+
* await client.webhookSubscriptions.sendTestEvent(
|
|
78
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
32
81
|
*/
|
|
33
82
|
sendTestEvent(id: string, options?: RequestOptions): APIPromise<WebhookSubscriptionSendTestEventResponse>;
|
|
34
83
|
}
|
|
@@ -205,13 +254,14 @@ export interface WebhookSubscriptionCreateParams {
|
|
|
205
254
|
}
|
|
206
255
|
export interface WebhookSubscriptionUpdateParams {
|
|
207
256
|
/**
|
|
208
|
-
*
|
|
257
|
+
* New event types. Omit or send null to keep the current events. Use ["*"] for all
|
|
258
|
+
* events.
|
|
209
259
|
*/
|
|
210
|
-
events?: Array<'payout.created' | 'payout.initiated' | 'payout.paid' | 'payout.failed' | 'return.initiated' | 'return.paid' | 'return.failed' | 'return.returned' | 'deposit.received' | 'conversion.created' | 'conversion.completed' | 'conversion.failed' | 'account_holder.active' | 'account_holder.closed' | '*'
|
|
260
|
+
events?: Array<'payout.created' | 'payout.initiated' | 'payout.paid' | 'payout.failed' | 'return.initiated' | 'return.paid' | 'return.failed' | 'return.returned' | 'deposit.received' | 'conversion.created' | 'conversion.completed' | 'conversion.failed' | 'account_holder.active' | 'account_holder.closed' | '*'> | null;
|
|
211
261
|
/**
|
|
212
|
-
* The HTTPS URL
|
|
262
|
+
* The new HTTPS URL. Omit or send null to keep the current URL.
|
|
213
263
|
*/
|
|
214
|
-
url?: string;
|
|
264
|
+
url?: string | null;
|
|
215
265
|
}
|
|
216
266
|
export interface WebhookSubscriptionListParams extends CursorPageParams {
|
|
217
267
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-subscriptions.d.ts","sourceRoot":"","sources":["../src/resources/webhook-subscriptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,8BAA2B;AACpF,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,oBAAqB,SAAQ,WAAW;IACnD
|
|
1
|
+
{"version":3,"file":"webhook-subscriptions.d.ts","sourceRoot":"","sources":["../src/resources/web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K,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,wCAAwC,IAAI,wCAAwC,EACzF,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
|
|
@@ -8,24 +8,57 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
8
8
|
class WebhookSubscriptions extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Creates a new webhook subscription.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const webhookSubscription =
|
|
15
|
+
* await client.webhookSubscriptions.create({
|
|
16
|
+
* events: ['payout.paid'],
|
|
17
|
+
* url: 'https://sandbox.example.com/webhooks/augustus',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
11
20
|
*/
|
|
12
21
|
create(body, options) {
|
|
13
22
|
return this._client.post('/v1/webhook_subscriptions', { body, ...options });
|
|
14
23
|
}
|
|
15
24
|
/**
|
|
16
25
|
* Retrieves a webhook subscription by ID.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const webhookSubscription =
|
|
30
|
+
* await client.webhookSubscriptions.retrieve(
|
|
31
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
17
34
|
*/
|
|
18
35
|
retrieve(id, options) {
|
|
19
36
|
return this._client.get((0, path_1.path) `/v1/webhook_subscriptions/${id}`, options);
|
|
20
37
|
}
|
|
21
38
|
/**
|
|
22
39
|
* Updates the URL and/or subscribed events.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const webhookSubscription =
|
|
44
|
+
* await client.webhookSubscriptions.update(
|
|
45
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
46
|
+
* );
|
|
47
|
+
* ```
|
|
23
48
|
*/
|
|
24
49
|
update(id, body, options) {
|
|
25
50
|
return this._client.post((0, path_1.path) `/v1/webhook_subscriptions/${id}`, { body, ...options });
|
|
26
51
|
}
|
|
27
52
|
/**
|
|
28
53
|
* Lists webhook subscriptions for the merchant with cursor-based pagination.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* // Automatically fetches more pages as needed.
|
|
58
|
+
* for await (const webhookSubscriptionListResponse of client.webhookSubscriptions.list()) {
|
|
59
|
+
* // ...
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
29
62
|
*/
|
|
30
63
|
list(query = {}, options) {
|
|
31
64
|
return this._client.getAPIList('/v1/webhook_subscriptions', (pagination_1.CursorPage), {
|
|
@@ -35,6 +68,14 @@ class WebhookSubscriptions extends resource_1.APIResource {
|
|
|
35
68
|
}
|
|
36
69
|
/**
|
|
37
70
|
* Permanently deletes a webhook subscription. This cannot be undone.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const webhookSubscription =
|
|
75
|
+
* await client.webhookSubscriptions.delete(
|
|
76
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
38
79
|
*/
|
|
39
80
|
delete(id, options) {
|
|
40
81
|
return this._client.delete((0, path_1.path) `/v1/webhook_subscriptions/${id}`, options);
|
|
@@ -45,6 +86,14 @@ class WebhookSubscriptions extends resource_1.APIResource {
|
|
|
45
86
|
* and signature verification in any environment without creating a real business
|
|
46
87
|
* event. Test-event failures do not affect the subscription's health counters or
|
|
47
88
|
* trigger failure-notification emails.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const response =
|
|
93
|
+
* await client.webhookSubscriptions.sendTestEvent(
|
|
94
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
95
|
+
* );
|
|
96
|
+
* ```
|
|
48
97
|
*/
|
|
49
98
|
sendTestEvent(id, options) {
|
|
50
99
|
return this._client.post((0, path_1.path) `/v1/webhook_subscriptions/${id}/send_test_event`, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-subscriptions.js","sourceRoot":"","sources":["../src/resources/webhook-subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,oBAAqB,SAAQ,sBAAW;IACnD
|
|
1
|
+
{"version":3,"file":"webhook-subscriptions.js","sourceRoot":"","sources":["../src/resources/webhook-subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,oBAAqB,SAAQ,sBAAW;IACnD;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,6BAA6B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,EAAU,EACV,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,6BAA6B,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,2BAA2B,EAAE,CAAA,uBAA2C,CAAA,EAAE;YACvG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,6BAA6B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAU,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,6BAA6B,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;CACF;AA5GD,oDA4GC"}
|
|
@@ -5,24 +5,57 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
5
5
|
export class WebhookSubscriptions extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Creates a new webhook subscription.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const webhookSubscription =
|
|
12
|
+
* await client.webhookSubscriptions.create({
|
|
13
|
+
* events: ['payout.paid'],
|
|
14
|
+
* url: 'https://sandbox.example.com/webhooks/augustus',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
8
17
|
*/
|
|
9
18
|
create(body, options) {
|
|
10
19
|
return this._client.post('/v1/webhook_subscriptions', { body, ...options });
|
|
11
20
|
}
|
|
12
21
|
/**
|
|
13
22
|
* Retrieves a webhook subscription by ID.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const webhookSubscription =
|
|
27
|
+
* await client.webhookSubscriptions.retrieve(
|
|
28
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
14
31
|
*/
|
|
15
32
|
retrieve(id, options) {
|
|
16
33
|
return this._client.get(path `/v1/webhook_subscriptions/${id}`, options);
|
|
17
34
|
}
|
|
18
35
|
/**
|
|
19
36
|
* Updates the URL and/or subscribed events.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const webhookSubscription =
|
|
41
|
+
* await client.webhookSubscriptions.update(
|
|
42
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
20
45
|
*/
|
|
21
46
|
update(id, body, options) {
|
|
22
47
|
return this._client.post(path `/v1/webhook_subscriptions/${id}`, { body, ...options });
|
|
23
48
|
}
|
|
24
49
|
/**
|
|
25
50
|
* Lists webhook subscriptions for the merchant with cursor-based pagination.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* // Automatically fetches more pages as needed.
|
|
55
|
+
* for await (const webhookSubscriptionListResponse of client.webhookSubscriptions.list()) {
|
|
56
|
+
* // ...
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
26
59
|
*/
|
|
27
60
|
list(query = {}, options) {
|
|
28
61
|
return this._client.getAPIList('/v1/webhook_subscriptions', (CursorPage), {
|
|
@@ -32,6 +65,14 @@ export class WebhookSubscriptions extends APIResource {
|
|
|
32
65
|
}
|
|
33
66
|
/**
|
|
34
67
|
* Permanently deletes a webhook subscription. This cannot be undone.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const webhookSubscription =
|
|
72
|
+
* await client.webhookSubscriptions.delete(
|
|
73
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
74
|
+
* );
|
|
75
|
+
* ```
|
|
35
76
|
*/
|
|
36
77
|
delete(id, options) {
|
|
37
78
|
return this._client.delete(path `/v1/webhook_subscriptions/${id}`, options);
|
|
@@ -42,6 +83,14 @@ export class WebhookSubscriptions extends APIResource {
|
|
|
42
83
|
* and signature verification in any environment without creating a real business
|
|
43
84
|
* event. Test-event failures do not affect the subscription's health counters or
|
|
44
85
|
* trigger failure-notification emails.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const response =
|
|
90
|
+
* await client.webhookSubscriptions.sendTestEvent(
|
|
91
|
+
* '550e8400-e29b-41d4-a716-446655440009',
|
|
92
|
+
* );
|
|
93
|
+
* ```
|
|
45
94
|
*/
|
|
46
95
|
sendTestEvent(id, options) {
|
|
47
96
|
return this._client.post(path `/v1/webhook_subscriptions/${id}/send_test_event`, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-subscriptions.mjs","sourceRoot":"","sources":["../src/resources/webhook-subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,UAAU,EAAsC,+BAA2B;AAEpF,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACnD
|
|
1
|
+
{"version":3,"file":"webhook-subscriptions.mjs","sourceRoot":"","sources":["../src/resources/webhook-subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,UAAU,EAAsC,+BAA2B;AAEpF,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACnD;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,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