@verdocs/js-sdk 2.0.13 → 2.0.14
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.
- package/Templates/Templates.d.ts +13 -3
- package/Templates/Templates.js +15 -1
- package/Templates/Types.d.ts +5 -0
- package/package.json +1 -1
package/Templates/Templates.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { ITemplate, ITemplatesSearchResult, ITemplatesSummary } from './Types';
|
|
7
|
+
import { ITemplate, ITemplateOwnerInfo, ITemplatesSearchResult, ITemplatesSummary } from './Types';
|
|
8
8
|
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
9
9
|
export interface IGetTemplatesParams {
|
|
10
10
|
is_starred?: boolean;
|
|
@@ -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) => Promise<
|
|
26
|
+
export declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) => Promise<ITemplate[]>;
|
|
27
27
|
/**
|
|
28
28
|
* Get one template by its ID.
|
|
29
29
|
*
|
|
@@ -33,7 +33,17 @@ export declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemp
|
|
|
33
33
|
* const template = await Templates.getTemplate('83da3d70-7857-4392-b876-c4592a304bc9');
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<
|
|
36
|
+
export declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplate>;
|
|
37
|
+
/**
|
|
38
|
+
* Get owner information for a template.
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
42
|
+
*
|
|
43
|
+
* const template = await Templates.getTemplateOwnerInfo('83da3d70-7857-4392-b876-c4592a304bc9');
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const getTemplateOwnerInfo: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateOwnerInfo>;
|
|
37
47
|
/**
|
|
38
48
|
* Create a template.
|
|
39
49
|
*
|
package/Templates/Templates.js
CHANGED
|
@@ -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
|
|
57
|
+
.get('/templates', { params: params })
|
|
58
58
|
.then(function (r) { return r.data; });
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
@@ -71,6 +71,20 @@ export var getTemplate = function (endpoint, templateId) {
|
|
|
71
71
|
.get("/templates/".concat(templateId))
|
|
72
72
|
.then(function (r) { return r.data; });
|
|
73
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Get owner information for a template.
|
|
76
|
+
*
|
|
77
|
+
* ```typescript
|
|
78
|
+
* import {Templates} from '@verdocs/js-sdk/Templates';
|
|
79
|
+
*
|
|
80
|
+
* const template = await Templates.getTemplateOwnerInfo('83da3d70-7857-4392-b876-c4592a304bc9');
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export var getTemplateOwnerInfo = function (endpoint, templateId) {
|
|
84
|
+
return endpoint.api //
|
|
85
|
+
.get("/templates/".concat(templateId))
|
|
86
|
+
.then(function (r) { return r.data; });
|
|
87
|
+
};
|
|
74
88
|
/**
|
|
75
89
|
* Create a template.
|
|
76
90
|
*
|
package/Templates/Types.d.ts
CHANGED