@fourlights/strapi-plugin-deep-populate 1.0.0-beta.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/LICENSE.md +21 -0
- package/README.md +55 -0
- package/dist/server/index.js +25233 -0
- package/dist/server/index.mjs +25221 -0
- package/dist/server/src/index.d.ts +23 -0
- package/dist/server/src/services/deep-populate/index.d.ts +3 -0
- package/dist/server/src/services/deep-populate/utils.d.ts +4 -0
- package/dist/server/src/services/index.d.ts +21 -0
- package/dist/server/src/services/populate.d.ts +20 -0
- package/package.json +80 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
services: {
|
|
3
|
+
populate: ({ strapi }: {
|
|
4
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
5
|
+
}) => {
|
|
6
|
+
getPopulate({ contentType, documentId }: {
|
|
7
|
+
contentType: import("@strapi/types/dist/uid").ContentType;
|
|
8
|
+
documentId: string;
|
|
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>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
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, }: PopulateProps<TContentType, TSchema>): Promise<{}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Schema, UID } from "@strapi/strapi";
|
|
2
|
+
export declare const getRelations: <TSchema extends UID.Schema>(model: Schema.Schema<TSchema>) => [string, Schema.Attribute.AnyAttribute][];
|
|
3
|
+
export declare const isEmpty: (obj: object) => boolean;
|
|
4
|
+
export declare const hasValue: (value: unknown) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
populate: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
getPopulate({ contentType, documentId }: {
|
|
6
|
+
contentType: import("@strapi/types/dist/uid").ContentType;
|
|
7
|
+
documentId: string;
|
|
8
|
+
}): Promise<{}>;
|
|
9
|
+
documents(contentType: import("@strapi/types/dist/uid").ContentType): {
|
|
10
|
+
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>;
|
|
11
|
+
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>;
|
|
12
|
+
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>;
|
|
13
|
+
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>;
|
|
14
|
+
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>;
|
|
15
|
+
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>;
|
|
16
|
+
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;
|
|
17
|
+
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>;
|
|
18
|
+
} & 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>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Core, UID } from "@strapi/strapi";
|
|
2
|
+
declare const deepPopulateService: ({ strapi }: {
|
|
3
|
+
strapi: Core.Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
getPopulate({ contentType, documentId }: {
|
|
6
|
+
contentType: UID.ContentType;
|
|
7
|
+
documentId: string;
|
|
8
|
+
}): Promise<{}>;
|
|
9
|
+
documents(contentType: UID.ContentType): {
|
|
10
|
+
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>;
|
|
11
|
+
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>;
|
|
12
|
+
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>;
|
|
13
|
+
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>;
|
|
14
|
+
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>;
|
|
15
|
+
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>;
|
|
16
|
+
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;
|
|
17
|
+
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>;
|
|
18
|
+
} & import("@strapi/types/dist/modules/documents").DraftAndPublishExtension<UID.ContentType> & import("@strapi/types/dist/modules/documents/component-extension").ComponentExtension<UID.ContentType>;
|
|
19
|
+
};
|
|
20
|
+
export default deepPopulateService;
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0-beta.0",
|
|
3
|
+
"keywords": [],
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./package.json": "./package.json",
|
|
7
|
+
"./strapi-server": {
|
|
8
|
+
"types": "./dist/server/src/index.d.ts",
|
|
9
|
+
"source": "./server/src/index.ts",
|
|
10
|
+
"import": "./dist/server/index.mjs",
|
|
11
|
+
"require": "./dist/server/index.js",
|
|
12
|
+
"default": "./dist/server/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "strapi-plugin build",
|
|
20
|
+
"watch": "strapi-plugin watch",
|
|
21
|
+
"watch:link": "strapi-plugin watch:link",
|
|
22
|
+
"verify": "strapi-plugin verify",
|
|
23
|
+
"test": "npm-run-all --parallel test:*",
|
|
24
|
+
"test:ts:back": "tsc -p server/tsconfig.json",
|
|
25
|
+
"test:integration": "jest --verbose --forceExit --detectOpenHandles",
|
|
26
|
+
"ci": "biome ci server",
|
|
27
|
+
"release": "release-it",
|
|
28
|
+
"playground:install": "$npm_execpath run playground:yalc-add && cd playground && $npm_execpath install",
|
|
29
|
+
"playground:yalc-add": "cd playground && yalc add @fourlights/strapi-plugin-deep-populate",
|
|
30
|
+
"playground:yalc-add-link": "cd playground && yalc add --link @fourlights/strapi-plugin-deep-populate"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"dlv": "^1.1.3",
|
|
34
|
+
"dset": "^3.1.4",
|
|
35
|
+
"klona": "^2.0.6"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@biomejs/biome": "^1.9.4",
|
|
39
|
+
"@release-it/conventional-changelog": "^10.0.0",
|
|
40
|
+
"@strapi/sdk-plugin": "^5.3.0",
|
|
41
|
+
"@strapi/strapi": "^5.8.0",
|
|
42
|
+
"@strapi/typescript-utils": "^5.8.0",
|
|
43
|
+
"@types/dlv": "^1.1.5",
|
|
44
|
+
"@types/jest": "^29.5.14",
|
|
45
|
+
"better-sqlite3": "^11.8.1",
|
|
46
|
+
"jest": "^29.7.0",
|
|
47
|
+
"npm-run-all": "^4.1.5",
|
|
48
|
+
"release-it": "^18.1.1",
|
|
49
|
+
"simple-git": "^3.27.0",
|
|
50
|
+
"ts-jest": "^29.2.5",
|
|
51
|
+
"ts-node": "^10.9.2",
|
|
52
|
+
"typescript": "^5.7.3",
|
|
53
|
+
"yalc": "^1.0.0-pre.53"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@strapi/sdk-plugin": "^5.3.0",
|
|
57
|
+
"@strapi/strapi": "^5.8.0"
|
|
58
|
+
},
|
|
59
|
+
"strapi": {
|
|
60
|
+
"kind": "plugin",
|
|
61
|
+
"name": "deep-populate",
|
|
62
|
+
"displayName": "Deep Populate",
|
|
63
|
+
"description": "This plugin provides a simple way of retrieving all nested objects in a single request."
|
|
64
|
+
},
|
|
65
|
+
"name": "@fourlights/strapi-plugin-deep-populate",
|
|
66
|
+
"description": "This plugin provides a simple way of retrieving all nested objects in a single request.",
|
|
67
|
+
"license": "MIT",
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "git+https://git@github.com/Four-Lights-NL/strapi-plugin-deep-populate.git"
|
|
71
|
+
},
|
|
72
|
+
"bugs": {
|
|
73
|
+
"url": "https://github.com/Four-Lights-NL/strapi-plugin-deep-populate/issues"
|
|
74
|
+
},
|
|
75
|
+
"homepage": "https://github.com/Four-Lights-NL/strapi-plugin-deep-populate#readme",
|
|
76
|
+
"author": "Four Lights <engineering@fourlights.nl>",
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"access": "public"
|
|
79
|
+
}
|
|
80
|
+
}
|