@testcontainers/neo4j 10.24.2 → 10.26.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/build/index.d.ts +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/neo4j-container.d.ts +12 -1
- package/build/neo4j-container.js +33 -10
- package/build/neo4j-container.js.map +1 -1
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Neo4jContainer, StartedNeo4jContainer } from "./neo4j-container";
|
|
1
|
+
export { Neo4jContainer, Neo4jPlugin, StartedNeo4jContainer } from "./neo4j-container";
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StartedNeo4jContainer = exports.Neo4jContainer = void 0;
|
|
3
|
+
exports.StartedNeo4jContainer = exports.Neo4jPlugin = exports.Neo4jContainer = void 0;
|
|
4
4
|
var neo4j_container_1 = require("./neo4j-container");
|
|
5
5
|
Object.defineProperty(exports, "Neo4jContainer", { enumerable: true, get: function () { return neo4j_container_1.Neo4jContainer; } });
|
|
6
|
+
Object.defineProperty(exports, "Neo4jPlugin", { enumerable: true, get: function () { return neo4j_container_1.Neo4jPlugin; } });
|
|
6
7
|
Object.defineProperty(exports, "StartedNeo4jContainer", { enumerable: true, get: function () { return neo4j_container_1.StartedNeo4jContainer; } });
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAuF;AAA9E,iHAAA,cAAc,OAAA;AAAE,8GAAA,WAAW,OAAA;AAAE,wHAAA,qBAAqB,OAAA"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { AbstractStartedContainer, GenericContainer, StartedTestContainer } from "testcontainers";
|
|
2
|
+
export declare enum Neo4jPlugin {
|
|
3
|
+
APOC = "apoc",
|
|
4
|
+
APOC_EXTENDED = "apoc-extended",
|
|
5
|
+
BLOOM = "bloom",
|
|
6
|
+
GEN_AI = "genai",
|
|
7
|
+
GRAPHQL = "graphql",
|
|
8
|
+
GRAPH_ALGORITHMS = "graph-algorithms",
|
|
9
|
+
GRAPH_DATA_SCIENCE = "graph-data-science",
|
|
10
|
+
NEO_SEMANTICS = "n10s"
|
|
11
|
+
}
|
|
2
12
|
export declare class Neo4jContainer extends GenericContainer {
|
|
3
13
|
private password;
|
|
4
|
-
private apoc;
|
|
5
14
|
private ttl?;
|
|
15
|
+
private plugins;
|
|
6
16
|
constructor(image?: string);
|
|
7
17
|
withPassword(password: string): this;
|
|
8
18
|
withApoc(): this;
|
|
19
|
+
withPlugins(plugins: Neo4jPlugin[]): this;
|
|
9
20
|
withTtl(schedule?: number): this;
|
|
10
21
|
start(): Promise<StartedNeo4jContainer>;
|
|
11
22
|
}
|
package/build/neo4j-container.js
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StartedNeo4jContainer = exports.Neo4jContainer = void 0;
|
|
3
|
+
exports.StartedNeo4jContainer = exports.Neo4jContainer = exports.Neo4jPlugin = void 0;
|
|
4
4
|
const testcontainers_1 = require("testcontainers");
|
|
5
5
|
const BOLT_PORT = 7687;
|
|
6
6
|
const HTTP_PORT = 7474;
|
|
7
7
|
const USERNAME = "neo4j";
|
|
8
|
+
var Neo4jPlugin;
|
|
9
|
+
(function (Neo4jPlugin) {
|
|
10
|
+
Neo4jPlugin["APOC"] = "apoc";
|
|
11
|
+
Neo4jPlugin["APOC_EXTENDED"] = "apoc-extended";
|
|
12
|
+
Neo4jPlugin["BLOOM"] = "bloom";
|
|
13
|
+
Neo4jPlugin["GEN_AI"] = "genai";
|
|
14
|
+
Neo4jPlugin["GRAPHQL"] = "graphql";
|
|
15
|
+
Neo4jPlugin["GRAPH_ALGORITHMS"] = "graph-algorithms";
|
|
16
|
+
Neo4jPlugin["GRAPH_DATA_SCIENCE"] = "graph-data-science";
|
|
17
|
+
Neo4jPlugin["NEO_SEMANTICS"] = "n10s";
|
|
18
|
+
})(Neo4jPlugin = exports.Neo4jPlugin || (exports.Neo4jPlugin = {}));
|
|
19
|
+
const pluginWhitelists = {
|
|
20
|
+
[Neo4jPlugin.APOC]: "apoc.*",
|
|
21
|
+
[Neo4jPlugin.APOC_EXTENDED]: "apoc.*",
|
|
22
|
+
[Neo4jPlugin.BLOOM]: "bloom.*",
|
|
23
|
+
[Neo4jPlugin.GRAPH_DATA_SCIENCE]: "gds.*",
|
|
24
|
+
};
|
|
8
25
|
class Neo4jContainer extends testcontainers_1.GenericContainer {
|
|
9
26
|
password = "pass123!@#WORD";
|
|
10
|
-
apoc = false;
|
|
11
27
|
ttl;
|
|
28
|
+
plugins = [];
|
|
12
29
|
constructor(image = "neo4j:4.4.12") {
|
|
13
30
|
super(image);
|
|
14
31
|
this.withExposedPorts(BOLT_PORT, HTTP_PORT)
|
|
@@ -21,11 +38,11 @@ class Neo4jContainer extends testcontainers_1.GenericContainer {
|
|
|
21
38
|
return this;
|
|
22
39
|
}
|
|
23
40
|
withApoc() {
|
|
24
|
-
this.
|
|
25
|
-
this
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
this.plugins.push(Neo4jPlugin.APOC);
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
withPlugins(plugins) {
|
|
45
|
+
this.plugins = plugins;
|
|
29
46
|
return this;
|
|
30
47
|
}
|
|
31
48
|
withTtl(schedule = 5) {
|
|
@@ -40,10 +57,16 @@ class Neo4jContainer extends testcontainers_1.GenericContainer {
|
|
|
40
57
|
NEO4J_apoc_ttl_schedule: this.ttl.toString(),
|
|
41
58
|
});
|
|
42
59
|
}
|
|
43
|
-
if (this.
|
|
60
|
+
if (this.plugins.length > 0) {
|
|
61
|
+
const whitelists = this.plugins
|
|
62
|
+
.map((plugin) => (plugin in pluginWhitelists ? pluginWhitelists[plugin] : null))
|
|
63
|
+
.filter((whitelisted) => whitelisted !== null)
|
|
64
|
+
.join(",");
|
|
44
65
|
this.withEnvironment({
|
|
45
|
-
NEO4JLABS_PLUGINS:
|
|
46
|
-
|
|
66
|
+
NEO4JLABS_PLUGINS: JSON.stringify(this.plugins),
|
|
67
|
+
NEO4J_PLUGINS: JSON.stringify(this.plugins),
|
|
68
|
+
NEO4J_dbms_security_procedures_unrestricted: whitelists,
|
|
69
|
+
NEO4J_dbms_security_procedures_whitelist: whitelists,
|
|
47
70
|
});
|
|
48
71
|
}
|
|
49
72
|
return new StartedNeo4jContainer(await super.start(), this.password);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neo4j-container.js","sourceRoot":"","sources":["../src/neo4j-container.ts"],"names":[],"mappings":";;;AAAA,mDAAwG;AAExG,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB,MAAa,cAAe,SAAQ,iCAAgB;IAC1C,QAAQ,GAAG,gBAAgB,CAAC;IAC5B,
|
|
1
|
+
{"version":3,"file":"neo4j-container.js","sourceRoot":"","sources":["../src/neo4j-container.ts"],"names":[],"mappings":";;;AAAA,mDAAwG;AAExG,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB,IAAY,WASX;AATD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,8CAA+B,CAAA;IAC/B,8BAAe,CAAA;IACf,+BAAgB,CAAA;IAChB,kCAAmB,CAAA;IACnB,oDAA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,CAAC;QAFX,aAAQ,GAAR,QAAQ,CAAQ;QAGjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC;IAEM,UAAU;QACf,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC;IACtD,CAAC;IAEM,UAAU;QACf,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC;IACtD,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,WAAW;QAChB,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA5BD,sDA4BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testcontainers/neo4j",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.26.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neo4j",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"neo4j-driver": "^5.22.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"testcontainers": "^10.
|
|
35
|
+
"testcontainers": "^10.26.0"
|
|
36
36
|
}
|
|
37
37
|
}
|