@pi-r/oci 0.2.10 → 0.2.11
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/client/index.js +3 -2
- package/package.json +2 -2
- package/types/index.d.ts +19 -0
package/client/index.js
CHANGED
|
@@ -14,8 +14,9 @@ function validateDatabase(credential, data) {
|
|
|
14
14
|
}
|
|
15
15
|
exports.validateDatabase = validateDatabase;
|
|
16
16
|
function setStorageCredential(credential) {
|
|
17
|
+
var _a;
|
|
17
18
|
if (credential.endpoint) {
|
|
18
|
-
credential.region || (credential.region = /([^.]+)\.oraclecloud\.com$/.exec(credential.endpoint)
|
|
19
|
+
credential.region || (credential.region = (_a = /([^.]+)\.oraclecloud\.com$/.exec(credential.endpoint)) === null || _a === void 0 ? void 0 : _a[1]);
|
|
19
20
|
}
|
|
20
21
|
else {
|
|
21
22
|
credential.endpoint || (credential.endpoint = `https://${credential.namespace}.compat.objectstorage.${credential.region}.oraclecloud.com`);
|
|
@@ -75,7 +76,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
|
|
|
75
76
|
const cacheValue = { value: this.valueOfKey(credential, 'cache'), sessionKey };
|
|
76
77
|
let client;
|
|
77
78
|
const createClient = () => createDatabaseClient.call(this, length === 1 ? credential : { ...credential });
|
|
78
|
-
const closeClient = () => client
|
|
79
|
+
const closeClient = () => client === null || client === void 0 ? void 0 : client.close();
|
|
79
80
|
for (let i = 0; i < length; ++i) {
|
|
80
81
|
const item = batch[i];
|
|
81
82
|
const { service, table, id, query, ignoreCache } = item;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/oci",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Oracle (OCI) cloud functions for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@e-mc/cloud": "^0.5.6",
|
|
24
24
|
"@e-mc/module": "^0.5.6",
|
|
25
25
|
"@e-mc/types": "^0.5.6",
|
|
26
|
-
"@pi-r/aws": "^0.2.
|
|
26
|
+
"@pi-r/aws": "^0.2.11",
|
|
27
27
|
"aws-sdk": "^2.1591.0",
|
|
28
28
|
"oracledb": "^5.5.0"
|
|
29
29
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CloudDatabase, CloudStorage } from '@e-mc/types/lib/cloud';
|
|
2
|
+
|
|
3
|
+
import type { BindParameters, ConnectionAttributes, ExecuteOptions, InitialiseOptions } from 'oracledb';
|
|
4
|
+
import type { ConfigurationOptions } from 'aws-sdk/lib/core';
|
|
5
|
+
|
|
6
|
+
export type OCIStorage = CloudStorage<OCIStorageCredential, "oci">;
|
|
7
|
+
|
|
8
|
+
export interface OCIStorageCredential extends ConfigurationOptions {
|
|
9
|
+
namespace?: string;
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface OCIDatabaseQuery extends CloudDatabase<PlainObject | string, ExecuteOptions, StandardMap, BindParameters, OCIDatabaseCredential> {
|
|
14
|
+
source: "cloud";
|
|
15
|
+
service: "oci";
|
|
16
|
+
streamRow?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface OCIDatabaseCredential extends ConnectionAttributes, InitialiseOptions {}
|