@verdocs/js-sdk 3.10.30 → 4.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 (112) hide show
  1. package/dist/README.md +75 -0
  2. package/dist/index.d.mts +41294 -0
  3. package/dist/index.d.ts +41294 -0
  4. package/dist/index.js +3045 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +3036 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/package.json +85 -0
  9. package/dist/tsconfig.json +16 -0
  10. package/package.json +29 -12
  11. package/.github/workflows/generate-docs.yml +0 -41
  12. package/Envelopes/Envelopes.d.ts +0 -242
  13. package/Envelopes/Envelopes.js +0 -339
  14. package/Envelopes/Initials.d.ts +0 -15
  15. package/Envelopes/Initials.js +0 -13
  16. package/Envelopes/Permissions.d.ts +0 -52
  17. package/Envelopes/Permissions.js +0 -84
  18. package/Envelopes/Recipients.d.ts +0 -89
  19. package/Envelopes/Recipients.js +0 -112
  20. package/Envelopes/Reminders.d.ts +0 -23
  21. package/Envelopes/Reminders.js +0 -33
  22. package/Envelopes/Signatures.d.ts +0 -28
  23. package/Envelopes/Signatures.js +0 -37
  24. package/Envelopes/Types.d.ts +0 -390
  25. package/Envelopes/Types.js +0 -45
  26. package/Envelopes/index.d.ts +0 -7
  27. package/Envelopes/index.js +0 -7
  28. package/Organizations/ApiKeys.d.ts +0 -64
  29. package/Organizations/ApiKeys.js +0 -82
  30. package/Organizations/Groups.d.ts +0 -47
  31. package/Organizations/Groups.js +0 -76
  32. package/Organizations/Invitations.d.ts +0 -24
  33. package/Organizations/Invitations.js +0 -45
  34. package/Organizations/Members.d.ts +0 -12
  35. package/Organizations/Members.js +0 -30
  36. package/Organizations/Organizations.d.ts +0 -27
  37. package/Organizations/Organizations.js +0 -45
  38. package/Organizations/Types.d.ts +0 -104
  39. package/Organizations/Types.js +0 -1
  40. package/Organizations/Webhooks.d.ts +0 -34
  41. package/Organizations/Webhooks.js +0 -10
  42. package/Organizations/Whitelabel.d.ts +0 -31
  43. package/Organizations/Whitelabel.js +0 -38
  44. package/Organizations/index.d.ts +0 -16
  45. package/Organizations/index.js +0 -16
  46. package/Sessions/Types.d.ts +0 -54
  47. package/Sessions/Types.js +0 -1
  48. package/Sessions/index.d.ts +0 -6
  49. package/Sessions/index.js +0 -7
  50. package/Templates/Actions.d.ts +0 -26
  51. package/Templates/Actions.js +0 -104
  52. package/Templates/Fields.d.ts +0 -14
  53. package/Templates/Fields.js +0 -24
  54. package/Templates/Pages.d.ts +0 -30
  55. package/Templates/Pages.js +0 -41
  56. package/Templates/Permissions.d.ts +0 -73
  57. package/Templates/Permissions.js +0 -124
  58. package/Templates/Reminders.d.ts +0 -23
  59. package/Templates/Reminders.js +0 -33
  60. package/Templates/Roles.d.ts +0 -16
  61. package/Templates/Roles.js +0 -42
  62. package/Templates/Stars.d.ts +0 -10
  63. package/Templates/Stars.js +0 -16
  64. package/Templates/Tags.d.ts +0 -33
  65. package/Templates/Tags.js +0 -55
  66. package/Templates/TemplateDocuments.d.ts +0 -66
  67. package/Templates/TemplateDocuments.js +0 -139
  68. package/Templates/Templates.d.ts +0 -284
  69. package/Templates/Templates.js +0 -309
  70. package/Templates/Types.d.ts +0 -346
  71. package/Templates/Types.js +0 -29
  72. package/Templates/Validators.d.ts +0 -21
  73. package/Templates/Validators.js +0 -27
  74. package/Templates/index.d.ts +0 -11
  75. package/Templates/index.js +0 -11
  76. package/Users/Auth.d.ts +0 -123
  77. package/Users/Auth.js +0 -142
  78. package/Users/Billing.d.ts +0 -1
  79. package/Users/Billing.js +0 -2
  80. package/Users/Notifications.d.ts +0 -2
  81. package/Users/Notifications.js +0 -43
  82. package/Users/Profiles.d.ts +0 -151
  83. package/Users/Profiles.js +0 -179
  84. package/Users/Types.d.ts +0 -146
  85. package/Users/Types.js +0 -47
  86. package/Users/index.d.ts +0 -5
  87. package/Users/index.js +0 -5
  88. package/Utils/Colors.d.ts +0 -18
  89. package/Utils/Colors.js +0 -102
  90. package/Utils/DateTime.d.ts +0 -6
  91. package/Utils/DateTime.js +0 -79
  92. package/Utils/Fields.d.ts +0 -5
  93. package/Utils/Fields.js +0 -24
  94. package/Utils/Files.d.ts +0 -16
  95. package/Utils/Files.js +0 -42
  96. package/Utils/Locales.d.ts +0 -17
  97. package/Utils/Locales.js +0 -1358
  98. package/Utils/Primitives.d.ts +0 -18
  99. package/Utils/Primitives.js +0 -31
  100. package/Utils/Strings.d.ts +0 -9
  101. package/Utils/Strings.js +0 -28
  102. package/Utils/Token.d.ts +0 -19
  103. package/Utils/Token.js +0 -67
  104. package/Utils/globalThis.d.ts +0 -2
  105. package/Utils/globalThis.js +0 -52
  106. package/Utils/index.d.ts +0 -8
  107. package/Utils/index.js +0 -8
  108. package/VerdocsEndpoint.d.ts +0 -199
  109. package/VerdocsEndpoint.js +0 -319
  110. package/index.d.ts +0 -18
  111. package/index.js +0 -18
  112. package/tsconfig-typedoc.json +0 -26
@@ -1,309 +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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- var __generator = (this && this.__generator) || function (thisArg, body) {
17
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
18
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
19
- function verb(n) { return function (v) { return step([n, v]); }; }
20
- function step(op) {
21
- if (f) throw new TypeError("Generator is already executing.");
22
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
23
- 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;
24
- if (y = 0, t) op = [op[0] & 2, t.value];
25
- switch (op[0]) {
26
- case 0: case 1: t = op; break;
27
- case 4: _.label++; return { value: op[1], done: false };
28
- case 5: _.label++; y = op[1]; op = [0]; continue;
29
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
30
- default:
31
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
32
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
33
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
34
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
35
- if (t[2]) _.ops.pop();
36
- _.trys.pop(); continue;
37
- }
38
- op = body.call(thisArg, _);
39
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
40
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
41
- }
42
- };
43
- /**
44
- * Get all templates accessible by the caller, with optional filters.
45
- *
46
- * ```typescript
47
- * import {Templates} from '@verdocs/js-sdk/Templates';
48
- *
49
- * await Templates.getTemplates((VerdocsEndpoint.getDefault());
50
- * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_starred: true });
51
- * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });
52
- * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });
53
- * ```
54
- */
55
- export var getTemplates = function (endpoint, params) {
56
- return endpoint.api //
57
- .post('/templates', { params: params })
58
- .then(function (r) { return r.data; });
59
- };
60
- // export interface IListTemplatesParams {
61
- // name?: string;
62
- // sharing?: 'all' | 'personal' | 'shared' | 'public';
63
- // starred?: 'all' | 'starred' | 'unstarred';
64
- // sort?: 'name' | 'created_at' | 'updated_at' | 'last_used_at' | 'counter' | 'star_counter';
65
- // direction?: 'asc' | 'desc';
66
- // page?: number;
67
- // rows?: number;
68
- // }
69
- /**
70
- * Lists all templates accessible by the caller, with optional filters.
71
- *
72
- * ```typescript
73
- * import {Templates} from '@verdocs/js-sdk/Templates';
74
- *
75
- * await Templates.listTemplates((VerdocsEndpoint.getDefault(), { sharing: 'personal', sort: 'last_used_at' });
76
- * ```
77
- */
78
- // export const listTemplates = (endpoint: VerdocsEndpoint, params?: IListTemplatesParams) =>
79
- // endpoint.api //
80
- // .post<ITemplateSummaries>('/templates/list', params, {baseURL: endpoint.getBaseURLv2()})
81
- // .then((r) => r.data);
82
- /**
83
- * Get one template by its ID.
84
- *
85
- * ```typescript
86
- * import {Templates} from '@verdocs/js-sdk/Templates';
87
- *
88
- * const template = await Templates.getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
89
- * ```
90
- */
91
- export var getTemplate = function (endpoint, templateId) {
92
- return endpoint.api //
93
- .get("/templates/".concat(templateId))
94
- .then(function (r) { return r.data; });
95
- };
96
- /**
97
- * Get owner information for a template.
98
- *
99
- * ```typescript
100
- * import {Templates} from '@verdocs/js-sdk/Templates';
101
- *
102
- * const template = await Templates.getTemplateOwnerInfo((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
103
- * ```
104
- */
105
- export var getTemplateOwnerInfo = function (endpoint, templateId) {
106
- return endpoint.api //
107
- .get("/templates/".concat(templateId))
108
- .then(function (r) { return r.data; });
109
- };
110
- var ALLOWED_CREATE_FIELDS = [
111
- 'name',
112
- 'is_personal',
113
- 'is_public',
114
- 'sender',
115
- 'description',
116
- 'roles',
117
- 'fields',
118
- ];
119
- /**
120
- * Create a template.
121
- *
122
- * ```typescript
123
- * import {Templates} from '@verdocs/js-sdk/Templates';
124
- *
125
- * const newTemplate = await Templates.createTemplate((VerdocsEndpoint.getDefault(), {...});
126
- * ```
127
- */
128
- export var createTemplate = function (endpoint, params, onUploadProgress) {
129
- var options = {
130
- timeout: 120000,
131
- onUploadProgress: function (event) {
132
- var total = event.total || 1;
133
- var loaded = event.loaded || 0;
134
- onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);
135
- },
136
- };
137
- if (params.documents && params.documents[0] instanceof File) {
138
- if (params.documents.length > 10) {
139
- throw new Error('createTemplate() has a maximum of 10 documents that can be attached.');
140
- }
141
- var formData_1 = new FormData();
142
- ALLOWED_CREATE_FIELDS.forEach(function (allowedKey) {
143
- if (params[allowedKey] !== undefined) {
144
- formData_1.append(allowedKey, params[allowedKey]);
145
- }
146
- });
147
- params.documents.forEach(function (file) {
148
- formData_1.append('documents', file, file.name);
149
- });
150
- return endpoint.api.post('/templates', formData_1, options).then(function (r) { return r.data; });
151
- }
152
- else {
153
- return endpoint.api.post('/templates', params, options).then(function (r) { return r.data; });
154
- }
155
- };
156
- /**
157
- * Create a template.
158
- *
159
- * ```typescript
160
- * import {Templates} from '@verdocs/js-sdk/Templates';
161
- *
162
- * const newTemplate = await Templates.createTemplatev2((VerdocsEndpoint.getDefault(), {...});
163
- * ```
164
- */
165
- export var createTemplatev2 = function (endpoint, params, onUploadProgress) {
166
- var options = {
167
- timeout: 120000,
168
- onUploadProgress: function (event) {
169
- var total = event.total || 1;
170
- var loaded = event.loaded || 0;
171
- onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);
172
- },
173
- };
174
- if (params.documents && params.documents[0] instanceof File) {
175
- var formData_2 = new FormData();
176
- ALLOWED_CREATE_FIELDS.forEach(function (allowedKey) {
177
- if (params[allowedKey] !== undefined) {
178
- formData_2.append(allowedKey, params[allowedKey]);
179
- }
180
- });
181
- params.documents.forEach(function (file) {
182
- formData_2.append('documents', file, file.name);
183
- });
184
- return endpoint.api.post('/v2/templates', formData_2, options).then(function (r) { return r.data; });
185
- }
186
- else {
187
- return endpoint.api.post('/v2/templates', params, options).then(function (r) { return r.data; });
188
- }
189
- };
190
- /**
191
- * Create a template from a Sharepoint asset.
192
- *
193
- * ```typescript
194
- * import {Templates} from '@verdocs/js-sdk/Templates';
195
- *
196
- * const newTemplate = await Templates.createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});
197
- * ```
198
- */
199
- export var createTemplateFromSharepoint = function (endpoint, params) {
200
- var options = {
201
- timeout: 120000,
202
- };
203
- return endpoint.api.post('/templates/from-sharepoint', params, options).then(function (r) { return r.data; });
204
- };
205
- /**
206
- * Update a template.
207
- *
208
- * ```typescript
209
- * import {Templates} from '@verdocs/js-sdk/Templates';
210
- *
211
- * const updatedTemplate = await Templates.updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });
212
- * ```
213
- */
214
- export var updateTemplate = function (endpoint, templateId, params) {
215
- return endpoint.api //
216
- .put("/templates/".concat(templateId), params)
217
- .then(function (r) { return r.data; });
218
- };
219
- /**
220
- * Delete a template.
221
- *
222
- * ```typescript
223
- * import {Templates} from '@verdocs/js-sdk/Templates';
224
- *
225
- * await Templates.deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
226
- * ```
227
- */
228
- export var deleteTemplate = function (endpoint, templateId) {
229
- return endpoint.api //
230
- .delete("/templates/".concat(templateId))
231
- .then(function (r) { return r.data; });
232
- };
233
- export var SortOptions;
234
- (function (SortOptions) {
235
- SortOptions["CREATED_AT"] = "created_at";
236
- SortOptions["UPDATED_AT"] = "updated_at";
237
- SortOptions["NAME"] = "name";
238
- SortOptions["LAST_USED_AT"] = "last_used_at";
239
- SortOptions["COUNTER"] = "counter";
240
- SortOptions["STAR_COUNTER"] = "star_counter";
241
- })(SortOptions || (SortOptions = {}));
242
- /**
243
- * Search for templates matching various criteria.
244
- *
245
- * ```typescript
246
- * import {Templates} from '@verdocs/js-sdk/Templates';
247
- *
248
- * const {result, page, total} = await Templates.search((VerdocsEndpoint.getDefault(), { ... });
249
- * ```
250
- */
251
- export var searchTemplates = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {
252
- return __generator(this, function (_a) {
253
- return [2 /*return*/, endpoint.api //
254
- .post('/templates/search', params)
255
- .then(function (r) { return r.data; })];
256
- });
257
- }); };
258
- /**
259
- * Get a summary of template data, typically used to populate admin panel dashboard pages.
260
- *
261
- * ```typescript
262
- * import {Templates} from '@verdocs/js-sdk/Templates';
263
- *
264
- * const summary = await Templates.getSummary((VerdocsEndpoint.getDefault(), 0);
265
- * ```
266
- */
267
- export var getSummary = function (endpoint, params) {
268
- if (params === void 0) { params = {}; }
269
- return __awaiter(void 0, void 0, void 0, function () {
270
- return __generator(this, function (_a) {
271
- return [2 /*return*/, endpoint.api //
272
- .post('/templates/summary', params)
273
- .then(function (r) { return r.data; })];
274
- });
275
- });
276
- };
277
- var cachedTemplates = {};
278
- /**
279
- * Wrapper for `getTemplate()` that limits queries to one every 2 seconds per template ID.
280
- * This is intended for use in component hierarchies that all rely on the same template
281
- * to avoid unnecessary repeat server calls.
282
- */
283
- export var throttledGetTemplate = function (endpoint, templateId) {
284
- if (cachedTemplates[templateId] && cachedTemplates[templateId].loaded + 2000 < new Date().getTime()) {
285
- return cachedTemplates[templateId].template;
286
- }
287
- return getTemplate(endpoint, templateId).then(function (template) {
288
- cachedTemplates[templateId] = { loaded: new Date().getTime(), template: template };
289
- return template;
290
- });
291
- };
292
- /**
293
- * List templates.
294
- *
295
- * ```typescript
296
- * import {Templates} from '@verdocs/js-sdk/Templates';
297
- *
298
- * const {totals, templates} = await Templates.listTemplates((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created_at' }); * ```
299
- */
300
- export var listTemplates = function (endpoint, params) {
301
- if (params === void 0) { params = {}; }
302
- return __awaiter(void 0, void 0, void 0, function () {
303
- return __generator(this, function (_a) {
304
- return [2 /*return*/, endpoint.api //
305
- .post('/templates/list', params)
306
- .then(function (r) { return r.data; })];
307
- });
308
- });
309
- };
@@ -1,346 +0,0 @@
1
- import { IOrganization } from '../Organizations/Types';
2
- import { TDocumentFieldType, TRecipientType } from '../Envelopes/Types';
3
- /**
4
- * A reusable template for creating signable instruments. Templates are used to create Envelopes which contain
5
- * Documents to sign.
6
- */
7
- export interface ITemplate {
8
- /**
9
- * The unique ID of the template.
10
- */
11
- id: string;
12
- name: string;
13
- /**
14
- * Optional description for the template.
15
- */
16
- description?: string;
17
- /**
18
- * Who may create new documents from the template.
19
- */
20
- sender: TTemplateSender;
21
- /**
22
- * The template's owner/creator.
23
- */
24
- profile_id: string;
25
- /**
26
- * Organization the template lives in.
27
- */
28
- organization_id: string;
29
- /**
30
- * Number of times the template has been used.
31
- */
32
- counter: number;
33
- /**
34
- * Number of times the template has been "starred".
35
- */
36
- star_counter: number;
37
- /**
38
- * If true, the template is considered "sendable" (it has at least one signer, and every signer has at least one field.)
39
- */
40
- is_sendable: boolean;
41
- /**
42
- * If true, the template is only visible to the creator. If false, the template will also be visible to the user's
43
- * organization, if any.
44
- */
45
- is_personal: boolean;
46
- /**
47
- * If true, the template is visible publicly. Note that this does not necessarily mean it is also visible to the
48
- * user's organization. It may be desirable to create documents that are public but that do not appear in the
49
- * organization's shared templates list. To achieve this, set both `is_personal` and `is_public` to TRUE.
50
- */
51
- is_public: boolean;
52
- /**
53
- * Creation date/time.
54
- */
55
- created_at: string;
56
- /**
57
- * Last-update date/time.
58
- */
59
- updated_at: string;
60
- /**
61
- * Last-used date/time (when the template was used to create a document).
62
- */
63
- last_used_at: string;
64
- /**
65
- * Secret token associated with the document. Note that this field is marked optional because it is only visible to
66
- * the creator. This token is used in some operations such as creating shareable links to the template.
67
- */
68
- token?: string;
69
- /**
70
- * If set, the template has reminders enabled.
71
- */
72
- reminder_id?: string;
73
- /**
74
- * If reminders are enabled, the reminder configuration.
75
- */
76
- reminder?: IReminder;
77
- /**
78
- * If set, the template has been post-processed (rendered server-side for display in Web and Mobile clients).
79
- */
80
- processed?: boolean;
81
- /**
82
- * If the template was created within an organization, details about that organization.
83
- */
84
- organization?: IOrganization;
85
- /**
86
- * Roles (recipients) attached to the template. (Note that roles are uniquely identified by name rather than ID.)
87
- */
88
- roles?: IRole[];
89
- /**
90
- * Pages attached to the template. Note that this is all of the pages for all document attachments in sequential order.
91
- * @deprecated. Use document page counts instead, and accessor functions that take page numbers rather than Page objects.
92
- */
93
- pages?: IPage[];
94
- /**
95
- * @deprecated. New code should use `template_documents`.
96
- */
97
- template_document?: ITemplateDocument;
98
- /**
99
- * File attachments for this template.
100
- */
101
- template_documents?: ITemplateDocument[];
102
- /**
103
- * Fields connected to the template.
104
- */
105
- fields?: ITemplateField[];
106
- }
107
- /**
108
- * Some template search and list endpoints return only a partial set of fields for each entry via this structure.
109
- */
110
- export interface ITemplateSummary {
111
- id: string;
112
- name: string;
113
- description: string | null;
114
- sender: TTemplateSender;
115
- counter: number;
116
- star_counter: number;
117
- created_at: string;
118
- updated_at: string;
119
- last_used_at: string | null;
120
- /**
121
- * If true, the template is considered "sendable" (it has at least one signer, and every signer has at least one field.)
122
- */
123
- is_sendable: boolean;
124
- is_personal: boolean;
125
- is_public: boolean;
126
- profile_id: string;
127
- organization_id: string;
128
- reminder_id: string;
129
- tags: string[];
130
- allowed_operations: TemplateActions[];
131
- }
132
- export declare enum TemplateSenderTypes {
133
- CREATOR = "creator",// same as legacy
134
- ORGANIZATION_MEMBER = "organization_member",
135
- ORGANIZATION_MEMBER_AS_CREATOR = "organization_member_as_creator",
136
- EVERYONE = "everyone",
137
- EVERYONE_AS_CREATOR = "everyone_as_creator"
138
- }
139
- export type TTemplateSender = `${TemplateSenderTypes}`;
140
- export declare enum TemplateActions {
141
- CREATE_PERSONAL = "create_personal",
142
- CREATE_ORG = "create_org",
143
- CREATE_PUBLIC = "create_public",
144
- READ = "read",
145
- WRITE = "write",
146
- DELETE = "delete",
147
- CHANGE_VISIBILITY_PERSONAL = "change_visibility_personal",
148
- CHANGE_VISIBILITY_ORG = "change_visibility_org",
149
- CHANGE_VISIBILITY_PUBLIC = "change_visibility_public"
150
- }
151
- export type TTemplateAction = `${TemplateActions}`;
152
- export interface ITemplateSearchParams {
153
- id?: string;
154
- name?: string;
155
- sender?: string;
156
- description?: string;
157
- profile_id?: string;
158
- organization_id?: string;
159
- updated_at?: ITimePeriod;
160
- created_at?: ITimePeriod;
161
- last_used_at?: ITimePeriod;
162
- is_personal?: boolean;
163
- is_public?: boolean;
164
- tags?: string[];
165
- document_name?: string;
166
- sort_by?: SortOptions;
167
- ascending?: boolean;
168
- row?: number;
169
- page?: number;
170
- }
171
- export interface ITimePeriod {
172
- start_time: string;
173
- end_time: string;
174
- }
175
- export declare enum SortOptions {
176
- CREATED_AT = "created_at",
177
- UPDATED_AT = "updated_at",
178
- NAME = "name",
179
- LAST_USED_AT = "last_used_at",
180
- COUNTER = "counter",
181
- STAR_COUNTER = "star_counter"
182
- }
183
- export interface ITemplateSummaries {
184
- page: number;
185
- count: number;
186
- total: number;
187
- records: ITemplateSummary[];
188
- }
189
- export interface ITemplateTag {
190
- tag_name: string;
191
- template_id: string;
192
- }
193
- export interface ITag {
194
- name: string;
195
- featured?: boolean;
196
- organization_id?: string;
197
- created_at?: string;
198
- }
199
- export interface IStar {
200
- template_id: string;
201
- profile_id: string;
202
- }
203
- /**
204
- * A placeholder for an individual recipient, CC, or other party in a signing flow. Roles may be "known" or "unknown."
205
- * "Known" roles will have their email address supplied in the template which will get copied to envelopes created from
206
- * it. This is used when a certain party will always be the same, e.g. a leasing agent counter-signing a lease.
207
- * "Unknown" roles are dynamic, and will be filled in later when the envelope is created.
208
- */
209
- export interface IRole {
210
- template_id: string;
211
- name: string;
212
- full_name?: string;
213
- email?: string;
214
- type: TRecipientType;
215
- /**
216
- * The sequence number indicates the order in which Roles act. Multiple roles may have the same sequence
217
- * number, in which case they may act in parallel. (e.g. all Roles at sequence 2 will receive invites once
218
- * all Recipients at sequence 1 have signed.)
219
- */
220
- sequence: number;
221
- /**
222
- * The order indicates the order in which recipients are listed in a single "level" of the workflow. Note that
223
- * recipients at the same level may act in parallel despite this value. However, it can often be useful to visually
224
- * arrange recipients to match related business processes so this field allows for that.
225
- */
226
- order: number;
227
- /**
228
- * @deprecated. Use the fields array at the template level instead. This nested block will be removed in a future release.
229
- */
230
- fields?: ITemplateField[];
231
- delegator?: boolean;
232
- message?: string;
233
- phone?: string;
234
- rgba?: string;
235
- }
236
- /**
237
- * A file attached to the template for display/signing.
238
- */
239
- export interface ITemplateDocument {
240
- url: string;
241
- name: string;
242
- page_numbers: number;
243
- order: number;
244
- id?: string;
245
- updated_at?: string;
246
- created_at?: string;
247
- template_id: string;
248
- mime: string;
249
- thumbnail_url: string;
250
- pages?: IPage[];
251
- }
252
- export interface ITemplateField {
253
- /** The machine name of the field, e.g. `checkbox_groupP1-18` */
254
- name: string;
255
- /** The ID of the role in the recipients list, e.g. `Recipient 2` */
256
- role_name: string;
257
- /** The ID of the template the field is for. */
258
- template_id: string;
259
- /** The ID of the document the field is for. */
260
- document_id: string;
261
- type: TDocumentFieldType;
262
- required: boolean;
263
- setting: ITemplateFieldSetting;
264
- page_sequence: number;
265
- validator?: string;
266
- label?: string;
267
- /** If set, the tab index for the field. */
268
- tabindex: number;
269
- /** The X position of the field. */
270
- x: number;
271
- /** The Y position of the field. */
272
- y: number;
273
- /** The width of the field. */
274
- width: number;
275
- /** The height of the field. */
276
- height: number;
277
- /** The default value for the field. */
278
- default?: string;
279
- /** The placeholder to show in the field. */
280
- placeholder?: string;
281
- /** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */
282
- group?: string;
283
- }
284
- export interface ITextFieldSetting {
285
- x: number;
286
- y: number;
287
- width: number;
288
- height: number;
289
- result: string;
290
- leading: number;
291
- alignment: number;
292
- upperCase: boolean;
293
- }
294
- export interface ITemplateFieldSetting {
295
- x?: number;
296
- y?: number;
297
- result?: string;
298
- width?: number;
299
- height?: number;
300
- leading?: number;
301
- alignment?: number;
302
- upperCase?: boolean;
303
- options?: any[];
304
- [key: string]: any;
305
- }
306
- export interface IPage {
307
- template_id: string;
308
- document_id: string;
309
- envelope_id: string;
310
- /**
311
- * Note: Page numbers are 1-based
312
- */
313
- sequence: number;
314
- /**
315
- * @deprecated. New code should use `sequence`
316
- */
317
- page_number: number;
318
- /**
319
- * @deprecated. Clients should not attempt to access images directly. Call `getTemplateDocumentPageDisplayUri()`
320
- * instead.
321
- */
322
- thumbnail_url?: string;
323
- /**
324
- * @deprecated. Clients should not attempt to access images directly. Call `getTemplateDocumentPageDisplayUri()`
325
- * instead.
326
- */
327
- image_uri?: string | null;
328
- template_document?: ITemplateDocument;
329
- fields?: ITemplateField[];
330
- }
331
- export interface IReminder {
332
- id?: string;
333
- created_at?: string;
334
- is_on: boolean;
335
- setup_time: number;
336
- interval_time: number;
337
- last_time: number;
338
- next_time: number;
339
- envelope_id: string;
340
- template_id: string;
341
- }
342
- export interface ITemplateOwnerInfo {
343
- email: string;
344
- name: string;
345
- profile_id: string;
346
- }
@@ -1,29 +0,0 @@
1
- export var TemplateSenderTypes;
2
- (function (TemplateSenderTypes) {
3
- TemplateSenderTypes["CREATOR"] = "creator";
4
- TemplateSenderTypes["ORGANIZATION_MEMBER"] = "organization_member";
5
- TemplateSenderTypes["ORGANIZATION_MEMBER_AS_CREATOR"] = "organization_member_as_creator";
6
- TemplateSenderTypes["EVERYONE"] = "everyone";
7
- TemplateSenderTypes["EVERYONE_AS_CREATOR"] = "everyone_as_creator";
8
- })(TemplateSenderTypes || (TemplateSenderTypes = {}));
9
- export var TemplateActions;
10
- (function (TemplateActions) {
11
- TemplateActions["CREATE_PERSONAL"] = "create_personal";
12
- TemplateActions["CREATE_ORG"] = "create_org";
13
- TemplateActions["CREATE_PUBLIC"] = "create_public";
14
- TemplateActions["READ"] = "read";
15
- TemplateActions["WRITE"] = "write";
16
- TemplateActions["DELETE"] = "delete";
17
- TemplateActions["CHANGE_VISIBILITY_PERSONAL"] = "change_visibility_personal";
18
- TemplateActions["CHANGE_VISIBILITY_ORG"] = "change_visibility_org";
19
- TemplateActions["CHANGE_VISIBILITY_PUBLIC"] = "change_visibility_public";
20
- })(TemplateActions || (TemplateActions = {}));
21
- export var SortOptions;
22
- (function (SortOptions) {
23
- SortOptions["CREATED_AT"] = "created_at";
24
- SortOptions["UPDATED_AT"] = "updated_at";
25
- SortOptions["NAME"] = "name";
26
- SortOptions["LAST_USED_AT"] = "last_used_at";
27
- SortOptions["COUNTER"] = "counter";
28
- SortOptions["STAR_COUNTER"] = "star_counter";
29
- })(SortOptions || (SortOptions = {}));