@pi-r/oci 0.2.9 → 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/LICENSE +1 -1
- package/README.md +1 -1
- package/client/index.js +3 -2
- package/package.json +5 -5
- package/types/index.d.ts +19 -0
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
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": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.5.
|
|
24
|
-
"@e-mc/module": "^0.5.
|
|
25
|
-
"@e-mc/types": "^0.5.
|
|
26
|
-
"@pi-r/aws": "^0.2.
|
|
23
|
+
"@e-mc/cloud": "^0.5.6",
|
|
24
|
+
"@e-mc/module": "^0.5.6",
|
|
25
|
+
"@e-mc/types": "^0.5.6",
|
|
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 {}
|