@verdocs/js-sdk 4.2.156 → 5.0.4

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.ts CHANGED
@@ -381,6 +381,7 @@ interface IUser {
381
381
  interface IWebhookEvents {
382
382
  envelope_created: boolean;
383
383
  envelope_completed: boolean;
384
+ envelope_updated: boolean;
384
385
  envelope_canceled: boolean;
385
386
  template_created: boolean;
386
387
  template_updated: boolean;
@@ -1350,8 +1351,8 @@ type TCreateEnvelopeRequest = ICreateEnvelopeFromTemplateRequest | ICreateEnvelo
1350
1351
  * ```
1351
1352
  *
1352
1353
  * @group Envelopes
1353
- * @api POST /v2/envelopes Create Envelope
1354
- * @apiBody string(format:uuid) template_id The template to base the new Envelope from
1354
+ * @api POST /v2/envelopes Create Envelope From Template
1355
+ * @apiBody string(format:uuid) template_id The ID of the template to copy
1355
1356
  * @apiBody array(items:ICreateEnvelopeRecipient) recipients A list of recipients to include in the workflow. Must specify one recipient to match each template Role.
1356
1357
  * @apiBody string name? Override the name of the envelope (defaults to the template name).
1357
1358
  * @apiBody string description? Override the description of the envelope (defaults to the template description).
@@ -1367,7 +1368,7 @@ declare const createEnvelope: (endpoint: VerdocsEndpoint, request: TCreateEnvelo
1367
1368
  * this will return only the **metadata** the caller is allowed to view.
1368
1369
  *
1369
1370
  * @group Envelopes
1370
- * @api GET /v2/envelopes/:id Get Envelope Details
1371
+ * @api GET /v2/envelopes/:id Get envelope details
1371
1372
  * @apiParam string(format: 'uuid') id The ID of the envelope to retrieve.
1372
1373
  * @apiSuccess IEnvelope . The detailed metadata for the envelope requested
1373
1374
  */
@@ -1376,8 +1377,8 @@ declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) => Pr
1376
1377
  * Get all metadata for an envelope document. Note that when called by non-creators (e.g. Recipients)
1377
1378
  * this will return only the **metadata** the caller is allowed to view.
1378
1379
  *
1379
- * @group Envelopes
1380
- * @api GET /envelopes/:id Get Envelope Details
1380
+ * @group Envelope Documents
1381
+ * @api GET /envelopes/:id Get envelope document
1381
1382
  * @apiParam string(format: 'uuid') id The ID of the document to retrieve.
1382
1383
  * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested
1383
1384
  */
@@ -1386,7 +1387,7 @@ declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, envelopeId: strin
1386
1387
  * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
1387
1388
  * be accessed immediately and never shared. Content-Disposition will be set to "download".
1388
1389
  *
1389
- * @group Envelopes
1390
+ * @group Envelope Documents
1390
1391
  * @api GET /envelopes/:envelope_id/envelope_documents/:document_id Preview, Download, or Link to a Document
1391
1392
  * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1392
1393
  * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
@@ -1497,7 +1498,7 @@ declare const getFieldAttachment: (endpoint: VerdocsEndpoint, envelopeId: string
1497
1498
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.
1498
1499
  *
1499
1500
  * @group Envelopes
1500
- * @api GET /v2/envelope-documnets/page-image/:document_id/:variant/:page Get Document Page Display URI
1501
+ * @api GET /v2/envelope-documnets/page-image/:document_id/:variant/:page Get envelope document page display URI
1501
1502
  * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1502
1503
  * @apiParam string(enum: 'original'|'filled') variant The variant of the document to retrieve.
1503
1504
  * @apiParam integer page The page number to retrieve
@@ -1531,7 +1532,7 @@ interface IListEnvelopesParams {
1531
1532
  * ```
1532
1533
  *
1533
1534
  * @group Envelopes
1534
- * @api GET /v2/envelopes List Envelopes
1535
+ * @api GET /v2/envelopes List envelopes
1535
1536
  * @apiQuery string q? Match envelopes whose name contains this string
1536
1537
  * @apiQuery string(enum: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed') view? Request pre-defined view. `inbox` returns envelopes where action is required by the caller. `sent` returns envelopes created by the caller. `action` returns envelopes where action is required by the caller. `waiting` returns envelopes where action is required by anyone. `completed` returns envelopes where all actions are complete.
1537
1538
  * @apiQuery array(items: 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled') status? Match envelopes in one of the specified states.
@@ -1866,6 +1867,10 @@ interface ISetWebhookRequest {
1866
1867
  *
1867
1868
  * const keys = await getApiKeys(ORGID);
1868
1869
  * ```
1870
+ *
1871
+ * @group API Keys
1872
+ * @api GET /v2/api-keys Get API keys
1873
+ * @apiSuccess array(items: IApiKey) . A list of the API keys for the caller's organization. Secrets will not be included.
1869
1874
  */
1870
1875
  declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
1871
1876
  /**
@@ -1876,6 +1881,13 @@ declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
1876
1881
  *
1877
1882
  * await createApiKey(ORGID, {name: NEWNAME});
1878
1883
  * ```
1884
+ *
1885
+ * @group API Keys
1886
+ * @api POST /v2/api-keys Create API key
1887
+ * @apiBody string name A name used to identify the key in the Verdocs Web App
1888
+ * @apiBody string(format:uuid) profile_id The profile ID that calls made using the key will act as
1889
+ * @apiBody array(items:string) permission An array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.
1890
+ * @apiSuccess IApiKey . The newly-created API key, including its secret.
1879
1891
  */
1880
1892
  declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyRequest) => Promise<IApiKey>;
1881
1893
  /**
@@ -1886,6 +1898,11 @@ declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyReq
1886
1898
  *
1887
1899
  * const {client_secret: newSecret} = await rotateApiKey(ORGID, CLIENTID);
1888
1900
  * ```
1901
+ *
1902
+ * @group API Keys
1903
+ * @api POST /v2/api-keys/:client_id/rotate Rotate API key
1904
+ * @apiParam string(format:uuid) client_id The client ID of the key to rotate
1905
+ * @apiSuccess IApiKey . The updated API key with its new secret.
1889
1906
  */
1890
1907
  declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<IApiKey>;
1891
1908
  /**
@@ -1896,6 +1913,12 @@ declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Pro
1896
1913
  *
1897
1914
  * await updateApiKey(ORGID, CLIENTID, {name: NEWNAME});
1898
1915
  * ```
1916
+ *
1917
+ * @group API Keys
1918
+ * @api PATCH /v2/api-keys/:client_id Update API key
1919
+ * @apiBody string name? New name for the API key
1920
+ * @apiBody array(items:string) permission New array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.
1921
+ * @apiSuccess IApiKey . The updated API key. The secret will not be included.
1899
1922
  */
1900
1923
  declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params: IUpdateApiKeyRequest) => Promise<IApiKey>;
1901
1924
  /**
@@ -1906,6 +1929,10 @@ declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params
1906
1929
  *
1907
1930
  * await deleteApiKey(ORGID, CLIENTID);
1908
1931
  * ```
1932
+ *
1933
+ * @group API Keys
1934
+ * @api DELETE /v2/api-keys/:client_id Delete API key
1935
+ * @apiSuccess string . Success.
1909
1936
  */
1910
1937
  declare const deleteApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<any>;
1911
1938
  /**
@@ -1922,17 +1949,28 @@ declare const deleteApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Pro
1922
1949
  *
1923
1950
  * const members = await getOrganizationContacts(VerdocsEndpoint.getDefault()});
1924
1951
  * ```
1952
+ *
1953
+ * @group Organization Contacts
1954
+ * @api GET /v2/organization-contacts Get a list of organization contacts
1955
+ * @apiBody string email Email address for the invitee
1956
+ * @apiBody string token Invite token for the invitee
1957
+ * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.
1925
1958
  */
1926
1959
  declare const getOrganizationContacts: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
1927
1960
  /**
1928
- * Delete a contact from the caller's organization. Note that the caller must be an admin or owner,
1929
- * may not delete him/herself.
1961
+ * Delete a contact from the caller's organization. Note that the caller must be an admin or owner.
1930
1962
  *
1931
1963
  * ```typescript
1932
1964
  * import {deleteOrganizationContact} from '@verdocs/js-sdk';
1933
1965
  *
1934
1966
  * await deleteOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID'});
1935
1967
  * ```
1968
+ *
1969
+ * @group Organization Contacts
1970
+ * @api POST /v2/organization-invitations/decline GET a list of pending invitations
1971
+ * @apiBody string email Email address for the invitee
1972
+ * @apiBody string token Invite token for the invitee
1973
+ * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.
1936
1974
  */
1937
1975
  declare const deleteOrganizationContact: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
1938
1976
  /**
@@ -2110,7 +2148,13 @@ type TAuthenticationRequest = IROPCRequest | IClientCredentialsRequest | IRefres
2110
2148
  *
2111
2149
  * @group Authentication
2112
2150
  * @api POST /v2/oauth2/token Authenticate
2113
- * @apiBody string(format: 'uuid') id The ID of the envelope to retrieve.
2151
+ * @apiBody string(enum: 'client_credentials'|'refresh_token'|'password') grant_type The type of grant to request. API callers should nearly always use 'client_credentials'.
2152
+ * @apiBody string(format: 'uuid') client_id? If grant_type is client_credentials or refresh_token, the client ID of the API key to use.
2153
+ * @apiBody string(format: 'uuid') client_secret? If grant_type is client_credentials, the secret key of the API key to use.
2154
+ * @apiBody string username? If grant_type is password, the username to authenticate with.
2155
+ * @apiBody string password? If grant_type is password, the password to authenticate with.
2156
+ * @apiBody string password? If grant_type is password, the password to authenticate with.
2157
+ * @apiBody string scope? Optional scope to limit the auth token to. Do not specify this unless you are instructed to by a Verdocs Support rep.
2114
2158
  * @apiSuccess IAuthenticateResponse . The detailed metadata for the envelope requested
2115
2159
  */
2116
2160
  declare const authenticate: (endpoint: VerdocsEndpoint, params: TAuthenticationRequest) => Promise<IAuthenticateResponse>;
@@ -2136,6 +2180,12 @@ declare const refreshToken: (endpoint: VerdocsEndpoint, refreshToken: string) =>
2136
2180
  * window.alert(`Password reset error: ${message}`);
2137
2181
  * }
2138
2182
  * ```
2183
+ *
2184
+ * @group Authentication
2185
+ * @api POST /v2/users/change-password Change the caller's password
2186
+ * @apiBody string old_password Current password for the caller
2187
+ * @apiBody string new_password New password to set for the caller. Must meet strength requirements.
2188
+ * @apiSuccess string . Success
2139
2189
  */
2140
2190
  declare const changePassword: (endpoint: VerdocsEndpoint, params: IChangePasswordRequest) => Promise<IChangePasswordResponse>;
2141
2191
  /**
@@ -2156,6 +2206,13 @@ declare const changePassword: (endpoint: VerdocsEndpoint, params: IChangePasswor
2156
2206
  * window.alert(`Please check your verification code and try again.`);
2157
2207
  * }
2158
2208
  * ```
2209
+ *
2210
+ * @group Authentication
2211
+ * @api POST /v2/users/reset-password Reset a password for a user
2212
+ * @apiBody string email Email address for the user account
2213
+ * @apiBody string code? To initiate a reset request, omit this field. To complete it, provide the emailed code received by the user.
2214
+ * @apiBody string new_password? To initiate a reset request, omit this field. To complete it, provide the new password the user wishes to use.
2215
+ * @apiSuccess string . Success
2159
2216
  */
2160
2217
  declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
2161
2218
  email: string;
@@ -2165,49 +2222,64 @@ declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
2165
2222
  success: boolean;
2166
2223
  }>;
2167
2224
  /**
2168
- * Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
2169
- * a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
2170
- * the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
2171
- * active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
2172
- * "anonymous" mode while verification is being performed.
2225
+ * Resend the email verification request if the email or token are unknown. Instead, an accessToken
2226
+ * may be supplied through which the user will be identified. This is intended to be used in post-signup
2227
+ * cases where the user is "partially" authenticated (has a session, but is not yet verified).
2173
2228
  *
2174
2229
  * ```typescript
2175
2230
  * import {resendVerification} from '@verdocs/js-sdk';
2176
2231
  *
2177
2232
  * const result = await resendVerification();
2178
2233
  * ```
2234
+ *
2235
+ * @group Authentication
2236
+ * @api POST /v2/users/verify Resend an email verification request for a "partially" authenticated user (authenticated, but not yet verified)
2237
+ * @apiSuccess string . Success
2179
2238
  */
2180
2239
  declare const resendVerification: (endpoint: VerdocsEndpoint, accessToken?: string) => Promise<{
2181
2240
  result: "done";
2182
2241
  }>;
2183
2242
  /**
2184
- * Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
2185
- * a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
2186
- * the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
2187
- * active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
2188
- * "anonymous" mode while verification is being performed.
2243
+ * Resend the email verification request if the user is unauthenticated, but the email and token are known.
2244
+ * Used if the token is valid but has expired.
2189
2245
  *
2190
2246
  * ```typescript
2191
2247
  * import {resendVerification} from '@verdocs/js-sdk';
2192
2248
  *
2193
2249
  * const result = await resendVerification();
2194
2250
  * ```
2251
+ *
2252
+ * @group Authentication
2253
+ * @api POST /v2/users/verify Resend the email verification request if both the email and token are known. Used if the token is valid but has expired.
2254
+ * @apiSuccess IAuthenticateResponse . Updated authentication details
2195
2255
  */
2196
2256
  declare const verifyEmail: (endpoint: VerdocsEndpoint, params: IVerifyEmailRequest) => Promise<IAuthenticateResponse>;
2257
+ /**
2258
+ * Get the caller's current user record.
2259
+ *
2260
+ * @group Authentication
2261
+ * @api GET /v2/users/me Get the caller's user record.
2262
+ * @apiSuccess IUser . User record
2263
+ */
2197
2264
  declare const getMyUser: (endpoint: VerdocsEndpoint) => Promise<IUser>;
2198
2265
  declare const getNotifications: (endpoint: VerdocsEndpoint) => Promise<any>;
2199
2266
  /**
2200
- * Get the user's available profiles. The current profile will be marked with `current: true`.
2267
+ * Get the caller's available profiles. The current profile will be marked with `current: true`.
2201
2268
  *
2202
2269
  * ```typescript
2203
2270
  * import {getProfiles} from '@verdocs/js-sdk';
2204
2271
  *
2205
2272
  * const profiles = await getProfiles();
2206
2273
  * ```
2274
+ *
2275
+ * @group Profiles
2276
+ * @api GET /v2/profiles Get the caller's profiles
2277
+ * @apiDescription A user may have multiple profiles, one for each organization of which they are a member. Only one profile may be "current" at a time.
2278
+ * @apiSuccess array(items: IProfile) . The caller's profiles
2207
2279
  */
2208
2280
  declare const getProfiles: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
2209
2281
  /**
2210
- * Get the user's current profile. This is just a convenience accessor that calls `getProfiles()`
2282
+ * Get the caller's current profile. This is just a convenience accessor that calls `getProfiles()`
2211
2283
  * and returns the first `current: true` entry.
2212
2284
  *
2213
2285
  * ```typescript
@@ -2227,6 +2299,10 @@ declare const getCurrentProfile: (endpoint: VerdocsEndpoint) => Promise<IProfile
2227
2299
  *
2228
2300
  * const newProfile = await switchProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2229
2301
  * ```
2302
+ *
2303
+ * @group Profiles
2304
+ * @api POST /v2/profiles/:profile_id/switch Change the "current" profile for the caller
2305
+ * @apiSuccess IAuthenticateResponse . New authentication credentials
2230
2306
  */
2231
2307
  declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse>;
2232
2308
  /**
@@ -2238,6 +2314,15 @@ declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => P
2238
2314
  *
2239
2315
  * const newProfile = await updateProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2240
2316
  * ```
2317
+ *
2318
+ * @group Profiles
2319
+ * @api PATCH /v2/profiles/:profile_id Update a profile
2320
+ * @apiBody string first_name? First name
2321
+ * @apiBody string last_name? Last name
2322
+ * @apiBody string phone? Phone number
2323
+ * @apiBody array(items:TPermission) permissions? New permissions to directly apply to the profile
2324
+ * @apiBody array(items:TRole) roles? New roles to assign to the profile
2325
+ * @apiSuccess IProfile . The updated profile
2241
2326
  */
2242
2327
  declare const updateProfile: (endpoint: VerdocsEndpoint, profileId: string, params: IUpdateProfileRequest) => Promise<IProfile>;
2243
2328
  /**
@@ -2249,13 +2334,17 @@ declare const updateProfile: (endpoint: VerdocsEndpoint, profileId: string, para
2249
2334
  *
2250
2335
  * await deleteProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2251
2336
  * ```
2337
+ *
2338
+ * @group Profiles
2339
+ * @api DELETE /v2/profiles/:profile_id Delete a profile
2340
+ * @apiSuccess IAuthenticateResponse . New session tokens for the next available profile for the caller, or null if none.
2252
2341
  */
2253
2342
  declare const deleteProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse | {
2254
2343
  status: "OK";
2255
2344
  message: "Your last profile has been deleted. You are now logged out.";
2256
2345
  }>;
2257
2346
  /**
2258
- * Create a new user account. Note that there are two registration paths for creation:
2347
+ * Create a new profile. Note that there are two registration paths for creation:
2259
2348
  * - Get invited to an organization, by an admin or owner of that org.
2260
2349
  * - Created a new organization. The caller will become the first owner of the new org.
2261
2350
  *
@@ -2286,6 +2375,11 @@ declare const createProfile: (endpoint: VerdocsEndpoint, params: ICreateProfileR
2286
2375
  *
2287
2376
  * await uploadProfilePhoto((VerdocsEndpoint.getDefault(), profileId, file);
2288
2377
  * ```
2378
+ *
2379
+ * @group Profiles
2380
+ * @api PATCH /v2/templates/:template_id Change a profile's photo
2381
+ * @apiBody string(format:binary) file File to upload
2382
+ * @apiSuccess IProfile . The updated profile
2289
2383
  */
2290
2384
  declare const updateProfilePhoto: (endpoint: VerdocsEndpoint, profileId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2291
2385
  /**
@@ -2295,44 +2389,95 @@ declare const updateProfilePhoto: (endpoint: VerdocsEndpoint, profileId: string,
2295
2389
  */
2296
2390
  /**
2297
2391
  * Get a list of invitations pending for the caller's organization. The caller must be an admin or owner.
2392
+ *
2393
+ * @group Organization Invitations
2394
+ * @api GET /v2/organization-invitations Get a list of pending invitations
2395
+ * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.
2396
+ * @apiBody string first_name First name. The user may override this after accepting the invitation.
2397
+ * @apiBody string last_name Last name. The user may override this after accepting the invitation.
2398
+ * @apiSuccess array(items:IProfile) . List of caller's current organization's members
2298
2399
  */
2299
2400
  declare const getOrganizationInvitations: (endpoint: VerdocsEndpoint) => Promise<IOrganizationInvitation[]>;
2300
2401
  /**
2301
2402
  * Invite a new user to join the organization.
2403
+ *
2404
+ * @group Organization Invitations
2405
+ * @api POST /v2/organization-invitations Invite a new user to join the organization
2406
+ * @apiBody string email Email address to send the invitation to
2407
+ * @apiBody string first_name First name. The user may override this after accepting the invitation.
2408
+ * @apiBody string last_name Last name. The user may override this after accepting the invitation.
2409
+ * @apiBody TRole role Initial role to assign to the user once they accept.
2410
+ * @apiSuccess IOrganizationInvitation . The newly-created invitation.
2302
2411
  */
2303
2412
  declare const createOrganizationInvitation: (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) => Promise<IOrganizationInvitation>;
2304
2413
  /**
2305
2414
  * Delete an invitation. Note that no cancellation message will be sent. Invitations are also one-time-use.
2306
2415
  * If the invitee attempts to join after the invitation is deleted, accepted, or decline, they will be
2307
2416
  * shown an error.
2417
+ *
2418
+ * @group Organization Invitations
2419
+ * @api DELETE /v2/organization-invitations/:email Delete a pending invitation
2420
+ * @apiSuccess string . Success
2308
2421
  */
2309
2422
  declare const deleteOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
2310
2423
  /**
2311
2424
  * Update an invitation. Note that email may not be changed after the invite is sent. To change
2312
2425
  * an invitee's email, delete the incorrect entry and create one with the correct value.
2426
+ *
2427
+ * @group Organization Invitations
2428
+ * @api PATCH /v2/organization-invitations/:email Update a pending invitation
2429
+ * @apiBody string first_name First name. The user may override this after accepting the invitation.
2430
+ * @apiBody string last_name Last name. The user may override this after accepting the invitation.
2431
+ * @apiBody TRole role Initial role to assign to the user once they accept.
2432
+ * @apiSuccess IOrganizationInvitation . The updated invitation.
2313
2433
  */
2314
2434
  declare const updateOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, params: Pick<ICreateInvitationRequest, "role" | "first_name" | "last_name">) => Promise<IOrganizationInvitation>;
2315
2435
  /**
2316
2436
  * Send a reminder to the invitee to join the organization.
2437
+ *
2438
+ * @group Organization Invitations
2439
+ * @api POST /v2/organization-invitations/resend Send a reminder to a pending invitee
2440
+ * @apiBody string email The recipient to send the reminder to
2441
+ * @apiSuccess IOrganizationInvitation . The updated invitation
2317
2442
  */
2318
- declare const resendOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
2443
+ declare const resendOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<IOrganizationInvitation>;
2319
2444
  /**
2320
2445
  * Get an invitation's details. This is generally used as the first step of accepting the invite.
2321
2446
  * A successful response will indicate that the invite token is still valid, and include some
2322
2447
  * metadata for the organization to style the acceptance screen.
2448
+ *
2449
+ * @group Organization Invitations
2450
+ * @api GET /v2/organization-invitations/:email/:token Get a pending invitation (_Authenticated via invite token, not an active session._). Intended to be called by the invitee to get details about the invitation they are about to accept.
2451
+ * @apiSuccess IOrganizationInvitation . Requested invitation's details. Will always include summary details for the organization, to be used for branding the accept-invite view.
2323
2452
  */
2324
2453
  declare const getOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<IOrganizationInvitation>;
2325
2454
  /**
2326
- * Accept an invitation. This will automatically create an Auth0 user for the caller as well as a profile
2455
+ * Accept an invitation. This will automatically create a user record for the caller as well as a profile
2327
2456
  * with the appropriate role as specified in the invite. The profile will be set as "current" for the caller,
2328
2457
  * and session tokens will be returned to access the new profile. The profile's email_verified flag will
2329
2458
  * also be set to true.
2459
+ *
2460
+ * @group Organization Invitations
2461
+ * @api POST /v2/organization-invitations/accept Accept an invitation
2462
+ * @apiBody string email Email address for the invitee
2463
+ * @apiBody string token Invite token for the invitee
2464
+ * @apiBody string first_name First name
2465
+ * @apiBody string last_name Last name
2466
+ * @apiBody string password Password
2467
+ * @apiSuccess IAuthenticateResponse . Session credentials for the newly-created user's profile. If the user already had a profile for another organization, the new profile will be made "current" automatically.
2330
2468
  */
2331
2469
  declare const acceptOrganizationInvitation: (endpoint: VerdocsEndpoint, params: IAcceptOrganizationInvitationRequest) => Promise<IAuthenticateResponse>;
2332
2470
  /**
2333
2471
  * Decline an invitation. This will mark the status "declined," providing a visual indication to the
2334
2472
  * organization's admins that the invite was declined, preventing further invites from being created
2335
2473
  * to the same email address, and also preventing the invitee from receiving reminders to join.
2474
+ *
2475
+ * @group Organization Invitations
2476
+ * @api POST /v2/organization-invitations/decline Decline an invitation
2477
+ * @apiDescription Mark the status "declined," providing a visual indication to the organization's admins that the invite was declined, preventing further invites from being created to the same email address, and also preventing the invitee from receiving reminders to join.
2478
+ * @apiBody string email Email address for the invitee
2479
+ * @apiBody string token Invite token for the invitee
2480
+ * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.
2336
2481
  */
2337
2482
  declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<{
2338
2483
  status: "OK";
@@ -2350,6 +2495,10 @@ declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email:
2350
2495
  *
2351
2496
  * const members = await getOrganizationMembers(VerdocsEndpoint.getDefault()});
2352
2497
  * ```
2498
+ *
2499
+ * @group Organization Members
2500
+ * @api GET /v2/organization-members List current organization's members
2501
+ * @apiSuccess array(items:IProfile) . List of caller's current organization's members
2353
2502
  */
2354
2503
  declare const getOrganizationMembers: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
2355
2504
  /**
@@ -2361,6 +2510,10 @@ declare const getOrganizationMembers: (endpoint: VerdocsEndpoint) => Promise<IPr
2361
2510
  *
2362
2511
  * await deleteOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID'});
2363
2512
  * ```
2513
+ *
2514
+ * @group Organization Members
2515
+ * @api DELETE /v2/organization-members/:profile_id Delete a member from the organization
2516
+ * @apiSuccess string . Success
2364
2517
  */
2365
2518
  declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
2366
2519
  /**
@@ -2371,6 +2524,13 @@ declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: s
2371
2524
  *
2372
2525
  * const result = await updateOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID', {roles:['member']});
2373
2526
  * ```
2527
+ *
2528
+ * @group Organization Members
2529
+ * @api PATCH /v2/organization-members/:profile_id Update an organization member.
2530
+ * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.
2531
+ * @apiBody string first_name Set to true to enable Webhooks calls.
2532
+ * @apiBody string last_name Record<TWebhookEvent, boolean> map of events to enable/disable.
2533
+ * @apiSuccess array(items:IProfile) . List of caller's current organization's members
2374
2534
  */
2375
2535
  declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, "roles" | "first_name" | "last_name">) => Promise<any>;
2376
2536
  /**
@@ -2382,6 +2542,10 @@ declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: s
2382
2542
  *
2383
2543
  * const organizations = await getOrganization(VerdocsEndpoint.getDefault(), 'ORGID');
2384
2544
  * ```
2545
+ *
2546
+ * @group Organizations
2547
+ * @api GET /v2/organizations/:organization_id Get organization
2548
+ * @apiSuccess IOrganization . The requested organization. The caller must be a member.
2385
2549
  */
2386
2550
  declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IOrganization>;
2387
2551
  /**
@@ -2394,6 +2558,18 @@ declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: strin
2394
2558
  *
2395
2559
  * const organization = await createOrganization(VerdocsEndpoint.getDefault(), {name: 'NewOrg'});
2396
2560
  * ```
2561
+ *
2562
+ * @group Organizations
2563
+ * @api POST /v2/organizations Create organization
2564
+ * @apiDescription The caller will be assigned an "Owner" profile in the new organization, and it will be set to "current" automatically. A new set of session tokens will be issued to the caller, and the caller should update their endpoint to use the new tokens.
2565
+ * @apiBody string name The name of the new organization
2566
+ * @apiBody string contact_email? Contact email for the new organization
2567
+ * @apiBody string url? URL for the new organization
2568
+ * @apiBody string full_logo_url? URL of a large-format PNG logo
2569
+ * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo
2570
+ * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo
2571
+ * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo
2572
+ * @apiSuccess IAuthenticateResponse . Authentication credentials for user in the new organization. The user will be made an Owner automatically.
2397
2573
  */
2398
2574
  declare const createOrganization: (endpoint: VerdocsEndpoint, params: Pick<IOrganization, "name" | "address" | "address2" | "phone" | "contact_email" | "url" | "full_logo_url" | "thumbnail_url" | "primary_color" | "secondary_color">) => Promise<IAuthenticateResponse>;
2399
2575
  /**
@@ -2404,6 +2580,17 @@ declare const createOrganization: (endpoint: VerdocsEndpoint, params: Pick<IOrga
2404
2580
  *
2405
2581
  * const organizations = await updateOrganization(VerdocsEndpoint.getDefault(), organizationId, {name:'ORGNAME'});
2406
2582
  * ```
2583
+ *
2584
+ * @group Organizations
2585
+ * @api PATCH /v2/organizations/:organization_id Update organization
2586
+ * @apiBody string name The name of the new organization
2587
+ * @apiBody string contact_email? Contact email for the new organization
2588
+ * @apiBody string url? URL for the new organization
2589
+ * @apiBody string full_logo_url? URL of a large-format PNG logo
2590
+ * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo
2591
+ * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo
2592
+ * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo
2593
+ * @apiSuccess IOrganization . The details for the updated organization
2407
2594
  */
2408
2595
  declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) => Promise<IOrganization>;
2409
2596
  /**
@@ -2415,18 +2602,28 @@ declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: st
2415
2602
  *
2416
2603
  * const newSession = await deleteOrganization(VerdocsEndpoint.getDefault(), organizationId);
2417
2604
  * ```
2605
+ *
2606
+ * @group Organizations
2607
+ * @api DELETE /v2/organizations/:organization_id Delete organization
2608
+ * @apiSuccess IAuthenticateResponse . If the caller is a member of another organization, authentication credentials for the next organization available. If not, this will be null and the caller will be logged out.
2418
2609
  */
2419
2610
  declare const deleteOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IAuthenticateResponse | null>;
2420
2611
  /**
2421
- * Update the organization's logo. This can only be called by an admin or owner.
2612
+ * Update the organization's full or thumbnail logo. This can only be called by an admin or owner.
2422
2613
  *
2423
2614
  * ```typescript
2424
2615
  * import {updateOrganizationLogo} from '@verdocs/js-sdk';
2425
2616
  *
2426
2617
  * await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);
2427
2618
  * ```
2619
+ *
2620
+ * @group Organizations
2621
+ * @api PATCH /v2/organizations/:organization_id Update organization full or thumbnail logo.
2622
+ * @apiBody image/png logo? Form-url-encoded file to upload
2623
+ * @apiBody image/png thumbnail? Form-url-encoded file to upload
2624
+ * @apiSuccess IOrganization . The updated organization.
2428
2625
  */
2429
- declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2626
+ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IOrganization>;
2430
2627
  /**
2431
2628
  * Update the organization's thumbnail. This can only be called by an admin or owner.
2432
2629
  *
@@ -2436,7 +2633,7 @@ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId
2436
2633
  * await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);
2437
2634
  * ```
2438
2635
  */
2439
- declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2636
+ declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IOrganization>;
2440
2637
  /**
2441
2638
  * Get the registered Webhook configuration for the caller's organization.
2442
2639
  *
@@ -2445,6 +2642,10 @@ declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizat
2445
2642
  *
2446
2643
  * await getWebhooks(ORGID, params);
2447
2644
  * ```
2645
+ *
2646
+ * @group Webhooks
2647
+ * @api GET /v2/webhooks Get organization Webhooks config
2648
+ * @apiSuccess IWebhook . The current Webhooks config for the caller's organization.
2448
2649
  */
2449
2650
  declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2450
2651
  /**
@@ -2457,6 +2658,14 @@ declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2457
2658
  *
2458
2659
  * await setWebhooks(ORGID, params);
2459
2660
  * ```
2661
+ *
2662
+ * @group Webhooks
2663
+ * @api PATCH /v2/webhooks Update organization Webhooks config
2664
+ * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.
2665
+ * @apiBody string url URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.
2666
+ * @apiBody boolean active Set to true to enable Webhooks calls.
2667
+ * @apiBody object events Record<TWebhookEvent, boolean> map of events to enable/disable.
2668
+ * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization.
2460
2669
  */
2461
2670
  declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
2462
2671
  declare const canPerformTemplateAction: (profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate) => {
@@ -2472,6 +2681,25 @@ declare const hasRequiredPermissions: (profile: IProfile | null | undefined, per
2472
2681
  *
2473
2682
  * await createField((VerdocsEndpoint.getDefault(), template_id, { ... });
2474
2683
  * ```
2684
+ *
2685
+ * @group Fields
2686
+ * @api POST /v2/fields/:template_id Add a field to a template
2687
+ * @apiBody string name Name for the new field. Field names must be unique within a template. Although special characters are allowed, they must be URL-encoded in subsequent requests, so it is recommended to use only alphanumeric characters and hyphens if possible.
2688
+ * @apiBody string role_name Role to assign to the field. Role names must be valid, so it is recommended to create roles before fields.
2689
+ * @apiBody string document_id ID of the document upon which to place the field.
2690
+ * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type Type of field to create
2691
+ * @apiBody boolean(default: false) required Whether the field is required
2692
+ * @apiBody integer(min: 0) page 0-based page number upon which to place the field
2693
+ * @apiBody integer(min: 0) x X position for the field (left to right)
2694
+ * @apiBody integer(min: 0) y Y position for the field (_bottom to top!_)
2695
+ * @apiBody string label? Optional label to display above the field
2696
+ * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2697
+ * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2698
+ * @apiBody string placeholder? Optional placeholder to display in text fields
2699
+ * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name
2700
+ * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display
2701
+ * @apiBody string value? Optional default value to set on the field
2702
+ * @apiSuccess ITemplateField . Template field
2475
2703
  */
2476
2704
  declare const createField: (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) => Promise<ITemplateField>;
2477
2705
  /**
@@ -2482,6 +2710,25 @@ declare const createField: (endpoint: VerdocsEndpoint, templateId: string, param
2482
2710
  *
2483
2711
  * await updateField((VerdocsEndpoint.getDefault(), template_id, field_name, { ... });
2484
2712
  * ```
2713
+ *
2714
+ * @group Fields
2715
+ * @api PATCH /v2/fields/:template_id/:field_name Update a field. See createField for additional details on the supported parameters.
2716
+ * @apiBody string name? Rename the field. Note that template field names must be unique within a template.
2717
+ * @apiBody string role_name Role to assign to the field.
2718
+ * @apiBody string document_id ID of the document upon which to place the field.
2719
+ * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type? Change the field type. Note that while this is technically allowed, fields have different behaviors, validators, default sizes, etc. It is usually easier to add a new field and delete the old one.
2720
+ * @apiBody boolean(default: false) required? Whether the field is required
2721
+ * @apiBody integer(min: 0) page? 0-based page number upon which to place the field
2722
+ * @apiBody integer(min: 0) x? X position for the field (left to right)
2723
+ * @apiBody integer(min: 0) y? Y position for the field (_bottom to top!_)
2724
+ * @apiBody string label? Optional label to display above the field
2725
+ * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2726
+ * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2727
+ * @apiBody string placeholder? Optional placeholder to display in text fields
2728
+ * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name
2729
+ * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display
2730
+ * @apiBody string value? Optional default value to set on the field
2731
+ * @apiSuccess ITemplateField . Updated template field
2485
2732
  */
2486
2733
  declare const updateField: (endpoint: VerdocsEndpoint, templateId: string, name: string, params: Partial<ITemplateField>) => Promise<ITemplateField>;
2487
2734
  /**
@@ -2492,6 +2739,10 @@ declare const updateField: (endpoint: VerdocsEndpoint, templateId: string, name:
2492
2739
  *
2493
2740
  * await deleteField((VerdocsEndpoint.getDefault(), template_id, field_name);
2494
2741
  * ```
2742
+ *
2743
+ * @group Fields
2744
+ * @api DELETE /v2/fields/:template_id/:field_name Delete a field
2745
+ * @apiSuccess string . Success
2495
2746
  */
2496
2747
  declare const deleteField: (endpoint: VerdocsEndpoint, templateId: string, name: string) => Promise<any>;
2497
2748
  /**
@@ -2569,6 +2820,20 @@ declare const userCanPreviewTemplate: (profile: IProfile | null | undefined, tem
2569
2820
  *
2570
2821
  * const role = await createTemplateRole(VerdocsEndpoint.getDefault(), template_id, params...);
2571
2822
  * ```
2823
+ *
2824
+ * @group Roles
2825
+ * @api POST /v2/roles/:template_id Add a role to a template
2826
+ * @apiBody string name Name for the new role. Must be unique within the template. May include spaces, but later calls must URL-encode any references to this role, so it is recomended that special characters be avoided.
2827
+ * @apiBody string(enum:'signer' | 'cc' | 'approver') type Type of role to create. Signers act on documents by filling and signing fields. CC recipients receive a copy but do not act on the document. Approvers control the final submission of a document, but do not have fields of their own to fill out.
2828
+ * @apiBody string full_name? Default full name for the role. May be completed/overridden later, when envelopes are made from the template.
2829
+ * @apiBody string email? Default email address for the role. May be completed/overridden later, when envelopes are made from the template.
2830
+ * @apiBody string phone? Default (SMS-capable) phone number for the role. May be completed/overridden later, when envelopes are made from the template.
2831
+ * @apiBody string message? Optional message to include in email and SMS signing invitations.
2832
+ * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role. Roles that share the same sequence number act in parallel, and will receive invitations at the same time.
2833
+ * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role. Controls the left-to-right display order of roles at the same sequence number in the UI components e.g. `<verdocs-template-roles />`.
2834
+ * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.
2835
+ * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role. NOTE: Some KBA operations may incur additional fees.
2836
+ * @apiSuccess IRole . The newly-created role
2572
2837
  */
2573
2838
  declare const createTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, params: IRole) => Promise<IRole>;
2574
2839
  /**
@@ -2579,6 +2844,20 @@ declare const createTemplateRole: (endpoint: VerdocsEndpoint, template_id: strin
2579
2844
  *
2580
2845
  * const role = await updateTemplateRole(VerdocsEndpoint.getDefault(), template_id, name, params...);
2581
2846
  * ```
2847
+ *
2848
+ * @group Roles
2849
+ * @api PATCH /v2/roles/:template_id/:role_id Update a role. See createRole for additional details on the parameters available.
2850
+ * @apiBody string name? Rename the role. Note that role names must be unique within a template, so this may fail if the new name is already in use.
2851
+ * @apiBody string(enum:'signer' | 'cc' | 'approver') type? Type of role.
2852
+ * @apiBody string full_name? Default full name for the role.
2853
+ * @apiBody string email? Default email address for the role.
2854
+ * @apiBody string phone? Default (SMS-capable) phone number for the role.
2855
+ * @apiBody string message? Optional message to include in email and SMS signing invitations.
2856
+ * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role.
2857
+ * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role.
2858
+ * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.
2859
+ * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role.
2860
+ * @apiSuccess IRole . The newly-created role
2582
2861
  */
2583
2862
  declare const updateTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, name: string, params: Partial<IRole>) => Promise<IRole>;
2584
2863
  /**
@@ -2589,6 +2868,10 @@ declare const updateTemplateRole: (endpoint: VerdocsEndpoint, template_id: strin
2589
2868
  *
2590
2869
  * const profiles = await deleteTemplateRole(VerdocsEndpoint.getDefault(), template_id, name);
2591
2870
  * ```
2871
+ *
2872
+ * @group Roles
2873
+ * @api DELETE /v2/roles/:template_id/:role_id Delete a role.
2874
+ * @apiSuccess string . Success
2592
2875
  */
2593
2876
  declare const deleteTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, name: string) => Promise<any>;
2594
2877
  interface ITemplateTag {
@@ -2704,6 +2987,10 @@ declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesPa
2704
2987
  *
2705
2988
  * const template = await getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
2706
2989
  * ```
2990
+ *
2991
+ * @group Templates
2992
+ * @api GET /v2/templates/:template_id Get a template. Note that the caller must have at least View access to the template.
2993
+ * @apiSuccess ITemplate . The requested template
2707
2994
  */
2708
2995
  declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplate>;
2709
2996
  /**
@@ -2778,6 +3065,21 @@ interface ITemplateCreateParams {
2778
3065
  *
2779
3066
  * const newTemplate = await createTemplate((VerdocsEndpoint.getDefault(), {...});
2780
3067
  * ```
3068
+ *
3069
+ * @group Templates
3070
+ * @api POST /v2/templates Create a template
3071
+ * @apiBody string name Template name
3072
+ * @apiBody string description? Optional description
3073
+ * @apiBody TTemplateVisibility visibility? Visibility setting
3074
+ * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use "visibility" for new calls.)
3075
+ * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use "visibility" for new calls.)
3076
+ * @apiBody TTemplateSender sender? Who may send envelopes using this template
3077
+ * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.
3078
+ * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.
3079
+ * @apiBody array(items:object) documents? Optional list of documents to attach to the template
3080
+ * @apiBody array(items:IRole) roles? Optional list of roles to create. Note that if roles are not included in the request, fields will be ignored.
3081
+ * @apiBody array(fields:ITemplateField) fields? Optional list of fields to create. Note that if fields that do not match a role will be ignored.
3082
+ * @apiSuccess ITemplate . The newly-created template
2781
3083
  */
2782
3084
  declare const createTemplate: (endpoint: VerdocsEndpoint, params: ITemplateCreateParams, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplate>;
2783
3085
  /**
@@ -2789,6 +3091,12 @@ declare const createTemplate: (endpoint: VerdocsEndpoint, params: ITemplateCreat
2789
3091
  *
2790
3092
  * const newTemplate = await duplicateTemplate((VerdocsEndpoint.getDefault(), originalTemplateId, 'My Template Copy');
2791
3093
  * ```
3094
+ *
3095
+ * @group Templates
3096
+ * @api PUT /v2/templates/:template_id Perform an operation on a template
3097
+ * @apiBody string(enum:'duplicate') action Action to perform
3098
+ * @apiBody string name? If duplicating the template, a name for the new copy
3099
+ * @apiSuccess ITemplate . The newly-copied template
2792
3100
  */
2793
3101
  declare const duplicateTemplate: (endpoint: VerdocsEndpoint, templateId: string, name: string) => Promise<ITemplate>;
2794
3102
  interface ITemplateCreateFromSharepointParams {
@@ -2813,6 +3121,14 @@ interface ITemplateCreateFromSharepointParams {
2813
3121
  *
2814
3122
  * const newTemplate = await createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});
2815
3123
  * ```
3124
+ *
3125
+ * @group Templates
3126
+ * @api POST /v2/templates/from-sharepoint Create a template from an asset in Sharepoint
3127
+ * @apiBody string name Name for the new template
3128
+ * @apiBody string siteId Name for the new template
3129
+ * @apiBody string itemId Name for the new template
3130
+ * @apiBody string oboToken On-Behalf-Of token for calls to Sharepoint. Should be generated as a short-expiration token with at least Read privileges to the siteId/itemId. This token will be discarded after being used.
3131
+ * @apiSuccess ITemplate . The newly-created template
2816
3132
  */
2817
3133
  declare const createTemplateFromSharepoint: (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => Promise<ITemplate>;
2818
3134
  /**
@@ -2823,6 +3139,18 @@ declare const createTemplateFromSharepoint: (endpoint: VerdocsEndpoint, params:
2823
3139
  *
2824
3140
  * const updatedTemplate = await updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });
2825
3141
  * ```
3142
+ *
3143
+ * @group Templates
3144
+ * @api PATCH /v2/templates/:template_id Update a template
3145
+ * @apiBody string name? Template name
3146
+ * @apiBody string description? Optional description
3147
+ * @apiBody TTemplateVisibility visibility? Visibility setting
3148
+ * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use "visibility" for new calls.)
3149
+ * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use "visibility" for new calls.)
3150
+ * @apiBody TTemplateSender sender? Who may send envelopes using this template
3151
+ * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.
3152
+ * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.
3153
+ * @apiSuccess ITemplate . The updated template
2826
3154
  */
2827
3155
  declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) => Promise<ITemplate>;
2828
3156
  /**
@@ -2833,8 +3161,12 @@ declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: string, pa
2833
3161
  *
2834
3162
  * await deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
2835
3163
  * ```
3164
+ *
3165
+ * @group Templates
3166
+ * @api DELETE /v2/templates/:template_id Delete a template
3167
+ * @apiSuccess string . Success
2836
3168
  */
2837
- declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<any>;
3169
+ declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<string>;
2838
3170
  /**
2839
3171
  * Get all the Template Documents associated to a particular Template.
2840
3172
  *
@@ -2843,6 +3175,10 @@ declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) =>
2843
3175
  *
2844
3176
  * await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);
2845
3177
  * ```
3178
+ *
3179
+ * @group Template Documents
3180
+ * @api GET /v2/templates/:template_id/documents List the documents assigned to a template
3181
+ * @apiSuccess array(items: ITemplateDocument) . Template documents
2846
3182
  */
2847
3183
  declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateDocument[]>;
2848
3184
  /**
@@ -2853,6 +3189,10 @@ declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: stri
2853
3189
  *
2854
3190
  * await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);
2855
3191
  * ```
3192
+ *
3193
+ * @group Template Documents
3194
+ * @api GET /v2/templates/:template_id/documents/:document_id Get an individual template document
3195
+ * @apiSuccess ITemplateDocument . Template document
2856
3196
  */
2857
3197
  declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplateDocument>;
2858
3198
  /**
@@ -2863,6 +3203,11 @@ declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: strin
2863
3203
  *
2864
3204
  * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
2865
3205
  * ```
3206
+ *
3207
+ * @group Template Documents
3208
+ * @api POST /v2/templates/:template_id/documents Attach a document to a template
3209
+ * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.
3210
+ * @apiSuccess ITemplateDocument . Template document
2866
3211
  */
2867
3212
  declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplateDocument>;
2868
3213
  /**
@@ -2873,6 +3218,10 @@ declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: st
2873
3218
  *
2874
3219
  * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
2875
3220
  * ```
3221
+ *
3222
+ * @group Template Documents
3223
+ * @api DELETE /v2/templates/:temlate_id/documents/:document_id Delete a template document
3224
+ * @apiSuccess string . Success
2876
3225
  */
2877
3226
  declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<any>;
2878
3227
  /**