@verdocs/js-sdk 1.0.27 → 1.0.28
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 +12 -3
- package/Documents/Documents.js +25 -2
- package/Documents/Signatures.js +4 -4
- package/Documents/Stars.js +1 -1
- package/Documents/Types.d.ts +19 -0
- package/HTTP/Transport.d.ts +13 -39
- package/HTTP/Transport.js +18 -81
- package/HTTP/{Endpoint.d.ts → VerdocsEndpoint.d.ts} +8 -7
- package/HTTP/{Endpoint.js → VerdocsEndpoint.js} +21 -20
- package/HTTP/index.d.ts +1 -1
- package/HTTP/index.js +1 -1
- 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 +6 -6
- package/Organizations/Webhooks.js +2 -2
- package/Organizations/Whitelabel.js +2 -2
- package/Search/Content.js +3 -3
- 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 +6 -6
- package/Templates/Templates.js +6 -6
- package/Templates/Validators.js +2 -2
- package/Users/Auth.js +6 -6
- package/Users/Notifications.js +1 -1
- package/Users/Profiles.js +10 -10
- package/package.json +1 -1
package/Documents/Documents.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ISigningSession, ISigningSessionRequest } from './Types';
|
|
1
2
|
export declare type TDocumentStatus = 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled';
|
|
2
3
|
export declare type TRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted' | 'canceled' | 'pending' | 'declined';
|
|
3
4
|
export declare type TRecipientType = 'signer' | 'cc' | 'approver';
|
|
@@ -51,10 +52,10 @@ export interface IRecipient {
|
|
|
51
52
|
email: string;
|
|
52
53
|
envelope_id: string;
|
|
53
54
|
full_name: string;
|
|
54
|
-
in_app_access_key
|
|
55
|
-
key_used_to_conclude
|
|
55
|
+
in_app_access_key?: string;
|
|
56
|
+
key_used_to_conclude?: string;
|
|
56
57
|
message: string | null;
|
|
57
|
-
phone: string;
|
|
58
|
+
phone: string | null;
|
|
58
59
|
profile_id: string;
|
|
59
60
|
role_name: string;
|
|
60
61
|
sequence: number;
|
|
@@ -137,3 +138,11 @@ export declare const getSummary: (page: number) => Promise<IDocumentsSummary>;
|
|
|
137
138
|
* ```
|
|
138
139
|
*/
|
|
139
140
|
export declare const searchDocuments: (params: any) => Promise<IDocumentsSearchResult>;
|
|
141
|
+
/**
|
|
142
|
+
* Get a signing session for a document.
|
|
143
|
+
*/
|
|
144
|
+
export declare const getSigningSession: (params: ISigningSessionRequest) => Promise<{
|
|
145
|
+
recipient: IRecipient;
|
|
146
|
+
session: ISigningSession;
|
|
147
|
+
}>;
|
|
148
|
+
export declare const getDocumentRecipients: (documentId: string) => Promise<IRecipient[]>;
|
package/Documents/Documents.js
CHANGED
|
@@ -47,7 +47,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
47
47
|
export var getSummary = function (page) { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
return [2 /*return*/, getEndpoint()
|
|
50
|
-
.post('/documents/summary', { page: page })
|
|
50
|
+
.api.post('/documents/summary', { page: page })
|
|
51
51
|
.then(function (r) { return r.data; })];
|
|
52
52
|
});
|
|
53
53
|
}); };
|
|
@@ -63,7 +63,30 @@ export var getSummary = function (page) { return __awaiter(void 0, void 0, void
|
|
|
63
63
|
export var searchDocuments = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
64
|
return __generator(this, function (_a) {
|
|
65
65
|
return [2 /*return*/, getEndpoint()
|
|
66
|
-
.post('/documents/search', params)
|
|
66
|
+
.api.post('/documents/search', params)
|
|
67
|
+
.then(function (r) { return r.data; })];
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
70
|
+
/**
|
|
71
|
+
* Get a signing session for a document.
|
|
72
|
+
*/
|
|
73
|
+
export var getSigningSession = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
return [2 /*return*/, getEndpoint()
|
|
76
|
+
.api.get("/documents/".concat(params.documentId, "/recipients/").concat(encodeURIComponent(params.roleId), "/invitation/").concat(params.inviteCode))
|
|
77
|
+
.then(function (r) {
|
|
78
|
+
var _a;
|
|
79
|
+
// Avoiding a jsonwebtoken dependency here - we don't actually need the whole library
|
|
80
|
+
var signerToken = ((_a = r.headers) === null || _a === void 0 ? void 0 : _a.signer_token) || '';
|
|
81
|
+
var session = JSON.parse(atob(signerToken.split('.')[1]));
|
|
82
|
+
return { recipient: r.data, session: session };
|
|
83
|
+
})];
|
|
84
|
+
});
|
|
85
|
+
}); };
|
|
86
|
+
export var getDocumentRecipients = function (documentId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
|
+
return __generator(this, function (_a) {
|
|
88
|
+
return [2 /*return*/, getEndpoint()
|
|
89
|
+
.api.get("/documents/".concat(documentId, "/recipients"))
|
|
67
90
|
.then(function (r) { return r.data; })];
|
|
68
91
|
});
|
|
69
92
|
}); };
|
package/Documents/Signatures.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var createSignature = function (params) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.post('/signatures', params)
|
|
4
|
+
.api.post('/signatures', params)
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var getSignatures = function () {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get('/signatures')
|
|
9
|
+
.api.get('/signatures')
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var getSignature = function (signatureId) {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.get("/signatures/".concat(signatureId))
|
|
14
|
+
.api.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/".concat(signatureId))
|
|
19
|
+
.api.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/".concat(templateId, "/stars/toggle")).then(function (r) { return r.data; })];
|
|
39
|
+
return [2 /*return*/, getEndpoint().api.post("/templates/".concat(templateId, "/stars/toggle")).then(function (r) { return r.data; })];
|
|
40
40
|
}); }); };
|
package/Documents/Types.d.ts
CHANGED
|
@@ -21,3 +21,22 @@ export interface ITemplatesSummary {
|
|
|
21
21
|
total: number;
|
|
22
22
|
result: ITemplateSummaryEntry[];
|
|
23
23
|
}
|
|
24
|
+
export interface ISigningSessionRequest {
|
|
25
|
+
documentId: string;
|
|
26
|
+
roleId: string;
|
|
27
|
+
inviteCode: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ISigningSession {
|
|
30
|
+
profile_id: 'guest|515c9dc1-4c5c-4255-9f75-44b6870fc0eb';
|
|
31
|
+
document_id: 'f484a296-4f4c-4783-9adf-a3302915a503';
|
|
32
|
+
role: 'Recipient 2';
|
|
33
|
+
email: 'crobinson@medialantern.com';
|
|
34
|
+
access_key: {
|
|
35
|
+
id: 'a59ceb98-3fab-44d2-af8a-13088d6c1a32';
|
|
36
|
+
type: 'email';
|
|
37
|
+
};
|
|
38
|
+
iss: 'https://stage-realster.auth0.com';
|
|
39
|
+
aud: 'QYVTceK2qtOQvH8Nl2APUJaBMRys1y95';
|
|
40
|
+
exp: 1641881182;
|
|
41
|
+
iat: 1641873982;
|
|
42
|
+
}
|
package/HTTP/Transport.d.ts
CHANGED
|
@@ -5,56 +5,30 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { VerdocsEndpoint } from './VerdocsEndpoint';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ```typescript
|
|
13
|
-
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
14
|
-
*
|
|
15
|
-
* Transport.setAuthorization(accessToken);
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const setAuthorization: (accessToken: string | null) => void;
|
|
19
|
-
/**
|
|
20
|
-
* Set the Client ID for Verdocs API calls.
|
|
21
|
-
*
|
|
22
|
-
* ```typescript
|
|
23
|
-
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
24
|
-
*
|
|
25
|
-
* Transport.setClientID('1234);
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare const setClientID: (clientID: string) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Set the base URL for API calls. This defaults to https://api.verdocs.com/ and should only be changed after consultation with
|
|
31
|
-
* Verdocs Developer Support (e.g. to access a private API endpoint).
|
|
32
|
-
*
|
|
33
|
-
* ```typescript
|
|
34
|
-
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
35
|
-
*
|
|
36
|
-
* Transport.setBaseUrl('https://my-private-api.verdocs.com');
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare const setBaseUrl: (baseUrl: string) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
|
|
10
|
+
* Helper to get the endpoint for direct access to HTTP functions.
|
|
42
11
|
*
|
|
43
12
|
* ```typescript
|
|
44
13
|
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
45
14
|
*
|
|
46
|
-
* Transport.
|
|
15
|
+
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
|
|
47
16
|
* ```
|
|
48
17
|
*/
|
|
49
|
-
export declare const
|
|
50
|
-
export declare const logRequests: (enable: boolean) => void;
|
|
18
|
+
export declare const getEndpoint: () => VerdocsEndpoint;
|
|
51
19
|
/**
|
|
52
|
-
*
|
|
20
|
+
* Change the endpoint that will be used when making calls to Verdocs. Only one endpoint may be active at a time.
|
|
21
|
+
* Authorization and other configuration data is specific to each endpoint, and will not be carried over when the
|
|
22
|
+
* endpoint is changed. The typical use-case is to change to a sandboxed endpoint for signing sessions, then revert
|
|
23
|
+
* to the global endpoint when the signing session is complete. To revert, pass `null` as the endpoint to use.
|
|
53
24
|
*
|
|
54
25
|
* ```typescript
|
|
55
26
|
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
56
27
|
*
|
|
57
|
-
*
|
|
28
|
+
* const mySigningEndpoint = new VerdocsEndpoint();
|
|
29
|
+
* setActiveEndpoint(mySigningEndpoint);
|
|
30
|
+
* ... [Perform signing operations]
|
|
31
|
+
* setActiveEndpoint(null);
|
|
58
32
|
* ```
|
|
59
33
|
*/
|
|
60
|
-
export declare const
|
|
34
|
+
export declare const setActiveEndpoint: (e: VerdocsEndpoint | null) => void;
|
package/HTTP/Transport.js
CHANGED
|
@@ -5,106 +5,43 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import axios from 'axios';
|
|
9
8
|
import globalThis from './globalThis';
|
|
10
|
-
|
|
11
|
-
baseURL: 'https://api.verdocs.com/',
|
|
12
|
-
timeout: 6000,
|
|
13
|
-
headers: { 'X-Client-ID': 'NONE' },
|
|
14
|
-
};
|
|
9
|
+
import { VerdocsEndpoint } from './VerdocsEndpoint';
|
|
15
10
|
// @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/
|
|
16
11
|
// Also see globalThis for comments about why we're doing this in the first place.
|
|
17
12
|
var ENDPOINT_KEY = Symbol.for('verdocs-api-endpoint');
|
|
18
13
|
if (!globalThis[ENDPOINT_KEY]) {
|
|
19
|
-
globalThis[ENDPOINT_KEY] =
|
|
14
|
+
globalThis[ENDPOINT_KEY] = new VerdocsEndpoint({ baseURL: 'https://api.verdocs.com/' });
|
|
20
15
|
}
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
// tslint:disable-next-line
|
|
24
|
-
console.log("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
25
|
-
return r;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Set the auth token that will be used for Verdocs API calls.
|
|
29
|
-
*
|
|
30
|
-
* ```typescript
|
|
31
|
-
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
32
|
-
*
|
|
33
|
-
* Transport.setAuthorization(accessToken);
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export var setAuthorization = function (accessToken) {
|
|
37
|
-
if (accessToken) {
|
|
38
|
-
endpoint.defaults.headers.Authorization = "Bearer ".concat(accessToken);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
delete endpoint.defaults.headers.Authorization;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Set the Client ID for Verdocs API calls.
|
|
46
|
-
*
|
|
47
|
-
* ```typescript
|
|
48
|
-
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
49
|
-
*
|
|
50
|
-
* Transport.setClientID('1234);
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
export var setClientID = function (clientID) {
|
|
54
|
-
endpoint.defaults.headers['X-Client-ID'] = clientID;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Set the base URL for API calls. This defaults to https://api.verdocs.com/ and should only be changed after consultation with
|
|
58
|
-
* Verdocs Developer Support (e.g. to access a private API endpoint).
|
|
59
|
-
*
|
|
60
|
-
* ```typescript
|
|
61
|
-
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
62
|
-
*
|
|
63
|
-
* Transport.setBaseUrl('https://my-private-api.verdocs.com');
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export var setBaseUrl = function (baseUrl) {
|
|
67
|
-
endpoint.defaults.baseURL = baseUrl;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
|
|
71
|
-
*
|
|
72
|
-
* ```typescript
|
|
73
|
-
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
74
|
-
*
|
|
75
|
-
* Transport.setTimeout(3000);
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export var setTimeout = function (timeout) {
|
|
79
|
-
endpoint.defaults.timeout = timeout;
|
|
80
|
-
};
|
|
16
|
+
var globalEndpoint = globalThis[ENDPOINT_KEY];
|
|
17
|
+
var activeEndpoint = globalEndpoint;
|
|
81
18
|
/**
|
|
82
|
-
*
|
|
19
|
+
* Helper to get the endpoint for direct access to HTTP functions.
|
|
83
20
|
*
|
|
84
21
|
* ```typescript
|
|
85
22
|
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
86
23
|
*
|
|
87
|
-
* Transport.
|
|
24
|
+
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
|
|
88
25
|
* ```
|
|
89
26
|
*/
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
if (enable && requestLoggerId === null) {
|
|
93
|
-
requestLoggerId = endpoint.interceptors.request.use(requestLogger);
|
|
94
|
-
}
|
|
95
|
-
else if (!enable && requestLoggerId !== null) {
|
|
96
|
-
endpoint.interceptors.request.eject(requestLoggerId);
|
|
97
|
-
}
|
|
27
|
+
export var getEndpoint = function () {
|
|
28
|
+
return activeEndpoint;
|
|
98
29
|
};
|
|
99
30
|
/**
|
|
100
|
-
*
|
|
31
|
+
* Change the endpoint that will be used when making calls to Verdocs. Only one endpoint may be active at a time.
|
|
32
|
+
* Authorization and other configuration data is specific to each endpoint, and will not be carried over when the
|
|
33
|
+
* endpoint is changed. The typical use-case is to change to a sandboxed endpoint for signing sessions, then revert
|
|
34
|
+
* to the global endpoint when the signing session is complete. To revert, pass `null` as the endpoint to use.
|
|
101
35
|
*
|
|
102
36
|
* ```typescript
|
|
103
37
|
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
104
38
|
*
|
|
105
|
-
*
|
|
39
|
+
* const mySigningEndpoint = new VerdocsEndpoint();
|
|
40
|
+
* setActiveEndpoint(mySigningEndpoint);
|
|
41
|
+
* ... [Perform signing operations]
|
|
42
|
+
* setActiveEndpoint(null);
|
|
106
43
|
* ```
|
|
107
44
|
*/
|
|
108
|
-
export var
|
|
109
|
-
|
|
45
|
+
export var setActiveEndpoint = function (e) {
|
|
46
|
+
activeEndpoint = e || globalEndpoint;
|
|
110
47
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* to simpliy standard-user operations, Endpoints can be used for isolated session tasks.
|
|
4
|
-
* created independently of a caller's status as an authenticated user.
|
|
5
|
-
* for calls related to signing operations, then
|
|
2
|
+
* A VerdocsEndpoint is a specific connection and authorization session for calling the Verdocs APIs. Where the global
|
|
3
|
+
* Transport is generally used to simpliy standard-user operations, Endpoints can be used for isolated session tasks.
|
|
4
|
+
* For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.
|
|
5
|
+
* In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then
|
|
6
|
+
* discarded once signing is complete.
|
|
6
7
|
*
|
|
7
8
|
* @module
|
|
8
9
|
*/
|
|
9
10
|
import { AxiosInstance } from 'axios';
|
|
10
|
-
export declare class
|
|
11
|
+
export declare class VerdocsEndpoint {
|
|
11
12
|
baseURL: string;
|
|
12
|
-
|
|
13
|
+
api: AxiosInstance;
|
|
13
14
|
requestLoggerId: number | null;
|
|
14
15
|
/**
|
|
15
16
|
* Create a new Endpoint to call Verdocs services.
|
|
@@ -20,7 +21,7 @@ export declare class Endpoint {
|
|
|
20
21
|
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
|
|
21
22
|
* ```
|
|
22
23
|
*/
|
|
23
|
-
constructor({ baseURL }
|
|
24
|
+
constructor({ baseURL }?: {
|
|
24
25
|
baseURL?: string;
|
|
25
26
|
});
|
|
26
27
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* to simpliy standard-user operations, Endpoints can be used for isolated session tasks.
|
|
4
|
-
* created independently of a caller's status as an authenticated user.
|
|
5
|
-
* for calls related to signing operations, then
|
|
2
|
+
* A VerdocsEndpoint is a specific connection and authorization session for calling the Verdocs APIs. Where the global
|
|
3
|
+
* Transport is generally used to simpliy standard-user operations, Endpoints can be used for isolated session tasks.
|
|
4
|
+
* For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.
|
|
5
|
+
* In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then
|
|
6
|
+
* discarded once signing is complete.
|
|
6
7
|
*
|
|
7
8
|
* @module
|
|
8
9
|
*/
|
|
@@ -12,7 +13,7 @@ var requestLogger = function (r) {
|
|
|
12
13
|
console.log("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
13
14
|
return r;
|
|
14
15
|
};
|
|
15
|
-
var
|
|
16
|
+
var VerdocsEndpoint = /** @class */ (function () {
|
|
16
17
|
/**
|
|
17
18
|
* Create a new Endpoint to call Verdocs services.
|
|
18
19
|
*
|
|
@@ -22,11 +23,11 @@ var Endpoint = /** @class */ (function () {
|
|
|
22
23
|
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
|
-
function
|
|
26
|
-
var baseURL =
|
|
26
|
+
function VerdocsEndpoint(_a) {
|
|
27
|
+
var _b = _a === void 0 ? {} : _a, baseURL = _b.baseURL;
|
|
27
28
|
this.requestLoggerId = null;
|
|
28
29
|
this.baseURL = baseURL || 'https://api.verdocs.com/';
|
|
29
|
-
this.
|
|
30
|
+
this.api = axios.create({
|
|
30
31
|
baseURL: this.baseURL,
|
|
31
32
|
timeout: 6000,
|
|
32
33
|
});
|
|
@@ -41,8 +42,8 @@ var Endpoint = /** @class */ (function () {
|
|
|
41
42
|
* endpoint.setTimeout(3000);
|
|
42
43
|
* ```
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
-
this.
|
|
45
|
+
VerdocsEndpoint.prototype.setTimeout = function (timeout) {
|
|
46
|
+
this.api.defaults.timeout = timeout;
|
|
46
47
|
};
|
|
47
48
|
/**
|
|
48
49
|
* Set the Client ID for Verdocs API calls.
|
|
@@ -54,8 +55,8 @@ var Endpoint = /** @class */ (function () {
|
|
|
54
55
|
* endpoint.setClientID('1234);
|
|
55
56
|
* ```
|
|
56
57
|
*/
|
|
57
|
-
|
|
58
|
-
this.
|
|
58
|
+
VerdocsEndpoint.prototype.setClientID = function (clientID) {
|
|
59
|
+
this.api.defaults.headers['X-Client-ID'] = clientID;
|
|
59
60
|
};
|
|
60
61
|
/**
|
|
61
62
|
* Set the auth token that will be used for Verdocs API calls.
|
|
@@ -67,12 +68,12 @@ var Endpoint = /** @class */ (function () {
|
|
|
67
68
|
* endpoint.setAuthorization(accessToken);
|
|
68
69
|
* ```
|
|
69
70
|
*/
|
|
70
|
-
|
|
71
|
+
VerdocsEndpoint.prototype.setAuthorization = function (accessToken) {
|
|
71
72
|
if (accessToken) {
|
|
72
|
-
this.
|
|
73
|
+
this.api.defaults.headers.Authorization = "Bearer ".concat(accessToken);
|
|
73
74
|
}
|
|
74
75
|
else {
|
|
75
|
-
delete this.
|
|
76
|
+
delete this.api.defaults.headers.Authorization;
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
79
|
/**
|
|
@@ -85,14 +86,14 @@ var Endpoint = /** @class */ (function () {
|
|
|
85
86
|
* endpoint.logRequests(true);
|
|
86
87
|
* ```
|
|
87
88
|
*/
|
|
88
|
-
|
|
89
|
+
VerdocsEndpoint.prototype.logRequests = function (enable) {
|
|
89
90
|
if (enable && this.requestLoggerId === null) {
|
|
90
|
-
this.requestLoggerId = this.
|
|
91
|
+
this.requestLoggerId = this.api.interceptors.request.use(requestLogger);
|
|
91
92
|
}
|
|
92
93
|
else if (!enable && this.requestLoggerId !== null) {
|
|
93
|
-
this.
|
|
94
|
+
this.api.interceptors.request.eject(this.requestLoggerId);
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
|
-
return
|
|
97
|
+
return VerdocsEndpoint;
|
|
97
98
|
}());
|
|
98
|
-
export {
|
|
99
|
+
export { VerdocsEndpoint };
|
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/".concat(organizationId, "/api_key"))
|
|
25
|
+
.api.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/".concat(organizationId, "/api_key"), params)
|
|
39
|
+
.api.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/".concat(organizationId, "/api_key/").concat(clientId, "/rotate"))
|
|
53
|
+
.api.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/".concat(organizationId, "/api_key/").concat(clientId), params)
|
|
67
|
+
.api.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/".concat(organizationId, "/api_key/").concat(clientId))
|
|
81
|
+
.api.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/".concat(organizationId, "/groups"))
|
|
22
|
+
.api.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/".concat(organizationId, "/groups/").concat(groupId))
|
|
36
|
+
.api.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/".concat(organizationId, "/groups/").concat(groupId, "/members"))
|
|
41
|
+
.api.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/".concat(organizationId, "/groups/").concat(groupId, "/members"), params)
|
|
46
|
+
.api.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/".concat(organizationId, "/groups/").concat(groupId, "/delete_members"), params)
|
|
51
|
+
.api.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/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId), params)
|
|
56
|
+
.api.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/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId))
|
|
61
|
+
.api.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/".concat(organizationId, "/invitation"))
|
|
9
|
+
.api.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/".concat(organizationId, "/invitation"), params)
|
|
14
|
+
.api.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/".concat(organizationId, "/invitation/").concat(email))
|
|
19
|
+
.api.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/".concat(organizationId, "/invitation/").concat(email), params)
|
|
24
|
+
.api.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/".concat(organizationId, "/invitation/").concat(email, "/resend"))
|
|
29
|
+
.api.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/".concat(organizationId, "/invitation/").concat(email), params)
|
|
34
|
+
.api.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/".concat(organizationId, "/invitation/").concat(email, "/token/").concat(token, "/new_user"))
|
|
39
|
+
.api.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/".concat(organizationId, "/profiles"))
|
|
9
|
+
.api.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/".concat(organizationId, "/profiles/").concat(profileId))
|
|
14
|
+
.api.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/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId))
|
|
19
|
+
.api.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/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId))
|
|
24
|
+
.api.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/".concat(organizationId, "/profiles/").concat(profileId, "/plans"))
|
|
29
|
+
.api.get("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/plans"))
|
|
30
30
|
.then(function (r) { return r.data; });
|
|
31
31
|
};
|
|
@@ -6,31 +6,31 @@
|
|
|
6
6
|
import { getEndpoint } from '../HTTP/Transport';
|
|
7
7
|
export var getOrganizations = function () {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get('/organizations')
|
|
9
|
+
.api.get('/organizations')
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
12
12
|
export var createOrganization = function () {
|
|
13
13
|
return getEndpoint()
|
|
14
|
-
.post('/organizations')
|
|
14
|
+
.api.post('/organizations')
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var validateOrganization = function () {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.get('/organizations/is_valid')
|
|
19
|
+
.api.get('/organizations/is_valid')
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
|
22
22
|
export var deleteOrganization = function (organizationId) {
|
|
23
23
|
return getEndpoint()
|
|
24
|
-
.delete("/organizations/".concat(organizationId))
|
|
24
|
+
.api.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/".concat(organizationId))
|
|
29
|
+
.api.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/".concat(organizationId), params)
|
|
34
|
+
.api.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/".concat(organizationId, "/webhook"))
|
|
4
|
+
.api.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/".concat(organizationId, "/webhook"), params)
|
|
9
|
+
.api.post("/organizations/".concat(organizationId, "/webhook"), params)
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
|
@@ -20,7 +20,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
20
20
|
*/
|
|
21
21
|
export var setWhitelabel = function () {
|
|
22
22
|
return getEndpoint()
|
|
23
|
-
.post('/whitelabel')
|
|
23
|
+
.api.post('/whitelabel')
|
|
24
24
|
.then(function (r) { return r.data; });
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
@@ -34,6 +34,6 @@ export var setWhitelabel = function () {
|
|
|
34
34
|
*/
|
|
35
35
|
export var getWhitelabel = function () {
|
|
36
36
|
return getEndpoint()
|
|
37
|
-
.get('/whitelabel')
|
|
37
|
+
.api.get('/whitelabel')
|
|
38
38
|
.then(function (r) { return r.data; });
|
|
39
39
|
};
|
package/Search/Content.js
CHANGED
|
@@ -55,7 +55,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
55
55
|
export var getSearchHistory = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
56
|
return __generator(this, function (_a) {
|
|
57
57
|
return [2 /*return*/, getEndpoint()
|
|
58
|
-
.get('/search/history')
|
|
58
|
+
.api.get('/search/history')
|
|
59
59
|
.then(function (r) { return r.data; })];
|
|
60
60
|
});
|
|
61
61
|
}); };
|
|
@@ -71,7 +71,7 @@ export var getSearchHistory = function () { return __awaiter(void 0, void 0, voi
|
|
|
71
71
|
export var saveSearch = function (name, params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
72
72
|
return __generator(this, function (_a) {
|
|
73
73
|
return [2 /*return*/, getEndpoint()
|
|
74
|
-
.post('/search/saved', { name: name, params: params })
|
|
74
|
+
.api.post('/search/saved', { name: name, params: params })
|
|
75
75
|
.then(function (r) { return r.data; })];
|
|
76
76
|
});
|
|
77
77
|
}); };
|
|
@@ -87,7 +87,7 @@ export var saveSearch = function (name, params) { return __awaiter(void 0, void
|
|
|
87
87
|
export var searchContent = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
88
|
return __generator(this, function (_a) {
|
|
89
89
|
return [2 /*return*/, getEndpoint()
|
|
90
|
-
.post('/search/content', params)
|
|
90
|
+
.api.post('/search/content', params)
|
|
91
91
|
.then(function (r) { return r.data; })];
|
|
92
92
|
});
|
|
93
93
|
}); };
|
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/".concat(templateId, "/documents/"))
|
|
13
|
+
.api.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/".concat(templateId, "/documents/"), params)
|
|
27
|
+
.api.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/".concat(templateId, "/documents/").concat(documentId))
|
|
41
|
+
.api.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/".concat(templateId, "/documents/").concat(documentId))
|
|
55
|
+
.api.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/".concat(templateId, "/pages/"), params)
|
|
4
|
+
.api.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/".concat(templateId, "/pages/").concat(fieldName), params)
|
|
9
|
+
.api.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/".concat(templateId, "/pages/").concat(fieldName))
|
|
14
|
+
.api.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/".concat(templateId, "/pages/"), params)
|
|
4
|
+
.api.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/".concat(templateId, "/pages/").concat(sequence))
|
|
9
|
+
.api.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/".concat(templateId, "/pages/").concat(sequence))
|
|
14
|
+
.api.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/".concat(templateId, "/pages/").concat(sequence))
|
|
19
|
+
.api.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/".concat(templateId, "/reminder/"), params)
|
|
4
|
+
.api.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/".concat(templateId, "/reminder/").concat(reminderId))
|
|
9
|
+
.api.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/".concat(templateId, "/reminder/").concat(reminderId))
|
|
14
|
+
.api.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/".concat(templateId, "/reminder/").concat(reminderId))
|
|
19
|
+
.api.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/".concat(templateId, "/roles/"), params)
|
|
4
|
+
.api.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/".concat(templateId, "/roles/"))
|
|
9
|
+
.api.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/".concat(templateId, "/roles/").concat(roleName))
|
|
14
|
+
.api.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/".concat(templateId, "/roles/").concat(roleName), params)
|
|
19
|
+
.api.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/".concat(templateId, "/roles/").concat(roleName))
|
|
24
|
+
.api.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/".concat(templateId, "/roles/").concat(roleName, "/fields"))
|
|
29
|
+
.api.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/".concat(templateId, "/roles/"))
|
|
34
|
+
.api.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/".concat(templateId, "/stars/"))
|
|
4
|
+
.api.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/".concat(templateId, "/stars/toggle"))
|
|
9
|
+
.api.get("/templates/".concat(templateId, "/stars/toggle"))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
package/Templates/Tags.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var addTemplateTag = function (templateId, params) {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.post("/templates/".concat(templateId, "/tags/"), params)
|
|
4
|
+
.api.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/".concat(templateId, "/tags/"))
|
|
9
|
+
.api.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/".concat(templateId, "/tags/").concat(tagName))
|
|
14
|
+
.api.post("/templates/".concat(templateId, "/tags/").concat(tagName))
|
|
15
15
|
.then(function (r) { return r.data; });
|
|
16
16
|
};
|
|
17
17
|
export var createTag = function (params) {
|
|
18
18
|
return getEndpoint()
|
|
19
|
-
.post('/tags', params)
|
|
19
|
+
.api.post('/tags', params)
|
|
20
20
|
.then(function (r) { return r.data; });
|
|
21
21
|
};
|
|
22
22
|
export var getTag = function (tagName) {
|
|
23
23
|
return getEndpoint()
|
|
24
|
-
.get("/tags/".concat(tagName))
|
|
24
|
+
.api.get("/tags/".concat(tagName))
|
|
25
25
|
.then(function (r) { return r.data; });
|
|
26
26
|
};
|
|
27
27
|
export var getAllTags = function (params) {
|
|
28
28
|
return getEndpoint()
|
|
29
|
-
.get('/tags', params)
|
|
29
|
+
.api.get('/tags', params)
|
|
30
30
|
.then(function (r) { return r.data; });
|
|
31
31
|
};
|
package/Templates/Templates.js
CHANGED
|
@@ -37,22 +37,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import { getEndpoint } from '../HTTP/Transport';
|
|
38
38
|
export var getTemplates = function () {
|
|
39
39
|
return getEndpoint()
|
|
40
|
-
.get('/templates/')
|
|
40
|
+
.api.get('/templates/')
|
|
41
41
|
.then(function (r) { return r.data; });
|
|
42
42
|
};
|
|
43
43
|
export var getTemplate = function (templateId) {
|
|
44
44
|
return getEndpoint()
|
|
45
|
-
.get("/templates/".concat(templateId))
|
|
45
|
+
.api.get("/templates/".concat(templateId))
|
|
46
46
|
.then(function (r) { return r.data; });
|
|
47
47
|
};
|
|
48
48
|
export var createTemplate = function (params) {
|
|
49
49
|
return getEndpoint()
|
|
50
|
-
.post('/templates/', params)
|
|
50
|
+
.api.post('/templates/', params)
|
|
51
51
|
.then(function (r) { return r.data; });
|
|
52
52
|
};
|
|
53
53
|
export var editTemplate = function (templateId, params) {
|
|
54
54
|
return getEndpoint()
|
|
55
|
-
.put("/templates/".concat(templateId), params)
|
|
55
|
+
.api.put("/templates/".concat(templateId), params)
|
|
56
56
|
.then(function (r) { return r.data; });
|
|
57
57
|
};
|
|
58
58
|
/**
|
|
@@ -67,14 +67,14 @@ export var editTemplate = function (templateId, params) {
|
|
|
67
67
|
export var searchTemplates = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
68
|
return __generator(this, function (_a) {
|
|
69
69
|
return [2 /*return*/, getEndpoint()
|
|
70
|
-
.post('/templates/search', params)
|
|
70
|
+
.api.post('/templates/search', params)
|
|
71
71
|
.then(function (r) { return r.data; })];
|
|
72
72
|
});
|
|
73
73
|
}); };
|
|
74
74
|
export var getSummary = function (page) { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
75
|
return __generator(this, function (_a) {
|
|
76
76
|
return [2 /*return*/, getEndpoint()
|
|
77
|
-
.post('/templates/summary', { page: page })
|
|
77
|
+
.api.post('/templates/summary', { page: page })
|
|
78
78
|
.then(function (r) { return r.data; })];
|
|
79
79
|
});
|
|
80
80
|
}); };
|
package/Templates/Validators.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
export var getValidators = function () {
|
|
3
3
|
return getEndpoint()
|
|
4
|
-
.get('/validators')
|
|
4
|
+
.api.get('/validators')
|
|
5
5
|
.then(function (r) { return r.data; });
|
|
6
6
|
};
|
|
7
7
|
export var getValidator = function (validatorName) {
|
|
8
8
|
return getEndpoint()
|
|
9
|
-
.get("/validators/".concat(validatorName))
|
|
9
|
+
.api.get("/validators/".concat(validatorName))
|
|
10
10
|
.then(function (r) { return r.data; });
|
|
11
11
|
};
|
package/Users/Auth.js
CHANGED
|
@@ -12,7 +12,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
12
12
|
*/
|
|
13
13
|
export var authenticateUser = function (params) {
|
|
14
14
|
return getEndpoint()
|
|
15
|
-
.post('/authentication/login', params)
|
|
15
|
+
.api.post('/authentication/login', params)
|
|
16
16
|
.then(function (r) { return r.data; });
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
@@ -32,7 +32,7 @@ export var authenticateUser = function (params) {
|
|
|
32
32
|
*/
|
|
33
33
|
export var authenticateApp = function (params) {
|
|
34
34
|
return getEndpoint()
|
|
35
|
-
.post('/authentication/login_client', {}, { headers: params })
|
|
35
|
+
.api.post('/authentication/login_client', {}, { headers: params })
|
|
36
36
|
.then(function (r) { return r.data; });
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
@@ -51,7 +51,7 @@ export var authenticateApp = function (params) {
|
|
|
51
51
|
*/
|
|
52
52
|
export var validateToken = function (params) {
|
|
53
53
|
return getEndpoint()
|
|
54
|
-
.post('/token/isValid', params)
|
|
54
|
+
.api.post('/token/isValid', params)
|
|
55
55
|
.then(function (r) { return r.data; });
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
@@ -67,7 +67,7 @@ export var validateToken = function (params) {
|
|
|
67
67
|
*/
|
|
68
68
|
export var refreshTokens = function () {
|
|
69
69
|
return getEndpoint()
|
|
70
|
-
.get('/token')
|
|
70
|
+
.api.get('/token')
|
|
71
71
|
.then(function (r) { return r.data; });
|
|
72
72
|
};
|
|
73
73
|
/**
|
|
@@ -84,7 +84,7 @@ export var refreshTokens = function () {
|
|
|
84
84
|
*/
|
|
85
85
|
export var updatePassword = function (params) {
|
|
86
86
|
return getEndpoint()
|
|
87
|
-
.put('/user/update_password', params)
|
|
87
|
+
.api.put('/user/update_password', params)
|
|
88
88
|
.then(function (r) { return r.data; });
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
@@ -98,6 +98,6 @@ export var updatePassword = function (params) {
|
|
|
98
98
|
*/
|
|
99
99
|
export var updateEmail = function (params) {
|
|
100
100
|
return getEndpoint()
|
|
101
|
-
.put('/user/update_email', params)
|
|
101
|
+
.api.put('/user/update_email', params)
|
|
102
102
|
.then(function (r) { return r.data; });
|
|
103
103
|
};
|
package/Users/Notifications.js
CHANGED
|
@@ -38,7 +38,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
38
38
|
export var getNotifications = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
39
39
|
return __generator(this, function (_a) {
|
|
40
40
|
return [2 /*return*/, getEndpoint()
|
|
41
|
-
.get('/notifications')
|
|
41
|
+
.api.get('/notifications')
|
|
42
42
|
.then(function (r) { return r.data; })];
|
|
43
43
|
});
|
|
44
44
|
}); };
|
package/Users/Profiles.js
CHANGED
|
@@ -10,7 +10,7 @@ import { getEndpoint } from '../HTTP/Transport';
|
|
|
10
10
|
*/
|
|
11
11
|
export var getProfiles = function () {
|
|
12
12
|
return getEndpoint()
|
|
13
|
-
.get('/profiles')
|
|
13
|
+
.api.get('/profiles')
|
|
14
14
|
.then(function (r) { return r.data; });
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -24,7 +24,7 @@ export var getProfiles = function () {
|
|
|
24
24
|
*/
|
|
25
25
|
export var getRoles = function () {
|
|
26
26
|
return getEndpoint()
|
|
27
|
-
.get('/roles')
|
|
27
|
+
.api.get('/roles')
|
|
28
28
|
.then(function (r) { return r.data; });
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
@@ -38,7 +38,7 @@ export var getRoles = function () {
|
|
|
38
38
|
*/
|
|
39
39
|
export var getPermissions = function () {
|
|
40
40
|
return getEndpoint()
|
|
41
|
-
.get('/permissions')
|
|
41
|
+
.api.get('/permissions')
|
|
42
42
|
.then(function (r) { return r.data; });
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
@@ -52,7 +52,7 @@ export var getPermissions = function () {
|
|
|
52
52
|
*/
|
|
53
53
|
export var createProfile = function (params) {
|
|
54
54
|
return getEndpoint()
|
|
55
|
-
.post('/profiles', params)
|
|
55
|
+
.api.post('/profiles', params)
|
|
56
56
|
.then(function (r) { return r.data; });
|
|
57
57
|
};
|
|
58
58
|
/**
|
|
@@ -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/".concat(profileId))
|
|
70
|
+
.api.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/".concat(profileId, "/permissions"))
|
|
84
|
+
.api.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/".concat(profileId, "/groups"))
|
|
98
|
+
.api.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/".concat(profileId, "/switch"))
|
|
113
|
+
.api.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/".concat(profileId), params)
|
|
128
|
+
.api.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/".concat(profileId))
|
|
142
|
+
.api.delete("/profiles/".concat(profileId))
|
|
143
143
|
.then(function (r) { return r.data; });
|
|
144
144
|
};
|