strapi-plugin-navigation 3.2.6 → 3.2.7

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 (23) hide show
  1. package/dist/admin/index.js +1047 -817
  2. package/dist/admin/index.mjs +27594 -18827
  3. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AttachToMenuField/index.d.ts +1 -1
  4. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/CopyFromLocales/index.d.ts +1 -1
  5. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/PathField/index.d.ts +1 -1
  6. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/RelatedTypeField/index.d.ts +1 -1
  7. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/context/NavigationItemFormContext.d.ts +1 -1
  8. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/index.d.ts +2 -3
  9. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/hooks.d.ts +1 -1
  10. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/properties.d.ts +1 -1
  11. package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/index.d.ts +1 -1
  12. package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/index.d.ts +1 -1
  13. package/dist/admin/src/pages/HomePage/hooks/useNavigationItemPopup.d.ts +1 -1
  14. package/dist/admin/src/pages/HomePage/utils/parsers.d.ts +1 -1
  15. package/dist/server/index.js +33 -33
  16. package/dist/server/index.mjs +1785 -1781
  17. package/dist/server/src/controllers/utils.d.ts +0 -3
  18. package/dist/server/src/controllers/validators.d.ts +16 -9
  19. package/dist/server/src/index.d.ts +6 -1
  20. package/dist/server/src/middlewares/index.d.ts +6 -1
  21. package/dist/server/src/middlewares/middleware.d.ts +6 -0
  22. package/dist/server/src/services/client/types.d.ts +1 -1
  23. package/package.json +1 -1
@@ -1,4 +1 @@
1
- type Populate = string | boolean | string[] | undefined;
2
- export declare const sanitizePopulateField: (populate: Populate) => Populate;
3
1
  export declare const parseId: (id: string) => string;
4
- export {};
@@ -14,42 +14,48 @@ export declare const readAllQuerySchema: z.ZodObject<{
14
14
  orderDirection?: "DESC" | "ASC" | undefined;
15
15
  }>;
16
16
  export declare const renderTypeSchema: z.ZodEnum<["FLAT", "TREE", "RFR"]>;
17
- export declare const statusSchema: z.ZodEnum<["draft", "published"]>;
18
- export declare const populateSchema: z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodUndefined]>;
17
+ export declare const statusSchema: z.ZodPipeline<z.ZodEffects<z.ZodString, "published" | "draft", string>, z.ZodEnum<["draft", "published"]>>;
18
+ type PopulatePrimitive = boolean | string | string[] | undefined;
19
+ export interface PopulateObject {
20
+ [key: string]: Populate;
21
+ }
22
+ type Populate = PopulatePrimitive | PopulateObject;
23
+ export declare const populateSchema: z.ZodType<Populate, z.ZodTypeDef, unknown>;
24
+ export type PopulateQueryParam = z.infer<typeof populateSchema>;
19
25
  export declare const renderQuerySchema: z.ZodObject<{
20
26
  type: z.ZodOptional<z.ZodEnum<["FLAT", "TREE", "RFR"]>>;
21
27
  menu: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
22
28
  path: z.ZodOptional<z.ZodString>;
23
29
  locale: z.ZodOptional<z.ZodString>;
24
- populate: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodUndefined]>>;
25
- status: z.ZodOptional<z.ZodEnum<["draft", "published"]>>;
30
+ populate: z.ZodOptional<z.ZodType<Populate, z.ZodTypeDef, unknown>>;
31
+ status: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, "published" | "draft", string>, z.ZodEnum<["draft", "published"]>>>;
26
32
  }, "strip", z.ZodTypeAny, {
27
33
  status?: "published" | "draft" | undefined;
28
34
  path?: string | undefined;
29
35
  type?: "FLAT" | "TREE" | "RFR" | undefined;
30
36
  locale?: string | undefined;
31
- populate?: string | boolean | string[] | undefined;
37
+ populate?: Populate;
32
38
  menu?: "true" | "false" | undefined;
33
39
  }, {
34
- status?: "published" | "draft" | undefined;
40
+ status?: string | undefined;
35
41
  path?: string | undefined;
36
42
  type?: "FLAT" | "TREE" | "RFR" | undefined;
37
43
  locale?: string | undefined;
38
- populate?: string | boolean | string[] | undefined;
44
+ populate?: unknown;
39
45
  menu?: "true" | "false" | undefined;
40
46
  }>;
41
47
  export declare const renderChildQueryParams: z.ZodObject<{
42
48
  type: z.ZodOptional<z.ZodEnum<["FLAT", "TREE", "RFR"]>>;
43
49
  menu: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
44
50
  locale: z.ZodOptional<z.ZodString>;
45
- status: z.ZodOptional<z.ZodEnum<["draft", "published"]>>;
51
+ status: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, "published" | "draft", string>, z.ZodEnum<["draft", "published"]>>>;
46
52
  }, "strip", z.ZodTypeAny, {
47
53
  status?: "published" | "draft" | undefined;
48
54
  type?: "FLAT" | "TREE" | "RFR" | undefined;
49
55
  locale?: string | undefined;
50
56
  menu?: "true" | "false" | undefined;
51
57
  }, {
52
- status?: "published" | "draft" | undefined;
58
+ status?: string | undefined;
53
59
  type?: "FLAT" | "TREE" | "RFR" | undefined;
54
60
  locale?: string | undefined;
55
61
  menu?: "true" | "false" | undefined;
@@ -67,3 +73,4 @@ export declare const fillFromOtherLocaleParams: z.ZodObject<{
67
73
  target: string;
68
74
  source: string;
69
75
  }>;
76
+ export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="koa" />
1
2
  export type { AdminService, ClientService, CommonService, MigrationService } from './services';
2
3
  declare const _default: {
3
4
  bootstrap: (context: {
@@ -220,7 +221,11 @@ declare const _default: {
220
221
  lifecycles: Record<string, import("./types").Effect<import("./types").LifeCycleEvent<import("./types").LifeCycleHookName, unknown, Record<string, unknown>>>>;
221
222
  };
222
223
  };
223
- middlewares: {};
224
+ middlewares: {
225
+ localeMiddleware: ({ strapi }: {
226
+ strapi: import("@strapi/types/dist/core").Strapi;
227
+ }) => (ctx: import("koa").Context, next: import("koa").Next) => Promise<void>;
228
+ };
224
229
  policies: {};
225
230
  routes: {
226
231
  admin: {
@@ -1,2 +1,7 @@
1
- declare const _default: {};
1
+ /// <reference types="koa" />
2
+ declare const _default: {
3
+ localeMiddleware: ({ strapi }: {
4
+ strapi: import("@strapi/types/dist/core").Strapi;
5
+ }) => (ctx: import("koa").Context, next: import("koa").Next) => Promise<void>;
6
+ };
2
7
  export default _default;
@@ -0,0 +1,6 @@
1
+ import type { Core } from '@strapi/types';
2
+ import type { Context, Next } from 'koa';
3
+ export declare const localeMiddleware: ({ strapi }: {
4
+ strapi: Core.Strapi;
5
+ }) => (ctx: Context, next: Next) => Promise<void>;
6
+ export default localeMiddleware;
@@ -1,6 +1,6 @@
1
1
  import { NavigationItemDTO, RFRNavigationItemDTO } from '../../dtos';
2
+ import { PopulateQueryParam } from '../../controllers/validators';
2
3
  export type RenderType = 'FLAT' | 'TREE' | 'RFR';
3
- export type PopulateQueryParam = string | boolean | string[];
4
4
  export type NestedPath = {
5
5
  id?: number;
6
6
  documentId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-navigation",
3
- "version": "3.2.6",
3
+ "version": "3.2.7",
4
4
  "description": "Strapi - Navigation plugin",
5
5
  "strapi": {
6
6
  "name": "navigation",