node-appwrite 22.1.2 → 23.0.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/README.md +2 -2
- package/dist/client.d.mts +33 -0
- package/dist/client.d.ts +33 -0
- package/dist/client.js +52 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +52 -4
- package/dist/client.mjs.map +1 -1
- package/dist/enums/backup-services.d.mts +3 -0
- package/dist/enums/backup-services.d.ts +3 -0
- package/dist/enums/backup-services.js +3 -0
- package/dist/enums/backup-services.js.map +1 -1
- package/dist/enums/backup-services.mjs +3 -0
- package/dist/enums/backup-services.mjs.map +1 -1
- package/dist/enums/database-type.d.mts +3 -1
- package/dist/enums/database-type.d.ts +3 -1
- package/dist/enums/database-type.js +2 -0
- package/dist/enums/database-type.js.map +1 -1
- package/dist/enums/database-type.mjs +2 -0
- package/dist/enums/database-type.mjs.map +1 -1
- package/dist/enums/databases-index-type.d.mts +8 -0
- package/dist/enums/databases-index-type.d.ts +8 -0
- package/dist/enums/databases-index-type.js +13 -0
- package/dist/enums/databases-index-type.js.map +1 -0
- package/dist/enums/databases-index-type.mjs +12 -0
- package/dist/enums/databases-index-type.mjs.map +1 -0
- package/dist/enums/scopes.d.mts +4 -0
- package/dist/enums/scopes.d.ts +4 -0
- package/dist/enums/scopes.js +4 -0
- package/dist/enums/scopes.js.map +1 -1
- package/dist/enums/scopes.mjs +4 -0
- package/dist/enums/scopes.mjs.map +1 -1
- package/dist/enums/{index-type.d.mts → tables-db-index-type.d.mts} +2 -2
- package/dist/enums/{index-type.d.ts → tables-db-index-type.d.ts} +2 -2
- package/dist/enums/tables-db-index-type.js +13 -0
- package/dist/enums/tables-db-index-type.js.map +1 -0
- package/dist/enums/tables-db-index-type.mjs +12 -0
- package/dist/enums/tables-db-index-type.mjs.map +1 -0
- package/dist/enums/template-reference-type.d.mts +1 -1
- package/dist/enums/template-reference-type.d.ts +1 -1
- package/dist/enums/template-reference-type.js +1 -1
- package/dist/enums/template-reference-type.js.map +1 -1
- package/dist/enums/template-reference-type.mjs +1 -1
- package/dist/enums/template-reference-type.mjs.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +109 -11
- package/dist/models.d.ts +109 -11
- package/dist/services/databases.d.mts +45 -42
- package/dist/services/databases.d.ts +45 -42
- package/dist/services/databases.js +52 -47
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +52 -47
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +20 -8
- package/dist/services/functions.d.ts +20 -8
- package/dist/services/functions.js +28 -8
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +28 -8
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/health.d.mts +23 -94
- package/dist/services/health.d.ts +23 -94
- package/dist/services/health.js +28 -119
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +28 -119
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/messaging.d.mts +2 -2
- package/dist/services/messaging.d.ts +2 -2
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/project.d.mts +136 -0
- package/dist/services/project.d.ts +136 -0
- package/dist/services/project.js +183 -0
- package/dist/services/project.js.map +1 -0
- package/dist/services/project.mjs +182 -0
- package/dist/services/project.mjs.map +1 -0
- package/dist/services/sites.d.mts +30 -12
- package/dist/services/sites.d.ts +30 -12
- package/dist/services/sites.js +60 -33
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +60 -33
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +9 -6
- package/dist/services/tables-db.d.ts +9 -6
- package/dist/services/tables-db.js +6 -1
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +6 -1
- package/dist/services/tables-db.mjs.map +1 -1
- package/dist/services/teams.d.mts +4 -4
- package/dist/services/teams.d.ts +4 -4
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/users.d.mts +26 -2
- package/dist/services/users.d.ts +26 -2
- package/dist/services/users.js +34 -0
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +34 -0
- package/dist/services/users.mjs.map +1 -1
- package/dist/services/webhooks.d.mts +179 -0
- package/dist/services/webhooks.d.ts +179 -0
- package/dist/services/webhooks.js +261 -0
- package/dist/services/webhooks.js.map +1 -0
- package/dist/services/webhooks.mjs +260 -0
- package/dist/services/webhooks.mjs.map +1 -0
- package/package.json +5 -3
- package/dist/enums/index-type.js +0 -13
- package/dist/enums/index-type.js.map +0 -1
- package/dist/enums/index-type.mjs +0 -12
- package/dist/enums/index-type.mjs.map +0 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Client } from '../client.mjs';
|
|
2
|
+
import { Models } from '../models.mjs';
|
|
3
|
+
import '../query.mjs';
|
|
4
|
+
import '../enums/database-type.mjs';
|
|
5
|
+
import '../enums/attribute-status.mjs';
|
|
6
|
+
import '../enums/column-status.mjs';
|
|
7
|
+
import '../enums/index-status.mjs';
|
|
8
|
+
import '../enums/deployment-status.mjs';
|
|
9
|
+
import '../enums/execution-trigger.mjs';
|
|
10
|
+
import '../enums/execution-status.mjs';
|
|
11
|
+
import '../enums/health-antivirus-status.mjs';
|
|
12
|
+
import '../enums/health-check-status.mjs';
|
|
13
|
+
import '../enums/message-status.mjs';
|
|
14
|
+
|
|
15
|
+
declare class Webhooks {
|
|
16
|
+
client: Client;
|
|
17
|
+
constructor(client: Client);
|
|
18
|
+
/**
|
|
19
|
+
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
20
|
+
*
|
|
21
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts
|
|
22
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
|
+
* @throws {AppwriteException}
|
|
24
|
+
* @returns {Promise<Models.WebhookList>}
|
|
25
|
+
*/
|
|
26
|
+
list(params?: {
|
|
27
|
+
queries?: string[];
|
|
28
|
+
total?: boolean;
|
|
29
|
+
}): Promise<Models.WebhookList>;
|
|
30
|
+
/**
|
|
31
|
+
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
32
|
+
*
|
|
33
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts
|
|
34
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
35
|
+
* @throws {AppwriteException}
|
|
36
|
+
* @returns {Promise<Models.WebhookList>}
|
|
37
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
38
|
+
*/
|
|
39
|
+
list(queries?: string[], total?: boolean): Promise<Models.WebhookList>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} params.webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
44
|
+
* @param {string} params.url - Webhook URL.
|
|
45
|
+
* @param {string} params.name - Webhook name. Max length: 128 chars.
|
|
46
|
+
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
47
|
+
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
48
|
+
* @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.
|
|
49
|
+
* @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
50
|
+
* @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
51
|
+
* @throws {AppwriteException}
|
|
52
|
+
* @returns {Promise<Models.Webhook>}
|
|
53
|
+
*/
|
|
54
|
+
create(params: {
|
|
55
|
+
webhookId: string;
|
|
56
|
+
url: string;
|
|
57
|
+
name: string;
|
|
58
|
+
events: string[];
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
security?: boolean;
|
|
61
|
+
httpUser?: string;
|
|
62
|
+
httpPass?: string;
|
|
63
|
+
}): Promise<Models.Webhook>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
68
|
+
* @param {string} url - Webhook URL.
|
|
69
|
+
* @param {string} name - Webhook name. Max length: 128 chars.
|
|
70
|
+
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
71
|
+
* @param {boolean} enabled - Enable or disable a webhook.
|
|
72
|
+
* @param {boolean} security - Certificate verification, false for disabled or true for enabled.
|
|
73
|
+
* @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
74
|
+
* @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
75
|
+
* @throws {AppwriteException}
|
|
76
|
+
* @returns {Promise<Models.Webhook>}
|
|
77
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
78
|
+
*/
|
|
79
|
+
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
|
|
80
|
+
/**
|
|
81
|
+
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
84
|
+
* @throws {AppwriteException}
|
|
85
|
+
* @returns {Promise<Models.Webhook>}
|
|
86
|
+
*/
|
|
87
|
+
get(params: {
|
|
88
|
+
webhookId: string;
|
|
89
|
+
}): Promise<Models.Webhook>;
|
|
90
|
+
/**
|
|
91
|
+
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} webhookId - Webhook ID.
|
|
94
|
+
* @throws {AppwriteException}
|
|
95
|
+
* @returns {Promise<Models.Webhook>}
|
|
96
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
97
|
+
*/
|
|
98
|
+
get(webhookId: string): Promise<Models.Webhook>;
|
|
99
|
+
/**
|
|
100
|
+
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
103
|
+
* @param {string} params.name - Webhook name. Max length: 128 chars.
|
|
104
|
+
* @param {string} params.url - Webhook URL.
|
|
105
|
+
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
106
|
+
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
107
|
+
* @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.
|
|
108
|
+
* @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
109
|
+
* @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
110
|
+
* @throws {AppwriteException}
|
|
111
|
+
* @returns {Promise<Models.Webhook>}
|
|
112
|
+
*/
|
|
113
|
+
update(params: {
|
|
114
|
+
webhookId: string;
|
|
115
|
+
name: string;
|
|
116
|
+
url: string;
|
|
117
|
+
events: string[];
|
|
118
|
+
enabled?: boolean;
|
|
119
|
+
security?: boolean;
|
|
120
|
+
httpUser?: string;
|
|
121
|
+
httpPass?: string;
|
|
122
|
+
}): Promise<Models.Webhook>;
|
|
123
|
+
/**
|
|
124
|
+
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
125
|
+
*
|
|
126
|
+
* @param {string} webhookId - Webhook ID.
|
|
127
|
+
* @param {string} name - Webhook name. Max length: 128 chars.
|
|
128
|
+
* @param {string} url - Webhook URL.
|
|
129
|
+
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
130
|
+
* @param {boolean} enabled - Enable or disable a webhook.
|
|
131
|
+
* @param {boolean} security - Certificate verification, false for disabled or true for enabled.
|
|
132
|
+
* @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
133
|
+
* @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
134
|
+
* @throws {AppwriteException}
|
|
135
|
+
* @returns {Promise<Models.Webhook>}
|
|
136
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
137
|
+
*/
|
|
138
|
+
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
|
|
139
|
+
/**
|
|
140
|
+
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
141
|
+
*
|
|
142
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
143
|
+
* @throws {AppwriteException}
|
|
144
|
+
* @returns {Promise<{}>}
|
|
145
|
+
*/
|
|
146
|
+
delete(params: {
|
|
147
|
+
webhookId: string;
|
|
148
|
+
}): Promise<{}>;
|
|
149
|
+
/**
|
|
150
|
+
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} webhookId - Webhook ID.
|
|
153
|
+
* @throws {AppwriteException}
|
|
154
|
+
* @returns {Promise<{}>}
|
|
155
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
156
|
+
*/
|
|
157
|
+
delete(webhookId: string): Promise<{}>;
|
|
158
|
+
/**
|
|
159
|
+
* Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook.
|
|
160
|
+
*
|
|
161
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
162
|
+
* @throws {AppwriteException}
|
|
163
|
+
* @returns {Promise<Models.Webhook>}
|
|
164
|
+
*/
|
|
165
|
+
updateSignature(params: {
|
|
166
|
+
webhookId: string;
|
|
167
|
+
}): Promise<Models.Webhook>;
|
|
168
|
+
/**
|
|
169
|
+
* Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook.
|
|
170
|
+
*
|
|
171
|
+
* @param {string} webhookId - Webhook ID.
|
|
172
|
+
* @throws {AppwriteException}
|
|
173
|
+
* @returns {Promise<Models.Webhook>}
|
|
174
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
175
|
+
*/
|
|
176
|
+
updateSignature(webhookId: string): Promise<Models.Webhook>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { Webhooks };
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Client } from '../client.js';
|
|
2
|
+
import { Models } from '../models.js';
|
|
3
|
+
import '../query.js';
|
|
4
|
+
import '../enums/database-type.js';
|
|
5
|
+
import '../enums/attribute-status.js';
|
|
6
|
+
import '../enums/column-status.js';
|
|
7
|
+
import '../enums/index-status.js';
|
|
8
|
+
import '../enums/deployment-status.js';
|
|
9
|
+
import '../enums/execution-trigger.js';
|
|
10
|
+
import '../enums/execution-status.js';
|
|
11
|
+
import '../enums/health-antivirus-status.js';
|
|
12
|
+
import '../enums/health-check-status.js';
|
|
13
|
+
import '../enums/message-status.js';
|
|
14
|
+
|
|
15
|
+
declare class Webhooks {
|
|
16
|
+
client: Client;
|
|
17
|
+
constructor(client: Client);
|
|
18
|
+
/**
|
|
19
|
+
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
20
|
+
*
|
|
21
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts
|
|
22
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
|
+
* @throws {AppwriteException}
|
|
24
|
+
* @returns {Promise<Models.WebhookList>}
|
|
25
|
+
*/
|
|
26
|
+
list(params?: {
|
|
27
|
+
queries?: string[];
|
|
28
|
+
total?: boolean;
|
|
29
|
+
}): Promise<Models.WebhookList>;
|
|
30
|
+
/**
|
|
31
|
+
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
32
|
+
*
|
|
33
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts
|
|
34
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
35
|
+
* @throws {AppwriteException}
|
|
36
|
+
* @returns {Promise<Models.WebhookList>}
|
|
37
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
38
|
+
*/
|
|
39
|
+
list(queries?: string[], total?: boolean): Promise<Models.WebhookList>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} params.webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
44
|
+
* @param {string} params.url - Webhook URL.
|
|
45
|
+
* @param {string} params.name - Webhook name. Max length: 128 chars.
|
|
46
|
+
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
47
|
+
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
48
|
+
* @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.
|
|
49
|
+
* @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
50
|
+
* @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
51
|
+
* @throws {AppwriteException}
|
|
52
|
+
* @returns {Promise<Models.Webhook>}
|
|
53
|
+
*/
|
|
54
|
+
create(params: {
|
|
55
|
+
webhookId: string;
|
|
56
|
+
url: string;
|
|
57
|
+
name: string;
|
|
58
|
+
events: string[];
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
security?: boolean;
|
|
61
|
+
httpUser?: string;
|
|
62
|
+
httpPass?: string;
|
|
63
|
+
}): Promise<Models.Webhook>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
68
|
+
* @param {string} url - Webhook URL.
|
|
69
|
+
* @param {string} name - Webhook name. Max length: 128 chars.
|
|
70
|
+
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
71
|
+
* @param {boolean} enabled - Enable or disable a webhook.
|
|
72
|
+
* @param {boolean} security - Certificate verification, false for disabled or true for enabled.
|
|
73
|
+
* @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
74
|
+
* @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
75
|
+
* @throws {AppwriteException}
|
|
76
|
+
* @returns {Promise<Models.Webhook>}
|
|
77
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
78
|
+
*/
|
|
79
|
+
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
|
|
80
|
+
/**
|
|
81
|
+
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
84
|
+
* @throws {AppwriteException}
|
|
85
|
+
* @returns {Promise<Models.Webhook>}
|
|
86
|
+
*/
|
|
87
|
+
get(params: {
|
|
88
|
+
webhookId: string;
|
|
89
|
+
}): Promise<Models.Webhook>;
|
|
90
|
+
/**
|
|
91
|
+
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} webhookId - Webhook ID.
|
|
94
|
+
* @throws {AppwriteException}
|
|
95
|
+
* @returns {Promise<Models.Webhook>}
|
|
96
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
97
|
+
*/
|
|
98
|
+
get(webhookId: string): Promise<Models.Webhook>;
|
|
99
|
+
/**
|
|
100
|
+
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
103
|
+
* @param {string} params.name - Webhook name. Max length: 128 chars.
|
|
104
|
+
* @param {string} params.url - Webhook URL.
|
|
105
|
+
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
106
|
+
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
107
|
+
* @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.
|
|
108
|
+
* @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
109
|
+
* @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
110
|
+
* @throws {AppwriteException}
|
|
111
|
+
* @returns {Promise<Models.Webhook>}
|
|
112
|
+
*/
|
|
113
|
+
update(params: {
|
|
114
|
+
webhookId: string;
|
|
115
|
+
name: string;
|
|
116
|
+
url: string;
|
|
117
|
+
events: string[];
|
|
118
|
+
enabled?: boolean;
|
|
119
|
+
security?: boolean;
|
|
120
|
+
httpUser?: string;
|
|
121
|
+
httpPass?: string;
|
|
122
|
+
}): Promise<Models.Webhook>;
|
|
123
|
+
/**
|
|
124
|
+
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
125
|
+
*
|
|
126
|
+
* @param {string} webhookId - Webhook ID.
|
|
127
|
+
* @param {string} name - Webhook name. Max length: 128 chars.
|
|
128
|
+
* @param {string} url - Webhook URL.
|
|
129
|
+
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
130
|
+
* @param {boolean} enabled - Enable or disable a webhook.
|
|
131
|
+
* @param {boolean} security - Certificate verification, false for disabled or true for enabled.
|
|
132
|
+
* @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.
|
|
133
|
+
* @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.
|
|
134
|
+
* @throws {AppwriteException}
|
|
135
|
+
* @returns {Promise<Models.Webhook>}
|
|
136
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
137
|
+
*/
|
|
138
|
+
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
|
|
139
|
+
/**
|
|
140
|
+
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
141
|
+
*
|
|
142
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
143
|
+
* @throws {AppwriteException}
|
|
144
|
+
* @returns {Promise<{}>}
|
|
145
|
+
*/
|
|
146
|
+
delete(params: {
|
|
147
|
+
webhookId: string;
|
|
148
|
+
}): Promise<{}>;
|
|
149
|
+
/**
|
|
150
|
+
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} webhookId - Webhook ID.
|
|
153
|
+
* @throws {AppwriteException}
|
|
154
|
+
* @returns {Promise<{}>}
|
|
155
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
156
|
+
*/
|
|
157
|
+
delete(webhookId: string): Promise<{}>;
|
|
158
|
+
/**
|
|
159
|
+
* Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook.
|
|
160
|
+
*
|
|
161
|
+
* @param {string} params.webhookId - Webhook ID.
|
|
162
|
+
* @throws {AppwriteException}
|
|
163
|
+
* @returns {Promise<Models.Webhook>}
|
|
164
|
+
*/
|
|
165
|
+
updateSignature(params: {
|
|
166
|
+
webhookId: string;
|
|
167
|
+
}): Promise<Models.Webhook>;
|
|
168
|
+
/**
|
|
169
|
+
* Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook.
|
|
170
|
+
*
|
|
171
|
+
* @param {string} webhookId - Webhook ID.
|
|
172
|
+
* @throws {AppwriteException}
|
|
173
|
+
* @returns {Promise<Models.Webhook>}
|
|
174
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
175
|
+
*/
|
|
176
|
+
updateSignature(webhookId: string): Promise<Models.Webhook>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { Webhooks };
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var client = require('../client');
|
|
4
|
+
|
|
5
|
+
class Webhooks {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
list(paramsOrFirst, ...rest) {
|
|
10
|
+
let params;
|
|
11
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12
|
+
params = paramsOrFirst || {};
|
|
13
|
+
} else {
|
|
14
|
+
params = {
|
|
15
|
+
queries: paramsOrFirst,
|
|
16
|
+
total: rest[0]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const queries = params.queries;
|
|
20
|
+
const total = params.total;
|
|
21
|
+
const apiPath = "/webhooks";
|
|
22
|
+
const payload = {};
|
|
23
|
+
if (typeof queries !== "undefined") {
|
|
24
|
+
payload["queries"] = queries;
|
|
25
|
+
}
|
|
26
|
+
if (typeof total !== "undefined") {
|
|
27
|
+
payload["total"] = total;
|
|
28
|
+
}
|
|
29
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
30
|
+
const apiHeaders = {};
|
|
31
|
+
return this.client.call(
|
|
32
|
+
"get",
|
|
33
|
+
uri,
|
|
34
|
+
apiHeaders,
|
|
35
|
+
payload
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
create(paramsOrFirst, ...rest) {
|
|
39
|
+
let params;
|
|
40
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
41
|
+
params = paramsOrFirst || {};
|
|
42
|
+
} else {
|
|
43
|
+
params = {
|
|
44
|
+
webhookId: paramsOrFirst,
|
|
45
|
+
url: rest[0],
|
|
46
|
+
name: rest[1],
|
|
47
|
+
events: rest[2],
|
|
48
|
+
enabled: rest[3],
|
|
49
|
+
security: rest[4],
|
|
50
|
+
httpUser: rest[5],
|
|
51
|
+
httpPass: rest[6]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const webhookId = params.webhookId;
|
|
55
|
+
const url = params.url;
|
|
56
|
+
const name = params.name;
|
|
57
|
+
const events = params.events;
|
|
58
|
+
const enabled = params.enabled;
|
|
59
|
+
const security = params.security;
|
|
60
|
+
const httpUser = params.httpUser;
|
|
61
|
+
const httpPass = params.httpPass;
|
|
62
|
+
if (typeof webhookId === "undefined") {
|
|
63
|
+
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
64
|
+
}
|
|
65
|
+
if (typeof url === "undefined") {
|
|
66
|
+
throw new client.AppwriteException('Missing required parameter: "url"');
|
|
67
|
+
}
|
|
68
|
+
if (typeof name === "undefined") {
|
|
69
|
+
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
70
|
+
}
|
|
71
|
+
if (typeof events === "undefined") {
|
|
72
|
+
throw new client.AppwriteException('Missing required parameter: "events"');
|
|
73
|
+
}
|
|
74
|
+
const apiPath = "/webhooks";
|
|
75
|
+
const payload = {};
|
|
76
|
+
if (typeof webhookId !== "undefined") {
|
|
77
|
+
payload["webhookId"] = webhookId;
|
|
78
|
+
}
|
|
79
|
+
if (typeof url !== "undefined") {
|
|
80
|
+
payload["url"] = url;
|
|
81
|
+
}
|
|
82
|
+
if (typeof name !== "undefined") {
|
|
83
|
+
payload["name"] = name;
|
|
84
|
+
}
|
|
85
|
+
if (typeof events !== "undefined") {
|
|
86
|
+
payload["events"] = events;
|
|
87
|
+
}
|
|
88
|
+
if (typeof enabled !== "undefined") {
|
|
89
|
+
payload["enabled"] = enabled;
|
|
90
|
+
}
|
|
91
|
+
if (typeof security !== "undefined") {
|
|
92
|
+
payload["security"] = security;
|
|
93
|
+
}
|
|
94
|
+
if (typeof httpUser !== "undefined") {
|
|
95
|
+
payload["httpUser"] = httpUser;
|
|
96
|
+
}
|
|
97
|
+
if (typeof httpPass !== "undefined") {
|
|
98
|
+
payload["httpPass"] = httpPass;
|
|
99
|
+
}
|
|
100
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
101
|
+
const apiHeaders = {
|
|
102
|
+
"content-type": "application/json"
|
|
103
|
+
};
|
|
104
|
+
return this.client.call(
|
|
105
|
+
"post",
|
|
106
|
+
uri,
|
|
107
|
+
apiHeaders,
|
|
108
|
+
payload
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
get(paramsOrFirst) {
|
|
112
|
+
let params;
|
|
113
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
114
|
+
params = paramsOrFirst || {};
|
|
115
|
+
} else {
|
|
116
|
+
params = {
|
|
117
|
+
webhookId: paramsOrFirst
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const webhookId = params.webhookId;
|
|
121
|
+
if (typeof webhookId === "undefined") {
|
|
122
|
+
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
123
|
+
}
|
|
124
|
+
const apiPath = "/webhooks/{webhookId}".replace("{webhookId}", webhookId);
|
|
125
|
+
const payload = {};
|
|
126
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
127
|
+
const apiHeaders = {};
|
|
128
|
+
return this.client.call(
|
|
129
|
+
"get",
|
|
130
|
+
uri,
|
|
131
|
+
apiHeaders,
|
|
132
|
+
payload
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
update(paramsOrFirst, ...rest) {
|
|
136
|
+
let params;
|
|
137
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
138
|
+
params = paramsOrFirst || {};
|
|
139
|
+
} else {
|
|
140
|
+
params = {
|
|
141
|
+
webhookId: paramsOrFirst,
|
|
142
|
+
name: rest[0],
|
|
143
|
+
url: rest[1],
|
|
144
|
+
events: rest[2],
|
|
145
|
+
enabled: rest[3],
|
|
146
|
+
security: rest[4],
|
|
147
|
+
httpUser: rest[5],
|
|
148
|
+
httpPass: rest[6]
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
const webhookId = params.webhookId;
|
|
152
|
+
const name = params.name;
|
|
153
|
+
const url = params.url;
|
|
154
|
+
const events = params.events;
|
|
155
|
+
const enabled = params.enabled;
|
|
156
|
+
const security = params.security;
|
|
157
|
+
const httpUser = params.httpUser;
|
|
158
|
+
const httpPass = params.httpPass;
|
|
159
|
+
if (typeof webhookId === "undefined") {
|
|
160
|
+
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
161
|
+
}
|
|
162
|
+
if (typeof name === "undefined") {
|
|
163
|
+
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
164
|
+
}
|
|
165
|
+
if (typeof url === "undefined") {
|
|
166
|
+
throw new client.AppwriteException('Missing required parameter: "url"');
|
|
167
|
+
}
|
|
168
|
+
if (typeof events === "undefined") {
|
|
169
|
+
throw new client.AppwriteException('Missing required parameter: "events"');
|
|
170
|
+
}
|
|
171
|
+
const apiPath = "/webhooks/{webhookId}".replace("{webhookId}", webhookId);
|
|
172
|
+
const payload = {};
|
|
173
|
+
if (typeof name !== "undefined") {
|
|
174
|
+
payload["name"] = name;
|
|
175
|
+
}
|
|
176
|
+
if (typeof url !== "undefined") {
|
|
177
|
+
payload["url"] = url;
|
|
178
|
+
}
|
|
179
|
+
if (typeof events !== "undefined") {
|
|
180
|
+
payload["events"] = events;
|
|
181
|
+
}
|
|
182
|
+
if (typeof enabled !== "undefined") {
|
|
183
|
+
payload["enabled"] = enabled;
|
|
184
|
+
}
|
|
185
|
+
if (typeof security !== "undefined") {
|
|
186
|
+
payload["security"] = security;
|
|
187
|
+
}
|
|
188
|
+
if (typeof httpUser !== "undefined") {
|
|
189
|
+
payload["httpUser"] = httpUser;
|
|
190
|
+
}
|
|
191
|
+
if (typeof httpPass !== "undefined") {
|
|
192
|
+
payload["httpPass"] = httpPass;
|
|
193
|
+
}
|
|
194
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
195
|
+
const apiHeaders = {
|
|
196
|
+
"content-type": "application/json"
|
|
197
|
+
};
|
|
198
|
+
return this.client.call(
|
|
199
|
+
"put",
|
|
200
|
+
uri,
|
|
201
|
+
apiHeaders,
|
|
202
|
+
payload
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
delete(paramsOrFirst) {
|
|
206
|
+
let params;
|
|
207
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
208
|
+
params = paramsOrFirst || {};
|
|
209
|
+
} else {
|
|
210
|
+
params = {
|
|
211
|
+
webhookId: paramsOrFirst
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
const webhookId = params.webhookId;
|
|
215
|
+
if (typeof webhookId === "undefined") {
|
|
216
|
+
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
217
|
+
}
|
|
218
|
+
const apiPath = "/webhooks/{webhookId}".replace("{webhookId}", webhookId);
|
|
219
|
+
const payload = {};
|
|
220
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
221
|
+
const apiHeaders = {
|
|
222
|
+
"content-type": "application/json"
|
|
223
|
+
};
|
|
224
|
+
return this.client.call(
|
|
225
|
+
"delete",
|
|
226
|
+
uri,
|
|
227
|
+
apiHeaders,
|
|
228
|
+
payload
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
updateSignature(paramsOrFirst) {
|
|
232
|
+
let params;
|
|
233
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
234
|
+
params = paramsOrFirst || {};
|
|
235
|
+
} else {
|
|
236
|
+
params = {
|
|
237
|
+
webhookId: paramsOrFirst
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
const webhookId = params.webhookId;
|
|
241
|
+
if (typeof webhookId === "undefined") {
|
|
242
|
+
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
243
|
+
}
|
|
244
|
+
const apiPath = "/webhooks/{webhookId}/signature".replace("{webhookId}", webhookId);
|
|
245
|
+
const payload = {};
|
|
246
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
247
|
+
const apiHeaders = {
|
|
248
|
+
"content-type": "application/json"
|
|
249
|
+
};
|
|
250
|
+
return this.client.call(
|
|
251
|
+
"patch",
|
|
252
|
+
uri,
|
|
253
|
+
apiHeaders,
|
|
254
|
+
payload
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
exports.Webhooks = Webhooks;
|
|
260
|
+
//# sourceMappingURL=out.js.map
|
|
261
|
+
//# sourceMappingURL=webhooks.js.map
|