@verdocs/js-sdk 2.0.4 → 2.0.7
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 +2 -0
- package/Users/Types.d.ts +1 -1
- package/VerdocsEndpoint.js +10 -6
- package/package.json +1 -1
package/Documents/Documents.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ISigningSession, ISigningSessionRequest } from './Types';
|
|
2
2
|
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
3
3
|
import { IFieldSetting } from '../Templates/Types';
|
|
4
|
+
import { IProfile } from '../Users/Types';
|
|
4
5
|
export declare type TDocumentStatus = 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled';
|
|
5
6
|
export declare type TRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted' | 'canceled' | 'pending' | 'declined';
|
|
6
7
|
export declare type TRecipientType = 'signer' | 'cc' | 'approver';
|
|
@@ -106,6 +107,7 @@ export interface IDocument {
|
|
|
106
107
|
certificate?: IDocumentAsset | null;
|
|
107
108
|
document?: IDocumentAsset | null;
|
|
108
109
|
fields?: IDocumentField[];
|
|
110
|
+
profile?: IProfile;
|
|
109
111
|
}
|
|
110
112
|
export interface IActivityEntry {
|
|
111
113
|
id: string;
|
package/Users/Types.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface IProfile {
|
|
|
30
30
|
/** If true, this is the caller's "currently selected" profile. All operations will performed "as" this profile. */
|
|
31
31
|
current: boolean;
|
|
32
32
|
/** The organization */
|
|
33
|
-
organization
|
|
33
|
+
organization?: IOrganization;
|
|
34
34
|
/** The permissions assigned to the profilel _NOTE: Only present in the "current" profile._ */
|
|
35
35
|
permissions?: TPermission[];
|
|
36
36
|
/** The roles assigned to the profilel _NOTE: Only present in the "current" profile._ */
|
package/VerdocsEndpoint.js
CHANGED
|
@@ -2,6 +2,9 @@ import axios from 'axios';
|
|
|
2
2
|
import { decodeAccessTokenBody } from './Utils/Token';
|
|
3
3
|
import globalThis from './Utils/globalThis';
|
|
4
4
|
import * as Documents from './Documents';
|
|
5
|
+
// @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/
|
|
6
|
+
// Also see globalThis for comments about why we're doing this in the first place.
|
|
7
|
+
var ENDPOINT_KEY = Symbol.for('verdocs-default-endpoint');
|
|
5
8
|
var requestLogger = function (r) {
|
|
6
9
|
// tslint:disable-next-line
|
|
7
10
|
console.debug("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
@@ -65,6 +68,13 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
|
65
68
|
globalThis[ENDPOINT_KEY] = this;
|
|
66
69
|
};
|
|
67
70
|
VerdocsEndpoint.getDefault = function () {
|
|
71
|
+
if (!globalThis[ENDPOINT_KEY]) {
|
|
72
|
+
globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();
|
|
73
|
+
window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY]);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
window.console.debug('[JS SDK] Re-using existing endpoint', globalThis[ENDPOINT_KEY]);
|
|
77
|
+
}
|
|
68
78
|
return globalThis[ENDPOINT_KEY];
|
|
69
79
|
};
|
|
70
80
|
/**
|
|
@@ -289,9 +299,3 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
|
289
299
|
return VerdocsEndpoint;
|
|
290
300
|
}());
|
|
291
301
|
export { VerdocsEndpoint };
|
|
292
|
-
// @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/
|
|
293
|
-
// Also see globalThis for comments about why we're doing this in the first place.
|
|
294
|
-
var ENDPOINT_KEY = Symbol.for('verdocs-default-endpoint');
|
|
295
|
-
if (!globalThis[ENDPOINT_KEY]) {
|
|
296
|
-
globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();
|
|
297
|
-
}
|