@verdocs/js-sdk 3.10.9 → 3.10.11

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.
@@ -8,7 +8,7 @@ export interface ICreateEnvelopeRequest {
8
8
  roles: ICreateEnvelopeRole[];
9
9
  name: string;
10
10
  environment?: string;
11
- prepared_fields: {
11
+ prepared_fields?: {
12
12
  name: string;
13
13
  value: string;
14
14
  }[];
@@ -1,3 +1,34 @@
1
1
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
2
- export declare const getWebhook: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<any>;
3
- export declare const updateWebhook: (endpoint: VerdocsEndpoint, organizationId: string, params: any) => Promise<any>;
2
+ export interface ISetWebhookRequest {
3
+ url: string;
4
+ active: boolean;
5
+ events: {
6
+ envelope_created: boolean;
7
+ envelope_completed: boolean;
8
+ envelope_canceled: boolean;
9
+ template_created: boolean;
10
+ template_updated: boolean;
11
+ template_deleted: boolean;
12
+ template_used: boolean;
13
+ };
14
+ }
15
+ export interface IWebhook {
16
+ id: string;
17
+ organization_id: string;
18
+ url: string;
19
+ active: boolean;
20
+ events: {
21
+ envelope_created: boolean;
22
+ envelope_completed: boolean;
23
+ envelope_canceled: boolean;
24
+ template_created: boolean;
25
+ template_updated: boolean;
26
+ template_deleted: boolean;
27
+ template_used: boolean;
28
+ };
29
+ status: string;
30
+ last_success: string;
31
+ last_failure: string;
32
+ }
33
+ export declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
34
+ export declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
@@ -1,10 +1,10 @@
1
- export var getWebhook = function (endpoint, organizationId) {
1
+ export var getWebhooks = function (endpoint) {
2
2
  return endpoint.api //
3
- .get("/organizations/".concat(organizationId, "/webhook"))
3
+ .get("/v2/webhooks/organization")
4
4
  .then(function (r) { return r.data; });
5
5
  };
6
- export var updateWebhook = function (endpoint, organizationId, params) {
6
+ export var setWebhooks = function (endpoint, params) {
7
7
  return endpoint.api //
8
- .post("/organizations/".concat(organizationId, "/webhook"), params)
8
+ .post("/v2/webhooks/organization", params)
9
9
  .then(function (r) { return r.data; });
10
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.10.9",
3
+ "version": "3.10.11",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",