@verdocs/js-sdk 4.2.1 → 4.2.2
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/index.d.mts +32 -181
- package/dist/index.d.ts +32 -181
- package/dist/index.js +5 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -33
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -856,24 +856,6 @@ interface ITemplateFieldSetting {
|
|
|
856
856
|
options?: any[];
|
|
857
857
|
[key: string]: any;
|
|
858
858
|
}
|
|
859
|
-
interface IActivityEntry {
|
|
860
|
-
id: string;
|
|
861
|
-
name: string;
|
|
862
|
-
canceled_at: string;
|
|
863
|
-
created_at: string;
|
|
864
|
-
updated_at: string;
|
|
865
|
-
profile_id: string;
|
|
866
|
-
status: TEnvelopeStatus;
|
|
867
|
-
template_id: string;
|
|
868
|
-
recipient: {
|
|
869
|
-
claimed: boolean;
|
|
870
|
-
email: string;
|
|
871
|
-
name: string;
|
|
872
|
-
profile_id: string;
|
|
873
|
-
status: TRecipientStatus;
|
|
874
|
-
type: TRecipientType;
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
859
|
type TRequestStatus = "OK" | "ERROR";
|
|
878
860
|
type TTemplateSenderType = "creator" | "organization_member" | "organization_member_as_creator" | "everyone" | "everyone_as_creator";
|
|
879
861
|
type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
|
|
@@ -1115,58 +1097,26 @@ declare class VerdocsEndpoint {
|
|
|
1115
1097
|
*/
|
|
1116
1098
|
loadSession(): VerdocsEndpoint;
|
|
1117
1099
|
}
|
|
1118
|
-
/**
|
|
1119
|
-
* One entry in an envelope search result.
|
|
1120
|
-
* NOTE: Many of the fields here are undefined unless "summary=true" is included in the search terms
|
|
1121
|
-
*/
|
|
1122
|
-
interface IEnvelopesSearchResultEntry {
|
|
1123
|
-
id: string;
|
|
1124
|
-
canceled_at: string;
|
|
1125
|
-
certificate_document_id: string;
|
|
1126
|
-
created_at: string;
|
|
1127
|
-
histories: IEnvelopeHistory[];
|
|
1128
|
-
indexed_at: string;
|
|
1129
|
-
name: string;
|
|
1130
|
-
no_contact: boolean;
|
|
1131
|
-
organization_id: string;
|
|
1132
|
-
profile_id: string;
|
|
1133
|
-
recipients: IRecipient[];
|
|
1134
|
-
reminder_id: string | null;
|
|
1135
|
-
status: TEnvelopeStatus;
|
|
1136
|
-
/** Defaults to 'private'. If set to 'shared', this envelope will be visible to other users in the same organization. Ignored for personal profiles. */
|
|
1137
|
-
visibility: "private" | "shared";
|
|
1138
|
-
next_recipient: {
|
|
1139
|
-
claimed: boolean;
|
|
1140
|
-
email: string;
|
|
1141
|
-
name: string;
|
|
1142
|
-
profile_id: string;
|
|
1143
|
-
status: TRecipientStatus;
|
|
1144
|
-
type: TRecipientType;
|
|
1145
|
-
};
|
|
1146
|
-
template_id: string;
|
|
1147
|
-
total_count: number;
|
|
1148
|
-
updated_at: string;
|
|
1149
|
-
}
|
|
1150
1100
|
interface IEnvelopesSearchResult {
|
|
1151
1101
|
page: number;
|
|
1152
1102
|
total: number;
|
|
1153
|
-
result:
|
|
1103
|
+
result: IEnvelope[];
|
|
1154
1104
|
}
|
|
1155
1105
|
interface IEnvelopesSummary {
|
|
1156
1106
|
action_required: {
|
|
1157
1107
|
page: number;
|
|
1158
1108
|
total: number;
|
|
1159
|
-
result:
|
|
1109
|
+
result: IEnvelope[];
|
|
1160
1110
|
};
|
|
1161
1111
|
completed: {
|
|
1162
1112
|
page: number;
|
|
1163
1113
|
total: number;
|
|
1164
|
-
result:
|
|
1114
|
+
result: IEnvelope[];
|
|
1165
1115
|
};
|
|
1166
1116
|
waiting_others: {
|
|
1167
1117
|
page: number;
|
|
1168
1118
|
total: number;
|
|
1169
|
-
result:
|
|
1119
|
+
result: IEnvelope[];
|
|
1170
1120
|
};
|
|
1171
1121
|
}
|
|
1172
1122
|
interface IDocumentSearchOptions {
|
|
@@ -1208,30 +1158,11 @@ interface ICreateEnvelopeRole {
|
|
|
1208
1158
|
/** A custom message to include in the email or SMS invitation. May be left blank for a default message. */
|
|
1209
1159
|
message: string;
|
|
1210
1160
|
}
|
|
1211
|
-
interface IEnvelopeSummary {
|
|
1212
|
-
id: string;
|
|
1213
|
-
profile_id: string;
|
|
1214
|
-
organization_id: string | null;
|
|
1215
|
-
name: string;
|
|
1216
|
-
status: TEnvelopeStatus;
|
|
1217
|
-
template_id: string;
|
|
1218
|
-
created_at: string;
|
|
1219
|
-
updated_at: string;
|
|
1220
|
-
canceled_at: string;
|
|
1221
|
-
envelope_document_id: string;
|
|
1222
|
-
certificate_document_id: string | null;
|
|
1223
|
-
reminder_id: string | null;
|
|
1224
|
-
no_contact: boolean;
|
|
1225
|
-
visibility: "private" | "shared";
|
|
1226
|
-
documents: IEnvelopeDocument[];
|
|
1227
|
-
recipients: IRecipient[];
|
|
1228
|
-
fields: IEnvelopeField[];
|
|
1229
|
-
}
|
|
1230
1161
|
interface IEnvelopeSummaries {
|
|
1231
1162
|
page: number;
|
|
1232
1163
|
count: number;
|
|
1233
1164
|
total: number;
|
|
1234
|
-
records:
|
|
1165
|
+
records: IEnvelope[];
|
|
1235
1166
|
}
|
|
1236
1167
|
interface IInPersonLinkResponse {
|
|
1237
1168
|
link: string;
|
|
@@ -1321,77 +1252,12 @@ declare const createEnvelope: (endpoint: VerdocsEndpoint, request: ICreateEnvelo
|
|
|
1321
1252
|
* Get a summary of currently active envelopes.
|
|
1322
1253
|
*
|
|
1323
1254
|
* ```typescript
|
|
1324
|
-
* import {
|
|
1255
|
+
* import {getEnvelopesSummary} from '@verdocs/js-sdk/Envelopes';
|
|
1325
1256
|
*
|
|
1326
|
-
* const {action_required, completed, waiting_on_others} = await
|
|
1257
|
+
* const {action_required, completed, waiting_on_others} = await getEnvelopesSummary(VerdocsEndpoint.getDefault());
|
|
1327
1258
|
* ```
|
|
1328
1259
|
*/
|
|
1329
1260
|
declare const getEnvelopesSummary: (endpoint: VerdocsEndpoint, page: number) => Promise<IEnvelopesSummary>;
|
|
1330
|
-
interface IEnvelopeSearchParams {
|
|
1331
|
-
/** The envelope must have been created via the specified template ID. */
|
|
1332
|
-
template_id?: string;
|
|
1333
|
-
/** The envelope must match one of the specified statuses. */
|
|
1334
|
-
envelope_status?: TEnvelopeStatus[];
|
|
1335
|
-
/** At least one of the recipients must match one of the specified statuses. */
|
|
1336
|
-
recipient_status?: TRecipientStatus[];
|
|
1337
|
-
/** The envelope's name (inherited from the template) must match the specified string. */
|
|
1338
|
-
envelope_name?: string;
|
|
1339
|
-
/** At least one of the envelope's recipients must match the specified name. */
|
|
1340
|
-
recipient_name?: string;
|
|
1341
|
-
/** At least one of the envelope's recipients must match the specified email address. */
|
|
1342
|
-
recipient_email?: string;
|
|
1343
|
-
/** Match against envelope_name, recipient_name, or recipient_email all at once. */
|
|
1344
|
-
name?: string;
|
|
1345
|
-
/** At least one of the envelope's recipients must match the specified ID. */
|
|
1346
|
-
recipient_id?: string;
|
|
1347
|
-
/** The date-range in which the envelope was created. Values should be specified in ISO8601 "UTC" format. */
|
|
1348
|
-
created_at?: {
|
|
1349
|
-
start_time: string;
|
|
1350
|
-
end_time: string;
|
|
1351
|
-
};
|
|
1352
|
-
/**
|
|
1353
|
-
* The date-range in which the envelope was last updated. Values should be specified in ISO8601 "UTC" format.
|
|
1354
|
-
* Note that any operations that alter the envelope are considered "updates", including status changes (cancellation),
|
|
1355
|
-
* recipient actions (opening/signing), etc.
|
|
1356
|
-
*/
|
|
1357
|
-
updated_at?: {
|
|
1358
|
-
start_time: string;
|
|
1359
|
-
end_time: string;
|
|
1360
|
-
};
|
|
1361
|
-
/** The date-range in which the envelope was canceled. Values should be specified in ISO8601 "UTC" format. */
|
|
1362
|
-
canceled_at?: {
|
|
1363
|
-
start_time: string;
|
|
1364
|
-
end_time: string;
|
|
1365
|
-
};
|
|
1366
|
-
/** Perform a "contains" search where any of the attached documents' fields contains the specified value. */
|
|
1367
|
-
text_field_value?: string;
|
|
1368
|
-
/** Set to true to retrieve only summary records (IEnvelopeSummary). */
|
|
1369
|
-
summary?: boolean;
|
|
1370
|
-
/** Set to true to retrieve only those envelopes owned by the caller. */
|
|
1371
|
-
is_owner?: boolean;
|
|
1372
|
-
/** Set to true to retrieve only those envelopes in which the caller is one of the recipients. */
|
|
1373
|
-
is_recipient?: boolean;
|
|
1374
|
-
/** Whether the recipient has "claimed" the envelope. */
|
|
1375
|
-
recipient_claimed?: boolean;
|
|
1376
|
-
/** The maximum number of records to return. Should be used in place of `row`. */
|
|
1377
|
-
limit?: number;
|
|
1378
|
-
/** The page number to return. Page numbers are 0-based. */
|
|
1379
|
-
page?: number;
|
|
1380
|
-
/** The field to sort the results by. */
|
|
1381
|
-
sort_by?: "created_at" | "updated_at" | "envelope_name" | "canceled_at" | "envelope_status";
|
|
1382
|
-
/** Whether to sort in ascending (default) or descending order. */
|
|
1383
|
-
ascending?: boolean;
|
|
1384
|
-
}
|
|
1385
|
-
/**
|
|
1386
|
-
* Search for envelopes matching various criteria.
|
|
1387
|
-
*
|
|
1388
|
-
* ```typescript
|
|
1389
|
-
* import {Envelopes} from '@verdocs/js-sdk/Envelopes';
|
|
1390
|
-
*
|
|
1391
|
-
* const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });
|
|
1392
|
-
* ```
|
|
1393
|
-
*/
|
|
1394
|
-
declare const searchEnvelopes: (endpoint: VerdocsEndpoint, params: IEnvelopeSearchParams) => Promise<IEnvelopesSearchResult>;
|
|
1395
1261
|
interface ISigningSessionResult {
|
|
1396
1262
|
recipient: IRecipient;
|
|
1397
1263
|
session: ISigningSession;
|
|
@@ -1465,52 +1331,34 @@ declare const getFieldAttachment: (endpoint: VerdocsEndpoint, envelopeId: string
|
|
|
1465
1331
|
* for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.
|
|
1466
1332
|
*/
|
|
1467
1333
|
declare const getEnvelopeDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string, page: number, type?: "original" | "filled" | "certificate") => Promise<string>;
|
|
1468
|
-
/**
|
|
1469
|
-
* Wrapper for `getEnvelope()` that limits queries to one every 2 seconds per template ID.
|
|
1470
|
-
* This is intended for use in component hierarchies that all rely on the same template
|
|
1471
|
-
* to avoid unnecessary repeat server calls.
|
|
1472
|
-
*/
|
|
1473
|
-
declare const throttledGetEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) => IEnvelope | Promise<IEnvelope>;
|
|
1474
1334
|
interface ITimeRange {
|
|
1475
1335
|
start: string;
|
|
1476
1336
|
end: string;
|
|
1477
1337
|
}
|
|
1478
|
-
// /**
|
|
1479
|
-
// * Lists all templates accessible by the caller, with optional filters.
|
|
1480
|
-
// *
|
|
1481
|
-
// * ```typescript
|
|
1482
|
-
// * import {Envelopes} from '@verdocs/js-sdk/Templates';
|
|
1483
|
-
// *
|
|
1484
|
-
// * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { name: 'test', sort: 'updated_at' });
|
|
1485
|
-
// * ```
|
|
1486
|
-
// */
|
|
1487
|
-
// export const listEnvelopes = (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) =>
|
|
1488
|
-
// endpoint.api //
|
|
1489
|
-
// .post<IEnvelopeSummaries>('/envelopes/list', params, {baseURL: endpoint.getBaseURLv2()})
|
|
1490
|
-
// .then((r) => r.data);
|
|
1491
1338
|
interface IListEnvelopesParams {
|
|
1492
|
-
view?: "inbox" | "sent" | "action" | "waiting" | "completed";
|
|
1493
1339
|
q?: string;
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1340
|
+
view?: "inbox" | "sent" | "action" | "waiting" | "completed";
|
|
1341
|
+
status?: ("complete" | "pending" | "in progress" | "declined" | "canceled")[];
|
|
1342
|
+
include_org?: boolean;
|
|
1497
1343
|
template_id?: string;
|
|
1344
|
+
created_before?: string;
|
|
1345
|
+
created_after?: string;
|
|
1498
1346
|
sort_by?: "name" | "created_at" | "updated_at" | "canceled_at" | "status";
|
|
1499
1347
|
ascending?: boolean;
|
|
1500
1348
|
rows?: number;
|
|
1501
1349
|
page?: number;
|
|
1502
1350
|
}
|
|
1503
|
-
/**
|
|
1351
|
+
/**
|
|
1504
1352
|
* Lists all envelopes accessible by the caller, with optional filters.
|
|
1505
1353
|
*
|
|
1506
1354
|
* ```typescript
|
|
1507
|
-
* import {
|
|
1355
|
+
* import {getEnvelopes} from '@verdocs/js-sdk/Envelopes';
|
|
1508
1356
|
*
|
|
1509
|
-
* const {
|
|
1357
|
+
* const {count, envelopes} = await getEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test' });
|
|
1510
1358
|
* ```
|
|
1511
1359
|
*/
|
|
1512
1360
|
declare const getEnvelopes: (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) => Promise<{
|
|
1513
|
-
|
|
1361
|
+
count: number;
|
|
1514
1362
|
rows: number;
|
|
1515
1363
|
page: number;
|
|
1516
1364
|
envelopes: IEnvelope[];
|
|
@@ -1575,8 +1423,11 @@ interface IRecipientKbaChallengeRequired {
|
|
|
1575
1423
|
kba_required: true;
|
|
1576
1424
|
kba_completed: false;
|
|
1577
1425
|
kba_method: "challenge";
|
|
1578
|
-
|
|
1579
|
-
|
|
1426
|
+
challenges: {
|
|
1427
|
+
type: string;
|
|
1428
|
+
message: string;
|
|
1429
|
+
options: string[];
|
|
1430
|
+
}[];
|
|
1580
1431
|
}
|
|
1581
1432
|
/**
|
|
1582
1433
|
* Identity verification has failed. The user should be shown the message included. No further
|
|
@@ -1588,7 +1439,7 @@ interface IRecipientKbaStatusFailed {
|
|
|
1588
1439
|
kba_required: true;
|
|
1589
1440
|
kba_completed: false;
|
|
1590
1441
|
kba_method: "failed";
|
|
1591
|
-
|
|
1442
|
+
message: string;
|
|
1592
1443
|
}
|
|
1593
1444
|
type TRecipientKbaStatus = IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed;
|
|
1594
1445
|
/**
|
|
@@ -1691,27 +1542,27 @@ declare const deleteEnvelopeReminder: (endpoint: VerdocsEndpoint, envelopeId: st
|
|
|
1691
1542
|
/**
|
|
1692
1543
|
* Check to see if the user owns the envelope.
|
|
1693
1544
|
*/
|
|
1694
|
-
declare const userIsEnvelopeOwner: (profile: IProfile | null | undefined, envelope: IEnvelope
|
|
1545
|
+
declare const userIsEnvelopeOwner: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
|
|
1695
1546
|
/**
|
|
1696
1547
|
* Check to see if the user owns the envelope.
|
|
1697
1548
|
*/
|
|
1698
|
-
declare const userIsEnvelopeRecipient: (profile: IProfile | null | undefined, envelope: IEnvelope
|
|
1549
|
+
declare const userIsEnvelopeRecipient: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
|
|
1699
1550
|
/**
|
|
1700
1551
|
* Check to see if the envelope has pending actions.
|
|
1701
1552
|
*/
|
|
1702
|
-
declare const envelopeIsActive: (envelope: IEnvelope
|
|
1553
|
+
declare const envelopeIsActive: (envelope: IEnvelope) => boolean;
|
|
1703
1554
|
/**
|
|
1704
1555
|
* Check to see if the envelope has been completed.
|
|
1705
1556
|
*/
|
|
1706
|
-
declare const envelopeIsComplete: (envelope: IEnvelope
|
|
1557
|
+
declare const envelopeIsComplete: (envelope: IEnvelope) => boolean;
|
|
1707
1558
|
/**
|
|
1708
1559
|
* Check to see if the user owns the envelope.
|
|
1709
1560
|
*/
|
|
1710
|
-
declare const userCanCancelEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope
|
|
1561
|
+
declare const userCanCancelEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
|
|
1711
1562
|
/**
|
|
1712
1563
|
* Check to see if the user owns the envelope.
|
|
1713
1564
|
*/
|
|
1714
|
-
declare const userCanFinishEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope
|
|
1565
|
+
declare const userCanFinishEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
|
|
1715
1566
|
/**
|
|
1716
1567
|
* Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
|
|
1717
1568
|
*/
|
|
@@ -1719,7 +1570,7 @@ declare const recipientHasAction: (recipient: IRecipient) => boolean;
|
|
|
1719
1570
|
/**
|
|
1720
1571
|
* Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).
|
|
1721
1572
|
*/
|
|
1722
|
-
declare const getRecipientsWithActions: (envelope: IEnvelope
|
|
1573
|
+
declare const getRecipientsWithActions: (envelope: IEnvelope) => IRecipient[];
|
|
1723
1574
|
/**
|
|
1724
1575
|
* Returns true if the recipient can act.
|
|
1725
1576
|
*/
|
|
@@ -1731,8 +1582,8 @@ declare const userCanAct: (email: string, recipientsWithActions: IRecipient[]) =
|
|
|
1731
1582
|
/**
|
|
1732
1583
|
* Returns true if the user can act.
|
|
1733
1584
|
*/
|
|
1734
|
-
declare const userCanSignNow: (profile: IProfile | null | undefined, envelope: IEnvelope
|
|
1735
|
-
declare const getNextRecipient: (envelope: IEnvelope
|
|
1585
|
+
declare const userCanSignNow: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean | undefined;
|
|
1586
|
+
declare const getNextRecipient: (envelope: IEnvelope) => IRecipient;
|
|
1736
1587
|
/**
|
|
1737
1588
|
* Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
|
|
1738
1589
|
* a signature block to be used for all signature fields in the document. Thus, this is typically called one time to
|
|
@@ -2914,4 +2765,4 @@ declare const isValidEmail: (email: string | undefined) => boolean;
|
|
|
2914
2765
|
declare const isValidPhone: (phone: string | undefined) => boolean;
|
|
2915
2766
|
declare const isValidRoleName: (value: string, roles: IRole[]) => boolean;
|
|
2916
2767
|
declare const isValidTag: (value: string, tags: string[]) => boolean;
|
|
2917
|
-
export { TRequestStatus, TTemplateSenderType, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting,
|
|
2768
|
+
export { TRequestStatus, TTemplateSenderType, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, ISigningSessionResult, getSigningSession, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStatusNotRequired, IRecipientKbaStatusComplete, IRecipientKbaStatusPinRequired, IRecipientKbaStatusIdentityRequired, IRecipientKbaChallengeRequired, IRecipientKbaStatusFailed, TRecipientKbaStatus, getKbaStatus, submitKbaPin, IKbaIdentity, submitKbaIdentity, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, updateOrganization, updateOrganizationLogo, updateOrganizationThumbnail, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, TTemplatePermissionCreatePublic, TTemplatePermissionCreateOrg, TTemplatePermissionCreatePersonal, TTemplatePermissionDelete, TTemplatePermissionVisibility, TTemplateMemberRead, TTemplateMemberWrite, TTemplateMemberDelete, TTemplateMemberVisibility, TTemplatePermission, TAccountPermissionOwnerAdd, TAccountPermissionOwnerRemove, TAccountPermissionAdminAdd, TAccountPermissionAdminRemove, TAccountPermissionMemberView, TAccountPermissionMemberAdd, TAccountPermissionMemberRemove, TAccountPermission, TOrgPermissionCreate, TOrgPermissionView, TOrgPermissionUpdate, TOrgPermissionDelete, TOrgPermissionTransfer, TOrgPermissionList, TOrgPermission, TEnvelopePermissionCreate, TEnvelopePermissionCancel, TEnvelopePermissionView, TEnvelopePermissionOrg, TEnvelopePermission, TPermission, TRole, RolePermissions, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, ICreateTemplateReminderRequest, createTemplateReminder, getTemplateReminder, updateTemplateReminder, deleteTemplateReminder, createTemplateRole, getTemplateRoles, getTemplateRole, updateTemplateRole, deleteTemplateRole, getTemplateRoleFields, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, IGetTemplatesParams, getTemplates, getTemplate, getTemplateOwnerInfo, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, createTemplatev2, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, searchTemplates, ISearchTimeRange, IGetTemplateSummarySortBy, IGetTemplateSummaryParams, getTemplatesSummary, throttledGetTemplate, ITemplateListParams, listTemplates, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateSummary, ITemplateSearchParams, ITemplateSummaries, ITemplateTag, ITag, IStar, ITemplateOwnerInfo, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, verifyEmail, resendVerification, getNotifications, getProfiles, getCurrentProfile, getProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, IUpdateProfileRequest, IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse, ICreateAccountRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, timePeriod, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry, ITimePeriod };
|
package/dist/index.js
CHANGED
|
@@ -1414,26 +1414,14 @@ const createEnvelope = async (endpoint, request) => endpoint.api //
|
|
|
1414
1414
|
* Get a summary of currently active envelopes.
|
|
1415
1415
|
*
|
|
1416
1416
|
* ```typescript
|
|
1417
|
-
* import {
|
|
1417
|
+
* import {getEnvelopesSummary} from '@verdocs/js-sdk/Envelopes';
|
|
1418
1418
|
*
|
|
1419
|
-
* const {action_required, completed, waiting_on_others} = await
|
|
1419
|
+
* const {action_required, completed, waiting_on_others} = await getEnvelopesSummary(VerdocsEndpoint.getDefault());
|
|
1420
1420
|
* ```
|
|
1421
1421
|
*/
|
|
1422
1422
|
const getEnvelopesSummary = async (endpoint, page) => endpoint.api //
|
|
1423
1423
|
.post('/envelopes/summary', { page })
|
|
1424
1424
|
.then((r) => r.data);
|
|
1425
|
-
/**
|
|
1426
|
-
* Search for envelopes matching various criteria.
|
|
1427
|
-
*
|
|
1428
|
-
* ```typescript
|
|
1429
|
-
* import {Envelopes} from '@verdocs/js-sdk/Envelopes';
|
|
1430
|
-
*
|
|
1431
|
-
* const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });
|
|
1432
|
-
* ```
|
|
1433
|
-
*/
|
|
1434
|
-
const searchEnvelopes = async (endpoint, params) => endpoint.api //
|
|
1435
|
-
.post('/envelopes/search', params)
|
|
1436
|
-
.then((r) => r.data);
|
|
1437
1425
|
/**
|
|
1438
1426
|
* Get a signing session for an Envelope.
|
|
1439
1427
|
*/
|
|
@@ -1575,32 +1563,17 @@ const getFieldAttachment = async (endpoint, envelopeId, fieldName) => endpoint.a
|
|
|
1575
1563
|
const getEnvelopeDocumentPageDisplayUri = async (endpoint, envelopeId, documentId, page, type = 'original') => endpoint.api
|
|
1576
1564
|
.get(`/envelopes/${envelopeId}/envelope_documents/${documentId}/pages/${page}/image?type=${type}`, { timeout: 20000 })
|
|
1577
1565
|
.then((r) => r.data);
|
|
1578
|
-
const cachedEnvelopes = {};
|
|
1579
1566
|
/**
|
|
1580
|
-
* Wrapper for `getEnvelope()` that limits queries to one every 2 seconds per template ID.
|
|
1581
|
-
* This is intended for use in component hierarchies that all rely on the same template
|
|
1582
|
-
* to avoid unnecessary repeat server calls.
|
|
1583
|
-
*/
|
|
1584
|
-
const throttledGetEnvelope = (endpoint, envelopeId) => {
|
|
1585
|
-
if (cachedEnvelopes[envelopeId] && cachedEnvelopes[envelopeId].loaded + 2000 < new Date().getTime()) {
|
|
1586
|
-
return cachedEnvelopes[envelopeId].envelope;
|
|
1587
|
-
}
|
|
1588
|
-
return getEnvelope(endpoint, envelopeId).then((envelope) => {
|
|
1589
|
-
cachedEnvelopes[envelopeId] = { loaded: new Date().getTime(), envelope };
|
|
1590
|
-
return envelope;
|
|
1591
|
-
});
|
|
1592
|
-
};
|
|
1593
|
-
/**a
|
|
1594
1567
|
* Lists all envelopes accessible by the caller, with optional filters.
|
|
1595
1568
|
*
|
|
1596
1569
|
* ```typescript
|
|
1597
|
-
* import {
|
|
1570
|
+
* import {getEnvelopes} from '@verdocs/js-sdk/Envelopes';
|
|
1598
1571
|
*
|
|
1599
|
-
* const {
|
|
1572
|
+
* const {count, envelopes} = await getEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test' });
|
|
1600
1573
|
* ```
|
|
1601
1574
|
*/
|
|
1602
1575
|
const getEnvelopes = (endpoint, params) => endpoint.api //
|
|
1603
|
-
.
|
|
1576
|
+
.get('/envelopes', { params })
|
|
1604
1577
|
.then((r) => r.data);
|
|
1605
1578
|
|
|
1606
1579
|
/**
|
|
@@ -3089,7 +3062,6 @@ exports.resendOrganizationInvitation = resendOrganizationInvitation;
|
|
|
3089
3062
|
exports.resendVerification = resendVerification;
|
|
3090
3063
|
exports.resetPassword = resetPassword;
|
|
3091
3064
|
exports.rotateApiKey = rotateApiKey;
|
|
3092
|
-
exports.searchEnvelopes = searchEnvelopes;
|
|
3093
3065
|
exports.searchTemplates = searchTemplates;
|
|
3094
3066
|
exports.sendDelegate = sendDelegate;
|
|
3095
3067
|
exports.setWebhooks = setWebhooks;
|
|
@@ -3097,7 +3069,6 @@ exports.submitKbaChallengeResponse = submitKbaChallengeResponse;
|
|
|
3097
3069
|
exports.submitKbaIdentity = submitKbaIdentity;
|
|
3098
3070
|
exports.submitKbaPin = submitKbaPin;
|
|
3099
3071
|
exports.switchProfile = switchProfile;
|
|
3100
|
-
exports.throttledGetEnvelope = throttledGetEnvelope;
|
|
3101
3072
|
exports.throttledGetTemplate = throttledGetTemplate;
|
|
3102
3073
|
exports.timePeriod = timePeriod;
|
|
3103
3074
|
exports.toggleStar = toggleStar;
|