@openfn/language-mongodb 1.0.6 → 2.0.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/configuration-schema.json +6 -6
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +4 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"properties": {
|
|
4
|
-
"
|
|
5
|
-
"title": "Cluster
|
|
4
|
+
"clusterHostname": {
|
|
5
|
+
"title": "Cluster Hostname",
|
|
6
6
|
"type": "string",
|
|
7
|
-
"description": "Your MongoDB cluster
|
|
8
|
-
"format": "
|
|
7
|
+
"description": "Your MongoDB cluster hostname",
|
|
8
|
+
"format": "hostname",
|
|
9
9
|
"minLength": 1,
|
|
10
10
|
"examples": [
|
|
11
11
|
"yourCluster-xxxyzzz.mongodb.net"
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"type": "object",
|
|
35
35
|
"additionalProperties": true,
|
|
36
36
|
"required": [
|
|
37
|
-
"
|
|
37
|
+
"clusterHostname",
|
|
38
38
|
"username",
|
|
39
39
|
"password"
|
|
40
40
|
]
|
|
41
|
-
}
|
|
41
|
+
}
|
package/dist/index.cjs
CHANGED
|
@@ -79,12 +79,12 @@ function execute(...operations) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
function connect(state) {
|
|
82
|
-
const {
|
|
82
|
+
const { clusterHostname, username, password } = state.configuration;
|
|
83
83
|
const uri = `mongodb+srv://${encodeURIComponent(
|
|
84
84
|
username
|
|
85
85
|
)}:${encodeURIComponent(
|
|
86
86
|
password
|
|
87
|
-
)}@${
|
|
87
|
+
)}@${clusterHostname}/test?retryWrites=true&w=majority`;
|
|
88
88
|
const client = new MongoClient(uri, { useNewUrlParser: true });
|
|
89
89
|
return new Promise((resolve, reject) => {
|
|
90
90
|
client.connect((err) => {
|
package/dist/index.js
CHANGED
|
@@ -55,12 +55,12 @@ function execute(...operations) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
function connect(state) {
|
|
58
|
-
const {
|
|
58
|
+
const { clusterHostname, username, password } = state.configuration;
|
|
59
59
|
const uri = `mongodb+srv://${encodeURIComponent(
|
|
60
60
|
username
|
|
61
61
|
)}:${encodeURIComponent(
|
|
62
62
|
password
|
|
63
|
-
)}@${
|
|
63
|
+
)}@${clusterHostname}/test?retryWrites=true&w=majority`;
|
|
64
64
|
const client = new MongoClient(uri, { useNewUrlParser: true });
|
|
65
65
|
return new Promise((resolve, reject) => {
|
|
66
66
|
client.connect((err) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-mongodb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A language package for working with MongoDb",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"configuration-schema.json"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@openfn/language-common": "^1.
|
|
15
|
+
"@openfn/language-common": "^1.8.1",
|
|
16
16
|
"mongodb": "^3.7.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"test": "mocha --experimental-specifier-resolution=node --no-warnings",
|
|
45
45
|
"test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
|
|
46
46
|
"clean": "rimraf dist types docs",
|
|
47
|
-
"pack": "pnpm pack --pack-destination ../../dist"
|
|
47
|
+
"pack": "pnpm pack --pack-destination ../../dist",
|
|
48
|
+
"lint": "eslint src"
|
|
48
49
|
}
|
|
49
50
|
}
|