@verdocs/js-sdk 2.0.12 → 2.0.13

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,161 +1,7 @@
1
- import { ISigningSession, ISigningSessionRequest } from './Types';
1
+ import { IDocument, IDocumentsSearchResult, IDocumentsSummary, IRecipient, ISigningSession, ISigningSessionRequest } from './Types';
2
2
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
3
3
  import { IFieldSetting } from '../Templates/Types';
4
- import { IProfile } from '../Users/Types';
5
- export declare type TDocumentStatus = 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled';
6
- export declare type TRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted' | 'canceled' | 'pending' | 'declined';
7
- export declare type TRecipientType = 'signer' | 'cc' | 'approver';
8
- export interface IDocumentsSearchResultEntry {
9
- id: string;
10
- canceled_at: string;
11
- certificate_document_id: string;
12
- created_at: string;
13
- envelope_document_id: string;
14
- histories: IHistory[];
15
- indexed_at: string;
16
- name: string;
17
- no_contact: boolean;
18
- organization_id: string;
19
- profile_id: string;
20
- recipients: IRecipient[];
21
- reminder_id: string | null;
22
- status: TDocumentStatus;
23
- next_recipient: {
24
- claimed: boolean;
25
- email: string;
26
- name: string;
27
- profile_id: string;
28
- status: TRecipientStatus;
29
- type: TRecipientType;
30
- };
31
- template_id: string;
32
- total_count: number;
33
- updated_at: string;
34
- }
35
- export interface IDocumentsSearchResult {
36
- page: number;
37
- total: number;
38
- result: IDocumentsSearchResultEntry[];
39
- }
40
- export interface IDocumentsSummary {
41
- action_required: {
42
- page: number;
43
- total: number;
44
- result: IActivityEntry[];
45
- };
46
- completed: {
47
- page: number;
48
- total: number;
49
- result: IActivityEntry[];
50
- };
51
- waiting_others: {
52
- page: number;
53
- total: number;
54
- result: IActivityEntry[];
55
- };
56
- }
57
- export interface IRecipient {
58
- agreed: boolean;
59
- claimed: boolean;
60
- created_at: string;
61
- delegated_to: string | null;
62
- delegator: boolean;
63
- email: string;
64
- envelope_id: string;
65
- full_name: string;
66
- in_app_access_key?: string;
67
- key_used_to_conclude?: string;
68
- message: string | null;
69
- phone: string | null;
70
- profile_id: string;
71
- role_name: string;
72
- sequence: number;
73
- status: TRecipientStatus;
74
- type: TRecipientType;
75
- updated_at: string;
76
- }
77
- export interface IDocumentAsset {
78
- created_at: string;
79
- id: string;
80
- mime: string;
81
- name: string;
82
- page_numbers: number;
83
- updated_at: string;
84
- url: string;
85
- }
86
- export interface IDocumentField {
87
- envelope_id: string;
88
- label: string | null;
89
- name: string;
90
- page: number;
91
- recipient_role: string;
92
- type: string;
93
- required: boolean;
94
- settings?: IFieldSetting;
95
- setting?: IFieldSetting;
96
- validator: string | null;
97
- prepared?: boolean;
98
- }
99
- export interface IDocument {
100
- id: string;
101
- created_at: string;
102
- canceled_at: string;
103
- envelope_document_id: string;
104
- certificate_document_id: string | null;
105
- histories: IHistory[];
106
- recipients: IRecipient[];
107
- name: string;
108
- no_contact: boolean;
109
- profile_id: string;
110
- reminder_id: string | null;
111
- status: TDocumentStatus;
112
- template_id: string;
113
- updated_at: string;
114
- organization_id: string | null;
115
- certificate?: IDocumentAsset | null;
116
- document?: IDocumentAsset | null;
117
- fields?: IDocumentField[];
118
- profile?: IProfile;
119
- }
120
- export declare type TDocumentUpdateResult = Omit<IDocument, 'histories' | 'recipients' | 'certificate' | 'document' | 'fields' | 'profile'>;
121
- export interface IActivityEntry {
122
- id: string;
123
- name: string;
124
- canceled_at: string;
125
- created_at: string;
126
- updated_at: string;
127
- profile_id: string;
128
- status: TDocumentStatus;
129
- template_id: string;
130
- recipient: {
131
- claimed: boolean;
132
- email: string;
133
- name: string;
134
- profile_id: string;
135
- status: TRecipientStatus;
136
- type: TRecipientType;
137
- };
138
- }
139
- export interface IHistory {
140
- created_at: string;
141
- envelope_id: string;
142
- event: IHistoryEvent;
143
- event_detail: IEventDetail;
144
- id: string;
145
- role_name: string;
146
- }
147
- export interface IDocumentSearchOptions {
148
- rows?: number;
149
- page?: number;
150
- sort_by?: 'updated_at' | 'created_at';
151
- ascending?: boolean;
152
- is_owner?: boolean;
153
- is_recipient?: boolean;
154
- envelope_status: TDocumentStatus[];
155
- recipient_status: TDocumentStatus[];
156
- }
157
- export declare type IHistoryEvent = 'recipient:invited' | 'recipient:opened' | 'recipient:agreed' | 'recipient:signed' | 'recipient:submitted';
158
- export declare type IEventDetail = 'in_app' | 'mail' | 'signer' | '';
4
+ import { TDocumentUpdateResult } from './Types';
159
5
  /**
160
6
  * Get a summary of currently active documents.
161
7
  *
@@ -1,6 +1,6 @@
1
1
  import { IInPersonAccessKey, TRecipientAction } from './Types';
2
2
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
3
- import { IDocument, IRecipient } from './Documents';
3
+ import { IDocument, IRecipient } from './Types';
4
4
  export interface IUpdateRecipientParams {
5
5
  new_full_name?: string;
6
6
  agreed?: boolean;
@@ -15,4 +15,5 @@ export interface ISignerTokenResponse {
15
15
  signerToken: string;
16
16
  inPersonAccessKey: IInPersonAccessKey;
17
17
  }
18
- export declare const getSignerToken: (endpoint: VerdocsEndpoint, documentId: string, roleName: string) => Promise<import("axios").AxiosResponse<ISignerTokenResponse, any>>;
18
+ export declare const getSignerToken: (endpoint: VerdocsEndpoint, documentId: string, roleName: string) => Promise<ISignerTokenResponse>;
19
+ export declare const getInPersonLink: (endpoint: VerdocsEndpoint, documentId: string, roleName: string) => Promise<ISignerTokenResponse>;
@@ -57,5 +57,11 @@ export var updateRecipientStatus = function (endpoint, documentId, roleName, act
57
57
  }); };
58
58
  export var getSignerToken = function (endpoint, documentId, roleName) {
59
59
  return endpoint.api //
60
- .get("/documents/".concat(documentId, "/recipients/").concat(encodeURIComponent(roleName), "/signer-token"));
60
+ .get("/documents/".concat(documentId, "/recipients/").concat(encodeURIComponent(roleName), "/signer-token"))
61
+ .then(function (r) { return r.data; });
62
+ };
63
+ export var getInPersonLink = function (endpoint, documentId, roleName) {
64
+ return endpoint.api //
65
+ .get("/documents/".concat(documentId, "/recipients/").concat(encodeURIComponent(roleName), "?in_person_link=true"))
66
+ .then(function (r) { return r.data; });
61
67
  };
@@ -1,3 +1,5 @@
1
+ import { IFieldSetting } from '../Templates/Types';
2
+ import { IProfile } from '../Users/Types';
1
3
  export declare type TRecipientAction = 'submit' | 'decline' | 'prepare' | 'update';
2
4
  export interface ITemplateSummaryEntry {
3
5
  id: string;
@@ -53,3 +55,157 @@ export interface IInPersonAccessKey {
53
55
  first_used: string | null;
54
56
  last_used: string | null;
55
57
  }
58
+ export declare type TDocumentStatus = 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled';
59
+ export declare type TRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted' | 'canceled' | 'pending' | 'declined';
60
+ export declare type TRecipientType = 'signer' | 'cc' | 'approver';
61
+ export interface IDocumentsSearchResultEntry {
62
+ id: string;
63
+ canceled_at: string;
64
+ certificate_document_id: string;
65
+ created_at: string;
66
+ envelope_document_id: string;
67
+ histories: IHistory[];
68
+ indexed_at: string;
69
+ name: string;
70
+ no_contact: boolean;
71
+ organization_id: string;
72
+ profile_id: string;
73
+ recipients: IRecipient[];
74
+ reminder_id: string | null;
75
+ status: TDocumentStatus;
76
+ next_recipient: {
77
+ claimed: boolean;
78
+ email: string;
79
+ name: string;
80
+ profile_id: string;
81
+ status: TRecipientStatus;
82
+ type: TRecipientType;
83
+ };
84
+ template_id: string;
85
+ total_count: number;
86
+ updated_at: string;
87
+ }
88
+ export interface IDocumentsSearchResult {
89
+ page: number;
90
+ total: number;
91
+ result: IDocumentsSearchResultEntry[];
92
+ }
93
+ export interface IDocumentsSummary {
94
+ action_required: {
95
+ page: number;
96
+ total: number;
97
+ result: IActivityEntry[];
98
+ };
99
+ completed: {
100
+ page: number;
101
+ total: number;
102
+ result: IActivityEntry[];
103
+ };
104
+ waiting_others: {
105
+ page: number;
106
+ total: number;
107
+ result: IActivityEntry[];
108
+ };
109
+ }
110
+ export interface IRecipient {
111
+ agreed: boolean;
112
+ claimed: boolean;
113
+ created_at: string;
114
+ delegated_to: string | null;
115
+ delegator: boolean;
116
+ email: string;
117
+ envelope_id: string;
118
+ full_name: string;
119
+ in_app_access_key?: string;
120
+ key_used_to_conclude?: string;
121
+ message: string | null;
122
+ phone: string | null;
123
+ profile_id: string;
124
+ role_name: string;
125
+ sequence: number;
126
+ status: TRecipientStatus;
127
+ type: TRecipientType;
128
+ updated_at: string;
129
+ }
130
+ export interface IDocumentAsset {
131
+ created_at: string;
132
+ id: string;
133
+ mime: string;
134
+ name: string;
135
+ page_numbers: number;
136
+ updated_at: string;
137
+ url: string;
138
+ }
139
+ export interface IDocumentField {
140
+ envelope_id: string;
141
+ label: string | null;
142
+ name: string;
143
+ page: number;
144
+ recipient_role: string;
145
+ type: string;
146
+ required: boolean;
147
+ settings?: IFieldSetting;
148
+ setting?: IFieldSetting;
149
+ validator: string | null;
150
+ prepared?: boolean;
151
+ }
152
+ export interface IDocument {
153
+ id: string;
154
+ created_at: string;
155
+ canceled_at: string;
156
+ envelope_document_id: string;
157
+ certificate_document_id: string | null;
158
+ histories: IHistory[];
159
+ recipients: IRecipient[];
160
+ name: string;
161
+ no_contact: boolean;
162
+ profile_id: string;
163
+ reminder_id: string | null;
164
+ status: TDocumentStatus;
165
+ template_id: string;
166
+ updated_at: string;
167
+ organization_id: string | null;
168
+ certificate?: IDocumentAsset | null;
169
+ document?: IDocumentAsset | null;
170
+ fields?: IDocumentField[];
171
+ profile?: IProfile;
172
+ }
173
+ export declare type TDocumentUpdateResult = Omit<IDocument, 'histories' | 'recipients' | 'certificate' | 'document' | 'fields' | 'profile'>;
174
+ export interface IActivityEntry {
175
+ id: string;
176
+ name: string;
177
+ canceled_at: string;
178
+ created_at: string;
179
+ updated_at: string;
180
+ profile_id: string;
181
+ status: TDocumentStatus;
182
+ template_id: string;
183
+ recipient: {
184
+ claimed: boolean;
185
+ email: string;
186
+ name: string;
187
+ profile_id: string;
188
+ status: TRecipientStatus;
189
+ type: TRecipientType;
190
+ };
191
+ }
192
+ export interface IHistory {
193
+ created_at: string;
194
+ envelope_id: string;
195
+ event: THistoryEvent;
196
+ event_detail: TEventDetail;
197
+ id: string;
198
+ role_name: string;
199
+ }
200
+ export interface IDocumentSearchOptions {
201
+ rows?: number;
202
+ page?: number;
203
+ sort_by?: 'updated_at' | 'created_at';
204
+ ascending?: boolean;
205
+ is_owner?: boolean;
206
+ is_recipient?: boolean;
207
+ envelope_status: TDocumentStatus[];
208
+ recipient_status: TDocumentStatus[];
209
+ }
210
+ export declare type THistoryEvent = 'recipient:invited' | 'recipient:opened' | 'recipient:agreed' | 'recipient:signed' | 'recipient:submitted';
211
+ export declare type TEventDetail = 'in_app' | 'mail' | 'signer' | '';
@@ -1,10 +1,11 @@
1
1
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
2
+ import { IProfile } from '../Users/Types';
2
3
  /**
3
4
  * An Organization Member (aka Profile) is an individual user with access to an organization.
4
5
  *
5
6
  * @module
6
7
  */
7
- export declare const getMembers: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<any>;
8
+ export declare const getMembers: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IProfile[]>;
8
9
  export declare const deleteMember: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string) => Promise<any>;
9
10
  export declare const addMemberRole: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string, roleId: string) => Promise<any>;
10
11
  export declare const deleteMemberRole: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string, roleId: string) => Promise<any>;
@@ -28,6 +28,7 @@ export interface IApiKey {
28
28
  name: string;
29
29
  profile_id: string;
30
30
  organization_id: string;
31
+ profile?: IProfile;
31
32
  }
32
33
  export interface IApiKeyWithSecret extends IApiKey {
33
34
  client_id: string;
package/Search/Types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { TDocumentStatus } from '../Documents/Documents';
2
1
  import { TTemplateSender } from '../Templates/Types';
2
+ import { TDocumentStatus } from '../Documents/Types';
3
3
  export declare type TMimeType = 'application/pdf' | string;
4
4
  /**
5
5
  * An individual hit in a document search result. Note that this schema does not precisely match IDocument because fields
@@ -37,7 +37,7 @@ export interface VerdocsEndpointOptions {
37
37
  export declare class VerdocsEndpoint {
38
38
  private environment;
39
39
  private sessionType;
40
- private baseURL;
40
+ private readonly baseURL;
41
41
  private clientID;
42
42
  private timeout;
43
43
  private token;
@@ -72,9 +72,6 @@ var VerdocsEndpoint = /** @class */ (function () {
72
72
  globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();
73
73
  window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY]);
74
74
  }
75
- else {
76
- window.console.debug('[JS SDK] Re-using existing endpoint', globalThis[ENDPOINT_KEY]);
77
- }
78
75
  return globalThis[ENDPOINT_KEY];
79
76
  };
80
77
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",