@verdocs/js-sdk 1.1.10 → 1.1.11

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.
@@ -108,9 +108,6 @@ export var getDocumentFile = function (documentId, envelopeDocumentId) { return
108
108
  .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];
109
109
  });
110
110
  }); };
111
- // {"name":"textboxP2-0","recipient_role":"Recipient 1","envelope_id":"29b99d0b-8079-4e98-827c-28c375e5ecb7","page":2,"type":"textbox",
112
- // "required":true,"settings":{"x":0,"y":772.0000000000001,"width":150,"height":15,"result":"Text 1","leading":0,"alignment":0,"upperCase":false},
113
- // "validator":null,"label":null,"prepared":false}
114
111
  export var updateDocumentField = function (documentId, fieldName, value) { return __awaiter(void 0, void 0, void 0, function () {
115
112
  return __generator(this, function (_a) {
116
113
  return [2 /*return*/, getEndpoint()
@@ -57,6 +57,18 @@ export declare class VerdocsEndpoint {
57
57
  * ```
58
58
  */
59
59
  setAuthorization(accessToken: string | null): void;
60
+ /**
61
+ * Set the auth token used for signing sessions. Separating user from signing auth allows the same endpoint to be
62
+ * used for multiple operations, although it is recommended that a separate endpoint be created for each operation.
63
+ *
64
+ * ```typescript
65
+ * import {Endpoint} from '@verdocs/js-sdk/HTTP';
66
+ *
67
+ * const endpoint = new Endpoint();
68
+ * endpoint.setSigningAuthorization(accessToken);
69
+ * ```
70
+ */
71
+ setSigningAuthorization(accessToken: string | null): void;
60
72
  /**
61
73
  * Set the base URL for API calls. May also be set via the constructor.
62
74
  *
@@ -75,6 +75,25 @@ var VerdocsEndpoint = /** @class */ (function () {
75
75
  delete this.api.defaults.headers.Authorization;
76
76
  }
77
77
  };
78
+ /**
79
+ * Set the auth token used for signing sessions. Separating user from signing auth allows the same endpoint to be
80
+ * used for multiple operations, although it is recommended that a separate endpoint be created for each operation.
81
+ *
82
+ * ```typescript
83
+ * import {Endpoint} from '@verdocs/js-sdk/HTTP';
84
+ *
85
+ * const endpoint = new Endpoint();
86
+ * endpoint.setSigningAuthorization(accessToken);
87
+ * ```
88
+ */
89
+ VerdocsEndpoint.prototype.setSigningAuthorization = function (accessToken) {
90
+ if (accessToken) {
91
+ this.api.defaults.headers.signer = "Bearer ".concat(accessToken);
92
+ }
93
+ else {
94
+ delete this.api.defaults.headers.signer;
95
+ }
96
+ };
78
97
  /**
79
98
  * Set the base URL for API calls. May also be set via the constructor.
80
99
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",