-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathextensions.d.ts
293 lines (291 loc) · 10.3 KB
/
extensions.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
import { A as ApiCallOptions } from './invoke-fetch-types-BXn-uSF5.js';
import './auth-types-PkN9CAF_.js';
/**
* Object containing meta data regarding the bundle the extension belongs to. If it does not belong to a bundle, this object is not defined.
*/
type BundleMeta = {
/** Description of the bundle. */
description?: string;
/** Unique identifier of the bundle. */
id?: string;
/** Name of the bundle. */
name?: string;
};
/**
* 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;
};
/**
* The extension model.
*/
type Extension = {
/** Author of the extension. */
author?: string;
/** Object containing meta data regarding the bundle the extension belongs to. If it does not belong to a bundle, this object is not defined. */
bundle?: BundleMeta;
/** If the extension is part of an extension bundle. */
bundled?: boolean;
/** Checksum of the extension contents. */
checksum?: string;
readonly createdAt?: string;
/** Map of dependencies describing version of the component it requires. */
dependencies?: unknown;
/** A date noting when the extension was deprecated. */
deprecated?: string;
/** Description of the extension. */
description?: string;
/** The file that was uploaded with the extension. */
file?: unknown;
/** Home page of the extension. */
homepage?: string;
/** Icon to show in the client. */
icon?: string;
readonly id?: string;
/** Keywords for the extension. */
keywords?: string;
/** Under which license this extension is published. */
license?: string;
/** Relative path to the extension's entry file, defaults to `filename` from the qext file. */
loadpath?: string;
/** The display name of this extension. */
name?: string;
/** Path to an image that enables users to preview the extension. */
preview?: string;
/** The name of the qext file that was uploaded with this extension. */
qextFilename?: string;
/** The version from the qext file that was uploaded with this extension. */
qextVersion?: string;
/** Link to the extension source code. */
repository?: string;
/** If the extension is a supernova extension or not. */
supernova?: boolean;
/** Supplier of the extension. */
supplier?: string;
/** List of tags. */
tags?: string[];
readonly tenantId?: string;
/** The type of this extension (visualization, etc.). */
type?: string;
readonly updateAt?: string;
readonly userId?: string;
/** Version of the extension. */
version?: string;
};
type Extensions = {
data: Extension[];
};
/**
* 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;
};
/**
* Lists all imported extensions in the tenant.
*
* @throws GetExtensionsHttpError
*/
declare const getExtensions: (options?: ApiCallOptions) => Promise<GetExtensionsHttpResponse>;
type GetExtensionsHttpResponse = {
data: Extensions;
headers: Headers;
status: 200;
};
type GetExtensionsHttpError = {
data: unknown;
headers: Headers;
status: number;
};
/**
* Creates a new extension. Accepts either provided file or data object. The name of the new extension must be different to any existing extensions.
*
* @param body an object with the body content
* @throws UploadExtensionHttpError
*/
declare const uploadExtension: (body: {
/** The extension model. */
data?: Extension;
/** Extension archive. */
file?: BodyInit;
}, options?: ApiCallOptions) => Promise<UploadExtensionHttpResponse>;
type UploadExtensionHttpResponse = {
data: Extension;
headers: Headers;
status: 201;
};
type UploadExtensionHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Deletes a specific extension matching either extension ID or extension name.
*
* @param id Extension identifier or its qextFilename.
* @throws DeleteExtensionHttpError
*/
declare const deleteExtension: (id: string, options?: ApiCallOptions) => Promise<DeleteExtensionHttpResponse>;
type DeleteExtensionHttpResponse = {
data: void;
headers: Headers;
status: 204;
};
type DeleteExtensionHttpError = {
data: Error;
headers: Headers;
status: 403 | 404 | 410;
};
/**
* Returns a specific extension matching either extension ID or extension name.
*
* @param id Extension identifier or its qextFilename.
* @throws GetExtensionHttpError
*/
declare const getExtension: (id: string, options?: ApiCallOptions) => Promise<GetExtensionHttpResponse>;
type GetExtensionHttpResponse = {
data: Extension;
headers: Headers;
status: 200;
};
type GetExtensionHttpError = {
data: Error;
headers: Headers;
status: 403 | 404 | 410;
};
/**
* Updates a specific extension matching either extension ID or extension name. Accepts either provided file or data object.
*
* @param id Extension identifier or its qextFilename.
* @param body an object with the body content
* @throws PatchExtensionHttpError
*/
declare const patchExtension: (id: string, body: {
/** The extension model. */
data?: Extension;
/** Extension archive. */
file?: BodyInit;
}, options?: ApiCallOptions) => Promise<PatchExtensionHttpResponse>;
type PatchExtensionHttpResponse = {
data: Extension;
headers: Headers;
status: 200;
};
type PatchExtensionHttpError = {
data: Error;
headers: Headers;
status: number;
};
/**
* Downloads all files in the extension matching either extension ID or extension name as a `.zip` archive.
*
* @param id Extension identifier or its qextFilename.
* @throws DownloadExtensionHttpError
*/
declare const downloadExtension: (id: string, options?: ApiCallOptions) => Promise<DownloadExtensionHttpResponse>;
type DownloadExtensionHttpResponse = {
data: void;
headers: Headers;
status: 200;
};
type DownloadExtensionHttpError = {
data: Error;
headers: Headers;
status: 403 | 404 | 410;
};
/**
* Downloads a specific file from the extension matching either extension ID or extension name, identified by the file path within the imported extension.
*
* @param id Extension identifier or its qextFilename.
* @param filepath Path to the file location within the specified extension archive. Folders separated with forward slashes.
* @throws DownloadFileFromExtensionHttpError
*/
declare const downloadFileFromExtension: (id: string, filepath: string, options?: ApiCallOptions) => Promise<DownloadFileFromExtensionHttpResponse>;
type DownloadFileFromExtensionHttpResponse = {
data: void;
headers: Headers;
status: 200;
};
type DownloadFileFromExtensionHttpError = {
data: Error;
headers: Headers;
status: 403 | 404 | 410;
};
/**
* Clears the cache for extensions api requests.
*/
declare function clearCache(): void;
interface ExtensionsAPI {
/**
* Lists all imported extensions in the tenant.
*
* @throws GetExtensionsHttpError
*/
getExtensions: typeof getExtensions;
/**
* Creates a new extension. Accepts either provided file or data object. The name of the new extension must be different to any existing extensions.
*
* @param body an object with the body content
* @throws UploadExtensionHttpError
*/
uploadExtension: typeof uploadExtension;
/**
* Deletes a specific extension matching either extension ID or extension name.
*
* @param id Extension identifier or its qextFilename.
* @throws DeleteExtensionHttpError
*/
deleteExtension: typeof deleteExtension;
/**
* Returns a specific extension matching either extension ID or extension name.
*
* @param id Extension identifier or its qextFilename.
* @throws GetExtensionHttpError
*/
getExtension: typeof getExtension;
/**
* Updates a specific extension matching either extension ID or extension name. Accepts either provided file or data object.
*
* @param id Extension identifier or its qextFilename.
* @param body an object with the body content
* @throws PatchExtensionHttpError
*/
patchExtension: typeof patchExtension;
/**
* Downloads all files in the extension matching either extension ID or extension name as a `.zip` archive.
*
* @param id Extension identifier or its qextFilename.
* @throws DownloadExtensionHttpError
*/
downloadExtension: typeof downloadExtension;
/**
* Downloads a specific file from the extension matching either extension ID or extension name, identified by the file path within the imported extension.
*
* @param id Extension identifier or its qextFilename.
* @param filepath Path to the file location within the specified extension archive. Folders separated with forward slashes.
* @throws DownloadFileFromExtensionHttpError
*/
downloadFileFromExtension: typeof downloadFileFromExtension;
/**
* Clears the cache for extensions api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the extensions api
*/
declare const extensionsExport: ExtensionsAPI;
export { type BundleMeta, type DeleteExtensionHttpError, type DeleteExtensionHttpResponse, type DownloadExtensionHttpError, type DownloadExtensionHttpResponse, type DownloadFileFromExtensionHttpError, type DownloadFileFromExtensionHttpResponse, type Error, type Extension, type Extensions, type ExtensionsAPI, type GetExtensionHttpError, type GetExtensionHttpResponse, type GetExtensionsHttpError, type GetExtensionsHttpResponse, type Meta, type PatchExtensionHttpError, type PatchExtensionHttpResponse, type UploadExtensionHttpError, type UploadExtensionHttpResponse, clearCache, extensionsExport as default, deleteExtension, downloadExtension, downloadFileFromExtension, getExtension, getExtensions, patchExtension, uploadExtension };