@testcontainers/neo4j 10.0.0-beta.4
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 -0
- package/build/index.js +7 -0
- package/build/index.js.map +1 -0
- package/build/neo4j-container.d.ts +21 -0
- package/build/neo4j-container.js +72 -0
- package/build/neo4j-container.js.map +1 -0
- package/package.json +21 -0
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Neo4jContainer, StartedNeo4jContainer } from "./neo4j-container";
|
package/build/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StartedNeo4jContainer = exports.Neo4jContainer = void 0;
|
|
4
|
+
var neo4j_container_1 = require("./neo4j-container");
|
|
5
|
+
Object.defineProperty(exports, "Neo4jContainer", { enumerable: true, get: function () { return neo4j_container_1.Neo4jContainer; } });
|
|
6
|
+
Object.defineProperty(exports, "StartedNeo4jContainer", { enumerable: true, get: function () { return neo4j_container_1.StartedNeo4jContainer; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0E;AAAjE,iHAAA,cAAc,OAAA;AAAE,wHAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AbstractStartedContainer, GenericContainer, StartedTestContainer } from "@testcontainers/testcontainers";
|
|
2
|
+
export declare class Neo4jContainer extends GenericContainer {
|
|
3
|
+
private password;
|
|
4
|
+
private apoc;
|
|
5
|
+
private ttl?;
|
|
6
|
+
constructor(image?: string);
|
|
7
|
+
withPassword(password: string): this;
|
|
8
|
+
withApoc(): this;
|
|
9
|
+
withTtl(schedule?: number): this;
|
|
10
|
+
start(): Promise<StartedNeo4jContainer>;
|
|
11
|
+
}
|
|
12
|
+
export declare class StartedNeo4jContainer extends AbstractStartedContainer {
|
|
13
|
+
private readonly password;
|
|
14
|
+
private readonly boltPort;
|
|
15
|
+
private readonly httpPort;
|
|
16
|
+
constructor(startedTestContainer: StartedTestContainer, password: string);
|
|
17
|
+
getBoltUri(): string;
|
|
18
|
+
getHttpUri(): string;
|
|
19
|
+
getPassword(): string;
|
|
20
|
+
getUsername(): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StartedNeo4jContainer = exports.Neo4jContainer = void 0;
|
|
4
|
+
const testcontainers_1 = require("@testcontainers/testcontainers");
|
|
5
|
+
const BOLT_PORT = 7687;
|
|
6
|
+
const HTTP_PORT = 7474;
|
|
7
|
+
const USERNAME = "neo4j";
|
|
8
|
+
class Neo4jContainer extends testcontainers_1.GenericContainer {
|
|
9
|
+
password = "test";
|
|
10
|
+
apoc = false;
|
|
11
|
+
ttl;
|
|
12
|
+
constructor(image = "neo4j:4.4.12") {
|
|
13
|
+
super(image);
|
|
14
|
+
}
|
|
15
|
+
withPassword(password) {
|
|
16
|
+
this.password = password;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
withApoc() {
|
|
20
|
+
this.apoc = true;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
withTtl(schedule = 5) {
|
|
24
|
+
this.ttl = schedule;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
async start() {
|
|
28
|
+
this.withExposedPorts(...(this.hasExposedPorts ? this.exposedPorts : [BOLT_PORT, HTTP_PORT]))
|
|
29
|
+
.withWaitStrategy(testcontainers_1.Wait.forLogMessage("Started."))
|
|
30
|
+
.withEnvironment({ NEO4J_AUTH: `${USERNAME}/${this.password}` })
|
|
31
|
+
.withStartupTimeout(120000);
|
|
32
|
+
if (this.apoc) {
|
|
33
|
+
this.withEnvironment({
|
|
34
|
+
NEO4JLABS_PLUGINS: '["apoc"]',
|
|
35
|
+
NEO4J_dbms_security_procedures_unrestricted: "apoc.*",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (this.ttl) {
|
|
39
|
+
this.withEnvironment({
|
|
40
|
+
NEO4J_apoc_ttl_enabled: "true",
|
|
41
|
+
NEO4J_apoc_ttl_schedule: this.ttl.toString(),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return new StartedNeo4jContainer(await super.start(), this.password);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.Neo4jContainer = Neo4jContainer;
|
|
48
|
+
class StartedNeo4jContainer extends testcontainers_1.AbstractStartedContainer {
|
|
49
|
+
password;
|
|
50
|
+
boltPort;
|
|
51
|
+
httpPort;
|
|
52
|
+
constructor(startedTestContainer, password) {
|
|
53
|
+
super(startedTestContainer);
|
|
54
|
+
this.password = password;
|
|
55
|
+
this.boltPort = this.startedTestContainer.getMappedPort(BOLT_PORT);
|
|
56
|
+
this.httpPort = this.startedTestContainer.getMappedPort(HTTP_PORT);
|
|
57
|
+
}
|
|
58
|
+
getBoltUri() {
|
|
59
|
+
return `bolt://${this.getHost()}:${this.boltPort}/`;
|
|
60
|
+
}
|
|
61
|
+
getHttpUri() {
|
|
62
|
+
return `http://${this.getHost()}:${this.httpPort}/`;
|
|
63
|
+
}
|
|
64
|
+
getPassword() {
|
|
65
|
+
return this.password;
|
|
66
|
+
}
|
|
67
|
+
getUsername() {
|
|
68
|
+
return USERNAME;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.StartedNeo4jContainer = StartedNeo4jContainer;
|
|
72
|
+
//# sourceMappingURL=neo4j-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neo4j-container.js","sourceRoot":"","sources":["../src/neo4j-container.ts"],"names":[],"mappings":";;;AAAA,mEAAwH;AAExH,MAAM,SAAS,GAAG,IAAI,C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C,GAAG,CAAC,QAAQ,EAAE;aAC7C,CAAC,CAAC;SACJ;QAED,OAAO,IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;CACF;AA9CD,wCA8CC;AAED,MAAa,qBAAsB,SAAQ,yCAAwB;IAIQ;IAHxD,QAAQ,CAAS;IACjB,QAAQ,CAAS;IAElC,YAAY,oBAA0C,EAAmB,QAAgB;QACvF,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAD2C,aAAQ,GAAR,QAAQ,CAAQ;QAEvF,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;AAzBD,sDAyBC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@testcontainers/neo4j",
|
|
3
|
+
"version": "10.0.0-beta.4",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"build"
|
|
8
|
+
],
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc --project tsconfig.build.json"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"neo4j-driver": "^5.10.0"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@testcontainers/testcontainers": "*"
|
|
20
|
+
}
|
|
21
|
+
}
|