@pi-r/atlas 0.6.3 → 0.6.6
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 +1 -1
- package/README.md +6 -3
- package/client/index.js +3 -4
- package/package.json +7 -7
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2024 An Pham
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# @pi-r/atlas
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Documentation
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- [E-mc](https://e-mc.readthedocs.io/en/latest/cloud/atlas.html)
|
|
6
|
+
- [squared](https://squared.readthedocs.io)
|
|
7
|
+
|
|
8
|
+
## LICENSE
|
|
6
9
|
|
|
7
10
|
MIT
|
package/client/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
exports.getObjectId = exports.executeBatchQuery = exports.executeQuery = exports.createDatabaseClient = exports.validateDatabase = void 0;
|
|
4
3
|
const mongodb = require("mongodb");
|
|
5
4
|
const types_1 = require("@e-mc/types");
|
|
@@ -35,7 +34,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
|
|
|
35
34
|
const result = new Array(length);
|
|
36
35
|
const clients = {};
|
|
37
36
|
const caching = length > 0 && this.hasCache(batch[0].service, sessionKey);
|
|
38
|
-
const coercing = this.hasCoerce("atlas"
|
|
37
|
+
const coercing = this.hasCoerce("atlas", 'options');
|
|
39
38
|
const cacheValue = { value: this.valueOfKey(credential, 'cache'), sessionKey };
|
|
40
39
|
const createClient = async (item, options) => {
|
|
41
40
|
var _a;
|
|
@@ -51,7 +50,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
|
|
|
51
50
|
const { service, name, table, id, aggregate, sort, client, ignoreCache } = item;
|
|
52
51
|
if (!table) {
|
|
53
52
|
closeClient();
|
|
54
|
-
throw (0, util_1.formatError)(item, "Missing database table"
|
|
53
|
+
throw (0, util_1.formatError)(item, "Missing database table");
|
|
55
54
|
}
|
|
56
55
|
let { query, update, limit = 0 } = item;
|
|
57
56
|
if (id && (!query || limit === 1)) {
|
|
@@ -78,7 +77,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
|
|
|
78
77
|
const command = item.command;
|
|
79
78
|
if (command) {
|
|
80
79
|
await Promise.all((!Array.isArray(command) ? [command] : command).map(async (cmd) => runCommand(instance, cmd)))
|
|
81
|
-
.then(items => items.forEach(output => this.addLog(this.statusType.INFO, output, "atlas"
|
|
80
|
+
.then(items => items.forEach(output => this.addLog(this.statusType.INFO, output, "atlas", 'runCommand')));
|
|
82
81
|
}
|
|
83
82
|
const collection = getCollection(instance);
|
|
84
83
|
if (update && coercing) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/atlas",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "MongoDB Atlas cloud functions for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.8.
|
|
24
|
-
"@e-mc/db": "^0.8.
|
|
25
|
-
"@e-mc/module": "^0.8.
|
|
26
|
-
"@e-mc/types": "^0.8.
|
|
27
|
-
"@pi-r/mongodb": "^0.6.
|
|
28
|
-
"mongodb": "^6.
|
|
23
|
+
"@e-mc/cloud": "^0.8.7",
|
|
24
|
+
"@e-mc/db": "^0.8.7",
|
|
25
|
+
"@e-mc/module": "^0.8.7",
|
|
26
|
+
"@e-mc/types": "^0.8.7",
|
|
27
|
+
"@pi-r/mongodb": "^0.6.6",
|
|
28
|
+
"mongodb": "^6.5.0"
|
|
29
29
|
}
|
|
30
30
|
}
|