kirby-types 1.1.0 → 1.1.2
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/README.md +41 -25
- package/package.json +2 -2
- package/src/blocks.d.ts +3 -3
- package/src/panel/api.d.ts +66 -84
- package/src/panel/base.d.ts +26 -33
- package/src/panel/features.d.ts +45 -48
- package/src/panel/helpers.d.ts +23 -33
- package/src/panel/index.d.ts +38 -25
- package/src/panel/libraries.d.ts +2 -2
- package/src/panel/writer.d.ts +10 -10
package/README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./.github/favicon.svg" alt="kirby-types logo" width="144">
|
|
3
|
+
|
|
1
4
|
# kirby-types
|
|
2
5
|
|
|
3
|
-
A collection of TypeScript types for [Kirby CMS](https://getkirby.com)
|
|
6
|
+
A collection of TypeScript types for [Kirby CMS](https://getkirby.com).
|
|
7
|
+
|
|
8
|
+
[Panel types](#panel-types) •
|
|
9
|
+
[Backend API types](#backend-types) •
|
|
10
|
+
[Block and layout types](#layouts)
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
- 🔌 **Backend API types** for headless Kirby usage and KQL
|
|
7
|
-
- 🧱 **Block and layout types** for page builder content
|
|
12
|
+
</div>
|
|
8
13
|
|
|
9
14
|
## Setup
|
|
10
15
|
|
|
@@ -21,7 +26,13 @@ yarn add -D kirby-types
|
|
|
21
26
|
|
|
22
27
|
## Features
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
<table>
|
|
30
|
+
<tr>
|
|
31
|
+
<th>🪟 Panel Types</th>
|
|
32
|
+
<th>🔌 Backend Types</th>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr>
|
|
35
|
+
<td>
|
|
25
36
|
|
|
26
37
|
- **Panel API**: Complete API client method types.
|
|
27
38
|
- **State Management**: State, Feature, and Modal hierarchies.
|
|
@@ -30,7 +41,8 @@ yarn add -D kirby-types
|
|
|
30
41
|
- **Libraries**: Color manipulation, dayjs, and autosize types.
|
|
31
42
|
- **Writer**: ProseMirror-based rich text editor utilities.
|
|
32
43
|
|
|
33
|
-
|
|
44
|
+
</td>
|
|
45
|
+
<td>
|
|
34
46
|
|
|
35
47
|
- **API Response**: Type-safe API responses.
|
|
36
48
|
- **Blocks**: All 11 default block types with content structures.
|
|
@@ -38,6 +50,10 @@ yarn add -D kirby-types
|
|
|
38
50
|
- **KQL**: Query Language request/response types.
|
|
39
51
|
- **Query Parsing**: Parse query strings into structured objects at the type level.
|
|
40
52
|
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
</table>
|
|
56
|
+
|
|
41
57
|
## Basic Usage
|
|
42
58
|
|
|
43
59
|
### Panel Types
|
|
@@ -87,25 +103,6 @@ const user = window.panel.user;
|
|
|
87
103
|
console.log(user.email, user.role);
|
|
88
104
|
```
|
|
89
105
|
|
|
90
|
-
### Writer Extensions
|
|
91
|
-
|
|
92
|
-
For ProseMirror-based Writer extensions (requires optional ProseMirror peer dependencies):
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
import type { WriterMarkContext } from "kirby-types";
|
|
96
|
-
|
|
97
|
-
// In a Writer mark extension
|
|
98
|
-
class Bold {
|
|
99
|
-
commands({ type, utils }: WriterMarkContext) {
|
|
100
|
-
return () => utils.toggleMark(type);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
inputRules({ type, utils }: WriterMarkContext) {
|
|
104
|
-
return [utils.markInputRule(/\*\*([^*]+)\*\*$/, type)];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
106
|
### API Responses
|
|
110
107
|
|
|
111
108
|
```ts
|
|
@@ -227,6 +224,25 @@ type Parsed = ParseKirbyQuery<'page.children.filterBy("status", "published")'>;
|
|
|
227
224
|
// }
|
|
228
225
|
```
|
|
229
226
|
|
|
227
|
+
### Writer Extensions
|
|
228
|
+
|
|
229
|
+
For ProseMirror-based Writer extensions (requires optional ProseMirror peer dependencies):
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
import type { WriterMarkContext } from "kirby-types";
|
|
233
|
+
|
|
234
|
+
// In a Writer mark extension
|
|
235
|
+
class Bold {
|
|
236
|
+
commands({ type, utils }: WriterMarkContext) {
|
|
237
|
+
return () => utils.toggleMark(type);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
inputRules({ type, utils }: WriterMarkContext) {
|
|
241
|
+
return [utils.markInputRule(/\*\*([^*]+)\*\*$/, type)];
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
230
246
|
## API Reference
|
|
231
247
|
|
|
232
248
|
### Panel
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirby-types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"packageManager": "pnpm@10.27.0",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "TypeScript types for Kirby Panel plugins and headless CMS usage",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"homepage": "https://github.com/johannschopplich/kirby-types#readme",
|
package/src/blocks.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ export interface KirbyDefaultBlocks {
|
|
|
166
166
|
* Table block for tabular data.
|
|
167
167
|
* Content structure is dynamic based on rows/columns.
|
|
168
168
|
*/
|
|
169
|
-
table: Record<string,
|
|
169
|
+
table: Record<string, any>;
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Rich text block (WYSIWYG editor).
|
|
@@ -242,13 +242,13 @@ export interface KirbyDefaultBlocks {
|
|
|
242
242
|
*/
|
|
243
243
|
export interface KirbyBlock<
|
|
244
244
|
T extends string = keyof KirbyDefaultBlocks,
|
|
245
|
-
U extends Record<string,
|
|
245
|
+
U extends Record<string, any> | undefined = undefined,
|
|
246
246
|
> {
|
|
247
247
|
/**
|
|
248
248
|
* The block's content fields.
|
|
249
249
|
* Structure depends on the block type or custom content definition.
|
|
250
250
|
*/
|
|
251
|
-
content: U extends Record<string,
|
|
251
|
+
content: U extends Record<string, any>
|
|
252
252
|
? U
|
|
253
253
|
: T extends keyof KirbyDefaultBlocks
|
|
254
254
|
? KirbyDefaultBlocks[T]
|
package/src/panel/api.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export interface PanelApiAuth {
|
|
|
71
71
|
* @param data - Login credentials
|
|
72
72
|
* @returns User data
|
|
73
73
|
*/
|
|
74
|
-
login: (data: PanelApiLoginData) => Promise<
|
|
74
|
+
login: (data: PanelApiLoginData) => Promise<any>;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Logs out the current user.
|
|
@@ -91,9 +91,9 @@ export interface PanelApiAuth {
|
|
|
91
91
|
* @returns User data
|
|
92
92
|
*/
|
|
93
93
|
user: (
|
|
94
|
-
query?: Record<string,
|
|
94
|
+
query?: Record<string, any>,
|
|
95
95
|
options?: PanelApiRequestOptions,
|
|
96
|
-
) => Promise<
|
|
96
|
+
) => Promise<any>;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Verifies a 2FA code.
|
|
@@ -102,10 +102,7 @@ export interface PanelApiAuth {
|
|
|
102
102
|
* @param data - Additional data
|
|
103
103
|
* @returns Verification result
|
|
104
104
|
*/
|
|
105
|
-
verifyCode: (
|
|
106
|
-
code: string,
|
|
107
|
-
data?: Record<string, unknown>,
|
|
108
|
-
) => Promise<unknown>;
|
|
105
|
+
verifyCode: (code: string, data?: Record<string, any>) => Promise<any>;
|
|
109
106
|
}
|
|
110
107
|
|
|
111
108
|
// -----------------------------------------------------------------------------
|
|
@@ -130,7 +127,7 @@ export interface PanelApiFiles {
|
|
|
130
127
|
parent: string | null,
|
|
131
128
|
filename: string,
|
|
132
129
|
to: string,
|
|
133
|
-
) => Promise<
|
|
130
|
+
) => Promise<any>;
|
|
134
131
|
|
|
135
132
|
/**
|
|
136
133
|
* Deletes a file.
|
|
@@ -151,8 +148,8 @@ export interface PanelApiFiles {
|
|
|
151
148
|
get: (
|
|
152
149
|
parent: string | null,
|
|
153
150
|
filename: string,
|
|
154
|
-
query?: Record<string,
|
|
155
|
-
) => Promise<
|
|
151
|
+
query?: Record<string, any>,
|
|
152
|
+
) => Promise<any>;
|
|
156
153
|
|
|
157
154
|
/**
|
|
158
155
|
* Converts file ID/UUID to API format.
|
|
@@ -183,8 +180,8 @@ export interface PanelApiFiles {
|
|
|
183
180
|
update: (
|
|
184
181
|
parent: string | null,
|
|
185
182
|
filename: string,
|
|
186
|
-
data: Record<string,
|
|
187
|
-
) => Promise<
|
|
183
|
+
data: Record<string, any>,
|
|
184
|
+
) => Promise<any>;
|
|
188
185
|
|
|
189
186
|
/**
|
|
190
187
|
* Gets API URL for a file.
|
|
@@ -232,7 +229,7 @@ export interface PanelApiLanguages {
|
|
|
232
229
|
* @param data - Language data
|
|
233
230
|
* @returns Created language
|
|
234
231
|
*/
|
|
235
|
-
create: (code: string, data: PanelApiLanguageData) => Promise<
|
|
232
|
+
create: (code: string, data: PanelApiLanguageData) => Promise<any>;
|
|
236
233
|
|
|
237
234
|
/**
|
|
238
235
|
* Deletes a language.
|
|
@@ -247,14 +244,14 @@ export interface PanelApiLanguages {
|
|
|
247
244
|
* @param code - Language code
|
|
248
245
|
* @returns Language data
|
|
249
246
|
*/
|
|
250
|
-
get: (code: string) => Promise<
|
|
247
|
+
get: (code: string) => Promise<any>;
|
|
251
248
|
|
|
252
249
|
/**
|
|
253
250
|
* Lists all languages.
|
|
254
251
|
*
|
|
255
252
|
* @returns Array of languages
|
|
256
253
|
*/
|
|
257
|
-
list: () => Promise<
|
|
254
|
+
list: () => Promise<any[]>;
|
|
258
255
|
|
|
259
256
|
/**
|
|
260
257
|
* Updates a language.
|
|
@@ -263,10 +260,7 @@ export interface PanelApiLanguages {
|
|
|
263
260
|
* @param data - Updated data
|
|
264
261
|
* @returns Updated language
|
|
265
262
|
*/
|
|
266
|
-
update: (
|
|
267
|
-
code: string,
|
|
268
|
-
data: Partial<PanelApiLanguageData>,
|
|
269
|
-
) => Promise<unknown>;
|
|
263
|
+
update: (code: string, data: Partial<PanelApiLanguageData>) => Promise<any>;
|
|
270
264
|
}
|
|
271
265
|
|
|
272
266
|
// -----------------------------------------------------------------------------
|
|
@@ -284,7 +278,7 @@ export interface PanelApiPageCreateData {
|
|
|
284
278
|
/** Page template */
|
|
285
279
|
template?: string;
|
|
286
280
|
/** Initial content */
|
|
287
|
-
content?: Record<string,
|
|
281
|
+
content?: Record<string, any>;
|
|
288
282
|
/** Initial status */
|
|
289
283
|
status?: "draft" | "unlisted" | "listed";
|
|
290
284
|
}
|
|
@@ -311,7 +305,7 @@ export interface PanelApiPages {
|
|
|
311
305
|
* @param parent - Page ID
|
|
312
306
|
* @returns Blueprint data
|
|
313
307
|
*/
|
|
314
|
-
blueprint: (parent: string) => Promise<
|
|
308
|
+
blueprint: (parent: string) => Promise<any>;
|
|
315
309
|
|
|
316
310
|
/**
|
|
317
311
|
* Gets available blueprints for a page.
|
|
@@ -320,7 +314,7 @@ export interface PanelApiPages {
|
|
|
320
314
|
* @param section - Section name
|
|
321
315
|
* @returns Array of blueprints
|
|
322
316
|
*/
|
|
323
|
-
blueprints: (parent: string, section?: string) => Promise<
|
|
317
|
+
blueprints: (parent: string, section?: string) => Promise<any[]>;
|
|
324
318
|
|
|
325
319
|
/**
|
|
326
320
|
* Changes a page's slug.
|
|
@@ -329,7 +323,7 @@ export interface PanelApiPages {
|
|
|
329
323
|
* @param slug - New slug
|
|
330
324
|
* @returns Updated page
|
|
331
325
|
*/
|
|
332
|
-
changeSlug: (id: string, slug: string) => Promise<
|
|
326
|
+
changeSlug: (id: string, slug: string) => Promise<any>;
|
|
333
327
|
|
|
334
328
|
/**
|
|
335
329
|
* Changes a page's status.
|
|
@@ -343,7 +337,7 @@ export interface PanelApiPages {
|
|
|
343
337
|
id: string,
|
|
344
338
|
status: "draft" | "unlisted" | "listed",
|
|
345
339
|
position?: number,
|
|
346
|
-
) => Promise<
|
|
340
|
+
) => Promise<any>;
|
|
347
341
|
|
|
348
342
|
/**
|
|
349
343
|
* Changes a page's template.
|
|
@@ -352,7 +346,7 @@ export interface PanelApiPages {
|
|
|
352
346
|
* @param template - New template
|
|
353
347
|
* @returns Updated page
|
|
354
348
|
*/
|
|
355
|
-
changeTemplate: (id: string, template: string) => Promise<
|
|
349
|
+
changeTemplate: (id: string, template: string) => Promise<any>;
|
|
356
350
|
|
|
357
351
|
/**
|
|
358
352
|
* Changes a page's title.
|
|
@@ -361,7 +355,7 @@ export interface PanelApiPages {
|
|
|
361
355
|
* @param title - New title
|
|
362
356
|
* @returns Updated page
|
|
363
357
|
*/
|
|
364
|
-
changeTitle: (id: string, title: string) => Promise<
|
|
358
|
+
changeTitle: (id: string, title: string) => Promise<any>;
|
|
365
359
|
|
|
366
360
|
/**
|
|
367
361
|
* Searches children pages.
|
|
@@ -370,7 +364,7 @@ export interface PanelApiPages {
|
|
|
370
364
|
* @param query - Search query
|
|
371
365
|
* @returns Search results
|
|
372
366
|
*/
|
|
373
|
-
children: (id: string, query?: PanelApiSearchQuery) => Promise<
|
|
367
|
+
children: (id: string, query?: PanelApiSearchQuery) => Promise<any>;
|
|
374
368
|
|
|
375
369
|
/**
|
|
376
370
|
* Creates a new page.
|
|
@@ -379,10 +373,7 @@ export interface PanelApiPages {
|
|
|
379
373
|
* @param data - Page data
|
|
380
374
|
* @returns Created page
|
|
381
375
|
*/
|
|
382
|
-
create: (
|
|
383
|
-
parent: string | null,
|
|
384
|
-
data: PanelApiPageCreateData,
|
|
385
|
-
) => Promise<unknown>;
|
|
376
|
+
create: (parent: string | null, data: PanelApiPageCreateData) => Promise<any>;
|
|
386
377
|
|
|
387
378
|
/**
|
|
388
379
|
* Deletes a page.
|
|
@@ -404,7 +395,7 @@ export interface PanelApiPages {
|
|
|
404
395
|
id: string,
|
|
405
396
|
slug: string,
|
|
406
397
|
options?: PanelApiPageDuplicateOptions,
|
|
407
|
-
) => Promise<
|
|
398
|
+
) => Promise<any>;
|
|
408
399
|
|
|
409
400
|
/**
|
|
410
401
|
* Gets a page.
|
|
@@ -413,7 +404,7 @@ export interface PanelApiPages {
|
|
|
413
404
|
* @param query - Query parameters
|
|
414
405
|
* @returns Page data
|
|
415
406
|
*/
|
|
416
|
-
get: (id: string, query?: Record<string,
|
|
407
|
+
get: (id: string, query?: Record<string, any>) => Promise<any>;
|
|
417
408
|
|
|
418
409
|
/**
|
|
419
410
|
* Converts page ID/UUID to API format.
|
|
@@ -430,7 +421,7 @@ export interface PanelApiPages {
|
|
|
430
421
|
* @param query - Search query
|
|
431
422
|
* @returns Search results
|
|
432
423
|
*/
|
|
433
|
-
files: (id: string, query?: PanelApiSearchQuery) => Promise<
|
|
424
|
+
files: (id: string, query?: PanelApiSearchQuery) => Promise<any>;
|
|
434
425
|
|
|
435
426
|
/**
|
|
436
427
|
* Gets Panel link for a page.
|
|
@@ -455,10 +446,7 @@ export interface PanelApiPages {
|
|
|
455
446
|
* @param query - Search query
|
|
456
447
|
* @returns Search results
|
|
457
448
|
*/
|
|
458
|
-
search: (
|
|
459
|
-
parent: string | null,
|
|
460
|
-
query?: PanelApiSearchQuery,
|
|
461
|
-
) => Promise<unknown>;
|
|
449
|
+
search: (parent: string | null, query?: PanelApiSearchQuery) => Promise<any>;
|
|
462
450
|
|
|
463
451
|
/**
|
|
464
452
|
* Updates a page's content.
|
|
@@ -467,7 +455,7 @@ export interface PanelApiPages {
|
|
|
467
455
|
* @param data - Content data
|
|
468
456
|
* @returns Updated page
|
|
469
457
|
*/
|
|
470
|
-
update: (id: string, data: Record<string,
|
|
458
|
+
update: (id: string, data: Record<string, any>) => Promise<any>;
|
|
471
459
|
|
|
472
460
|
/**
|
|
473
461
|
* Gets API URL for a page.
|
|
@@ -495,7 +483,7 @@ export interface PanelApiRoles {
|
|
|
495
483
|
* @param name - Role name
|
|
496
484
|
* @returns Role data
|
|
497
485
|
*/
|
|
498
|
-
get: (name: string) => Promise<
|
|
486
|
+
get: (name: string) => Promise<any>;
|
|
499
487
|
|
|
500
488
|
/**
|
|
501
489
|
* Lists available roles.
|
|
@@ -504,7 +492,7 @@ export interface PanelApiRoles {
|
|
|
504
492
|
* @param query - Query parameters
|
|
505
493
|
* @returns Array of roles
|
|
506
494
|
*/
|
|
507
|
-
list: (user?: string, query?: Record<string,
|
|
495
|
+
list: (user?: string, query?: Record<string, any>) => Promise<any[]>;
|
|
508
496
|
}
|
|
509
497
|
|
|
510
498
|
// -----------------------------------------------------------------------------
|
|
@@ -522,14 +510,14 @@ export interface PanelApiSite {
|
|
|
522
510
|
*
|
|
523
511
|
* @returns Blueprint data
|
|
524
512
|
*/
|
|
525
|
-
blueprint: () => Promise<
|
|
513
|
+
blueprint: () => Promise<any>;
|
|
526
514
|
|
|
527
515
|
/**
|
|
528
516
|
* Gets available blueprints for the site.
|
|
529
517
|
*
|
|
530
518
|
* @returns Array of blueprints
|
|
531
519
|
*/
|
|
532
|
-
blueprints: () => Promise<
|
|
520
|
+
blueprints: () => Promise<any[]>;
|
|
533
521
|
|
|
534
522
|
/**
|
|
535
523
|
* Changes the site title.
|
|
@@ -538,7 +526,7 @@ export interface PanelApiSite {
|
|
|
538
526
|
* @param language - Language code
|
|
539
527
|
* @returns Updated site
|
|
540
528
|
*/
|
|
541
|
-
changeTitle: (title: string, language?: string) => Promise<
|
|
529
|
+
changeTitle: (title: string, language?: string) => Promise<any>;
|
|
542
530
|
|
|
543
531
|
/**
|
|
544
532
|
* Searches site children.
|
|
@@ -549,8 +537,8 @@ export interface PanelApiSite {
|
|
|
549
537
|
*/
|
|
550
538
|
children: (
|
|
551
539
|
query?: PanelApiSearchQuery,
|
|
552
|
-
options?: Record<string,
|
|
553
|
-
) => Promise<
|
|
540
|
+
options?: Record<string, any>,
|
|
541
|
+
) => Promise<any>;
|
|
554
542
|
|
|
555
543
|
/**
|
|
556
544
|
* Gets the site.
|
|
@@ -558,7 +546,7 @@ export interface PanelApiSite {
|
|
|
558
546
|
* @param query - Query parameters
|
|
559
547
|
* @returns Site data
|
|
560
548
|
*/
|
|
561
|
-
get: (query?: Record<string,
|
|
549
|
+
get: (query?: Record<string, any>) => Promise<any>;
|
|
562
550
|
|
|
563
551
|
/**
|
|
564
552
|
* Updates the site content.
|
|
@@ -567,10 +555,7 @@ export interface PanelApiSite {
|
|
|
567
555
|
* @param language - Language code
|
|
568
556
|
* @returns Updated site
|
|
569
557
|
*/
|
|
570
|
-
update: (
|
|
571
|
-
data: Record<string, unknown>,
|
|
572
|
-
language?: string,
|
|
573
|
-
) => Promise<unknown>;
|
|
558
|
+
update: (data: Record<string, any>, language?: string) => Promise<any>;
|
|
574
559
|
}
|
|
575
560
|
|
|
576
561
|
// -----------------------------------------------------------------------------
|
|
@@ -611,7 +596,7 @@ export interface PanelApiSystem {
|
|
|
611
596
|
* @param query - Query parameters
|
|
612
597
|
* @returns System data
|
|
613
598
|
*/
|
|
614
|
-
get: (query?: Record<string,
|
|
599
|
+
get: (query?: Record<string, any>) => Promise<any>;
|
|
615
600
|
|
|
616
601
|
/**
|
|
617
602
|
* Installs Kirby with initial user.
|
|
@@ -622,8 +607,8 @@ export interface PanelApiSystem {
|
|
|
622
607
|
*/
|
|
623
608
|
install: (
|
|
624
609
|
data: PanelApiSystemInstallData,
|
|
625
|
-
query?: Record<string,
|
|
626
|
-
) => Promise<
|
|
610
|
+
query?: Record<string, any>,
|
|
611
|
+
) => Promise<any>;
|
|
627
612
|
|
|
628
613
|
/**
|
|
629
614
|
* Registers a license.
|
|
@@ -634,8 +619,8 @@ export interface PanelApiSystem {
|
|
|
634
619
|
*/
|
|
635
620
|
register: (
|
|
636
621
|
data: PanelApiSystemRegisterData,
|
|
637
|
-
query?: Record<string,
|
|
638
|
-
) => Promise<
|
|
622
|
+
query?: Record<string, any>,
|
|
623
|
+
) => Promise<any>;
|
|
639
624
|
}
|
|
640
625
|
|
|
641
626
|
// -----------------------------------------------------------------------------
|
|
@@ -654,14 +639,14 @@ export interface PanelApiTranslations {
|
|
|
654
639
|
* @param code - Translation code
|
|
655
640
|
* @returns Translation data
|
|
656
641
|
*/
|
|
657
|
-
get: (code: string) => Promise<
|
|
642
|
+
get: (code: string) => Promise<any>;
|
|
658
643
|
|
|
659
644
|
/**
|
|
660
645
|
* Lists all translations.
|
|
661
646
|
*
|
|
662
647
|
* @returns Array of translations
|
|
663
648
|
*/
|
|
664
|
-
list: () => Promise<
|
|
649
|
+
list: () => Promise<any[]>;
|
|
665
650
|
}
|
|
666
651
|
|
|
667
652
|
// -----------------------------------------------------------------------------
|
|
@@ -696,7 +681,7 @@ export interface PanelApiUsers {
|
|
|
696
681
|
* @param id - User ID
|
|
697
682
|
* @returns Blueprint data
|
|
698
683
|
*/
|
|
699
|
-
blueprint: (id: string) => Promise<
|
|
684
|
+
blueprint: (id: string) => Promise<any>;
|
|
700
685
|
|
|
701
686
|
/**
|
|
702
687
|
* Gets available blueprints for users.
|
|
@@ -705,10 +690,7 @@ export interface PanelApiUsers {
|
|
|
705
690
|
* @param query - Query parameters
|
|
706
691
|
* @returns Array of blueprints
|
|
707
692
|
*/
|
|
708
|
-
blueprints: (
|
|
709
|
-
user?: string,
|
|
710
|
-
query?: Record<string, unknown>,
|
|
711
|
-
) => Promise<unknown[]>;
|
|
693
|
+
blueprints: (user?: string, query?: Record<string, any>) => Promise<any[]>;
|
|
712
694
|
|
|
713
695
|
/**
|
|
714
696
|
* Changes a user's email.
|
|
@@ -717,7 +699,7 @@ export interface PanelApiUsers {
|
|
|
717
699
|
* @param email - New email
|
|
718
700
|
* @returns Updated user
|
|
719
701
|
*/
|
|
720
|
-
changeEmail: (id: string, email: string) => Promise<
|
|
702
|
+
changeEmail: (id: string, email: string) => Promise<any>;
|
|
721
703
|
|
|
722
704
|
/**
|
|
723
705
|
* Changes a user's language.
|
|
@@ -726,7 +708,7 @@ export interface PanelApiUsers {
|
|
|
726
708
|
* @param language - New language code
|
|
727
709
|
* @returns Updated user
|
|
728
710
|
*/
|
|
729
|
-
changeLanguage: (id: string, language: string) => Promise<
|
|
711
|
+
changeLanguage: (id: string, language: string) => Promise<any>;
|
|
730
712
|
|
|
731
713
|
/**
|
|
732
714
|
* Changes a user's name.
|
|
@@ -735,7 +717,7 @@ export interface PanelApiUsers {
|
|
|
735
717
|
* @param name - New name
|
|
736
718
|
* @returns Updated user
|
|
737
719
|
*/
|
|
738
|
-
changeName: (id: string, name: string) => Promise<
|
|
720
|
+
changeName: (id: string, name: string) => Promise<any>;
|
|
739
721
|
|
|
740
722
|
/**
|
|
741
723
|
* Changes a user's password.
|
|
@@ -749,7 +731,7 @@ export interface PanelApiUsers {
|
|
|
749
731
|
id: string,
|
|
750
732
|
password: string,
|
|
751
733
|
confirmation: string,
|
|
752
|
-
) => Promise<
|
|
734
|
+
) => Promise<any>;
|
|
753
735
|
|
|
754
736
|
/**
|
|
755
737
|
* Changes a user's role.
|
|
@@ -758,7 +740,7 @@ export interface PanelApiUsers {
|
|
|
758
740
|
* @param role - New role
|
|
759
741
|
* @returns Updated user
|
|
760
742
|
*/
|
|
761
|
-
changeRole: (id: string, role: string) => Promise<
|
|
743
|
+
changeRole: (id: string, role: string) => Promise<any>;
|
|
762
744
|
|
|
763
745
|
/**
|
|
764
746
|
* Creates a new user.
|
|
@@ -767,7 +749,7 @@ export interface PanelApiUsers {
|
|
|
767
749
|
* @param data - User data
|
|
768
750
|
* @returns Created user
|
|
769
751
|
*/
|
|
770
|
-
create: (id: string, data: PanelApiUserCreateData) => Promise<
|
|
752
|
+
create: (id: string, data: PanelApiUserCreateData) => Promise<any>;
|
|
771
753
|
|
|
772
754
|
/**
|
|
773
755
|
* Deletes a user.
|
|
@@ -790,7 +772,7 @@ export interface PanelApiUsers {
|
|
|
790
772
|
* @param query - Query parameters
|
|
791
773
|
* @returns User data
|
|
792
774
|
*/
|
|
793
|
-
get: (id: string, query?: Record<string,
|
|
775
|
+
get: (id: string, query?: Record<string, any>) => Promise<any>;
|
|
794
776
|
|
|
795
777
|
/**
|
|
796
778
|
* Gets Panel link for a user.
|
|
@@ -807,7 +789,7 @@ export interface PanelApiUsers {
|
|
|
807
789
|
* @param query - Query parameters
|
|
808
790
|
* @returns Array of users
|
|
809
791
|
*/
|
|
810
|
-
list: (query?: Record<string,
|
|
792
|
+
list: (query?: Record<string, any>) => Promise<any[]>;
|
|
811
793
|
|
|
812
794
|
/**
|
|
813
795
|
* Gets roles available to a user.
|
|
@@ -815,7 +797,7 @@ export interface PanelApiUsers {
|
|
|
815
797
|
* @param id - User ID
|
|
816
798
|
* @returns Array of roles
|
|
817
799
|
*/
|
|
818
|
-
roles: (id: string) => Promise<
|
|
800
|
+
roles: (id: string) => Promise<any[]>;
|
|
819
801
|
|
|
820
802
|
/**
|
|
821
803
|
* Searches users.
|
|
@@ -826,8 +808,8 @@ export interface PanelApiUsers {
|
|
|
826
808
|
*/
|
|
827
809
|
search: (
|
|
828
810
|
query?: PanelApiSearchQuery,
|
|
829
|
-
options?: Record<string,
|
|
830
|
-
) => Promise<
|
|
811
|
+
options?: Record<string, any>,
|
|
812
|
+
) => Promise<any>;
|
|
831
813
|
|
|
832
814
|
/**
|
|
833
815
|
* Updates a user's content.
|
|
@@ -836,7 +818,7 @@ export interface PanelApiUsers {
|
|
|
836
818
|
* @param data - Content data
|
|
837
819
|
* @returns Updated user
|
|
838
820
|
*/
|
|
839
|
-
update: (id: string, data: Record<string,
|
|
821
|
+
update: (id: string, data: Record<string, any>) => Promise<any>;
|
|
840
822
|
|
|
841
823
|
/**
|
|
842
824
|
* Gets API URL for a user.
|
|
@@ -906,7 +888,7 @@ export interface PanelApi {
|
|
|
906
888
|
path: string,
|
|
907
889
|
options?: PanelApiRequestOptions,
|
|
908
890
|
silent?: boolean,
|
|
909
|
-
) => Promise<
|
|
891
|
+
) => Promise<any>;
|
|
910
892
|
|
|
911
893
|
/**
|
|
912
894
|
* Makes a GET request.
|
|
@@ -919,10 +901,10 @@ export interface PanelApi {
|
|
|
919
901
|
*/
|
|
920
902
|
get: (
|
|
921
903
|
path: string,
|
|
922
|
-
query?: Record<string,
|
|
904
|
+
query?: Record<string, any>,
|
|
923
905
|
options?: PanelApiRequestOptions,
|
|
924
906
|
silent?: boolean,
|
|
925
|
-
) => Promise<
|
|
907
|
+
) => Promise<any>;
|
|
926
908
|
|
|
927
909
|
/**
|
|
928
910
|
* Makes a POST request.
|
|
@@ -936,11 +918,11 @@ export interface PanelApi {
|
|
|
936
918
|
*/
|
|
937
919
|
post: (
|
|
938
920
|
path: string,
|
|
939
|
-
data?:
|
|
921
|
+
data?: any,
|
|
940
922
|
options?: PanelApiRequestOptions,
|
|
941
923
|
silent?: boolean,
|
|
942
924
|
upload?: boolean,
|
|
943
|
-
) => Promise<
|
|
925
|
+
) => Promise<any>;
|
|
944
926
|
|
|
945
927
|
/**
|
|
946
928
|
* Makes a PATCH request.
|
|
@@ -953,10 +935,10 @@ export interface PanelApi {
|
|
|
953
935
|
*/
|
|
954
936
|
patch: (
|
|
955
937
|
path: string,
|
|
956
|
-
data?:
|
|
938
|
+
data?: any,
|
|
957
939
|
options?: PanelApiRequestOptions,
|
|
958
940
|
silent?: boolean,
|
|
959
|
-
) => Promise<
|
|
941
|
+
) => Promise<any>;
|
|
960
942
|
|
|
961
943
|
/**
|
|
962
944
|
* Makes a DELETE request.
|
|
@@ -969,10 +951,10 @@ export interface PanelApi {
|
|
|
969
951
|
*/
|
|
970
952
|
delete: (
|
|
971
953
|
path: string,
|
|
972
|
-
data?:
|
|
954
|
+
data?: any,
|
|
973
955
|
options?: PanelApiRequestOptions,
|
|
974
956
|
silent?: boolean,
|
|
975
|
-
) => Promise<
|
|
957
|
+
) => Promise<any>;
|
|
976
958
|
|
|
977
959
|
/** Authentication methods */
|
|
978
960
|
auth: PanelApiAuth;
|