@verdocs/js-sdk 1.0.20 → 1.0.25

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.
@@ -11,11 +11,11 @@ export var getSignatures = function () {
11
11
  };
12
12
  export var getSignature = function (signatureId) {
13
13
  return getEndpoint()
14
- .get("/signatures/" + signatureId)
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/" + signatureId)
19
+ .delete("/signatures/".concat(signatureId))
20
20
  .then(function (r) { return r.data; });
21
21
  };
@@ -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/" + templateId + "/stars/toggle").then(function (r) { return r.data; })];
39
+ return [2 /*return*/, getEndpoint().post("/templates/".concat(templateId, "/stars/toggle")).then(function (r) { return r.data; })];
40
40
  }); }); };
package/HTTP/Transport.js CHANGED
@@ -20,7 +20,7 @@ if (!globalThis[ENDPOINT_KEY]) {
20
20
  var endpoint = globalThis[ENDPOINT_KEY];
21
21
  var requestLogger = function (r) {
22
22
  // tslint:disable-next-line
23
- console.log("[JS-SDK] " + r.method.toUpperCase() + " " + r.baseURL + r.url, r.data ? JSON.stringify(r.data) : '');
23
+ console.log("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
24
24
  return r;
25
25
  };
26
26
  /**
@@ -34,7 +34,7 @@ var requestLogger = function (r) {
34
34
  */
35
35
  export var setAuthorization = function (accessToken) {
36
36
  if (accessToken) {
37
- endpoint.defaults.headers.Authorization = "Bearer " + accessToken;
37
+ endpoint.defaults.headers.Authorization = "Bearer ".concat(accessToken);
38
38
  }
39
39
  else {
40
40
  delete endpoint.defaults.headers.Authorization;
@@ -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/" + organizationId + "/api_key")
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/" + organizationId + "/api_key", params)
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/" + organizationId + "/api_key/" + clientId + "/rotate")
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/" + organizationId + "/api_key/" + clientId, params)
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/" + organizationId + "/api_key/" + clientId)
81
+ .delete("/organizations/".concat(organizationId, "/api_key/").concat(clientId))
82
82
  .then(function (r) { return r.data; });
83
83
  };
@@ -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/" + organizationId + "/groups")
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/" + organizationId + "/groups/" + groupId)
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/" + organizationId + "/groups/" + groupId + "/members")
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/" + organizationId + "/groups/" + groupId + "/members", params)
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/" + organizationId + "/groups/" + groupId + "/delete_members", params)
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/" + organizationId + "/groups/" + groupId + "/permissions/" + permissionId, params)
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/" + organizationId + "/groups/" + groupId + "/permissions/" + permissionId)
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/" + organizationId + "/invitation")
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/" + organizationId + "/invitation", params)
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/" + organizationId + "/invitation/" + email)
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/" + organizationId + "/invitation/" + email, params)
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/" + organizationId + "/invitation/" + email + "/resend")
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/" + organizationId + "/invitation/" + email, params)
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/" + organizationId + "/invitation/" + email + "/token/" + token + "/new_user")
39
+ .put("/organizations/".concat(organizationId, "/invitation/").concat(email, "/token/").concat(token, "/new_user"))
40
40
  .then(function (r) { return r.data; });
41
41
  };
@@ -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/" + organizationId + "/profiles")
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/" + organizationId + "/profiles/" + profileId)
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/" + organizationId + "/profiles/" + profileId + "/roles/" + roleId)
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/" + organizationId + "/profiles/" + profileId + "/roles/" + roleId)
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/" + organizationId + "/profiles/" + profileId + "/plans")
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/" + organizationId)
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/" + organizationId)
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/" + organizationId, params)
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/" + organizationId + "/webhook")
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/" + organizationId + "/webhook", params)
9
+ .post("/organizations/".concat(organizationId, "/webhook"), params)
10
10
  .then(function (r) { return r.data; });
11
11
  };
package/Search/Content.js CHANGED
@@ -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')
90
+ .post('/search/content', params)
91
91
  .then(function (r) { return r.data; })];
92
92
  });
93
93
  }); };
package/Search/Types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TDocumentStatus, TRecipientStatus } from '../Documents/Documents';
1
+ import { TDocumentStatus } from '../Documents/Documents';
2
2
  import { TTemplateSender } from '../Templates/Types';
3
3
  export declare type TMimeType = 'application/pdf' | string;
4
4
  /**
@@ -6,6 +6,7 @@ export declare type TMimeType = 'application/pdf' | string;
6
6
  * are optimized for search performance.
7
7
  */
8
8
  export interface IDocumentHit {
9
+ type: 'document';
9
10
  id: string;
10
11
  template_id: string;
11
12
  name: string;
@@ -31,6 +32,7 @@ export interface IDocumentHit {
31
32
  * are optimized for search performance.
32
33
  */
33
34
  export interface ITemplateHit {
35
+ type: 'template';
34
36
  id: string;
35
37
  name: string;
36
38
  description: string;
@@ -56,6 +58,7 @@ export interface ITemplateHit {
56
58
  * are optimized for search performance.
57
59
  */
58
60
  export interface IOrganizationHit {
61
+ type: 'organization';
59
62
  id: string;
60
63
  name: string;
61
64
  slug: string;
@@ -85,7 +88,7 @@ export interface ISearchResultCollection<T> {
85
88
  page: number;
86
89
  found: number;
87
90
  out_of: number;
88
- hits: IHit<T>;
91
+ hits: IHit<T>[];
89
92
  request_params: ISearchRequestParams;
90
93
  search_time_ms: number;
91
94
  }
@@ -96,14 +99,7 @@ export interface ISearchResult {
96
99
  organizations: ISearchResultCollection<IOrganizationHit>;
97
100
  }
98
101
  export interface ISearchParams {
99
- page?: number;
100
- limit?: number;
101
- q?: string;
102
- tags?: string[];
103
- type?: 'template' | 'document' | 'organization';
104
- shared?: 'private' | 'shared' | 'public';
105
- mine?: boolean;
106
- status?: TDocumentStatus | TRecipientStatus;
102
+ q: string;
107
103
  }
108
104
  export interface IRecentSearch {
109
105
  id: string;
@@ -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/" + templateId + "/documents/")
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/" + templateId + "/documents/", params)
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/" + templateId + "/documents/" + documentId)
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/" + templateId + "/documents/" + documentId)
55
+ .delete("/templates/".concat(templateId, "/documents/").concat(documentId))
56
56
  .then(function (r) { return r.data; });
57
57
  };
@@ -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/" + templateId + "/pages/", params)
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/" + templateId + "/pages/" + fieldName, params)
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/" + templateId + "/pages/" + fieldName)
14
+ .delete("/templates/".concat(templateId, "/pages/").concat(fieldName))
15
15
  .then(function (r) { return r.data; });
16
16
  };
@@ -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/" + templateId + "/pages/", params)
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/" + templateId + "/pages/" + sequence)
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/" + templateId + "/pages/" + sequence)
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/" + templateId + "/pages/" + sequence)
19
+ .delete("/templates/".concat(templateId, "/pages/").concat(sequence))
20
20
  .then(function (r) { return r.data; });
21
21
  };
@@ -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/" + templateId + "/reminder/", params)
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/" + templateId + "/reminder/" + reminderId)
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/" + templateId + "/reminder/" + reminderId)
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/" + templateId + "/reminder/" + reminderId)
19
+ .delete("/templates/".concat(templateId, "/reminder/").concat(reminderId))
20
20
  .then(function (r) { return r.data; });
21
21
  };
@@ -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/" + templateId + "/roles/", params)
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/" + templateId + "/roles/")
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/" + templateId + "/roles/" + roleName)
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/" + templateId + "/roles/" + roleName, params)
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/" + templateId + "/roles/" + roleName)
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/" + templateId + "/roles/" + roleName + "/fields")
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/" + templateId + "/roles/")
34
+ .delete("/templates/".concat(templateId, "/roles/"))
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 getStars = function (templateId) {
3
3
  return getEndpoint()
4
- .get("/templates/" + templateId + "/stars/")
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/" + templateId + "/stars/toggle")
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/" + templateId + "/tags/", params)
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/" + templateId + "/tags/")
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/" + templateId + "/tags/" + tagName)
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/" + tagName)
24
+ .get("/tags/".concat(tagName))
25
25
  .then(function (r) { return r.data; });
26
26
  };
27
27
  export var getAllTags = function (params) {
@@ -42,7 +42,7 @@ export var getTemplates = function () {
42
42
  };
43
43
  export var getTemplate = function (templateId) {
44
44
  return getEndpoint()
45
- .get("/templates/" + templateId)
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/" + templateId, params)
55
+ .put("/templates/".concat(templateId), params)
56
56
  .then(function (r) { return r.data; });
57
57
  };
58
58
  /**
@@ -6,6 +6,6 @@ export var getValidators = function () {
6
6
  };
7
7
  export var getValidator = function (validatorName) {
8
8
  return getEndpoint()
9
- .get("/validators/" + validatorName)
9
+ .get("/validators/".concat(validatorName))
10
10
  .then(function (r) { return r.data; });
11
11
  };
@@ -1,5 +1,4 @@
1
- import { ICreateProfileRequest, IPermission, IProfile, IRole, ISwitchProfileResponse, IUpdateProfileRequest } from './Types';
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<IProfile[]>;
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<IRole[]>;
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<IPermission[]>;
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<IProfile>;
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<IProfile>;
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<IPermission[]>;
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<IGroup[]>;
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<ISwitchProfileResponse>;
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<IProfile>;
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/" + profileId)
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/" + profileId + "/permissions")
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/" + profileId + "/groups")
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/" + profileId + "/switch")
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/" + profileId, params)
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/" + profileId)
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: IPermission[];
41
- roles: IRole[];
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
@@ -37,5 +37,5 @@ export var formatShortTimeAgo = function (val) {
37
37
  if (timeDiff >= MINUTE) {
38
38
  return Math.floor(timeDiff / MINUTE) + 'Y';
39
39
  }
40
- return timeDiff + "S";
40
+ return "".concat(timeDiff, "S");
41
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "1.0.20",
3
+ "version": "1.0.25",
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 && tsc && npm run lint && npm run docs",
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
- "docs": "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"
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"
@@ -51,12 +51,12 @@
51
51
  "@types/jest": "^27.0.2",
52
52
  "jest": "^27.3.1",
53
53
  "jest-mock-axios": "^4.4.1",
54
- "prettier": "^2.4.1",
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.9",
59
- "typedoc-plugin-markdown": "^3.11.6",
60
- "typescript": "^4.4.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
+ }