strapi-plugin-navigation 3.0.16 → 3.1.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.
Files changed (37) hide show
  1. package/README.md +47 -1
  2. package/dist/_chunks/ca-CSdZD9Oe.js +1 -0
  3. package/dist/_chunks/{ca-Jr1amAtF.mjs → ca-htynOC4E.mjs} +20 -3
  4. package/dist/_chunks/en-BuevNT8U.js +1 -0
  5. package/dist/_chunks/{en-DmeenfQT.mjs → en-DU6wb-rd.mjs} +20 -3
  6. package/dist/_chunks/fr-cFTbGuHW.js +1 -0
  7. package/dist/_chunks/{fr-CZx3EMw8.mjs → fr-v8w2-ufp.mjs} +20 -3
  8. package/dist/admin/index.js +341 -354
  9. package/dist/admin/index.mjs +8743 -8597
  10. package/dist/admin/src/api/client.d.ts +13 -1
  11. package/dist/admin/src/api/validators.d.ts +128 -14
  12. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +3 -3
  13. package/dist/admin/src/pages/HomePage/hooks/index.d.ts +14 -3
  14. package/dist/admin/src/pages/SettingsPage/components/CustomFieldForm/index.d.ts +1 -1
  15. package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +43 -1
  16. package/dist/admin/src/schemas/config.d.ts +93 -3
  17. package/dist/admin/src/translations/ca.d.ts +17 -0
  18. package/dist/admin/src/translations/en.d.ts +17 -0
  19. package/dist/admin/src/translations/es.d.ts +17 -0
  20. package/dist/admin/src/translations/fr.d.ts +17 -0
  21. package/dist/admin/src/translations/tr.d.ts +17 -0
  22. package/dist/server/index.js +36 -36
  23. package/dist/server/index.mjs +3331 -3492
  24. package/dist/server/src/config/setup.d.ts +6 -0
  25. package/dist/server/src/controllers/admin.d.ts +875 -2
  26. package/dist/server/src/controllers/client.d.ts +12 -0
  27. package/dist/server/src/controllers/validators.d.ts +2 -2
  28. package/dist/server/src/index.d.ts +885 -0
  29. package/dist/server/src/schemas/config.d.ts +93 -3
  30. package/dist/server/src/schemas/index.d.ts +1296 -2
  31. package/dist/server/src/services/admin/admin.d.ts +1 -0
  32. package/dist/server/src/services/common/common.d.ts +859 -0
  33. package/dist/server/src/services/index.d.ts +884 -0
  34. package/package.json +1 -1
  35. package/dist/_chunks/ca-Gq9Ty_aG.js +0 -1
  36. package/dist/_chunks/en-BP5RWE-N.js +0 -1
  37. package/dist/_chunks/fr-BIJn6QmK.js +0 -1
@@ -1,5 +1,6 @@
1
1
  import { Core } from '@strapi/strapi';
2
2
  import { Context as KoaContext } from 'koa';
3
+ import * as z from 'zod';
3
4
  export type KoaContextExtension = {
4
5
  request: KoaContext['request'] & {
5
6
  body: unknown;
@@ -42,6 +43,7 @@ export default function adminController(context: {
42
43
  delete({ auditLog, documentId }: import("../services/admin/types").DeleteInput): Promise<void>;
43
44
  restart(): Promise<void>;
44
45
  restoreConfig(): Promise<void>;
46
+ refreshNavigationLocale(newLocale?: string | undefined): Promise<void>;
45
47
  updateConfig({ config: newConfig }: import("../services/admin/types").UpdateConfigInput): Promise<void>;
46
48
  fillFromOtherLocale({ auditLog, source, target, documentId, }: import("../services/admin/types").FillFromOtherLocaleInput): Promise<{
47
49
  name: string;
@@ -103,6 +105,8 @@ export default function adminController(context: {
103
105
  name: string;
104
106
  label: string;
105
107
  options?: string[] | undefined;
108
+ description?: string | undefined;
109
+ placeholder?: string | undefined;
106
110
  required?: boolean | undefined;
107
111
  enabled?: boolean | undefined;
108
112
  multi?: false | undefined;
@@ -111,6 +115,8 @@ export default function adminController(context: {
111
115
  name: string;
112
116
  label: string;
113
117
  options?: string[] | undefined;
118
+ description?: string | undefined;
119
+ placeholder?: string | undefined;
114
120
  required?: boolean | undefined;
115
121
  enabled?: boolean | undefined;
116
122
  multi?: false | undefined;
@@ -120,6 +126,8 @@ export default function adminController(context: {
120
126
  name: string;
121
127
  label: string;
122
128
  multi: boolean;
129
+ description?: string | undefined;
130
+ placeholder?: string | undefined;
123
131
  required?: boolean | undefined;
124
132
  enabled?: boolean | undefined;
125
133
  })[];
@@ -147,6 +155,8 @@ export default function adminController(context: {
147
155
  name: string;
148
156
  label: string;
149
157
  options?: string[] | undefined;
158
+ description?: string | undefined;
159
+ placeholder?: string | undefined;
150
160
  required?: boolean | undefined;
151
161
  enabled?: boolean | undefined;
152
162
  multi?: false | undefined;
@@ -155,6 +165,8 @@ export default function adminController(context: {
155
165
  name: string;
156
166
  label: string;
157
167
  options?: string[] | undefined;
168
+ description?: string | undefined;
169
+ placeholder?: string | undefined;
158
170
  required?: boolean | undefined;
159
171
  enabled?: boolean | undefined;
160
172
  multi?: false | undefined;
@@ -164,6 +176,8 @@ export default function adminController(context: {
164
176
  name: string;
165
177
  label: string;
166
178
  multi: boolean;
179
+ description?: string | undefined;
180
+ placeholder?: string | undefined;
167
181
  required?: boolean | undefined;
168
182
  enabled?: boolean | undefined;
169
183
  })[];
@@ -176,6 +190,865 @@ export default function adminController(context: {
176
190
  defaultLocale: string;
177
191
  restLocale: string[];
178
192
  }>;
193
+ updateConfigSchema: (modifier: (base: z.ZodObject<{
194
+ additionalFields: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"audience">, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
195
+ name: z.ZodEffects<z.ZodString, string, string>;
196
+ label: z.ZodString;
197
+ description: z.ZodOptional<z.ZodString>;
198
+ placeholder: z.ZodOptional<z.ZodString>;
199
+ required: z.ZodOptional<z.ZodBoolean>;
200
+ enabled: z.ZodOptional<z.ZodBoolean>;
201
+ } & {
202
+ type: z.ZodEnum<["boolean", "string"]>;
203
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
204
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ type: "string" | "boolean";
207
+ name: string;
208
+ label: string;
209
+ options?: string[] | undefined;
210
+ description?: string | undefined;
211
+ placeholder?: string | undefined;
212
+ required?: boolean | undefined;
213
+ enabled?: boolean | undefined;
214
+ multi?: false | undefined;
215
+ }, {
216
+ type: "string" | "boolean";
217
+ name: string;
218
+ label: string;
219
+ options?: string[] | undefined;
220
+ description?: string | undefined;
221
+ placeholder?: string | undefined;
222
+ required?: boolean | undefined;
223
+ enabled?: boolean | undefined;
224
+ multi?: false | undefined;
225
+ }>, z.ZodObject<{
226
+ name: z.ZodEffects<z.ZodString, string, string>;
227
+ label: z.ZodString;
228
+ description: z.ZodOptional<z.ZodString>;
229
+ placeholder: z.ZodOptional<z.ZodString>;
230
+ required: z.ZodOptional<z.ZodBoolean>;
231
+ enabled: z.ZodOptional<z.ZodBoolean>;
232
+ } & {
233
+ type: z.ZodLiteral<"media">;
234
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
235
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
236
+ }, "strip", z.ZodTypeAny, {
237
+ type: "media";
238
+ name: string;
239
+ label: string;
240
+ options?: string[] | undefined;
241
+ description?: string | undefined;
242
+ placeholder?: string | undefined;
243
+ required?: boolean | undefined;
244
+ enabled?: boolean | undefined;
245
+ multi?: false | undefined;
246
+ }, {
247
+ type: "media";
248
+ name: string;
249
+ label: string;
250
+ options?: string[] | undefined;
251
+ description?: string | undefined;
252
+ placeholder?: string | undefined;
253
+ required?: boolean | undefined;
254
+ enabled?: boolean | undefined;
255
+ multi?: false | undefined;
256
+ }>, z.ZodObject<{
257
+ name: z.ZodEffects<z.ZodString, string, string>;
258
+ label: z.ZodString;
259
+ description: z.ZodOptional<z.ZodString>;
260
+ placeholder: z.ZodOptional<z.ZodString>;
261
+ required: z.ZodOptional<z.ZodBoolean>;
262
+ enabled: z.ZodOptional<z.ZodBoolean>;
263
+ } & {
264
+ type: z.ZodLiteral<"select">;
265
+ multi: z.ZodBoolean;
266
+ options: z.ZodArray<z.ZodString, "many">;
267
+ }, "strip", z.ZodTypeAny, {
268
+ options: string[];
269
+ type: "select";
270
+ name: string;
271
+ label: string;
272
+ multi: boolean;
273
+ description?: string | undefined;
274
+ placeholder?: string | undefined;
275
+ required?: boolean | undefined;
276
+ enabled?: boolean | undefined;
277
+ }, {
278
+ options: string[];
279
+ type: "select";
280
+ name: string;
281
+ label: string;
282
+ multi: boolean;
283
+ description?: string | undefined;
284
+ placeholder?: string | undefined;
285
+ required?: boolean | undefined;
286
+ enabled?: boolean | undefined;
287
+ }>]>]>, "many">;
288
+ allowedLevels: z.ZodNumber;
289
+ contentTypes: z.ZodArray<z.ZodString, "many">;
290
+ contentTypesNameFields: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
291
+ contentTypesPopulate: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
292
+ gql: z.ZodObject<{
293
+ navigationItemRelated: z.ZodArray<z.ZodString, "many">;
294
+ }, "strip", z.ZodTypeAny, {
295
+ navigationItemRelated: string[];
296
+ }, {
297
+ navigationItemRelated: string[];
298
+ }>;
299
+ pathDefaultFields: z.ZodRecord<z.ZodString, z.ZodAny>;
300
+ cascadeMenuAttached: z.ZodBoolean;
301
+ preferCustomContentTypes: z.ZodBoolean;
302
+ isCacheEnabled: z.ZodOptional<z.ZodBoolean>;
303
+ }, "strip", z.ZodTypeAny, {
304
+ additionalFields: ("audience" | {
305
+ type: "string" | "boolean";
306
+ name: string;
307
+ label: string;
308
+ options?: string[] | undefined;
309
+ description?: string | undefined;
310
+ placeholder?: string | undefined;
311
+ required?: boolean | undefined;
312
+ enabled?: boolean | undefined;
313
+ multi?: false | undefined;
314
+ } | {
315
+ type: "media";
316
+ name: string;
317
+ label: string;
318
+ options?: string[] | undefined;
319
+ description?: string | undefined;
320
+ placeholder?: string | undefined;
321
+ required?: boolean | undefined;
322
+ enabled?: boolean | undefined;
323
+ multi?: false | undefined;
324
+ } | {
325
+ options: string[];
326
+ type: "select";
327
+ name: string;
328
+ label: string;
329
+ multi: boolean;
330
+ description?: string | undefined;
331
+ placeholder?: string | undefined;
332
+ required?: boolean | undefined;
333
+ enabled?: boolean | undefined;
334
+ })[];
335
+ allowedLevels: number;
336
+ contentTypes: string[];
337
+ contentTypesNameFields: Record<string, string[]>;
338
+ contentTypesPopulate: Record<string, string[]>;
339
+ gql: {
340
+ navigationItemRelated: string[];
341
+ };
342
+ pathDefaultFields: Record<string, any>;
343
+ cascadeMenuAttached: boolean;
344
+ preferCustomContentTypes: boolean;
345
+ isCacheEnabled?: boolean | undefined;
346
+ }, {
347
+ additionalFields: ("audience" | {
348
+ type: "string" | "boolean";
349
+ name: string;
350
+ label: string;
351
+ options?: string[] | undefined;
352
+ description?: string | undefined;
353
+ placeholder?: string | undefined;
354
+ required?: boolean | undefined;
355
+ enabled?: boolean | undefined;
356
+ multi?: false | undefined;
357
+ } | {
358
+ type: "media";
359
+ name: string;
360
+ label: string;
361
+ options?: string[] | undefined;
362
+ description?: string | undefined;
363
+ placeholder?: string | undefined;
364
+ required?: boolean | undefined;
365
+ enabled?: boolean | undefined;
366
+ multi?: false | undefined;
367
+ } | {
368
+ options: string[];
369
+ type: "select";
370
+ name: string;
371
+ label: string;
372
+ multi: boolean;
373
+ description?: string | undefined;
374
+ placeholder?: string | undefined;
375
+ required?: boolean | undefined;
376
+ enabled?: boolean | undefined;
377
+ })[];
378
+ allowedLevels: number;
379
+ contentTypes: string[];
380
+ contentTypesNameFields: Record<string, string[]>;
381
+ contentTypesPopulate: Record<string, string[]>;
382
+ gql: {
383
+ navigationItemRelated: string[];
384
+ };
385
+ pathDefaultFields: Record<string, any>;
386
+ cascadeMenuAttached: boolean;
387
+ preferCustomContentTypes: boolean;
388
+ isCacheEnabled?: boolean | undefined;
389
+ }>) => z.ZodObject<{
390
+ additionalFields: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"audience">, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
391
+ name: z.ZodEffects<z.ZodString, string, string>;
392
+ label: z.ZodString;
393
+ description: z.ZodOptional<z.ZodString>;
394
+ placeholder: z.ZodOptional<z.ZodString>;
395
+ required: z.ZodOptional<z.ZodBoolean>;
396
+ enabled: z.ZodOptional<z.ZodBoolean>;
397
+ } & {
398
+ type: z.ZodEnum<["boolean", "string"]>;
399
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
400
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
401
+ }, "strip", z.ZodTypeAny, {
402
+ type: "string" | "boolean";
403
+ name: string;
404
+ label: string;
405
+ options?: string[] | undefined;
406
+ description?: string | undefined;
407
+ placeholder?: string | undefined;
408
+ required?: boolean | undefined;
409
+ enabled?: boolean | undefined;
410
+ multi?: false | undefined;
411
+ }, {
412
+ type: "string" | "boolean";
413
+ name: string;
414
+ label: string;
415
+ options?: string[] | undefined;
416
+ description?: string | undefined;
417
+ placeholder?: string | undefined;
418
+ required?: boolean | undefined;
419
+ enabled?: boolean | undefined;
420
+ multi?: false | undefined;
421
+ }>, z.ZodObject<{
422
+ name: z.ZodEffects<z.ZodString, string, string>;
423
+ label: z.ZodString;
424
+ description: z.ZodOptional<z.ZodString>;
425
+ placeholder: z.ZodOptional<z.ZodString>;
426
+ required: z.ZodOptional<z.ZodBoolean>;
427
+ enabled: z.ZodOptional<z.ZodBoolean>;
428
+ } & {
429
+ type: z.ZodLiteral<"media">;
430
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
431
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
432
+ }, "strip", z.ZodTypeAny, {
433
+ type: "media";
434
+ name: string;
435
+ label: string;
436
+ options?: string[] | undefined;
437
+ description?: string | undefined;
438
+ placeholder?: string | undefined;
439
+ required?: boolean | undefined;
440
+ enabled?: boolean | undefined;
441
+ multi?: false | undefined;
442
+ }, {
443
+ type: "media";
444
+ name: string;
445
+ label: string;
446
+ options?: string[] | undefined;
447
+ description?: string | undefined;
448
+ placeholder?: string | undefined;
449
+ required?: boolean | undefined;
450
+ enabled?: boolean | undefined;
451
+ multi?: false | undefined;
452
+ }>, z.ZodObject<{
453
+ name: z.ZodEffects<z.ZodString, string, string>;
454
+ label: z.ZodString;
455
+ description: z.ZodOptional<z.ZodString>;
456
+ placeholder: z.ZodOptional<z.ZodString>;
457
+ required: z.ZodOptional<z.ZodBoolean>;
458
+ enabled: z.ZodOptional<z.ZodBoolean>;
459
+ } & {
460
+ type: z.ZodLiteral<"select">;
461
+ multi: z.ZodBoolean;
462
+ options: z.ZodArray<z.ZodString, "many">;
463
+ }, "strip", z.ZodTypeAny, {
464
+ options: string[];
465
+ type: "select";
466
+ name: string;
467
+ label: string;
468
+ multi: boolean;
469
+ description?: string | undefined;
470
+ placeholder?: string | undefined;
471
+ required?: boolean | undefined;
472
+ enabled?: boolean | undefined;
473
+ }, {
474
+ options: string[];
475
+ type: "select";
476
+ name: string;
477
+ label: string;
478
+ multi: boolean;
479
+ description?: string | undefined;
480
+ placeholder?: string | undefined;
481
+ required?: boolean | undefined;
482
+ enabled?: boolean | undefined;
483
+ }>]>]>, "many">;
484
+ allowedLevels: z.ZodNumber;
485
+ contentTypes: z.ZodArray<z.ZodString, "many">;
486
+ contentTypesNameFields: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
487
+ contentTypesPopulate: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
488
+ gql: z.ZodObject<{
489
+ navigationItemRelated: z.ZodArray<z.ZodString, "many">;
490
+ }, "strip", z.ZodTypeAny, {
491
+ navigationItemRelated: string[];
492
+ }, {
493
+ navigationItemRelated: string[];
494
+ }>;
495
+ pathDefaultFields: z.ZodRecord<z.ZodString, z.ZodAny>;
496
+ cascadeMenuAttached: z.ZodBoolean;
497
+ preferCustomContentTypes: z.ZodBoolean;
498
+ isCacheEnabled: z.ZodOptional<z.ZodBoolean>;
499
+ }, "strip", z.ZodTypeAny, {
500
+ additionalFields: ("audience" | {
501
+ type: "string" | "boolean";
502
+ name: string;
503
+ label: string;
504
+ options?: string[] | undefined;
505
+ description?: string | undefined;
506
+ placeholder?: string | undefined;
507
+ required?: boolean | undefined;
508
+ enabled?: boolean | undefined;
509
+ multi?: false | undefined;
510
+ } | {
511
+ type: "media";
512
+ name: string;
513
+ label: string;
514
+ options?: string[] | undefined;
515
+ description?: string | undefined;
516
+ placeholder?: string | undefined;
517
+ required?: boolean | undefined;
518
+ enabled?: boolean | undefined;
519
+ multi?: false | undefined;
520
+ } | {
521
+ options: string[];
522
+ type: "select";
523
+ name: string;
524
+ label: string;
525
+ multi: boolean;
526
+ description?: string | undefined;
527
+ placeholder?: string | undefined;
528
+ required?: boolean | undefined;
529
+ enabled?: boolean | undefined;
530
+ })[];
531
+ allowedLevels: number;
532
+ contentTypes: string[];
533
+ contentTypesNameFields: Record<string, string[]>;
534
+ contentTypesPopulate: Record<string, string[]>;
535
+ gql: {
536
+ navigationItemRelated: string[];
537
+ };
538
+ pathDefaultFields: Record<string, any>;
539
+ cascadeMenuAttached: boolean;
540
+ preferCustomContentTypes: boolean;
541
+ isCacheEnabled?: boolean | undefined;
542
+ }, {
543
+ additionalFields: ("audience" | {
544
+ type: "string" | "boolean";
545
+ name: string;
546
+ label: string;
547
+ options?: string[] | undefined;
548
+ description?: string | undefined;
549
+ placeholder?: string | undefined;
550
+ required?: boolean | undefined;
551
+ enabled?: boolean | undefined;
552
+ multi?: false | undefined;
553
+ } | {
554
+ type: "media";
555
+ name: string;
556
+ label: string;
557
+ options?: string[] | undefined;
558
+ description?: string | undefined;
559
+ placeholder?: string | undefined;
560
+ required?: boolean | undefined;
561
+ enabled?: boolean | undefined;
562
+ multi?: false | undefined;
563
+ } | {
564
+ options: string[];
565
+ type: "select";
566
+ name: string;
567
+ label: string;
568
+ multi: boolean;
569
+ description?: string | undefined;
570
+ placeholder?: string | undefined;
571
+ required?: boolean | undefined;
572
+ enabled?: boolean | undefined;
573
+ })[];
574
+ allowedLevels: number;
575
+ contentTypes: string[];
576
+ contentTypesNameFields: Record<string, string[]>;
577
+ contentTypesPopulate: Record<string, string[]>;
578
+ gql: {
579
+ navigationItemRelated: string[];
580
+ };
581
+ pathDefaultFields: Record<string, any>;
582
+ cascadeMenuAttached: boolean;
583
+ preferCustomContentTypes: boolean;
584
+ isCacheEnabled?: boolean | undefined;
585
+ }>) => void;
586
+ updateCreateNavigationSchema: (modifier: (base: z.ZodObject<Omit<{
587
+ id: z.ZodNumber;
588
+ documentId: z.ZodString;
589
+ name: z.ZodString;
590
+ slug: z.ZodString;
591
+ locale: z.ZodString;
592
+ visible: z.ZodBoolean;
593
+ items: z.ZodArray<z.ZodType<import("../schemas").NavigationItemDBSchema, z.ZodTypeDef, import("../schemas").NavigationItemDBSchema>, "many"> | z.ZodOptional<z.ZodArray<z.ZodType<import("../schemas").NavigationItemDBSchema, z.ZodTypeDef, import("../schemas").NavigationItemDBSchema>, "many">>;
594
+ }, "id" | "documentId" | "slug" | "locale" | "items"> & {
595
+ documentId: z.ZodOptional<z.ZodString>;
596
+ id: z.ZodOptional<z.ZodUndefined>;
597
+ }, "strip", z.ZodTypeAny, {
598
+ name: string;
599
+ visible: boolean;
600
+ id?: undefined;
601
+ documentId?: string | undefined;
602
+ }, {
603
+ name: string;
604
+ visible: boolean;
605
+ id?: undefined;
606
+ documentId?: string | undefined;
607
+ }>) => z.ZodObject<Omit<{
608
+ id: z.ZodNumber;
609
+ documentId: z.ZodString;
610
+ name: z.ZodString;
611
+ slug: z.ZodString;
612
+ locale: z.ZodString;
613
+ visible: z.ZodBoolean;
614
+ items: z.ZodArray<z.ZodType<import("../schemas").NavigationItemDBSchema, z.ZodTypeDef, import("../schemas").NavigationItemDBSchema>, "many"> | z.ZodOptional<z.ZodArray<z.ZodType<import("../schemas").NavigationItemDBSchema, z.ZodTypeDef, import("../schemas").NavigationItemDBSchema>, "many">>;
615
+ }, "id" | "documentId" | "slug" | "locale" | "items"> & {
616
+ documentId: z.ZodOptional<z.ZodString>;
617
+ id: z.ZodOptional<z.ZodUndefined>;
618
+ }, "strip", z.ZodTypeAny, {
619
+ name: string;
620
+ visible: boolean;
621
+ id?: undefined;
622
+ documentId?: string | undefined;
623
+ }, {
624
+ name: string;
625
+ visible: boolean;
626
+ id?: undefined;
627
+ documentId?: string | undefined;
628
+ }>) => void;
629
+ updateNavigationItemAdditionalField: (modifier: (base: z.ZodUnion<[z.ZodLiteral<"audience">, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
630
+ name: z.ZodEffects<z.ZodString, string, string>;
631
+ label: z.ZodString;
632
+ description: z.ZodOptional<z.ZodString>;
633
+ placeholder: z.ZodOptional<z.ZodString>;
634
+ required: z.ZodOptional<z.ZodBoolean>;
635
+ enabled: z.ZodOptional<z.ZodBoolean>;
636
+ } & {
637
+ type: z.ZodEnum<["boolean", "string"]>;
638
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
639
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
640
+ }, "strip", z.ZodTypeAny, {
641
+ type: "string" | "boolean";
642
+ name: string;
643
+ label: string;
644
+ options?: string[] | undefined;
645
+ description?: string | undefined;
646
+ placeholder?: string | undefined;
647
+ required?: boolean | undefined;
648
+ enabled?: boolean | undefined;
649
+ multi?: false | undefined;
650
+ }, {
651
+ type: "string" | "boolean";
652
+ name: string;
653
+ label: string;
654
+ options?: string[] | undefined;
655
+ description?: string | undefined;
656
+ placeholder?: string | undefined;
657
+ required?: boolean | undefined;
658
+ enabled?: boolean | undefined;
659
+ multi?: false | undefined;
660
+ }>, z.ZodObject<{
661
+ name: z.ZodEffects<z.ZodString, string, string>;
662
+ label: z.ZodString;
663
+ description: z.ZodOptional<z.ZodString>;
664
+ placeholder: z.ZodOptional<z.ZodString>;
665
+ required: z.ZodOptional<z.ZodBoolean>;
666
+ enabled: z.ZodOptional<z.ZodBoolean>;
667
+ } & {
668
+ type: z.ZodLiteral<"media">;
669
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
670
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ type: "media";
673
+ name: string;
674
+ label: string;
675
+ options?: string[] | undefined;
676
+ description?: string | undefined;
677
+ placeholder?: string | undefined;
678
+ required?: boolean | undefined;
679
+ enabled?: boolean | undefined;
680
+ multi?: false | undefined;
681
+ }, {
682
+ type: "media";
683
+ name: string;
684
+ label: string;
685
+ options?: string[] | undefined;
686
+ description?: string | undefined;
687
+ placeholder?: string | undefined;
688
+ required?: boolean | undefined;
689
+ enabled?: boolean | undefined;
690
+ multi?: false | undefined;
691
+ }>, z.ZodObject<{
692
+ name: z.ZodEffects<z.ZodString, string, string>;
693
+ label: z.ZodString;
694
+ description: z.ZodOptional<z.ZodString>;
695
+ placeholder: z.ZodOptional<z.ZodString>;
696
+ required: z.ZodOptional<z.ZodBoolean>;
697
+ enabled: z.ZodOptional<z.ZodBoolean>;
698
+ } & {
699
+ type: z.ZodLiteral<"select">;
700
+ multi: z.ZodBoolean;
701
+ options: z.ZodArray<z.ZodString, "many">;
702
+ }, "strip", z.ZodTypeAny, {
703
+ options: string[];
704
+ type: "select";
705
+ name: string;
706
+ label: string;
707
+ multi: boolean;
708
+ description?: string | undefined;
709
+ placeholder?: string | undefined;
710
+ required?: boolean | undefined;
711
+ enabled?: boolean | undefined;
712
+ }, {
713
+ options: string[];
714
+ type: "select";
715
+ name: string;
716
+ label: string;
717
+ multi: boolean;
718
+ description?: string | undefined;
719
+ placeholder?: string | undefined;
720
+ required?: boolean | undefined;
721
+ enabled?: boolean | undefined;
722
+ }>]>]>) => z.ZodUnion<[z.ZodLiteral<"audience">, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
723
+ name: z.ZodEffects<z.ZodString, string, string>;
724
+ label: z.ZodString;
725
+ description: z.ZodOptional<z.ZodString>;
726
+ placeholder: z.ZodOptional<z.ZodString>;
727
+ required: z.ZodOptional<z.ZodBoolean>;
728
+ enabled: z.ZodOptional<z.ZodBoolean>;
729
+ } & {
730
+ type: z.ZodEnum<["boolean", "string"]>;
731
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
732
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
733
+ }, "strip", z.ZodTypeAny, {
734
+ type: "string" | "boolean";
735
+ name: string;
736
+ label: string;
737
+ options?: string[] | undefined;
738
+ description?: string | undefined;
739
+ placeholder?: string | undefined;
740
+ required?: boolean | undefined;
741
+ enabled?: boolean | undefined;
742
+ multi?: false | undefined;
743
+ }, {
744
+ type: "string" | "boolean";
745
+ name: string;
746
+ label: string;
747
+ options?: string[] | undefined;
748
+ description?: string | undefined;
749
+ placeholder?: string | undefined;
750
+ required?: boolean | undefined;
751
+ enabled?: boolean | undefined;
752
+ multi?: false | undefined;
753
+ }>, z.ZodObject<{
754
+ name: z.ZodEffects<z.ZodString, string, string>;
755
+ label: z.ZodString;
756
+ description: z.ZodOptional<z.ZodString>;
757
+ placeholder: z.ZodOptional<z.ZodString>;
758
+ required: z.ZodOptional<z.ZodBoolean>;
759
+ enabled: z.ZodOptional<z.ZodBoolean>;
760
+ } & {
761
+ type: z.ZodLiteral<"media">;
762
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
763
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
764
+ }, "strip", z.ZodTypeAny, {
765
+ type: "media";
766
+ name: string;
767
+ label: string;
768
+ options?: string[] | undefined;
769
+ description?: string | undefined;
770
+ placeholder?: string | undefined;
771
+ required?: boolean | undefined;
772
+ enabled?: boolean | undefined;
773
+ multi?: false | undefined;
774
+ }, {
775
+ type: "media";
776
+ name: string;
777
+ label: string;
778
+ options?: string[] | undefined;
779
+ description?: string | undefined;
780
+ placeholder?: string | undefined;
781
+ required?: boolean | undefined;
782
+ enabled?: boolean | undefined;
783
+ multi?: false | undefined;
784
+ }>, z.ZodObject<{
785
+ name: z.ZodEffects<z.ZodString, string, string>;
786
+ label: z.ZodString;
787
+ description: z.ZodOptional<z.ZodString>;
788
+ placeholder: z.ZodOptional<z.ZodString>;
789
+ required: z.ZodOptional<z.ZodBoolean>;
790
+ enabled: z.ZodOptional<z.ZodBoolean>;
791
+ } & {
792
+ type: z.ZodLiteral<"select">;
793
+ multi: z.ZodBoolean;
794
+ options: z.ZodArray<z.ZodString, "many">;
795
+ }, "strip", z.ZodTypeAny, {
796
+ options: string[];
797
+ type: "select";
798
+ name: string;
799
+ label: string;
800
+ multi: boolean;
801
+ description?: string | undefined;
802
+ placeholder?: string | undefined;
803
+ required?: boolean | undefined;
804
+ enabled?: boolean | undefined;
805
+ }, {
806
+ options: string[];
807
+ type: "select";
808
+ name: string;
809
+ label: string;
810
+ multi: boolean;
811
+ description?: string | undefined;
812
+ placeholder?: string | undefined;
813
+ required?: boolean | undefined;
814
+ enabled?: boolean | undefined;
815
+ }>]>]>) => void;
816
+ updateNavigationItemCustomField: (modifier: (base: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
817
+ name: z.ZodEffects<z.ZodString, string, string>;
818
+ label: z.ZodString;
819
+ description: z.ZodOptional<z.ZodString>;
820
+ placeholder: z.ZodOptional<z.ZodString>;
821
+ required: z.ZodOptional<z.ZodBoolean>;
822
+ enabled: z.ZodOptional<z.ZodBoolean>;
823
+ } & {
824
+ type: z.ZodEnum<["boolean", "string"]>;
825
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
826
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
827
+ }, "strip", z.ZodTypeAny, {
828
+ type: "string" | "boolean";
829
+ name: string;
830
+ label: string;
831
+ options?: string[] | undefined;
832
+ description?: string | undefined;
833
+ placeholder?: string | undefined;
834
+ required?: boolean | undefined;
835
+ enabled?: boolean | undefined;
836
+ multi?: false | undefined;
837
+ }, {
838
+ type: "string" | "boolean";
839
+ name: string;
840
+ label: string;
841
+ options?: string[] | undefined;
842
+ description?: string | undefined;
843
+ placeholder?: string | undefined;
844
+ required?: boolean | undefined;
845
+ enabled?: boolean | undefined;
846
+ multi?: false | undefined;
847
+ }>, z.ZodObject<{
848
+ name: z.ZodEffects<z.ZodString, string, string>;
849
+ label: z.ZodString;
850
+ description: z.ZodOptional<z.ZodString>;
851
+ placeholder: z.ZodOptional<z.ZodString>;
852
+ required: z.ZodOptional<z.ZodBoolean>;
853
+ enabled: z.ZodOptional<z.ZodBoolean>;
854
+ } & {
855
+ type: z.ZodLiteral<"media">;
856
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
857
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
858
+ }, "strip", z.ZodTypeAny, {
859
+ type: "media";
860
+ name: string;
861
+ label: string;
862
+ options?: string[] | undefined;
863
+ description?: string | undefined;
864
+ placeholder?: string | undefined;
865
+ required?: boolean | undefined;
866
+ enabled?: boolean | undefined;
867
+ multi?: false | undefined;
868
+ }, {
869
+ type: "media";
870
+ name: string;
871
+ label: string;
872
+ options?: string[] | undefined;
873
+ description?: string | undefined;
874
+ placeholder?: string | undefined;
875
+ required?: boolean | undefined;
876
+ enabled?: boolean | undefined;
877
+ multi?: false | undefined;
878
+ }>, z.ZodObject<{
879
+ name: z.ZodEffects<z.ZodString, string, string>;
880
+ label: z.ZodString;
881
+ description: z.ZodOptional<z.ZodString>;
882
+ placeholder: z.ZodOptional<z.ZodString>;
883
+ required: z.ZodOptional<z.ZodBoolean>;
884
+ enabled: z.ZodOptional<z.ZodBoolean>;
885
+ } & {
886
+ type: z.ZodLiteral<"select">;
887
+ multi: z.ZodBoolean;
888
+ options: z.ZodArray<z.ZodString, "many">;
889
+ }, "strip", z.ZodTypeAny, {
890
+ options: string[];
891
+ type: "select";
892
+ name: string;
893
+ label: string;
894
+ multi: boolean;
895
+ description?: string | undefined;
896
+ placeholder?: string | undefined;
897
+ required?: boolean | undefined;
898
+ enabled?: boolean | undefined;
899
+ }, {
900
+ options: string[];
901
+ type: "select";
902
+ name: string;
903
+ label: string;
904
+ multi: boolean;
905
+ description?: string | undefined;
906
+ placeholder?: string | undefined;
907
+ required?: boolean | undefined;
908
+ enabled?: boolean | undefined;
909
+ }>]>) => z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
910
+ name: z.ZodEffects<z.ZodString, string, string>;
911
+ label: z.ZodString;
912
+ description: z.ZodOptional<z.ZodString>;
913
+ placeholder: z.ZodOptional<z.ZodString>;
914
+ required: z.ZodOptional<z.ZodBoolean>;
915
+ enabled: z.ZodOptional<z.ZodBoolean>;
916
+ } & {
917
+ type: z.ZodEnum<["boolean", "string"]>;
918
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
919
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
920
+ }, "strip", z.ZodTypeAny, {
921
+ type: "string" | "boolean";
922
+ name: string;
923
+ label: string;
924
+ options?: string[] | undefined;
925
+ description?: string | undefined;
926
+ placeholder?: string | undefined;
927
+ required?: boolean | undefined;
928
+ enabled?: boolean | undefined;
929
+ multi?: false | undefined;
930
+ }, {
931
+ type: "string" | "boolean";
932
+ name: string;
933
+ label: string;
934
+ options?: string[] | undefined;
935
+ description?: string | undefined;
936
+ placeholder?: string | undefined;
937
+ required?: boolean | undefined;
938
+ enabled?: boolean | undefined;
939
+ multi?: false | undefined;
940
+ }>, z.ZodObject<{
941
+ name: z.ZodEffects<z.ZodString, string, string>;
942
+ label: z.ZodString;
943
+ description: z.ZodOptional<z.ZodString>;
944
+ placeholder: z.ZodOptional<z.ZodString>;
945
+ required: z.ZodOptional<z.ZodBoolean>;
946
+ enabled: z.ZodOptional<z.ZodBoolean>;
947
+ } & {
948
+ type: z.ZodLiteral<"media">;
949
+ multi: z.ZodOptional<z.ZodLiteral<false>>;
950
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
951
+ }, "strip", z.ZodTypeAny, {
952
+ type: "media";
953
+ name: string;
954
+ label: string;
955
+ options?: string[] | undefined;
956
+ description?: string | undefined;
957
+ placeholder?: string | undefined;
958
+ required?: boolean | undefined;
959
+ enabled?: boolean | undefined;
960
+ multi?: false | undefined;
961
+ }, {
962
+ type: "media";
963
+ name: string;
964
+ label: string;
965
+ options?: string[] | undefined;
966
+ description?: string | undefined;
967
+ placeholder?: string | undefined;
968
+ required?: boolean | undefined;
969
+ enabled?: boolean | undefined;
970
+ multi?: false | undefined;
971
+ }>, z.ZodObject<{
972
+ name: z.ZodEffects<z.ZodString, string, string>;
973
+ label: z.ZodString;
974
+ description: z.ZodOptional<z.ZodString>;
975
+ placeholder: z.ZodOptional<z.ZodString>;
976
+ required: z.ZodOptional<z.ZodBoolean>;
977
+ enabled: z.ZodOptional<z.ZodBoolean>;
978
+ } & {
979
+ type: z.ZodLiteral<"select">;
980
+ multi: z.ZodBoolean;
981
+ options: z.ZodArray<z.ZodString, "many">;
982
+ }, "strip", z.ZodTypeAny, {
983
+ options: string[];
984
+ type: "select";
985
+ name: string;
986
+ label: string;
987
+ multi: boolean;
988
+ description?: string | undefined;
989
+ placeholder?: string | undefined;
990
+ required?: boolean | undefined;
991
+ enabled?: boolean | undefined;
992
+ }, {
993
+ options: string[];
994
+ type: "select";
995
+ name: string;
996
+ label: string;
997
+ multi: boolean;
998
+ description?: string | undefined;
999
+ placeholder?: string | undefined;
1000
+ required?: boolean | undefined;
1001
+ enabled?: boolean | undefined;
1002
+ }>]>) => void;
1003
+ updateUpdateNavigationSchema: (modifier: (base: z.ZodObject<{
1004
+ name: z.ZodOptional<z.ZodString>;
1005
+ id: z.ZodNumber;
1006
+ documentId: z.ZodString;
1007
+ slug: z.ZodOptional<z.ZodString>;
1008
+ locale: z.ZodOptional<z.ZodString>;
1009
+ visible: z.ZodOptional<z.ZodBoolean>;
1010
+ items: z.ZodOptional<z.ZodArray<import("../schemas").UpdateNavigationItemSchema, "many">>;
1011
+ }, "strip", z.ZodTypeAny, {
1012
+ id: number;
1013
+ documentId: string;
1014
+ name?: string | undefined;
1015
+ slug?: string | undefined;
1016
+ locale?: string | undefined;
1017
+ visible?: boolean | undefined;
1018
+ items?: Omit<import("../schemas").NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
1019
+ }, {
1020
+ id: number;
1021
+ documentId: string;
1022
+ name?: string | undefined;
1023
+ slug?: string | undefined;
1024
+ locale?: string | undefined;
1025
+ visible?: boolean | undefined;
1026
+ items?: Omit<import("../schemas").NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
1027
+ }>) => z.ZodObject<{
1028
+ name: z.ZodOptional<z.ZodString>;
1029
+ id: z.ZodNumber;
1030
+ documentId: z.ZodString;
1031
+ slug: z.ZodOptional<z.ZodString>;
1032
+ locale: z.ZodOptional<z.ZodString>;
1033
+ visible: z.ZodOptional<z.ZodBoolean>;
1034
+ items: z.ZodOptional<z.ZodArray<import("../schemas").UpdateNavigationItemSchema, "many">>;
1035
+ }, "strip", z.ZodTypeAny, {
1036
+ id: number;
1037
+ documentId: string;
1038
+ name?: string | undefined;
1039
+ slug?: string | undefined;
1040
+ locale?: string | undefined;
1041
+ visible?: boolean | undefined;
1042
+ items?: Omit<import("../schemas").NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
1043
+ }, {
1044
+ id: number;
1045
+ documentId: string;
1046
+ name?: string | undefined;
1047
+ slug?: string | undefined;
1048
+ locale?: string | undefined;
1049
+ visible?: boolean | undefined;
1050
+ items?: Omit<import("../schemas").NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
1051
+ }>) => void;
179
1052
  };
180
1053
  get(): Promise<{
181
1054
  name: string;
@@ -186,7 +1059,7 @@ export default function adminController(context: {
186
1059
  visible: boolean;
187
1060
  items?: import("../schemas").NavigationItemDBSchema[] | undefined;
188
1061
  }[]>;
189
- post(ctx: KoaContext & KoaContextExtension): Promise<import("../dtos").NavigationDTO>;
1062
+ post(ctx: KoaContext & KoaContextExtension): Promise<import("../dtos").NavigationDTO | KoaContext>;
190
1063
  put(ctx: KoaContext & KoaContextExtension): Promise<{
191
1064
  name: string;
192
1065
  id: number;
@@ -195,7 +1068,7 @@ export default function adminController(context: {
195
1068
  locale: string;
196
1069
  visible: boolean;
197
1070
  items?: import("../schemas").NavigationItemDBSchema[] | undefined;
198
- }>;
1071
+ } | KoaContext>;
199
1072
  delete(ctx: KoaContext): Promise<{}>;
200
1073
  config(): Promise<import("../dtos").NavigationPluginConfigDTO>;
201
1074
  updateConfig(ctx: KoaContext & KoaContextExtension): Promise<{}>;