kirby-types 1.1.1 → 1.2.0
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 +12 -7
- package/src/blocks.d.ts +3 -3
- package/src/panel/api.d.ts +81 -123
- package/src/panel/base.d.ts +40 -45
- package/src/panel/features.d.ts +82 -77
- package/src/panel/helpers.d.ts +64 -61
- package/src/panel/index.d.ts +133 -76
- package/src/panel/libraries.d.ts +145 -133
- package/src/panel/writer.d.ts +10 -10
package/src/panel/api.d.ts
CHANGED
|
@@ -71,41 +71,33 @@ 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.
|
|
78
78
|
*/
|
|
79
|
-
logout: () => Promise<
|
|
79
|
+
logout: () => Promise<any>;
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Pings the server to keep session alive.
|
|
83
83
|
*/
|
|
84
|
-
ping: () => Promise<
|
|
84
|
+
ping: () => Promise<any>;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* Gets the current user.
|
|
88
88
|
*
|
|
89
89
|
* @param query - Query parameters
|
|
90
|
-
* @param options - Request options
|
|
91
90
|
* @returns User data
|
|
92
91
|
*/
|
|
93
|
-
user: (
|
|
94
|
-
query?: Record<string, unknown>,
|
|
95
|
-
options?: PanelApiRequestOptions,
|
|
96
|
-
) => Promise<unknown>;
|
|
92
|
+
user: (query?: Record<string, any>) => Promise<any>;
|
|
97
93
|
|
|
98
94
|
/**
|
|
99
95
|
* Verifies a 2FA code.
|
|
100
96
|
*
|
|
101
97
|
* @param code - Verification code
|
|
102
|
-
* @param data - Additional data
|
|
103
98
|
* @returns Verification result
|
|
104
99
|
*/
|
|
105
|
-
verifyCode: (
|
|
106
|
-
code: string,
|
|
107
|
-
data?: Record<string, unknown>,
|
|
108
|
-
) => Promise<unknown>;
|
|
100
|
+
verifyCode: (code: string) => Promise<any>;
|
|
109
101
|
}
|
|
110
102
|
|
|
111
103
|
// -----------------------------------------------------------------------------
|
|
@@ -130,7 +122,7 @@ export interface PanelApiFiles {
|
|
|
130
122
|
parent: string | null,
|
|
131
123
|
filename: string,
|
|
132
124
|
to: string,
|
|
133
|
-
) => Promise<
|
|
125
|
+
) => Promise<any>;
|
|
134
126
|
|
|
135
127
|
/**
|
|
136
128
|
* Deletes a file.
|
|
@@ -138,7 +130,7 @@ export interface PanelApiFiles {
|
|
|
138
130
|
* @param parent - Parent page/site path
|
|
139
131
|
* @param filename - Filename to delete
|
|
140
132
|
*/
|
|
141
|
-
delete: (parent: string | null, filename: string) => Promise<
|
|
133
|
+
delete: (parent: string | null, filename: string) => Promise<any>;
|
|
142
134
|
|
|
143
135
|
/**
|
|
144
136
|
* Gets a file.
|
|
@@ -151,8 +143,8 @@ export interface PanelApiFiles {
|
|
|
151
143
|
get: (
|
|
152
144
|
parent: string | null,
|
|
153
145
|
filename: string,
|
|
154
|
-
query?: Record<string,
|
|
155
|
-
) => Promise<
|
|
146
|
+
query?: Record<string, any>,
|
|
147
|
+
) => Promise<any>;
|
|
156
148
|
|
|
157
149
|
/**
|
|
158
150
|
* Converts file ID/UUID to API format.
|
|
@@ -183,8 +175,8 @@ export interface PanelApiFiles {
|
|
|
183
175
|
update: (
|
|
184
176
|
parent: string | null,
|
|
185
177
|
filename: string,
|
|
186
|
-
data: Record<string,
|
|
187
|
-
) => Promise<
|
|
178
|
+
data: Record<string, any>,
|
|
179
|
+
) => Promise<any>;
|
|
188
180
|
|
|
189
181
|
/**
|
|
190
182
|
* Gets API URL for a file.
|
|
@@ -228,18 +220,17 @@ export interface PanelApiLanguages {
|
|
|
228
220
|
/**
|
|
229
221
|
* Creates a new language.
|
|
230
222
|
*
|
|
231
|
-
* @param
|
|
232
|
-
* @param data - Language data
|
|
223
|
+
* @param data - Language data (including code)
|
|
233
224
|
* @returns Created language
|
|
234
225
|
*/
|
|
235
|
-
create: (
|
|
226
|
+
create: (data: PanelApiLanguageData) => Promise<any>;
|
|
236
227
|
|
|
237
228
|
/**
|
|
238
229
|
* Deletes a language.
|
|
239
230
|
*
|
|
240
231
|
* @param code - Language code
|
|
241
232
|
*/
|
|
242
|
-
delete: (code: string) => Promise<
|
|
233
|
+
delete: (code: string) => Promise<any>;
|
|
243
234
|
|
|
244
235
|
/**
|
|
245
236
|
* Gets a language.
|
|
@@ -247,14 +238,14 @@ export interface PanelApiLanguages {
|
|
|
247
238
|
* @param code - Language code
|
|
248
239
|
* @returns Language data
|
|
249
240
|
*/
|
|
250
|
-
get: (code: string) => Promise<
|
|
241
|
+
get: (code: string) => Promise<any>;
|
|
251
242
|
|
|
252
243
|
/**
|
|
253
244
|
* Lists all languages.
|
|
254
245
|
*
|
|
255
246
|
* @returns Array of languages
|
|
256
247
|
*/
|
|
257
|
-
list: () => Promise<
|
|
248
|
+
list: () => Promise<any[]>;
|
|
258
249
|
|
|
259
250
|
/**
|
|
260
251
|
* Updates a language.
|
|
@@ -263,10 +254,7 @@ export interface PanelApiLanguages {
|
|
|
263
254
|
* @param data - Updated data
|
|
264
255
|
* @returns Updated language
|
|
265
256
|
*/
|
|
266
|
-
update: (
|
|
267
|
-
code: string,
|
|
268
|
-
data: Partial<PanelApiLanguageData>,
|
|
269
|
-
) => Promise<unknown>;
|
|
257
|
+
update: (code: string, data: Partial<PanelApiLanguageData>) => Promise<any>;
|
|
270
258
|
}
|
|
271
259
|
|
|
272
260
|
// -----------------------------------------------------------------------------
|
|
@@ -284,7 +272,7 @@ export interface PanelApiPageCreateData {
|
|
|
284
272
|
/** Page template */
|
|
285
273
|
template?: string;
|
|
286
274
|
/** Initial content */
|
|
287
|
-
content?: Record<string,
|
|
275
|
+
content?: Record<string, any>;
|
|
288
276
|
/** Initial status */
|
|
289
277
|
status?: "draft" | "unlisted" | "listed";
|
|
290
278
|
}
|
|
@@ -311,7 +299,7 @@ export interface PanelApiPages {
|
|
|
311
299
|
* @param parent - Page ID
|
|
312
300
|
* @returns Blueprint data
|
|
313
301
|
*/
|
|
314
|
-
blueprint: (parent: string) => Promise<
|
|
302
|
+
blueprint: (parent: string) => Promise<any>;
|
|
315
303
|
|
|
316
304
|
/**
|
|
317
305
|
* Gets available blueprints for a page.
|
|
@@ -320,7 +308,7 @@ export interface PanelApiPages {
|
|
|
320
308
|
* @param section - Section name
|
|
321
309
|
* @returns Array of blueprints
|
|
322
310
|
*/
|
|
323
|
-
blueprints: (parent: string, section?: string) => Promise<
|
|
311
|
+
blueprints: (parent: string, section?: string) => Promise<any[]>;
|
|
324
312
|
|
|
325
313
|
/**
|
|
326
314
|
* Changes a page's slug.
|
|
@@ -329,7 +317,7 @@ export interface PanelApiPages {
|
|
|
329
317
|
* @param slug - New slug
|
|
330
318
|
* @returns Updated page
|
|
331
319
|
*/
|
|
332
|
-
changeSlug: (id: string, slug: string) => Promise<
|
|
320
|
+
changeSlug: (id: string, slug: string) => Promise<any>;
|
|
333
321
|
|
|
334
322
|
/**
|
|
335
323
|
* Changes a page's status.
|
|
@@ -343,7 +331,7 @@ export interface PanelApiPages {
|
|
|
343
331
|
id: string,
|
|
344
332
|
status: "draft" | "unlisted" | "listed",
|
|
345
333
|
position?: number,
|
|
346
|
-
) => Promise<
|
|
334
|
+
) => Promise<any>;
|
|
347
335
|
|
|
348
336
|
/**
|
|
349
337
|
* Changes a page's template.
|
|
@@ -352,7 +340,7 @@ export interface PanelApiPages {
|
|
|
352
340
|
* @param template - New template
|
|
353
341
|
* @returns Updated page
|
|
354
342
|
*/
|
|
355
|
-
changeTemplate: (id: string, template: string) => Promise<
|
|
343
|
+
changeTemplate: (id: string, template: string) => Promise<any>;
|
|
356
344
|
|
|
357
345
|
/**
|
|
358
346
|
* Changes a page's title.
|
|
@@ -361,7 +349,7 @@ export interface PanelApiPages {
|
|
|
361
349
|
* @param title - New title
|
|
362
350
|
* @returns Updated page
|
|
363
351
|
*/
|
|
364
|
-
changeTitle: (id: string, title: string) => Promise<
|
|
352
|
+
changeTitle: (id: string, title: string) => Promise<any>;
|
|
365
353
|
|
|
366
354
|
/**
|
|
367
355
|
* Searches children pages.
|
|
@@ -370,7 +358,7 @@ export interface PanelApiPages {
|
|
|
370
358
|
* @param query - Search query
|
|
371
359
|
* @returns Search results
|
|
372
360
|
*/
|
|
373
|
-
children: (id: string, query?: PanelApiSearchQuery) => Promise<
|
|
361
|
+
children: (id: string, query?: PanelApiSearchQuery) => Promise<any>;
|
|
374
362
|
|
|
375
363
|
/**
|
|
376
364
|
* Creates a new page.
|
|
@@ -379,10 +367,7 @@ export interface PanelApiPages {
|
|
|
379
367
|
* @param data - Page data
|
|
380
368
|
* @returns Created page
|
|
381
369
|
*/
|
|
382
|
-
create: (
|
|
383
|
-
parent: string | null,
|
|
384
|
-
data: PanelApiPageCreateData,
|
|
385
|
-
) => Promise<unknown>;
|
|
370
|
+
create: (parent: string | null, data: PanelApiPageCreateData) => Promise<any>;
|
|
386
371
|
|
|
387
372
|
/**
|
|
388
373
|
* Deletes a page.
|
|
@@ -390,7 +375,7 @@ export interface PanelApiPages {
|
|
|
390
375
|
* @param id - Page ID
|
|
391
376
|
* @param data - Delete options
|
|
392
377
|
*/
|
|
393
|
-
delete: (id: string, data?: { force?: boolean }) => Promise<
|
|
378
|
+
delete: (id: string, data?: { force?: boolean }) => Promise<any>;
|
|
394
379
|
|
|
395
380
|
/**
|
|
396
381
|
* Duplicates a page.
|
|
@@ -404,7 +389,7 @@ export interface PanelApiPages {
|
|
|
404
389
|
id: string,
|
|
405
390
|
slug: string,
|
|
406
391
|
options?: PanelApiPageDuplicateOptions,
|
|
407
|
-
) => Promise<
|
|
392
|
+
) => Promise<any>;
|
|
408
393
|
|
|
409
394
|
/**
|
|
410
395
|
* Gets a page.
|
|
@@ -413,7 +398,7 @@ export interface PanelApiPages {
|
|
|
413
398
|
* @param query - Query parameters
|
|
414
399
|
* @returns Page data
|
|
415
400
|
*/
|
|
416
|
-
get: (id: string, query?: Record<string,
|
|
401
|
+
get: (id: string, query?: Record<string, any>) => Promise<any>;
|
|
417
402
|
|
|
418
403
|
/**
|
|
419
404
|
* Converts page ID/UUID to API format.
|
|
@@ -430,7 +415,7 @@ export interface PanelApiPages {
|
|
|
430
415
|
* @param query - Search query
|
|
431
416
|
* @returns Search results
|
|
432
417
|
*/
|
|
433
|
-
files: (id: string, query?: PanelApiSearchQuery) => Promise<
|
|
418
|
+
files: (id: string, query?: PanelApiSearchQuery) => Promise<any>;
|
|
434
419
|
|
|
435
420
|
/**
|
|
436
421
|
* Gets Panel link for a page.
|
|
@@ -455,10 +440,7 @@ export interface PanelApiPages {
|
|
|
455
440
|
* @param query - Search query
|
|
456
441
|
* @returns Search results
|
|
457
442
|
*/
|
|
458
|
-
search: (
|
|
459
|
-
parent: string | null,
|
|
460
|
-
query?: PanelApiSearchQuery,
|
|
461
|
-
) => Promise<unknown>;
|
|
443
|
+
search: (parent: string | null, query?: PanelApiSearchQuery) => Promise<any>;
|
|
462
444
|
|
|
463
445
|
/**
|
|
464
446
|
* Updates a page's content.
|
|
@@ -467,7 +449,7 @@ export interface PanelApiPages {
|
|
|
467
449
|
* @param data - Content data
|
|
468
450
|
* @returns Updated page
|
|
469
451
|
*/
|
|
470
|
-
update: (id: string, data: Record<string,
|
|
452
|
+
update: (id: string, data: Record<string, any>) => Promise<any>;
|
|
471
453
|
|
|
472
454
|
/**
|
|
473
455
|
* Gets API URL for a page.
|
|
@@ -495,16 +477,15 @@ export interface PanelApiRoles {
|
|
|
495
477
|
* @param name - Role name
|
|
496
478
|
* @returns Role data
|
|
497
479
|
*/
|
|
498
|
-
get: (name: string) => Promise<
|
|
480
|
+
get: (name: string) => Promise<any>;
|
|
499
481
|
|
|
500
482
|
/**
|
|
501
483
|
* Lists available roles.
|
|
502
484
|
*
|
|
503
|
-
* @param
|
|
504
|
-
* @param query - Query parameters
|
|
485
|
+
* @param params - Query parameters
|
|
505
486
|
* @returns Array of roles
|
|
506
487
|
*/
|
|
507
|
-
list: (
|
|
488
|
+
list: (params?: Record<string, any>) => Promise<any[]>;
|
|
508
489
|
}
|
|
509
490
|
|
|
510
491
|
// -----------------------------------------------------------------------------
|
|
@@ -522,35 +503,30 @@ export interface PanelApiSite {
|
|
|
522
503
|
*
|
|
523
504
|
* @returns Blueprint data
|
|
524
505
|
*/
|
|
525
|
-
blueprint: () => Promise<
|
|
506
|
+
blueprint: () => Promise<any>;
|
|
526
507
|
|
|
527
508
|
/**
|
|
528
509
|
* Gets available blueprints for the site.
|
|
529
510
|
*
|
|
530
511
|
* @returns Array of blueprints
|
|
531
512
|
*/
|
|
532
|
-
blueprints: () => Promise<
|
|
513
|
+
blueprints: () => Promise<any[]>;
|
|
533
514
|
|
|
534
515
|
/**
|
|
535
516
|
* Changes the site title.
|
|
536
517
|
*
|
|
537
518
|
* @param title - New title
|
|
538
|
-
* @param language - Language code
|
|
539
519
|
* @returns Updated site
|
|
540
520
|
*/
|
|
541
|
-
changeTitle: (title: string
|
|
521
|
+
changeTitle: (title: string) => Promise<any>;
|
|
542
522
|
|
|
543
523
|
/**
|
|
544
524
|
* Searches site children.
|
|
545
525
|
*
|
|
546
526
|
* @param query - Search query
|
|
547
|
-
* @param options - Query options
|
|
548
527
|
* @returns Search results
|
|
549
528
|
*/
|
|
550
|
-
children: (
|
|
551
|
-
query?: PanelApiSearchQuery,
|
|
552
|
-
options?: Record<string, unknown>,
|
|
553
|
-
) => Promise<unknown>;
|
|
529
|
+
children: (query?: PanelApiSearchQuery) => Promise<any>;
|
|
554
530
|
|
|
555
531
|
/**
|
|
556
532
|
* Gets the site.
|
|
@@ -558,19 +534,15 @@ export interface PanelApiSite {
|
|
|
558
534
|
* @param query - Query parameters
|
|
559
535
|
* @returns Site data
|
|
560
536
|
*/
|
|
561
|
-
get: (query?: Record<string,
|
|
537
|
+
get: (query?: Record<string, any>) => Promise<any>;
|
|
562
538
|
|
|
563
539
|
/**
|
|
564
540
|
* Updates the site content.
|
|
565
541
|
*
|
|
566
542
|
* @param data - Content data
|
|
567
|
-
* @param language - Language code
|
|
568
543
|
* @returns Updated site
|
|
569
544
|
*/
|
|
570
|
-
update: (
|
|
571
|
-
data: Record<string, unknown>,
|
|
572
|
-
language?: string,
|
|
573
|
-
) => Promise<unknown>;
|
|
545
|
+
update: (data: Record<string, any>) => Promise<any>;
|
|
574
546
|
}
|
|
575
547
|
|
|
576
548
|
// -----------------------------------------------------------------------------
|
|
@@ -611,31 +583,23 @@ export interface PanelApiSystem {
|
|
|
611
583
|
* @param query - Query parameters
|
|
612
584
|
* @returns System data
|
|
613
585
|
*/
|
|
614
|
-
get: (query?: Record<string,
|
|
586
|
+
get: (query?: Record<string, any>) => Promise<any>;
|
|
615
587
|
|
|
616
588
|
/**
|
|
617
589
|
* Installs Kirby with initial user.
|
|
618
590
|
*
|
|
619
591
|
* @param data - Installation data
|
|
620
|
-
* @param query - Query parameters
|
|
621
592
|
* @returns Installation result
|
|
622
593
|
*/
|
|
623
|
-
install: (
|
|
624
|
-
data: PanelApiSystemInstallData,
|
|
625
|
-
query?: Record<string, unknown>,
|
|
626
|
-
) => Promise<unknown>;
|
|
594
|
+
install: (data: PanelApiSystemInstallData) => Promise<any>;
|
|
627
595
|
|
|
628
596
|
/**
|
|
629
597
|
* Registers a license.
|
|
630
598
|
*
|
|
631
599
|
* @param data - Registration data
|
|
632
|
-
* @param query - Query parameters
|
|
633
600
|
* @returns Registration result
|
|
634
601
|
*/
|
|
635
|
-
register: (
|
|
636
|
-
data: PanelApiSystemRegisterData,
|
|
637
|
-
query?: Record<string, unknown>,
|
|
638
|
-
) => Promise<unknown>;
|
|
602
|
+
register: (data: PanelApiSystemRegisterData) => Promise<any>;
|
|
639
603
|
}
|
|
640
604
|
|
|
641
605
|
// -----------------------------------------------------------------------------
|
|
@@ -654,14 +618,14 @@ export interface PanelApiTranslations {
|
|
|
654
618
|
* @param code - Translation code
|
|
655
619
|
* @returns Translation data
|
|
656
620
|
*/
|
|
657
|
-
get: (code: string) => Promise<
|
|
621
|
+
get: (code: string) => Promise<any>;
|
|
658
622
|
|
|
659
623
|
/**
|
|
660
624
|
* Lists all translations.
|
|
661
625
|
*
|
|
662
626
|
* @returns Array of translations
|
|
663
627
|
*/
|
|
664
|
-
list: () => Promise<
|
|
628
|
+
list: () => Promise<any[]>;
|
|
665
629
|
}
|
|
666
630
|
|
|
667
631
|
// -----------------------------------------------------------------------------
|
|
@@ -696,19 +660,16 @@ export interface PanelApiUsers {
|
|
|
696
660
|
* @param id - User ID
|
|
697
661
|
* @returns Blueprint data
|
|
698
662
|
*/
|
|
699
|
-
blueprint: (id: string) => Promise<
|
|
663
|
+
blueprint: (id: string) => Promise<any>;
|
|
700
664
|
|
|
701
665
|
/**
|
|
702
666
|
* Gets available blueprints for users.
|
|
703
667
|
*
|
|
704
|
-
* @param
|
|
705
|
-
* @param
|
|
668
|
+
* @param id - User ID for context
|
|
669
|
+
* @param section - Section name to filter by
|
|
706
670
|
* @returns Array of blueprints
|
|
707
671
|
*/
|
|
708
|
-
blueprints: (
|
|
709
|
-
user?: string,
|
|
710
|
-
query?: Record<string, unknown>,
|
|
711
|
-
) => Promise<unknown[]>;
|
|
672
|
+
blueprints: (id: string, section?: string) => Promise<any[]>;
|
|
712
673
|
|
|
713
674
|
/**
|
|
714
675
|
* Changes a user's email.
|
|
@@ -717,7 +678,7 @@ export interface PanelApiUsers {
|
|
|
717
678
|
* @param email - New email
|
|
718
679
|
* @returns Updated user
|
|
719
680
|
*/
|
|
720
|
-
changeEmail: (id: string, email: string) => Promise<
|
|
681
|
+
changeEmail: (id: string, email: string) => Promise<any>;
|
|
721
682
|
|
|
722
683
|
/**
|
|
723
684
|
* Changes a user's language.
|
|
@@ -726,7 +687,7 @@ export interface PanelApiUsers {
|
|
|
726
687
|
* @param language - New language code
|
|
727
688
|
* @returns Updated user
|
|
728
689
|
*/
|
|
729
|
-
changeLanguage: (id: string, language: string) => Promise<
|
|
690
|
+
changeLanguage: (id: string, language: string) => Promise<any>;
|
|
730
691
|
|
|
731
692
|
/**
|
|
732
693
|
* Changes a user's name.
|
|
@@ -735,21 +696,21 @@ export interface PanelApiUsers {
|
|
|
735
696
|
* @param name - New name
|
|
736
697
|
* @returns Updated user
|
|
737
698
|
*/
|
|
738
|
-
changeName: (id: string, name: string) => Promise<
|
|
699
|
+
changeName: (id: string, name: string) => Promise<any>;
|
|
739
700
|
|
|
740
701
|
/**
|
|
741
702
|
* Changes a user's password.
|
|
742
703
|
*
|
|
743
704
|
* @param id - User ID
|
|
744
705
|
* @param password - New password
|
|
745
|
-
* @param
|
|
706
|
+
* @param currentPassword - Current password for verification
|
|
746
707
|
* @returns Updated user
|
|
747
708
|
*/
|
|
748
709
|
changePassword: (
|
|
749
710
|
id: string,
|
|
750
711
|
password: string,
|
|
751
|
-
|
|
752
|
-
) => Promise<
|
|
712
|
+
currentPassword: string,
|
|
713
|
+
) => Promise<any>;
|
|
753
714
|
|
|
754
715
|
/**
|
|
755
716
|
* Changes a user's role.
|
|
@@ -758,30 +719,29 @@ export interface PanelApiUsers {
|
|
|
758
719
|
* @param role - New role
|
|
759
720
|
* @returns Updated user
|
|
760
721
|
*/
|
|
761
|
-
changeRole: (id: string, role: string) => Promise<
|
|
722
|
+
changeRole: (id: string, role: string) => Promise<any>;
|
|
762
723
|
|
|
763
724
|
/**
|
|
764
725
|
* Creates a new user.
|
|
765
726
|
*
|
|
766
|
-
* @param
|
|
767
|
-
* @param data - User data
|
|
727
|
+
* @param data - User data (including email as identifier)
|
|
768
728
|
* @returns Created user
|
|
769
729
|
*/
|
|
770
|
-
create: (
|
|
730
|
+
create: (data: PanelApiUserCreateData) => Promise<any>;
|
|
771
731
|
|
|
772
732
|
/**
|
|
773
733
|
* Deletes a user.
|
|
774
734
|
*
|
|
775
735
|
* @param id - User ID
|
|
776
736
|
*/
|
|
777
|
-
delete: (id: string) => Promise<
|
|
737
|
+
delete: (id: string) => Promise<any>;
|
|
778
738
|
|
|
779
739
|
/**
|
|
780
740
|
* Deletes a user's avatar.
|
|
781
741
|
*
|
|
782
742
|
* @param id - User ID
|
|
783
743
|
*/
|
|
784
|
-
deleteAvatar: (id: string) => Promise<
|
|
744
|
+
deleteAvatar: (id: string) => Promise<any>;
|
|
785
745
|
|
|
786
746
|
/**
|
|
787
747
|
* Gets a user.
|
|
@@ -790,7 +750,7 @@ export interface PanelApiUsers {
|
|
|
790
750
|
* @param query - Query parameters
|
|
791
751
|
* @returns User data
|
|
792
752
|
*/
|
|
793
|
-
get: (id: string, query?: Record<string,
|
|
753
|
+
get: (id: string, query?: Record<string, any>) => Promise<any>;
|
|
794
754
|
|
|
795
755
|
/**
|
|
796
756
|
* Gets Panel link for a user.
|
|
@@ -807,7 +767,7 @@ export interface PanelApiUsers {
|
|
|
807
767
|
* @param query - Query parameters
|
|
808
768
|
* @returns Array of users
|
|
809
769
|
*/
|
|
810
|
-
list: (query?: Record<string,
|
|
770
|
+
list: (query?: Record<string, any>) => Promise<any[]>;
|
|
811
771
|
|
|
812
772
|
/**
|
|
813
773
|
* Gets roles available to a user.
|
|
@@ -815,7 +775,7 @@ export interface PanelApiUsers {
|
|
|
815
775
|
* @param id - User ID
|
|
816
776
|
* @returns Array of roles
|
|
817
777
|
*/
|
|
818
|
-
roles: (id: string) => Promise<
|
|
778
|
+
roles: (id: string) => Promise<any[]>;
|
|
819
779
|
|
|
820
780
|
/**
|
|
821
781
|
* Searches users.
|
|
@@ -826,8 +786,8 @@ export interface PanelApiUsers {
|
|
|
826
786
|
*/
|
|
827
787
|
search: (
|
|
828
788
|
query?: PanelApiSearchQuery,
|
|
829
|
-
options?: Record<string,
|
|
830
|
-
) => Promise<
|
|
789
|
+
options?: Record<string, any>,
|
|
790
|
+
) => Promise<any>;
|
|
831
791
|
|
|
832
792
|
/**
|
|
833
793
|
* Updates a user's content.
|
|
@@ -836,7 +796,7 @@ export interface PanelApiUsers {
|
|
|
836
796
|
* @param data - Content data
|
|
837
797
|
* @returns Updated user
|
|
838
798
|
*/
|
|
839
|
-
update: (id: string, data: Record<string,
|
|
799
|
+
update: (id: string, data: Record<string, any>) => Promise<any>;
|
|
840
800
|
|
|
841
801
|
/**
|
|
842
802
|
* Gets API URL for a user.
|
|
@@ -860,13 +820,13 @@ export interface PanelApiUsers {
|
|
|
860
820
|
* @example
|
|
861
821
|
* ```ts
|
|
862
822
|
* // Get a page
|
|
863
|
-
* const page = await panel.api.pages.get(
|
|
823
|
+
* const page = await panel.api.pages.get("home");
|
|
864
824
|
*
|
|
865
825
|
* // Create a new page
|
|
866
|
-
* await panel.api.pages.create(
|
|
867
|
-
* slug:
|
|
868
|
-
* title:
|
|
869
|
-
* template:
|
|
826
|
+
* await panel.api.pages.create("blog", {
|
|
827
|
+
* slug: "new-post",
|
|
828
|
+
* title: "New Post",
|
|
829
|
+
* template: "article"
|
|
870
830
|
* });
|
|
871
831
|
* ```
|
|
872
832
|
*
|
|
@@ -906,7 +866,7 @@ export interface PanelApi {
|
|
|
906
866
|
path: string,
|
|
907
867
|
options?: PanelApiRequestOptions,
|
|
908
868
|
silent?: boolean,
|
|
909
|
-
) => Promise<
|
|
869
|
+
) => Promise<any>;
|
|
910
870
|
|
|
911
871
|
/**
|
|
912
872
|
* Makes a GET request.
|
|
@@ -919,10 +879,10 @@ export interface PanelApi {
|
|
|
919
879
|
*/
|
|
920
880
|
get: (
|
|
921
881
|
path: string,
|
|
922
|
-
query?: Record<string,
|
|
882
|
+
query?: Record<string, any>,
|
|
923
883
|
options?: PanelApiRequestOptions,
|
|
924
884
|
silent?: boolean,
|
|
925
|
-
) => Promise<
|
|
885
|
+
) => Promise<any>;
|
|
926
886
|
|
|
927
887
|
/**
|
|
928
888
|
* Makes a POST request.
|
|
@@ -931,16 +891,14 @@ export interface PanelApi {
|
|
|
931
891
|
* @param data - Request body
|
|
932
892
|
* @param options - Request options
|
|
933
893
|
* @param silent - Skip loading indicator
|
|
934
|
-
* @param upload - Whether uploading file
|
|
935
894
|
* @returns Response data
|
|
936
895
|
*/
|
|
937
896
|
post: (
|
|
938
897
|
path: string,
|
|
939
|
-
data?:
|
|
898
|
+
data?: any,
|
|
940
899
|
options?: PanelApiRequestOptions,
|
|
941
900
|
silent?: boolean,
|
|
942
|
-
|
|
943
|
-
) => Promise<unknown>;
|
|
901
|
+
) => Promise<any>;
|
|
944
902
|
|
|
945
903
|
/**
|
|
946
904
|
* Makes a PATCH request.
|
|
@@ -953,10 +911,10 @@ export interface PanelApi {
|
|
|
953
911
|
*/
|
|
954
912
|
patch: (
|
|
955
913
|
path: string,
|
|
956
|
-
data?:
|
|
914
|
+
data?: any,
|
|
957
915
|
options?: PanelApiRequestOptions,
|
|
958
916
|
silent?: boolean,
|
|
959
|
-
) => Promise<
|
|
917
|
+
) => Promise<any>;
|
|
960
918
|
|
|
961
919
|
/**
|
|
962
920
|
* Makes a DELETE request.
|
|
@@ -969,10 +927,10 @@ export interface PanelApi {
|
|
|
969
927
|
*/
|
|
970
928
|
delete: (
|
|
971
929
|
path: string,
|
|
972
|
-
data?:
|
|
930
|
+
data?: any,
|
|
973
931
|
options?: PanelApiRequestOptions,
|
|
974
932
|
silent?: boolean,
|
|
975
|
-
) => Promise<
|
|
933
|
+
) => Promise<any>;
|
|
976
934
|
|
|
977
935
|
/** Authentication methods */
|
|
978
936
|
auth: PanelApiAuth;
|