@verdocs/js-sdk 1.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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -0
  3. package/dist/Api/Auth.d.ts +71 -0
  4. package/dist/Api/Auth.js +24 -0
  5. package/dist/Api/Documents.d.ts +124 -0
  6. package/dist/Api/Documents.js +47 -0
  7. package/dist/Api/Endpoint.d.ts +2 -0
  8. package/dist/Api/Endpoint.js +9 -0
  9. package/dist/Api/Notifications.d.ts +1 -0
  10. package/dist/Api/Notifications.js +40 -0
  11. package/dist/Api/Templates.d.ts +33 -0
  12. package/dist/Api/Templates.js +55 -0
  13. package/dist/Api/Types.d.ts +182 -0
  14. package/dist/Api/Types.js +1 -0
  15. package/dist/Api/index.d.ts +2 -0
  16. package/dist/Api/index.js +2 -0
  17. package/dist/AuthManager.d.ts +14 -0
  18. package/dist/AuthManager.js +53 -0
  19. package/dist/Documents/Documents.d.ts +129 -0
  20. package/dist/Documents/Documents.js +52 -0
  21. package/dist/Documents/Stars.d.ts +2 -0
  22. package/dist/Documents/Stars.js +40 -0
  23. package/dist/Documents/Templates.d.ts +4 -0
  24. package/dist/Documents/Templates.js +46 -0
  25. package/dist/Documents/Types.d.ts +23 -0
  26. package/dist/Documents/Types.js +1 -0
  27. package/dist/Documents/index.d.ts +4 -0
  28. package/dist/Documents/index.js +4 -0
  29. package/dist/HTTP/Endpoint.d.ts +4 -0
  30. package/dist/HTTP/Endpoint.js +12 -0
  31. package/dist/HTTP/Transport.d.ts +3 -0
  32. package/dist/HTTP/Transport.js +12 -0
  33. package/dist/HTTP/Types.d.ts +1 -0
  34. package/dist/HTTP/Types.js +1 -0
  35. package/dist/HTTP/index.d.ts +2 -0
  36. package/dist/HTTP/index.js +2 -0
  37. package/dist/Organizations/ApiKeys.d.ts +5 -0
  38. package/dist/Organizations/ApiKeys.js +16 -0
  39. package/dist/Organizations/Groups.d.ts +7 -0
  40. package/dist/Organizations/Groups.js +22 -0
  41. package/dist/Organizations/Invitations.d.ts +7 -0
  42. package/dist/Organizations/Invitations.js +22 -0
  43. package/dist/Organizations/Members.d.ts +5 -0
  44. package/dist/Organizations/Members.js +16 -0
  45. package/dist/Organizations/Organizations.d.ts +7 -0
  46. package/dist/Organizations/Organizations.js +13 -0
  47. package/dist/Organizations/Types.d.ts +16 -0
  48. package/dist/Organizations/Types.js +1 -0
  49. package/dist/Organizations/Webhooks.d.ts +2 -0
  50. package/dist/Organizations/Webhooks.js +7 -0
  51. package/dist/Organizations/index.d.ts +7 -0
  52. package/dist/Organizations/index.js +7 -0
  53. package/dist/Users/Auth.d.ts +79 -0
  54. package/dist/Users/Auth.js +89 -0
  55. package/dist/Users/Billing.d.ts +1 -0
  56. package/dist/Users/Billing.js +2 -0
  57. package/dist/Users/Notifications.d.ts +1 -0
  58. package/dist/Users/Notifications.js +40 -0
  59. package/dist/Users/Profiles.d.ts +104 -0
  60. package/dist/Users/Profiles.js +114 -0
  61. package/dist/Users/Types.d.ts +106 -0
  62. package/dist/Users/Types.js +1 -0
  63. package/dist/Users/index.d.ts +5 -0
  64. package/dist/Users/index.js +5 -0
  65. package/dist/Utils/DateTime.d.ts +1 -0
  66. package/dist/Utils/DateTime.js +41 -0
  67. package/dist/Utils/index.d.ts +1 -0
  68. package/dist/Utils/index.js +1 -0
  69. package/dist/index.d.ts +5 -0
  70. package/dist/index.js +5 -0
  71. package/package.json +52 -0
@@ -0,0 +1,2 @@
1
+ import { ITemplateSummaryEntry } from './Types';
2
+ export declare const toggleStar: (templateId: string) => Promise<ITemplateSummaryEntry>;
@@ -0,0 +1,40 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { Endpoint } from '../HTTP/Transport';
38
+ export var toggleStar = function (templateId) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
39
+ return [2 /*return*/, Endpoint.post("/templates/" + templateId + "/stars/toggle").then(function (r) { return r.data; })];
40
+ }); }); };
@@ -0,0 +1,4 @@
1
+ import { ITemplatesSummary } from './Types';
2
+ export declare const getTemplates: () => Promise<any>;
3
+ export declare const searchTemplates: () => Promise<any>;
4
+ export declare const getSummary: (page: number) => Promise<ITemplatesSummary>;
@@ -0,0 +1,46 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { Endpoint } from '../HTTP/Transport';
38
+ export var getTemplates = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
39
+ return [2 /*return*/, Endpoint.get('/templates').then(function (r) { return r.data; })];
40
+ }); }); };
41
+ export var searchTemplates = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
42
+ return [2 /*return*/, Endpoint.post('/templates/search').then(function (r) { return r.data; })];
43
+ }); }); };
44
+ export var getSummary = function (page) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
45
+ return [2 /*return*/, Endpoint.post('/templates/summary', { page: page }).then(function (r) { return r.data; })];
46
+ }); }); };
@@ -0,0 +1,23 @@
1
+ export interface ITemplateSummaryEntry {
2
+ id: string;
3
+ name: string;
4
+ sender: string;
5
+ counter: number;
6
+ description: string | null;
7
+ created_at: string;
8
+ updated_at: string;
9
+ is_personal: boolean;
10
+ is_public: boolean;
11
+ profile_id: string;
12
+ organization_id: string;
13
+ last_used_at: string | null;
14
+ document_name: string | null;
15
+ star_counter: number;
16
+ tag_name: string | null;
17
+ is_starred: boolean;
18
+ }
19
+ export interface ITemplatesSummary {
20
+ page: number;
21
+ total: number;
22
+ result: ITemplateSummaryEntry[];
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export * as Documents from './Documents';
2
+ export * as Stars from './Stars';
3
+ export * as Templates from './Templates';
4
+ export * as Types from './Types';
@@ -0,0 +1,4 @@
1
+ export * as Documents from './Documents';
2
+ export * as Stars from './Stars';
3
+ export * as Templates from './Templates';
4
+ export * as Types from './Types';
@@ -0,0 +1,4 @@
1
+ export declare type TRequestStatus = 'OK' | 'ERROR';
2
+ export declare const Endpoint: import("axios").AxiosInstance;
3
+ export declare const setAuthToken: (accessToken: string | null) => void;
4
+ export declare const setClientID: (clientID: string) => void;
@@ -0,0 +1,12 @@
1
+ import axios from 'axios';
2
+ export var Endpoint = axios.create({
3
+ baseURL: 'https://stage-api.verdocs.com/',
4
+ timeout: 3000,
5
+ headers: { 'X-Client-ID': 'NONE' },
6
+ });
7
+ export var setAuthToken = function (accessToken) {
8
+ Endpoint.defaults.headers.Authorization = "Bearer " + accessToken;
9
+ };
10
+ export var setClientID = function (clientID) {
11
+ Endpoint.defaults.headers['X-Client-ID'] = clientID;
12
+ };
@@ -0,0 +1,3 @@
1
+ export declare const Endpoint: import("axios").AxiosInstance;
2
+ export declare const setAuthToken: (accessToken: string | null) => void;
3
+ export declare const setClientID: (clientID: string) => void;
@@ -0,0 +1,12 @@
1
+ import axios from 'axios';
2
+ export var Endpoint = axios.create({
3
+ baseURL: 'https://stage-api.verdocs.com/',
4
+ timeout: 3000,
5
+ headers: { 'X-Client-ID': 'NONE' },
6
+ });
7
+ export var setAuthToken = function (accessToken) {
8
+ Endpoint.defaults.headers.Authorization = "Bearer " + accessToken;
9
+ };
10
+ export var setClientID = function (clientID) {
11
+ Endpoint.defaults.headers['X-Client-ID'] = clientID;
12
+ };
@@ -0,0 +1 @@
1
+ export declare type TRequestStatus = 'OK' | 'ERROR';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * as Transport from './Transport';
2
+ export * as Types from './Types';
@@ -0,0 +1,2 @@
1
+ export * as Transport from './Transport';
2
+ export * as Types from './Types';
@@ -0,0 +1,5 @@
1
+ export declare const getApiKeys: (organizationId: string) => Promise<any>;
2
+ export declare const createApiKey: (organizationId: string, params: any) => Promise<any>;
3
+ export declare const rotateApiKey: (organizationId: string, clientId: string) => Promise<any>;
4
+ export declare const updateApiKey: (organizationId: string, clientId: string, params: any) => Promise<any>;
5
+ export declare const deleteApiKey: (organizationId: string, clientId: string, params: any) => Promise<any>;
@@ -0,0 +1,16 @@
1
+ import { Endpoint } from '../HTTP/Transport';
2
+ export var getApiKeys = function (organizationId) {
3
+ return Endpoint.get("/organizations/" + organizationId + "/api_key").then(function (r) { return r.data; });
4
+ };
5
+ export var createApiKey = function (organizationId, params) {
6
+ return Endpoint.post("/organizations/" + organizationId + "/api_key", params).then(function (r) { return r.data; });
7
+ };
8
+ export var rotateApiKey = function (organizationId, clientId) {
9
+ return Endpoint.put("/organizations/" + organizationId + "/api_key/" + clientId + "/rotate").then(function (r) { return r.data; });
10
+ };
11
+ export var updateApiKey = function (organizationId, clientId, params) {
12
+ return Endpoint.patch("/organizations/" + organizationId + "/api_key/" + clientId, params).then(function (r) { return r.data; });
13
+ };
14
+ export var deleteApiKey = function (organizationId, clientId, params) {
15
+ return Endpoint.delete("/organizations/" + organizationId + "/api_key/" + clientId, params).then(function (r) { return r.data; });
16
+ };
@@ -0,0 +1,7 @@
1
+ export declare const getGroups: (organizationId: string) => Promise<any>;
2
+ export declare const getGroup: (organizationId: string, groupId: string) => Promise<any>;
3
+ export declare const getGroupMembers: (organizationId: string, groupId: string) => Promise<any>;
4
+ export declare const addGroupMembers: (organizationId: string, groupId: string, params: any) => Promise<any>;
5
+ export declare const deleteGroupMembers: (organizationId: string, groupId: string, params: any) => Promise<any>;
6
+ export declare const addGroupPermission: (organizationId: string, groupId: string, permissionId: string, params: any) => Promise<any>;
7
+ export declare const deleteGroupPermission: (organizationId: string, groupId: string, permissionId: string) => Promise<any>;
@@ -0,0 +1,22 @@
1
+ import { Endpoint } from '../HTTP/Transport';
2
+ export var getGroups = function (organizationId) {
3
+ return Endpoint.get("/organizations/" + organizationId + "/groups").then(function (r) { return r.data; });
4
+ };
5
+ export var getGroup = function (organizationId, groupId) {
6
+ return Endpoint.get("/organizations/" + organizationId + "/groups/" + groupId).then(function (r) { return r.data; });
7
+ };
8
+ export var getGroupMembers = function (organizationId, groupId) {
9
+ return Endpoint.get("/organizations/" + organizationId + "/groups/" + groupId + "/members").then(function (r) { return r.data; });
10
+ };
11
+ export var addGroupMembers = function (organizationId, groupId, params) {
12
+ return Endpoint.post("/organizations/" + organizationId + "/groups/" + groupId + "/members", params).then(function (r) { return r.data; });
13
+ };
14
+ export var deleteGroupMembers = function (organizationId, groupId, params) {
15
+ return Endpoint.put("/organizations/" + organizationId + "/groups/" + groupId + "/delete_members", params).then(function (r) { return r.data; });
16
+ };
17
+ export var addGroupPermission = function (organizationId, groupId, permissionId, params) {
18
+ return Endpoint.post("/organizations/" + organizationId + "/groups/" + groupId + "/permissions/" + permissionId, params).then(function (r) { return r.data; });
19
+ };
20
+ export var deleteGroupPermission = function (organizationId, groupId, permissionId) {
21
+ return Endpoint.delete("/organizations/" + organizationId + "/groups/" + groupId + "/permissions/" + permissionId).then(function (r) { return r.data; });
22
+ };
@@ -0,0 +1,7 @@
1
+ export declare const getInvitations: (organizationId: string) => Promise<any>;
2
+ export declare const createInvitation: (organizationId: string, params: any) => Promise<any>;
3
+ export declare const deleteInvitation: (organizationId: string, email: string) => Promise<any>;
4
+ export declare const updateInvitation: (organizationId: string, email: string, params: any) => Promise<any>;
5
+ export declare const resendInvitation: (organizationId: string, email: string) => Promise<any>;
6
+ export declare const claimInvitation: (organizationId: string, email: string, params: any) => Promise<any>;
7
+ export declare const claimNewUser: (organizationId: string, email: string, token: string) => Promise<any>;
@@ -0,0 +1,22 @@
1
+ import { Endpoint } from '../HTTP/Transport';
2
+ export var getInvitations = function (organizationId) {
3
+ return Endpoint.get("/organizations/" + organizationId + "/invitation").then(function (r) { return r.data; });
4
+ };
5
+ export var createInvitation = function (organizationId, params) {
6
+ return Endpoint.post("/organizations/" + organizationId + "/invitation", params).then(function (r) { return r.data; });
7
+ };
8
+ export var deleteInvitation = function (organizationId, email) {
9
+ return Endpoint.delete("/organizations/" + organizationId + "/invitation/" + email).then(function (r) { return r.data; });
10
+ };
11
+ export var updateInvitation = function (organizationId, email, params) {
12
+ return Endpoint.patch("/organizations/" + organizationId + "/invitation/" + email, params).then(function (r) { return r.data; });
13
+ };
14
+ export var resendInvitation = function (organizationId, email) {
15
+ return Endpoint.post("/organizations/" + organizationId + "/invitation/" + email + "/resend").then(function (r) { return r.data; });
16
+ };
17
+ export var claimInvitation = function (organizationId, email, params) {
18
+ return Endpoint.put("/organizations/" + organizationId + "/invitation/" + email, params).then(function (r) { return r.data; });
19
+ };
20
+ export var claimNewUser = function (organizationId, email, token) {
21
+ return Endpoint.put("/organizations/" + organizationId + "/invitation/" + email + "/token/" + token + "/new_user").then(function (r) { return r.data; });
22
+ };
@@ -0,0 +1,5 @@
1
+ export declare const getMembers: (organizationId: string) => Promise<any>;
2
+ export declare const deleteMember: (organizationId: string, profileId: string) => Promise<any>;
3
+ export declare const addMemberRole: (organizationId: string, profileId: string, roleId: string) => Promise<any>;
4
+ export declare const deleteMemberRole: (organizationId: string, profileId: string, roleId: string) => Promise<any>;
5
+ export declare const getMemberPlans: (organizationId: string, profileId: string) => Promise<any>;
@@ -0,0 +1,16 @@
1
+ import { Endpoint } from '../HTTP/Transport';
2
+ export var getMembers = function (organizationId) {
3
+ return Endpoint.get("/organizations/" + organizationId + "/profiles").then(function (r) { return r.data; });
4
+ };
5
+ export var deleteMember = function (organizationId, profileId) {
6
+ return Endpoint.delete("/organizations/" + organizationId + "/profiles/" + profileId).then(function (r) { return r.data; });
7
+ };
8
+ export var addMemberRole = function (organizationId, profileId, roleId) {
9
+ return Endpoint.post("/organizations/" + organizationId + "/profiles/" + profileId + "/roles/" + roleId).then(function (r) { return r.data; });
10
+ };
11
+ export var deleteMemberRole = function (organizationId, profileId, roleId) {
12
+ return Endpoint.delete("/organizations/" + organizationId + "/profiles/" + profileId + "/roles/" + roleId).then(function (r) { return r.data; });
13
+ };
14
+ export var getMemberPlans = function (organizationId, profileId) {
15
+ return Endpoint.get("/organizations/" + organizationId + "/profiles/" + profileId + "/plans").then(function (r) { return r.data; });
16
+ };
@@ -0,0 +1,7 @@
1
+ import { IOrganization } from './Types';
2
+ export declare const getOrganizations: () => Promise<IOrganization[]>;
3
+ export declare const createOrganization: () => Promise<IOrganization>;
4
+ export declare const validateOrganization: () => Promise<IOrganization>;
5
+ export declare const deleteOrganization: (organizationId: string) => Promise<any>;
6
+ export declare const getOrganization: (organizationId: string) => Promise<any>;
7
+ export declare const updateOrganization: (organizationId: string, params: any) => Promise<any>;
@@ -0,0 +1,13 @@
1
+ import { Endpoint } from '../HTTP/Transport';
2
+ export var getOrganizations = function () { return Endpoint.get('/organizations').then(function (r) { return r.data; }); };
3
+ export var createOrganization = function () { return Endpoint.post('/organizations').then(function (r) { return r.data; }); };
4
+ export var validateOrganization = function () { return Endpoint.get('/organizations/is_valid').then(function (r) { return r.data; }); };
5
+ export var deleteOrganization = function (organizationId) {
6
+ return Endpoint.delete("/organizations/" + organizationId).then(function (r) { return r.data; });
7
+ };
8
+ export var getOrganization = function (organizationId) {
9
+ return Endpoint.get("/organizations/" + organizationId).then(function (r) { return r.data; });
10
+ };
11
+ export var updateOrganization = function (organizationId, params) {
12
+ return Endpoint.patch("/organizations/" + organizationId, params).then(function (r) { return r.data; });
13
+ };
@@ -0,0 +1,16 @@
1
+ export interface IOrganization {
2
+ /** The unique ID of the organization */
3
+ id: string;
4
+ /** The organization's name. */
5
+ name: string;
6
+ address: string | null;
7
+ phone: string | null;
8
+ /** If the organization is a business, its name. Note that a business name can be different from an organization name. */
9
+ business_name: string | null;
10
+ /** If true, the organization is a business */
11
+ is_business: boolean;
12
+ address2: string | null;
13
+ contact_email: string | null;
14
+ timezone: string | null;
15
+ envelope_responsible: boolean;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const getWebhook: (organizationId: string) => Promise<any>;
2
+ export declare const updateWebhook: (organizationId: string, params: any) => Promise<any>;
@@ -0,0 +1,7 @@
1
+ import { Endpoint } from '../HTTP/Transport';
2
+ export var getWebhook = function (organizationId) {
3
+ return Endpoint.get("/organizations/" + organizationId + "/webhook").then(function (r) { return r.data; });
4
+ };
5
+ export var updateWebhook = function (organizationId, params) {
6
+ return Endpoint.post("/organizations/" + organizationId + "/webhook", params).then(function (r) { return r.data; });
7
+ };
@@ -0,0 +1,7 @@
1
+ export * as ApiKeys from './ApiKeys';
2
+ export * as Groups from './Groups';
3
+ export * as Invitations from './Invitations';
4
+ export * as Members from './Members';
5
+ export * as Organizations from './Organizations';
6
+ export * as Types from './Types';
7
+ export * as Webhooks from './Webhooks';
@@ -0,0 +1,7 @@
1
+ export * as ApiKeys from './ApiKeys';
2
+ export * as Groups from './Groups';
3
+ export * as Invitations from './Invitations';
4
+ export * as Members from './Members';
5
+ export * as Organizations from './Organizations';
6
+ export * as Types from './Types';
7
+ export * as Webhooks from './Webhooks';
@@ -0,0 +1,79 @@
1
+ import { IAuthenticateAppRequest, IAuthenticateResponse, IAuthenticateUserRequest, TokenValidationRequest, TokenValidationResponse, UpdateEmailRequest, UpdateEmailResponse, UpdatePasswordRequest, UpdatePasswordResponse } from './Types';
2
+ /**
3
+ * Authenticate to Verdocs via user/password authentication
4
+ *
5
+ * ```typescript
6
+ * import {Auth} from '@verdocs/js-sdk/Auth';
7
+ * import {Endpoint} from '@verdocs/js-sdk/HTTP';
8
+ *
9
+ * const {accessToken} = await Auth.authenticateUser({ username: 'test@test.com', password: 'PASSWORD' });
10
+ * Endpoint.setAuthToken(accessToken);
11
+ * ```
12
+ */
13
+ export declare const authenticateUser: (params: IAuthenticateUserRequest) => Promise<IAuthenticateResponse>;
14
+ /**
15
+ * Authenticate to Verdocs via client ID / Secret authentication. **NOTE: This is only suitable for
16
+ * NodeJS server-side applications. Never expose your Client Secret in a Web or Mobile app!** Also note
17
+ * that access tokens may be cached by server-side apps (and this is recommended) but do expire after 2
18
+ * hours. This expiration may change based on future security needs. Application developers are encouraged
19
+ * to check the `exp` expiration field in the response accessToken and renew tokens after they expire.
20
+ *
21
+ * ```typescript
22
+ * import {Auth} from '@verdocs/js-sdk/Auth';
23
+ * import {Endpoint} from '@verdocs/js-sdk/HTTP';
24
+ *
25
+ * const {accessToken} = await Auth.authenticateApp({ client_id: 'CLIENTID', client_secret: 'SECRET' });
26
+ * Endpoint.setAuthToken(accessToken);
27
+ * ```
28
+ */
29
+ export declare const authenticateApp: (params: IAuthenticateAppRequest) => Promise<IAuthenticateResponse>;
30
+ /**
31
+ * Validate a token. Only Verdocs tokens will be accepted. Most applications can decode tokens locally,
32
+ * because tokens will be validated when API calls are made anyway. However, high-security applications
33
+ * may use this endpoint to check if a token has been revoked.
34
+ *
35
+ * ```typescript
36
+ * import {Auth} from '@verdocs/js-sdk/Auth';
37
+ *
38
+ * const {valid} = await Auth.validateToken({ token });
39
+ * if (!valid) {
40
+ * window.alert('Session invalid or expired. Please re-authenticate.');
41
+ * }
42
+ * ```
43
+ */
44
+ export declare const validateToken: (params: TokenValidationRequest) => Promise<TokenValidationResponse>;
45
+ /**
46
+ * If called before the session expires, this will refresh the caller's session and tokens.
47
+ *
48
+ * ```typescript
49
+ * import {Auth} from '@verdocs/js-sdk/Auth';
50
+ * import {Endpoint} from '@verdocs/js-sdk/HTTP';
51
+ *
52
+ * const {accessToken} = await Auth.refreshTokens();
53
+ * Auth.Endpoint.setAuthToken(accessToken);
54
+ * ```
55
+ */
56
+ export declare const refreshTokens: () => Promise<IAuthenticateResponse>;
57
+ /**
58
+ * Update the caller's password. To help prevent CSRF attack vectors, the user's old password and email address are required.
59
+ *
60
+ * ```typescript
61
+ * import {Auth} from '@verdocs/js-sdk/Auth';
62
+ *
63
+ * const {status, message} = await Auth.updatePassword({ email, oldPassword, newPassword });
64
+ * if (status !== 'OK') {
65
+ * window.alert(`Password reset error: ${message}`);
66
+ * }
67
+ * ```
68
+ */
69
+ export declare const updatePassword: (params: UpdatePasswordRequest) => Promise<UpdatePasswordResponse>;
70
+ /**
71
+ * Update the caller's email address.
72
+ *
73
+ * ```typescript
74
+ * import {Auth} from '@verdocs/js-sdk/Auth';
75
+ *
76
+ * const {profiles} = await Auth.updateEmail({ email: newEmail });
77
+ * ```
78
+ */
79
+ export declare const updateEmail: (params: UpdateEmailRequest) => Promise<UpdateEmailResponse>;