-
Notifications
You must be signed in to change notification settings - Fork 3
/
themes.d.ts
268 lines (266 loc) · 8.56 KB
/
themes.d.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
import { A as ApiCallOptions } from './global.types-qsBNouXJ.js';
import './auth-types-PkN9CAF_.js';
/**
* An error object.
*/
type Error = {
/** Object containing meta data regarding an error. It does not necessarily contain all the properties. */
meta?: Meta;
/** Optional JSON patch object pointing to an invalid property. */
source?: unknown;
/** The HTTP status code. */
status?: number;
/** Title of the HTTP status code. */
title: string;
};
/**
* Object containing meta data regarding an error. It does not necessarily contain all the properties.
*/
type Meta = {
/** A more detailed message explaining the error. */
message?: string;
/** Name of the resource related to the error. If there is a conflict, it is the name of the model attempting to be created. */
resourceName?: string;
/** Full stack trace of the error that was raised. */
stack?: string;
};
/**
* The theme model.
*/
type Theme = {
/** Author of the theme. */
author?: string;
readonly createdAt?: string;
/** Map of dependencies describing version of the component it requires. */
dependencies?: unknown;
/** Description of the theme. */
description?: string;
/** The file that was uploaded with the theme. */
file?: unknown;
/** Home page of the theme. */
homepage?: string;
/** Icon to show in the client. */
icon?: string;
readonly id?: string;
/** Keywords for the theme. */
keywords?: string;
/** Under which license this theme is published. */
license?: string;
/** The display name of this theme. */
name?: string;
/** The name of the qext file that was uploaded with this theme. */
qextFilename?: string;
/** The version from the qext file that was uploaded with this extension. */
qextVersion?: string;
/** Link to the theme source code. */
repository?: string;
/** Supplier of the theme. */
supplier?: string;
/** List of tags. */
tags?: string[];
readonly tenantId?: string;
/** The type of this theme (visualization, etc.). */
type?: string;
readonly updateAt?: string;
readonly userId?: string;
/** Version of the theme. */
version?: string;
};
type Themes = {
data: Theme[];
};
/**
* Lists all imported themes in the tenant.
*
* @throws GetThemesHttpError
*/
declare const getThemes: (options?: ApiCallOptions) => Promise<GetThemesHttpResponse>;
type GetThemesHttpResponse = {
data: Themes;
headers: Headers;
status: number;
};
type GetThemesHttpError = {
data: unknown;
headers: Headers;
status: number;
};
/**
* Creates a new theme. Accepts either provided file or data object. The name of the new theme must be different to any existing themes.
*
* @param body an object with the body content
* @throws UploadThemeHttpError
*/
declare const uploadTheme: (body: {
/** The theme model. */
data?: Theme;
/** Theme archive. */
file?: BodyInit;
}, options?: ApiCallOptions) => Promise<UploadThemeHttpResponse>;
type UploadThemeHttpResponse = {
data: Theme;
headers: Headers;
status: number;
};
type UploadThemeHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Deletes a specific theme matching either theme ID or theme name.
*
* @param id Theme identifier or its qextFilename.
* @throws DeleteThemeHttpError
*/
declare const deleteTheme: (id: string, options?: ApiCallOptions) => Promise<DeleteThemeHttpResponse>;
type DeleteThemeHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DeleteThemeHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Returns a specific theme matching either theme ID or theme name.
*
* @param id Theme identifier or its qextFilename
* @throws GetThemeHttpError
*/
declare const getTheme: (id: string, options?: ApiCallOptions) => Promise<GetThemeHttpResponse>;
type GetThemeHttpResponse = {
data: Theme;
headers: Headers;
status: number;
};
type GetThemeHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Updates a specific theme matching either theme ID or theme name. Accepts either provided file or data object.
*
* @param id Theme identifier or its qextFilename.
* @param body an object with the body content
* @throws PatchThemeHttpError
*/
declare const patchTheme: (id: string, body: {
/** The theme model. */
data?: Theme;
/** Theme archive. */
file?: BodyInit;
}, options?: ApiCallOptions) => Promise<PatchThemeHttpResponse>;
type PatchThemeHttpResponse = {
data: Themes;
headers: Headers;
status: number;
};
type PatchThemeHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Downloads all files in the theme matching either theme ID or theme name as a `.zip` archive.
*
* @param id Theme identifier or its qextFilename
* @throws DownloadThemeHttpError
*/
declare const downloadTheme: (id: string, options?: ApiCallOptions) => Promise<DownloadThemeHttpResponse>;
type DownloadThemeHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DownloadThemeHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Downloads a file from the theme matching either theme ID or theme name, identified by the file path within the imported extension.
*
* @param id Theme identifier or its qextFilename.
* @param filepath Path to the file location within the specified theme archive. Folders separated with forward slashes.
* @throws DownloadFileFromThemeHttpError
*/
declare const downloadFileFromTheme: (id: string, filepath: string, options?: ApiCallOptions) => Promise<DownloadFileFromThemeHttpResponse>;
type DownloadFileFromThemeHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DownloadFileFromThemeHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Clears the cache for themes api requests.
*/
declare function clearCache(): void;
interface ThemesAPI {
/**
* Lists all imported themes in the tenant.
*
* @throws GetThemesHttpError
*/
getThemes: typeof getThemes;
/**
* Creates a new theme. Accepts either provided file or data object. The name of the new theme must be different to any existing themes.
*
* @param body an object with the body content
* @throws UploadThemeHttpError
*/
uploadTheme: typeof uploadTheme;
/**
* Deletes a specific theme matching either theme ID or theme name.
*
* @param id Theme identifier or its qextFilename.
* @throws DeleteThemeHttpError
*/
deleteTheme: typeof deleteTheme;
/**
* Returns a specific theme matching either theme ID or theme name.
*
* @param id Theme identifier or its qextFilename
* @throws GetThemeHttpError
*/
getTheme: typeof getTheme;
/**
* Updates a specific theme matching either theme ID or theme name. Accepts either provided file or data object.
*
* @param id Theme identifier or its qextFilename.
* @param body an object with the body content
* @throws PatchThemeHttpError
*/
patchTheme: typeof patchTheme;
/**
* Downloads all files in the theme matching either theme ID or theme name as a `.zip` archive.
*
* @param id Theme identifier or its qextFilename
* @throws DownloadThemeHttpError
*/
downloadTheme: typeof downloadTheme;
/**
* Downloads a file from the theme matching either theme ID or theme name, identified by the file path within the imported extension.
*
* @param id Theme identifier or its qextFilename.
* @param filepath Path to the file location within the specified theme archive. Folders separated with forward slashes.
* @throws DownloadFileFromThemeHttpError
*/
downloadFileFromTheme: typeof downloadFileFromTheme;
/**
* Clears the cache for themes api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the themes api
*/
declare const themesExport: ThemesAPI;
export { type DeleteThemeHttpError, type DeleteThemeHttpResponse, type DownloadFileFromThemeHttpError, type DownloadFileFromThemeHttpResponse, type DownloadThemeHttpError, type DownloadThemeHttpResponse, type Error, type GetThemeHttpError, type GetThemeHttpResponse, type GetThemesHttpError, type GetThemesHttpResponse, type Meta, type PatchThemeHttpError, type PatchThemeHttpResponse, type Theme, type Themes, type ThemesAPI, type UploadThemeHttpError, type UploadThemeHttpResponse, clearCache, themesExport as default, deleteTheme, downloadFileFromTheme, downloadTheme, getTheme, getThemes, patchTheme, uploadTheme };