@verdocs/js-sdk
Advanced tools
Comparing version 1.0.27 to 1.0.28
@@ -0,1 +1,2 @@ | ||
import { ISigningSession, ISigningSessionRequest } from './Types'; | ||
export declare type TDocumentStatus = 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled'; | ||
@@ -54,6 +55,6 @@ export declare type TRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted' | 'canceled' | 'pending' | 'declined'; | ||
full_name: string; | ||
in_app_access_key: string; | ||
key_used_to_conclude: string; | ||
in_app_access_key?: string; | ||
key_used_to_conclude?: string; | ||
message: string | null; | ||
phone: string; | ||
phone: string | null; | ||
profile_id: string; | ||
@@ -141,1 +142,9 @@ role_name: string; | ||
export declare const searchDocuments: (params: any) => Promise<IDocumentsSearchResult>; | ||
/** | ||
* Get a signing session for a document. | ||
*/ | ||
export declare const getSigningSession: (params: ISigningSessionRequest) => Promise<{ | ||
recipient: IRecipient; | ||
session: ISigningSession; | ||
}>; | ||
export declare const getDocumentRecipients: (documentId: string) => Promise<IRecipient[]>; |
@@ -50,3 +50,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return [2 /*return*/, getEndpoint() | ||
.post('/documents/summary', { page: page }) | ||
.api.post('/documents/summary', { page: page }) | ||
.then(function (r) { return r.data; })]; | ||
@@ -67,5 +67,28 @@ }); | ||
return [2 /*return*/, getEndpoint() | ||
.post('/documents/search', params) | ||
.api.post('/documents/search', params) | ||
.then(function (r) { return r.data; })]; | ||
}); | ||
}); }; | ||
/** | ||
* Get a signing session for a document. | ||
*/ | ||
export var getSigningSession = function (params) { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, getEndpoint() | ||
.api.get("/documents/".concat(params.documentId, "/recipients/").concat(encodeURIComponent(params.roleId), "/invitation/").concat(params.inviteCode)) | ||
.then(function (r) { | ||
var _a; | ||
// Avoiding a jsonwebtoken dependency here - we don't actually need the whole library | ||
var signerToken = ((_a = r.headers) === null || _a === void 0 ? void 0 : _a.signer_token) || ''; | ||
var session = JSON.parse(atob(signerToken.split('.')[1])); | ||
return { recipient: r.data, session: session }; | ||
})]; | ||
}); | ||
}); }; | ||
export var getDocumentRecipients = function (documentId) { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, getEndpoint() | ||
.api.get("/documents/".concat(documentId, "/recipients")) | ||
.then(function (r) { return r.data; })]; | ||
}); | ||
}); }; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var createSignature = function (params) { | ||
return getEndpoint() | ||
.post('/signatures', params) | ||
.api.post('/signatures', params) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,3 +9,3 @@ }; | ||
return getEndpoint() | ||
.get('/signatures') | ||
.api.get('/signatures') | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.get("/signatures/".concat(signatureId)) | ||
.api.get("/signatures/".concat(signatureId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -21,4 +21,4 @@ }; | ||
return getEndpoint() | ||
.delete("/signatures/".concat(signatureId)) | ||
.api.delete("/signatures/".concat(signatureId)) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -39,3 +39,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
export var toggleStar = function (templateId) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { | ||
return [2 /*return*/, getEndpoint().post("/templates/".concat(templateId, "/stars/toggle")).then(function (r) { return r.data; })]; | ||
return [2 /*return*/, getEndpoint().api.post("/templates/".concat(templateId, "/stars/toggle")).then(function (r) { return r.data; })]; | ||
}); }); }; |
@@ -24,1 +24,20 @@ export interface ITemplateSummaryEntry { | ||
} | ||
export interface ISigningSessionRequest { | ||
documentId: string; | ||
roleId: string; | ||
inviteCode: string; | ||
} | ||
export interface ISigningSession { | ||
profile_id: 'guest|515c9dc1-4c5c-4255-9f75-44b6870fc0eb'; | ||
document_id: 'f484a296-4f4c-4783-9adf-a3302915a503'; | ||
role: 'Recipient 2'; | ||
email: 'crobinson@medialantern.com'; | ||
access_key: { | ||
id: 'a59ceb98-3fab-44d2-af8a-13088d6c1a32'; | ||
type: 'email'; | ||
}; | ||
iss: 'https://stage-realster.auth0.com'; | ||
aud: 'QYVTceK2qtOQvH8Nl2APUJaBMRys1y95'; | ||
exp: 1641881182; | ||
iat: 1641873982; | ||
} |
@@ -1,3 +0,3 @@ | ||
export { Endpoint } from './Endpoint'; | ||
export { VerdocsEndpoint } from './VerdocsEndpoint'; | ||
export * as Transport from './Transport'; | ||
export * as Types from './Types'; |
@@ -1,3 +0,3 @@ | ||
export { Endpoint } from './Endpoint'; | ||
export { VerdocsEndpoint } from './VerdocsEndpoint'; | ||
export * as Transport from './Transport'; | ||
export * as Types from './Types'; |
@@ -8,5 +8,5 @@ /** | ||
*/ | ||
import { AxiosInstance } from 'axios'; | ||
import { VerdocsEndpoint } from './VerdocsEndpoint'; | ||
/** | ||
* Set the auth token that will be used for Verdocs API calls. | ||
* Helper to get the endpoint for direct access to HTTP functions. | ||
* | ||
@@ -16,8 +16,11 @@ * ```typescript | ||
* | ||
* Transport.setAuthorization(accessToken); | ||
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout); | ||
* ``` | ||
*/ | ||
export declare const setAuthorization: (accessToken: string | null) => void; | ||
export declare const getEndpoint: () => VerdocsEndpoint; | ||
/** | ||
* Set the Client ID for Verdocs API calls. | ||
* Change the endpoint that will be used when making calls to Verdocs. Only one endpoint may be active at a time. | ||
* Authorization and other configuration data is specific to each endpoint, and will not be carried over when the | ||
* endpoint is changed. The typical use-case is to change to a sandboxed endpoint for signing sessions, then revert | ||
* to the global endpoint when the signing session is complete. To revert, pass `null` as the endpoint to use. | ||
* | ||
@@ -27,37 +30,8 @@ * ```typescript | ||
* | ||
* Transport.setClientID('1234); | ||
* const mySigningEndpoint = new VerdocsEndpoint(); | ||
* setActiveEndpoint(mySigningEndpoint); | ||
* ... [Perform signing operations] | ||
* setActiveEndpoint(null); | ||
* ``` | ||
*/ | ||
export declare const setClientID: (clientID: string) => void; | ||
/** | ||
* Set the base URL for API calls. This defaults to https://api.verdocs.com/ and should only be changed after consultation with | ||
* Verdocs Developer Support (e.g. to access a private API endpoint). | ||
* | ||
* ```typescript | ||
* import {Transport} from '@verdocs/js-sdk/HTTP'; | ||
* | ||
* Transport.setBaseUrl('https://my-private-api.verdocs.com'); | ||
* ``` | ||
*/ | ||
export declare const setBaseUrl: (baseUrl: string) => void; | ||
/** | ||
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default. | ||
* | ||
* ```typescript | ||
* import {Transport} from '@verdocs/js-sdk/HTTP'; | ||
* | ||
* Transport.setTimeout(3000); | ||
* ``` | ||
*/ | ||
export declare const setTimeout: (timeout: number) => void; | ||
export declare const logRequests: (enable: boolean) => void; | ||
/** | ||
* Helper to get the endpoint for direct access to HTTP functions. | ||
* | ||
* ```typescript | ||
* import {Transport} from '@verdocs/js-sdk/HTTP'; | ||
* | ||
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout); | ||
* ``` | ||
*/ | ||
export declare const getEndpoint: () => AxiosInstance; | ||
export declare const setActiveEndpoint: (e: VerdocsEndpoint | null) => void; |
@@ -8,9 +8,4 @@ /** | ||
*/ | ||
import axios from 'axios'; | ||
import globalThis from './globalThis'; | ||
var DEFAULTS = { | ||
baseURL: 'https://api.verdocs.com/', | ||
timeout: 6000, | ||
headers: { 'X-Client-ID': 'NONE' }, | ||
}; | ||
import { VerdocsEndpoint } from './VerdocsEndpoint'; | ||
// @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/ | ||
@@ -20,12 +15,8 @@ // Also see globalThis for comments about why we're doing this in the first place. | ||
if (!globalThis[ENDPOINT_KEY]) { | ||
globalThis[ENDPOINT_KEY] = axios.create(DEFAULTS); | ||
globalThis[ENDPOINT_KEY] = new VerdocsEndpoint({ baseURL: 'https://api.verdocs.com/' }); | ||
} | ||
var endpoint = globalThis[ENDPOINT_KEY]; | ||
var requestLogger = function (r) { | ||
// tslint:disable-next-line | ||
console.log("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : ''); | ||
return r; | ||
}; | ||
var globalEndpoint = globalThis[ENDPOINT_KEY]; | ||
var activeEndpoint = globalEndpoint; | ||
/** | ||
* Set the auth token that will be used for Verdocs API calls. | ||
* Helper to get the endpoint for direct access to HTTP functions. | ||
* | ||
@@ -35,15 +26,13 @@ * ```typescript | ||
* | ||
* Transport.setAuthorization(accessToken); | ||
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout); | ||
* ``` | ||
*/ | ||
export var setAuthorization = function (accessToken) { | ||
if (accessToken) { | ||
endpoint.defaults.headers.Authorization = "Bearer ".concat(accessToken); | ||
} | ||
else { | ||
delete endpoint.defaults.headers.Authorization; | ||
} | ||
export var getEndpoint = function () { | ||
return activeEndpoint; | ||
}; | ||
/** | ||
* Set the Client ID for Verdocs API calls. | ||
* Change the endpoint that will be used when making calls to Verdocs. Only one endpoint may be active at a time. | ||
* Authorization and other configuration data is specific to each endpoint, and will not be carried over when the | ||
* endpoint is changed. The typical use-case is to change to a sandboxed endpoint for signing sessions, then revert | ||
* to the global endpoint when the signing session is complete. To revert, pass `null` as the endpoint to use. | ||
* | ||
@@ -53,62 +42,10 @@ * ```typescript | ||
* | ||
* Transport.setClientID('1234); | ||
* const mySigningEndpoint = new VerdocsEndpoint(); | ||
* setActiveEndpoint(mySigningEndpoint); | ||
* ... [Perform signing operations] | ||
* setActiveEndpoint(null); | ||
* ``` | ||
*/ | ||
export var setClientID = function (clientID) { | ||
endpoint.defaults.headers['X-Client-ID'] = clientID; | ||
export var setActiveEndpoint = function (e) { | ||
activeEndpoint = e || globalEndpoint; | ||
}; | ||
/** | ||
* Set the base URL for API calls. This defaults to https://api.verdocs.com/ and should only be changed after consultation with | ||
* Verdocs Developer Support (e.g. to access a private API endpoint). | ||
* | ||
* ```typescript | ||
* import {Transport} from '@verdocs/js-sdk/HTTP'; | ||
* | ||
* Transport.setBaseUrl('https://my-private-api.verdocs.com'); | ||
* ``` | ||
*/ | ||
export var setBaseUrl = function (baseUrl) { | ||
endpoint.defaults.baseURL = baseUrl; | ||
}; | ||
/** | ||
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default. | ||
* | ||
* ```typescript | ||
* import {Transport} from '@verdocs/js-sdk/HTTP'; | ||
* | ||
* Transport.setTimeout(3000); | ||
* ``` | ||
*/ | ||
export var setTimeout = function (timeout) { | ||
endpoint.defaults.timeout = timeout; | ||
}; | ||
/** | ||
* Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging. | ||
* | ||
* ```typescript | ||
* import {Transport} from '@verdocs/js-sdk/HTTP'; | ||
* | ||
* Transport.logRequests(true); | ||
* ``` | ||
*/ | ||
var requestLoggerId = null; | ||
export var logRequests = function (enable) { | ||
if (enable && requestLoggerId === null) { | ||
requestLoggerId = endpoint.interceptors.request.use(requestLogger); | ||
} | ||
else if (!enable && requestLoggerId !== null) { | ||
endpoint.interceptors.request.eject(requestLoggerId); | ||
} | ||
}; | ||
/** | ||
* Helper to get the endpoint for direct access to HTTP functions. | ||
* | ||
* ```typescript | ||
* import {Transport} from '@verdocs/js-sdk/HTTP'; | ||
* | ||
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout); | ||
* ``` | ||
*/ | ||
export var getEndpoint = function () { | ||
return endpoint; | ||
}; |
@@ -25,3 +25,3 @@ /** | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/api_key")) | ||
.api.get("/organizations/".concat(organizationId, "/api_key")) | ||
.then(function (r) { return r.data; }); | ||
@@ -40,3 +40,3 @@ }; | ||
return getEndpoint() | ||
.post("/organizations/".concat(organizationId, "/api_key"), params) | ||
.api.post("/organizations/".concat(organizationId, "/api_key"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -55,3 +55,3 @@ }; | ||
return getEndpoint() | ||
.put("/organizations/".concat(organizationId, "/api_key/").concat(clientId, "/rotate")) | ||
.api.put("/organizations/".concat(organizationId, "/api_key/").concat(clientId, "/rotate")) | ||
.then(function (r) { return r.data; }); | ||
@@ -70,3 +70,3 @@ }; | ||
return getEndpoint() | ||
.patch("/organizations/".concat(organizationId, "/api_key/").concat(clientId), params) | ||
.api.patch("/organizations/".concat(organizationId, "/api_key/").concat(clientId), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -85,4 +85,4 @@ }; | ||
return getEndpoint() | ||
.delete("/organizations/".concat(organizationId, "/api_key/").concat(clientId)) | ||
.api.delete("/organizations/".concat(organizationId, "/api_key/").concat(clientId)) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -22,3 +22,3 @@ /** | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/groups")) | ||
.api.get("/organizations/".concat(organizationId, "/groups")) | ||
.then(function (r) { return r.data; }); | ||
@@ -37,3 +37,3 @@ }; | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/groups/").concat(groupId)) | ||
.api.get("/organizations/".concat(organizationId, "/groups/").concat(groupId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -43,3 +43,3 @@ }; | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members")) | ||
.api.get("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members")) | ||
.then(function (r) { return r.data; }); | ||
@@ -49,3 +49,3 @@ }; | ||
return getEndpoint() | ||
.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members"), params) | ||
.api.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -55,3 +55,3 @@ }; | ||
return getEndpoint() | ||
.put("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/delete_members"), params) | ||
.api.put("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/delete_members"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -61,3 +61,3 @@ }; | ||
return getEndpoint() | ||
.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId), params) | ||
.api.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -67,4 +67,4 @@ }; | ||
return getEndpoint() | ||
.delete("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId)) | ||
.api.delete("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId)) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -9,3 +9,3 @@ /** | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/invitation")) | ||
.api.get("/organizations/".concat(organizationId, "/invitation")) | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.post("/organizations/".concat(organizationId, "/invitation"), params) | ||
.api.post("/organizations/".concat(organizationId, "/invitation"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -21,3 +21,3 @@ }; | ||
return getEndpoint() | ||
.delete("/organizations/".concat(organizationId, "/invitation/").concat(email)) | ||
.api.delete("/organizations/".concat(organizationId, "/invitation/").concat(email)) | ||
.then(function (r) { return r.data; }); | ||
@@ -27,3 +27,3 @@ }; | ||
return getEndpoint() | ||
.patch("/organizations/".concat(organizationId, "/invitation/").concat(email), params) | ||
.api.patch("/organizations/".concat(organizationId, "/invitation/").concat(email), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -33,3 +33,3 @@ }; | ||
return getEndpoint() | ||
.post("/organizations/".concat(organizationId, "/invitation/").concat(email, "/resend")) | ||
.api.post("/organizations/".concat(organizationId, "/invitation/").concat(email, "/resend")) | ||
.then(function (r) { return r.data; }); | ||
@@ -39,3 +39,3 @@ }; | ||
return getEndpoint() | ||
.put("/organizations/".concat(organizationId, "/invitation/").concat(email), params) | ||
.api.put("/organizations/".concat(organizationId, "/invitation/").concat(email), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -45,4 +45,4 @@ }; | ||
return getEndpoint() | ||
.put("/organizations/".concat(organizationId, "/invitation/").concat(email, "/token/").concat(token, "/new_user")) | ||
.api.put("/organizations/".concat(organizationId, "/invitation/").concat(email, "/token/").concat(token, "/new_user")) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -9,3 +9,3 @@ /** | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/profiles")) | ||
.api.get("/organizations/".concat(organizationId, "/profiles")) | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId)) | ||
.api.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -21,3 +21,3 @@ }; | ||
return getEndpoint() | ||
.post("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId)) | ||
.api.post("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -27,3 +27,3 @@ }; | ||
return getEndpoint() | ||
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId)) | ||
.api.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/roles/").concat(roleId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -33,4 +33,4 @@ }; | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/plans")) | ||
.api.get("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/plans")) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -9,3 +9,3 @@ /** | ||
return getEndpoint() | ||
.get('/organizations') | ||
.api.get('/organizations') | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.post('/organizations') | ||
.api.post('/organizations') | ||
.then(function (r) { return r.data; }); | ||
@@ -21,3 +21,3 @@ }; | ||
return getEndpoint() | ||
.get('/organizations/is_valid') | ||
.api.get('/organizations/is_valid') | ||
.then(function (r) { return r.data; }); | ||
@@ -27,3 +27,3 @@ }; | ||
return getEndpoint() | ||
.delete("/organizations/".concat(organizationId)) | ||
.api.delete("/organizations/".concat(organizationId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -33,3 +33,3 @@ }; | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId)) | ||
.api.get("/organizations/".concat(organizationId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -39,4 +39,4 @@ }; | ||
return getEndpoint() | ||
.patch("/organizations/".concat(organizationId), params) | ||
.api.patch("/organizations/".concat(organizationId), params) | ||
.then(function (r) { return r.data; }); | ||
}; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var getWebhook = function (organizationId) { | ||
return getEndpoint() | ||
.get("/organizations/".concat(organizationId, "/webhook")) | ||
.api.get("/organizations/".concat(organizationId, "/webhook")) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,4 +9,4 @@ }; | ||
return getEndpoint() | ||
.post("/organizations/".concat(organizationId, "/webhook"), params) | ||
.api.post("/organizations/".concat(organizationId, "/webhook"), params) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -23,3 +23,3 @@ /** | ||
return getEndpoint() | ||
.post('/whitelabel') | ||
.api.post('/whitelabel') | ||
.then(function (r) { return r.data; }); | ||
@@ -38,4 +38,4 @@ }; | ||
return getEndpoint() | ||
.get('/whitelabel') | ||
.api.get('/whitelabel') | ||
.then(function (r) { return r.data; }); | ||
}; |
{ | ||
"name": "@verdocs/js-sdk", | ||
"version": "1.0.27", | ||
"version": "1.0.28", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/Verdocs/js-sdk", |
@@ -58,3 +58,3 @@ /** | ||
return [2 /*return*/, getEndpoint() | ||
.get('/search/history') | ||
.api.get('/search/history') | ||
.then(function (r) { return r.data; })]; | ||
@@ -75,3 +75,3 @@ }); | ||
return [2 /*return*/, getEndpoint() | ||
.post('/search/saved', { name: name, params: params }) | ||
.api.post('/search/saved', { name: name, params: params }) | ||
.then(function (r) { return r.data; })]; | ||
@@ -92,5 +92,5 @@ }); | ||
return [2 /*return*/, getEndpoint() | ||
.post('/search/content', params) | ||
.api.post('/search/content', params) | ||
.then(function (r) { return r.data; })]; | ||
}); | ||
}); }; |
@@ -13,3 +13,3 @@ import { getEndpoint } from '../HTTP/Transport'; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/documents/")) | ||
.api.get("/templates/".concat(templateId, "/documents/")) | ||
.then(function (r) { return r.data; }); | ||
@@ -28,3 +28,3 @@ }; | ||
return getEndpoint() | ||
.post("/templates/".concat(templateId, "/documents/"), params) | ||
.api.post("/templates/".concat(templateId, "/documents/"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -43,3 +43,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/documents/").concat(documentId)) | ||
.api.get("/templates/".concat(templateId, "/documents/").concat(documentId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -58,4 +58,4 @@ }; | ||
return getEndpoint() | ||
.delete("/templates/".concat(templateId, "/documents/").concat(documentId)) | ||
.api.delete("/templates/".concat(templateId, "/documents/").concat(documentId)) | ||
.then(function (r) { return r.data; }); | ||
}; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var createField = function (templateId, params) { | ||
return getEndpoint() | ||
.post("/templates/".concat(templateId, "/pages/"), params) | ||
.api.post("/templates/".concat(templateId, "/pages/"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,3 +9,3 @@ }; | ||
return getEndpoint() | ||
.put("/templates/".concat(templateId, "/pages/").concat(fieldName), params) | ||
.api.put("/templates/".concat(templateId, "/pages/").concat(fieldName), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -15,4 +15,4 @@ }; | ||
return getEndpoint() | ||
.delete("/templates/".concat(templateId, "/pages/").concat(fieldName)) | ||
.api.delete("/templates/".concat(templateId, "/pages/").concat(fieldName)) | ||
.then(function (r) { return r.data; }); | ||
}; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var createPage = function (templateId, params) { | ||
return getEndpoint() | ||
.post("/templates/".concat(templateId, "/pages/"), params) | ||
.api.post("/templates/".concat(templateId, "/pages/"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,3 +9,3 @@ }; | ||
return getEndpoint() | ||
.put("/templates/".concat(templateId, "/pages/").concat(sequence)) | ||
.api.put("/templates/".concat(templateId, "/pages/").concat(sequence)) | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/pages/").concat(sequence)) | ||
.api.get("/templates/".concat(templateId, "/pages/").concat(sequence)) | ||
.then(function (r) { return r.data; }); | ||
@@ -21,4 +21,4 @@ }; | ||
return getEndpoint() | ||
.delete("/templates/".concat(templateId, "/pages/").concat(sequence)) | ||
.api.delete("/templates/".concat(templateId, "/pages/").concat(sequence)) | ||
.then(function (r) { return r.data; }); | ||
}; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var createReminder = function (templateId, params) { | ||
return getEndpoint() | ||
.post("/templates/".concat(templateId, "/reminder/"), params) | ||
.api.post("/templates/".concat(templateId, "/reminder/"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,3 +9,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/reminder/").concat(reminderId)) | ||
.api.get("/templates/".concat(templateId, "/reminder/").concat(reminderId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.put("/templates/".concat(templateId, "/reminder/").concat(reminderId)) | ||
.api.put("/templates/".concat(templateId, "/reminder/").concat(reminderId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -21,4 +21,4 @@ }; | ||
return getEndpoint() | ||
.delete("/templates/".concat(templateId, "/reminder/").concat(reminderId)) | ||
.api.delete("/templates/".concat(templateId, "/reminder/").concat(reminderId)) | ||
.then(function (r) { return r.data; }); | ||
}; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var createRole = function (templateId, params) { | ||
return getEndpoint() | ||
.post("/templates/".concat(templateId, "/roles/"), params) | ||
.api.post("/templates/".concat(templateId, "/roles/"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,3 +9,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/roles/")) | ||
.api.get("/templates/".concat(templateId, "/roles/")) | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/roles/").concat(roleName)) | ||
.api.get("/templates/".concat(templateId, "/roles/").concat(roleName)) | ||
.then(function (r) { return r.data; }); | ||
@@ -21,3 +21,3 @@ }; | ||
return getEndpoint() | ||
.put("/templates/".concat(templateId, "/roles/").concat(roleName), params) | ||
.api.put("/templates/".concat(templateId, "/roles/").concat(roleName), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -27,3 +27,3 @@ }; | ||
return getEndpoint() | ||
.delete("/templates/".concat(templateId, "/roles/").concat(roleName)) | ||
.api.delete("/templates/".concat(templateId, "/roles/").concat(roleName)) | ||
.then(function (r) { return r.data; }); | ||
@@ -33,3 +33,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/roles/").concat(roleName, "/fields")) | ||
.api.get("/templates/".concat(templateId, "/roles/").concat(roleName, "/fields")) | ||
.then(function (r) { return r.data; }); | ||
@@ -39,4 +39,4 @@ }; | ||
return getEndpoint() | ||
.delete("/templates/".concat(templateId, "/roles/")) | ||
.api.delete("/templates/".concat(templateId, "/roles/")) | ||
.then(function (r) { return r.data; }); | ||
}; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var getStars = function (templateId) { | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/stars/")) | ||
.api.get("/templates/".concat(templateId, "/stars/")) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,4 +9,4 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/stars/toggle")) | ||
.api.get("/templates/".concat(templateId, "/stars/toggle")) | ||
.then(function (r) { return r.data; }); | ||
}; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var addTemplateTag = function (templateId, params) { | ||
return getEndpoint() | ||
.post("/templates/".concat(templateId, "/tags/"), params) | ||
.api.post("/templates/".concat(templateId, "/tags/"), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -9,3 +9,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId, "/tags/")) | ||
.api.get("/templates/".concat(templateId, "/tags/")) | ||
.then(function (r) { return r.data; }); | ||
@@ -15,3 +15,3 @@ }; | ||
return getEndpoint() | ||
.post("/templates/".concat(templateId, "/tags/").concat(tagName)) | ||
.api.post("/templates/".concat(templateId, "/tags/").concat(tagName)) | ||
.then(function (r) { return r.data; }); | ||
@@ -21,3 +21,3 @@ }; | ||
return getEndpoint() | ||
.post('/tags', params) | ||
.api.post('/tags', params) | ||
.then(function (r) { return r.data; }); | ||
@@ -27,3 +27,3 @@ }; | ||
return getEndpoint() | ||
.get("/tags/".concat(tagName)) | ||
.api.get("/tags/".concat(tagName)) | ||
.then(function (r) { return r.data; }); | ||
@@ -33,4 +33,4 @@ }; | ||
return getEndpoint() | ||
.get('/tags', params) | ||
.api.get('/tags', params) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -40,3 +40,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return getEndpoint() | ||
.get('/templates/') | ||
.api.get('/templates/') | ||
.then(function (r) { return r.data; }); | ||
@@ -46,3 +46,3 @@ }; | ||
return getEndpoint() | ||
.get("/templates/".concat(templateId)) | ||
.api.get("/templates/".concat(templateId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -52,3 +52,3 @@ }; | ||
return getEndpoint() | ||
.post('/templates/', params) | ||
.api.post('/templates/', params) | ||
.then(function (r) { return r.data; }); | ||
@@ -58,3 +58,3 @@ }; | ||
return getEndpoint() | ||
.put("/templates/".concat(templateId), params) | ||
.api.put("/templates/".concat(templateId), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -74,3 +74,3 @@ }; | ||
return [2 /*return*/, getEndpoint() | ||
.post('/templates/search', params) | ||
.api.post('/templates/search', params) | ||
.then(function (r) { return r.data; })]; | ||
@@ -82,5 +82,5 @@ }); | ||
return [2 /*return*/, getEndpoint() | ||
.post('/templates/summary', { page: page }) | ||
.api.post('/templates/summary', { page: page }) | ||
.then(function (r) { return r.data; })]; | ||
}); | ||
}); }; |
import { getEndpoint } from '../HTTP/Transport'; | ||
export var getValidators = function () { | ||
return getEndpoint() | ||
.get('/validators') | ||
.api.get('/validators') | ||
.then(function (r) { return r.data; }); | ||
@@ -9,4 +9,4 @@ }; | ||
return getEndpoint() | ||
.get("/validators/".concat(validatorName)) | ||
.api.get("/validators/".concat(validatorName)) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -15,3 +15,3 @@ import { getEndpoint } from '../HTTP/Transport'; | ||
return getEndpoint() | ||
.post('/authentication/login', params) | ||
.api.post('/authentication/login', params) | ||
.then(function (r) { return r.data; }); | ||
@@ -36,3 +36,3 @@ }; | ||
return getEndpoint() | ||
.post('/authentication/login_client', {}, { headers: params }) | ||
.api.post('/authentication/login_client', {}, { headers: params }) | ||
.then(function (r) { return r.data; }); | ||
@@ -56,3 +56,3 @@ }; | ||
return getEndpoint() | ||
.post('/token/isValid', params) | ||
.api.post('/token/isValid', params) | ||
.then(function (r) { return r.data; }); | ||
@@ -73,3 +73,3 @@ }; | ||
return getEndpoint() | ||
.get('/token') | ||
.api.get('/token') | ||
.then(function (r) { return r.data; }); | ||
@@ -91,3 +91,3 @@ }; | ||
return getEndpoint() | ||
.put('/user/update_password', params) | ||
.api.put('/user/update_password', params) | ||
.then(function (r) { return r.data; }); | ||
@@ -106,4 +106,4 @@ }; | ||
return getEndpoint() | ||
.put('/user/update_email', params) | ||
.api.put('/user/update_email', params) | ||
.then(function (r) { return r.data; }); | ||
}; |
@@ -41,5 +41,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return [2 /*return*/, getEndpoint() | ||
.get('/notifications') | ||
.api.get('/notifications') | ||
.then(function (r) { return r.data; })]; | ||
}); | ||
}); }; |
@@ -13,3 +13,3 @@ import { getEndpoint } from '../HTTP/Transport'; | ||
return getEndpoint() | ||
.get('/profiles') | ||
.api.get('/profiles') | ||
.then(function (r) { return r.data; }); | ||
@@ -28,3 +28,3 @@ }; | ||
return getEndpoint() | ||
.get('/roles') | ||
.api.get('/roles') | ||
.then(function (r) { return r.data; }); | ||
@@ -43,3 +43,3 @@ }; | ||
return getEndpoint() | ||
.get('/permissions') | ||
.api.get('/permissions') | ||
.then(function (r) { return r.data; }); | ||
@@ -58,3 +58,3 @@ }; | ||
return getEndpoint() | ||
.post('/profiles', params) | ||
.api.post('/profiles', params) | ||
.then(function (r) { return r.data; }); | ||
@@ -74,3 +74,3 @@ }; | ||
return getEndpoint() | ||
.get("/profiles/".concat(profileId)) | ||
.api.get("/profiles/".concat(profileId)) | ||
.then(function (r) { return r.data; }); | ||
@@ -89,3 +89,3 @@ }; | ||
return getEndpoint() | ||
.get("/profiles/".concat(profileId, "/permissions")) | ||
.api.get("/profiles/".concat(profileId, "/permissions")) | ||
.then(function (r) { return r.data; }); | ||
@@ -104,3 +104,3 @@ }; | ||
return getEndpoint() | ||
.get("/profiles/".concat(profileId, "/groups")) | ||
.api.get("/profiles/".concat(profileId, "/groups")) | ||
.then(function (r) { return r.data; }); | ||
@@ -120,3 +120,3 @@ }; | ||
return getEndpoint() | ||
.post("/profiles/".concat(profileId, "/switch")) | ||
.api.post("/profiles/".concat(profileId, "/switch")) | ||
.then(function (r) { return r.data; }); | ||
@@ -136,3 +136,3 @@ }; | ||
return getEndpoint() | ||
.put("/profiles/".concat(profileId), params) | ||
.api.put("/profiles/".concat(profileId), params) | ||
.then(function (r) { return r.data; }); | ||
@@ -151,4 +151,4 @@ }; | ||
return getEndpoint() | ||
.delete("/profiles/".concat(profileId)) | ||
.api.delete("/profiles/".concat(profileId)) | ||
.then(function (r) { return r.data; }); | ||
}; |
114824
2803