@verdocs/js-sdk 3.7.4 → 3.7.5

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.
@@ -24,6 +24,24 @@ export interface IGetTemplatesParams {
24
24
  * ```
25
25
  */
26
26
  export declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) => Promise<ITemplate[]>;
27
+ export interface IListTemplatesParams {
28
+ name?: string;
29
+ sharing?: 'all' | 'personal' | 'shared' | 'public';
30
+ starred?: 'all' | 'starred' | 'unstarred';
31
+ sort?: 'name' | 'created_at' | 'updated_at' | 'last_used_at' | 'counter' | 'star_counter';
32
+ page?: number;
33
+ rows?: number;
34
+ }
35
+ /**
36
+ * Lists all templates accessible by the caller, with optional filters.
37
+ *
38
+ * ```typescript
39
+ * import {Templates} from '@verdocs/js-sdk/Templates';
40
+ *
41
+ * await Templates.listTemplates((VerdocsEndpoint.getDefault(), { sharing: 'personal', sort: 'last_used_at' });
42
+ * ```
43
+ */
44
+ export declare const listTemplates: (endpoint: VerdocsEndpoint, params?: IListTemplatesParams) => Promise<ITemplate[]>;
27
45
  /**
28
46
  * Get one template by its ID.
29
47
  *
@@ -57,6 +57,20 @@ export var getTemplates = function (endpoint, params) {
57
57
  .post('/templates', { params: params })
58
58
  .then(function (r) { return r.data; });
59
59
  };
60
+ /**
61
+ * Lists all templates accessible by the caller, with optional filters.
62
+ *
63
+ * ```typescript
64
+ * import {Templates} from '@verdocs/js-sdk/Templates';
65
+ *
66
+ * await Templates.listTemplates((VerdocsEndpoint.getDefault(), { sharing: 'personal', sort: 'last_used_at' });
67
+ * ```
68
+ */
69
+ export var listTemplates = function (endpoint, params) {
70
+ return endpoint.api //
71
+ .post('/templates/list', { params: params }, { baseURL: endpoint.getBaseURLv2() })
72
+ .then(function (r) { return r.data; });
73
+ };
60
74
  /**
61
75
  * Get one template by its ID.
62
76
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.7.4",
3
+ "version": "3.7.5",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",