terafoundation 0.42.5 → 0.44.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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Logger } from '@terascope/utils';
|
|
2
|
-
declare function create(customConfig: Record<string, any>, logger: Logger): {
|
|
3
|
-
client: any;
|
|
4
|
-
};
|
|
5
2
|
declare const _default: {
|
|
6
|
-
create:
|
|
3
|
+
create(): never;
|
|
4
|
+
createClient(customConfig: Record<string, any>, logger: Logger): Promise<{
|
|
5
|
+
client: import("@terascope/file-asset-apis").S3Client;
|
|
6
|
+
logger: Logger;
|
|
7
|
+
}>;
|
|
7
8
|
config_schema(): Record<string, any>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/connectors/s3.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/connectors/s3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;;;+BAOL,OAAO,MAAM,EAAE,GAAG,CAAC,UAAU,MAAM;;;;qBAInD,OAAO,MAAM,EAAE,GAAG,CAAC;;AARxC,wBA6DE"}
|
|
@@ -1,38 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const https_1 = __importDefault(require("https"));
|
|
8
|
-
const bluebird_1 = require("bluebird");
|
|
9
|
-
function create(customConfig, logger) {
|
|
10
|
-
const S3 = require('aws-sdk/clients/s3');
|
|
11
|
-
logger.info(`Using S3 endpoint: ${customConfig.endpoint}`);
|
|
12
|
-
// https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-registering-certs.html
|
|
13
|
-
// Instead of updating the client, we can just update the config before creating the client
|
|
14
|
-
if (customConfig.sslEnabled) {
|
|
15
|
-
if (customConfig.certLocation.length === 0) {
|
|
16
|
-
throw new Error(`Must provide a certificate for S3 endpoint ${customConfig.endpoint} since SSL is enabled`);
|
|
17
|
-
}
|
|
18
|
-
// Assumes all certs needed are in a single bundle
|
|
19
|
-
const certs = [
|
|
20
|
-
fs_1.default.readFileSync(customConfig.certLocation)
|
|
21
|
-
];
|
|
22
|
-
if (!customConfig.httpOptions)
|
|
23
|
-
customConfig.httpOptions = {};
|
|
24
|
-
customConfig.httpOptions.agent = new https_1.default.Agent({
|
|
25
|
-
rejectUnauthorized: true,
|
|
26
|
-
ca: certs
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const client = new S3(customConfig);
|
|
30
|
-
return {
|
|
31
|
-
client: (0, bluebird_1.promisifyAll)(client, { suffix: '_Async' })
|
|
32
|
-
};
|
|
33
|
-
}
|
|
3
|
+
const file_asset_apis_1 = require("@terascope/file-asset-apis");
|
|
34
4
|
exports.default = {
|
|
35
|
-
create
|
|
5
|
+
create() {
|
|
6
|
+
throw new Error('s3 does not support the deprecated "create" method, please use file-assets >= v2.4.0');
|
|
7
|
+
},
|
|
8
|
+
async createClient(customConfig, logger) {
|
|
9
|
+
const client = await (0, file_asset_apis_1.createS3Client)(customConfig, logger);
|
|
10
|
+
return { client, logger };
|
|
11
|
+
},
|
|
36
12
|
config_schema() {
|
|
37
13
|
return {
|
|
38
14
|
endpoint: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../src/connectors/s3.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../src/connectors/s3.ts"],"names":[],"mappings":";;AACA,gEAA4D;AAE5D,kBAAe;IACX,MAAM;QACF,MAAM,IAAI,KAA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}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "terafoundation",
|
|
3
3
|
"displayName": "Terafoundation",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.44.0",
|
|
5
5
|
"description": "A Clustering and Foundation tool for Terascope Tools",
|
|
6
6
|
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/terafoundation#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"test:watch": "ts-scripts test --watch . --"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@terascope/file-asset-apis": "^0.7.1",
|
|
30
31
|
"@terascope/utils": "^0.45.5",
|
|
31
32
|
"aws-sdk": "^2.1324.0",
|
|
32
33
|
"bluebird": "^3.7.2",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"convict-format-with-moment": "^6.2.0",
|
|
36
37
|
"convict-format-with-validator": "^6.2.0",
|
|
37
38
|
"elasticsearch": "^15.4.1",
|
|
38
|
-
"elasticsearch-store": "^0.
|
|
39
|
+
"elasticsearch-store": "^0.66.0",
|
|
39
40
|
"js-yaml": "^4.1.0",
|
|
40
41
|
"mongoose": "~6.6.5",
|
|
41
42
|
"nanoid": "^3.3.4",
|