@verdocs/js-sdk 1.3.3 → 2.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/Documents/Documents.d.ts +26 -9
- package/Documents/Documents.js +42 -27
- package/Documents/Initials.d.ts +2 -1
- package/Documents/Initials.js +3 -4
- package/Documents/Recipients.d.ts +5 -1
- package/Documents/Recipients.js +6 -4
- package/Documents/Signatures.d.ts +14 -4
- package/Documents/Signatures.js +21 -13
- package/Documents/index.d.ts +0 -1
- package/Documents/index.js +0 -1
- package/Organizations/ApiKeys.d.ts +6 -5
- package/Organizations/ApiKeys.js +15 -16
- package/Organizations/Groups.d.ts +8 -7
- package/Organizations/Groups.js +21 -22
- package/Organizations/Invitations.d.ts +8 -7
- package/Organizations/Invitations.js +21 -22
- package/Organizations/Members.d.ts +6 -5
- package/Organizations/Members.js +15 -16
- package/Organizations/Organizations.d.ts +7 -6
- package/Organizations/Organizations.js +18 -19
- package/Organizations/Webhooks.d.ts +3 -2
- package/Organizations/Webhooks.js +6 -7
- package/Organizations/Whitelabel.d.ts +3 -2
- package/Organizations/Whitelabel.js +6 -7
- package/Search/Content.d.ts +4 -3
- package/Search/Content.js +9 -10
- package/Templates/Fields.d.ts +4 -3
- package/Templates/Fields.js +9 -10
- package/Templates/Pages.d.ts +5 -4
- package/Templates/Pages.js +12 -13
- package/Templates/Reminders.d.ts +5 -4
- package/Templates/Reminders.js +12 -13
- package/Templates/Roles.d.ts +8 -7
- package/Templates/Roles.js +21 -22
- package/Templates/Stars.d.ts +3 -2
- package/Templates/Stars.js +6 -7
- package/Templates/Tags.d.ts +7 -6
- package/Templates/Tags.js +18 -19
- package/Templates/TemplateDocuments.d.ts +5 -4
- package/Templates/TemplateDocuments.js +12 -13
- package/Templates/Templates.d.ts +7 -6
- package/Templates/Templates.js +18 -19
- package/Templates/Validators.d.ts +3 -2
- package/Templates/Validators.js +7 -10
- package/Users/Auth.d.ts +9 -22
- package/Users/Auth.js +18 -71
- package/Users/Billing.d.ts +1 -1
- package/Users/Billing.js +1 -1
- package/Users/Notifications.d.ts +2 -1
- package/Users/Notifications.js +3 -4
- package/Users/Profiles.d.ts +11 -10
- package/Users/Profiles.js +30 -31
- package/Users/Types.d.ts +1 -1
- package/Utils/Token.d.ts +1 -1
- package/Utils/Token.js +2 -2
- package/{HTTP → Utils}/globalThis.d.ts +0 -0
- package/{HTTP → Utils}/globalThis.js +0 -0
- package/VerdocsEndpoint.d.ts +188 -0
- package/VerdocsEndpoint.js +285 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/Documents/Stars.d.ts +0 -2
- package/Documents/Stars.js +0 -40
- package/HTTP/Transport.d.ts +0 -34
- package/HTTP/Transport.js +0 -47
- package/HTTP/Types.d.ts +0 -1
- package/HTTP/Types.js +0 -1
- package/HTTP/VerdocsEndpoint.d.ts +0 -106
- package/HTTP/VerdocsEndpoint.js +0 -141
- package/HTTP/index.d.ts +0 -3
- package/HTTP/index.js +0 -3
package/HTTP/VerdocsEndpoint.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
var requestLogger = function (r) {
|
|
3
|
-
// tslint:disable-next-line
|
|
4
|
-
console.debug("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
5
|
-
return r;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* VerdocsEndpoint is a class wrapper for a specific connection and authorization context for calling the Verdocs APIs.
|
|
9
|
-
* Endpoints can be used for isolated session tasks.
|
|
10
|
-
* For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.
|
|
11
|
-
* In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then
|
|
12
|
-
* discarded once signing is complete.
|
|
13
|
-
*
|
|
14
|
-
* Note that endpoint configuration functions return the instance, so they can be chained, e.g.
|
|
15
|
-
*
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
18
|
-
*
|
|
19
|
-
* const endpoint = new VerdocsEndpoint();
|
|
20
|
-
* endpoint
|
|
21
|
-
* .logRequests(true)
|
|
22
|
-
* .setClientID('1234)
|
|
23
|
-
* .setTimeout(5000);
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
var VerdocsEndpoint = /** @class */ (function () {
|
|
27
|
-
/**
|
|
28
|
-
* Create a new VerdocsEndpoint to call Verdocs platform services.
|
|
29
|
-
*
|
|
30
|
-
* ```typescript
|
|
31
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
32
|
-
* const endpoint = new VerdocsEndpoint();
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
function VerdocsEndpoint() {
|
|
36
|
-
this.requestLoggerId = null;
|
|
37
|
-
this.api = axios.create({ baseURL: 'https://api.verdocs.com', timeout: 3000 });
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
|
|
41
|
-
*
|
|
42
|
-
* ```typescript
|
|
43
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
44
|
-
*
|
|
45
|
-
* const endpoint = new VerdocsEndpoint();
|
|
46
|
-
* endpoint.setTimeout(3000);
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
VerdocsEndpoint.prototype.setTimeout = function (timeout) {
|
|
50
|
-
this.api.defaults.timeout = timeout;
|
|
51
|
-
return this;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Set the Client ID for Verdocs API calls.
|
|
55
|
-
*
|
|
56
|
-
* ```typescript
|
|
57
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
58
|
-
*
|
|
59
|
-
* const endpoint = new VerdocsEndpoint();
|
|
60
|
-
* endpoint.setClientID('1234);
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
VerdocsEndpoint.prototype.setClientID = function (clientID) {
|
|
64
|
-
this.api.defaults.headers.common['X-Client-ID'] = clientID;
|
|
65
|
-
return this;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Set the auth token that will be used for Verdocs API calls.
|
|
69
|
-
*
|
|
70
|
-
* ```typescript
|
|
71
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
72
|
-
*
|
|
73
|
-
* const endpoint = new VerdocsEndpoint();
|
|
74
|
-
* endpoint.setAuthorization(accessToken);
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
VerdocsEndpoint.prototype.setAuthorization = function (accessToken) {
|
|
78
|
-
if (accessToken) {
|
|
79
|
-
this.api.defaults.headers.common.Authorization = "Bearer ".concat(accessToken);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
delete this.api.defaults.headers.common.Authorization;
|
|
83
|
-
}
|
|
84
|
-
return this;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Set the auth token used for signing sessions. Separating user from signing auth allows the same endpoint to be
|
|
88
|
-
* used for multiple operations, although it is recommended that a separate endpoint be created for each operation.
|
|
89
|
-
*
|
|
90
|
-
* ```typescript
|
|
91
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
92
|
-
*
|
|
93
|
-
* const endpoint = new VerdocsEndpoint();
|
|
94
|
-
* endpoint.setSigningAuthorization(accessToken);
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
VerdocsEndpoint.prototype.setSigningAuthorization = function (accessToken) {
|
|
98
|
-
if (accessToken) {
|
|
99
|
-
this.api.defaults.headers.common.signer = "Bearer ".concat(accessToken);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
delete this.api.defaults.headers.common.signer;
|
|
103
|
-
}
|
|
104
|
-
return this;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Set the base URL for API calls. May also be set via the constructor.
|
|
108
|
-
*
|
|
109
|
-
* ```typescript
|
|
110
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
111
|
-
*
|
|
112
|
-
* const endpoint = new VerdocsEndpoint();
|
|
113
|
-
* endpoint.setBaseURL('https://api.verdocs.com');
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
VerdocsEndpoint.prototype.setBaseURL = function (url) {
|
|
117
|
-
this.api.defaults.baseURL = url;
|
|
118
|
-
return this;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging.
|
|
122
|
-
*
|
|
123
|
-
* ```typescript
|
|
124
|
-
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
125
|
-
*
|
|
126
|
-
* const endpoint = new VerdocsEndpoint();
|
|
127
|
-
* endpoint.logRequests(true);
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
VerdocsEndpoint.prototype.logRequests = function (enable) {
|
|
131
|
-
if (enable && this.requestLoggerId === null) {
|
|
132
|
-
this.requestLoggerId = this.api.interceptors.request.use(requestLogger);
|
|
133
|
-
}
|
|
134
|
-
else if (!enable && this.requestLoggerId !== null) {
|
|
135
|
-
this.api.interceptors.request.eject(this.requestLoggerId);
|
|
136
|
-
}
|
|
137
|
-
return this;
|
|
138
|
-
};
|
|
139
|
-
return VerdocsEndpoint;
|
|
140
|
-
}());
|
|
141
|
-
export { VerdocsEndpoint };
|
package/HTTP/index.d.ts
DELETED
package/HTTP/index.js
DELETED