@verdocs/js-sdk 1.0.22 → 1.0.27
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/Signatures.js +2 -2
- package/Documents/Stars.js +1 -1
- package/HTTP/Endpoint.d.ts +70 -0
- package/HTTP/Endpoint.js +98 -0
- package/HTTP/Transport.d.ts +3 -2
- package/HTTP/Transport.js +5 -4
- package/HTTP/index.d.ts +1 -0
- package/HTTP/index.js +1 -0
- package/Organizations/ApiKeys.js +5 -5
- package/Organizations/Groups.js +7 -7
- package/Organizations/Invitations.js +7 -7
- package/Organizations/Members.js +5 -5
- package/Organizations/Organizations.js +3 -3
- package/Organizations/Webhooks.js +2 -2
- package/Search/Types.d.ts +2 -9
- package/Templates/Documents.js +4 -4
- package/Templates/Fields.js +3 -3
- package/Templates/Pages.js +4 -4
- package/Templates/Reminders.js +4 -4
- package/Templates/Roles.js +7 -7
- package/Templates/Stars.js +2 -2
- package/Templates/Tags.js +4 -4
- package/Templates/Templates.js +2 -2
- package/Templates/Validators.js +1 -1
- package/Users/Profiles.d.ts +10 -11
- package/Users/Profiles.js +6 -6
- package/Users/Types.d.ts +12 -2
- package/Utils/DateTime.js +1 -1
- package/package.json +12 -12
- package/tsconfig-typedoc.json +25 -0
package/Documents/Signatures.js
CHANGED
|
@@ -11,11 +11,11 @@ export var getSignatures = function () {
|
|
|
11
11
|
};
|
|
12
12
|
export var getSignature = function (signatureId) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.get("/signatures/"
|
|
14
|
+
.get("/signatures/".concat(signatureId))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var deleteSignature = function (signatureId) {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.delete("/signatures/"
|
|
19
|
+
.delete("/signatures/".concat(signatureId))
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
package/Documents/Stars.js
CHANGED
|
@@ -36,5 +36,5 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import { getEndpoint } from '../HTTP/Transport';
|
|
38
38
|
export var toggleStar = function (templateId) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
39
|
-
return [2 /*return*/, getEndpoint().post("/templates/"
|
|
39
|
+
return [2 /*return*/, getEndpoint().post("/templates/".concat(templateId, "/stars/toggle")).then(function (r) { return r.data; })];
|
|
40
40
|
}); }); };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An Endpoint is a specific connection and authorization session for calling the Verdocs APIs. Where the global Transport is generally used
|
|
3
|
+
* to simpliy standard-user operations, Endpoints can be used for isolated session tasks. For instance, ephemeral signing sessions may be
|
|
4
|
+
* created independently of a caller's status as an authenticated user. In that case, an Endpoint can be created and authenticated, used
|
|
5
|
+
* for calls related to signing operations, then discarded once signing is complete.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { AxiosInstance } from 'axios';
|
|
10
|
+
export declare class Endpoint {
|
|
11
|
+
baseURL: string;
|
|
12
|
+
endpoint: AxiosInstance;
|
|
13
|
+
requestLoggerId: number | null;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new Endpoint to call Verdocs services.
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
19
|
+
*
|
|
20
|
+
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
constructor({ baseURL }: {
|
|
24
|
+
baseURL?: string;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
|
|
28
|
+
*
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
31
|
+
*
|
|
32
|
+
* const endpoint = new Endpoint();
|
|
33
|
+
* endpoint.setTimeout(3000);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
setTimeout(timeout: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Set the Client ID for Verdocs API calls.
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
42
|
+
*
|
|
43
|
+
* const endpoint = new Endpoint();
|
|
44
|
+
* endpoint.setClientID('1234);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
setClientID(clientID: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Set the auth token that will be used for Verdocs API calls.
|
|
50
|
+
*
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
53
|
+
*
|
|
54
|
+
* const endpoint = new Endpoint();
|
|
55
|
+
* endpoint.setAuthorization(accessToken);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
setAuthorization(accessToken: string | null): void;
|
|
59
|
+
/**
|
|
60
|
+
* Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging.
|
|
61
|
+
*
|
|
62
|
+
* ```typescript
|
|
63
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
64
|
+
*
|
|
65
|
+
* const endpoint = new Endpoint();
|
|
66
|
+
* endpoint.logRequests(true);
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
logRequests(enable: boolean): void;
|
|
70
|
+
}
|
package/HTTP/Endpoint.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An Endpoint is a specific connection and authorization session for calling the Verdocs APIs. Where the global Transport is generally used
|
|
3
|
+
* to simpliy standard-user operations, Endpoints can be used for isolated session tasks. For instance, ephemeral signing sessions may be
|
|
4
|
+
* created independently of a caller's status as an authenticated user. In that case, an Endpoint can be created and authenticated, used
|
|
5
|
+
* for calls related to signing operations, then discarded once signing is complete.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import axios from 'axios';
|
|
10
|
+
var requestLogger = function (r) {
|
|
11
|
+
// tslint:disable-next-line
|
|
12
|
+
console.log("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
13
|
+
return r;
|
|
14
|
+
};
|
|
15
|
+
var Endpoint = /** @class */ (function () {
|
|
16
|
+
/**
|
|
17
|
+
* Create a new Endpoint to call Verdocs services.
|
|
18
|
+
*
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
21
|
+
*
|
|
22
|
+
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
function Endpoint(_a) {
|
|
26
|
+
var baseURL = _a.baseURL;
|
|
27
|
+
this.requestLoggerId = null;
|
|
28
|
+
this.baseURL = baseURL || 'https://api.verdocs.com/';
|
|
29
|
+
this.endpoint = axios.create({
|
|
30
|
+
baseURL: this.baseURL,
|
|
31
|
+
timeout: 6000,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
|
|
36
|
+
*
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
39
|
+
*
|
|
40
|
+
* const endpoint = new Endpoint();
|
|
41
|
+
* endpoint.setTimeout(3000);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
Endpoint.prototype.setTimeout = function (timeout) {
|
|
45
|
+
this.endpoint.defaults.timeout = timeout;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Set the Client ID for Verdocs API calls.
|
|
49
|
+
*
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
52
|
+
*
|
|
53
|
+
* const endpoint = new Endpoint();
|
|
54
|
+
* endpoint.setClientID('1234);
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
Endpoint.prototype.setClientID = function (clientID) {
|
|
58
|
+
this.endpoint.defaults.headers['X-Client-ID'] = clientID;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Set the auth token that will be used for Verdocs API calls.
|
|
62
|
+
*
|
|
63
|
+
* ```typescript
|
|
64
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
65
|
+
*
|
|
66
|
+
* const endpoint = new Endpoint();
|
|
67
|
+
* endpoint.setAuthorization(accessToken);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
Endpoint.prototype.setAuthorization = function (accessToken) {
|
|
71
|
+
if (accessToken) {
|
|
72
|
+
this.endpoint.defaults.headers.Authorization = "Bearer ".concat(accessToken);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
delete this.endpoint.defaults.headers.Authorization;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging.
|
|
80
|
+
*
|
|
81
|
+
* ```typescript
|
|
82
|
+
* import {Endpoint} from '@verdocs/js-sdk/HTTP';
|
|
83
|
+
*
|
|
84
|
+
* const endpoint = new Endpoint();
|
|
85
|
+
* endpoint.logRequests(true);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
Endpoint.prototype.logRequests = function (enable) {
|
|
89
|
+
if (enable && this.requestLoggerId === null) {
|
|
90
|
+
this.requestLoggerId = this.endpoint.interceptors.request.use(requestLogger);
|
|
91
|
+
}
|
|
92
|
+
else if (!enable && this.requestLoggerId !== null) {
|
|
93
|
+
this.endpoint.interceptors.request.eject(this.requestLoggerId);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return Endpoint;
|
|
97
|
+
}());
|
|
98
|
+
export { Endpoint };
|
package/HTTP/Transport.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Transport
|
|
3
|
-
* its configuration settings are shared for all callers.
|
|
2
|
+
* The Transport is a global singleton used to call Verdocs APIs. There can only be one Transport per application, and
|
|
3
|
+
* its configuration settings are shared for all callers. This is a simplified form of the Endpoint class where most
|
|
4
|
+
* tasks such as general session-token-management are handled automatically for the caller.
|
|
4
5
|
*
|
|
5
6
|
* @module
|
|
6
7
|
*/
|
package/HTTP/Transport.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Transport
|
|
3
|
-
* its configuration settings are shared for all callers.
|
|
2
|
+
* The Transport is a global singleton used to call Verdocs APIs. There can only be one Transport per application, and
|
|
3
|
+
* its configuration settings are shared for all callers. This is a simplified form of the Endpoint class where most
|
|
4
|
+
* tasks such as general session-token-management are handled automatically for the caller.
|
|
4
5
|
*
|
|
5
6
|
* @module
|
|
6
7
|
*/
|
|
@@ -20,7 +21,7 @@ if (!globalThis[ENDPOINT_KEY]) {
|
|
|
20
21
|
var endpoint = globalThis[ENDPOINT_KEY];
|
|
21
22
|
var requestLogger = function (r) {
|
|
22
23
|
// tslint:disable-next-line
|
|
23
|
-
console.log("[JS-SDK] "
|
|
24
|
+
console.log("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
24
25
|
return r;
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
@@ -34,7 +35,7 @@ var requestLogger = function (r) {
|
|
|
34
35
|
*/
|
|
35
36
|
export var setAuthorization = function (accessToken) {
|
|
36
37
|
if (accessToken) {
|
|
37
|
-
endpoint.defaults.headers.Authorization = "Bearer "
|
|
38
|
+
endpoint.defaults.headers.Authorization = "Bearer ".concat(accessToken);
|
|
38
39
|
}
|
|
39
40
|
else {
|
|
40
41
|
delete endpoint.defaults.headers.Authorization;
|
package/HTTP/index.d.ts
CHANGED
package/HTTP/index.js
CHANGED
package/Organizations/ApiKeys.js
CHANGED
|
@@ -22,7 +22,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
22
22
|
*/
|
|
23
23
|
export var getKeys = function (organizationId) {
|
|
24
24
|
return getEndpoint()
|
|
25
|
-
.get("/organizations/"
|
|
25
|
+
.get("/organizations/".concat(organizationId, "/api_key"))
|
|
26
26
|
.then(function (r) { return r.data; });
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -36,7 +36,7 @@ export var getKeys = function (organizationId) {
|
|
|
36
36
|
*/
|
|
37
37
|
export var createKey = function (organizationId, params) {
|
|
38
38
|
return getEndpoint()
|
|
39
|
-
.post("/organizations/"
|
|
39
|
+
.post("/organizations/".concat(organizationId, "/api_key"), params)
|
|
40
40
|
.then(function (r) { return r.data; });
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
@@ -50,7 +50,7 @@ export var createKey = function (organizationId, params) {
|
|
|
50
50
|
*/
|
|
51
51
|
export var rotateKey = function (organizationId, clientId) {
|
|
52
52
|
return getEndpoint()
|
|
53
|
-
.put("/organizations/"
|
|
53
|
+
.put("/organizations/".concat(organizationId, "/api_key/").concat(clientId, "/rotate"))
|
|
54
54
|
.then(function (r) { return r.data; });
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
@@ -64,7 +64,7 @@ export var rotateKey = function (organizationId, clientId) {
|
|
|
64
64
|
*/
|
|
65
65
|
export var updateKey = function (organizationId, clientId, params) {
|
|
66
66
|
return getEndpoint()
|
|
67
|
-
.patch("/organizations/"
|
|
67
|
+
.patch("/organizations/".concat(organizationId, "/api_key/").concat(clientId), params)
|
|
68
68
|
.then(function (r) { return r.data; });
|
|
69
69
|
};
|
|
70
70
|
/**
|
|
@@ -78,6 +78,6 @@ export var updateKey = function (organizationId, clientId, params) {
|
|
|
78
78
|
*/
|
|
79
79
|
export var deleteKey = function (organizationId, clientId) {
|
|
80
80
|
return getEndpoint()
|
|
81
|
-
.delete("/organizations/"
|
|
81
|
+
.delete("/organizations/".concat(organizationId, "/api_key/").concat(clientId))
|
|
82
82
|
.then(function (r) { return r.data; });
|
|
83
83
|
};
|
package/Organizations/Groups.js
CHANGED
|
@@ -19,7 +19,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
19
19
|
*/
|
|
20
20
|
export var getGroups = function (organizationId) {
|
|
21
21
|
return getEndpoint()
|
|
22
|
-
.get("/organizations/"
|
|
22
|
+
.get("/organizations/".concat(organizationId, "/groups"))
|
|
23
23
|
.then(function (r) { return r.data; });
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
@@ -33,31 +33,31 @@ export var getGroups = function (organizationId) {
|
|
|
33
33
|
*/
|
|
34
34
|
export var getGroup = function (organizationId, groupId) {
|
|
35
35
|
return getEndpoint()
|
|
36
|
-
.get("/organizations/"
|
|
36
|
+
.get("/organizations/".concat(organizationId, "/groups/").concat(groupId))
|
|
37
37
|
.then(function (r) { return r.data; });
|
|
38
38
|
};
|
|
39
39
|
export var getMembers = function (organizationId, groupId) {
|
|
40
40
|
return getEndpoint()
|
|
41
|
-
.get("/organizations/"
|
|
41
|
+
.get("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members"))
|
|
42
42
|
.then(function (r) { return r.data; });
|
|
43
43
|
};
|
|
44
44
|
export var addMembers = function (organizationId, groupId, params) {
|
|
45
45
|
return getEndpoint()
|
|
46
|
-
.post("/organizations/"
|
|
46
|
+
.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members"), params)
|
|
47
47
|
.then(function (r) { return r.data; });
|
|
48
48
|
};
|
|
49
49
|
export var deleteMembers = function (organizationId, groupId, params) {
|
|
50
50
|
return getEndpoint()
|
|
51
|
-
.put("/organizations/"
|
|
51
|
+
.put("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/delete_members"), params)
|
|
52
52
|
.then(function (r) { return r.data; });
|
|
53
53
|
};
|
|
54
54
|
export var addPermission = function (organizationId, groupId, permissionId, params) {
|
|
55
55
|
return getEndpoint()
|
|
56
|
-
.post("/organizations/"
|
|
56
|
+
.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId), params)
|
|
57
57
|
.then(function (r) { return r.data; });
|
|
58
58
|
};
|
|
59
59
|
export var deletePermission = function (organizationId, groupId, permissionId) {
|
|
60
60
|
return getEndpoint()
|
|
61
|
-
.delete("/organizations/"
|
|
61
|
+
.delete("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId))
|
|
62
62
|
.then(function (r) { return r.data; });
|
|
63
63
|
};
|
|
@@ -6,36 +6,36 @@
|
|
|
6
6
|
import { getEndpoint } from '../HTTP/Transport';
|
|
7
7
|
export var getInvitations = function (organizationId) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get("/organizations/"
|
|
9
|
+
.get("/organizations/".concat(organizationId, "/invitation"))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var createInvitation = function (organizationId, params) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.post("/organizations/"
|
|
14
|
+
.post("/organizations/".concat(organizationId, "/invitation"), params)
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var deleteInvitation = function (organizationId, email) {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.delete("/organizations/"
|
|
19
|
+
.delete("/organizations/".concat(organizationId, "/invitation/").concat(email))
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
|
22
22
|
export var updateInvitation = function (organizationId, email, params) {
|
|
23
23
|
return getEndpoint()
|
|
24
|
-
.patch("/organizations/"
|
|
24
|
+
.patch("/organizations/".concat(organizationId, "/invitation/").concat(email), params)
|
|
25
25
|
.then(function (r) { return r.data; });
|
|
26
26
|
};
|
|
27
27
|
export var resendInvitation = function (organizationId, email) {
|
|
28
28
|
return getEndpoint()
|
|
29
|
-
.post("/organizations/"
|
|
29
|
+
.post("/organizations/".concat(organizationId, "/invitation/").concat(email, "/resend"))
|
|
30
30
|
.then(function (r) { return r.data; });
|
|
31
31
|
};
|
|
32
32
|
export var claimInvitation = function (organizationId, email, params) {
|
|
33
33
|
return getEndpoint()
|
|
34
|
-
.put("/organizations/"
|
|
34
|
+
.put("/organizations/".concat(organizationId, "/invitation/").concat(email), params)
|
|
35
35
|
.then(function (r) { return r.data; });
|
|
36
36
|
};
|
|
37
37
|
export var claimNewUser = function (organizationId, email, token) {
|
|
38
38
|
return getEndpoint()
|
|
39
|
-
.put("/organizations/"
|
|
39
|
+
.put("/organizations/".concat(organizationId, "/invitation/").concat(email, "/token/").concat(token, "/new_user"))
|
|
40
40
|
.then(function (r) { return r.data; });
|
|
41
41
|
};
|
package/Organizations/Members.js
CHANGED
|
@@ -6,26 +6,26 @@
|
|
|
6
6
|
import { getEndpoint } from '../HTTP/Transport';
|
|
7
7
|
export var getMembers = function (organizationId) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get("/organizations/"
|
|
9
|
+
.get("/organizations/".concat(organizationId, "/profiles"))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var deleteMember = function (organizationId, profileId) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.delete("/organizations/"
|
|
14
|
+
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var addMemberRole = function (organizationId, profileId, roleId) {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.post("/organizations/"
|
|
19
|
+
.post("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId))
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
|
22
22
|
export var deleteMemberRole = function (organizationId, profileId, roleId) {
|
|
23
23
|
return getEndpoint()
|
|
24
|
-
.delete("/organizations/"
|
|
24
|
+
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId))
|
|
25
25
|
.then(function (r) { return r.data; });
|
|
26
26
|
};
|
|
27
27
|
export var getMemberPlans = function (organizationId, profileId) {
|
|
28
28
|
return getEndpoint()
|
|
29
|
-
.get("/organizations/"
|
|
29
|
+
.get("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/plans"))
|
|
30
30
|
.then(function (r) { return r.data; });
|
|
31
31
|
};
|
|
@@ -21,16 +21,16 @@ export var validateOrganization = function () {
|
|
|
21
21
|
};
|
|
22
22
|
export var deleteOrganization = function (organizationId) {
|
|
23
23
|
return getEndpoint()
|
|
24
|
-
.delete("/organizations/"
|
|
24
|
+
.delete("/organizations/".concat(organizationId))
|
|
25
25
|
.then(function (r) { return r.data; });
|
|
26
26
|
};
|
|
27
27
|
export var getOrganization = function (organizationId) {
|
|
28
28
|
return getEndpoint()
|
|
29
|
-
.get("/organizations/"
|
|
29
|
+
.get("/organizations/".concat(organizationId))
|
|
30
30
|
.then(function (r) { return r.data; });
|
|
31
31
|
};
|
|
32
32
|
export var updateOrganization = function (organizationId, params) {
|
|
33
33
|
return getEndpoint()
|
|
34
|
-
.patch("/organizations/"
|
|
34
|
+
.patch("/organizations/".concat(organizationId), params)
|
|
35
35
|
.then(function (r) { return r.data; });
|
|
36
36
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var getWebhook = function (organizationId) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.get("/organizations/"
|
|
4
|
+
.get("/organizations/".concat(organizationId, "/webhook"))
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var updateWebhook = function (organizationId, params) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.post("/organizations/"
|
|
9
|
+
.post("/organizations/".concat(organizationId, "/webhook"), params)
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
package/Search/Types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TDocumentStatus
|
|
1
|
+
import { TDocumentStatus } from '../Documents/Documents';
|
|
2
2
|
import { TTemplateSender } from '../Templates/Types';
|
|
3
3
|
export declare type TMimeType = 'application/pdf' | string;
|
|
4
4
|
/**
|
|
@@ -99,14 +99,7 @@ export interface ISearchResult {
|
|
|
99
99
|
organizations: ISearchResultCollection<IOrganizationHit>;
|
|
100
100
|
}
|
|
101
101
|
export interface ISearchParams {
|
|
102
|
-
|
|
103
|
-
limit?: number;
|
|
104
|
-
q?: string;
|
|
105
|
-
tags?: string[];
|
|
106
|
-
type?: 'template' | 'document' | 'organization';
|
|
107
|
-
shared?: 'private' | 'shared' | 'public';
|
|
108
|
-
mine?: boolean;
|
|
109
|
-
status?: TDocumentStatus | TRecipientStatus;
|
|
102
|
+
q: string;
|
|
110
103
|
}
|
|
111
104
|
export interface IRecentSearch {
|
|
112
105
|
id: string;
|
package/Templates/Documents.js
CHANGED
|
@@ -10,7 +10,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
10
10
|
*/
|
|
11
11
|
export var getDocuments = function (templateId) {
|
|
12
12
|
return getEndpoint()
|
|
13
|
-
.get("/templates/"
|
|
13
|
+
.get("/templates/".concat(templateId, "/documents/"))
|
|
14
14
|
.then(function (r) { return r.data; });
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -24,7 +24,7 @@ export var getDocuments = function (templateId) {
|
|
|
24
24
|
*/
|
|
25
25
|
export var createDocument = function (templateId, params) {
|
|
26
26
|
return getEndpoint()
|
|
27
|
-
.post("/templates/"
|
|
27
|
+
.post("/templates/".concat(templateId, "/documents/"), params)
|
|
28
28
|
.then(function (r) { return r.data; });
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
@@ -38,7 +38,7 @@ export var createDocument = function (templateId, params) {
|
|
|
38
38
|
*/
|
|
39
39
|
export var getDocument = function (templateId, documentId) {
|
|
40
40
|
return getEndpoint()
|
|
41
|
-
.get("/templates/"
|
|
41
|
+
.get("/templates/".concat(templateId, "/documents/").concat(documentId))
|
|
42
42
|
.then(function (r) { return r.data; });
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
@@ -52,6 +52,6 @@ export var getDocument = function (templateId, documentId) {
|
|
|
52
52
|
*/
|
|
53
53
|
export var deleteDocument = function (templateId, documentId) {
|
|
54
54
|
return getEndpoint()
|
|
55
|
-
.delete("/templates/"
|
|
55
|
+
.delete("/templates/".concat(templateId, "/documents/").concat(documentId))
|
|
56
56
|
.then(function (r) { return r.data; });
|
|
57
57
|
};
|
package/Templates/Fields.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var createField = function (templateId, params) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.post("/templates/"
|
|
4
|
+
.post("/templates/".concat(templateId, "/pages/"), params)
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var editField = function (templateId, fieldName, params) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.put("/templates/"
|
|
9
|
+
.put("/templates/".concat(templateId, "/pages/").concat(fieldName), params)
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var deleteField = function (templateId, fieldName) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.delete("/templates/"
|
|
14
|
+
.delete("/templates/".concat(templateId, "/pages/").concat(fieldName))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
package/Templates/Pages.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var createPage = function (templateId, params) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.post("/templates/"
|
|
4
|
+
.post("/templates/".concat(templateId, "/pages/"), params)
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var editPage = function (templateId, sequence) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.put("/templates/"
|
|
9
|
+
.put("/templates/".concat(templateId, "/pages/").concat(sequence))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var getPage = function (templateId, sequence) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.get("/templates/"
|
|
14
|
+
.get("/templates/".concat(templateId, "/pages/").concat(sequence))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var deletePage = function (templateId, sequence) {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.delete("/templates/"
|
|
19
|
+
.delete("/templates/".concat(templateId, "/pages/").concat(sequence))
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
package/Templates/Reminders.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var createReminder = function (templateId, params) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.post("/templates/"
|
|
4
|
+
.post("/templates/".concat(templateId, "/reminder/"), params)
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var getReminder = function (templateId, reminderId) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get("/templates/"
|
|
9
|
+
.get("/templates/".concat(templateId, "/reminder/").concat(reminderId))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var editReminder = function (templateId, reminderId) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.put("/templates/"
|
|
14
|
+
.put("/templates/".concat(templateId, "/reminder/").concat(reminderId))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var deleteReminder = function (templateId, reminderId) {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.delete("/templates/"
|
|
19
|
+
.delete("/templates/".concat(templateId, "/reminder/").concat(reminderId))
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
package/Templates/Roles.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var createRole = function (templateId, params) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.post("/templates/"
|
|
4
|
+
.post("/templates/".concat(templateId, "/roles/"), params)
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var getRoles = function (templateId) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get("/templates/"
|
|
9
|
+
.get("/templates/".concat(templateId, "/roles/"))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var getRole = function (templateId, roleName) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.get("/templates/"
|
|
14
|
+
.get("/templates/".concat(templateId, "/roles/").concat(roleName))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var editRole = function (templateId, roleName, params) {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.put("/templates/"
|
|
19
|
+
.put("/templates/".concat(templateId, "/roles/").concat(roleName), params)
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
|
22
22
|
export var deleteRole = function (templateId, roleName) {
|
|
23
23
|
return getEndpoint()
|
|
24
|
-
.delete("/templates/"
|
|
24
|
+
.delete("/templates/".concat(templateId, "/roles/").concat(roleName))
|
|
25
25
|
.then(function (r) { return r.data; });
|
|
26
26
|
};
|
|
27
27
|
export var getRoleFields = function (templateId, roleName) {
|
|
28
28
|
return getEndpoint()
|
|
29
|
-
.get("/templates/"
|
|
29
|
+
.get("/templates/".concat(templateId, "/roles/").concat(roleName, "/fields"))
|
|
30
30
|
.then(function (r) { return r.data; });
|
|
31
31
|
};
|
|
32
32
|
export var deleteSequence = function (templateId) {
|
|
33
33
|
return getEndpoint()
|
|
34
|
-
.delete("/templates/"
|
|
34
|
+
.delete("/templates/".concat(templateId, "/roles/"))
|
|
35
35
|
.then(function (r) { return r.data; });
|
|
36
36
|
};
|
package/Templates/Stars.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var getStars = function (templateId) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.get("/templates/"
|
|
4
|
+
.get("/templates/".concat(templateId, "/stars/"))
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var toggleStar = function (templateId) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get("/templates/"
|
|
9
|
+
.get("/templates/".concat(templateId, "/stars/toggle"))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
package/Templates/Tags.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var addTemplateTag = function (templateId, params) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.post("/templates/"
|
|
4
|
+
.post("/templates/".concat(templateId, "/tags/"), params)
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var getTemplateTags = function (templateId) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get("/templates/"
|
|
9
|
+
.get("/templates/".concat(templateId, "/tags/"))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var deleteTemplateTag = function (templateId, tagName) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.post("/templates/"
|
|
14
|
+
.post("/templates/".concat(templateId, "/tags/").concat(tagName))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var createTag = function (params) {
|
|
@@ -21,7 +21,7 @@ export var createTag = function (params) {
|
|
|
21
21
|
};
|
|
22
22
|
export var getTag = function (tagName) {
|
|
23
23
|
return getEndpoint()
|
|
24
|
-
.get("/tags/"
|
|
24
|
+
.get("/tags/".concat(tagName))
|
|
25
25
|
.then(function (r) { return r.data; });
|
|
26
26
|
};
|
|
27
27
|
export var getAllTags = function (params) {
|
package/Templates/Templates.js
CHANGED
|
@@ -42,7 +42,7 @@ export var getTemplates = function () {
|
|
|
42
42
|
};
|
|
43
43
|
export var getTemplate = function (templateId) {
|
|
44
44
|
return getEndpoint()
|
|
45
|
-
.get("/templates/"
|
|
45
|
+
.get("/templates/".concat(templateId))
|
|
46
46
|
.then(function (r) { return r.data; });
|
|
47
47
|
};
|
|
48
48
|
export var createTemplate = function (params) {
|
|
@@ -52,7 +52,7 @@ export var createTemplate = function (params) {
|
|
|
52
52
|
};
|
|
53
53
|
export var editTemplate = function (templateId, params) {
|
|
54
54
|
return getEndpoint()
|
|
55
|
-
.put("/templates/"
|
|
55
|
+
.put("/templates/".concat(templateId), params)
|
|
56
56
|
.then(function (r) { return r.data; });
|
|
57
57
|
};
|
|
58
58
|
/**
|
package/Templates/Validators.js
CHANGED
package/Users/Profiles.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ICreateProfileRequest,
|
|
2
|
-
import { IGroup } from '../Organizations/Types';
|
|
1
|
+
import { ICreateProfileRequest, IUpdateProfileRequest } from './Types';
|
|
3
2
|
/**
|
|
4
3
|
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
5
4
|
*
|
|
@@ -9,7 +8,7 @@ import { IGroup } from '../Organizations/Types';
|
|
|
9
8
|
* const profiles = await Profiles.getProfiles()
|
|
10
9
|
* ```
|
|
11
10
|
*/
|
|
12
|
-
export declare const getProfiles: () => Promise<
|
|
11
|
+
export declare const getProfiles: () => Promise<any>;
|
|
13
12
|
/**
|
|
14
13
|
* Get a list of system roles.
|
|
15
14
|
*
|
|
@@ -19,7 +18,7 @@ export declare const getProfiles: () => Promise<IProfile[]>;
|
|
|
19
18
|
* const roles = await Profiles.getRoles();
|
|
20
19
|
* ```
|
|
21
20
|
*/
|
|
22
|
-
export declare const getRoles: () => Promise<
|
|
21
|
+
export declare const getRoles: () => Promise<any>;
|
|
23
22
|
/**
|
|
24
23
|
* Get a list of system roles.
|
|
25
24
|
*
|
|
@@ -29,7 +28,7 @@ export declare const getRoles: () => Promise<IRole[]>;
|
|
|
29
28
|
* const permissions = await Profiles.getPermissions();
|
|
30
29
|
* ```
|
|
31
30
|
*/
|
|
32
|
-
export declare const getPermissions: () => Promise<
|
|
31
|
+
export declare const getPermissions: () => Promise<any>;
|
|
33
32
|
/**
|
|
34
33
|
* Create a profile. If the caller does not have a "current" profile set, the new profile will be made current.
|
|
35
34
|
*
|
|
@@ -39,7 +38,7 @@ export declare const getPermissions: () => Promise<IPermission[]>;
|
|
|
39
38
|
* const newProfile = await Profiles.createProfile({ first_name: 'FIRST', last_name: 'LAST', email: 'EMAIL' });
|
|
40
39
|
* ```
|
|
41
40
|
*/
|
|
42
|
-
export declare const createProfile: (params: ICreateProfileRequest) => Promise<
|
|
41
|
+
export declare const createProfile: (params: ICreateProfileRequest) => Promise<any>;
|
|
43
42
|
/**
|
|
44
43
|
* Get a profile. The caller must have admin access to the given profile.
|
|
45
44
|
* TODO: Add a "public" profile endpoint for public pages
|
|
@@ -50,7 +49,7 @@ export declare const createProfile: (params: ICreateProfileRequest) => Promise<I
|
|
|
50
49
|
* const profile = await Profiles.getProfile('PROFILEID');
|
|
51
50
|
* ```
|
|
52
51
|
*/
|
|
53
|
-
export declare const getProfile: (profileId: string) => Promise<
|
|
52
|
+
export declare const getProfile: (profileId: string) => Promise<any>;
|
|
54
53
|
/**
|
|
55
54
|
* Get a profile's permissions. The caller must have admin access to the given profile.
|
|
56
55
|
*
|
|
@@ -60,7 +59,7 @@ export declare const getProfile: (profileId: string) => Promise<IProfile>;
|
|
|
60
59
|
* const permissions = await Profiles.getProfilePermissions('PROFILEID');
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
|
-
export declare const getProfilePermissions: (profileId: string) => Promise<
|
|
62
|
+
export declare const getProfilePermissions: (profileId: string) => Promise<any>;
|
|
64
63
|
/**
|
|
65
64
|
* Get a profile's groups.
|
|
66
65
|
*
|
|
@@ -70,7 +69,7 @@ export declare const getProfilePermissions: (profileId: string) => Promise<IPerm
|
|
|
70
69
|
* const groups = await Profiles.getProfileGroups('PROFILEID');
|
|
71
70
|
* ```
|
|
72
71
|
*/
|
|
73
|
-
export declare const getProfileGroups: (profileId: string) => Promise<
|
|
72
|
+
export declare const getProfileGroups: (profileId: string) => Promise<any>;
|
|
74
73
|
/**
|
|
75
74
|
* Switch the caller's "current" profile. The current profile is used for permissions checking and profile_id field settings
|
|
76
75
|
* for most operations in Verdocs. It is important to select the appropropriate profile before calling other API functions.
|
|
@@ -81,7 +80,7 @@ export declare const getProfileGroups: (profileId: string) => Promise<IGroup[]>;
|
|
|
81
80
|
* const newProfile = await Profiles.switchProfile('PROFILEID');
|
|
82
81
|
* ```
|
|
83
82
|
*/
|
|
84
|
-
export declare const switchProfile: (profileId: string) => Promise<
|
|
83
|
+
export declare const switchProfile: (profileId: string) => Promise<any>;
|
|
85
84
|
/**
|
|
86
85
|
* Update a profile. For future expansion, the profile ID to update is required, but currently this must also be the
|
|
87
86
|
* "current" profile for the caller.
|
|
@@ -92,7 +91,7 @@ export declare const switchProfile: (profileId: string) => Promise<ISwitchProfil
|
|
|
92
91
|
* const newProfile = await Profiles.updateProfile('PROFILEID');
|
|
93
92
|
* ```
|
|
94
93
|
*/
|
|
95
|
-
export declare const updateProfile: (profileId: string, params: IUpdateProfileRequest) => Promise<
|
|
94
|
+
export declare const updateProfile: (profileId: string, params: IUpdateProfileRequest) => Promise<any>;
|
|
96
95
|
/**
|
|
97
96
|
* Delete a profile. If the requested profile is the caller's curent profile, the next available profile will be selected.
|
|
98
97
|
*
|
package/Users/Profiles.js
CHANGED
|
@@ -67,7 +67,7 @@ export var createProfile = function (params) {
|
|
|
67
67
|
*/
|
|
68
68
|
export var getProfile = function (profileId) {
|
|
69
69
|
return getEndpoint()
|
|
70
|
-
.get("/profiles/"
|
|
70
|
+
.get("/profiles/".concat(profileId))
|
|
71
71
|
.then(function (r) { return r.data; });
|
|
72
72
|
};
|
|
73
73
|
/**
|
|
@@ -81,7 +81,7 @@ export var getProfile = function (profileId) {
|
|
|
81
81
|
*/
|
|
82
82
|
export var getProfilePermissions = function (profileId) {
|
|
83
83
|
return getEndpoint()
|
|
84
|
-
.get("/profiles/"
|
|
84
|
+
.get("/profiles/".concat(profileId, "/permissions"))
|
|
85
85
|
.then(function (r) { return r.data; });
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
@@ -95,7 +95,7 @@ export var getProfilePermissions = function (profileId) {
|
|
|
95
95
|
*/
|
|
96
96
|
export var getProfileGroups = function (profileId) {
|
|
97
97
|
return getEndpoint()
|
|
98
|
-
.get("/profiles/"
|
|
98
|
+
.get("/profiles/".concat(profileId, "/groups"))
|
|
99
99
|
.then(function (r) { return r.data; });
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
@@ -110,7 +110,7 @@ export var getProfileGroups = function (profileId) {
|
|
|
110
110
|
*/
|
|
111
111
|
export var switchProfile = function (profileId) {
|
|
112
112
|
return getEndpoint()
|
|
113
|
-
.post("/profiles/"
|
|
113
|
+
.post("/profiles/".concat(profileId, "/switch"))
|
|
114
114
|
.then(function (r) { return r.data; });
|
|
115
115
|
};
|
|
116
116
|
/**
|
|
@@ -125,7 +125,7 @@ export var switchProfile = function (profileId) {
|
|
|
125
125
|
*/
|
|
126
126
|
export var updateProfile = function (profileId, params) {
|
|
127
127
|
return getEndpoint()
|
|
128
|
-
.put("/profiles/"
|
|
128
|
+
.put("/profiles/".concat(profileId), params)
|
|
129
129
|
.then(function (r) { return r.data; });
|
|
130
130
|
};
|
|
131
131
|
/**
|
|
@@ -139,6 +139,6 @@ export var updateProfile = function (profileId, params) {
|
|
|
139
139
|
*/
|
|
140
140
|
export var deleteProfile = function (profileId) {
|
|
141
141
|
return getEndpoint()
|
|
142
|
-
.delete("/profiles/"
|
|
142
|
+
.delete("/profiles/".concat(profileId))
|
|
143
143
|
.then(function (r) { return r.data; });
|
|
144
144
|
};
|
package/Users/Types.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { IGroup, IOrganization } from '../Organizations/Types';
|
|
2
2
|
import { TRequestStatus } from '../HTTP/Types';
|
|
3
|
+
/**
|
|
4
|
+
* An operation within Verdocs the user may perform.
|
|
5
|
+
*/
|
|
3
6
|
export declare type TPermission = 'org:view' | 'member:view' | 'org:update' | 'member:add' | 'member:remove' | 'admin:add' | 'admin:remove' | 'org:delete' | 'org:transfer' | 'owner:add' | 'owner:remove' | 'template:creator:create:personal' | 'template:creator:visibility' | 'template:creator:create:org' | 'template:member:read' | 'template:member:write' | 'template:member:visibility' | 'template:creator:delete' | 'template:member:delete' | 'template:creator:create:public' | 'rform:access' | 'rcommon:access' | 'org:list' | 'org:create';
|
|
7
|
+
/**
|
|
8
|
+
* Plans provide access to Verdocs product features.
|
|
9
|
+
*/
|
|
4
10
|
export declare type TPlan = 'env:essential' | 'org:standard';
|
|
11
|
+
/**
|
|
12
|
+
* Roles provide access to groups of permissions.
|
|
13
|
+
*/
|
|
5
14
|
export declare type TRole = 'owner' | 'basic_user' | 'member';
|
|
6
15
|
export interface IProfile {
|
|
7
16
|
/** The unique ID of the profile */
|
|
@@ -37,12 +46,13 @@ export interface IActiveSession {
|
|
|
37
46
|
email_verified: boolean;
|
|
38
47
|
iat: number;
|
|
39
48
|
exp: number;
|
|
40
|
-
permissions:
|
|
41
|
-
roles:
|
|
49
|
+
permissions: TPermission[];
|
|
50
|
+
roles: TRole[];
|
|
42
51
|
profile: IProfile;
|
|
43
52
|
profile_id: string;
|
|
44
53
|
organization_id: string;
|
|
45
54
|
plans?: TPlan[];
|
|
55
|
+
[key: string]: any;
|
|
46
56
|
}
|
|
47
57
|
export interface IRole {
|
|
48
58
|
/** Unique identifier for the role. */
|
package/Utils/DateTime.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdocs/js-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"private": false,
|
|
5
5
|
"homepage": "https://github.com/Verdocs/js-sdk",
|
|
6
6
|
"description": "Verdocs JS SDK",
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
"url": "https://github.com/Verdocs/js-sdk/issues"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "npm run clean &&
|
|
26
|
+
"build": "npm run clean && npm run docs && tsc && npm run lint",
|
|
27
27
|
"prepare": "npm run build",
|
|
28
28
|
"prepublishOnly": "npm run lint",
|
|
29
|
-
"OldprepublishOnly": "npm test && npm run lint",
|
|
30
29
|
"preversion": "npm run lint",
|
|
31
30
|
"version": "npm run format && git add -A src",
|
|
32
31
|
"postversion": "git push && git push --tags",
|
|
33
32
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jestconfig.json",
|
|
34
33
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
35
34
|
"lint": "tslint -p tsconfig.json",
|
|
36
|
-
"docs-md": "typedoc",
|
|
37
|
-
"docs-html": "typedoc --plugin none --out docs-html",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
35
|
+
"docs-md": "typedoc --tsconfig ./tsconfig-typedoc.json",
|
|
36
|
+
"docs-html": "typedoc --tsconfig ./tsconfig-typedoc.json --plugin none --out docs-html",
|
|
37
|
+
"Xdocs-html": "typedoc --tsconfig ./tsconfig-typedoc.json --plugin ./typedoc-theme.tsx --out docs-html",
|
|
38
|
+
"docs": "rm -rf ../partner-portal/site/static/js-sdk/* && npm run docs-md && npm run docs-html && cp -aR docs-html/* ../partner-portal/site/static/js-sdk/",
|
|
39
|
+
"clean": "rm -rf Documents HTTP Organizations Search Templates Users Utils index.js index.d.ts docs docs-html"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
"axios": "^0.21.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"typescript": "4.
|
|
48
|
+
"typescript": "4.2.x || 4.3.x || 4.4.x || 4.5.x"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/jest": "^27.0.2",
|
|
52
52
|
"jest": "^27.3.1",
|
|
53
53
|
"jest-mock-axios": "^4.4.1",
|
|
54
|
-
"prettier": "^2.
|
|
54
|
+
"prettier": "^2.5.1",
|
|
55
55
|
"ts-jest": "^27.0.7",
|
|
56
56
|
"tslint": "^6.1.3",
|
|
57
57
|
"tslint-config-prettier": "^1.18.0",
|
|
58
|
-
"typedoc": "^0.22.
|
|
59
|
-
"typedoc-plugin-markdown": "^3.11.
|
|
60
|
-
"typescript": "^4.
|
|
58
|
+
"typedoc": "^0.22.10",
|
|
59
|
+
"typedoc-plugin-markdown": "^3.11.9",
|
|
60
|
+
"typescript": "^4.5.4"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"lib": ["es2017", "es7", "es6", "dom"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"outDir": "./",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"jsx": "react",
|
|
13
|
+
"jsxFactory": "JSX.createElement",
|
|
14
|
+
"jsxFragmentFactory": "JSX.Fragment"
|
|
15
|
+
},
|
|
16
|
+
"include": ["src"],
|
|
17
|
+
"exclude": ["node_modules", "dist", "**/__tests__/*"],
|
|
18
|
+
"typedocOptions": {
|
|
19
|
+
"entryPoints": ["src/index.ts"],
|
|
20
|
+
"out": "docs",
|
|
21
|
+
"includeVersion": true,
|
|
22
|
+
"gitRevision": "main",
|
|
23
|
+
"hideGenerator": true
|
|
24
|
+
}
|
|
25
|
+
}
|