@appwrite.io/console 4.0.0 → 6.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +2 -2
  3. package/dist/cjs/sdk.js +752 -383
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +752 -384
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +752 -383
  8. package/docs/examples/domains/update-purchase.md +16 -0
  9. package/docs/examples/domains/update-transfer-in.md +16 -0
  10. package/docs/examples/functions/create.md +3 -1
  11. package/docs/examples/functions/update.md +3 -1
  12. package/docs/examples/sites/create.md +4 -1
  13. package/docs/examples/sites/update.md +4 -1
  14. package/docs/examples/{projects/update-webhook.md → webhooks/create.md} +5 -6
  15. package/docs/examples/{projects/get-webhook.md → webhooks/delete.md} +3 -4
  16. package/docs/examples/{projects/delete-webhook.md → webhooks/get.md} +3 -4
  17. package/docs/examples/{projects/list-webhooks.md → webhooks/list.md} +4 -4
  18. package/docs/examples/{projects/update-webhook-signature.md → webhooks/update-signature.md} +3 -4
  19. package/docs/examples/{projects/create-webhook.md → webhooks/update.md} +6 -6
  20. package/package.json +1 -1
  21. package/src/client.ts +5 -1
  22. package/src/enums/appwrite-migration-resource.ts +4 -0
  23. package/src/enums/build-runtime.ts +86 -0
  24. package/src/enums/domain-purchase-status.ts +6 -0
  25. package/src/enums/{domain-transfer-status-status.ts → domain-transfer-status-enum.ts} +1 -1
  26. package/src/enums/runtime.ts +86 -0
  27. package/src/enums/runtimes.ts +86 -0
  28. package/src/enums/scopes.ts +2 -0
  29. package/src/index.ts +3 -1
  30. package/src/models.ts +140 -13
  31. package/src/services/account.ts +2 -2
  32. package/src/services/domains.ts +136 -10
  33. package/src/services/functions.ts +52 -24
  34. package/src/services/organizations.ts +2 -2
  35. package/src/services/projects.ts +0 -473
  36. package/src/services/sites.ts +83 -41
  37. package/src/services/webhooks.ts +451 -0
  38. package/types/enums/appwrite-migration-resource.d.ts +4 -0
  39. package/types/enums/build-runtime.d.ts +87 -1
  40. package/types/enums/domain-purchase-status.d.ts +6 -0
  41. package/types/enums/{domain-transfer-status-status.d.ts → domain-transfer-status-enum.d.ts} +1 -1
  42. package/types/enums/runtime.d.ts +87 -1
  43. package/types/enums/runtimes.d.ts +87 -1
  44. package/types/enums/scopes.d.ts +2 -0
  45. package/types/index.d.ts +3 -1
  46. package/types/models.d.ts +139 -13
  47. package/types/services/account.d.ts +2 -2
  48. package/types/services/domains.d.ts +52 -8
  49. package/types/services/functions.d.ts +20 -8
  50. package/types/services/organizations.d.ts +2 -2
  51. package/types/services/projects.d.ts +0 -171
  52. package/types/services/sites.d.ts +26 -8
  53. package/types/services/webhooks.d.ts +165 -0
@@ -1235,7 +1235,7 @@ export class Organizations {
1235
1235
  * List all invoices for an organization.
1236
1236
  *
1237
1237
  * @param {string} params.organizationId - Organization ID
1238
- * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, amount, currency, from, to, dueAt, attempts, status, grossAmount
1238
+ * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount
1239
1239
  * @throws {AppwriteException}
1240
1240
  * @returns {Promise<Models.InvoiceList>}
1241
1241
  */
@@ -1244,7 +1244,7 @@ export class Organizations {
1244
1244
  * List all invoices for an organization.
1245
1245
  *
1246
1246
  * @param {string} organizationId - Organization ID
1247
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, amount, currency, from, to, dueAt, attempts, status, grossAmount
1247
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount
1248
1248
  * @throws {AppwriteException}
1249
1249
  * @returns {Promise<Models.InvoiceList>}
1250
1250
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -4428,477 +4428,4 @@ export class Projects {
4428
4428
  payload
4429
4429
  );
4430
4430
  }
4431
-
4432
- /**
4433
- * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
4434
- *
4435
- * @param {string} params.projectId - Project unique ID.
4436
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
4437
- * @throws {AppwriteException}
4438
- * @returns {Promise<Models.WebhookList>}
4439
- */
4440
- listWebhooks(params: { projectId: string, total?: boolean }): Promise<Models.WebhookList>;
4441
- /**
4442
- * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.
4443
- *
4444
- * @param {string} projectId - Project unique ID.
4445
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
4446
- * @throws {AppwriteException}
4447
- * @returns {Promise<Models.WebhookList>}
4448
- * @deprecated Use the object parameter style method for a better developer experience.
4449
- */
4450
- listWebhooks(projectId: string, total?: boolean): Promise<Models.WebhookList>;
4451
- listWebhooks(
4452
- paramsOrFirst: { projectId: string, total?: boolean } | string,
4453
- ...rest: [(boolean)?]
4454
- ): Promise<Models.WebhookList> {
4455
- let params: { projectId: string, total?: boolean };
4456
-
4457
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4458
- params = (paramsOrFirst || {}) as { projectId: string, total?: boolean };
4459
- } else {
4460
- params = {
4461
- projectId: paramsOrFirst as string,
4462
- total: rest[0] as boolean
4463
- };
4464
- }
4465
-
4466
- const projectId = params.projectId;
4467
- const total = params.total;
4468
-
4469
- if (typeof projectId === 'undefined') {
4470
- throw new AppwriteException('Missing required parameter: "projectId"');
4471
- }
4472
-
4473
- const apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
4474
- const payload: Payload = {};
4475
- if (typeof total !== 'undefined') {
4476
- payload['total'] = total;
4477
- }
4478
- const uri = new URL(this.client.config.endpoint + apiPath);
4479
-
4480
- const apiHeaders: { [header: string]: string } = {
4481
- }
4482
-
4483
- return this.client.call(
4484
- 'get',
4485
- uri,
4486
- apiHeaders,
4487
- payload
4488
- );
4489
- }
4490
-
4491
- /**
4492
- * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
4493
- *
4494
- * @param {string} params.projectId - Project unique ID.
4495
- * @param {string} params.name - Webhook name. Max length: 128 chars.
4496
- * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
4497
- * @param {string} params.url - Webhook URL.
4498
- * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.
4499
- * @param {boolean} params.enabled - Enable or disable a webhook.
4500
- * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.
4501
- * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.
4502
- * @throws {AppwriteException}
4503
- * @returns {Promise<Models.Webhook>}
4504
- */
4505
- createWebhook(params: { projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string }): Promise<Models.Webhook>;
4506
- /**
4507
- * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.
4508
- *
4509
- * @param {string} projectId - Project unique ID.
4510
- * @param {string} name - Webhook name. Max length: 128 chars.
4511
- * @param {string[]} events - Events list. Maximum of 100 events are allowed.
4512
- * @param {string} url - Webhook URL.
4513
- * @param {boolean} security - Certificate verification, false for disabled or true for enabled.
4514
- * @param {boolean} enabled - Enable or disable a webhook.
4515
- * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.
4516
- * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.
4517
- * @throws {AppwriteException}
4518
- * @returns {Promise<Models.Webhook>}
4519
- * @deprecated Use the object parameter style method for a better developer experience.
4520
- */
4521
- createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
4522
- createWebhook(
4523
- paramsOrFirst: { projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string } | string,
4524
- ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (boolean)?, (string)?, (string)?]
4525
- ): Promise<Models.Webhook> {
4526
- let params: { projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string };
4527
-
4528
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4529
- params = (paramsOrFirst || {}) as { projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string };
4530
- } else {
4531
- params = {
4532
- projectId: paramsOrFirst as string,
4533
- name: rest[0] as string,
4534
- events: rest[1] as string[],
4535
- url: rest[2] as string,
4536
- security: rest[3] as boolean,
4537
- enabled: rest[4] as boolean,
4538
- httpUser: rest[5] as string,
4539
- httpPass: rest[6] as string
4540
- };
4541
- }
4542
-
4543
- const projectId = params.projectId;
4544
- const name = params.name;
4545
- const events = params.events;
4546
- const url = params.url;
4547
- const security = params.security;
4548
- const enabled = params.enabled;
4549
- const httpUser = params.httpUser;
4550
- const httpPass = params.httpPass;
4551
-
4552
- if (typeof projectId === 'undefined') {
4553
- throw new AppwriteException('Missing required parameter: "projectId"');
4554
- }
4555
- if (typeof name === 'undefined') {
4556
- throw new AppwriteException('Missing required parameter: "name"');
4557
- }
4558
- if (typeof events === 'undefined') {
4559
- throw new AppwriteException('Missing required parameter: "events"');
4560
- }
4561
- if (typeof url === 'undefined') {
4562
- throw new AppwriteException('Missing required parameter: "url"');
4563
- }
4564
- if (typeof security === 'undefined') {
4565
- throw new AppwriteException('Missing required parameter: "security"');
4566
- }
4567
-
4568
- const apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
4569
- const payload: Payload = {};
4570
- if (typeof name !== 'undefined') {
4571
- payload['name'] = name;
4572
- }
4573
- if (typeof enabled !== 'undefined') {
4574
- payload['enabled'] = enabled;
4575
- }
4576
- if (typeof events !== 'undefined') {
4577
- payload['events'] = events;
4578
- }
4579
- if (typeof url !== 'undefined') {
4580
- payload['url'] = url;
4581
- }
4582
- if (typeof security !== 'undefined') {
4583
- payload['security'] = security;
4584
- }
4585
- if (typeof httpUser !== 'undefined') {
4586
- payload['httpUser'] = httpUser;
4587
- }
4588
- if (typeof httpPass !== 'undefined') {
4589
- payload['httpPass'] = httpPass;
4590
- }
4591
- const uri = new URL(this.client.config.endpoint + apiPath);
4592
-
4593
- const apiHeaders: { [header: string]: string } = {
4594
- 'content-type': 'application/json',
4595
- }
4596
-
4597
- return this.client.call(
4598
- 'post',
4599
- uri,
4600
- apiHeaders,
4601
- payload
4602
- );
4603
- }
4604
-
4605
- /**
4606
- * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
4607
- *
4608
- * @param {string} params.projectId - Project unique ID.
4609
- * @param {string} params.webhookId - Webhook unique ID.
4610
- * @throws {AppwriteException}
4611
- * @returns {Promise<Models.Webhook>}
4612
- */
4613
- getWebhook(params: { projectId: string, webhookId: string }): Promise<Models.Webhook>;
4614
- /**
4615
- * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
4616
- *
4617
- * @param {string} projectId - Project unique ID.
4618
- * @param {string} webhookId - Webhook unique ID.
4619
- * @throws {AppwriteException}
4620
- * @returns {Promise<Models.Webhook>}
4621
- * @deprecated Use the object parameter style method for a better developer experience.
4622
- */
4623
- getWebhook(projectId: string, webhookId: string): Promise<Models.Webhook>;
4624
- getWebhook(
4625
- paramsOrFirst: { projectId: string, webhookId: string } | string,
4626
- ...rest: [(string)?]
4627
- ): Promise<Models.Webhook> {
4628
- let params: { projectId: string, webhookId: string };
4629
-
4630
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4631
- params = (paramsOrFirst || {}) as { projectId: string, webhookId: string };
4632
- } else {
4633
- params = {
4634
- projectId: paramsOrFirst as string,
4635
- webhookId: rest[0] as string
4636
- };
4637
- }
4638
-
4639
- const projectId = params.projectId;
4640
- const webhookId = params.webhookId;
4641
-
4642
- if (typeof projectId === 'undefined') {
4643
- throw new AppwriteException('Missing required parameter: "projectId"');
4644
- }
4645
- if (typeof webhookId === 'undefined') {
4646
- throw new AppwriteException('Missing required parameter: "webhookId"');
4647
- }
4648
-
4649
- const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
4650
- const payload: Payload = {};
4651
- const uri = new URL(this.client.config.endpoint + apiPath);
4652
-
4653
- const apiHeaders: { [header: string]: string } = {
4654
- }
4655
-
4656
- return this.client.call(
4657
- 'get',
4658
- uri,
4659
- apiHeaders,
4660
- payload
4661
- );
4662
- }
4663
-
4664
- /**
4665
- * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
4666
- *
4667
- * @param {string} params.projectId - Project unique ID.
4668
- * @param {string} params.webhookId - Webhook unique ID.
4669
- * @param {string} params.name - Webhook name. Max length: 128 chars.
4670
- * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
4671
- * @param {string} params.url - Webhook URL.
4672
- * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled.
4673
- * @param {boolean} params.enabled - Enable or disable a webhook.
4674
- * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars.
4675
- * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars.
4676
- * @throws {AppwriteException}
4677
- * @returns {Promise<Models.Webhook>}
4678
- */
4679
- updateWebhook(params: { projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string }): Promise<Models.Webhook>;
4680
- /**
4681
- * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
4682
- *
4683
- * @param {string} projectId - Project unique ID.
4684
- * @param {string} webhookId - Webhook unique ID.
4685
- * @param {string} name - Webhook name. Max length: 128 chars.
4686
- * @param {string[]} events - Events list. Maximum of 100 events are allowed.
4687
- * @param {string} url - Webhook URL.
4688
- * @param {boolean} security - Certificate verification, false for disabled or true for enabled.
4689
- * @param {boolean} enabled - Enable or disable a webhook.
4690
- * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars.
4691
- * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars.
4692
- * @throws {AppwriteException}
4693
- * @returns {Promise<Models.Webhook>}
4694
- * @deprecated Use the object parameter style method for a better developer experience.
4695
- */
4696
- updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
4697
- updateWebhook(
4698
- paramsOrFirst: { projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string } | string,
4699
- ...rest: [(string)?, (string)?, (string[])?, (string)?, (boolean)?, (boolean)?, (string)?, (string)?]
4700
- ): Promise<Models.Webhook> {
4701
- let params: { projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string };
4702
-
4703
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4704
- params = (paramsOrFirst || {}) as { projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string };
4705
- } else {
4706
- params = {
4707
- projectId: paramsOrFirst as string,
4708
- webhookId: rest[0] as string,
4709
- name: rest[1] as string,
4710
- events: rest[2] as string[],
4711
- url: rest[3] as string,
4712
- security: rest[4] as boolean,
4713
- enabled: rest[5] as boolean,
4714
- httpUser: rest[6] as string,
4715
- httpPass: rest[7] as string
4716
- };
4717
- }
4718
-
4719
- const projectId = params.projectId;
4720
- const webhookId = params.webhookId;
4721
- const name = params.name;
4722
- const events = params.events;
4723
- const url = params.url;
4724
- const security = params.security;
4725
- const enabled = params.enabled;
4726
- const httpUser = params.httpUser;
4727
- const httpPass = params.httpPass;
4728
-
4729
- if (typeof projectId === 'undefined') {
4730
- throw new AppwriteException('Missing required parameter: "projectId"');
4731
- }
4732
- if (typeof webhookId === 'undefined') {
4733
- throw new AppwriteException('Missing required parameter: "webhookId"');
4734
- }
4735
- if (typeof name === 'undefined') {
4736
- throw new AppwriteException('Missing required parameter: "name"');
4737
- }
4738
- if (typeof events === 'undefined') {
4739
- throw new AppwriteException('Missing required parameter: "events"');
4740
- }
4741
- if (typeof url === 'undefined') {
4742
- throw new AppwriteException('Missing required parameter: "url"');
4743
- }
4744
- if (typeof security === 'undefined') {
4745
- throw new AppwriteException('Missing required parameter: "security"');
4746
- }
4747
-
4748
- const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
4749
- const payload: Payload = {};
4750
- if (typeof name !== 'undefined') {
4751
- payload['name'] = name;
4752
- }
4753
- if (typeof enabled !== 'undefined') {
4754
- payload['enabled'] = enabled;
4755
- }
4756
- if (typeof events !== 'undefined') {
4757
- payload['events'] = events;
4758
- }
4759
- if (typeof url !== 'undefined') {
4760
- payload['url'] = url;
4761
- }
4762
- if (typeof security !== 'undefined') {
4763
- payload['security'] = security;
4764
- }
4765
- if (typeof httpUser !== 'undefined') {
4766
- payload['httpUser'] = httpUser;
4767
- }
4768
- if (typeof httpPass !== 'undefined') {
4769
- payload['httpPass'] = httpPass;
4770
- }
4771
- const uri = new URL(this.client.config.endpoint + apiPath);
4772
-
4773
- const apiHeaders: { [header: string]: string } = {
4774
- 'content-type': 'application/json',
4775
- }
4776
-
4777
- return this.client.call(
4778
- 'put',
4779
- uri,
4780
- apiHeaders,
4781
- payload
4782
- );
4783
- }
4784
-
4785
- /**
4786
- * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
4787
- *
4788
- * @param {string} params.projectId - Project unique ID.
4789
- * @param {string} params.webhookId - Webhook unique ID.
4790
- * @throws {AppwriteException}
4791
- * @returns {Promise<{}>}
4792
- */
4793
- deleteWebhook(params: { projectId: string, webhookId: string }): Promise<{}>;
4794
- /**
4795
- * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
4796
- *
4797
- * @param {string} projectId - Project unique ID.
4798
- * @param {string} webhookId - Webhook unique ID.
4799
- * @throws {AppwriteException}
4800
- * @returns {Promise<{}>}
4801
- * @deprecated Use the object parameter style method for a better developer experience.
4802
- */
4803
- deleteWebhook(projectId: string, webhookId: string): Promise<{}>;
4804
- deleteWebhook(
4805
- paramsOrFirst: { projectId: string, webhookId: string } | string,
4806
- ...rest: [(string)?]
4807
- ): Promise<{}> {
4808
- let params: { projectId: string, webhookId: string };
4809
-
4810
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4811
- params = (paramsOrFirst || {}) as { projectId: string, webhookId: string };
4812
- } else {
4813
- params = {
4814
- projectId: paramsOrFirst as string,
4815
- webhookId: rest[0] as string
4816
- };
4817
- }
4818
-
4819
- const projectId = params.projectId;
4820
- const webhookId = params.webhookId;
4821
-
4822
- if (typeof projectId === 'undefined') {
4823
- throw new AppwriteException('Missing required parameter: "projectId"');
4824
- }
4825
- if (typeof webhookId === 'undefined') {
4826
- throw new AppwriteException('Missing required parameter: "webhookId"');
4827
- }
4828
-
4829
- const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
4830
- const payload: Payload = {};
4831
- const uri = new URL(this.client.config.endpoint + apiPath);
4832
-
4833
- const apiHeaders: { [header: string]: string } = {
4834
- 'content-type': 'application/json',
4835
- }
4836
-
4837
- return this.client.call(
4838
- 'delete',
4839
- uri,
4840
- apiHeaders,
4841
- payload
4842
- );
4843
- }
4844
-
4845
- /**
4846
- * 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.
4847
- *
4848
- * @param {string} params.projectId - Project unique ID.
4849
- * @param {string} params.webhookId - Webhook unique ID.
4850
- * @throws {AppwriteException}
4851
- * @returns {Promise<Models.Webhook>}
4852
- */
4853
- updateWebhookSignature(params: { projectId: string, webhookId: string }): Promise<Models.Webhook>;
4854
- /**
4855
- * 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.
4856
- *
4857
- * @param {string} projectId - Project unique ID.
4858
- * @param {string} webhookId - Webhook unique ID.
4859
- * @throws {AppwriteException}
4860
- * @returns {Promise<Models.Webhook>}
4861
- * @deprecated Use the object parameter style method for a better developer experience.
4862
- */
4863
- updateWebhookSignature(projectId: string, webhookId: string): Promise<Models.Webhook>;
4864
- updateWebhookSignature(
4865
- paramsOrFirst: { projectId: string, webhookId: string } | string,
4866
- ...rest: [(string)?]
4867
- ): Promise<Models.Webhook> {
4868
- let params: { projectId: string, webhookId: string };
4869
-
4870
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4871
- params = (paramsOrFirst || {}) as { projectId: string, webhookId: string };
4872
- } else {
4873
- params = {
4874
- projectId: paramsOrFirst as string,
4875
- webhookId: rest[0] as string
4876
- };
4877
- }
4878
-
4879
- const projectId = params.projectId;
4880
- const webhookId = params.webhookId;
4881
-
4882
- if (typeof projectId === 'undefined') {
4883
- throw new AppwriteException('Missing required parameter: "projectId"');
4884
- }
4885
- if (typeof webhookId === 'undefined') {
4886
- throw new AppwriteException('Missing required parameter: "webhookId"');
4887
- }
4888
-
4889
- const apiPath = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
4890
- const payload: Payload = {};
4891
- const uri = new URL(this.client.config.endpoint + apiPath);
4892
-
4893
- const apiHeaders: { [header: string]: string } = {
4894
- 'content-type': 'application/json',
4895
- }
4896
-
4897
- return this.client.call(
4898
- 'patch',
4899
- uri,
4900
- apiHeaders,
4901
- payload
4902
- );
4903
- }
4904
4431
  }