@verdocs/js-sdk 3.0.10 → 3.0.12

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.
@@ -75,7 +75,7 @@ export declare const getEnvelopeRecipients: (endpoint: VerdocsEndpoint, envelope
75
75
  /**
76
76
  * Get all metadata for an Envelope.
77
77
  */
78
- export declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) => Promise<IEnvelope>;
78
+ export declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string, ssr?: boolean) => Promise<IEnvelope>;
79
79
  /**
80
80
  * Get all metadata for an Envelope.
81
81
  */
@@ -136,10 +136,10 @@ export var getEnvelopeRecipients = function (endpoint, envelopeId) { return __aw
136
136
  /**
137
137
  * Get all metadata for an Envelope.
138
138
  */
139
- export var getEnvelope = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {
139
+ export var getEnvelope = function (endpoint, envelopeId, ssr) { return __awaiter(void 0, void 0, void 0, function () {
140
140
  return __generator(this, function (_a) {
141
141
  return [2 /*return*/, endpoint.api //
142
- .get("/envelopes/".concat(envelopeId))
142
+ .get("/envelopes/".concat(envelopeId) + (ssr ? '?ssr=true' : ''))
143
143
  .then(function (r) { return r.data; })];
144
144
  });
145
145
  }); };
@@ -1,14 +1,61 @@
1
- import { IInPersonAccessKey, TRecipientAction } from './Types';
1
+ import { IEnvelope, IRecipient, IInPersonAccessKey } from './Types';
2
2
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
3
- import { IEnvelope, IRecipient } from './Types';
4
- export interface IUpdateRecipientParams {
3
+ export interface IUpdateRecipientSubmitParams {
4
+ action: 'submit';
5
+ }
6
+ export interface IUpdateRecipientDeclineParams {
7
+ action: 'decline';
8
+ }
9
+ export interface IUpdateRecipientClaimEnvelope {
10
+ action: 'owner_update';
11
+ full_name: string;
12
+ email: string;
13
+ }
14
+ export interface IUpdateRecipientStatus {
5
15
  new_full_name?: string;
6
16
  agreed?: boolean;
17
+ action?: 'prepare' | 'update';
18
+ }
19
+ export interface IUpdateRecipientAgreedParams {
20
+ action: 'update';
21
+ agreed: boolean;
22
+ }
23
+ export interface IUpdateRecipientNameParams {
24
+ action: 'update';
25
+ new_full_name: string;
26
+ }
27
+ export interface IUpdateRecipientPrepareParams {
28
+ action: 'prepare';
29
+ recipients: IRecipient[];
7
30
  }
8
31
  /**
9
32
  * Update a recipient's status block
10
33
  */
11
- export declare const updateRecipientStatus: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, action: TRecipientAction, params?: IUpdateRecipientParams) => Promise<IRecipient>;
34
+ export declare const updateRecipient: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, params: IUpdateRecipientSubmitParams | IUpdateRecipientClaimEnvelope | IUpdateRecipientAgreedParams | IUpdateRecipientNameParams | IUpdateRecipientDeclineParams | IUpdateRecipientPrepareParams) => Promise<IRecipient>;
35
+ /**
36
+ * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.
37
+ */
38
+ export declare const envelopeRecipientSubmit: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) => Promise<IRecipient>;
39
+ /**
40
+ * Decline to complete an envelope (signing will not terminated).
41
+ */
42
+ export declare const envelopeRecipientDecline: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) => Promise<IRecipient>;
43
+ /**
44
+ * Claim / change ownership of an envelope. This is a special-case operation only available in certain workflows.
45
+ */
46
+ export declare const envelopeRecipientChangeOwner: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, email: string, fullName: string) => Promise<IRecipient>;
47
+ /**
48
+ * Agree to electronic signing.
49
+ */
50
+ export declare const envelopeRecipientAgree: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, agreed: boolean) => Promise<IRecipient>;
51
+ /**
52
+ * Change a recipient's name.
53
+ */
54
+ export declare const envelopeRecipientUpdateName: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, fullName: string) => Promise<IRecipient>;
55
+ /**
56
+ * Change a recipient's name.
57
+ */
58
+ export declare const envelopeRecipientPrepare: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, recipients: IRecipient[]) => Promise<IRecipient>;
12
59
  export interface ISignerTokenResponse {
13
60
  recipient: IRecipient;
14
61
  envelope: IEnvelope;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -48,13 +37,47 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
37
  /**
49
38
  * Update a recipient's status block
50
39
  */
51
- export var updateRecipientStatus = function (endpoint, envelopeId, roleName, action, params) { return __awaiter(void 0, void 0, void 0, function () {
40
+ export var updateRecipient = function (endpoint, envelopeId, roleName, params) { return __awaiter(void 0, void 0, void 0, function () {
52
41
  return __generator(this, function (_a) {
53
42
  return [2 /*return*/, endpoint.api //
54
- .put("/envelopes/".concat(envelopeId, "/recipients/").concat(roleName), __assign({ role_name: roleName, action: action }, (params || {})))
43
+ .put("/envelopes/".concat(envelopeId, "/recipients/").concat(roleName), params)
55
44
  .then(function (r) { return r.data; })];
56
45
  });
57
46
  }); };
47
+ /**
48
+ * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.
49
+ */
50
+ export var envelopeRecipientSubmit = function (endpoint, envelopeId, roleName) {
51
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'submit' });
52
+ };
53
+ /**
54
+ * Decline to complete an envelope (signing will not terminated).
55
+ */
56
+ export var envelopeRecipientDecline = function (endpoint, envelopeId, roleName) {
57
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'decline' });
58
+ };
59
+ /**
60
+ * Claim / change ownership of an envelope. This is a special-case operation only available in certain workflows.
61
+ */
62
+ export var envelopeRecipientChangeOwner = function (endpoint, envelopeId, roleName, email, fullName) { return updateRecipient(endpoint, envelopeId, roleName, { action: 'owner_update', email: email, full_name: fullName }); };
63
+ /**
64
+ * Agree to electronic signing.
65
+ */
66
+ export var envelopeRecipientAgree = function (endpoint, envelopeId, roleName, agreed) {
67
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', agreed: agreed });
68
+ };
69
+ /**
70
+ * Change a recipient's name.
71
+ */
72
+ export var envelopeRecipientUpdateName = function (endpoint, envelopeId, roleName, fullName) {
73
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', new_full_name: fullName });
74
+ };
75
+ /**
76
+ * Change a recipient's name.
77
+ */
78
+ export var envelopeRecipientPrepare = function (endpoint, envelopeId, roleName, recipients) {
79
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'prepare', recipients: recipients });
80
+ };
58
81
  export var getSignerToken = function (endpoint, envelopeId, roleName) {
59
82
  return endpoint.api //
60
83
  .get("/envelopes/".concat(envelopeId, "/recipients/").concat(encodeURIComponent(roleName), "/signer-token"))
@@ -208,6 +208,8 @@ export interface IEnvelope {
208
208
  /** @deprecated. New envelopes will support more than one document attachment so new code should no longer refer to this field. */
209
209
  envelope_document_id: string;
210
210
  certificate_document_id: string | null;
211
+ /** Defaults to 'private'. If set to 'shared', this envelope will be visible to other users in the same organization. Ignored for personal profiles. */
212
+ visibility: 'private' | 'shared';
211
213
  histories: IHistory[];
212
214
  recipients: IRecipient[];
213
215
  profile?: IProfile | null;
@@ -33,7 +33,7 @@ export declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemp
33
33
  * const template = await Templates.getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
34
34
  * ```
35
35
  */
36
- export declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplate>;
36
+ export declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string, ssr?: boolean) => Promise<ITemplate>;
37
37
  /**
38
38
  * Get owner information for a template.
39
39
  *
@@ -66,9 +66,9 @@ export var getTemplates = function (endpoint, params) {
66
66
  * const template = await Templates.getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
67
67
  * ```
68
68
  */
69
- export var getTemplate = function (endpoint, templateId) {
69
+ export var getTemplate = function (endpoint, templateId, ssr) {
70
70
  return endpoint.api //
71
- .get("/templates/".concat(templateId))
71
+ .get("/templates/".concat(templateId) + (ssr ? '?ssr=true' : ''))
72
72
  .then(function (r) { return r.data; });
73
73
  };
74
74
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.0.10",
3
+ "version": "3.0.12",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",
@@ -39,7 +39,8 @@
39
39
  "docs": "npm run docs-md && npm run docs-html",
40
40
  "clear-docs": "aws --profile=verdocs cloudfront create-invalidation --distribution-id E29UFGU4KEH1GQ --paths \"/*\"",
41
41
  "deploy-docs": "npm run docs && aws --profile=verdocs s3 sync --acl public-read --delete docs-html s3://verdocs-developers-js-sdk/ && yarn clear-docs",
42
- "clean": "rm -rf Documents HTTP Organizations Search Templates Users Utils index.js index.d.ts VerdocsEndpoint.* docs docs-html"
42
+ "clean": "rm -rf Documents HTTP Organizations Search Templates Users Utils index.js index.d.ts VerdocsEndpoint.* docs docs-html",
43
+ "push": "npm run build && npm publish"
43
44
  },
44
45
  "publishConfig": {
45
46
  "access": "public"