node-appwrite 23.1.0 → 24.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 +1 -1
- package/dist/client.d.mts +2 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.js +7 -9
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +6 -8
- package/dist/client.mjs.map +1 -1
- package/dist/enums/adapter.js +1 -1
- package/dist/enums/adapter.js.map +1 -1
- package/dist/enums/adapter.mjs +1 -1
- package/dist/enums/adapter.mjs.map +1 -1
- package/dist/enums/attribute-status.js +1 -1
- package/dist/enums/attribute-status.js.map +1 -1
- package/dist/enums/attribute-status.mjs +1 -1
- package/dist/enums/attribute-status.mjs.map +1 -1
- package/dist/enums/authentication-factor.js +1 -1
- package/dist/enums/authentication-factor.js.map +1 -1
- package/dist/enums/authentication-factor.mjs +1 -1
- package/dist/enums/authentication-factor.mjs.map +1 -1
- package/dist/enums/authenticator-type.js +1 -1
- package/dist/enums/authenticator-type.js.map +1 -1
- package/dist/enums/authenticator-type.mjs +1 -1
- package/dist/enums/authenticator-type.mjs.map +1 -1
- package/dist/enums/backup-services.js +1 -1
- package/dist/enums/backup-services.js.map +1 -1
- package/dist/enums/backup-services.mjs +1 -1
- package/dist/enums/backup-services.mjs.map +1 -1
- package/dist/enums/browser-permission.js +1 -1
- package/dist/enums/browser-permission.js.map +1 -1
- package/dist/enums/browser-permission.mjs +1 -1
- package/dist/enums/browser-permission.mjs.map +1 -1
- package/dist/enums/browser.js +1 -1
- package/dist/enums/browser.js.map +1 -1
- package/dist/enums/browser.mjs +1 -1
- package/dist/enums/browser.mjs.map +1 -1
- package/dist/enums/build-runtime.d.mts +3 -1
- package/dist/enums/build-runtime.d.ts +3 -1
- package/dist/enums/build-runtime.js +3 -1
- package/dist/enums/build-runtime.js.map +1 -1
- package/dist/enums/build-runtime.mjs +3 -1
- package/dist/enums/build-runtime.mjs.map +1 -1
- package/dist/enums/column-status.js +1 -1
- package/dist/enums/column-status.js.map +1 -1
- package/dist/enums/column-status.mjs +1 -1
- package/dist/enums/column-status.mjs.map +1 -1
- package/dist/enums/compression.js +1 -1
- package/dist/enums/compression.js.map +1 -1
- package/dist/enums/compression.mjs +1 -1
- package/dist/enums/compression.mjs.map +1 -1
- package/dist/enums/credit-card.js +1 -1
- package/dist/enums/credit-card.js.map +1 -1
- package/dist/enums/credit-card.mjs +1 -1
- package/dist/enums/credit-card.mjs.map +1 -1
- package/dist/enums/database-type.js +1 -1
- package/dist/enums/database-type.js.map +1 -1
- package/dist/enums/database-type.mjs +1 -1
- package/dist/enums/database-type.mjs.map +1 -1
- package/dist/enums/databases-index-type.js +1 -1
- package/dist/enums/databases-index-type.js.map +1 -1
- package/dist/enums/databases-index-type.mjs +1 -1
- package/dist/enums/databases-index-type.mjs.map +1 -1
- package/dist/enums/deployment-download-type.js +1 -1
- package/dist/enums/deployment-download-type.js.map +1 -1
- package/dist/enums/deployment-download-type.mjs +1 -1
- package/dist/enums/deployment-download-type.mjs.map +1 -1
- package/dist/enums/deployment-status.js +1 -1
- package/dist/enums/deployment-status.js.map +1 -1
- package/dist/enums/deployment-status.mjs +1 -1
- package/dist/enums/deployment-status.mjs.map +1 -1
- package/dist/enums/execution-method.js +1 -1
- package/dist/enums/execution-method.js.map +1 -1
- package/dist/enums/execution-method.mjs +1 -1
- package/dist/enums/execution-method.mjs.map +1 -1
- package/dist/enums/execution-status.js +1 -1
- package/dist/enums/execution-status.js.map +1 -1
- package/dist/enums/execution-status.mjs +1 -1
- package/dist/enums/execution-status.mjs.map +1 -1
- package/dist/enums/execution-trigger.js +1 -1
- package/dist/enums/execution-trigger.js.map +1 -1
- package/dist/enums/execution-trigger.mjs +1 -1
- package/dist/enums/execution-trigger.mjs.map +1 -1
- package/dist/enums/flag.js +1 -1
- package/dist/enums/flag.js.map +1 -1
- package/dist/enums/flag.mjs +1 -1
- package/dist/enums/flag.mjs.map +1 -1
- package/dist/enums/framework.js +1 -1
- package/dist/enums/framework.js.map +1 -1
- package/dist/enums/framework.mjs +1 -1
- package/dist/enums/framework.mjs.map +1 -1
- package/dist/enums/health-antivirus-status.js +1 -1
- package/dist/enums/health-antivirus-status.js.map +1 -1
- package/dist/enums/health-antivirus-status.mjs +1 -1
- package/dist/enums/health-antivirus-status.mjs.map +1 -1
- package/dist/enums/health-check-status.js +1 -1
- package/dist/enums/health-check-status.js.map +1 -1
- package/dist/enums/health-check-status.mjs +1 -1
- package/dist/enums/health-check-status.mjs.map +1 -1
- package/dist/enums/image-format.js +1 -1
- package/dist/enums/image-format.js.map +1 -1
- package/dist/enums/image-format.mjs +1 -1
- package/dist/enums/image-format.mjs.map +1 -1
- package/dist/enums/image-gravity.js +1 -1
- package/dist/enums/image-gravity.js.map +1 -1
- package/dist/enums/image-gravity.mjs +1 -1
- package/dist/enums/image-gravity.mjs.map +1 -1
- package/dist/enums/index-status.js +1 -1
- package/dist/enums/index-status.js.map +1 -1
- package/dist/enums/index-status.mjs +1 -1
- package/dist/enums/index-status.mjs.map +1 -1
- package/dist/enums/message-priority.js +1 -1
- package/dist/enums/message-priority.js.map +1 -1
- package/dist/enums/message-priority.mjs +1 -1
- package/dist/enums/message-priority.mjs.map +1 -1
- package/dist/enums/message-status.js +1 -1
- package/dist/enums/message-status.js.map +1 -1
- package/dist/enums/message-status.mjs +1 -1
- package/dist/enums/message-status.mjs.map +1 -1
- package/dist/enums/messaging-provider-type.js +1 -1
- package/dist/enums/messaging-provider-type.js.map +1 -1
- package/dist/enums/messaging-provider-type.mjs +1 -1
- package/dist/enums/messaging-provider-type.mjs.map +1 -1
- package/dist/enums/name.js +1 -1
- package/dist/enums/name.js.map +1 -1
- package/dist/enums/name.mjs +1 -1
- package/dist/enums/name.mjs.map +1 -1
- package/dist/enums/o-auth-provider.d.mts +1 -0
- package/dist/enums/o-auth-provider.d.ts +1 -0
- package/dist/enums/o-auth-provider.js +2 -1
- package/dist/enums/o-auth-provider.js.map +1 -1
- package/dist/enums/o-auth-provider.mjs +2 -1
- package/dist/enums/o-auth-provider.mjs.map +1 -1
- package/dist/enums/order-by.js +1 -1
- package/dist/enums/order-by.js.map +1 -1
- package/dist/enums/order-by.mjs +1 -1
- package/dist/enums/order-by.mjs.map +1 -1
- package/dist/enums/password-hash.js +1 -1
- package/dist/enums/password-hash.js.map +1 -1
- package/dist/enums/password-hash.mjs +1 -1
- package/dist/enums/password-hash.mjs.map +1 -1
- package/dist/enums/platform-type.d.mts +9 -0
- package/dist/enums/platform-type.d.ts +9 -0
- package/dist/enums/platform-type.js +14 -0
- package/dist/enums/platform-type.js.map +1 -0
- package/dist/enums/platform-type.mjs +13 -0
- package/dist/enums/platform-type.mjs.map +1 -0
- package/dist/enums/protocol-id.d.mts +7 -0
- package/dist/enums/protocol-id.d.ts +7 -0
- package/dist/enums/protocol-id.js +12 -0
- package/dist/enums/protocol-id.js.map +1 -0
- package/dist/enums/protocol-id.mjs +11 -0
- package/dist/enums/protocol-id.mjs.map +1 -0
- package/dist/enums/relation-mutate.js +1 -1
- package/dist/enums/relation-mutate.js.map +1 -1
- package/dist/enums/relation-mutate.mjs +1 -1
- package/dist/enums/relation-mutate.mjs.map +1 -1
- package/dist/enums/relationship-type.js +1 -1
- package/dist/enums/relationship-type.js.map +1 -1
- package/dist/enums/relationship-type.mjs +1 -1
- package/dist/enums/relationship-type.mjs.map +1 -1
- package/dist/enums/runtime.d.mts +3 -1
- package/dist/enums/runtime.d.ts +3 -1
- package/dist/enums/runtime.js +3 -1
- package/dist/enums/runtime.js.map +1 -1
- package/dist/enums/runtime.mjs +3 -1
- package/dist/enums/runtime.mjs.map +1 -1
- package/dist/enums/scopes.d.mts +4 -0
- package/dist/enums/scopes.d.ts +4 -0
- package/dist/enums/scopes.js +5 -1
- package/dist/enums/scopes.js.map +1 -1
- package/dist/enums/scopes.mjs +5 -1
- package/dist/enums/scopes.mjs.map +1 -1
- package/dist/enums/service-id.d.mts +21 -0
- package/dist/enums/service-id.d.ts +21 -0
- package/dist/enums/service-id.js +26 -0
- package/dist/enums/service-id.js.map +1 -0
- package/dist/enums/service-id.mjs +25 -0
- package/dist/enums/service-id.mjs.map +1 -0
- package/dist/enums/smtp-encryption.js +1 -1
- package/dist/enums/smtp-encryption.js.map +1 -1
- package/dist/enums/smtp-encryption.mjs +1 -1
- package/dist/enums/smtp-encryption.mjs.map +1 -1
- package/dist/enums/tables-db-index-type.js +1 -1
- package/dist/enums/tables-db-index-type.js.map +1 -1
- package/dist/enums/tables-db-index-type.mjs +1 -1
- package/dist/enums/tables-db-index-type.mjs.map +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/enums/theme.js +1 -1
- package/dist/enums/theme.js.map +1 -1
- package/dist/enums/theme.mjs +1 -1
- package/dist/enums/theme.mjs.map +1 -1
- package/dist/enums/timezone.js +1 -1
- package/dist/enums/timezone.js.map +1 -1
- package/dist/enums/timezone.mjs +1 -1
- package/dist/enums/timezone.mjs.map +1 -1
- package/dist/enums/vcs-reference-type.js +1 -1
- package/dist/enums/vcs-reference-type.js.map +1 -1
- package/dist/enums/vcs-reference-type.mjs +1 -1
- package/dist/enums/vcs-reference-type.mjs.map +1 -1
- package/dist/id.js +1 -1
- package/dist/id.js.map +1 -1
- package/dist/id.mjs +1 -1
- package/dist/id.mjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +84 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/inputFile.js +1 -1
- package/dist/inputFile.js.map +1 -1
- package/dist/inputFile.mjs +1 -1
- package/dist/inputFile.mjs.map +1 -1
- package/dist/models.d.mts +678 -7
- package/dist/models.d.ts +678 -7
- package/dist/models.js +1 -1
- package/dist/models.js.map +1 -1
- package/dist/models.mjs +1 -1
- package/dist/models.mjs.map +1 -1
- package/dist/operator.d.mts +1 -1
- package/dist/operator.d.ts +1 -1
- package/dist/operator.js +1 -1
- package/dist/operator.js.map +1 -1
- package/dist/operator.mjs +1 -1
- package/dist/operator.mjs.map +1 -1
- package/dist/permission.js +1 -1
- package/dist/permission.js.map +1 -1
- package/dist/permission.mjs +1 -1
- package/dist/permission.mjs.map +1 -1
- package/dist/query.d.mts +1 -1
- package/dist/query.d.ts +1 -1
- package/dist/query.js +1 -1
- package/dist/query.js.map +1 -1
- package/dist/query.mjs +1 -1
- package/dist/query.mjs.map +1 -1
- package/dist/role.js +1 -1
- package/dist/role.js.map +1 -1
- package/dist/role.mjs +1 -1
- package/dist/role.mjs.map +1 -1
- package/dist/services/account.d.mts +3 -2
- package/dist/services/account.d.ts +3 -2
- package/dist/services/account.js +1 -1
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +1 -1
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/activities.d.mts +1 -0
- package/dist/services/activities.d.ts +1 -0
- package/dist/services/activities.js +1 -1
- package/dist/services/activities.js.map +1 -1
- package/dist/services/activities.mjs +1 -1
- package/dist/services/activities.mjs.map +1 -1
- package/dist/services/avatars.d.mts +1 -0
- package/dist/services/avatars.d.ts +1 -0
- package/dist/services/avatars.js +1 -1
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +1 -1
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/backups.d.mts +1 -0
- package/dist/services/backups.d.ts +1 -0
- package/dist/services/backups.js +1 -1
- package/dist/services/backups.js.map +1 -1
- package/dist/services/backups.mjs +1 -1
- package/dist/services/backups.mjs.map +1 -1
- package/dist/services/databases.d.mts +7 -3
- package/dist/services/databases.d.ts +7 -3
- package/dist/services/databases.js +7 -2
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +7 -2
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +1 -0
- package/dist/services/functions.d.ts +1 -0
- package/dist/services/functions.js +1 -1
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +1 -1
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.d.mts +1 -0
- package/dist/services/graphql.d.ts +1 -0
- package/dist/services/graphql.js +1 -1
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs +1 -1
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +3 -0
- package/dist/services/health.d.ts +3 -0
- package/dist/services/health.js +1 -1
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +1 -1
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.d.mts +1 -0
- package/dist/services/locale.d.ts +1 -0
- package/dist/services/locale.js +1 -1
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs +1 -1
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +1 -0
- package/dist/services/messaging.d.ts +1 -0
- package/dist/services/messaging.js +1 -1
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +1 -1
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/project.d.mts +493 -0
- package/dist/services/project.d.ts +493 -0
- package/dist/services/project.js +788 -1
- package/dist/services/project.js.map +1 -1
- package/dist/services/project.mjs +788 -1
- package/dist/services/project.mjs.map +1 -1
- package/dist/services/sites.d.mts +1 -0
- package/dist/services/sites.d.ts +1 -0
- package/dist/services/sites.js +1 -1
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +1 -1
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/storage.d.mts +1 -0
- package/dist/services/storage.d.ts +1 -0
- package/dist/services/storage.js +1 -1
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +1 -1
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +7 -3
- package/dist/services/tables-db.d.ts +7 -3
- package/dist/services/tables-db.js +7 -2
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +7 -2
- package/dist/services/tables-db.mjs.map +1 -1
- package/dist/services/teams.d.mts +1 -0
- package/dist/services/teams.d.ts +1 -0
- package/dist/services/teams.js +1 -1
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +1 -1
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/tokens.d.mts +1 -0
- package/dist/services/tokens.d.ts +1 -0
- package/dist/services/tokens.js +1 -1
- package/dist/services/tokens.js.map +1 -1
- package/dist/services/tokens.mjs +1 -1
- package/dist/services/tokens.mjs.map +1 -1
- package/dist/services/users.d.mts +1 -0
- package/dist/services/users.d.ts +1 -0
- package/dist/services/users.js +1 -1
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +1 -1
- package/dist/services/users.mjs.map +1 -1
- package/dist/services/webhooks.d.mts +33 -26
- package/dist/services/webhooks.d.ts +33 -26
- package/dist/services/webhooks.js +38 -28
- package/dist/services/webhooks.js.map +1 -1
- package/dist/services/webhooks.mjs +38 -28
- package/dist/services/webhooks.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ import '../enums/index-status.mjs';
|
|
|
8
8
|
import '../enums/deployment-status.mjs';
|
|
9
9
|
import '../enums/execution-trigger.mjs';
|
|
10
10
|
import '../enums/execution-status.mjs';
|
|
11
|
+
import '../enums/platform-type.mjs';
|
|
11
12
|
import '../enums/health-antivirus-status.mjs';
|
|
12
13
|
import '../enums/health-check-status.mjs';
|
|
13
14
|
import '../enums/message-status.mjs';
|
|
@@ -18,7 +19,7 @@ declare class Webhooks {
|
|
|
18
19
|
/**
|
|
19
20
|
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
20
21
|
*
|
|
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,
|
|
22
|
+
* @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, authUsername, tls, events, enabled, logs, attempts
|
|
22
23
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
24
|
* @throws {AppwriteException}
|
|
24
25
|
* @returns {Promise<Models.WebhookList>}
|
|
@@ -30,7 +31,7 @@ declare class Webhooks {
|
|
|
30
31
|
/**
|
|
31
32
|
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
32
33
|
*
|
|
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,
|
|
34
|
+
* @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, authUsername, tls, events, enabled, logs, attempts
|
|
34
35
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
35
36
|
* @throws {AppwriteException}
|
|
36
37
|
* @returns {Promise<Models.WebhookList>}
|
|
@@ -45,9 +46,10 @@ declare class Webhooks {
|
|
|
45
46
|
* @param {string} params.name - Webhook name. Max length: 128 chars.
|
|
46
47
|
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
47
48
|
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
48
|
-
* @param {boolean} params.
|
|
49
|
-
* @param {string} params.
|
|
50
|
-
* @param {string} params.
|
|
49
|
+
* @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.
|
|
50
|
+
* @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
51
|
+
* @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
52
|
+
* @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
51
53
|
* @throws {AppwriteException}
|
|
52
54
|
* @returns {Promise<Models.Webhook>}
|
|
53
55
|
*/
|
|
@@ -57,9 +59,10 @@ declare class Webhooks {
|
|
|
57
59
|
name: string;
|
|
58
60
|
events: string[];
|
|
59
61
|
enabled?: boolean;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
tls?: boolean;
|
|
63
|
+
authUsername?: string;
|
|
64
|
+
authPassword?: string;
|
|
65
|
+
secret?: string;
|
|
63
66
|
}): Promise<Models.Webhook>;
|
|
64
67
|
/**
|
|
65
68
|
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
|
|
@@ -69,14 +72,15 @@ declare class Webhooks {
|
|
|
69
72
|
* @param {string} name - Webhook name. Max length: 128 chars.
|
|
70
73
|
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
71
74
|
* @param {boolean} enabled - Enable or disable a webhook.
|
|
72
|
-
* @param {boolean}
|
|
73
|
-
* @param {string}
|
|
74
|
-
* @param {string}
|
|
75
|
+
* @param {boolean} tls - Certificate verification, false for disabled or true for enabled.
|
|
76
|
+
* @param {string} authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
77
|
+
* @param {string} authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
78
|
+
* @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
75
79
|
* @throws {AppwriteException}
|
|
76
80
|
* @returns {Promise<Models.Webhook>}
|
|
77
81
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
78
82
|
*/
|
|
79
|
-
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean,
|
|
83
|
+
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string): Promise<Models.Webhook>;
|
|
80
84
|
/**
|
|
81
85
|
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
82
86
|
*
|
|
@@ -104,9 +108,9 @@ declare class Webhooks {
|
|
|
104
108
|
* @param {string} params.url - Webhook URL.
|
|
105
109
|
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
106
110
|
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
107
|
-
* @param {boolean} params.
|
|
108
|
-
* @param {string} params.
|
|
109
|
-
* @param {string} params.
|
|
111
|
+
* @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.
|
|
112
|
+
* @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
113
|
+
* @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
110
114
|
* @throws {AppwriteException}
|
|
111
115
|
* @returns {Promise<Models.Webhook>}
|
|
112
116
|
*/
|
|
@@ -116,9 +120,9 @@ declare class Webhooks {
|
|
|
116
120
|
url: string;
|
|
117
121
|
events: string[];
|
|
118
122
|
enabled?: boolean;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
tls?: boolean;
|
|
124
|
+
authUsername?: string;
|
|
125
|
+
authPassword?: string;
|
|
122
126
|
}): Promise<Models.Webhook>;
|
|
123
127
|
/**
|
|
124
128
|
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
@@ -128,14 +132,14 @@ declare class Webhooks {
|
|
|
128
132
|
* @param {string} url - Webhook URL.
|
|
129
133
|
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
130
134
|
* @param {boolean} enabled - Enable or disable a webhook.
|
|
131
|
-
* @param {boolean}
|
|
132
|
-
* @param {string}
|
|
133
|
-
* @param {string}
|
|
135
|
+
* @param {boolean} tls - Certificate verification, false for disabled or true for enabled.
|
|
136
|
+
* @param {string} authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
137
|
+
* @param {string} authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
134
138
|
* @throws {AppwriteException}
|
|
135
139
|
* @returns {Promise<Models.Webhook>}
|
|
136
140
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
137
141
|
*/
|
|
138
|
-
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean,
|
|
142
|
+
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string): Promise<Models.Webhook>;
|
|
139
143
|
/**
|
|
140
144
|
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
141
145
|
*
|
|
@@ -156,24 +160,27 @@ declare class Webhooks {
|
|
|
156
160
|
*/
|
|
157
161
|
delete(webhookId: string): Promise<{}>;
|
|
158
162
|
/**
|
|
159
|
-
* Update the webhook
|
|
163
|
+
* Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.
|
|
160
164
|
*
|
|
161
165
|
* @param {string} params.webhookId - Webhook ID.
|
|
166
|
+
* @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
162
167
|
* @throws {AppwriteException}
|
|
163
168
|
* @returns {Promise<Models.Webhook>}
|
|
164
169
|
*/
|
|
165
|
-
|
|
170
|
+
updateSecret(params: {
|
|
166
171
|
webhookId: string;
|
|
172
|
+
secret?: string;
|
|
167
173
|
}): Promise<Models.Webhook>;
|
|
168
174
|
/**
|
|
169
|
-
* Update the webhook
|
|
175
|
+
* Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.
|
|
170
176
|
*
|
|
171
177
|
* @param {string} webhookId - Webhook ID.
|
|
178
|
+
* @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
172
179
|
* @throws {AppwriteException}
|
|
173
180
|
* @returns {Promise<Models.Webhook>}
|
|
174
181
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
175
182
|
*/
|
|
176
|
-
|
|
183
|
+
updateSecret(webhookId: string, secret?: string): Promise<Models.Webhook>;
|
|
177
184
|
}
|
|
178
185
|
|
|
179
186
|
export { Webhooks };
|
|
@@ -8,6 +8,7 @@ import '../enums/index-status.js';
|
|
|
8
8
|
import '../enums/deployment-status.js';
|
|
9
9
|
import '../enums/execution-trigger.js';
|
|
10
10
|
import '../enums/execution-status.js';
|
|
11
|
+
import '../enums/platform-type.js';
|
|
11
12
|
import '../enums/health-antivirus-status.js';
|
|
12
13
|
import '../enums/health-check-status.js';
|
|
13
14
|
import '../enums/message-status.js';
|
|
@@ -18,7 +19,7 @@ declare class Webhooks {
|
|
|
18
19
|
/**
|
|
19
20
|
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
20
21
|
*
|
|
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,
|
|
22
|
+
* @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, authUsername, tls, events, enabled, logs, attempts
|
|
22
23
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
24
|
* @throws {AppwriteException}
|
|
24
25
|
* @returns {Promise<Models.WebhookList>}
|
|
@@ -30,7 +31,7 @@ declare class Webhooks {
|
|
|
30
31
|
/**
|
|
31
32
|
* Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
|
|
32
33
|
*
|
|
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,
|
|
34
|
+
* @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, authUsername, tls, events, enabled, logs, attempts
|
|
34
35
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
35
36
|
* @throws {AppwriteException}
|
|
36
37
|
* @returns {Promise<Models.WebhookList>}
|
|
@@ -45,9 +46,10 @@ declare class Webhooks {
|
|
|
45
46
|
* @param {string} params.name - Webhook name. Max length: 128 chars.
|
|
46
47
|
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
47
48
|
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
48
|
-
* @param {boolean} params.
|
|
49
|
-
* @param {string} params.
|
|
50
|
-
* @param {string} params.
|
|
49
|
+
* @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.
|
|
50
|
+
* @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
51
|
+
* @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
52
|
+
* @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
51
53
|
* @throws {AppwriteException}
|
|
52
54
|
* @returns {Promise<Models.Webhook>}
|
|
53
55
|
*/
|
|
@@ -57,9 +59,10 @@ declare class Webhooks {
|
|
|
57
59
|
name: string;
|
|
58
60
|
events: string[];
|
|
59
61
|
enabled?: boolean;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
tls?: boolean;
|
|
63
|
+
authUsername?: string;
|
|
64
|
+
authPassword?: string;
|
|
65
|
+
secret?: string;
|
|
63
66
|
}): Promise<Models.Webhook>;
|
|
64
67
|
/**
|
|
65
68
|
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
|
|
@@ -69,14 +72,15 @@ declare class Webhooks {
|
|
|
69
72
|
* @param {string} name - Webhook name. Max length: 128 chars.
|
|
70
73
|
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
71
74
|
* @param {boolean} enabled - Enable or disable a webhook.
|
|
72
|
-
* @param {boolean}
|
|
73
|
-
* @param {string}
|
|
74
|
-
* @param {string}
|
|
75
|
+
* @param {boolean} tls - Certificate verification, false for disabled or true for enabled.
|
|
76
|
+
* @param {string} authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
77
|
+
* @param {string} authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
78
|
+
* @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
75
79
|
* @throws {AppwriteException}
|
|
76
80
|
* @returns {Promise<Models.Webhook>}
|
|
77
81
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
78
82
|
*/
|
|
79
|
-
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean,
|
|
83
|
+
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string): Promise<Models.Webhook>;
|
|
80
84
|
/**
|
|
81
85
|
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
82
86
|
*
|
|
@@ -104,9 +108,9 @@ declare class Webhooks {
|
|
|
104
108
|
* @param {string} params.url - Webhook URL.
|
|
105
109
|
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
106
110
|
* @param {boolean} params.enabled - Enable or disable a webhook.
|
|
107
|
-
* @param {boolean} params.
|
|
108
|
-
* @param {string} params.
|
|
109
|
-
* @param {string} params.
|
|
111
|
+
* @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.
|
|
112
|
+
* @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
113
|
+
* @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
110
114
|
* @throws {AppwriteException}
|
|
111
115
|
* @returns {Promise<Models.Webhook>}
|
|
112
116
|
*/
|
|
@@ -116,9 +120,9 @@ declare class Webhooks {
|
|
|
116
120
|
url: string;
|
|
117
121
|
events: string[];
|
|
118
122
|
enabled?: boolean;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
tls?: boolean;
|
|
124
|
+
authUsername?: string;
|
|
125
|
+
authPassword?: string;
|
|
122
126
|
}): Promise<Models.Webhook>;
|
|
123
127
|
/**
|
|
124
128
|
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
@@ -128,14 +132,14 @@ declare class Webhooks {
|
|
|
128
132
|
* @param {string} url - Webhook URL.
|
|
129
133
|
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
130
134
|
* @param {boolean} enabled - Enable or disable a webhook.
|
|
131
|
-
* @param {boolean}
|
|
132
|
-
* @param {string}
|
|
133
|
-
* @param {string}
|
|
135
|
+
* @param {boolean} tls - Certificate verification, false for disabled or true for enabled.
|
|
136
|
+
* @param {string} authUsername - Webhook HTTP user. Max length: 256 chars.
|
|
137
|
+
* @param {string} authPassword - Webhook HTTP password. Max length: 256 chars.
|
|
134
138
|
* @throws {AppwriteException}
|
|
135
139
|
* @returns {Promise<Models.Webhook>}
|
|
136
140
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
137
141
|
*/
|
|
138
|
-
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean,
|
|
142
|
+
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string): Promise<Models.Webhook>;
|
|
139
143
|
/**
|
|
140
144
|
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
141
145
|
*
|
|
@@ -156,24 +160,27 @@ declare class Webhooks {
|
|
|
156
160
|
*/
|
|
157
161
|
delete(webhookId: string): Promise<{}>;
|
|
158
162
|
/**
|
|
159
|
-
* Update the webhook
|
|
163
|
+
* Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.
|
|
160
164
|
*
|
|
161
165
|
* @param {string} params.webhookId - Webhook ID.
|
|
166
|
+
* @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
162
167
|
* @throws {AppwriteException}
|
|
163
168
|
* @returns {Promise<Models.Webhook>}
|
|
164
169
|
*/
|
|
165
|
-
|
|
170
|
+
updateSecret(params: {
|
|
166
171
|
webhookId: string;
|
|
172
|
+
secret?: string;
|
|
167
173
|
}): Promise<Models.Webhook>;
|
|
168
174
|
/**
|
|
169
|
-
* Update the webhook
|
|
175
|
+
* Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.
|
|
170
176
|
*
|
|
171
177
|
* @param {string} webhookId - Webhook ID.
|
|
178
|
+
* @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
172
179
|
* @throws {AppwriteException}
|
|
173
180
|
* @returns {Promise<Models.Webhook>}
|
|
174
181
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
175
182
|
*/
|
|
176
|
-
|
|
183
|
+
updateSecret(webhookId: string, secret?: string): Promise<Models.Webhook>;
|
|
177
184
|
}
|
|
178
185
|
|
|
179
186
|
export { Webhooks };
|
|
@@ -46,9 +46,10 @@ class Webhooks {
|
|
|
46
46
|
name: rest[1],
|
|
47
47
|
events: rest[2],
|
|
48
48
|
enabled: rest[3],
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
tls: rest[4],
|
|
50
|
+
authUsername: rest[5],
|
|
51
|
+
authPassword: rest[6],
|
|
52
|
+
secret: rest[7]
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
const webhookId = params.webhookId;
|
|
@@ -56,9 +57,10 @@ class Webhooks {
|
|
|
56
57
|
const name = params.name;
|
|
57
58
|
const events = params.events;
|
|
58
59
|
const enabled = params.enabled;
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
60
|
+
const tls = params.tls;
|
|
61
|
+
const authUsername = params.authUsername;
|
|
62
|
+
const authPassword = params.authPassword;
|
|
63
|
+
const secret = params.secret;
|
|
62
64
|
if (typeof webhookId === "undefined") {
|
|
63
65
|
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
64
66
|
}
|
|
@@ -88,14 +90,17 @@ class Webhooks {
|
|
|
88
90
|
if (typeof enabled !== "undefined") {
|
|
89
91
|
payload["enabled"] = enabled;
|
|
90
92
|
}
|
|
91
|
-
if (typeof
|
|
92
|
-
payload["
|
|
93
|
+
if (typeof tls !== "undefined") {
|
|
94
|
+
payload["tls"] = tls;
|
|
93
95
|
}
|
|
94
|
-
if (typeof
|
|
95
|
-
payload["
|
|
96
|
+
if (typeof authUsername !== "undefined") {
|
|
97
|
+
payload["authUsername"] = authUsername;
|
|
96
98
|
}
|
|
97
|
-
if (typeof
|
|
98
|
-
payload["
|
|
99
|
+
if (typeof authPassword !== "undefined") {
|
|
100
|
+
payload["authPassword"] = authPassword;
|
|
101
|
+
}
|
|
102
|
+
if (typeof secret !== "undefined") {
|
|
103
|
+
payload["secret"] = secret;
|
|
99
104
|
}
|
|
100
105
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
101
106
|
const apiHeaders = {
|
|
@@ -143,9 +148,9 @@ class Webhooks {
|
|
|
143
148
|
url: rest[1],
|
|
144
149
|
events: rest[2],
|
|
145
150
|
enabled: rest[3],
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
151
|
+
tls: rest[4],
|
|
152
|
+
authUsername: rest[5],
|
|
153
|
+
authPassword: rest[6]
|
|
149
154
|
};
|
|
150
155
|
}
|
|
151
156
|
const webhookId = params.webhookId;
|
|
@@ -153,9 +158,9 @@ class Webhooks {
|
|
|
153
158
|
const url = params.url;
|
|
154
159
|
const events = params.events;
|
|
155
160
|
const enabled = params.enabled;
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
const
|
|
161
|
+
const tls = params.tls;
|
|
162
|
+
const authUsername = params.authUsername;
|
|
163
|
+
const authPassword = params.authPassword;
|
|
159
164
|
if (typeof webhookId === "undefined") {
|
|
160
165
|
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
161
166
|
}
|
|
@@ -182,14 +187,14 @@ class Webhooks {
|
|
|
182
187
|
if (typeof enabled !== "undefined") {
|
|
183
188
|
payload["enabled"] = enabled;
|
|
184
189
|
}
|
|
185
|
-
if (typeof
|
|
186
|
-
payload["
|
|
190
|
+
if (typeof tls !== "undefined") {
|
|
191
|
+
payload["tls"] = tls;
|
|
187
192
|
}
|
|
188
|
-
if (typeof
|
|
189
|
-
payload["
|
|
193
|
+
if (typeof authUsername !== "undefined") {
|
|
194
|
+
payload["authUsername"] = authUsername;
|
|
190
195
|
}
|
|
191
|
-
if (typeof
|
|
192
|
-
payload["
|
|
196
|
+
if (typeof authPassword !== "undefined") {
|
|
197
|
+
payload["authPassword"] = authPassword;
|
|
193
198
|
}
|
|
194
199
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
195
200
|
const apiHeaders = {
|
|
@@ -228,21 +233,26 @@ class Webhooks {
|
|
|
228
233
|
payload
|
|
229
234
|
);
|
|
230
235
|
}
|
|
231
|
-
|
|
236
|
+
updateSecret(paramsOrFirst, ...rest) {
|
|
232
237
|
let params;
|
|
233
238
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
234
239
|
params = paramsOrFirst || {};
|
|
235
240
|
} else {
|
|
236
241
|
params = {
|
|
237
|
-
webhookId: paramsOrFirst
|
|
242
|
+
webhookId: paramsOrFirst,
|
|
243
|
+
secret: rest[0]
|
|
238
244
|
};
|
|
239
245
|
}
|
|
240
246
|
const webhookId = params.webhookId;
|
|
247
|
+
const secret = params.secret;
|
|
241
248
|
if (typeof webhookId === "undefined") {
|
|
242
249
|
throw new client.AppwriteException('Missing required parameter: "webhookId"');
|
|
243
250
|
}
|
|
244
|
-
const apiPath = "/webhooks/{webhookId}/
|
|
251
|
+
const apiPath = "/webhooks/{webhookId}/secret".replace("{webhookId}", webhookId);
|
|
245
252
|
const payload = {};
|
|
253
|
+
if (typeof secret !== "undefined") {
|
|
254
|
+
payload["secret"] = secret;
|
|
255
|
+
}
|
|
246
256
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
247
257
|
const apiHeaders = {
|
|
248
258
|
"content-type": "application/json"
|
|
@@ -257,5 +267,5 @@ class Webhooks {
|
|
|
257
267
|
}
|
|
258
268
|
|
|
259
269
|
exports.Webhooks = Webhooks;
|
|
260
|
-
//# sourceMappingURL=
|
|
270
|
+
//# sourceMappingURL=webhooks.js.map
|
|
261
271
|
//# sourceMappingURL=webhooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/webhooks.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AAIjE,MAAM,SAAS;AAAA,EAGlB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EAqBA,KACI,kBACG,MACwB;AAC3B,QAAI;AAEJ,QAAI,CAAC,iBAAkB,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACzG,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,SAAS;AAAA,QACT,OAAO,KAAK,CAAC;AAAA,MACjB;AAAA,IACJ;AAEA,UAAM,UAAU,OAAO;AACvB,UAAM,QAAQ,OAAO;AAGrB,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,UAAU,aAAa;AAC9B,cAAQ,OAAO,IAAI;AAAA,IACvB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAiCA,OACI,kBACG,MACoB;AACvB,QAAI;AAEJ,QAAK,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACvF,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;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,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\n\nexport class Webhooks {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @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\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.WebhookList>}\n */\n list(params?: { queries?: string[], total?: boolean }): Promise<Models.WebhookList>;\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @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\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.WebhookList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n list(queries?: string[], total?: boolean): Promise<Models.WebhookList>;\n list(\n paramsOrFirst?: { queries?: string[], total?: boolean } | string[],\n ...rest: [(boolean)?] \n ): Promise<Models.WebhookList> {\n let params: { queries?: string[], total?: boolean };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n total: rest[0] as boolean \n };\n }\n \n const queries = params.queries;\n const total = params.total;\n\n\n const apiPath = '/webhooks';\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.\n *\n * @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.\n * @param {string} params.url - Webhook URL.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.\n * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n create(params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }): Promise<Models.Webhook>;\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.\n *\n * @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.\n * @param {string} url - Webhook URL.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} security - Certificate verification, false for disabled or true for enabled.\n * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.\n * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;\n create(\n paramsOrFirst: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string } | string,\n ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] \n ): Promise<Models.Webhook> {\n let params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n url: rest[0] as string,\n name: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n security: rest[4] as boolean,\n httpUser: rest[5] as string,\n httpPass: rest[6] as string \n };\n }\n \n const webhookId = params.webhookId;\n const url = params.url;\n const name = params.name;\n const events = params.events;\n const enabled = params.enabled;\n const security = params.security;\n const httpUser = params.httpUser;\n const httpPass = params.httpPass;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n if (typeof events === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"events\"');\n }\n\n const apiPath = '/webhooks';\n const payload: Payload = {};\n if (typeof webhookId !== 'undefined') {\n payload['webhookId'] = webhookId;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof security !== 'undefined') {\n payload['security'] = security;\n }\n if (typeof httpUser !== 'undefined') {\n payload['httpUser'] = httpUser;\n }\n if (typeof httpPass !== 'undefined') {\n payload['httpPass'] = httpPass;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. \n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n get(params: { webhookId: string }): Promise<Models.Webhook>;\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. \n *\n * @param {string} webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n get(webhookId: string): Promise<Models.Webhook>;\n get(\n paramsOrFirst: { webhookId: string } | string \n ): Promise<Models.Webhook> {\n let params: { webhookId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string \n };\n }\n \n const webhookId = params.webhookId;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n\n const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string} params.url - Webhook URL.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.\n * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n update(params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }): Promise<Models.Webhook>;\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} webhookId - Webhook ID.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string} url - Webhook URL.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} security - Certificate verification, false for disabled or true for enabled.\n * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.\n * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;\n update(\n paramsOrFirst: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string } | string,\n ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] \n ): Promise<Models.Webhook> {\n let params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n name: rest[0] as string,\n url: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n security: rest[4] as boolean,\n httpUser: rest[5] as string,\n httpPass: rest[6] as string \n };\n }\n \n const webhookId = params.webhookId;\n const name = params.name;\n const url = params.url;\n const events = params.events;\n const enabled = params.enabled;\n const security = params.security;\n const httpUser = params.httpUser;\n const httpPass = params.httpPass;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n if (typeof events === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"events\"');\n }\n\n const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof security !== 'undefined') {\n payload['security'] = security;\n }\n if (typeof httpUser !== 'undefined') {\n payload['httpUser'] = httpUser;\n }\n if (typeof httpPass !== 'undefined') {\n payload['httpPass'] = httpPass;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. \n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n delete(params: { webhookId: string }): Promise<{}>;\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. \n *\n * @param {string} webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n delete(webhookId: string): Promise<{}>;\n delete(\n paramsOrFirst: { webhookId: string } | string \n ): Promise<{}> {\n let params: { webhookId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string \n };\n }\n \n const webhookId = params.webhookId;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n\n const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * 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.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n updateSignature(params: { webhookId: string }): Promise<Models.Webhook>;\n /**\n * 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.\n *\n * @param {string} webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateSignature(webhookId: string): Promise<Models.Webhook>;\n updateSignature(\n paramsOrFirst: { webhookId: string } | string \n ): Promise<Models.Webhook> {\n let params: { webhookId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string \n };\n }\n \n const webhookId = params.webhookId;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n\n const apiPath = '/webhooks/{webhookId}/signature'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'patch',\n uri,\n apiHeaders,\n payload,\n );\n }\n}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OAAA,CAAQ,aAAA,EAAe,SAAS,CAAA;AAC/E,IAAA,MAAM,UAAmB,EAAC;AAC1B,IAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AAC/B,MAAA,OAAA,CAAQ,QAAQ,CAAA,GAAI,MAAA;AAAA,IACxB;AACA,IAAA,MAAM,MAAM,IAAI,GAAA,CAAI,KAAK,MAAA,CAAO,MAAA,CAAO,WAAW,OAAO,CAAA;AAEzD,IAAA,MAAM,UAAA,GAA2C;AAAA,MAC7C,cAAA,EAAgB;AAAA,KACpB;AAEA,IAAA,OAAO,KAAK,MAAA,CAAO,IAAA;AAAA,MACf,OAAA;AAAA,MACA,GAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACJ;AAAA,EACJ;AACJ","file":"webhooks.js","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\n\nexport class Webhooks {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @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, authUsername, tls, events, enabled, logs, attempts\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.WebhookList>}\n */\n list(params?: { queries?: string[], total?: boolean }): Promise<Models.WebhookList>;\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @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, authUsername, tls, events, enabled, logs, attempts\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.WebhookList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n list(queries?: string[], total?: boolean): Promise<Models.WebhookList>;\n list(\n paramsOrFirst?: { queries?: string[], total?: boolean } | string[],\n ...rest: [(boolean)?] \n ): Promise<Models.WebhookList> {\n let params: { queries?: string[], total?: boolean };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n total: rest[0] as boolean \n };\n }\n \n const queries = params.queries;\n const total = params.total;\n\n\n const apiPath = '/webhooks';\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.\n *\n * @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.\n * @param {string} params.url - Webhook URL.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars.\n * @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars.\n * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n create(params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string }): Promise<Models.Webhook>;\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.\n *\n * @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.\n * @param {string} url - Webhook URL.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} authUsername - Webhook HTTP user. Max length: 256 chars.\n * @param {string} authPassword - Webhook HTTP password. Max length: 256 chars.\n * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string): Promise<Models.Webhook>;\n create(\n paramsOrFirst: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string } | string,\n ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?, (string)?] \n ): Promise<Models.Webhook> {\n let params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n url: rest[0] as string,\n name: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n tls: rest[4] as boolean,\n authUsername: rest[5] as string,\n authPassword: rest[6] as string,\n secret: rest[7] as string \n };\n }\n \n const webhookId = params.webhookId;\n const url = params.url;\n const name = params.name;\n const events = params.events;\n const enabled = params.enabled;\n const tls = params.tls;\n const authUsername = params.authUsername;\n const authPassword = params.authPassword;\n const secret = params.secret;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n if (typeof events === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"events\"');\n }\n\n const apiPath = '/webhooks';\n const payload: Payload = {};\n if (typeof webhookId !== 'undefined') {\n payload['webhookId'] = webhookId;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof tls !== 'undefined') {\n payload['tls'] = tls;\n }\n if (typeof authUsername !== 'undefined') {\n payload['authUsername'] = authUsername;\n }\n if (typeof authPassword !== 'undefined') {\n payload['authPassword'] = authPassword;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. \n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n get(params: { webhookId: string }): Promise<Models.Webhook>;\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. \n *\n * @param {string} webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n get(webhookId: string): Promise<Models.Webhook>;\n get(\n paramsOrFirst: { webhookId: string } | string \n ): Promise<Models.Webhook> {\n let params: { webhookId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string \n };\n }\n \n const webhookId = params.webhookId;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n\n const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string} params.url - Webhook URL.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars.\n * @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n update(params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string }): Promise<Models.Webhook>;\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} webhookId - Webhook ID.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string} url - Webhook URL.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} authUsername - Webhook HTTP user. Max length: 256 chars.\n * @param {string} authPassword - Webhook HTTP password. Max length: 256 chars.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string): Promise<Models.Webhook>;\n update(\n paramsOrFirst: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string } | string,\n ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] \n ): Promise<Models.Webhook> {\n let params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n name: rest[0] as string,\n url: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n tls: rest[4] as boolean,\n authUsername: rest[5] as string,\n authPassword: rest[6] as string \n };\n }\n \n const webhookId = params.webhookId;\n const name = params.name;\n const url = params.url;\n const events = params.events;\n const enabled = params.enabled;\n const tls = params.tls;\n const authUsername = params.authUsername;\n const authPassword = params.authPassword;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n if (typeof url === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"url\"');\n }\n if (typeof events === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"events\"');\n }\n\n const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof tls !== 'undefined') {\n payload['tls'] = tls;\n }\n if (typeof authUsername !== 'undefined') {\n payload['authUsername'] = authUsername;\n }\n if (typeof authPassword !== 'undefined') {\n payload['authPassword'] = authPassword;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. \n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n delete(params: { webhookId: string }): Promise<{}>;\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. \n *\n * @param {string} webhookId - Webhook ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n delete(webhookId: string): Promise<{}>;\n delete(\n paramsOrFirst: { webhookId: string } | string \n ): Promise<{}> {\n let params: { webhookId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string \n };\n }\n \n const webhookId = params.webhookId;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n\n const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n */\n updateSecret(params: { webhookId: string, secret?: string }): Promise<Models.Webhook>;\n /**\n * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.\n *\n * @param {string} webhookId - Webhook ID.\n * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateSecret(webhookId: string, secret?: string): Promise<Models.Webhook>;\n updateSecret(\n paramsOrFirst: { webhookId: string, secret?: string } | string,\n ...rest: [(string)?] \n ): Promise<Models.Webhook> {\n let params: { webhookId: string, secret?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { webhookId: string, secret?: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n secret: rest[0] as string \n };\n }\n \n const webhookId = params.webhookId;\n const secret = params.secret;\n\n if (typeof webhookId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"webhookId\"');\n }\n\n const apiPath = '/webhooks/{webhookId}/secret'.replace('{webhookId}', webhookId);\n const payload: Payload = {};\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'patch',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}
|