@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.
Files changed (72) hide show
  1. package/Documents/Documents.d.ts +26 -9
  2. package/Documents/Documents.js +42 -27
  3. package/Documents/Initials.d.ts +2 -1
  4. package/Documents/Initials.js +3 -4
  5. package/Documents/Recipients.d.ts +5 -1
  6. package/Documents/Recipients.js +6 -4
  7. package/Documents/Signatures.d.ts +14 -4
  8. package/Documents/Signatures.js +21 -13
  9. package/Documents/index.d.ts +0 -1
  10. package/Documents/index.js +0 -1
  11. package/Organizations/ApiKeys.d.ts +6 -5
  12. package/Organizations/ApiKeys.js +15 -16
  13. package/Organizations/Groups.d.ts +8 -7
  14. package/Organizations/Groups.js +21 -22
  15. package/Organizations/Invitations.d.ts +8 -7
  16. package/Organizations/Invitations.js +21 -22
  17. package/Organizations/Members.d.ts +6 -5
  18. package/Organizations/Members.js +15 -16
  19. package/Organizations/Organizations.d.ts +7 -6
  20. package/Organizations/Organizations.js +18 -19
  21. package/Organizations/Webhooks.d.ts +3 -2
  22. package/Organizations/Webhooks.js +6 -7
  23. package/Organizations/Whitelabel.d.ts +3 -2
  24. package/Organizations/Whitelabel.js +6 -7
  25. package/Search/Content.d.ts +4 -3
  26. package/Search/Content.js +9 -10
  27. package/Templates/Fields.d.ts +4 -3
  28. package/Templates/Fields.js +9 -10
  29. package/Templates/Pages.d.ts +5 -4
  30. package/Templates/Pages.js +12 -13
  31. package/Templates/Reminders.d.ts +5 -4
  32. package/Templates/Reminders.js +12 -13
  33. package/Templates/Roles.d.ts +8 -7
  34. package/Templates/Roles.js +21 -22
  35. package/Templates/Stars.d.ts +3 -2
  36. package/Templates/Stars.js +6 -7
  37. package/Templates/Tags.d.ts +7 -6
  38. package/Templates/Tags.js +18 -19
  39. package/Templates/TemplateDocuments.d.ts +5 -4
  40. package/Templates/TemplateDocuments.js +12 -13
  41. package/Templates/Templates.d.ts +7 -6
  42. package/Templates/Templates.js +18 -19
  43. package/Templates/Validators.d.ts +3 -2
  44. package/Templates/Validators.js +7 -10
  45. package/Users/Auth.d.ts +9 -22
  46. package/Users/Auth.js +18 -71
  47. package/Users/Billing.d.ts +1 -1
  48. package/Users/Billing.js +1 -1
  49. package/Users/Notifications.d.ts +2 -1
  50. package/Users/Notifications.js +3 -4
  51. package/Users/Profiles.d.ts +11 -10
  52. package/Users/Profiles.js +30 -31
  53. package/Users/Types.d.ts +1 -1
  54. package/Utils/Token.d.ts +1 -1
  55. package/Utils/Token.js +2 -2
  56. package/{HTTP → Utils}/globalThis.d.ts +0 -0
  57. package/{HTTP → Utils}/globalThis.js +0 -0
  58. package/VerdocsEndpoint.d.ts +188 -0
  59. package/VerdocsEndpoint.js +285 -0
  60. package/index.d.ts +1 -1
  61. package/index.js +1 -1
  62. package/package.json +1 -1
  63. package/Documents/Stars.d.ts +0 -2
  64. package/Documents/Stars.js +0 -40
  65. package/HTTP/Transport.d.ts +0 -34
  66. package/HTTP/Transport.js +0 -47
  67. package/HTTP/Types.d.ts +0 -1
  68. package/HTTP/Types.js +0 -1
  69. package/HTTP/VerdocsEndpoint.d.ts +0 -106
  70. package/HTTP/VerdocsEndpoint.js +0 -141
  71. package/HTTP/index.d.ts +0 -3
  72. package/HTTP/index.js +0 -3
@@ -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
@@ -1,3 +0,0 @@
1
- export { VerdocsEndpoint } from './VerdocsEndpoint';
2
- export * as Transport from './Transport';
3
- export * as Types from './Types';
package/HTTP/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { VerdocsEndpoint } from './VerdocsEndpoint';
2
- export * as Transport from './Transport';
3
- export * as Types from './Types';