-
Notifications
You must be signed in to change notification settings - Fork 1
/
i-keys.ts
98 lines (91 loc) · 3.23 KB
/
i-keys.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import {IKeyQuery} from '../query/i-key';
import {IKey} from '../model/i-key';
/**
* @export
* @interface IKeys
* @description Keys are core item elements of the project.
* Each phrase that is used in your app or website must be identified by a key
* and have values that represent translations to various languages.
* For example key index.welcome would have values of Welcome in English and Benvenuto in Italian.
* Keys can be assigned to one or multiple platforms.
* Once a key is assigned to a platform,
* it would be included in the export for file formats related to this platform.
*/
export interface IKeys {
/**
* @public
* @description Lists all keys in the project.
* @param {string} projectId
* @param {IKeyQuery} [query]
* @returns {Promise<{project_id: string, keys: IKey[]}>}
* @memberof IKeys
*/
list(projectId: string, query?: IKeyQuery):
Promise<{project_id: string, keys: IKey[]}>;
/**
* @public
* @description Retrieves a Key object.
* @param {string} projectId
* @param {number} keyId
* @returns {Promise<{project_id: string, key: IKey}>}
* @memberof IKeys
*/
get(projectId: string, keyId: number):
Promise<{project_id: string, key: IKey}>;
/**
* @public
* @description Creates one or more keys in the project. Requires Manage keys admin right.
* We recommend sending payload in chunks of up to 500 keys per request.
* @param {string} projectId
* @param {object} body
* @returns {Promise<{keys: IKey[]}>}
* @memberof IKeys
*/
create(projectId: string, body: object):
Promise<{keys: IKey[]}>;
/**
* @public
* @description Updates the properties of a key and it’s associated objects.
* Requires Manage keys admin right.
* @param {string} projectId
* @param {number} keyId
* @param {object} body
* @returns {Promise<{project_id: string, key: IKey}>}
* @memberof IKeys
*/
update(projectId: string, keyId: number, body: object):
Promise<{project_id: string, key: IKey}>;
/**
* @public
* @description Updates the properties of a key and it’s associated objects.
* Requires Manage keys admin right.
* @param {string} projectId
* @param {object} body
* @returns {Promise<{project_id: string, keys: IKey[]}>}
* @memberof IKeys
*/
updateMany(projectId: string, body: object):
Promise<{project_id: string, keys: IKey[]}>;
/**
* @public
* @description Deletes multiple keys from the project.
* Requires Manage keys admin right.
* @param {string} projectId
* @param {object} body
* @returns {Promise<{project_id: string, keys_removed: boolean}>}
* @memberof IKeys
*/
deleteMany(projectId: string, body: object):
Promise<{project_id: string, keys_removed: boolean}>;
/**
* @public
* @description Deletes a key from the project.
* Requires Manage keys admin right.
* @param {string} projectId
* @param {number} keyId
* @returns {Promise<{project_id: string, key_removed: boolean}>}
* @memberof IKeys
*/
delete(projectId: string, keyId: number):
Promise<{project_id: string, key_removed: boolean}>;
}