@verdocs/js-sdk 3.10.3 → 3.10.5

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, IEnvelopeDocument, IEnvelopeFieldSettings, IEnvelopeSummaries } from './Types';
1
+ import { IEnvelope, IEnvelopesSummary, IRecipient, IEnvelopeDocument, IEnvelopeFieldSettings } from './Types';
2
2
  import { ICreateEnvelopeRole, IEnvelopesSearchResult, ISigningSessionRequest } from './Types';
3
3
  import { TEnvelopeUpdateResult, TEnvelopeStatus, TRecipientStatus } from './Types';
4
4
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
@@ -146,9 +146,14 @@ export declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string
146
146
  export declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<IEnvelopeDocument>;
147
147
  /**
148
148
  * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
149
- * be accessed immediately and never shared.
149
+ * be accessed immediately and never shared. Content-Disposition will be set to "download".
150
150
  */
151
- export declare const getEnvelopeDocumentLink: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<string>;
151
+ export declare const getDocumentDownloadLink: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<string>;
152
+ /**
153
+ * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should
154
+ * be accessed immediately and never shared. Content-Disposition will be set to "inline".
155
+ */
156
+ export declare const getDocumentPreviewLink: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<string>;
152
157
  /**
153
158
  * Cancel an Envelope.
154
159
  */
@@ -209,32 +214,23 @@ export interface ITimeRange {
209
214
  end: string;
210
215
  }
211
216
  export interface IListEnvelopesParams {
212
- match?: string;
213
- name?: string;
214
- recipient_name?: string;
215
- field_value?: string;
216
- visibility?: 'private' | 'shared';
217
- status?: ('pending' | 'in progress' | 'complete' | 'declined' | 'canceled')[];
218
- recipient_status?: ('pending' | 'invited' | 'declined' | 'opened' | 'signed' | 'submitted' | 'canceled')[];
219
- recipient_id?: string;
220
- updated_at?: ITimeRange;
221
- canceled_at?: ITimeRange;
217
+ status?: string[];
218
+ q?: string;
222
219
  created_at?: ITimeRange;
223
220
  is_owner?: boolean;
224
- is_recipient?: boolean;
221
+ sort_by?: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status';
225
222
  template_id?: string;
226
- sort?: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status';
227
- direction?: 'asc' | 'desc';
228
- page?: number;
223
+ ascending?: boolean;
229
224
  rows?: number;
225
+ page?: number;
230
226
  }
231
- /**
232
- * Lists all templates accessible by the caller, with optional filters.
227
+ /**a
228
+ * Lists all envelopes accessible by the caller, with optional filters.
233
229
  *
234
230
  * ```typescript
235
- * import {Envelopes} from '@verdocs/js-sdk/Templates';
231
+ * import {Envelopes} from '@verdocs/js-sdk/Envelopes';
236
232
  *
237
- * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { name: 'test', sort: 'updated_at' });
233
+ * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created)at' });
238
234
  * ```
239
235
  */
240
- export declare const listEnvelopes: (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) => Promise<IEnvelopeSummaries>;
236
+ export declare const listEnvelopes: (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) => Promise<IEnvelope[]>;
@@ -155,12 +155,23 @@ export var getEnvelopeDocument = function (endpoint, envelopeId, documentId) { r
155
155
  }); };
156
156
  /**
157
157
  * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
158
- * be accessed immediately and never shared.
158
+ * be accessed immediately and never shared. Content-Disposition will be set to "download".
159
159
  */
160
- export var getEnvelopeDocumentLink = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {
160
+ export var getDocumentDownloadLink = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {
161
161
  return __generator(this, function (_a) {
162
162
  return [2 /*return*/, endpoint.api //
163
- .get("/envelopes/".concat(envelopeId, "/envelope_documents/").concat(documentId, "?link=true"))
163
+ .get("/envelopes/".concat(envelopeId, "/envelope_documents/").concat(documentId, "?download=true"))
164
+ .then(function (r) { return r.data; })];
165
+ });
166
+ }); };
167
+ /**
168
+ * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should
169
+ * be accessed immediately and never shared. Content-Disposition will be set to "inline".
170
+ */
171
+ export var getDocumentPreviewLink = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {
172
+ return __generator(this, function (_a) {
173
+ return [2 /*return*/, endpoint.api //
174
+ .get("/envelopes/".concat(envelopeId, "/envelope_documents/").concat(documentId, "?preview=true"))
164
175
  .then(function (r) { return r.data; })];
165
176
  });
166
177
  }); };
@@ -316,17 +327,17 @@ export var throttledGetEnvelope = function (endpoint, envelopeId) {
316
327
  return envelope;
317
328
  });
318
329
  };
319
- /**
320
- * Lists all templates accessible by the caller, with optional filters.
330
+ /**a
331
+ * Lists all envelopes accessible by the caller, with optional filters.
321
332
  *
322
333
  * ```typescript
323
- * import {Envelopes} from '@verdocs/js-sdk/Templates';
334
+ * import {Envelopes} from '@verdocs/js-sdk/Envelopes';
324
335
  *
325
- * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { name: 'test', sort: 'updated_at' });
336
+ * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created)at' });
326
337
  * ```
327
338
  */
328
339
  export var listEnvelopes = function (endpoint, params) {
329
340
  return endpoint.api //
330
- .post('/envelopes/list', params, { baseURL: endpoint.getBaseURLv2() })
341
+ .post('/envelopes/list', params)
331
342
  .then(function (r) { return r.data; });
332
343
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.10.3",
3
+ "version": "3.10.5",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",