@verdocs/js-sdk 2.0.18 → 2.0.21

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.
@@ -8,7 +8,7 @@ export interface IUpdateRecipientParams {
8
8
  /**
9
9
  * Update a recipient's status block
10
10
  */
11
- export declare const updateRecipientStatus: (endpoint: VerdocsEndpoint, documentId: string, roleName: string, action: TRecipientAction, params?: IUpdateRecipientParams | undefined) => Promise<IRecipient>;
11
+ export declare const updateRecipientStatus: (endpoint: VerdocsEndpoint, documentId: string, roleName: string, action: TRecipientAction, params?: IUpdateRecipientParams) => Promise<IRecipient>;
12
12
  export interface ISignerTokenResponse {
13
13
  recipient: IRecipient;
14
14
  envelope: IDocument;
@@ -28,7 +28,7 @@ export declare const getGroups: (endpoint: VerdocsEndpoint, organizationId: stri
28
28
  * const groups = await Groups.getGroups(ORGID);
29
29
  * ```
30
30
  */
31
- export declare const getGroupByName: (endpoint: VerdocsEndpoint, organizationId: string, name?: string | undefined) => Promise<IGroupDetail>;
31
+ export declare const getGroupByName: (endpoint: VerdocsEndpoint, organizationId: string, name?: string) => Promise<IGroupDetail>;
32
32
  /**
33
33
  * Get the details for a group.
34
34
  *
@@ -23,7 +23,7 @@ export interface IGetTemplatesParams {
23
23
  * await Templates.getTemplates({ is_organization: true });
24
24
  * ```
25
25
  */
26
- export declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams | undefined) => Promise<ITemplate[]>;
26
+ export declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) => Promise<ITemplate[]>;
27
27
  /**
28
28
  * Get one template by its ID.
29
29
  *
@@ -74,6 +74,27 @@ export declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: str
74
74
  * ```
75
75
  */
76
76
  export declare const searchTemplates: (endpoint: VerdocsEndpoint, params: any) => Promise<ITemplatesSearchResult>;
77
+ export interface ISearchTimeRange {
78
+ start_time: string;
79
+ end_time: string;
80
+ }
81
+ export interface IGetTemplateSummaryParams {
82
+ id?: string;
83
+ name?: string;
84
+ sender?: string;
85
+ profile_id?: string;
86
+ organization_id?: string;
87
+ description?: string;
88
+ created_at?: ISearchTimeRange;
89
+ updated_at?: ISearchTimeRange;
90
+ last_used_at?: ISearchTimeRange;
91
+ is_personal?: boolean;
92
+ is_public?: boolean;
93
+ sort_by?: 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter';
94
+ ascending?: boolean;
95
+ row?: number;
96
+ page?: number;
97
+ }
77
98
  /**
78
99
  * Get a summary of template data, typically used to populate admin panel dashboard pages.
79
100
  *
@@ -83,4 +104,4 @@ export declare const searchTemplates: (endpoint: VerdocsEndpoint, params: any) =
83
104
  * const summary = await Templates.getSummary(0);
84
105
  * ```
85
106
  */
86
- export declare const getSummary: (endpoint: VerdocsEndpoint, page: number) => Promise<ITemplatesSummary>;
107
+ export declare const getSummary: (endpoint: VerdocsEndpoint, params?: IGetTemplateSummaryParams) => Promise<ITemplatesSummary>;
@@ -54,7 +54,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
54
54
  */
55
55
  export var getTemplates = function (endpoint, params) {
56
56
  return endpoint.api //
57
- .get('/templates', { params: params })
57
+ .post('/templates', { params: params })
58
58
  .then(function (r) { return r.data; });
59
59
  };
60
60
  /**
@@ -138,10 +138,13 @@ export var searchTemplates = function (endpoint, params) { return __awaiter(void
138
138
  * const summary = await Templates.getSummary(0);
139
139
  * ```
140
140
  */
141
- export var getSummary = function (endpoint, page) { return __awaiter(void 0, void 0, void 0, function () {
142
- return __generator(this, function (_a) {
143
- return [2 /*return*/, endpoint.api //
144
- .post('/templates/summary', { page: page })
145
- .then(function (r) { return r.data; })];
141
+ export var getSummary = function (endpoint, params) {
142
+ if (params === void 0) { params = {}; }
143
+ return __awaiter(void 0, void 0, void 0, function () {
144
+ return __generator(this, function (_a) {
145
+ return [2 /*return*/, endpoint.api //
146
+ .post('/templates/summary', params)
147
+ .then(function (r) { return r.data; })];
148
+ });
146
149
  });
147
- }); };
150
+ };
@@ -6,7 +6,7 @@ export interface ITemplate {
6
6
  counter?: number;
7
7
  star_counter?: number;
8
8
  name: string;
9
- id?: string;
9
+ id: string;
10
10
  profile_id?: string;
11
11
  created_at?: string;
12
12
  updated_at?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "2.0.18",
3
+ "version": "2.0.21",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",