@verdocs/js-sdk 3.10.30 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/README.md +75 -0
- package/dist/index.d.mts +40458 -0
- package/dist/index.d.ts +40458 -0
- package/dist/index.js +3040 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3032 -0
- package/dist/index.mjs.map +1 -0
- package/dist/package.json +76 -0
- package/dist/tsconfig.json +16 -0
- package/package.json +28 -20
- package/.github/workflows/generate-docs.yml +0 -41
- package/Envelopes/Envelopes.d.ts +0 -242
- package/Envelopes/Envelopes.js +0 -339
- package/Envelopes/Initials.d.ts +0 -15
- package/Envelopes/Initials.js +0 -13
- package/Envelopes/Permissions.d.ts +0 -52
- package/Envelopes/Permissions.js +0 -84
- package/Envelopes/Recipients.d.ts +0 -89
- package/Envelopes/Recipients.js +0 -112
- package/Envelopes/Reminders.d.ts +0 -23
- package/Envelopes/Reminders.js +0 -33
- package/Envelopes/Signatures.d.ts +0 -28
- package/Envelopes/Signatures.js +0 -37
- package/Envelopes/Types.d.ts +0 -390
- package/Envelopes/Types.js +0 -45
- package/Envelopes/index.d.ts +0 -7
- package/Envelopes/index.js +0 -7
- package/Organizations/ApiKeys.d.ts +0 -64
- package/Organizations/ApiKeys.js +0 -82
- package/Organizations/Groups.d.ts +0 -47
- package/Organizations/Groups.js +0 -76
- package/Organizations/Invitations.d.ts +0 -24
- package/Organizations/Invitations.js +0 -45
- package/Organizations/Members.d.ts +0 -12
- package/Organizations/Members.js +0 -30
- package/Organizations/Organizations.d.ts +0 -27
- package/Organizations/Organizations.js +0 -45
- package/Organizations/Types.d.ts +0 -104
- package/Organizations/Types.js +0 -1
- package/Organizations/Webhooks.d.ts +0 -34
- package/Organizations/Webhooks.js +0 -10
- package/Organizations/Whitelabel.d.ts +0 -31
- package/Organizations/Whitelabel.js +0 -38
- package/Organizations/index.d.ts +0 -16
- package/Organizations/index.js +0 -16
- package/Sessions/Types.d.ts +0 -54
- package/Sessions/Types.js +0 -1
- package/Sessions/index.d.ts +0 -6
- package/Sessions/index.js +0 -7
- package/Templates/Actions.d.ts +0 -26
- package/Templates/Actions.js +0 -104
- package/Templates/Fields.d.ts +0 -14
- package/Templates/Fields.js +0 -24
- package/Templates/Pages.d.ts +0 -30
- package/Templates/Pages.js +0 -41
- package/Templates/Permissions.d.ts +0 -73
- package/Templates/Permissions.js +0 -124
- package/Templates/Reminders.d.ts +0 -23
- package/Templates/Reminders.js +0 -33
- package/Templates/Roles.d.ts +0 -16
- package/Templates/Roles.js +0 -42
- package/Templates/Stars.d.ts +0 -10
- package/Templates/Stars.js +0 -16
- package/Templates/Tags.d.ts +0 -33
- package/Templates/Tags.js +0 -55
- package/Templates/TemplateDocuments.d.ts +0 -66
- package/Templates/TemplateDocuments.js +0 -139
- package/Templates/Templates.d.ts +0 -284
- package/Templates/Templates.js +0 -309
- package/Templates/Types.d.ts +0 -346
- package/Templates/Types.js +0 -29
- package/Templates/Validators.d.ts +0 -21
- package/Templates/Validators.js +0 -27
- package/Templates/index.d.ts +0 -11
- package/Templates/index.js +0 -11
- package/Users/Auth.d.ts +0 -123
- package/Users/Auth.js +0 -142
- package/Users/Billing.d.ts +0 -1
- package/Users/Billing.js +0 -2
- package/Users/Notifications.d.ts +0 -2
- package/Users/Notifications.js +0 -43
- package/Users/Profiles.d.ts +0 -151
- package/Users/Profiles.js +0 -179
- package/Users/Types.d.ts +0 -146
- package/Users/Types.js +0 -47
- package/Users/index.d.ts +0 -5
- package/Users/index.js +0 -5
- package/Utils/Colors.d.ts +0 -18
- package/Utils/Colors.js +0 -102
- package/Utils/DateTime.d.ts +0 -6
- package/Utils/DateTime.js +0 -79
- package/Utils/Fields.d.ts +0 -5
- package/Utils/Fields.js +0 -24
- package/Utils/Files.d.ts +0 -16
- package/Utils/Files.js +0 -42
- package/Utils/Locales.d.ts +0 -17
- package/Utils/Locales.js +0 -1358
- package/Utils/Primitives.d.ts +0 -18
- package/Utils/Primitives.js +0 -31
- package/Utils/Strings.d.ts +0 -9
- package/Utils/Strings.js +0 -28
- package/Utils/Token.d.ts +0 -19
- package/Utils/Token.js +0 -67
- package/Utils/globalThis.d.ts +0 -2
- package/Utils/globalThis.js +0 -52
- package/Utils/index.d.ts +0 -8
- package/Utils/index.js +0 -8
- package/VerdocsEndpoint.d.ts +0 -199
- package/VerdocsEndpoint.js +0 -319
- package/index.d.ts +0 -18
- package/index.js +0 -18
- package/tsconfig-typedoc.json +0 -26
package/Templates/Roles.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A "role" is an individual participant in a signing flow, such as a signer or CC contact. Roles are identified by
|
|
3
|
-
* their names, which must be unique (e.g. 'Recipient 1'). Template fields are assigned to roles for signing operations,
|
|
4
|
-
* so you may have 'Recipient 1 Signature 1' and so forth.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
import { ITemplateField, IRole } from './Types';
|
|
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 updateRole: (endpoint: VerdocsEndpoint, templateId: string, roleName: string, params: Partial<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[]>;
|
package/Templates/Roles.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A "role" is an individual participant in a signing flow, such as a signer or CC contact. Roles are identified by
|
|
3
|
-
* their names, which must be unique (e.g. 'Recipient 1'). Template fields are assigned to roles for signing operations,
|
|
4
|
-
* so you may have 'Recipient 1 Signature 1' and so forth.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
export var createRole = function (endpoint, templateId, params) {
|
|
9
|
-
return endpoint.api //
|
|
10
|
-
.post("/templates/".concat(templateId, "/roles"), params)
|
|
11
|
-
.then(function (r) { return r.data; });
|
|
12
|
-
};
|
|
13
|
-
export var getRoles = function (endpoint, templateId) {
|
|
14
|
-
return endpoint.api //
|
|
15
|
-
.get("/templates/".concat(templateId, "/roles"))
|
|
16
|
-
.then(function (r) { return r.data; });
|
|
17
|
-
};
|
|
18
|
-
export var getRole = function (endpoint, templateId, roleName) {
|
|
19
|
-
return endpoint.api //
|
|
20
|
-
.get("/templates/".concat(templateId, "/roles/").concat(roleName))
|
|
21
|
-
.then(function (r) { return r.data; });
|
|
22
|
-
};
|
|
23
|
-
export var updateRole = function (endpoint, templateId, roleName, params) {
|
|
24
|
-
return endpoint.api //
|
|
25
|
-
.put("/templates/".concat(templateId, "/roles/").concat(roleName), params)
|
|
26
|
-
.then(function (r) { return r.data; });
|
|
27
|
-
};
|
|
28
|
-
export var deleteRole = function (endpoint, templateId, roleName) {
|
|
29
|
-
return endpoint.api //
|
|
30
|
-
.delete("/templates/".concat(templateId, "/roles/").concat(roleName))
|
|
31
|
-
.then(function (r) { return r.data; });
|
|
32
|
-
};
|
|
33
|
-
export var getRoleFields = function (endpoint, templateId, roleName) {
|
|
34
|
-
return endpoint.api //
|
|
35
|
-
.get("/templates/".concat(templateId, "/roles/").concat(roleName, "/fields"))
|
|
36
|
-
.then(function (r) { return r.data; });
|
|
37
|
-
};
|
|
38
|
-
export var deleteSequence = function (endpoint, templateId) {
|
|
39
|
-
return endpoint.api //
|
|
40
|
-
.delete("/templates/".concat(templateId, "/roles"))
|
|
41
|
-
.then(function (r) { return r.data; });
|
|
42
|
-
};
|
package/Templates/Stars.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IStar, ITemplateSummary } from './Types';
|
|
2
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
3
|
-
/**
|
|
4
|
-
* Get the template stars for a template.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getStars: (endpoint: VerdocsEndpoint, templateId: string) => Promise<IStar[]>;
|
|
7
|
-
/**
|
|
8
|
-
* Toggle the template star for a template.
|
|
9
|
-
*/
|
|
10
|
-
export declare const toggleStar: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateSummary>;
|
package/Templates/Stars.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the template stars for a template.
|
|
3
|
-
*/
|
|
4
|
-
export var getStars = function (endpoint, templateId) {
|
|
5
|
-
return endpoint.api //
|
|
6
|
-
.get("/templates/".concat(templateId, "/stars"))
|
|
7
|
-
.then(function (r) { return r.data; });
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Toggle the template star for a template.
|
|
11
|
-
*/
|
|
12
|
-
export var toggleStar = function (endpoint, templateId) {
|
|
13
|
-
return endpoint.api //
|
|
14
|
-
.post("/templates/".concat(templateId, "/stars/toggle"))
|
|
15
|
-
.then(function (r) { return r.data; });
|
|
16
|
-
};
|
package/Templates/Tags.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A Tag is a user-specified label applied to a template. Tags help users organize and find Templates.
|
|
3
|
-
* recipients. Every Organization has a set of tags "owned" by that Organization and only visible inside it.
|
|
4
|
-
* Verdocs also provides a set of system-wide "featured" tags available to all Organizations.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
import { ITemplateTag, ITag } from './Types';
|
|
9
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
10
|
-
/**
|
|
11
|
-
* Apply a tag to a template.
|
|
12
|
-
*/
|
|
13
|
-
export declare const addTemplateTag: (endpoint: VerdocsEndpoint, templateId: string, params: ITag) => Promise<ITemplateTag>;
|
|
14
|
-
/**
|
|
15
|
-
* Get all tags for a template.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getTemplateTags: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateTag[]>;
|
|
18
|
-
/**
|
|
19
|
-
* Remove a tag from a template.
|
|
20
|
-
*/
|
|
21
|
-
export declare const deleteTemplateTag: (endpoint: VerdocsEndpoint, templateId: string, tagName: string) => Promise<any>;
|
|
22
|
-
/**
|
|
23
|
-
* Create an Organization-wide tag.
|
|
24
|
-
*/
|
|
25
|
-
export declare const createTag: (endpoint: VerdocsEndpoint, name: string) => Promise<ITag>;
|
|
26
|
-
/**
|
|
27
|
-
* Get an Organization-wide tag.
|
|
28
|
-
*/
|
|
29
|
-
export declare const getTag: (endpoint: VerdocsEndpoint, name: string) => Promise<ITag>;
|
|
30
|
-
/**
|
|
31
|
-
* Get all tags available for use by an Organization.
|
|
32
|
-
*/
|
|
33
|
-
export declare const getAllTags: (endpoint: VerdocsEndpoint) => Promise<ITag[]>;
|
package/Templates/Tags.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A Tag is a user-specified label applied to a template. Tags help users organize and find Templates.
|
|
3
|
-
* recipients. Every Organization has a set of tags "owned" by that Organization and only visible inside it.
|
|
4
|
-
* Verdocs also provides a set of system-wide "featured" tags available to all Organizations.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Apply a tag to a template.
|
|
10
|
-
*/
|
|
11
|
-
export var addTemplateTag = function (endpoint, templateId, params) {
|
|
12
|
-
return endpoint.api //
|
|
13
|
-
.post("/templates/".concat(templateId, "/tags/"), params)
|
|
14
|
-
.then(function (r) { return r.data; });
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Get all tags for a template.
|
|
18
|
-
*/
|
|
19
|
-
export var getTemplateTags = function (endpoint, templateId) {
|
|
20
|
-
return endpoint.api //
|
|
21
|
-
.get("/templates/".concat(templateId, "/tags/"))
|
|
22
|
-
.then(function (r) { return r.data; });
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Remove a tag from a template.
|
|
26
|
-
*/
|
|
27
|
-
export var deleteTemplateTag = function (endpoint, templateId, tagName) {
|
|
28
|
-
return endpoint.api //
|
|
29
|
-
.post("/templates/".concat(templateId, "/tags/").concat(tagName))
|
|
30
|
-
.then(function (r) { return r.data; });
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Create an Organization-wide tag.
|
|
34
|
-
*/
|
|
35
|
-
export var createTag = function (endpoint, name) {
|
|
36
|
-
return endpoint.api //
|
|
37
|
-
.post('/tags', { tag_name: name })
|
|
38
|
-
.then(function (r) { return r.data; });
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Get an Organization-wide tag.
|
|
42
|
-
*/
|
|
43
|
-
export var getTag = function (endpoint, name) {
|
|
44
|
-
return endpoint.api //
|
|
45
|
-
.get("/tags/".concat(name))
|
|
46
|
-
.then(function (r) { return r.data; });
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Get all tags available for use by an Organization.
|
|
50
|
-
*/
|
|
51
|
-
export var getAllTags = function (endpoint) {
|
|
52
|
-
return endpoint.api //
|
|
53
|
-
.get('/tags')
|
|
54
|
-
.then(function (r) { return r.data; });
|
|
55
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A TemplateDocument represents a PDF or other attachment in a Template.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
7
|
-
import { ITemplateDocument } from './Types';
|
|
8
|
-
/**
|
|
9
|
-
* Get all the Template Documents associated to a particular Template.
|
|
10
|
-
*
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
13
|
-
*
|
|
14
|
-
* await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateDocument[]>;
|
|
18
|
-
/**
|
|
19
|
-
* Get a specific Document.
|
|
20
|
-
*
|
|
21
|
-
* ```typescript
|
|
22
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
23
|
-
*
|
|
24
|
-
* await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplateDocument>;
|
|
28
|
-
/**
|
|
29
|
-
* Create a Document for a particular Template.
|
|
30
|
-
*
|
|
31
|
-
* ```typescript
|
|
32
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
33
|
-
*
|
|
34
|
-
* await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, file: File, onUploadProgress?: ((percent: number, loadedBytes: number, totalBytes: number) => void) | undefined) => Promise<ITemplateDocument>;
|
|
38
|
-
/**
|
|
39
|
-
* Delete a specific Document.
|
|
40
|
-
*
|
|
41
|
-
* ```typescript
|
|
42
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
43
|
-
*
|
|
44
|
-
* await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<any>;
|
|
48
|
-
/**
|
|
49
|
-
* Get (binary download) a file attached to a Template. It is important to use this method
|
|
50
|
-
* rather than a direct A HREF or similar link to set the authorization headers for the
|
|
51
|
-
* request.
|
|
52
|
-
*/
|
|
53
|
-
export declare const getTemplateDocumentFile: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<any>;
|
|
54
|
-
/**
|
|
55
|
-
* Get (binary download) a file attached to a Template. It is important to use this method
|
|
56
|
-
* rather than a direct A HREF or similar link to set the authorization headers for the
|
|
57
|
-
* request.
|
|
58
|
-
*/
|
|
59
|
-
export declare const getTemplateDocumentThumbnail: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<any>;
|
|
60
|
-
/**
|
|
61
|
-
* Get a display URI for a given page in a file attached to a template document. These pages are rendered server-side
|
|
62
|
-
* into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended
|
|
63
|
-
* for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants. The
|
|
64
|
-
* original asset may be obtained by calling `getTemplateDocumentFile()` or similar.
|
|
65
|
-
*/
|
|
66
|
-
export declare const getTemplateDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, templateId: string, documentId: string, page: number) => Promise<string>;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A TemplateDocument represents a PDF or other attachment in a Template.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
16
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
17
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
18
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
19
|
-
function step(op) {
|
|
20
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
21
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22
|
-
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;
|
|
23
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
24
|
-
switch (op[0]) {
|
|
25
|
-
case 0: case 1: t = op; break;
|
|
26
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
27
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
28
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
29
|
-
default:
|
|
30
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
31
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
32
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
34
|
-
if (t[2]) _.ops.pop();
|
|
35
|
-
_.trys.pop(); continue;
|
|
36
|
-
}
|
|
37
|
-
op = body.call(thisArg, _);
|
|
38
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
39
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Get all the Template Documents associated to a particular Template.
|
|
44
|
-
*
|
|
45
|
-
* ```typescript
|
|
46
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
47
|
-
*
|
|
48
|
-
* await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export var getTemplateDocuments = function (endpoint, templateId) {
|
|
52
|
-
return endpoint.api //
|
|
53
|
-
.get("/templates/".concat(templateId, "/documents/"))
|
|
54
|
-
.then(function (r) { return r.data; });
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Get a specific Document.
|
|
58
|
-
*
|
|
59
|
-
* ```typescript
|
|
60
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
61
|
-
*
|
|
62
|
-
* await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
export var getTemplateDocument = function (endpoint, templateId, documentId) {
|
|
66
|
-
return endpoint.api //
|
|
67
|
-
.get("/templates/".concat(templateId, "/documents/").concat(documentId))
|
|
68
|
-
.then(function (r) { return r.data; });
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Create a Document for a particular Template.
|
|
72
|
-
*
|
|
73
|
-
* ```typescript
|
|
74
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
75
|
-
*
|
|
76
|
-
* await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
export var createTemplateDocument = function (endpoint, templateId, file, onUploadProgress) {
|
|
80
|
-
var formData = new FormData();
|
|
81
|
-
formData.append('document', file, file.name);
|
|
82
|
-
return endpoint.api //
|
|
83
|
-
.post("/templates/".concat(templateId, "/documents"), formData, {
|
|
84
|
-
timeout: 120000,
|
|
85
|
-
onUploadProgress: function (event) {
|
|
86
|
-
var total = event.total || 1;
|
|
87
|
-
var loaded = event.loaded || 0;
|
|
88
|
-
onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);
|
|
89
|
-
},
|
|
90
|
-
})
|
|
91
|
-
.then(function (r) { return r.data; });
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Delete a specific Document.
|
|
95
|
-
*
|
|
96
|
-
* ```typescript
|
|
97
|
-
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
98
|
-
*
|
|
99
|
-
* await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
export var deleteTemplateDocument = function (endpoint, templateId, documentId) {
|
|
103
|
-
return endpoint.api //
|
|
104
|
-
.delete("/templates/".concat(templateId, "/documents/").concat(documentId))
|
|
105
|
-
.then(function (r) { return r.data; });
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Get (binary download) a file attached to a Template. It is important to use this method
|
|
109
|
-
* rather than a direct A HREF or similar link to set the authorization headers for the
|
|
110
|
-
* request.
|
|
111
|
-
*/
|
|
112
|
-
export var getTemplateDocumentFile = function (endpoint, templateId, documentId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
113
|
-
return __generator(this, function (_a) {
|
|
114
|
-
return [2 /*return*/, endpoint.api //
|
|
115
|
-
.get("/templates/".concat(templateId, "/documents/").concat(documentId, "?file=true"), { responseType: 'blob' })
|
|
116
|
-
.then(function (r) { return r.data; })];
|
|
117
|
-
});
|
|
118
|
-
}); };
|
|
119
|
-
/**
|
|
120
|
-
* Get (binary download) a file attached to a Template. It is important to use this method
|
|
121
|
-
* rather than a direct A HREF or similar link to set the authorization headers for the
|
|
122
|
-
* request.
|
|
123
|
-
*/
|
|
124
|
-
export var getTemplateDocumentThumbnail = function (endpoint, templateId, documentId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
125
|
-
return __generator(this, function (_a) {
|
|
126
|
-
return [2 /*return*/, endpoint.api //
|
|
127
|
-
.get("/templates/".concat(templateId, "/documents/").concat(documentId, "?thumbnail=true"), { responseType: 'blob' })
|
|
128
|
-
.then(function (r) { return r.data; })];
|
|
129
|
-
});
|
|
130
|
-
}); };
|
|
131
|
-
/**
|
|
132
|
-
* Get a display URI for a given page in a file attached to a template document. These pages are rendered server-side
|
|
133
|
-
* into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended
|
|
134
|
-
* for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants. The
|
|
135
|
-
* original asset may be obtained by calling `getTemplateDocumentFile()` or similar.
|
|
136
|
-
*/
|
|
137
|
-
export var getTemplateDocumentPageDisplayUri = function (endpoint, templateId, documentId, page) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
138
|
-
return [2 /*return*/, endpoint.api.get("/templates/".concat(templateId, "/documents/").concat(documentId, "/pages/").concat(page, "/image")).then(function (r) { return r.data; })];
|
|
139
|
-
}); }); };
|
package/Templates/Templates.d.ts
DELETED
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A Template defines how a Verdocs signing flow will be performed, including attachments, signing fields, and
|
|
3
|
-
* recipients.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { IRole, ITemplate, ITemplateField, ITemplateOwnerInfo, ITemplateSummary, TTemplateSender } from './Types';
|
|
8
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
9
|
-
export interface IGetTemplatesParams {
|
|
10
|
-
is_starred?: boolean;
|
|
11
|
-
is_creator?: boolean;
|
|
12
|
-
is_organization?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Get all templates accessible by the caller, with optional filters.
|
|
16
|
-
*
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
19
|
-
*
|
|
20
|
-
* await Templates.getTemplates((VerdocsEndpoint.getDefault());
|
|
21
|
-
* await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_starred: true });
|
|
22
|
-
* await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });
|
|
23
|
-
* await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) => Promise<ITemplate[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Lists all templates accessible by the caller, with optional filters.
|
|
29
|
-
*
|
|
30
|
-
* ```typescript
|
|
31
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
32
|
-
*
|
|
33
|
-
* await Templates.listTemplates((VerdocsEndpoint.getDefault(), { sharing: 'personal', sort: 'last_used_at' });
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
/**
|
|
37
|
-
* Get one template by its ID.
|
|
38
|
-
*
|
|
39
|
-
* ```typescript
|
|
40
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
41
|
-
*
|
|
42
|
-
* const template = await Templates.getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplate>;
|
|
46
|
-
/**
|
|
47
|
-
* Get owner information for a template.
|
|
48
|
-
*
|
|
49
|
-
* ```typescript
|
|
50
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
51
|
-
*
|
|
52
|
-
* const template = await Templates.getTemplateOwnerInfo((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export declare const getTemplateOwnerInfo: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateOwnerInfo>;
|
|
56
|
-
/**
|
|
57
|
-
* Represents a document to be attached to a template via an externally-accessible URI. A copy of the document will be
|
|
58
|
-
* downloaded from the specified URI. Note that the URI will be accessed without headers or other authorization methods
|
|
59
|
-
* set, so the URI itself must encode any security tokens or keys required to access the file.
|
|
60
|
-
*/
|
|
61
|
-
export interface IDocumentFromUri {
|
|
62
|
-
/** The URI to retrieve the file from. */
|
|
63
|
-
uri: string;
|
|
64
|
-
/** A name for the attachment. */
|
|
65
|
-
name: string;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Represents a document to be attached to a template via a Base64-encoded string attachment. This is the best option
|
|
69
|
-
* for maximum security but there is a 10MB size limit for the entire creation request. Requests attaching larger files
|
|
70
|
-
* should use `IDocumentFromUri` or add attachments via `createTemplateDocument` after creating the template.
|
|
71
|
-
*/
|
|
72
|
-
export interface IDocumentFromData {
|
|
73
|
-
/** Base64-encoded file data. */
|
|
74
|
-
data: string;
|
|
75
|
-
/** A name for the attachment. */
|
|
76
|
-
name: string;
|
|
77
|
-
}
|
|
78
|
-
export interface ITemplateCreateParams {
|
|
79
|
-
/** Name for the template to create. */
|
|
80
|
-
name: string;
|
|
81
|
-
/**
|
|
82
|
-
* Optional (defaults to true). Personal templates are only visible to the owner. Non-personal templates are shared
|
|
83
|
-
* within the user's organization.
|
|
84
|
-
*/
|
|
85
|
-
is_personal?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Optional (defaults to false). Public templates may be found (via search) and viewed by anyone.
|
|
88
|
-
*/
|
|
89
|
-
is_public?: boolean;
|
|
90
|
-
/** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */
|
|
91
|
-
sender?: TTemplateSender;
|
|
92
|
-
/** Optional description for the template to help identify it. */
|
|
93
|
-
description?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Optional list of roles to create. Documents are required if roles or fields will also be specified. Files may
|
|
96
|
-
* be attached via a number of methods (browser File object, remote URI reference, or Base64-encoded string) but
|
|
97
|
-
* all entries must of of the same type. If browser File objects are provided, the request will use a FORM POST
|
|
98
|
-
* call, otherwise it will use traditional XHR.
|
|
99
|
-
*/
|
|
100
|
-
documents?: File[] | IDocumentFromUri[] | IDocumentFromData[];
|
|
101
|
-
/**
|
|
102
|
-
* Optional list of roles to create. Note that if roles are not included in the request, fields will be ignored.
|
|
103
|
-
*/
|
|
104
|
-
roles?: IRole[];
|
|
105
|
-
/**
|
|
106
|
-
* Optional list of fields to create.
|
|
107
|
-
*/
|
|
108
|
-
fields?: ITemplateField[];
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Create a template.
|
|
112
|
-
*
|
|
113
|
-
* ```typescript
|
|
114
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
115
|
-
*
|
|
116
|
-
* const newTemplate = await Templates.createTemplate((VerdocsEndpoint.getDefault(), {...});
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
export declare const createTemplate: (endpoint: VerdocsEndpoint, params: ITemplateCreateParams, onUploadProgress?: ((percent: number, loadedBytes: number, totalBytes: number) => void) | undefined) => Promise<ITemplate>;
|
|
120
|
-
/**
|
|
121
|
-
* Create a template.
|
|
122
|
-
*
|
|
123
|
-
* ```typescript
|
|
124
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
125
|
-
*
|
|
126
|
-
* const newTemplate = await Templates.createTemplatev2((VerdocsEndpoint.getDefault(), {...});
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
export declare const createTemplatev2: (endpoint: VerdocsEndpoint, params: ITemplateCreateParams, onUploadProgress?: ((percent: number, loadedBytes: number, totalBytes: number) => void) | undefined) => Promise<ITemplate>;
|
|
130
|
-
export interface ITemplateCreateFromSharepointParams {
|
|
131
|
-
/** Name for the template to create. */
|
|
132
|
-
name: string;
|
|
133
|
-
/** The site ID the source file is in. */
|
|
134
|
-
siteId: string;
|
|
135
|
-
/** The item ID of the source file. */
|
|
136
|
-
itemId: string;
|
|
137
|
-
/**
|
|
138
|
-
* On-Behalf-Of access token generated for the request. This must have an audience of "https://graph.microsoft.com"
|
|
139
|
-
* with Read access to the source file. This token is used ephemerally and discarded after the request, but it is
|
|
140
|
-
* still recommended that you generate it with the minimal permissions possible.
|
|
141
|
-
*/
|
|
142
|
-
oboToken: string;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Create a template from a Sharepoint asset.
|
|
146
|
-
*
|
|
147
|
-
* ```typescript
|
|
148
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
149
|
-
*
|
|
150
|
-
* const newTemplate = await Templates.createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
export declare const createTemplateFromSharepoint: (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => Promise<ITemplate>;
|
|
154
|
-
/**
|
|
155
|
-
* Update a template.
|
|
156
|
-
*
|
|
157
|
-
* ```typescript
|
|
158
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
159
|
-
*
|
|
160
|
-
* const updatedTemplate = await Templates.updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
export declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) => Promise<ITemplate>;
|
|
164
|
-
/**
|
|
165
|
-
* Delete a template.
|
|
166
|
-
*
|
|
167
|
-
* ```typescript
|
|
168
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
169
|
-
*
|
|
170
|
-
* await Templates.deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
|
-
export declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<any>;
|
|
174
|
-
export interface ITimePeriod {
|
|
175
|
-
start_time: string;
|
|
176
|
-
end_time: string;
|
|
177
|
-
}
|
|
178
|
-
export declare enum SortOptions {
|
|
179
|
-
CREATED_AT = "created_at",
|
|
180
|
-
UPDATED_AT = "updated_at",
|
|
181
|
-
NAME = "name",
|
|
182
|
-
LAST_USED_AT = "last_used_at",
|
|
183
|
-
COUNTER = "counter",
|
|
184
|
-
STAR_COUNTER = "star_counter"
|
|
185
|
-
}
|
|
186
|
-
export interface ITemplateSearchParams {
|
|
187
|
-
id?: string;
|
|
188
|
-
name?: string;
|
|
189
|
-
sender?: string;
|
|
190
|
-
description?: string;
|
|
191
|
-
profile_id?: string;
|
|
192
|
-
organization_id?: string;
|
|
193
|
-
updated_at?: ITimePeriod;
|
|
194
|
-
created_at?: ITimePeriod;
|
|
195
|
-
last_used_at?: ITimePeriod;
|
|
196
|
-
is_personal?: boolean;
|
|
197
|
-
is_public?: boolean;
|
|
198
|
-
tags?: string[];
|
|
199
|
-
document_name?: string;
|
|
200
|
-
sort_by?: SortOptions;
|
|
201
|
-
ascending?: boolean;
|
|
202
|
-
row?: number;
|
|
203
|
-
page?: number;
|
|
204
|
-
}
|
|
205
|
-
export interface ITemplateSearchResult {
|
|
206
|
-
page: number;
|
|
207
|
-
row: number;
|
|
208
|
-
total: number;
|
|
209
|
-
result: ITemplate[];
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Search for templates matching various criteria.
|
|
213
|
-
*
|
|
214
|
-
* ```typescript
|
|
215
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
216
|
-
*
|
|
217
|
-
* const {result, page, total} = await Templates.search((VerdocsEndpoint.getDefault(), { ... });
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
export declare const searchTemplates: (endpoint: VerdocsEndpoint, params: ITemplateSearchParams) => Promise<ITemplateSearchResult>;
|
|
221
|
-
export interface ISearchTimeRange {
|
|
222
|
-
start_time: string;
|
|
223
|
-
end_time: string;
|
|
224
|
-
}
|
|
225
|
-
export type IGetTemplateSummarySortBy = 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter';
|
|
226
|
-
export interface IGetTemplateSummaryParams {
|
|
227
|
-
id?: string;
|
|
228
|
-
name?: string;
|
|
229
|
-
sender?: string;
|
|
230
|
-
profile_id?: string;
|
|
231
|
-
organization_id?: string;
|
|
232
|
-
description?: string;
|
|
233
|
-
created_at?: ISearchTimeRange;
|
|
234
|
-
updated_at?: ISearchTimeRange;
|
|
235
|
-
last_used_at?: ISearchTimeRange;
|
|
236
|
-
is_personal?: boolean;
|
|
237
|
-
is_public?: boolean;
|
|
238
|
-
is_starred?: boolean;
|
|
239
|
-
sort_by?: IGetTemplateSummarySortBy;
|
|
240
|
-
ascending?: boolean;
|
|
241
|
-
row?: number;
|
|
242
|
-
page?: number;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Get a summary of template data, typically used to populate admin panel dashboard pages.
|
|
246
|
-
*
|
|
247
|
-
* ```typescript
|
|
248
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
249
|
-
*
|
|
250
|
-
* const summary = await Templates.getSummary((VerdocsEndpoint.getDefault(), 0);
|
|
251
|
-
* ```
|
|
252
|
-
*/
|
|
253
|
-
export declare const getSummary: (endpoint: VerdocsEndpoint, params?: IGetTemplateSummaryParams) => Promise<ITemplateSummary>;
|
|
254
|
-
/**
|
|
255
|
-
* Wrapper for `getTemplate()` that limits queries to one every 2 seconds per template ID.
|
|
256
|
-
* This is intended for use in component hierarchies that all rely on the same template
|
|
257
|
-
* to avoid unnecessary repeat server calls.
|
|
258
|
-
*/
|
|
259
|
-
export declare const throttledGetTemplate: (endpoint: VerdocsEndpoint, templateId: string) => ITemplate | Promise<ITemplate>;
|
|
260
|
-
export interface ITemplateListParams {
|
|
261
|
-
status?: string[];
|
|
262
|
-
q?: string;
|
|
263
|
-
created_at?: ITimePeriod;
|
|
264
|
-
is_personal?: boolean;
|
|
265
|
-
is_public?: boolean;
|
|
266
|
-
sort_by?: SortOptions;
|
|
267
|
-
ascending?: boolean;
|
|
268
|
-
rows?: number;
|
|
269
|
-
page?: number;
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* List templates.
|
|
273
|
-
*
|
|
274
|
-
* ```typescript
|
|
275
|
-
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
276
|
-
*
|
|
277
|
-
* const {totals, templates} = await Templates.listTemplates((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created_at' }); * ```
|
|
278
|
-
*/
|
|
279
|
-
export declare const listTemplates: (endpoint: VerdocsEndpoint, params?: ITemplateListParams) => Promise<{
|
|
280
|
-
total: number;
|
|
281
|
-
rows: number;
|
|
282
|
-
page: number;
|
|
283
|
-
templates: ITemplate[];
|
|
284
|
-
}>;
|