@fourlights/strapi-plugin-deep-populate 1.1.1 → 1.2.1

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.
@@ -0,0 +1,45 @@
1
+ declare const _default: {
2
+ kind: string;
3
+ collectionName: string;
4
+ info: {
5
+ singularName: string;
6
+ pluralName: string;
7
+ displayName: string;
8
+ description: string;
9
+ };
10
+ options: {};
11
+ pluginOptions: {
12
+ "content-manager": {
13
+ visible: boolean;
14
+ };
15
+ "content-type-builder": {
16
+ visible: boolean;
17
+ };
18
+ };
19
+ attributes: {
20
+ hash: {
21
+ type: string;
22
+ configurable: boolean;
23
+ required: boolean;
24
+ };
25
+ params: {
26
+ type: string;
27
+ configurable: boolean;
28
+ required: boolean;
29
+ };
30
+ populate: {
31
+ type: string;
32
+ configurable: boolean;
33
+ };
34
+ dependencies: {
35
+ type: string;
36
+ configurable: boolean;
37
+ };
38
+ };
39
+ indexes: {
40
+ name: string;
41
+ columns: string[];
42
+ type: string;
43
+ }[];
44
+ };
45
+ export default _default;
@@ -0,0 +1,49 @@
1
+ declare const _default: {
2
+ cache: {
3
+ schema: {
4
+ kind: string;
5
+ collectionName: string;
6
+ info: {
7
+ singularName: string;
8
+ pluralName: string;
9
+ displayName: string;
10
+ description: string;
11
+ };
12
+ options: {};
13
+ pluginOptions: {
14
+ "content-manager": {
15
+ visible: boolean;
16
+ };
17
+ "content-type-builder": {
18
+ visible: boolean;
19
+ };
20
+ };
21
+ attributes: {
22
+ hash: {
23
+ type: string;
24
+ configurable: boolean;
25
+ required: boolean;
26
+ };
27
+ params: {
28
+ type: string;
29
+ configurable: boolean;
30
+ required: boolean;
31
+ };
32
+ populate: {
33
+ type: string;
34
+ configurable: boolean;
35
+ };
36
+ dependencies: {
37
+ type: string;
38
+ configurable: boolean;
39
+ };
40
+ };
41
+ indexes: {
42
+ name: string;
43
+ columns: string[];
44
+ type: string;
45
+ }[];
46
+ };
47
+ };
48
+ };
49
+ export default _default;
@@ -1,24 +1,88 @@
1
1
  declare const _default: {
2
+ config: {
3
+ default: ({ env }: {
4
+ env: any;
5
+ }) => {
6
+ cachePopulate: boolean;
7
+ augmentPopulateStar: boolean;
8
+ };
9
+ validator: (config: any) => void;
10
+ };
11
+ contentTypes: {
12
+ cache: {
13
+ schema: {
14
+ kind: string;
15
+ collectionName: string;
16
+ info: {
17
+ singularName: string;
18
+ pluralName: string;
19
+ displayName: string;
20
+ description: string;
21
+ };
22
+ options: {};
23
+ pluginOptions: {
24
+ "content-manager": {
25
+ visible: boolean;
26
+ };
27
+ "content-type-builder": {
28
+ visible: boolean;
29
+ };
30
+ };
31
+ attributes: {
32
+ hash: {
33
+ type: string;
34
+ configurable: boolean;
35
+ required: boolean;
36
+ };
37
+ params: {
38
+ type: string;
39
+ configurable: boolean;
40
+ required: boolean;
41
+ };
42
+ populate: {
43
+ type: string;
44
+ configurable: boolean;
45
+ };
46
+ dependencies: {
47
+ type: string;
48
+ configurable: boolean;
49
+ };
50
+ };
51
+ indexes: {
52
+ name: string;
53
+ columns: string[];
54
+ type: string;
55
+ }[];
56
+ };
57
+ };
58
+ };
2
59
  services: {
3
60
  populate: ({ strapi }: {
4
61
  strapi: import("@strapi/types/dist/core").Strapi;
5
62
  }) => {
6
- get({ contentType, documentId, omitEmpty, }: {
63
+ get(params: import("./services/populate").PopulateParams<import("@strapi/types/dist/uid").ContentType>): Promise<any>;
64
+ };
65
+ cache: ({ strapi }: {
66
+ strapi: import("@strapi/types/dist/core").Strapi;
67
+ }) => {
68
+ get(params: import("./services/populate").PopulateParams): Promise<any>;
69
+ set({ populate, dependencies, ...params }: import("@strapi/types/dist/modules/documents/params/status").Param & {
70
+ locale?: string;
71
+ } & {
7
72
  contentType: import("@strapi/types/dist/uid").ContentType;
8
73
  documentId: string;
9
74
  omitEmpty?: boolean;
10
- }): Promise<{}>;
11
- documents(contentType: import("@strapi/types/dist/uid").ContentType): {
12
- findMany<const TParams extends import("@strapi/types/dist/modules/documents/params/document-engine").FindMany<import("@strapi/types/dist/uid").ContentType>>(params?: TParams): import("@strapi/types/dist/modules/documents/result/document-engine").FindMany<import("@strapi/types/dist/uid").ContentType, TParams>;
13
- findFirst<const TParams_1 extends import("@strapi/types/dist/modules/documents/params/document-engine").FindFirst<import("@strapi/types/dist/uid").ContentType>>(params?: TParams_1): import("@strapi/types/dist/modules/documents/result/document-engine").FindFirst<import("@strapi/types/dist/uid").ContentType, TParams_1>;
14
- findOne<const TParams_2 extends import("@strapi/types/dist/modules/documents/params/document-engine").FindOne<import("@strapi/types/dist/uid").ContentType>>(params: TParams_2): import("@strapi/types/dist/modules/documents/result/document-engine").FindOne<import("@strapi/types/dist/uid").ContentType, TParams_2>;
15
- delete<const TParams_3 extends import("@strapi/types/dist/modules/documents/params/document-engine").Delete<import("@strapi/types/dist/uid").ContentType>>(params: TParams_3): import("@strapi/types/dist/modules/documents/result/document-engine").Delete<import("@strapi/types/dist/uid").ContentType, TParams_3>;
16
- create<const TParams_4 extends import("@strapi/types/dist/modules/documents/params/document-engine").Create<import("@strapi/types/dist/uid").ContentType>>(params: TParams_4): import("@strapi/types/dist/modules/documents/result/document-engine").Create<import("@strapi/types/dist/uid").ContentType, TParams_4>;
17
- update<const TParams_5 extends import("@strapi/types/dist/modules/documents/params/document-engine").Update<import("@strapi/types/dist/uid").ContentType>>(params: TParams_5): import("@strapi/types/dist/modules/documents/result/document-engine").Update<import("@strapi/types/dist/uid").ContentType, TParams_5>;
18
- count<const TParams_6 extends import("@strapi/types/dist/modules/documents/params/document-engine").Count<import("@strapi/types/dist/uid").ContentType>>(params: TParams_6): import("@strapi/types/dist/modules/documents/result/document-engine").Count;
19
- clone<const TParams_7 extends import("@strapi/types/dist/modules/documents/params/document-engine").Clone<import("@strapi/types/dist/uid").ContentType>>(params: TParams_7): import("@strapi/types/dist/modules/documents/result/document-engine").Clone<import("@strapi/types/dist/uid").ContentType, TParams_7>;
20
- } & import("@strapi/types/dist/modules/documents").DraftAndPublishExtension<import("@strapi/types/dist/uid").ContentType> & import("@strapi/types/dist/modules/documents/component-extension").ComponentExtension<import("@strapi/types/dist/uid").ContentType>;
75
+ } & {
76
+ populate?: import("@strapi/types/dist/modules/documents/params/populate").Any<import("@strapi/types/dist/uid").ContentType>;
77
+ } & {
78
+ dependencies: string[];
79
+ }): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
80
+ clear(params: import("./services/populate").PopulateParams): Promise<any>;
81
+ refreshDependents(documentId: string): Promise<void>;
21
82
  };
22
83
  };
84
+ register: ({ strapi }: {
85
+ strapi: any;
86
+ }) => Promise<void>;
23
87
  };
24
88
  export default _default;
@@ -0,0 +1,4 @@
1
+ declare const _default: ({ strapi }: {
2
+ strapi: any;
3
+ }) => Promise<void>;
4
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import type { Core, Modules } from "@strapi/strapi";
2
+ import type { PopulateParams } from "./populate";
3
+ type SetPopulateParams = PopulateParams & Modules.Documents.Params.Pick<PopulateParams["contentType"], "populate"> & {
4
+ dependencies: string[];
5
+ };
6
+ declare const _default: ({ strapi }: {
7
+ strapi: Core.Strapi;
8
+ }) => {
9
+ get(params: PopulateParams): Promise<any>;
10
+ set({ populate, dependencies, ...params }: SetPopulateParams): Promise<Modules.Documents.AnyDocument>;
11
+ clear(params: PopulateParams): Promise<any>;
12
+ refreshDependents(documentId: string): Promise<void>;
13
+ };
14
+ export default _default;
@@ -1,3 +1,5 @@
1
- import type { UID } from "@strapi/strapi";
2
- import type { PopulateProps } from "./types";
3
- export default function _populate<TContentType extends UID.ContentType, TSchema extends UID.Schema>({ mainUid, mainDocumentId, schema, populate, lookup, resolvedRelations, omitEmpty, }: PopulateProps<TContentType, TSchema>): Promise<{}>;
1
+ import type { PopulateParams } from "../populate";
2
+ export default function populate(params: PopulateParams): Promise<{
3
+ populate: {};
4
+ dependencies: any[];
5
+ }>;
@@ -2,21 +2,25 @@ declare const _default: {
2
2
  populate: ({ strapi }: {
3
3
  strapi: import("@strapi/types/dist/core").Strapi;
4
4
  }) => {
5
- get({ contentType, documentId, omitEmpty, }: {
5
+ get(params: import("./populate").PopulateParams<import("@strapi/types/dist/uid").ContentType>): Promise<any>;
6
+ };
7
+ cache: ({ strapi }: {
8
+ strapi: import("@strapi/types/dist/core").Strapi;
9
+ }) => {
10
+ get(params: import("./populate").PopulateParams): Promise<any>;
11
+ set({ populate, dependencies, ...params }: import("@strapi/types/dist/modules/documents/params/status").Param & {
12
+ locale?: string;
13
+ } & {
6
14
  contentType: import("@strapi/types/dist/uid").ContentType;
7
15
  documentId: string;
8
16
  omitEmpty?: boolean;
9
- }): Promise<{}>;
10
- documents(contentType: import("@strapi/types/dist/uid").ContentType): {
11
- findMany<const TParams extends import("@strapi/types/dist/modules/documents/params/document-engine").FindMany<import("@strapi/types/dist/uid").ContentType>>(params?: TParams): import("@strapi/types/dist/modules/documents/result/document-engine").FindMany<import("@strapi/types/dist/uid").ContentType, TParams>;
12
- findFirst<const TParams_1 extends import("@strapi/types/dist/modules/documents/params/document-engine").FindFirst<import("@strapi/types/dist/uid").ContentType>>(params?: TParams_1): import("@strapi/types/dist/modules/documents/result/document-engine").FindFirst<import("@strapi/types/dist/uid").ContentType, TParams_1>;
13
- findOne<const TParams_2 extends import("@strapi/types/dist/modules/documents/params/document-engine").FindOne<import("@strapi/types/dist/uid").ContentType>>(params: TParams_2): import("@strapi/types/dist/modules/documents/result/document-engine").FindOne<import("@strapi/types/dist/uid").ContentType, TParams_2>;
14
- delete<const TParams_3 extends import("@strapi/types/dist/modules/documents/params/document-engine").Delete<import("@strapi/types/dist/uid").ContentType>>(params: TParams_3): import("@strapi/types/dist/modules/documents/result/document-engine").Delete<import("@strapi/types/dist/uid").ContentType, TParams_3>;
15
- create<const TParams_4 extends import("@strapi/types/dist/modules/documents/params/document-engine").Create<import("@strapi/types/dist/uid").ContentType>>(params: TParams_4): import("@strapi/types/dist/modules/documents/result/document-engine").Create<import("@strapi/types/dist/uid").ContentType, TParams_4>;
16
- update<const TParams_5 extends import("@strapi/types/dist/modules/documents/params/document-engine").Update<import("@strapi/types/dist/uid").ContentType>>(params: TParams_5): import("@strapi/types/dist/modules/documents/result/document-engine").Update<import("@strapi/types/dist/uid").ContentType, TParams_5>;
17
- count<const TParams_6 extends import("@strapi/types/dist/modules/documents/params/document-engine").Count<import("@strapi/types/dist/uid").ContentType>>(params: TParams_6): import("@strapi/types/dist/modules/documents/result/document-engine").Count;
18
- clone<const TParams_7 extends import("@strapi/types/dist/modules/documents/params/document-engine").Clone<import("@strapi/types/dist/uid").ContentType>>(params: TParams_7): import("@strapi/types/dist/modules/documents/result/document-engine").Clone<import("@strapi/types/dist/uid").ContentType, TParams_7>;
19
- } & import("@strapi/types/dist/modules/documents").DraftAndPublishExtension<import("@strapi/types/dist/uid").ContentType> & import("@strapi/types/dist/modules/documents/component-extension").ComponentExtension<import("@strapi/types/dist/uid").ContentType>;
17
+ } & {
18
+ populate?: import("@strapi/types/dist/modules/documents/params/populate").Any<import("@strapi/types/dist/uid").ContentType>;
19
+ } & {
20
+ dependencies: string[];
21
+ }): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
22
+ clear(params: import("./populate").PopulateParams): Promise<any>;
23
+ refreshDependents(documentId: string): Promise<void>;
20
24
  };
21
25
  };
22
26
  export default _default;
@@ -1,21 +1,12 @@
1
- import type { Core, UID } from "@strapi/strapi";
1
+ import type { Core, Modules, UID } from "@strapi/strapi";
2
+ export type PopulateParams<TContentType extends UID.ContentType = UID.ContentType> = Modules.Documents.Params.Pick<TContentType, "locale:string" | "status"> & {
3
+ contentType: TContentType;
4
+ documentId: string;
5
+ omitEmpty?: boolean;
6
+ };
2
7
  declare const _default: ({ strapi }: {
3
8
  strapi: Core.Strapi;
4
9
  }) => {
5
- get({ contentType, documentId, omitEmpty, }: {
6
- contentType: UID.ContentType;
7
- documentId: string;
8
- omitEmpty?: boolean;
9
- }): Promise<{}>;
10
- documents(contentType: UID.ContentType): {
11
- findMany<const TParams extends import("@strapi/types/dist/modules/documents/params/document-engine").FindMany<UID.ContentType>>(params?: TParams): import("@strapi/types/dist/modules/documents/result/document-engine").FindMany<UID.ContentType, TParams>;
12
- findFirst<const TParams_1 extends import("@strapi/types/dist/modules/documents/params/document-engine").FindFirst<UID.ContentType>>(params?: TParams_1): import("@strapi/types/dist/modules/documents/result/document-engine").FindFirst<UID.ContentType, TParams_1>;
13
- findOne<const TParams_2 extends import("@strapi/types/dist/modules/documents/params/document-engine").FindOne<UID.ContentType>>(params: TParams_2): import("@strapi/types/dist/modules/documents/result/document-engine").FindOne<UID.ContentType, TParams_2>;
14
- delete<const TParams_3 extends import("@strapi/types/dist/modules/documents/params/document-engine").Delete<UID.ContentType>>(params: TParams_3): import("@strapi/types/dist/modules/documents/result/document-engine").Delete<UID.ContentType, TParams_3>;
15
- create<const TParams_4 extends import("@strapi/types/dist/modules/documents/params/document-engine").Create<UID.ContentType>>(params: TParams_4): import("@strapi/types/dist/modules/documents/result/document-engine").Create<UID.ContentType, TParams_4>;
16
- update<const TParams_5 extends import("@strapi/types/dist/modules/documents/params/document-engine").Update<UID.ContentType>>(params: TParams_5): import("@strapi/types/dist/modules/documents/result/document-engine").Update<UID.ContentType, TParams_5>;
17
- count<const TParams_6 extends import("@strapi/types/dist/modules/documents/params/document-engine").Count<UID.ContentType>>(params: TParams_6): import("@strapi/types/dist/modules/documents/result/document-engine").Count;
18
- clone<const TParams_7 extends import("@strapi/types/dist/modules/documents/params/document-engine").Clone<UID.ContentType>>(params: TParams_7): import("@strapi/types/dist/modules/documents/result/document-engine").Clone<UID.ContentType, TParams_7>;
19
- } & import("@strapi/types/dist/modules/documents").DraftAndPublishExtension<UID.ContentType> & import("@strapi/types/dist/modules/documents/component-extension").ComponentExtension<UID.ContentType>;
10
+ get(params: PopulateParams): Promise<any>;
20
11
  };
21
12
  export default _default;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.1",
2
+ "version": "1.2.1",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "strapi-plugin",
@@ -24,10 +24,11 @@
24
24
  "build": "strapi-plugin build",
25
25
  "watch": "strapi-plugin watch",
26
26
  "watch:link": "strapi-plugin watch:link",
27
+ "link": "yalc push --publish",
27
28
  "verify": "strapi-plugin verify",
28
29
  "test": "npm-run-all --parallel test:*",
29
30
  "test:ts:back": "tsc -p server/tsconfig.json",
30
- "test:integration": "jest --verbose --forceExit --detectOpenHandles",
31
+ "test:integration": "vitest --pool=vmThreads",
31
32
  "ci": "biome ci server",
32
33
  "release": "release-it",
33
34
  "playground:install": "$npm_execpath run playground:yalc-add && cd playground && $npm_execpath install --loglevel error",
@@ -45,15 +46,14 @@
45
46
  "@strapi/strapi": "^5.8.0",
46
47
  "@strapi/typescript-utils": "^5.8.0",
47
48
  "@types/dlv": "^1.1.5",
48
- "@types/jest": "^29.5.14",
49
+ "@vitest/ui": "^3.0.5",
49
50
  "better-sqlite3": "^11.8.1",
50
- "jest": "^29.7.0",
51
51
  "npm-run-all": "^4.1.5",
52
52
  "release-it": "^18.1.1",
53
53
  "simple-git": "^3.27.0",
54
- "ts-jest": "^29.2.5",
55
54
  "ts-node": "^10.9.2",
56
55
  "typescript": "^5.7.3",
56
+ "vitest": "^3.0.5",
57
57
  "yalc": "^1.0.0-pre.53"
58
58
  },
59
59
  "peerDependencies": {