@verdocs/js-sdk 4.1.14 → 4.1.15

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 CHANGED
@@ -851,6 +851,10 @@ interface ICreateEnvelopeRequest {
851
851
  }[];
852
852
  }
853
853
  type TEnvelopePermission = "envelope:create" | "envelope:cancel" | "envelope:view";
854
+ /**
855
+ * Confirm whether the user has all of the specified permissions.
856
+ */
857
+ declare const userHasPermissions: (profile: IProfile | null | undefined, permissions: TPermission[]) => boolean;
854
858
  interface ISigningSessionRequest {
855
859
  envelopeId: string;
856
860
  roleId: string;
@@ -878,16 +882,15 @@ interface ISigningSession {
878
882
  * A User Session connects a caller to a Verdocs profile, and can be used for any operations that profile may perform.
879
883
  */
880
884
  interface IUserSession {
885
+ aud: string;
886
+ iss: string;
881
887
  sub: string;
882
888
  email: string;
883
889
  email_verified: boolean;
884
890
  iat: number;
885
891
  exp: number;
886
- profile_id: string;
887
- organization_id: string;
888
- permissions: TPermission[];
889
- roles: TRole[];
890
- profile: IProfile;
892
+ "https://verdocs.com/profile_id": string;
893
+ "https://verdocs.com/organization_id": string;
891
894
  }
892
895
  /**
893
896
  * Verdocs supports two types of authenticated sessions: User and Signing. Both behave similarly and have similar
@@ -902,10 +905,6 @@ type TSession = IUserSession | ISigningSession | null;
902
905
  * An active authenticated session within Verdocs, either for signing or regular user-based operations.
903
906
  */
904
907
  type TActiveSession = IUserSession | ISigningSession;
905
- /**
906
- * Confirm whether the user has all of the specified permissions.
907
- */
908
- declare const userHasPermissions: (session: TSession, permissions: TPermission[]) => boolean;
909
908
  type TEnvironment = "verdocs" | "verdocs-stage";
910
909
  type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession) => void;
911
910
  interface VerdocsEndpointOptions {
@@ -1535,11 +1534,11 @@ declare const deleteEnvelopeReminder: (endpoint: VerdocsEndpoint, envelopeId: st
1535
1534
  /**
1536
1535
  * Check to see if the user owns the envelope.
1537
1536
  */
1538
- declare const userIsEnvelopeOwner: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1537
+ declare const userIsEnvelopeOwner: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1539
1538
  /**
1540
1539
  * Check to see if the user owns the envelope.
1541
1540
  */
1542
- declare const userIsEnvelopeRecipient: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1541
+ declare const userIsEnvelopeRecipient: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1543
1542
  /**
1544
1543
  * Check to see if the envelope has pending actions.
1545
1544
  */
@@ -1551,11 +1550,11 @@ declare const envelopeIsComplete: (envelope: IEnvelope | IEnvelopeSummary) => bo
1551
1550
  /**
1552
1551
  * Check to see if the user owns the envelope.
1553
1552
  */
1554
- declare const userCanCancelEnvelope: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1553
+ declare const userCanCancelEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1555
1554
  /**
1556
1555
  * Check to see if the user owns the envelope.
1557
1556
  */
1558
- declare const userCanFinishEnvelope: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1557
+ declare const userCanFinishEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1559
1558
  /**
1560
1559
  * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
1561
1560
  */
@@ -1575,7 +1574,7 @@ declare const userCanAct: (email: string, recipientsWithActions: IRecipient[]) =
1575
1574
  /**
1576
1575
  * Returns true if the user can act.
1577
1576
  */
1578
- declare const userCanSignNow: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean | undefined;
1577
+ declare const userCanSignNow: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean | undefined;
1579
1578
  declare const getNextRecipient: (envelope: IEnvelope | IEnvelopeSummary) => IRecipient;
1580
1579
  /**
1581
1580
  * Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
@@ -1666,9 +1665,9 @@ interface ISetWebhookRequest {
1666
1665
  * Get a list of keys for a given organization. The caller must have admin access to the organization.
1667
1666
  *
1668
1667
  * ```typescript
1669
- * import {ApiKeys} from '@verdocs/js-sdk';
1668
+ * import {getApiKeys} from '@verdocs/js-sdk';
1670
1669
  *
1671
- * const keys = await ApiKeys.getKeys(ORGID);
1670
+ * const keys = await getApiKeys(ORGID);
1672
1671
  * ```
1673
1672
  */
1674
1673
  declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
@@ -1676,9 +1675,9 @@ declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
1676
1675
  * Create an API key.
1677
1676
  *
1678
1677
  * ```typescript
1679
- * import {ApiKeys} from '@verdocs/js-sdk';
1678
+ * import {createApiKey} from '@verdocs/js-sdk';
1680
1679
  *
1681
- * await ApiKeys.createKey(ORGID, {name: NEWNAME});
1680
+ * await createApiKey(ORGID, {name: NEWNAME});
1682
1681
  * ```
1683
1682
  */
1684
1683
  declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyRequest) => Promise<IApiKey>;
@@ -1686,9 +1685,9 @@ declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyReq
1686
1685
  * Rotate the secret for an API key. The caller must have admin access to the organization.
1687
1686
  *
1688
1687
  * ```typescript
1689
- * import {ApiKeys} from '@verdocs/js-sdk';
1688
+ * import {rotateApiKey} from '@verdocs/js-sdk';
1690
1689
  *
1691
- * const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
1690
+ * const {client_secret: newSecret} = await rotateApiKey(ORGID, CLIENTID);
1692
1691
  * ```
1693
1692
  */
1694
1693
  declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<IApiKey>;
@@ -1696,9 +1695,9 @@ declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Pro
1696
1695
  * Update an API key to change its assigned Profile ID or Name.
1697
1696
  *
1698
1697
  * ```typescript
1699
- * import {ApiKeys} from '@verdocs/js-sdk';
1698
+ * import {updateApiKey} from '@verdocs/js-sdk';
1700
1699
  *
1701
- * await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
1700
+ * await updateApiKey(ORGID, CLIENTID, {name: NEWNAME});
1702
1701
  * ```
1703
1702
  */
1704
1703
  declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params: IUpdateApiKeyRequest) => Promise<IApiKey>;
@@ -1706,9 +1705,9 @@ declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params
1706
1705
  * Delete an API key.
1707
1706
  *
1708
1707
  * ```typescript
1709
- * import {ApiKeys} from '@verdocs/js-sdk';
1708
+ * import {deleteApiKey} from '@verdocs/js-sdk';
1710
1709
  *
1711
- * await ApiKeys.deleteKey(ORGID, CLIENTID);
1710
+ * await deleteApiKey(ORGID, CLIENTID);
1712
1711
  * ```
1713
1712
  */
1714
1713
  declare const deleteApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<any>;
@@ -2043,15 +2042,33 @@ declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email:
2043
2042
  */
2044
2043
  /**
2045
2044
  * Get a list of the members in the caller's organization.
2045
+ *
2046
+ * ```typescript
2047
+ * import {getOrganizationMembers} from '@verdocs/js-sdk';
2048
+ *
2049
+ * const members = await deleteOrganizationMember(VerdocsEndpoint.getDefault()});
2050
+ * ```
2046
2051
  */
2047
2052
  declare const getOrganizationMembers: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
2048
2053
  /**
2049
2054
  * Delete a member from the caller's organization. Note that the caller must be an admin or owner,
2050
- * may not delete him/herself
2055
+ * may not delete him/herself.
2056
+ *
2057
+ * ```typescript
2058
+ * import {deleteOrganizationMember} from '@verdocs/js-sdk';
2059
+ *
2060
+ * await deleteOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID'});
2061
+ * ```
2051
2062
  */
2052
2063
  declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
2053
2064
  /**
2054
2065
  * Update a member.
2066
+ *
2067
+ * ```typescript
2068
+ * import {updateOrganizationMember} from '@verdocs/js-sdk';
2069
+ *
2070
+ * const result = await updateOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID', {roles:['member']});
2071
+ * ```
2055
2072
  */
2056
2073
  declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, "roles" | "first_name" | "last_name">) => Promise<any>;
2057
2074
  /**
@@ -2096,11 +2113,25 @@ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId
2096
2113
  */
2097
2114
  declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2098
2115
  /**
2099
- * Get the registered Webhooks for the caller's organization.
2116
+ * Get the registered Webhook configuration for the caller's organization.
2117
+ *
2118
+ * ```typescript
2119
+ * import {getWebhooks} from '@verdocs/js-sdk';
2120
+ *
2121
+ * await getWebhooks(ORGID, params);
2122
+ * ```
2100
2123
  */
2101
2124
  declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2102
2125
  /**
2103
- * Update the registered Webhooks for the caller's organization.
2126
+ * Update the registered Webhook configuration for the caller's organization. Note that
2127
+ * Webhooks cannot currently be deleted, but may be easily disabled by setting `active`
2128
+ * to `false` and/or setting the `url` to an empty string.
2129
+ *
2130
+ * ```typescript
2131
+ * import {setWebhooks} from '@verdocs/js-sdk';
2132
+ *
2133
+ * await setWebhooks(ORGID, params);
2134
+ * ```
2104
2135
  */
2105
2136
  declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
2106
2137
  /**
@@ -2284,11 +2315,11 @@ interface ITemplateSearchResult {
2284
2315
  total: number;
2285
2316
  result: ITemplate[];
2286
2317
  }
2287
- declare const canPerformTemplateAction: (session: TSession, action: TTemplateAction, template?: ITemplate | ITemplateSummary) => {
2318
+ declare const canPerformTemplateAction: (profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate | ITemplateSummary) => {
2288
2319
  canPerform: boolean;
2289
2320
  message: string;
2290
2321
  };
2291
- declare const hasRequiredPermissions: (session: TSession, permissions: string[]) => boolean;
2322
+ declare const hasRequiredPermissions: (profile: IProfile | null | undefined, permissions: TPermission[]) => boolean;
2292
2323
  /**
2293
2324
  * Add a field to a template.
2294
2325
  */
@@ -2304,70 +2335,70 @@ declare const deleteField: (endpoint: VerdocsEndpoint, templateId: string, field
2304
2335
  /**
2305
2336
  * Check to see if the user created the template.
2306
2337
  */
2307
- declare const userIsTemplateCreator: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2338
+ declare const userIsTemplateCreator: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2308
2339
  /**
2309
2340
  * Check to see if a template is "shared" with the user.
2310
2341
  */
2311
- declare const userHasSharedTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2342
+ declare const userHasSharedTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2312
2343
  /**
2313
2344
  * Check to see if the user can create a personal/private template.
2314
2345
  */
2315
- declare const userCanCreatePersonalTemplate: (session: TSession) => boolean;
2346
+ declare const userCanCreatePersonalTemplate: (profile: IProfile) => boolean;
2316
2347
  /**
2317
2348
  * Check to see if the user can create an org-shared template.
2318
2349
  */
2319
- declare const userCanCreateOrgTemplate: (session: TSession) => boolean;
2350
+ declare const userCanCreateOrgTemplate: (profile: IProfile) => boolean;
2320
2351
  /**
2321
2352
  * Check to see if the user can create a public template.
2322
2353
  */
2323
- declare const userCanCreatePublicTemplate: (session: TSession) => boolean;
2354
+ declare const userCanCreatePublicTemplate: (profile: IProfile) => boolean;
2324
2355
  /**
2325
2356
  * Check to see if the user can read/view a template.
2326
2357
  */
2327
- declare const userCanReadTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2358
+ declare const userCanReadTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2328
2359
  /**
2329
2360
  * Check to see if the user can update a tempate.
2330
2361
  */
2331
- declare const userCanUpdateTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2362
+ declare const userCanUpdateTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2332
2363
  /**
2333
2364
  * Check to see if the user can change whether a template is personal vs org-shared.
2334
2365
  */
2335
- declare const userCanMakeTemplatePrivate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2366
+ declare const userCanMakeTemplatePrivate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2336
2367
  /**
2337
2368
  * Check to see if the user can change whether a template is personal vs org-shared.
2338
2369
  */
2339
- declare const userCanMakeTemplateShared: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2370
+ declare const userCanMakeTemplateShared: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2340
2371
  /**
2341
2372
  * Check to see if the user can change whether a template is personal vs org-shared.
2342
2373
  */
2343
- declare const userCanMakeTemplatePublic: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2374
+ declare const userCanMakeTemplatePublic: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2344
2375
  /**
2345
2376
  * Check to see if the user can change whether a template is personal vs org-shared.
2346
2377
  */
2347
- declare const userCanChangeOrgVisibility: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2378
+ declare const userCanChangeOrgVisibility: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2348
2379
  /**
2349
2380
  * Check to see if the user can change whether a template is personal vs org-shared.
2350
2381
  */
2351
- declare const userCanDeleteTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2382
+ declare const userCanDeleteTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2352
2383
  /**
2353
2384
  * Confirm whether the user can create an envelope using the specified template.
2354
2385
  */
2355
- declare const userCanSendTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2386
+ declare const userCanSendTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2356
2387
  /**
2357
2388
  * Confirm whether the user can create a new template.
2358
2389
  */
2359
- declare const userCanCreateTemplate: (session: TSession) => boolean;
2390
+ declare const userCanCreateTemplate: (profile: IProfile) => boolean;
2360
2391
  /**
2361
2392
  * Check to see if the user can "build" the template (use the field builder). The user must have write access to the
2362
2393
  * template, and the template must have at least one signer role.
2363
2394
  */
2364
- declare const userCanBuildTemplate: (session: TSession, template: ITemplate) => boolean | null;
2395
+ declare const userCanBuildTemplate: (profile: IProfile | null | undefined, template: ITemplate) => boolean | null | undefined;
2365
2396
  declare const getFieldsForRole: (template: ITemplate, role_name: string) => ITemplateField[];
2366
2397
  /**
2367
2398
  * Check to see if the user can preview the template. The user must have read access to the template, the template must
2368
2399
  * have at least one signer, and every signer must have at least one field.
2369
2400
  */
2370
- declare const userCanPreviewTemplate: (session: TSession, template: ITemplate) => boolean | null;
2401
+ declare const userCanPreviewTemplate: (profile: IProfile | null | undefined, template: ITemplate) => boolean | null | undefined;
2371
2402
  interface ICreateTemplateReminderRequest {
2372
2403
  setup_time: number;
2373
2404
  interval_time: number;
package/dist/index.d.ts CHANGED
@@ -851,6 +851,10 @@ interface ICreateEnvelopeRequest {
851
851
  }[];
852
852
  }
853
853
  type TEnvelopePermission = "envelope:create" | "envelope:cancel" | "envelope:view";
854
+ /**
855
+ * Confirm whether the user has all of the specified permissions.
856
+ */
857
+ declare const userHasPermissions: (profile: IProfile | null | undefined, permissions: TPermission[]) => boolean;
854
858
  interface ISigningSessionRequest {
855
859
  envelopeId: string;
856
860
  roleId: string;
@@ -878,16 +882,15 @@ interface ISigningSession {
878
882
  * A User Session connects a caller to a Verdocs profile, and can be used for any operations that profile may perform.
879
883
  */
880
884
  interface IUserSession {
885
+ aud: string;
886
+ iss: string;
881
887
  sub: string;
882
888
  email: string;
883
889
  email_verified: boolean;
884
890
  iat: number;
885
891
  exp: number;
886
- profile_id: string;
887
- organization_id: string;
888
- permissions: TPermission[];
889
- roles: TRole[];
890
- profile: IProfile;
892
+ "https://verdocs.com/profile_id": string;
893
+ "https://verdocs.com/organization_id": string;
891
894
  }
892
895
  /**
893
896
  * Verdocs supports two types of authenticated sessions: User and Signing. Both behave similarly and have similar
@@ -902,10 +905,6 @@ type TSession = IUserSession | ISigningSession | null;
902
905
  * An active authenticated session within Verdocs, either for signing or regular user-based operations.
903
906
  */
904
907
  type TActiveSession = IUserSession | ISigningSession;
905
- /**
906
- * Confirm whether the user has all of the specified permissions.
907
- */
908
- declare const userHasPermissions: (session: TSession, permissions: TPermission[]) => boolean;
909
908
  type TEnvironment = "verdocs" | "verdocs-stage";
910
909
  type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession) => void;
911
910
  interface VerdocsEndpointOptions {
@@ -1535,11 +1534,11 @@ declare const deleteEnvelopeReminder: (endpoint: VerdocsEndpoint, envelopeId: st
1535
1534
  /**
1536
1535
  * Check to see if the user owns the envelope.
1537
1536
  */
1538
- declare const userIsEnvelopeOwner: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1537
+ declare const userIsEnvelopeOwner: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1539
1538
  /**
1540
1539
  * Check to see if the user owns the envelope.
1541
1540
  */
1542
- declare const userIsEnvelopeRecipient: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1541
+ declare const userIsEnvelopeRecipient: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1543
1542
  /**
1544
1543
  * Check to see if the envelope has pending actions.
1545
1544
  */
@@ -1551,11 +1550,11 @@ declare const envelopeIsComplete: (envelope: IEnvelope | IEnvelopeSummary) => bo
1551
1550
  /**
1552
1551
  * Check to see if the user owns the envelope.
1553
1552
  */
1554
- declare const userCanCancelEnvelope: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1553
+ declare const userCanCancelEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1555
1554
  /**
1556
1555
  * Check to see if the user owns the envelope.
1557
1556
  */
1558
- declare const userCanFinishEnvelope: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1557
+ declare const userCanFinishEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean;
1559
1558
  /**
1560
1559
  * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
1561
1560
  */
@@ -1575,7 +1574,7 @@ declare const userCanAct: (email: string, recipientsWithActions: IRecipient[]) =
1575
1574
  /**
1576
1575
  * Returns true if the user can act.
1577
1576
  */
1578
- declare const userCanSignNow: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean | undefined;
1577
+ declare const userCanSignNow: (profile: IProfile | null | undefined, envelope: IEnvelope | IEnvelopeSummary) => boolean | undefined;
1579
1578
  declare const getNextRecipient: (envelope: IEnvelope | IEnvelopeSummary) => IRecipient;
1580
1579
  /**
1581
1580
  * Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
@@ -1666,9 +1665,9 @@ interface ISetWebhookRequest {
1666
1665
  * Get a list of keys for a given organization. The caller must have admin access to the organization.
1667
1666
  *
1668
1667
  * ```typescript
1669
- * import {ApiKeys} from '@verdocs/js-sdk';
1668
+ * import {getApiKeys} from '@verdocs/js-sdk';
1670
1669
  *
1671
- * const keys = await ApiKeys.getKeys(ORGID);
1670
+ * const keys = await getApiKeys(ORGID);
1672
1671
  * ```
1673
1672
  */
1674
1673
  declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
@@ -1676,9 +1675,9 @@ declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
1676
1675
  * Create an API key.
1677
1676
  *
1678
1677
  * ```typescript
1679
- * import {ApiKeys} from '@verdocs/js-sdk';
1678
+ * import {createApiKey} from '@verdocs/js-sdk';
1680
1679
  *
1681
- * await ApiKeys.createKey(ORGID, {name: NEWNAME});
1680
+ * await createApiKey(ORGID, {name: NEWNAME});
1682
1681
  * ```
1683
1682
  */
1684
1683
  declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyRequest) => Promise<IApiKey>;
@@ -1686,9 +1685,9 @@ declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyReq
1686
1685
  * Rotate the secret for an API key. The caller must have admin access to the organization.
1687
1686
  *
1688
1687
  * ```typescript
1689
- * import {ApiKeys} from '@verdocs/js-sdk';
1688
+ * import {rotateApiKey} from '@verdocs/js-sdk';
1690
1689
  *
1691
- * const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
1690
+ * const {client_secret: newSecret} = await rotateApiKey(ORGID, CLIENTID);
1692
1691
  * ```
1693
1692
  */
1694
1693
  declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<IApiKey>;
@@ -1696,9 +1695,9 @@ declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Pro
1696
1695
  * Update an API key to change its assigned Profile ID or Name.
1697
1696
  *
1698
1697
  * ```typescript
1699
- * import {ApiKeys} from '@verdocs/js-sdk';
1698
+ * import {updateApiKey} from '@verdocs/js-sdk';
1700
1699
  *
1701
- * await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
1700
+ * await updateApiKey(ORGID, CLIENTID, {name: NEWNAME});
1702
1701
  * ```
1703
1702
  */
1704
1703
  declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params: IUpdateApiKeyRequest) => Promise<IApiKey>;
@@ -1706,9 +1705,9 @@ declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params
1706
1705
  * Delete an API key.
1707
1706
  *
1708
1707
  * ```typescript
1709
- * import {ApiKeys} from '@verdocs/js-sdk';
1708
+ * import {deleteApiKey} from '@verdocs/js-sdk';
1710
1709
  *
1711
- * await ApiKeys.deleteKey(ORGID, CLIENTID);
1710
+ * await deleteApiKey(ORGID, CLIENTID);
1712
1711
  * ```
1713
1712
  */
1714
1713
  declare const deleteApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<any>;
@@ -2043,15 +2042,33 @@ declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email:
2043
2042
  */
2044
2043
  /**
2045
2044
  * Get a list of the members in the caller's organization.
2045
+ *
2046
+ * ```typescript
2047
+ * import {getOrganizationMembers} from '@verdocs/js-sdk';
2048
+ *
2049
+ * const members = await deleteOrganizationMember(VerdocsEndpoint.getDefault()});
2050
+ * ```
2046
2051
  */
2047
2052
  declare const getOrganizationMembers: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
2048
2053
  /**
2049
2054
  * Delete a member from the caller's organization. Note that the caller must be an admin or owner,
2050
- * may not delete him/herself
2055
+ * may not delete him/herself.
2056
+ *
2057
+ * ```typescript
2058
+ * import {deleteOrganizationMember} from '@verdocs/js-sdk';
2059
+ *
2060
+ * await deleteOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID'});
2061
+ * ```
2051
2062
  */
2052
2063
  declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
2053
2064
  /**
2054
2065
  * Update a member.
2066
+ *
2067
+ * ```typescript
2068
+ * import {updateOrganizationMember} from '@verdocs/js-sdk';
2069
+ *
2070
+ * const result = await updateOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID', {roles:['member']});
2071
+ * ```
2055
2072
  */
2056
2073
  declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, "roles" | "first_name" | "last_name">) => Promise<any>;
2057
2074
  /**
@@ -2096,11 +2113,25 @@ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId
2096
2113
  */
2097
2114
  declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2098
2115
  /**
2099
- * Get the registered Webhooks for the caller's organization.
2116
+ * Get the registered Webhook configuration for the caller's organization.
2117
+ *
2118
+ * ```typescript
2119
+ * import {getWebhooks} from '@verdocs/js-sdk';
2120
+ *
2121
+ * await getWebhooks(ORGID, params);
2122
+ * ```
2100
2123
  */
2101
2124
  declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2102
2125
  /**
2103
- * Update the registered Webhooks for the caller's organization.
2126
+ * Update the registered Webhook configuration for the caller's organization. Note that
2127
+ * Webhooks cannot currently be deleted, but may be easily disabled by setting `active`
2128
+ * to `false` and/or setting the `url` to an empty string.
2129
+ *
2130
+ * ```typescript
2131
+ * import {setWebhooks} from '@verdocs/js-sdk';
2132
+ *
2133
+ * await setWebhooks(ORGID, params);
2134
+ * ```
2104
2135
  */
2105
2136
  declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
2106
2137
  /**
@@ -2284,11 +2315,11 @@ interface ITemplateSearchResult {
2284
2315
  total: number;
2285
2316
  result: ITemplate[];
2286
2317
  }
2287
- declare const canPerformTemplateAction: (session: TSession, action: TTemplateAction, template?: ITemplate | ITemplateSummary) => {
2318
+ declare const canPerformTemplateAction: (profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate | ITemplateSummary) => {
2288
2319
  canPerform: boolean;
2289
2320
  message: string;
2290
2321
  };
2291
- declare const hasRequiredPermissions: (session: TSession, permissions: string[]) => boolean;
2322
+ declare const hasRequiredPermissions: (profile: IProfile | null | undefined, permissions: TPermission[]) => boolean;
2292
2323
  /**
2293
2324
  * Add a field to a template.
2294
2325
  */
@@ -2304,70 +2335,70 @@ declare const deleteField: (endpoint: VerdocsEndpoint, templateId: string, field
2304
2335
  /**
2305
2336
  * Check to see if the user created the template.
2306
2337
  */
2307
- declare const userIsTemplateCreator: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2338
+ declare const userIsTemplateCreator: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2308
2339
  /**
2309
2340
  * Check to see if a template is "shared" with the user.
2310
2341
  */
2311
- declare const userHasSharedTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2342
+ declare const userHasSharedTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2312
2343
  /**
2313
2344
  * Check to see if the user can create a personal/private template.
2314
2345
  */
2315
- declare const userCanCreatePersonalTemplate: (session: TSession) => boolean;
2346
+ declare const userCanCreatePersonalTemplate: (profile: IProfile) => boolean;
2316
2347
  /**
2317
2348
  * Check to see if the user can create an org-shared template.
2318
2349
  */
2319
- declare const userCanCreateOrgTemplate: (session: TSession) => boolean;
2350
+ declare const userCanCreateOrgTemplate: (profile: IProfile) => boolean;
2320
2351
  /**
2321
2352
  * Check to see if the user can create a public template.
2322
2353
  */
2323
- declare const userCanCreatePublicTemplate: (session: TSession) => boolean;
2354
+ declare const userCanCreatePublicTemplate: (profile: IProfile) => boolean;
2324
2355
  /**
2325
2356
  * Check to see if the user can read/view a template.
2326
2357
  */
2327
- declare const userCanReadTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2358
+ declare const userCanReadTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2328
2359
  /**
2329
2360
  * Check to see if the user can update a tempate.
2330
2361
  */
2331
- declare const userCanUpdateTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2362
+ declare const userCanUpdateTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2332
2363
  /**
2333
2364
  * Check to see if the user can change whether a template is personal vs org-shared.
2334
2365
  */
2335
- declare const userCanMakeTemplatePrivate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2366
+ declare const userCanMakeTemplatePrivate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2336
2367
  /**
2337
2368
  * Check to see if the user can change whether a template is personal vs org-shared.
2338
2369
  */
2339
- declare const userCanMakeTemplateShared: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2370
+ declare const userCanMakeTemplateShared: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2340
2371
  /**
2341
2372
  * Check to see if the user can change whether a template is personal vs org-shared.
2342
2373
  */
2343
- declare const userCanMakeTemplatePublic: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2374
+ declare const userCanMakeTemplatePublic: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2344
2375
  /**
2345
2376
  * Check to see if the user can change whether a template is personal vs org-shared.
2346
2377
  */
2347
- declare const userCanChangeOrgVisibility: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2378
+ declare const userCanChangeOrgVisibility: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2348
2379
  /**
2349
2380
  * Check to see if the user can change whether a template is personal vs org-shared.
2350
2381
  */
2351
- declare const userCanDeleteTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
2382
+ declare const userCanDeleteTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean;
2352
2383
  /**
2353
2384
  * Confirm whether the user can create an envelope using the specified template.
2354
2385
  */
2355
- declare const userCanSendTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
2386
+ declare const userCanSendTemplate: (profile: IProfile | null | undefined, template: ITemplate | ITemplateSummary) => boolean | null | undefined;
2356
2387
  /**
2357
2388
  * Confirm whether the user can create a new template.
2358
2389
  */
2359
- declare const userCanCreateTemplate: (session: TSession) => boolean;
2390
+ declare const userCanCreateTemplate: (profile: IProfile) => boolean;
2360
2391
  /**
2361
2392
  * Check to see if the user can "build" the template (use the field builder). The user must have write access to the
2362
2393
  * template, and the template must have at least one signer role.
2363
2394
  */
2364
- declare const userCanBuildTemplate: (session: TSession, template: ITemplate) => boolean | null;
2395
+ declare const userCanBuildTemplate: (profile: IProfile | null | undefined, template: ITemplate) => boolean | null | undefined;
2365
2396
  declare const getFieldsForRole: (template: ITemplate, role_name: string) => ITemplateField[];
2366
2397
  /**
2367
2398
  * Check to see if the user can preview the template. The user must have read access to the template, the template must
2368
2399
  * have at least one signer, and every signer must have at least one field.
2369
2400
  */
2370
- declare const userCanPreviewTemplate: (session: TSession, template: ITemplate) => boolean | null;
2401
+ declare const userCanPreviewTemplate: (profile: IProfile | null | undefined, template: ITemplate) => boolean | null | undefined;
2371
2402
  interface ICreateTemplateReminderRequest {
2372
2403
  setup_time: number;
2373
2404
  interval_time: number;