@avalabs/glacier-sdk 2.8.0-canary.69c602c.0 → 2.8.0-canary.6a1af3d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +278 -169
- package/dist/index.js +189 -114
- package/esm/generated/Glacier.d.ts +4 -0
- package/esm/generated/Glacier.js +6 -0
- package/esm/generated/core/CancelablePromise.d.ts +2 -8
- package/esm/generated/core/CancelablePromise.js +38 -36
- package/esm/generated/core/request.js +3 -2
- package/esm/generated/models/AddressActivityMetadata.d.ts +2 -6
- package/esm/generated/models/AddressesChangeRequest.d.ts +8 -0
- package/esm/generated/models/ChainInfo.d.ts +1 -0
- package/esm/generated/models/GetChainResponse.d.ts +1 -0
- package/esm/generated/models/GlacierApiFeature.d.ts +6 -0
- package/esm/generated/models/GlacierApiFeature.js +7 -0
- package/esm/generated/models/ListTeleporterMessagesResponse.d.ts +12 -0
- package/esm/generated/models/PrimaryNetworkOptions.d.ts +1 -1
- package/esm/generated/models/RegisterWebhookRequest.d.ts +8 -0
- package/esm/generated/models/RpcErrorDto.d.ts +7 -0
- package/esm/generated/models/RpcErrorResponseDto.d.ts +9 -0
- package/esm/generated/models/RpcRequestBodyDto.d.ts +8 -0
- package/esm/generated/models/RpcSuccessResponseDto.d.ts +7 -0
- package/esm/generated/models/UpdateWebhookRequest.d.ts +2 -1
- package/esm/generated/models/WebhookResponse.d.ts +8 -0
- package/esm/generated/services/DefaultService.d.ts +0 -86
- package/esm/generated/services/DefaultService.js +0 -73
- package/esm/generated/services/EvmChainsService.d.ts +6 -1
- package/esm/generated/services/EvmChainsService.js +4 -2
- package/esm/generated/services/PrimaryNetworkService.d.ts +1 -1
- package/esm/generated/services/PrimaryNetworkService.js +1 -1
- package/esm/generated/services/RpcService.d.ts +25 -0
- package/esm/generated/services/RpcService.js +24 -0
- package/esm/generated/services/TeleporterService.d.ts +3 -3
- package/esm/generated/services/WebhooksService.d.ts +122 -0
- package/esm/generated/services/WebhooksService.js +108 -0
- package/esm/index.d.ts +9 -0
- package/esm/index.js +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeliveredTeleporterMessage } from './DeliveredTeleporterMessage.js';
|
|
2
|
+
import { PendingTeleporterMessage } from './PendingTeleporterMessage.js';
|
|
3
|
+
|
|
4
|
+
type ListTeleporterMessagesResponse = {
|
|
5
|
+
/**
|
|
6
|
+
* A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
|
|
7
|
+
*/
|
|
8
|
+
nextPageToken?: string;
|
|
9
|
+
messages: Array<(PendingTeleporterMessage | DeliveredTeleporterMessage)>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { ListTeleporterMessagesResponse };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type PrimaryNetworkOptions = {
|
|
2
|
-
addresses
|
|
2
|
+
addresses?: Array<string>;
|
|
3
3
|
cChainEvmAddresses?: Array<string>;
|
|
4
4
|
includeChains: Array<'11111111111111111111111111111111LpoYY' | '2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM' | '2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm' | '2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5' | 'yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp' | 'p-chain' | 'x-chain' | 'c-chain'>;
|
|
5
5
|
};
|
|
@@ -6,6 +6,14 @@ type RegisterWebhookRequest = {
|
|
|
6
6
|
chainId: string;
|
|
7
7
|
eventType: EventType;
|
|
8
8
|
metadata: AddressActivityMetadata;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to include traces in the webhook payload.
|
|
11
|
+
*/
|
|
12
|
+
includeInternalTxs?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to include logs in the webhook payload.
|
|
15
|
+
*/
|
|
16
|
+
includeLogs?: boolean;
|
|
9
17
|
};
|
|
10
18
|
|
|
11
19
|
export { RegisterWebhookRequest };
|
|
@@ -6,6 +6,14 @@ type WebhookResponse = {
|
|
|
6
6
|
id: string;
|
|
7
7
|
eventType: EventType;
|
|
8
8
|
metadata: AddressActivityMetadata;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to include traces in the webhook payload.
|
|
11
|
+
*/
|
|
12
|
+
includeInternalTxs?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to include logs in the webhook payload.
|
|
15
|
+
*/
|
|
16
|
+
includeLogs?: boolean;
|
|
9
17
|
url: string;
|
|
10
18
|
chainId: string;
|
|
11
19
|
status: WebhookStatusType;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { ListWebhooksResponse } from '../models/ListWebhooksResponse.js';
|
|
2
|
-
import { RegisterWebhookRequest } from '../models/RegisterWebhookRequest.js';
|
|
3
|
-
import { SharedSecretsResponse } from '../models/SharedSecretsResponse.js';
|
|
4
|
-
import { UpdateWebhookRequest } from '../models/UpdateWebhookRequest.js';
|
|
5
|
-
import { WebhookResponse } from '../models/WebhookResponse.js';
|
|
6
|
-
import { WebhookStatus } from '../models/WebhookStatus.js';
|
|
7
1
|
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
8
2
|
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
9
3
|
|
|
@@ -15,86 +9,6 @@ declare class DefaultService {
|
|
|
15
9
|
* @throws ApiError
|
|
16
10
|
*/
|
|
17
11
|
mediaControllerUploadImage(): CancelablePromise<any>;
|
|
18
|
-
/**
|
|
19
|
-
* Register a webhook
|
|
20
|
-
* Registers a new webhook.
|
|
21
|
-
* @returns WebhookResponse
|
|
22
|
-
* @throws ApiError
|
|
23
|
-
*/
|
|
24
|
-
registerWebhook({ requestBody, }: {
|
|
25
|
-
requestBody: RegisterWebhookRequest;
|
|
26
|
-
}): CancelablePromise<WebhookResponse>;
|
|
27
|
-
/**
|
|
28
|
-
* List webhooks
|
|
29
|
-
* Lists webhooks for the user.
|
|
30
|
-
* @returns ListWebhooksResponse
|
|
31
|
-
* @throws ApiError
|
|
32
|
-
*/
|
|
33
|
-
listWebhooks({ pageToken, pageSize, status, }: {
|
|
34
|
-
/**
|
|
35
|
-
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
36
|
-
*/
|
|
37
|
-
pageToken?: string;
|
|
38
|
-
/**
|
|
39
|
-
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
40
|
-
*/
|
|
41
|
-
pageSize?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned.
|
|
44
|
-
*/
|
|
45
|
-
status?: WebhookStatus;
|
|
46
|
-
}): CancelablePromise<ListWebhooksResponse>;
|
|
47
|
-
/**
|
|
48
|
-
* Get a webhook by ID
|
|
49
|
-
* Retrieves a webhook by ID.
|
|
50
|
-
* @returns WebhookResponse
|
|
51
|
-
* @throws ApiError
|
|
52
|
-
*/
|
|
53
|
-
getWebhook({ id, }: {
|
|
54
|
-
/**
|
|
55
|
-
* The webhook identifier.
|
|
56
|
-
*/
|
|
57
|
-
id: string;
|
|
58
|
-
}): CancelablePromise<WebhookResponse>;
|
|
59
|
-
/**
|
|
60
|
-
* Deactivate a webhook
|
|
61
|
-
* Deactivates a webhook by ID.
|
|
62
|
-
* @returns WebhookResponse
|
|
63
|
-
* @throws ApiError
|
|
64
|
-
*/
|
|
65
|
-
deactivateWebhook({ id, }: {
|
|
66
|
-
/**
|
|
67
|
-
* The webhook identifier.
|
|
68
|
-
*/
|
|
69
|
-
id: string;
|
|
70
|
-
}): CancelablePromise<WebhookResponse>;
|
|
71
|
-
/**
|
|
72
|
-
* Update a webhook
|
|
73
|
-
* Updates an existing webhook.
|
|
74
|
-
* @returns WebhookResponse
|
|
75
|
-
* @throws ApiError
|
|
76
|
-
*/
|
|
77
|
-
updateWebhook({ id, requestBody, }: {
|
|
78
|
-
/**
|
|
79
|
-
* The webhook identifier.
|
|
80
|
-
*/
|
|
81
|
-
id: string;
|
|
82
|
-
requestBody: UpdateWebhookRequest;
|
|
83
|
-
}): CancelablePromise<WebhookResponse>;
|
|
84
|
-
/**
|
|
85
|
-
* Generate a shared secret
|
|
86
|
-
* Generates a new shared secret.
|
|
87
|
-
* @returns SharedSecretsResponse
|
|
88
|
-
* @throws ApiError
|
|
89
|
-
*/
|
|
90
|
-
generateSharedSecret(): CancelablePromise<SharedSecretsResponse>;
|
|
91
|
-
/**
|
|
92
|
-
* Get a shared secret
|
|
93
|
-
* Get a previously generated shared secret.
|
|
94
|
-
* @returns SharedSecretsResponse
|
|
95
|
-
* @throws ApiError
|
|
96
|
-
*/
|
|
97
|
-
getSharedSecret(): CancelablePromise<SharedSecretsResponse>;
|
|
98
12
|
}
|
|
99
13
|
|
|
100
14
|
export { DefaultService };
|
|
@@ -8,79 +8,6 @@ class DefaultService {
|
|
|
8
8
|
url: "/v1/media/uploadImage"
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
registerWebhook({
|
|
12
|
-
requestBody
|
|
13
|
-
}) {
|
|
14
|
-
return this.httpRequest.request({
|
|
15
|
-
method: "POST",
|
|
16
|
-
url: "/v1/webhooks",
|
|
17
|
-
body: requestBody,
|
|
18
|
-
mediaType: "application/json"
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
listWebhooks({
|
|
22
|
-
pageToken,
|
|
23
|
-
pageSize = 10,
|
|
24
|
-
status
|
|
25
|
-
}) {
|
|
26
|
-
return this.httpRequest.request({
|
|
27
|
-
method: "GET",
|
|
28
|
-
url: "/v1/webhooks",
|
|
29
|
-
query: {
|
|
30
|
-
"pageToken": pageToken,
|
|
31
|
-
"pageSize": pageSize,
|
|
32
|
-
"status": status
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
getWebhook({
|
|
37
|
-
id
|
|
38
|
-
}) {
|
|
39
|
-
return this.httpRequest.request({
|
|
40
|
-
method: "GET",
|
|
41
|
-
url: "/v1/webhooks/{id}",
|
|
42
|
-
path: {
|
|
43
|
-
"id": id
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
deactivateWebhook({
|
|
48
|
-
id
|
|
49
|
-
}) {
|
|
50
|
-
return this.httpRequest.request({
|
|
51
|
-
method: "DELETE",
|
|
52
|
-
url: "/v1/webhooks/{id}",
|
|
53
|
-
path: {
|
|
54
|
-
"id": id
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
updateWebhook({
|
|
59
|
-
id,
|
|
60
|
-
requestBody
|
|
61
|
-
}) {
|
|
62
|
-
return this.httpRequest.request({
|
|
63
|
-
method: "PATCH",
|
|
64
|
-
url: "/v1/webhooks/{id}",
|
|
65
|
-
path: {
|
|
66
|
-
"id": id
|
|
67
|
-
},
|
|
68
|
-
body: requestBody,
|
|
69
|
-
mediaType: "application/json"
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
generateSharedSecret() {
|
|
73
|
-
return this.httpRequest.request({
|
|
74
|
-
method: "POST",
|
|
75
|
-
url: "/v1/webhooks:generateOrRotateSharedSecret"
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
getSharedSecret() {
|
|
79
|
-
return this.httpRequest.request({
|
|
80
|
-
method: "GET",
|
|
81
|
-
url: "/v1/webhooks:getSharedSecret"
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
11
|
}
|
|
85
12
|
|
|
86
13
|
export { DefaultService };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GetChainResponse } from '../models/GetChainResponse.js';
|
|
2
|
+
import { GlacierApiFeature } from '../models/GlacierApiFeature.js';
|
|
2
3
|
import { ListChainsResponse } from '../models/ListChainsResponse.js';
|
|
3
4
|
import { NetworkType } from '../models/NetworkType.js';
|
|
4
5
|
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
@@ -13,11 +14,15 @@ declare class EvmChainsService {
|
|
|
13
14
|
* @returns ListChainsResponse
|
|
14
15
|
* @throws ApiError
|
|
15
16
|
*/
|
|
16
|
-
supportedChains({ network, }: {
|
|
17
|
+
supportedChains({ network, feature, }: {
|
|
17
18
|
/**
|
|
18
19
|
* mainnet or testnet.
|
|
19
20
|
*/
|
|
20
21
|
network?: NetworkType;
|
|
22
|
+
/**
|
|
23
|
+
* Filter by feature.
|
|
24
|
+
*/
|
|
25
|
+
feature?: GlacierApiFeature;
|
|
21
26
|
}): CancelablePromise<ListChainsResponse>;
|
|
22
27
|
/**
|
|
23
28
|
* Get chain information
|
|
@@ -3,13 +3,15 @@ class EvmChainsService {
|
|
|
3
3
|
this.httpRequest = httpRequest;
|
|
4
4
|
}
|
|
5
5
|
supportedChains({
|
|
6
|
-
network
|
|
6
|
+
network,
|
|
7
|
+
feature
|
|
7
8
|
}) {
|
|
8
9
|
return this.httpRequest.request({
|
|
9
10
|
method: "GET",
|
|
10
11
|
url: "/v1/chains",
|
|
11
12
|
query: {
|
|
12
|
-
"network": network
|
|
13
|
+
"network": network,
|
|
14
|
+
"feature": feature
|
|
13
15
|
}
|
|
14
16
|
});
|
|
15
17
|
}
|
|
@@ -170,7 +170,7 @@ declare class PrimaryNetworkService {
|
|
|
170
170
|
/**
|
|
171
171
|
* The subnet ID to filter by. If not provided, then all subnets will be returned.
|
|
172
172
|
*/
|
|
173
|
-
subnetId?:
|
|
173
|
+
subnetId?: any;
|
|
174
174
|
}): CancelablePromise<ListValidatorDetailsResponse>;
|
|
175
175
|
/**
|
|
176
176
|
* Get single validator details
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RpcErrorResponseDto } from '../models/RpcErrorResponseDto.js';
|
|
2
|
+
import { RpcRequestBodyDto } from '../models/RpcRequestBodyDto.js';
|
|
3
|
+
import { RpcSuccessResponseDto } from '../models/RpcSuccessResponseDto.js';
|
|
4
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
5
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
6
|
+
|
|
7
|
+
declare class RpcService {
|
|
8
|
+
readonly httpRequest: BaseHttpRequest;
|
|
9
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
10
|
+
/**
|
|
11
|
+
* Calls JSON-RPC method
|
|
12
|
+
* Calls JSON-RPC method.
|
|
13
|
+
* @returns any
|
|
14
|
+
* @throws ApiError
|
|
15
|
+
*/
|
|
16
|
+
rpc({ chainId, requestBody, }: {
|
|
17
|
+
/**
|
|
18
|
+
* A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
19
|
+
*/
|
|
20
|
+
chainId: string;
|
|
21
|
+
requestBody: (RpcRequestBodyDto | Array<RpcRequestBodyDto>);
|
|
22
|
+
}): CancelablePromise<(RpcSuccessResponseDto | RpcErrorResponseDto)>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { RpcService };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
class RpcService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
rpc({
|
|
6
|
+
chainId,
|
|
7
|
+
requestBody
|
|
8
|
+
}) {
|
|
9
|
+
return this.httpRequest.request({
|
|
10
|
+
method: "POST",
|
|
11
|
+
url: "/v1/ext/bc/{chainId}/rpc",
|
|
12
|
+
path: {
|
|
13
|
+
"chainId": chainId
|
|
14
|
+
},
|
|
15
|
+
body: requestBody,
|
|
16
|
+
mediaType: "application/json",
|
|
17
|
+
errors: {
|
|
18
|
+
504: `Request timed out`
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { RpcService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeliveredSourceNotIndexedTeleporterMessage } from '../models/DeliveredSourceNotIndexedTeleporterMessage.js';
|
|
2
2
|
import { DeliveredTeleporterMessage } from '../models/DeliveredTeleporterMessage.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ListTeleporterMessagesResponse } from '../models/ListTeleporterMessagesResponse.js';
|
|
4
4
|
import { PendingTeleporterMessage } from '../models/PendingTeleporterMessage.js';
|
|
5
5
|
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
6
6
|
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
@@ -23,7 +23,7 @@ declare class TeleporterService {
|
|
|
23
23
|
/**
|
|
24
24
|
* List teleporter messages
|
|
25
25
|
* Lists teleporter messages. Ordered by timestamp in descending order.
|
|
26
|
-
* @returns
|
|
26
|
+
* @returns ListTeleporterMessagesResponse
|
|
27
27
|
* @throws ApiError
|
|
28
28
|
*/
|
|
29
29
|
listTeleporterMessages({ pageToken, pageSize, sourceBlockchainId, destinationBlockchainId, to, from, }: {
|
|
@@ -51,7 +51,7 @@ declare class TeleporterService {
|
|
|
51
51
|
* The address of the sender of the teleporter message.
|
|
52
52
|
*/
|
|
53
53
|
from?: string;
|
|
54
|
-
}): CancelablePromise<
|
|
54
|
+
}): CancelablePromise<ListTeleporterMessagesResponse>;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export { TeleporterService };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { AddressesChangeRequest } from '../models/AddressesChangeRequest.js';
|
|
2
|
+
import { ListWebhooksResponse } from '../models/ListWebhooksResponse.js';
|
|
3
|
+
import { RegisterWebhookRequest } from '../models/RegisterWebhookRequest.js';
|
|
4
|
+
import { SharedSecretsResponse } from '../models/SharedSecretsResponse.js';
|
|
5
|
+
import { UpdateWebhookRequest } from '../models/UpdateWebhookRequest.js';
|
|
6
|
+
import { WebhookResponse } from '../models/WebhookResponse.js';
|
|
7
|
+
import { WebhookStatus } from '../models/WebhookStatus.js';
|
|
8
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
9
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
10
|
+
|
|
11
|
+
declare class WebhooksService {
|
|
12
|
+
readonly httpRequest: BaseHttpRequest;
|
|
13
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
14
|
+
/**
|
|
15
|
+
* Create a webhook
|
|
16
|
+
* Create a new webhook.
|
|
17
|
+
* @returns WebhookResponse
|
|
18
|
+
* @throws ApiError
|
|
19
|
+
*/
|
|
20
|
+
registerWebhook({ requestBody, }: {
|
|
21
|
+
requestBody: RegisterWebhookRequest;
|
|
22
|
+
}): CancelablePromise<WebhookResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* List webhooks
|
|
25
|
+
* Lists webhooks for the user.
|
|
26
|
+
* @returns ListWebhooksResponse
|
|
27
|
+
* @throws ApiError
|
|
28
|
+
*/
|
|
29
|
+
listWebhooks({ pageToken, pageSize, status, }: {
|
|
30
|
+
/**
|
|
31
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
32
|
+
*/
|
|
33
|
+
pageToken?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
36
|
+
*/
|
|
37
|
+
pageSize?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned.
|
|
40
|
+
*/
|
|
41
|
+
status?: WebhookStatus;
|
|
42
|
+
}): CancelablePromise<ListWebhooksResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Get a webhook by ID
|
|
45
|
+
* Retrieves a webhook by ID.
|
|
46
|
+
* @returns WebhookResponse
|
|
47
|
+
* @throws ApiError
|
|
48
|
+
*/
|
|
49
|
+
getWebhook({ id, }: {
|
|
50
|
+
/**
|
|
51
|
+
* The webhook identifier.
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
}): CancelablePromise<WebhookResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Deactivate a webhook
|
|
57
|
+
* Deactivates a webhook by ID.
|
|
58
|
+
* @returns WebhookResponse
|
|
59
|
+
* @throws ApiError
|
|
60
|
+
*/
|
|
61
|
+
deactivateWebhook({ id, }: {
|
|
62
|
+
/**
|
|
63
|
+
* The webhook identifier.
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
}): CancelablePromise<WebhookResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Update a webhook
|
|
69
|
+
* Updates an existing webhook.
|
|
70
|
+
* @returns WebhookResponse
|
|
71
|
+
* @throws ApiError
|
|
72
|
+
*/
|
|
73
|
+
updateWebhook({ id, requestBody, }: {
|
|
74
|
+
/**
|
|
75
|
+
* The webhook identifier.
|
|
76
|
+
*/
|
|
77
|
+
id: string;
|
|
78
|
+
requestBody: UpdateWebhookRequest;
|
|
79
|
+
}): CancelablePromise<WebhookResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Generate a shared secret
|
|
82
|
+
* Generates a new shared secret.
|
|
83
|
+
* @returns SharedSecretsResponse
|
|
84
|
+
* @throws ApiError
|
|
85
|
+
*/
|
|
86
|
+
generateSharedSecret(): CancelablePromise<SharedSecretsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Get a shared secret
|
|
89
|
+
* Get a previously generated shared secret.
|
|
90
|
+
* @returns SharedSecretsResponse
|
|
91
|
+
* @throws ApiError
|
|
92
|
+
*/
|
|
93
|
+
getSharedSecret(): CancelablePromise<SharedSecretsResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Add address(es) to a webhook
|
|
96
|
+
* Adding address(es) to a given webhook.
|
|
97
|
+
* @returns WebhookResponse
|
|
98
|
+
* @throws ApiError
|
|
99
|
+
*/
|
|
100
|
+
addAddressesToWebhook({ id, requestBody, }: {
|
|
101
|
+
/**
|
|
102
|
+
* The webhook identifier.
|
|
103
|
+
*/
|
|
104
|
+
id: string;
|
|
105
|
+
requestBody: AddressesChangeRequest;
|
|
106
|
+
}): CancelablePromise<WebhookResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Remove address(es) from a webhook
|
|
109
|
+
* Removing address(es) from a given webhook.
|
|
110
|
+
* @returns WebhookResponse
|
|
111
|
+
* @throws ApiError
|
|
112
|
+
*/
|
|
113
|
+
removeAddressesFromWebhook({ id, requestBody, }: {
|
|
114
|
+
/**
|
|
115
|
+
* The webhook identifier.
|
|
116
|
+
*/
|
|
117
|
+
id: string;
|
|
118
|
+
requestBody: AddressesChangeRequest;
|
|
119
|
+
}): CancelablePromise<WebhookResponse>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { WebhooksService };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
class WebhooksService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
registerWebhook({
|
|
6
|
+
requestBody
|
|
7
|
+
}) {
|
|
8
|
+
return this.httpRequest.request({
|
|
9
|
+
method: "POST",
|
|
10
|
+
url: "/v1/webhooks",
|
|
11
|
+
body: requestBody,
|
|
12
|
+
mediaType: "application/json"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
listWebhooks({
|
|
16
|
+
pageToken,
|
|
17
|
+
pageSize = 10,
|
|
18
|
+
status
|
|
19
|
+
}) {
|
|
20
|
+
return this.httpRequest.request({
|
|
21
|
+
method: "GET",
|
|
22
|
+
url: "/v1/webhooks",
|
|
23
|
+
query: {
|
|
24
|
+
"pageToken": pageToken,
|
|
25
|
+
"pageSize": pageSize,
|
|
26
|
+
"status": status
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
getWebhook({
|
|
31
|
+
id
|
|
32
|
+
}) {
|
|
33
|
+
return this.httpRequest.request({
|
|
34
|
+
method: "GET",
|
|
35
|
+
url: "/v1/webhooks/{id}",
|
|
36
|
+
path: {
|
|
37
|
+
"id": id
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
deactivateWebhook({
|
|
42
|
+
id
|
|
43
|
+
}) {
|
|
44
|
+
return this.httpRequest.request({
|
|
45
|
+
method: "DELETE",
|
|
46
|
+
url: "/v1/webhooks/{id}",
|
|
47
|
+
path: {
|
|
48
|
+
"id": id
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
updateWebhook({
|
|
53
|
+
id,
|
|
54
|
+
requestBody
|
|
55
|
+
}) {
|
|
56
|
+
return this.httpRequest.request({
|
|
57
|
+
method: "PATCH",
|
|
58
|
+
url: "/v1/webhooks/{id}",
|
|
59
|
+
path: {
|
|
60
|
+
"id": id
|
|
61
|
+
},
|
|
62
|
+
body: requestBody,
|
|
63
|
+
mediaType: "application/json"
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
generateSharedSecret() {
|
|
67
|
+
return this.httpRequest.request({
|
|
68
|
+
method: "POST",
|
|
69
|
+
url: "/v1/webhooks:generateOrRotateSharedSecret"
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getSharedSecret() {
|
|
73
|
+
return this.httpRequest.request({
|
|
74
|
+
method: "GET",
|
|
75
|
+
url: "/v1/webhooks:getSharedSecret"
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
addAddressesToWebhook({
|
|
79
|
+
id,
|
|
80
|
+
requestBody
|
|
81
|
+
}) {
|
|
82
|
+
return this.httpRequest.request({
|
|
83
|
+
method: "PATCH",
|
|
84
|
+
url: "/v1/webhooks/{id}/addresses",
|
|
85
|
+
path: {
|
|
86
|
+
"id": id
|
|
87
|
+
},
|
|
88
|
+
body: requestBody,
|
|
89
|
+
mediaType: "application/json"
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
removeAddressesFromWebhook({
|
|
93
|
+
id,
|
|
94
|
+
requestBody
|
|
95
|
+
}) {
|
|
96
|
+
return this.httpRequest.request({
|
|
97
|
+
method: "DELETE",
|
|
98
|
+
url: "/v1/webhooks/{id}/addresses",
|
|
99
|
+
path: {
|
|
100
|
+
"id": id
|
|
101
|
+
},
|
|
102
|
+
body: requestBody,
|
|
103
|
+
mediaType: "application/json"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { WebhooksService };
|