@verdocs/js-sdk 3.7.7 → 3.8.0

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 { ITemplate, ITemplateSummaryEntry } from './Types';
1
+ import { ITemplate, ITemplateSummary } from './Types';
2
2
  import { TSession } from '../Sessions/Types';
3
3
  export declare enum TemplateSenderTypes {
4
4
  CREATOR = "creator",
@@ -19,7 +19,7 @@ export declare enum TemplatePermissions {
19
19
  TEMPLATE_MEMBER_VISIBILITY = "template:member:visibility"
20
20
  }
21
21
  export type TTemplateActions = 'create_personal' | 'create_org' | 'create_public' | 'read' | 'write' | 'delete' | 'change_visibility_personal' | 'change_visibility_org' | 'change_visibility_public';
22
- export declare const canPerformTemplateAction: (session: TSession, action: TTemplateActions, template?: ITemplate | ITemplateSummaryEntry) => {
22
+ export declare const canPerformTemplateAction: (session: TSession, action: TTemplateActions, template?: ITemplate | ITemplateSummary) => {
23
23
  canPerform: boolean;
24
24
  message: string;
25
25
  };
@@ -3,16 +3,16 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { ITemplate, ITemplateSummaryEntry } from './Types';
6
+ import { ITemplate, ITemplateSummary } from './Types';
7
7
  import { TSession } from '../Sessions/Types';
8
8
  /**
9
9
  * Check to see if the user created the template.
10
10
  */
11
- export declare const userIsTemplateCreator: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean | null;
11
+ export declare const userIsTemplateCreator: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
12
12
  /**
13
13
  * Check to see if a template is "shared" with the user.
14
14
  */
15
- export declare const userHasSharedTemplate: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean | null;
15
+ export declare const userHasSharedTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
16
16
  /**
17
17
  * Check to see if the user can create a personal/private template.
18
18
  */
@@ -28,35 +28,35 @@ export declare const userCanCreatePublicTemplate: (session: TSession) => boolean
28
28
  /**
29
29
  * Check to see if the user can read/view a template.
30
30
  */
31
- export declare const userCanReadTemplate: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean | null;
31
+ export declare const userCanReadTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
32
32
  /**
33
33
  * Check to see if the user can update a tempate.
34
34
  */
35
- export declare const userCanUpdateTemplate: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean | null;
35
+ export declare const userCanUpdateTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
36
36
  /**
37
37
  * Check to see if the user can change whether a template is personal vs org-shared.
38
38
  */
39
- export declare const userCanMakeTemplatePrivate: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean;
39
+ export declare const userCanMakeTemplatePrivate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
40
40
  /**
41
41
  * Check to see if the user can change whether a template is personal vs org-shared.
42
42
  */
43
- export declare const userCanMakeTemplateShared: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean;
43
+ export declare const userCanMakeTemplateShared: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
44
44
  /**
45
45
  * Check to see if the user can change whether a template is personal vs org-shared.
46
46
  */
47
- export declare const userCanMakeTemplatePublic: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean;
47
+ export declare const userCanMakeTemplatePublic: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
48
48
  /**
49
49
  * Check to see if the user can change whether a template is personal vs org-shared.
50
50
  */
51
- export declare const userCanChangeOrgVisibility: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean | null;
51
+ export declare const userCanChangeOrgVisibility: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
52
52
  /**
53
53
  * Check to see if the user can change whether a template is personal vs org-shared.
54
54
  */
55
- export declare const userCanDeleteTemplate: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean;
55
+ export declare const userCanDeleteTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean;
56
56
  /**
57
57
  * Confirm whether the user can create an envelope using the specified template.
58
58
  */
59
- export declare const userCanSendTemplate: (session: TSession, template: ITemplate | ITemplateSummaryEntry) => boolean | null;
59
+ export declare const userCanSendTemplate: (session: TSession, template: ITemplate | ITemplateSummary) => boolean | null;
60
60
  /**
61
61
  * Confirm whether the user can create a new template.
62
62
  */
@@ -1,4 +1,4 @@
1
- import { IStar, ITemplateSummaryEntry } from './Types';
1
+ import { IStar, ITemplateSummary } from './Types';
2
2
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
3
3
  /**
4
4
  * Get the template stars for a template.
@@ -7,4 +7,4 @@ export declare const getStars: (endpoint: VerdocsEndpoint, templateId: string) =
7
7
  /**
8
8
  * Toggle the template star for a template.
9
9
  */
10
- export declare const toggleStar: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateSummaryEntry>;
10
+ export declare const toggleStar: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateSummary>;
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @module
6
6
  */
7
- import { IRole, ITemplate, ITemplateField, ITemplateOwnerInfo, ITemplatesSearchResult, ITemplatesSummary, TTemplateSender } from './Types';
7
+ import { IRole, ITemplate, ITemplateField, ITemplateOwnerInfo, ITemplateSummaries, ITemplateSummary, TTemplateSender } from './Types';
8
8
  import { VerdocsEndpoint } from '../VerdocsEndpoint';
9
9
  export interface IGetTemplatesParams {
10
10
  is_starred?: boolean;
@@ -41,10 +41,7 @@ export interface IListTemplatesParams {
41
41
  * await Templates.listTemplates((VerdocsEndpoint.getDefault(), { sharing: 'personal', sort: 'last_used_at' });
42
42
  * ```
43
43
  */
44
- export declare const listTemplates: (endpoint: VerdocsEndpoint, params?: IListTemplatesParams) => Promise<{
45
- records: ITemplate[];
46
- total: number;
47
- }>;
44
+ export declare const listTemplates: (endpoint: VerdocsEndpoint, params?: IListTemplatesParams) => Promise<ITemplateSummaries>;
48
45
  /**
49
46
  * Get one template by its ID.
50
47
  *
@@ -158,7 +155,7 @@ export declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: str
158
155
  * const {result, page, total} = await Templates.search((VerdocsEndpoint.getDefault(), { ... });
159
156
  * ```
160
157
  */
161
- export declare const searchTemplates: (endpoint: VerdocsEndpoint, params: any) => Promise<ITemplatesSearchResult>;
158
+ export declare const searchTemplates: (endpoint: VerdocsEndpoint, params: any) => Promise<ITemplateSummaries>;
162
159
  export interface ISearchTimeRange {
163
160
  start_time: string;
164
161
  end_time: string;
@@ -191,7 +188,7 @@ export interface IGetTemplateSummaryParams {
191
188
  * const summary = await Templates.getSummary((VerdocsEndpoint.getDefault(), 0);
192
189
  * ```
193
190
  */
194
- export declare const getSummary: (endpoint: VerdocsEndpoint, params?: IGetTemplateSummaryParams) => Promise<ITemplatesSummary>;
191
+ export declare const getSummary: (endpoint: VerdocsEndpoint, params?: IGetTemplateSummaryParams) => Promise<ITemplateSummary>;
195
192
  /**
196
193
  * Wrapper for `getTemplate()` that limits queries to one every 2 seconds per template ID.
197
194
  * This is intended for use in component hierarchies that all rely on the same template
@@ -107,14 +107,16 @@ export interface ITemplate {
107
107
  /**
108
108
  * Some template search and list endpoints return only a partial set of fields for each entry via this structure.
109
109
  */
110
- export interface ITemplateSummaryEntry {
110
+ export interface ITemplateSummary {
111
111
  id: string;
112
112
  name: string;
113
+ description: string | null;
113
114
  sender: TTemplateSender;
114
115
  counter: number;
115
- description: string | null;
116
+ star_counter: number;
116
117
  created_at: string;
117
118
  updated_at: string;
119
+ last_used_at: string | null;
118
120
  /**
119
121
  * If true, the template is considered "sendable" (it has at least one signer, and every signer has at least one field.)
120
122
  */
@@ -123,11 +125,9 @@ export interface ITemplateSummaryEntry {
123
125
  is_public: boolean;
124
126
  profile_id: string;
125
127
  organization_id: string;
126
- last_used_at: string | null;
127
- document_name: string | null;
128
- star_counter: number;
129
- tag_name: string | null;
130
- is_starred: boolean;
128
+ reminder_id: string;
129
+ tags: string[];
130
+ allowed_operations: TemplateActions[];
131
131
  }
132
132
  export declare enum TemplateSenderTypes {
133
133
  CREATOR = "creator",
@@ -180,15 +180,11 @@ export declare enum SortOptions {
180
180
  COUNTER = "counter",
181
181
  STAR_COUNTER = "star_counter"
182
182
  }
183
- export interface ITemplatesSummary {
184
- page: number;
185
- total: number;
186
- result: ITemplateSummaryEntry[];
187
- }
188
- export interface ITemplatesSearchResult {
183
+ export interface ITemplateSummaries {
189
184
  page: number;
185
+ rows: number;
190
186
  total: number;
191
- result: ITemplate[];
187
+ records: ITemplateSummary[];
192
188
  }
193
189
  export interface ITemplateTag {
194
190
  tag_name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.7.7",
3
+ "version": "3.8.0",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",