@verdocs/js-sdk 3.0.2 → 3.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.
@@ -1,4 +1,4 @@
1
- import { IEnvelope, IEnvelopesSummary, IRecipient, ISigningSession, TEnvelopeUpdateResult, IDocumentFieldSettings } from './Types';
1
+ import { IEnvelope, IEnvelopesSummary, IRecipient, ISigningSession, TEnvelopeUpdateResult, IDocumentFieldSettings, IEnvelopeDocument } from './Types';
2
2
  import { ICreateEnvelopeRole, IEnvelopesSearchResult, ISigningSessionRequest } from './Types';
3
3
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
4
4
  export interface ICreateEnvelopeRequest {
@@ -76,6 +76,10 @@ export declare const getEnvelopeRecipients: (endpoint: VerdocsEndpoint, envelope
76
76
  * Get all metadata for an Envelope.
77
77
  */
78
78
  export declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) => Promise<IEnvelope>;
79
+ /**
80
+ * Get all metadata for an Envelope.
81
+ */
82
+ export declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<IEnvelopeDocument>;
79
83
  /**
80
84
  * Cancel an Envelope.
81
85
  */
@@ -143,6 +143,16 @@ export var getEnvelope = function (endpoint, envelopeId) { return __awaiter(void
143
143
  .then(function (r) { return r.data; })];
144
144
  });
145
145
  }); };
146
+ /**
147
+ * Get all metadata for an Envelope.
148
+ */
149
+ export var getEnvelopeDocument = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {
150
+ return __generator(this, function (_a) {
151
+ return [2 /*return*/, endpoint.api //
152
+ .get("/envelopes/".concat(envelopeId, "/envelope_documents/").concat(documentId))
153
+ .then(function (r) { return r.data; })];
154
+ });
155
+ }); };
146
156
  /**
147
157
  * Cancel an Envelope.
148
158
  */
@@ -11,30 +11,30 @@ import { ITemplateDocument } from './Types';
11
11
  * ```typescript
12
12
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
13
13
  *
14
- * await TemplateDocument.getDocuments((VerdocsEndpoint.getDefault(), templateID);
14
+ * await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);
15
15
  * ```
16
16
  */
17
17
  export declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateDocument[]>;
18
18
  /**
19
- * Create a Document for a particular Template.
19
+ * Get a specific Document.
20
20
  *
21
21
  * ```typescript
22
22
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
23
23
  *
24
- * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
24
+ * await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);
25
25
  * ```
26
26
  */
27
- export declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, file: File, onUploadProgress?: ((percent: number, loadedBytes: number, totalBytes: number) => void) | undefined) => Promise<ITemplateDocument>;
27
+ export declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplateDocument>;
28
28
  /**
29
- * Get a specific Document.
29
+ * Create a Document for a particular Template.
30
30
  *
31
31
  * ```typescript
32
32
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
33
33
  *
34
- * await TemplateDocument.getDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
34
+ * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
35
35
  * ```
36
36
  */
37
- export declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplateDocument>;
37
+ export declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, file: File, onUploadProgress?: ((percent: number, loadedBytes: number, totalBytes: number) => void) | undefined) => Promise<ITemplateDocument>;
38
38
  /**
39
39
  * Delete a specific Document.
40
40
  *
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  * ```typescript
46
46
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
47
47
  *
48
- * await TemplateDocument.getDocuments((VerdocsEndpoint.getDefault(), templateID);
48
+ * await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);
49
49
  * ```
50
50
  */
51
51
  export var getTemplateDocuments = function (endpoint, templateId) {
@@ -54,36 +54,36 @@ export var getTemplateDocuments = function (endpoint, templateId) {
54
54
  .then(function (r) { return r.data; });
55
55
  };
56
56
  /**
57
- * Create a Document for a particular Template.
57
+ * Get a specific Document.
58
58
  *
59
59
  * ```typescript
60
60
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
61
61
  *
62
- * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
62
+ * await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);
63
63
  * ```
64
64
  */
65
- export var createTemplateDocument = function (endpoint, templateId, file, onUploadProgress) {
66
- var formData = new FormData();
67
- formData.append('document', file, file.name);
65
+ export var getTemplateDocument = function (endpoint, templateId, documentId) {
68
66
  return endpoint.api //
69
- .post("/templates/".concat(templateId, "/documents"), formData, {
70
- timeout: 10000,
71
- onUploadProgress: function (event) { return onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((event.loaded * 100) / event.total), event.loaded, event.total); },
72
- })
67
+ .get("/templates/".concat(templateId, "/documents/").concat(documentId))
73
68
  .then(function (r) { return r.data; });
74
69
  };
75
70
  /**
76
- * Get a specific Document.
71
+ * Create a Document for a particular Template.
77
72
  *
78
73
  * ```typescript
79
74
  * import {TemplateDocument} from '@verdocs/js-sdk/Templates';
80
75
  *
81
- * await TemplateDocument.getDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
76
+ * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
82
77
  * ```
83
78
  */
84
- export var getTemplateDocument = function (endpoint, templateId, documentId) {
79
+ export var createTemplateDocument = function (endpoint, templateId, file, onUploadProgress) {
80
+ var formData = new FormData();
81
+ formData.append('document', file, file.name);
85
82
  return endpoint.api //
86
- .get("/templates/".concat(templateId, "/documents/").concat(documentId))
83
+ .post("/templates/".concat(templateId, "/documents"), formData, {
84
+ timeout: 10000,
85
+ onUploadProgress: function (event) { return onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((event.loaded * 100) / event.total), event.loaded, event.total); },
86
+ })
87
87
  .then(function (r) { return r.data; });
88
88
  };
89
89
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",