@verdocs/js-sdk 4.2.136 → 4.2.148

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.mjs CHANGED
@@ -885,6 +885,11 @@ var globalThis$1 = /*@__PURE__*/getDefaultExportFromCjs(globalThis_1);
885
885
  * const {access_token} = await Auth.authenticate({ client_id: '...', client_secret: '...', grant_type:'client_credentials' });
886
886
  * VerdocsEndpoint.getDefault().setAuthToken(access_token);
887
887
  * ```
888
+ *
889
+ * @group Authentication
890
+ * @api POST /v2/oauth2/token Authenticate
891
+ * @apiBody string(format: 'uuid') id The ID of the envelope to retrieve.
892
+ * @apiSuccess IAuthenticateResponse . The detailed metadata for the envelope requested
888
893
  */
889
894
  const authenticate = (endpoint, params) => endpoint.api //
890
895
  .post('/v2/oauth2/token', params)
@@ -1502,18 +1507,42 @@ class VerdocsEndpoint {
1502
1507
  * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};
1503
1508
  * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);
1504
1509
  * ```
1510
+ *
1511
+ * @group Envelopes
1512
+ * @api POST /v2/envelopes Create Envelope
1513
+ * @apiBody string(format:uuid) template_id The template to base the new Envelope from
1514
+ * @apiBody array(items:ICreateEnvelopeRecipient) recipients A list of recipients to include in the workflow. Must specify one recipient to match each template Role.
1515
+ * @apiBody string name? Override the name of the envelope (defaults to the template name).
1516
+ * @apiBody string description? Override the description of the envelope (defaults to the template description).
1517
+ * @apiBody array(items:IEnvelopeField) fields? Provide default values for fields in the envelope. Note that only "name", "role_name", and "default" should be set in this array.
1518
+ * @apiBody boolean no_contact? If set to true, no email or SMS messages will be sent to any recipients.
1519
+ * @apiBody integer(min: 0) initial_reminder? Override the template initial-reminder setting.
1520
+ * @apiBody integer(min: 0) followup_reminders? Override the template initial-reminder setting.
1521
+ * @apiSuccess IEnvelope . The newly-created envelope.
1505
1522
  */
1506
1523
  const createEnvelope = async (endpoint, request) => endpoint.api //
1507
1524
  .post('/v2/envelopes', request)
1508
1525
  .then((r) => r.data);
1509
1526
  /**
1510
- * Get all metadata for an Envelope.
1527
+ * Get all metadata for an envelope. Note that when called by non-creators (e.g. Recipients)
1528
+ * this will return only the **metadata** the caller is allowed to view.
1529
+ *
1530
+ * @group Envelopes
1531
+ * @api GET /v2/envelopes/:id Get Envelope Details
1532
+ * @apiParam string(format: 'uuid') id The ID of the envelope to retrieve.
1533
+ * @apiSuccess IEnvelope . The detailed metadata for the envelope requested
1511
1534
  */
1512
1535
  const getEnvelope = async (endpoint, envelopeId) => endpoint.api //
1513
1536
  .get(`/v2/envelopes/${envelopeId}`)
1514
1537
  .then((r) => r.data);
1515
1538
  /**
1516
- * Get an Envelope Document
1539
+ * Get all metadata for an envelope document. Note that when called by non-creators (e.g. Recipients)
1540
+ * this will return only the **metadata** the caller is allowed to view.
1541
+ *
1542
+ * @group Envelopes
1543
+ * @api GET /envelopes/:id Get Envelope Details
1544
+ * @apiParam string(format: 'uuid') id The ID of the document to retrieve.
1545
+ * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested
1517
1546
  */
1518
1547
  const getEnvelopeDocument = async (endpoint, envelopeId, documentId) => endpoint.api //
1519
1548
  .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}`)
@@ -1521,6 +1550,15 @@ const getEnvelopeDocument = async (endpoint, envelopeId, documentId) => endpoint
1521
1550
  /**
1522
1551
  * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
1523
1552
  * be accessed immediately and never shared. Content-Disposition will be set to "download".
1553
+ *
1554
+ * @group Envelopes
1555
+ * @api GET /envelopes/:envelope_id/envelope_documents/:document_id Preview, Download, or Link to a Document
1556
+ * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1557
+ * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1558
+ * @apiQuery boolean download? Set to true to generate a download link (content-disposition: download).
1559
+ * @apiQuery boolean preview? Set to true to generate a preview link (content-disposition: inline).
1560
+ * @apiQuery boolean file? Set to true to return the raw binary BLOB data of the file rather than a link.
1561
+ * @apiSuccess string . The generated link.
1524
1562
  */
1525
1563
  const getDocumentDownloadLink = async (endpoint, envelopeId, documentId) => endpoint.api //
1526
1564
  .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}?download=true`)
@@ -1534,6 +1572,12 @@ const getDocumentPreviewLink = async (endpoint, envelopeId, documentId) => endpo
1534
1572
  .then((r) => r.data);
1535
1573
  /**
1536
1574
  * Cancel an Envelope.
1575
+ *
1576
+ * @group Envelopes
1577
+ * @api PUT /v2/envelopes/:id Cancel envelope
1578
+ * @apiParam string(format: 'uuid') id The ID of the envelope to cancel.
1579
+ * @apiBody string(enum: 'cancel') action The action to perform (currently only "cancel" is supported).
1580
+ * @apiSuccess IEnvelope . The updated envelope.
1537
1581
  */
1538
1582
  const cancelEnvelope = async (endpoint, envelopeId) => endpoint.api //
1539
1583
  .put(`/v2/envelopes/${envelopeId}`, { action: 'cancel' })
@@ -1548,32 +1592,68 @@ const getEnvelopeFile = async (endpoint, envelopeId, documentId) => endpoint.api
1548
1592
  .then((r) => r.data);
1549
1593
  /**
1550
1594
  * Update an envelope. Currently, only reminder settings may be changed.
1595
+ *
1596
+ * @group Envelopes
1597
+ * @api PATCH /v2/envelopes/:id Update Envelope
1598
+ * @apiParam string(format: 'uuid') id The ID of the envelope to update.
1599
+ * @apiBody IEnvelope . Set of fields to update. Omit (leave undefined) any fields that should not be changed.
1600
+ * @apiSuccess IEnvelope . A copy of the newly-updated envelope.
1551
1601
  */
1552
1602
  const updateEnvelope = async (endpoint, envelopeId, params) => endpoint.api //
1553
1603
  .patch(`/v2/envelopes/${envelopeId}`, params)
1554
1604
  .then((r) => r.data);
1555
1605
  /**
1556
1606
  * Update a Document field. Typically called during the signing process as a Recipient fills in fields.
1607
+ *
1608
+ * @group Envelopes
1609
+ * @api PUT /envelopes/:envelope_id/fields/:field_name Update Envelope Field
1610
+ * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1611
+ * @apiParam string field_name The name of the field to update. Be sure to URL-encode the value.
1612
+ * @apiBody IEnvelopeFieldSettings . Set of properties to update. Leave undefined any properties that should not be changed.
1613
+ * @apiSuccess IEnvelope . A copy of the newly-updated field.
1557
1614
  */
1558
1615
  const updateEnvelopeField = async (endpoint, envelopeId, fieldName, value) => endpoint.api //
1559
1616
  .put(`/envelopes/${envelopeId}/fields/${fieldName}`, value)
1560
1617
  .then((r) => r.data);
1561
1618
  /**
1562
- * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a
1563
- * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.
1619
+ * Apply a signature to a signature field. Signature fields are ID-driven. Call `createSignature()`
1620
+ * first to create a signature for a Recipient, then call `updateEnvelopeFieldSignature()` to
1621
+ * attach it to a field.
1622
+ *
1623
+ * @group Envelopes
1624
+ * @api PUT /envelopes/:envelope_id/fields/:field_name/signature/:signature_id Update Envelope
1625
+ * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to update.
1626
+ * @apiParam string field_name The name of the field to update. Be sure to URL-encode the value.
1627
+ * @apiParam string(format: 'uuid') signature_id The ID of the signature to attach.
1628
+ * @apiSuccess IEnvelopeFieldSettings . A copy of the newly-updated field.
1564
1629
  */
1565
1630
  const updateEnvelopeFieldSignature = async (endpoint, envelopeId, fieldName, signatureId) => endpoint.api //
1566
1631
  .put(`/envelopes/${envelopeId}/fields/${fieldName}/signature/${signatureId}`)
1567
1632
  .then((r) => r.data);
1568
1633
  /**
1569
- * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a
1570
- * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.
1634
+ * Apply an initial to an initials field. Initial fields are ID-driven. Call `createInitial()`
1635
+ * first to create an initial block for a Recipient, then call `supdateEnvelopeFieldInitials()` to
1636
+ * attach it to a field.
1637
+ *
1638
+ * @group Envelopes
1639
+ * @api PUT /envelopes/:envelope_id/fields/:field_name/initial/:initial_id Update Envelope
1640
+ * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to update.
1641
+ * @apiParam string field_name The name of the field to update. Be sure to URL-encode the value.
1642
+ * @apiParam string(format: 'uuid') initial_id The ID of the initial block to attach.
1643
+ * @apiSuccess IEnvelopeFieldSettings . A copy of the newly-updated field.
1571
1644
  */
1572
1645
  const updateEnvelopeFieldInitials = async (endpoint, envelopeId, fieldName, initialId) => endpoint.api //
1573
1646
  .put(`/envelopes/${envelopeId}/fields/${fieldName}/initial/${initialId}`)
1574
1647
  .then((r) => r.data);
1575
1648
  /**
1576
- * Upload an attachment.
1649
+ * Upload an attachment to an attachment field
1650
+ *
1651
+ * @group Envelopes
1652
+ * @api PUT /envelopes/:envelope_id/fields/:field_name Upload or Delete Attachment
1653
+ * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to update.
1654
+ * @apiParam string field_name The name of the field to update. Be sure to URL-encode the value.
1655
+ * @apiBody string document The file to attach. Must contain standard File object fields. If omitted, the attachment will be deleted instead.
1656
+ * @apiSuccess IEnvelopeFieldSettings . A copy of the newly-updated field.
1577
1657
  */
1578
1658
  const uploadEnvelopeFieldAttachment = async (endpoint, envelopeId, fieldName, file, onUploadProgress) => {
1579
1659
  const formData = new FormData();
@@ -1590,7 +1670,9 @@ const uploadEnvelopeFieldAttachment = async (endpoint, envelopeId, fieldName, fi
1590
1670
  .then((r) => r.data);
1591
1671
  };
1592
1672
  /**
1593
- * Delete an attachment.
1673
+ * Delete an attachment. Note that this is not a DELETE endpoint because the field itself is not
1674
+ * being deleted. Instead, it is a similar operation to uploading a new attachment, but the
1675
+ * omission of the attachment signals the server to delete the current entry.
1594
1676
  */
1595
1677
  const deleteEnvelopeFieldAttachment = async (endpoint, envelopeId, fieldName) => {
1596
1678
  const formData = new FormData();
@@ -1600,7 +1682,13 @@ const deleteEnvelopeFieldAttachment = async (endpoint, envelopeId, fieldName) =>
1600
1682
  .then((r) => r.data);
1601
1683
  };
1602
1684
  /**
1603
- * Get the attached file for an attachment field (if any)
1685
+ * Get the attached file for an attachment field (if any).
1686
+ *
1687
+ * @group Envelopes
1688
+ * @api GET /envelopes/:envelope_id/fields/:field_name/document Download attachment in binary format
1689
+ * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1690
+ * @apiParam string field_name The name of the field from which to download the attachment.
1691
+ * @apiSuccess string . The file binary data.
1604
1692
  */
1605
1693
  const getFieldAttachment = async (endpoint, envelopeId, fieldName) => endpoint.api //
1606
1694
  .get(`/envelopes/${envelopeId}/fields/${fieldName}/document`, { responseType: 'blob' })
@@ -1609,6 +1697,13 @@ const getFieldAttachment = async (endpoint, envelopeId, fieldName) => endpoint.a
1609
1697
  * Get a display URI for a given page in a file attached to an envelope document. These pages are rendered server-side
1610
1698
  * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended
1611
1699
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.
1700
+ *
1701
+ * @group Envelopes
1702
+ * @api GET /v2/envelope-documnets/page-image/:document_id/:variant/:page Get Document Page Display URI
1703
+ * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1704
+ * @apiParam string(enum: 'original'|'filled') variant The variant of the document to retrieve.
1705
+ * @apiParam integer page The page number to retrieve
1706
+ * @apiSuccess string . The page display URI. Note that this is a signed URL with a short expiration. It should be used immediately and never databased or cached.
1612
1707
  */
1613
1708
  const getEnvelopeDocumentPageDisplayUri = async (endpoint, documentId, page, variant = 'original') => endpoint.api.get(`/v2/envelope-documents/page-image/${documentId}/${variant}/${page}`, { timeout: 20000 }).then((r) => r.data);
1614
1709
  /**
@@ -1619,6 +1714,24 @@ const getEnvelopeDocumentPageDisplayUri = async (endpoint, documentId, page, var
1619
1714
  *
1620
1715
  * const {count, envelopes} = await getEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test' });
1621
1716
  * ```
1717
+ *
1718
+ * @group Envelopes
1719
+ * @api GET /v2/envelopes List Envelopes
1720
+ * @apiQuery string q? Match envelopes whose name contains this string
1721
+ * @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.
1722
+ * @apiQuery array(items: 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled') status? Match envelopes in one of the specified states.
1723
+ * @apiQuery boolean(default: false) include_org? If true, include organizations-shared envelopes
1724
+ * @apiQuery string(format: uuid) template_id? Match envelopes created from the specified template ID
1725
+ * @apiQuery string(format: date-time) created_before? Match envelopes created before this date
1726
+ * @apiQuery string(format: date-time) created_after? Match envelopes created after this date
1727
+ * @apiQuery string(enum: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status') sort_by? Return results sorted by this criteria
1728
+ * @apiQuery boolean ascending? Set true/false to override the sort direction. Note that the default depends on `sort_by`. Date-based sorts default to descending, while name and status default to ascending.
1729
+ * @apiQuery integer(default: 20) rows? Limit the number of rows returned
1730
+ * @apiQuery integer(default: 0) page? Specify which page of results to return
1731
+ * @apiSuccess integer(format: int32) count The total number of records matching the query, helpful for pagination
1732
+ * @apiSuccess integer(format: int32) rows The number of rows returned in this response page
1733
+ * @apiSuccess integer(format: int32) page The page number of this response
1734
+ * @apiSuccess array(items: IEnvelope) envelopes List of envelopes found
1622
1735
  */
1623
1736
  const getEnvelopes = (endpoint, params) => endpoint.api //
1624
1737
  .get('/v2/envelopes', { params })
@@ -1629,6 +1742,11 @@ const getEnvelopes = (endpoint, params) => endpoint.api //
1629
1742
  * an initials block to be used for all initials fields in the document. Thus, this is typically called one time to
1630
1743
  * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field
1631
1744
  * to be "stamped" by the user.
1745
+ *
1746
+ * @group Signatures and Initials
1747
+ * @api POST /initials Create Initial Block
1748
+ * @apiBody string initial Blob containing initials image to store.
1749
+ * @apiSuccess IInitial . The newly-created initial block.
1632
1750
  */
1633
1751
  const createInitials = (endpoint, name, initials) => {
1634
1752
  const data = new FormData();
@@ -1664,12 +1782,24 @@ const submitKbaIdentity = (endpoint, envelope_id, role_name, identity) => endpoi
1664
1782
  * Submit an identity response to a KBA challenge. Answers should be submitted in the same order as
1665
1783
  * the challenges were listed in `IRecipientKbaStepChallenge.questions`.
1666
1784
  */
1667
- const submitKbaChallengeResponse = (endpoint, envelope_id, role_name, response) => endpoint.api //
1668
- .post(`/v2/kba/response`, { envelope_id, role_name, response })
1785
+ const submitKbaChallengeResponse = (endpoint, envelope_id, role_name, responses) => endpoint.api //
1786
+ .post(`/v2/kba/response`, { envelope_id, role_name, responses })
1669
1787
  .then((r) => r.data);
1670
1788
 
1671
1789
  /**
1672
- * Update a recipient's status block
1790
+ * Update a recipient's status.
1791
+ *
1792
+ * @group Recipients
1793
+ * @api PUT /envelopes/:envelope_id/recipients/:role_name Update Recipient Status
1794
+ * @apiParam string(format:uuid) envelope_id The envelope to operate on.
1795
+ * @apiParam string role_name The role to adjust.
1796
+ * @apiBody string(enum:'submit'|'decline'|'owner_update'|'update'|'prepare') action The action to take. Adjusts the status, and may also perform other operations.
1797
+ * @apiBody string first_name? Ignored unless action is 'owner_update' or 'update'. The new owner's or recipient's first name.
1798
+ * @apiBody string last_name? Ignored unless action is 'owner_update' or 'update'. The new owner's or recipient's last name.
1799
+ * @apiBody string email? Ignored unless action is 'owner_update'. The new owner's email address.
1800
+ * @apiBody boolean agreed? Ignored unless action is 'update'. Set to true to accept the e-signing disclosures.
1801
+ * @apiBody array(items:IRecipient) recipients? Ignored unless action is 'prepare'. A list of recipients and their fields to set defaults for.
1802
+ * @apiSuccess IRecipient . The updated Recipient.
1673
1803
  */
1674
1804
  const updateRecipient = async (endpoint, envelope_id, role_name, params) => endpoint.api //
1675
1805
  .put(`/envelopes/${envelope_id}/recipients/${role_name}`, params)
@@ -1700,10 +1830,17 @@ const envelopeRecipientUpdateName = (endpoint, envelopeId, roleName, first_name,
1700
1830
  const envelopeRecipientPrepare = (endpoint, envelopeId, roleName, recipients) => updateRecipient(endpoint, envelopeId, roleName, { action: 'prepare', recipients });
1701
1831
  /**
1702
1832
  * Begin a signing session for an Envelope. This path requires an invite code, and should generally
1703
- * be called with a NON-default endpoint to avoid conflicting with any active user session the user
1833
+ * be called with a NON-default Endpoint to avoid conflicting with any active user session the user
1704
1834
  * may have. To initiate in-person signing by an authenticated user (e.g. self-signing), call
1705
1835
  * getInPersonLink() instead. The response from that call includes both a link for direct signing
1706
1836
  * via a Web browser as well as an in-person access_key. That access_key.key may be used here as well.
1837
+ *
1838
+ * @group Recipients
1839
+ * @api POST /v2/sign/unauth/:envelope_id/:role_name/:key Start Signing Session
1840
+ * @apiParam string(format:uuid) envelope_id The envelope to operate on.
1841
+ * @apiParam string role_name The role to request.
1842
+ * @apiParam string key Access key generated by the envelope creator or email/SMS invite.
1843
+ * @apiSuccess ISignerTokenResponse . Signing session token and envelope/recipient metadata.
1707
1844
  */
1708
1845
  const startSigningSession = async (endpoint, envelope_id, role_name, key) => {
1709
1846
  return endpoint.api //
@@ -1714,7 +1851,18 @@ const startSigningSession = async (endpoint, envelope_id, role_name, key) => {
1714
1851
  });
1715
1852
  };
1716
1853
  /**
1717
- * Get an in-person signing link.
1854
+ * Get an in-person signing link. Must be called by the owner/creator of the envelope. The response
1855
+ * also includes the raw access key that may be used to directly initiate a signing session (see
1856
+ * `startSigningSession`) as well as an access token representing a valid signing session for
1857
+ * immediate use in embeds or other applications. Note that in-person signing is considered a
1858
+ * lower-security operation than authenticated signing, and the final envelope certificate will
1859
+ * reflect this.
1860
+ *
1861
+ * @group Recipients
1862
+ * @api POST /v2/sign/in-person/:envelope_id/:role_name Get In-Person Signing Link
1863
+ * @apiParam string(format:uuid) envelope_id The envelope to operate on.
1864
+ * @apiParam string role_name The role to request.
1865
+ * @apiSuccess IInPersonLinkResponse . Signing session token and envelope/recipient metadata.
1718
1866
  */
1719
1867
  const getInPersonLink = (endpoint, envelope_id, role_name) => endpoint.api //
1720
1868
  .post(`/v2/sign/in-person/${envelope_id}/${encodeURIComponent(role_name)}`)
@@ -1726,7 +1874,17 @@ const sendDelegate = (endpoint, envelopeId, roleName) => endpoint.api //
1726
1874
  .post(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`)
1727
1875
  .then((r) => r.data);
1728
1876
  /**
1729
- * Resend a recipient's invitation.
1877
+ * Resend a recipient's invitation. NOTE: User interfaces should rate-limit this operation to
1878
+ * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
1879
+ * the calling application to prevent abuse. This endpoint will return a 200 OK even if the
1880
+ * no_contact flag is set on the envelope (in which case the call will be ignored).
1881
+ *
1882
+ * @group Recipients
1883
+ * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Resend Invitation
1884
+ * @apiParam string(format:uuid) envelope_id The envelope to operate on.
1885
+ * @apiParam string role_name The role to operate on.
1886
+ * @apiBody string(enum:'resend') action The operation to perform.
1887
+ * @apiSuccess string . Success message.
1730
1888
  */
1731
1889
  const resendInvitation = (endpoint, envelopeId, roleName) => endpoint.api //
1732
1890
  .put(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, { action: 'resend' })
@@ -1810,6 +1968,12 @@ const getNextRecipient = (envelope) => {
1810
1968
  * a signature block to be used for all signature fields in the document. Thus, this is typically called one time to
1811
1969
  * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field
1812
1970
  * to be "stamped" by the user.
1971
+ *
1972
+ * @group Signatures and Initials
1973
+ * @api POST /signatures Create Signature Block
1974
+ *
1975
+ * @apiBody string signature Blob containing signature image to store.
1976
+ * @apiSuccess ISignature . The newly-created signature block.
1813
1977
  */
1814
1978
  const createSignature = (endpoint, name, signature) => {
1815
1979
  const data = new FormData();
@@ -1819,19 +1983,34 @@ const createSignature = (endpoint, name, signature) => {
1819
1983
  .then((r) => r.data);
1820
1984
  };
1821
1985
  /**
1822
- * Get the availbable signatures for a user.
1986
+ * Get the available signatures for a user.
1987
+ *
1988
+ * @group Signatures and Initials
1989
+ * @api GET /signatures Create Signature Block
1990
+ *
1991
+ * @apiSuccess array(items:ISignature) . A list of signatures previously stored for the user.
1823
1992
  */
1824
1993
  const getSignatures = (endpoint) => endpoint.api //
1825
1994
  .get('/signatures')
1826
1995
  .then((r) => r.data);
1827
1996
  /**
1828
1997
  * Get a user's signature by ID.
1998
+ *
1999
+ * @group Signatures and Initials
2000
+ * @api GET /signatures/:id Delete Signature Block
2001
+ * @apiParam string(format: 'uuid') id The ID of the signature to delete.
2002
+ * @apiSuccess ISignature . The signature metadata requested.
1829
2003
  */
1830
2004
  const getSignature = (endpoint, signatureId) => endpoint.api //
1831
2005
  .get(`/signatures/${signatureId}`)
1832
2006
  .then((r) => r.data);
1833
2007
  /**
1834
2008
  * Delete a user's signature.
2009
+ *
2010
+ * @group Signatures and Initials
2011
+ * @api DELETE /signatures/:id Delete Signature Block
2012
+ * @apiParam string(format: 'uuid') id The ID of the signature to delete.
2013
+ * @apiSuccess string . OK
1835
2014
  */
1836
2015
  const deleteSignature = (endpoint, signatureId) => endpoint.api //
1837
2016
  .delete(`/signatures/${signatureId}`)
@@ -2744,6 +2923,21 @@ const getAllTags = (endpoint) => endpoint.api //
2744
2923
  * await getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });
2745
2924
  * await getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });
2746
2925
  * ```
2926
+ *
2927
+ * @group Templates
2928
+ * @api GET /v2/templates Get Templates
2929
+ * @apiQuery string q? Find templates whose names/descriptions contain the specified query string
2930
+ * @apiQuery boolean is_starred? If true, returns only templates with at least one "star".
2931
+ * @apiQuery boolean is_creator? If true, returns only templates that the caller created.
2932
+ * @apiQuery string(enum: 'private_shared' | 'private' | 'shared' | 'public') visibility? Return only templates with the specified visibility.
2933
+ * @apiQuery string(enum: 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter') sort_by? Return results sorted by this criteria
2934
+ * @apiQuery boolean ascending? Set true/false to override the sort direction. Note that the default depends on `sort_by`. Date-based sorts default to descending, while name defaults to ascending.
2935
+ * @apiQuery integer(default: 20) rows? Limit the number of rows returned
2936
+ * @apiQuery integer(default: 0) page? Specify which page of results to return
2937
+ * @apiSuccess integer(format: int32) count The total number of records matching the query, helpful for pagination
2938
+ * @apiSuccess integer(format: int32) rows The number of rows returned in this response page
2939
+ * @apiSuccess integer(format: int32) page The page number of this response
2940
+ * @apiSuccess array(items: ITemplate) templates List of templates found
2747
2941
  */
2748
2942
  const getTemplates = (endpoint, params) => endpoint.api //
2749
2943
  .get('/v2/templates', { params })