@verdocs/js-sdk 2.0.3 → 2.0.6

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,6 +1,7 @@
1
1
  import { ISigningSession, ISigningSessionRequest } from './Types';
2
2
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
3
3
  import { IFieldSetting } from '../Templates/Types';
4
+ import { IProfile } from '../Users/Types';
4
5
  export declare type TDocumentStatus = 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled';
5
6
  export declare type TRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted' | 'canceled' | 'pending' | 'declined';
6
7
  export declare type TRecipientType = 'signer' | 'cc' | 'approver';
@@ -106,6 +107,7 @@ export interface IDocument {
106
107
  certificate?: IDocumentAsset | null;
107
108
  document?: IDocumentAsset | null;
108
109
  fields?: IDocumentField[];
110
+ profile?: IProfile;
109
111
  }
110
112
  export interface IActivityEntry {
111
113
  id: string;
package/Users/Types.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface IProfile {
30
30
  /** If true, this is the caller's "currently selected" profile. All operations will performed "as" this profile. */
31
31
  current: boolean;
32
32
  /** The organization */
33
- organization: IOrganization;
33
+ organization?: IOrganization;
34
34
  /** The permissions assigned to the profilel _NOTE: Only present in the "current" profile._ */
35
35
  permissions?: TPermission[];
36
36
  /** The roles assigned to the profilel _NOTE: Only present in the "current" profile._ */
@@ -175,6 +175,11 @@ export declare class VerdocsEndpoint {
175
175
  * ```
176
176
  */
177
177
  setToken(token: string | null): VerdocsEndpoint;
178
+ /**
179
+ * Retrieves the current session token, if any. Tokens should rarely be used for direct actions, but this is
180
+ * required by the `<VerdocsView>` and other components to authorize requests to raw PDF files.
181
+ */
182
+ getToken(): string | null;
178
183
  private sessionStorageKey;
179
184
  /**
180
185
  * Clear the active session.
@@ -230,6 +230,13 @@ var VerdocsEndpoint = /** @class */ (function () {
230
230
  this.notifySessionListeners();
231
231
  return this;
232
232
  };
233
+ /**
234
+ * Retrieves the current session token, if any. Tokens should rarely be used for direct actions, but this is
235
+ * required by the `<VerdocsView>` and other components to authorize requests to raw PDF files.
236
+ */
237
+ VerdocsEndpoint.prototype.getToken = function () {
238
+ return this.token;
239
+ };
233
240
  VerdocsEndpoint.prototype.sessionStorageKey = function () {
234
241
  return "verdocs-session-".concat(this.getSessionType(), "-").concat(this.getEnvironment());
235
242
  };
@@ -287,4 +294,5 @@ export { VerdocsEndpoint };
287
294
  var ENDPOINT_KEY = Symbol.for('verdocs-default-endpoint');
288
295
  if (!globalThis[ENDPOINT_KEY]) {
289
296
  globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();
297
+ window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY]);
290
298
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.6",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",