@verdocs/js-sdk 1.4.1 → 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 -27
- package/Users/Auth.js +18 -105
- 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
|
@@ -3,39 +3,38 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.api.get("/organizations/".concat(organizationId, "/invitation"))
|
|
6
|
+
export var getInvitations = function (endpoint, organizationId) {
|
|
7
|
+
return endpoint.api //
|
|
8
|
+
.get("/organizations/".concat(organizationId, "/invitation"))
|
|
10
9
|
.then(function (r) { return r.data; });
|
|
11
10
|
};
|
|
12
|
-
export var createInvitation = function (organizationId, params) {
|
|
13
|
-
return
|
|
14
|
-
.
|
|
11
|
+
export var createInvitation = function (endpoint, organizationId, params) {
|
|
12
|
+
return endpoint.api //
|
|
13
|
+
.post("/organizations/".concat(organizationId, "/invitation"), params)
|
|
15
14
|
.then(function (r) { return r.data; });
|
|
16
15
|
};
|
|
17
|
-
export var deleteInvitation = function (organizationId, email) {
|
|
18
|
-
return
|
|
19
|
-
.
|
|
16
|
+
export var deleteInvitation = function (endpoint, organizationId, email) {
|
|
17
|
+
return endpoint.api //
|
|
18
|
+
.delete("/organizations/".concat(organizationId, "/invitation/").concat(email))
|
|
20
19
|
.then(function (r) { return r.data; });
|
|
21
20
|
};
|
|
22
|
-
export var updateInvitation = function (organizationId, email, params) {
|
|
23
|
-
return
|
|
24
|
-
.
|
|
21
|
+
export var updateInvitation = function (endpoint, organizationId, email, params) {
|
|
22
|
+
return endpoint.api //
|
|
23
|
+
.patch("/organizations/".concat(organizationId, "/invitation/").concat(email), params)
|
|
25
24
|
.then(function (r) { return r.data; });
|
|
26
25
|
};
|
|
27
|
-
export var resendInvitation = function (organizationId, email) {
|
|
28
|
-
return
|
|
29
|
-
.
|
|
26
|
+
export var resendInvitation = function (endpoint, organizationId, email) {
|
|
27
|
+
return endpoint.api //
|
|
28
|
+
.post("/organizations/".concat(organizationId, "/invitation/").concat(email, "/resend"))
|
|
30
29
|
.then(function (r) { return r.data; });
|
|
31
30
|
};
|
|
32
|
-
export var claimInvitation = function (organizationId, email, params) {
|
|
33
|
-
return
|
|
34
|
-
.
|
|
31
|
+
export var claimInvitation = function (endpoint, organizationId, email, params) {
|
|
32
|
+
return endpoint.api //
|
|
33
|
+
.put("/organizations/".concat(organizationId, "/invitation/").concat(email), params)
|
|
35
34
|
.then(function (r) { return r.data; });
|
|
36
35
|
};
|
|
37
|
-
export var claimNewUser = function (organizationId, email, token) {
|
|
38
|
-
return
|
|
39
|
-
.
|
|
36
|
+
export var claimNewUser = function (endpoint, organizationId, email, token) {
|
|
37
|
+
return endpoint.api //
|
|
38
|
+
.put("/organizations/".concat(organizationId, "/invitation/").concat(email, "/token/").concat(token, "/new_user"))
|
|
40
39
|
.then(function (r) { return r.data; });
|
|
41
40
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
1
2
|
/**
|
|
2
3
|
* An Organization Member (aka Profile) is an individual user with access to an organization.
|
|
3
4
|
*
|
|
4
5
|
* @module
|
|
5
6
|
*/
|
|
6
|
-
export declare const getMembers: (organizationId: string) => Promise<any>;
|
|
7
|
-
export declare const deleteMember: (organizationId: string, profileId: string) => Promise<any>;
|
|
8
|
-
export declare const addMemberRole: (organizationId: string, profileId: string, roleId: string) => Promise<any>;
|
|
9
|
-
export declare const deleteMemberRole: (organizationId: string, profileId: string, roleId: string) => Promise<any>;
|
|
10
|
-
export declare const getMemberPlans: (organizationId: string, profileId: string) => Promise<any>;
|
|
7
|
+
export declare const getMembers: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<any>;
|
|
8
|
+
export declare const deleteMember: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string) => Promise<any>;
|
|
9
|
+
export declare const addMemberRole: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string, roleId: string) => Promise<any>;
|
|
10
|
+
export declare const deleteMemberRole: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string, roleId: string) => Promise<any>;
|
|
11
|
+
export declare const getMemberPlans: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string) => Promise<any>;
|
package/Organizations/Members.js
CHANGED
|
@@ -3,29 +3,28 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.api.get("/organizations/".concat(organizationId, "/profiles"))
|
|
6
|
+
export var getMembers = function (endpoint, organizationId) {
|
|
7
|
+
return endpoint.api //
|
|
8
|
+
.get("/organizations/".concat(organizationId, "/profiles"))
|
|
10
9
|
.then(function (r) { return r.data; });
|
|
11
10
|
};
|
|
12
|
-
export var deleteMember = function (organizationId, profileId) {
|
|
13
|
-
return
|
|
14
|
-
.
|
|
11
|
+
export var deleteMember = function (endpoint, organizationId, profileId) {
|
|
12
|
+
return endpoint.api //
|
|
13
|
+
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId))
|
|
15
14
|
.then(function (r) { return r.data; });
|
|
16
15
|
};
|
|
17
|
-
export var addMemberRole = function (organizationId, profileId, roleId) {
|
|
18
|
-
return
|
|
19
|
-
.
|
|
16
|
+
export var addMemberRole = function (endpoint, organizationId, profileId, roleId) {
|
|
17
|
+
return endpoint.api //
|
|
18
|
+
.post("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId))
|
|
20
19
|
.then(function (r) { return r.data; });
|
|
21
20
|
};
|
|
22
|
-
export var deleteMemberRole = function (organizationId, profileId, roleId) {
|
|
23
|
-
return
|
|
24
|
-
.
|
|
21
|
+
export var deleteMemberRole = function (endpoint, organizationId, profileId, roleId) {
|
|
22
|
+
return endpoint.api //
|
|
23
|
+
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId))
|
|
25
24
|
.then(function (r) { return r.data; });
|
|
26
25
|
};
|
|
27
|
-
export var getMemberPlans = function (organizationId, profileId) {
|
|
28
|
-
return
|
|
29
|
-
.
|
|
26
|
+
export var getMemberPlans = function (endpoint, organizationId, profileId) {
|
|
27
|
+
return endpoint.api //
|
|
28
|
+
.get("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/plans"))
|
|
30
29
|
.then(function (r) { return r.data; });
|
|
31
30
|
};
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import { IOrganization } from './Types';
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
7
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
8
|
+
export declare const getOrganizations: (endpoint: VerdocsEndpoint) => Promise<IOrganization[]>;
|
|
9
|
+
export declare const createOrganization: (endpoint: VerdocsEndpoint) => Promise<IOrganization>;
|
|
10
|
+
export declare const validateOrganization: (endpoint: VerdocsEndpoint) => Promise<IOrganization>;
|
|
11
|
+
export declare const deleteOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<any>;
|
|
12
|
+
export declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<any>;
|
|
13
|
+
export declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: any) => Promise<any>;
|
|
@@ -3,34 +3,33 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.api.get('/organizations')
|
|
6
|
+
export var getOrganizations = function (endpoint) {
|
|
7
|
+
return endpoint.api //
|
|
8
|
+
.get('/organizations')
|
|
10
9
|
.then(function (r) { return r.data; });
|
|
11
10
|
};
|
|
12
|
-
export var createOrganization = function () {
|
|
13
|
-
return
|
|
14
|
-
.
|
|
11
|
+
export var createOrganization = function (endpoint) {
|
|
12
|
+
return endpoint.api //
|
|
13
|
+
.post('/organizations')
|
|
15
14
|
.then(function (r) { return r.data; });
|
|
16
15
|
};
|
|
17
|
-
export var validateOrganization = function () {
|
|
18
|
-
return
|
|
19
|
-
.
|
|
16
|
+
export var validateOrganization = function (endpoint) {
|
|
17
|
+
return endpoint.api //
|
|
18
|
+
.get('/organizations/is_valid')
|
|
20
19
|
.then(function (r) { return r.data; });
|
|
21
20
|
};
|
|
22
|
-
export var deleteOrganization = function (organizationId) {
|
|
23
|
-
return
|
|
24
|
-
.
|
|
21
|
+
export var deleteOrganization = function (endpoint, organizationId) {
|
|
22
|
+
return endpoint.api //
|
|
23
|
+
.delete("/organizations/".concat(organizationId))
|
|
25
24
|
.then(function (r) { return r.data; });
|
|
26
25
|
};
|
|
27
|
-
export var getOrganization = function (organizationId) {
|
|
28
|
-
return
|
|
29
|
-
.
|
|
26
|
+
export var getOrganization = function (endpoint, organizationId) {
|
|
27
|
+
return endpoint.api //
|
|
28
|
+
.get("/organizations/".concat(organizationId))
|
|
30
29
|
.then(function (r) { return r.data; });
|
|
31
30
|
};
|
|
32
|
-
export var updateOrganization = function (organizationId, params) {
|
|
33
|
-
return
|
|
34
|
-
.
|
|
31
|
+
export var updateOrganization = function (endpoint, organizationId, params) {
|
|
32
|
+
return endpoint.api //
|
|
33
|
+
.patch("/organizations/".concat(organizationId), params)
|
|
35
34
|
.then(function (r) { return r.data; });
|
|
36
35
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
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>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
.api.get("/organizations/".concat(organizationId, "/webhook"))
|
|
1
|
+
export var getWebhook = function (endpoint, organizationId) {
|
|
2
|
+
return endpoint.api //
|
|
3
|
+
.get("/organizations/".concat(organizationId, "/webhook"))
|
|
5
4
|
.then(function (r) { return r.data; });
|
|
6
5
|
};
|
|
7
|
-
export var updateWebhook = function (organizationId, params) {
|
|
8
|
-
return
|
|
9
|
-
.
|
|
6
|
+
export var updateWebhook = function (endpoint, organizationId, params) {
|
|
7
|
+
return endpoint.api //
|
|
8
|
+
.post("/organizations/".concat(organizationId, "/webhook"), params)
|
|
10
9
|
.then(function (r) { return r.data; });
|
|
11
10
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
11
12
|
/**
|
|
12
13
|
* Create or update white-label data. The caller's organization ID will be used as the key for the operation.
|
|
13
14
|
*
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
* await Whitelabel.setWhitelabel({ logo: '/path/to/logo.png' });
|
|
18
19
|
* ```
|
|
19
20
|
*/
|
|
20
|
-
export declare const setWhitelabel: () => Promise<any>;
|
|
21
|
+
export declare const setWhitelabel: (endpoint: VerdocsEndpoint) => Promise<any>;
|
|
21
22
|
/**
|
|
22
23
|
* Retrieve white-label data.
|
|
23
24
|
*
|
|
@@ -27,4 +28,4 @@ export declare const setWhitelabel: () => Promise<any>;
|
|
|
27
28
|
* const {logo} = await Whitelabel.getWhitelabel();
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
|
-
export declare const getWhitelabel: () => Promise<any>;
|
|
31
|
+
export declare const getWhitelabel: (endpoint: VerdocsEndpoint) => Promise<any>;
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
-
import { getEndpoint } from '../HTTP/Transport';
|
|
12
11
|
/**
|
|
13
12
|
* Create or update white-label data. The caller's organization ID will be used as the key for the operation.
|
|
14
13
|
*
|
|
@@ -18,9 +17,9 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
18
17
|
* await Whitelabel.setWhitelabel({ logo: '/path/to/logo.png' });
|
|
19
18
|
* ```
|
|
20
19
|
*/
|
|
21
|
-
export var setWhitelabel = function () {
|
|
22
|
-
return
|
|
23
|
-
.
|
|
20
|
+
export var setWhitelabel = function (endpoint) {
|
|
21
|
+
return endpoint.api //
|
|
22
|
+
.post('/whitelabel')
|
|
24
23
|
.then(function (r) { return r.data; });
|
|
25
24
|
};
|
|
26
25
|
/**
|
|
@@ -32,8 +31,8 @@ export var setWhitelabel = function () {
|
|
|
32
31
|
* const {logo} = await Whitelabel.getWhitelabel();
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
|
-
export var getWhitelabel = function () {
|
|
36
|
-
return
|
|
37
|
-
.
|
|
34
|
+
export var getWhitelabel = function (endpoint) {
|
|
35
|
+
return endpoint.api //
|
|
36
|
+
.get('/whitelabel')
|
|
38
37
|
.then(function (r) { return r.data; });
|
|
39
38
|
};
|
package/Search/Content.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { ISavedSearch, ISearchHistory, ISearchParams, ISearchResult } from './Types';
|
|
9
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
9
10
|
/**
|
|
10
11
|
* Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each
|
|
11
12
|
* type but this may be expanded in the future. Client UI's should self-limit display counts as needed.
|
|
@@ -16,7 +17,7 @@ import { ISavedSearch, ISearchHistory, ISearchParams, ISearchResult } from './Ty
|
|
|
16
17
|
* const {recent, saved} = await Content.getSearchHistory();
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
|
-
export declare const getSearchHistory: () => Promise<ISearchHistory>;
|
|
20
|
+
export declare const getSearchHistory: (endpoint: VerdocsEndpoint) => Promise<ISearchHistory>;
|
|
20
21
|
/**
|
|
21
22
|
* Save a search. If a name is re-used, that saved search will be overwritten with the new parameters.
|
|
22
23
|
*
|
|
@@ -26,7 +27,7 @@ export declare const getSearchHistory: () => Promise<ISearchHistory>;
|
|
|
26
27
|
* const entry = await Documents.saveSearch('W9 Forms', {q: 'w9', type: 'template});
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
29
|
-
export declare const saveSearch: (name: string, params: ISearchParams) => Promise<ISavedSearch>;
|
|
30
|
+
export declare const saveSearch: (endpoint: VerdocsEndpoint, name: string, params: ISearchParams) => Promise<ISavedSearch>;
|
|
30
31
|
/**
|
|
31
32
|
* Search for documents matching various criteria.
|
|
32
33
|
*
|
|
@@ -36,4 +37,4 @@ export declare const saveSearch: (name: string, params: ISearchParams) => Promis
|
|
|
36
37
|
* const {result, page, total} = await Documents.search({ ... });
|
|
37
38
|
* ```
|
|
38
39
|
*/
|
|
39
|
-
export declare const searchContent: (params: ISearchParams) => Promise<ISearchResult>;
|
|
40
|
+
export declare const searchContent: (endpoint: VerdocsEndpoint, params: ISearchParams) => Promise<ISearchResult>;
|
package/Search/Content.js
CHANGED
|
@@ -41,7 +41,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
41
41
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
import { getEndpoint } from '../HTTP/Transport';
|
|
45
44
|
/**
|
|
46
45
|
* Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each
|
|
47
46
|
* type but this may be expanded in the future. Client UI's should self-limit display counts as needed.
|
|
@@ -52,10 +51,10 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
52
51
|
* const {recent, saved} = await Content.getSearchHistory();
|
|
53
52
|
* ```
|
|
54
53
|
*/
|
|
55
|
-
export var getSearchHistory = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
+
export var getSearchHistory = function (endpoint) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
55
|
return __generator(this, function (_a) {
|
|
57
|
-
return [2 /*return*/,
|
|
58
|
-
.
|
|
56
|
+
return [2 /*return*/, endpoint.api //
|
|
57
|
+
.get('/search/history')
|
|
59
58
|
.then(function (r) { return r.data; })];
|
|
60
59
|
});
|
|
61
60
|
}); };
|
|
@@ -68,10 +67,10 @@ export var getSearchHistory = function () { return __awaiter(void 0, void 0, voi
|
|
|
68
67
|
* const entry = await Documents.saveSearch('W9 Forms', {q: 'w9', type: 'template});
|
|
69
68
|
* ```
|
|
70
69
|
*/
|
|
71
|
-
export var saveSearch = function (name, params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
70
|
+
export var saveSearch = function (endpoint, name, params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
72
71
|
return __generator(this, function (_a) {
|
|
73
|
-
return [2 /*return*/,
|
|
74
|
-
.
|
|
72
|
+
return [2 /*return*/, endpoint.api //
|
|
73
|
+
.post('/search/saved', { name: name, params: params })
|
|
75
74
|
.then(function (r) { return r.data; })];
|
|
76
75
|
});
|
|
77
76
|
}); };
|
|
@@ -84,10 +83,10 @@ export var saveSearch = function (name, params) { return __awaiter(void 0, void
|
|
|
84
83
|
* const {result, page, total} = await Documents.search({ ... });
|
|
85
84
|
* ```
|
|
86
85
|
*/
|
|
87
|
-
export var searchContent = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
86
|
+
export var searchContent = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
87
|
return __generator(this, function (_a) {
|
|
89
|
-
return [2 /*return*/,
|
|
90
|
-
.
|
|
88
|
+
return [2 /*return*/, endpoint.api //
|
|
89
|
+
.post('/search/content', params)
|
|
91
90
|
.then(function (r) { return r.data; })];
|
|
92
91
|
});
|
|
93
92
|
}); };
|
package/Templates/Fields.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
1
2
|
import { ITemplateField } from './Types';
|
|
2
3
|
/**
|
|
3
4
|
* Add a field to a template.
|
|
4
5
|
*/
|
|
5
|
-
export declare const createField: (templateId: string, params: ITemplateField) => Promise<ITemplateField>;
|
|
6
|
+
export declare const createField: (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) => Promise<ITemplateField>;
|
|
6
7
|
/**
|
|
7
8
|
* Update a template field.
|
|
8
9
|
*/
|
|
9
|
-
export declare const editField: (templateId: string, fieldName: string, params: ITemplateField) => Promise<ITemplateField>;
|
|
10
|
+
export declare const editField: (endpoint: VerdocsEndpoint, templateId: string, fieldName: string, params: ITemplateField) => Promise<ITemplateField>;
|
|
10
11
|
/**
|
|
11
12
|
* REmove a field from a template.
|
|
12
13
|
*/
|
|
13
|
-
export declare const deleteField: (templateId: string, fieldName: string) => Promise<any>;
|
|
14
|
+
export declare const deleteField: (endpoint: VerdocsEndpoint, templateId: string, fieldName: string) => Promise<any>;
|
package/Templates/Fields.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { getEndpoint } from '../HTTP/Transport';
|
|
2
1
|
/**
|
|
3
2
|
* Add a field to a template.
|
|
4
3
|
*/
|
|
5
|
-
export var createField = function (templateId, params) {
|
|
6
|
-
return
|
|
7
|
-
.
|
|
4
|
+
export var createField = function (endpoint, templateId, params) {
|
|
5
|
+
return endpoint.api //
|
|
6
|
+
.post("/templates/".concat(templateId, "/pages/"), params)
|
|
8
7
|
.then(function (r) { return r.data; });
|
|
9
8
|
};
|
|
10
9
|
/**
|
|
11
10
|
* Update a template field.
|
|
12
11
|
*/
|
|
13
|
-
export var editField = function (templateId, fieldName, params) {
|
|
14
|
-
return
|
|
15
|
-
.
|
|
12
|
+
export var editField = function (endpoint, templateId, fieldName, params) {
|
|
13
|
+
return endpoint.api //
|
|
14
|
+
.put("/templates/".concat(templateId, "/pages/").concat(fieldName), params)
|
|
16
15
|
.then(function (r) { return r.data; });
|
|
17
16
|
};
|
|
18
17
|
/**
|
|
19
18
|
* REmove a field from a template.
|
|
20
19
|
*/
|
|
21
|
-
export var deleteField = function (templateId, fieldName) {
|
|
22
|
-
return
|
|
23
|
-
.
|
|
20
|
+
export var deleteField = function (endpoint, templateId, fieldName) {
|
|
21
|
+
return endpoint.api //
|
|
22
|
+
.delete("/templates/".concat(templateId, "/pages/").concat(fieldName))
|
|
24
23
|
.then(function (r) { return r.data; });
|
|
25
24
|
};
|
package/Templates/Pages.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { IPage } from './Types';
|
|
2
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
2
3
|
/**
|
|
3
4
|
* Add a page to a template
|
|
4
5
|
*/
|
|
5
|
-
export declare const createPage: (templateId: string, params: IPage) => Promise<IPage>;
|
|
6
|
+
export declare const createPage: (endpoint: VerdocsEndpoint, templateId: string, params: IPage) => Promise<IPage>;
|
|
6
7
|
/**
|
|
7
8
|
* Update a template page.
|
|
8
9
|
*/
|
|
9
|
-
export declare const editPage: (templateId: string, sequence: string) => Promise<any>;
|
|
10
|
+
export declare const editPage: (endpoint: VerdocsEndpoint, templateId: string, sequence: string) => Promise<any>;
|
|
10
11
|
/**
|
|
11
12
|
* Get a page from a template.
|
|
12
13
|
*/
|
|
13
|
-
export declare const getPage: (templateId: string, sequence: string) => Promise<any>;
|
|
14
|
+
export declare const getPage: (endpoint: VerdocsEndpoint, templateId: string, sequence: string) => Promise<any>;
|
|
14
15
|
/**
|
|
15
16
|
* Delete a page from a template
|
|
16
17
|
*/
|
|
17
|
-
export declare const deletePage: (templateId: string, sequence: string) => Promise<any>;
|
|
18
|
+
export declare const deletePage: (endpoint: VerdocsEndpoint, templateId: string, sequence: string) => Promise<any>;
|
package/Templates/Pages.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { getEndpoint } from '../HTTP/Transport';
|
|
2
1
|
/**
|
|
3
2
|
* Add a page to a template
|
|
4
3
|
*/
|
|
5
|
-
export var createPage = function (templateId, params) {
|
|
6
|
-
return
|
|
7
|
-
.
|
|
4
|
+
export var createPage = function (endpoint, templateId, params) {
|
|
5
|
+
return endpoint.api //
|
|
6
|
+
.post("/templates/".concat(templateId, "/pages/"), params)
|
|
8
7
|
.then(function (r) { return r.data; });
|
|
9
8
|
};
|
|
10
9
|
/**
|
|
11
10
|
* Update a template page.
|
|
12
11
|
*/
|
|
13
|
-
export var editPage = function (templateId, sequence) {
|
|
14
|
-
return
|
|
15
|
-
.
|
|
12
|
+
export var editPage = function (endpoint, templateId, sequence) {
|
|
13
|
+
return endpoint.api //
|
|
14
|
+
.put("/templates/".concat(templateId, "/pages/").concat(sequence))
|
|
16
15
|
.then(function (r) { return r.data; });
|
|
17
16
|
};
|
|
18
17
|
/**
|
|
19
18
|
* Get a page from a template.
|
|
20
19
|
*/
|
|
21
|
-
export var getPage = function (templateId, sequence) {
|
|
22
|
-
return
|
|
23
|
-
.
|
|
20
|
+
export var getPage = function (endpoint, templateId, sequence) {
|
|
21
|
+
return endpoint.api //
|
|
22
|
+
.get("/templates/".concat(templateId, "/pages/").concat(sequence))
|
|
24
23
|
.then(function (r) { return r.data; });
|
|
25
24
|
};
|
|
26
25
|
/**
|
|
27
26
|
* Delete a page from a template
|
|
28
27
|
*/
|
|
29
|
-
export var deletePage = function (templateId, sequence) {
|
|
30
|
-
return
|
|
31
|
-
.
|
|
28
|
+
export var deletePage = function (endpoint, templateId, sequence) {
|
|
29
|
+
return endpoint.api //
|
|
30
|
+
.delete("/templates/".concat(templateId, "/pages/").concat(sequence))
|
|
32
31
|
.then(function (r) { return r.data; });
|
|
33
32
|
};
|
package/Templates/Reminders.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IReminder, ITemplate } from './Types';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
2
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
3
|
+
export declare const createReminder: (endpoint: VerdocsEndpoint, templateId: string, params: any) => Promise<ITemplate>;
|
|
4
|
+
export declare const getReminder: (endpoint: VerdocsEndpoint, templateId: string, reminderId: string) => Promise<IReminder>;
|
|
5
|
+
export declare const editReminder: (endpoint: VerdocsEndpoint, templateId: string, reminderId: string) => Promise<IReminder>;
|
|
6
|
+
export declare const deleteReminder: (endpoint: VerdocsEndpoint, templateId: string, reminderId: string) => Promise<any>;
|
package/Templates/Reminders.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
.api.post("/templates/".concat(templateId, "/reminder/"), params)
|
|
1
|
+
export var createReminder = function (endpoint, templateId, params) {
|
|
2
|
+
return endpoint.api //
|
|
3
|
+
.post("/templates/".concat(templateId, "/reminder/"), params)
|
|
5
4
|
.then(function (r) { return r.data; });
|
|
6
5
|
};
|
|
7
|
-
export var getReminder = function (templateId, reminderId) {
|
|
8
|
-
return
|
|
9
|
-
.
|
|
6
|
+
export var getReminder = function (endpoint, templateId, reminderId) {
|
|
7
|
+
return endpoint.api //
|
|
8
|
+
.get("/templates/".concat(templateId, "/reminder/").concat(reminderId))
|
|
10
9
|
.then(function (r) { return r.data; });
|
|
11
10
|
};
|
|
12
|
-
export var editReminder = function (templateId, reminderId) {
|
|
13
|
-
return
|
|
14
|
-
.
|
|
11
|
+
export var editReminder = function (endpoint, templateId, reminderId) {
|
|
12
|
+
return endpoint.api //
|
|
13
|
+
.put("/templates/".concat(templateId, "/reminder/").concat(reminderId))
|
|
15
14
|
.then(function (r) { return r.data; });
|
|
16
15
|
};
|
|
17
|
-
export var deleteReminder = function (templateId, reminderId) {
|
|
18
|
-
return
|
|
19
|
-
.
|
|
16
|
+
export var deleteReminder = function (endpoint, templateId, reminderId) {
|
|
17
|
+
return endpoint.api //
|
|
18
|
+
.delete("/templates/".concat(templateId, "/reminder/").concat(reminderId))
|
|
20
19
|
.then(function (r) { return r.data; });
|
|
21
20
|
};
|
package/Templates/Roles.d.ts
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { ITemplateField, IRole } from './Types';
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
9
|
+
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
10
|
+
export declare const createRole: (endpoint: VerdocsEndpoint, templateId: string, params: IRole) => Promise<IRole>;
|
|
11
|
+
export declare const getRoles: (endpoint: VerdocsEndpoint, templateId: string) => Promise<IRole[]>;
|
|
12
|
+
export declare const getRole: (endpoint: VerdocsEndpoint, templateId: string, roleName: string) => Promise<IRole>;
|
|
13
|
+
export declare const editRole: (endpoint: VerdocsEndpoint, templateId: string, roleName: string, params: IRole) => Promise<IRole>;
|
|
14
|
+
export declare const deleteRole: (endpoint: VerdocsEndpoint, templateId: string, roleName: string) => Promise<any>;
|
|
15
|
+
export declare const getRoleFields: (endpoint: VerdocsEndpoint, templateId: string, roleName: string) => Promise<ITemplateField[]>;
|
|
16
|
+
export declare const deleteSequence: (endpoint: VerdocsEndpoint, templateId: string) => Promise<IRole[]>;
|
package/Templates/Roles.js
CHANGED
|
@@ -5,39 +5,38 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.api.post("/templates/".concat(templateId, "/roles/"), params)
|
|
8
|
+
export var createRole = function (endpoint, templateId, params) {
|
|
9
|
+
return endpoint.api //
|
|
10
|
+
.post("/templates/".concat(templateId, "/roles/"), params)
|
|
12
11
|
.then(function (r) { return r.data; });
|
|
13
12
|
};
|
|
14
|
-
export var getRoles = function (templateId) {
|
|
15
|
-
return
|
|
16
|
-
.
|
|
13
|
+
export var getRoles = function (endpoint, templateId) {
|
|
14
|
+
return endpoint.api //
|
|
15
|
+
.get("/templates/".concat(templateId, "/roles/"))
|
|
17
16
|
.then(function (r) { return r.data; });
|
|
18
17
|
};
|
|
19
|
-
export var getRole = function (templateId, roleName) {
|
|
20
|
-
return
|
|
21
|
-
.
|
|
18
|
+
export var getRole = function (endpoint, templateId, roleName) {
|
|
19
|
+
return endpoint.api //
|
|
20
|
+
.get("/templates/".concat(templateId, "/roles/").concat(roleName))
|
|
22
21
|
.then(function (r) { return r.data; });
|
|
23
22
|
};
|
|
24
|
-
export var editRole = function (templateId, roleName, params) {
|
|
25
|
-
return
|
|
26
|
-
.
|
|
23
|
+
export var editRole = function (endpoint, templateId, roleName, params) {
|
|
24
|
+
return endpoint.api //
|
|
25
|
+
.put("/templates/".concat(templateId, "/roles/").concat(roleName), params)
|
|
27
26
|
.then(function (r) { return r.data; });
|
|
28
27
|
};
|
|
29
|
-
export var deleteRole = function (templateId, roleName) {
|
|
30
|
-
return
|
|
31
|
-
.
|
|
28
|
+
export var deleteRole = function (endpoint, templateId, roleName) {
|
|
29
|
+
return endpoint.api //
|
|
30
|
+
.delete("/templates/".concat(templateId, "/roles/").concat(roleName))
|
|
32
31
|
.then(function (r) { return r.data; });
|
|
33
32
|
};
|
|
34
|
-
export var getRoleFields = function (templateId, roleName) {
|
|
35
|
-
return
|
|
36
|
-
.
|
|
33
|
+
export var getRoleFields = function (endpoint, templateId, roleName) {
|
|
34
|
+
return endpoint.api //
|
|
35
|
+
.get("/templates/".concat(templateId, "/roles/").concat(roleName, "/fields"))
|
|
37
36
|
.then(function (r) { return r.data; });
|
|
38
37
|
};
|
|
39
|
-
export var deleteSequence = function (templateId) {
|
|
40
|
-
return
|
|
41
|
-
.
|
|
38
|
+
export var deleteSequence = function (endpoint, templateId) {
|
|
39
|
+
return endpoint.api //
|
|
40
|
+
.delete("/templates/".concat(templateId, "/roles/"))
|
|
42
41
|
.then(function (r) { return r.data; });
|
|
43
42
|
};
|