@verdocs/js-sdk 1.3.3 → 2.0.0

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