@verdocs/js-sdk 6.2.0-beta.5 → 6.2.0-beta.8

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
@@ -161,8 +161,6 @@ interface ISigningSession {
161
161
  // @deprecated
162
162
  ["https://verdocs.com/session_type"]: "signing";
163
163
  // @deprecated
164
- ["https://verdocs.com/key_type"]: TAccessKeyType;
165
- // @deprecated
166
164
  ["https://verdocs.com/envelope_id"]: string;
167
165
  // @deprecated
168
166
  ["https://verdocs.com/role_name"]: string;
@@ -1814,6 +1812,7 @@ declare const getEnvelopes: (endpoint: VerdocsEndpoint, params?: IListEnvelopesP
1814
1812
  */
1815
1813
  declare const getEnvelopesZip: (endpoint: VerdocsEndpoint, envelope_ids: string[]) => Promise<import("axios").AxiosResponse<any, any, {}>>;
1816
1814
  declare const isFieldFilled: (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => boolean | "" | null;
1815
+ // TODO: Only allow !required to bypass validation if the field is empty.
1817
1816
  declare const isFieldValid: (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => boolean | "" | null;
1818
1817
  /**
1819
1818
  * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to
@@ -3527,12 +3526,13 @@ declare const toggleTemplateStar: (endpoint: VerdocsEndpoint, templateId: string
3527
3526
  * ```typescript
3528
3527
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
3529
3528
  *
3530
- * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
3529
+ * await TemplateDocument.createDocument(VerdocsEndpoint.getDefault(), templateID, params);
3531
3530
  * ```
3532
3531
  *
3533
3532
  * @group Template Documents
3534
3533
  * @api POST /v2/templates/:template_id/documents Attach a document to a template
3535
3534
  * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.
3535
+ * @apiBody string(format:uuid) template_id Template ID to attach the document to
3536
3536
  * @apiSuccess ITemplateDocument . Template document
3537
3537
  */
3538
3538
  declare const createTemplateDocument: (endpoint: VerdocsEndpoint, template_id: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplateDocument>;
@@ -3540,16 +3540,16 @@ declare const createTemplateDocument: (endpoint: VerdocsEndpoint, template_id: s
3540
3540
  * Delete a specific Document.
3541
3541
  *
3542
3542
  * ```typescript
3543
- * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
3543
+ * import {deleteTemplateDocument} from '@verdocs/js-sdk/Templates';
3544
3544
  *
3545
- * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
3545
+ * await deleteTemplateDocument(VerdocsEndpoint.getDefault(), documentID);
3546
3546
  * ```
3547
3547
  *
3548
3548
  * @group Template Documents
3549
- * @api DELETE /v2/templates/:temlate_id/documents/:document_id Delete a template document
3549
+ * @api DELETE /v2/template-documents/:document_id Delete a template document
3550
3550
  * @apiSuccess string . Success
3551
3551
  */
3552
- declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplate>;
3552
+ declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, documentId: string) => Promise<ITemplate>;
3553
3553
  /**
3554
3554
  * Get all metadata for a template document. Note that when called by non-creators (e.g. Org Collaborators)
3555
3555
  * this will return only the **metadata** the caller is allowed to view.
package/dist/index.d.ts CHANGED
@@ -161,8 +161,6 @@ interface ISigningSession {
161
161
  // @deprecated
162
162
  ["https://verdocs.com/session_type"]: "signing";
163
163
  // @deprecated
164
- ["https://verdocs.com/key_type"]: TAccessKeyType;
165
- // @deprecated
166
164
  ["https://verdocs.com/envelope_id"]: string;
167
165
  // @deprecated
168
166
  ["https://verdocs.com/role_name"]: string;
@@ -1814,6 +1812,7 @@ declare const getEnvelopes: (endpoint: VerdocsEndpoint, params?: IListEnvelopesP
1814
1812
  */
1815
1813
  declare const getEnvelopesZip: (endpoint: VerdocsEndpoint, envelope_ids: string[]) => Promise<import("axios").AxiosResponse<any, any, {}>>;
1816
1814
  declare const isFieldFilled: (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => boolean | "" | null;
1815
+ // TODO: Only allow !required to bypass validation if the field is empty.
1817
1816
  declare const isFieldValid: (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => boolean | "" | null;
1818
1817
  /**
1819
1818
  * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to
@@ -3527,12 +3526,13 @@ declare const toggleTemplateStar: (endpoint: VerdocsEndpoint, templateId: string
3527
3526
  * ```typescript
3528
3527
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
3529
3528
  *
3530
- * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
3529
+ * await TemplateDocument.createDocument(VerdocsEndpoint.getDefault(), templateID, params);
3531
3530
  * ```
3532
3531
  *
3533
3532
  * @group Template Documents
3534
3533
  * @api POST /v2/templates/:template_id/documents Attach a document to a template
3535
3534
  * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.
3535
+ * @apiBody string(format:uuid) template_id Template ID to attach the document to
3536
3536
  * @apiSuccess ITemplateDocument . Template document
3537
3537
  */
3538
3538
  declare const createTemplateDocument: (endpoint: VerdocsEndpoint, template_id: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplateDocument>;
@@ -3540,16 +3540,16 @@ declare const createTemplateDocument: (endpoint: VerdocsEndpoint, template_id: s
3540
3540
  * Delete a specific Document.
3541
3541
  *
3542
3542
  * ```typescript
3543
- * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
3543
+ * import {deleteTemplateDocument} from '@verdocs/js-sdk/Templates';
3544
3544
  *
3545
- * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
3545
+ * await deleteTemplateDocument(VerdocsEndpoint.getDefault(), documentID);
3546
3546
  * ```
3547
3547
  *
3548
3548
  * @group Template Documents
3549
- * @api DELETE /v2/templates/:temlate_id/documents/:document_id Delete a template document
3549
+ * @api DELETE /v2/template-documents/:document_id Delete a template document
3550
3550
  * @apiSuccess string . Success
3551
3551
  */
3552
- declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplate>;
3552
+ declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, documentId: string) => Promise<ITemplate>;
3553
3553
  /**
3554
3554
  * Get all metadata for a template document. Note that when called by non-creators (e.g. Org Collaborators)
3555
3555
  * this will return only the **metadata** the caller is allowed to view.
package/dist/index.js CHANGED
@@ -2440,17 +2440,18 @@ const toggleTemplateStar = (endpoint, templateId) => endpoint.api //
2440
2440
  * ```typescript
2441
2441
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
2442
2442
  *
2443
- * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
2443
+ * await TemplateDocument.createDocument(VerdocsEndpoint.getDefault(), templateID, params);
2444
2444
  * ```
2445
2445
  *
2446
2446
  * @group Template Documents
2447
2447
  * @api POST /v2/templates/:template_id/documents Attach a document to a template
2448
2448
  * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.
2449
+ * @apiBody string(format:uuid) template_id Template ID to attach the document to
2449
2450
  * @apiSuccess ITemplateDocument . Template document
2450
2451
  */
2451
2452
  const createTemplateDocument = (endpoint, template_id, file, onUploadProgress) => {
2452
2453
  const formData = new FormData();
2453
- formData.append('document', file, file.name);
2454
+ formData.append('file', file, file.name);
2454
2455
  formData.append('template_id', template_id);
2455
2456
  return endpoint.api //
2456
2457
  .post(`/v2/template-documents`, formData, {
@@ -2467,17 +2468,17 @@ const createTemplateDocument = (endpoint, template_id, file, onUploadProgress) =
2467
2468
  * Delete a specific Document.
2468
2469
  *
2469
2470
  * ```typescript
2470
- * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
2471
+ * import {deleteTemplateDocument} from '@verdocs/js-sdk/Templates';
2471
2472
  *
2472
- * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
2473
+ * await deleteTemplateDocument(VerdocsEndpoint.getDefault(), documentID);
2473
2474
  * ```
2474
2475
  *
2475
2476
  * @group Template Documents
2476
- * @api DELETE /v2/templates/:temlate_id/documents/:document_id Delete a template document
2477
+ * @api DELETE /v2/template-documents/:document_id Delete a template document
2477
2478
  * @apiSuccess string . Success
2478
2479
  */
2479
- const deleteTemplateDocument = (endpoint, templateId, documentId) => endpoint.api //
2480
- .delete(`/v2/templates/${templateId}/documents/${documentId}`)
2480
+ const deleteTemplateDocument = (endpoint, documentId) => endpoint.api //
2481
+ .delete(`/v2/template-documents/${documentId}`)
2481
2482
  .then((r) => r.data);
2482
2483
  /**
2483
2484
  * Get all metadata for a template document. Note that when called by non-creators (e.g. Org Collaborators)
@@ -2610,6 +2611,7 @@ const isFieldFilled = (field, allRecipientFields) => {
2610
2611
  return false;
2611
2612
  }
2612
2613
  };
2614
+ // TODO: Only allow !required to bypass validation if the field is empty.
2613
2615
  const isFieldValid = (field, allRecipientFields) => {
2614
2616
  return !field.required || isFieldFilled(field, allRecipientFields);
2615
2617
  };