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: typeof 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":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,iBAAS,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG;IAChE,MAAM,EAAE,GAAG,CAAC;CACf,CA6BA;;;qBAIoB,OAAO,MAAM,EAAE,GAAG,CAAC;;AAFxC,wBAuDE"}
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 fs_1 = __importDefault(require("fs"));
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":";;;;;AAAA,4CAAoB;AACpB,kDAA0B;AAE1B,uCAAwC;AAExC,SAAS,MAAM,CAAC,YAAiC,EAAE,MAAc;IAG7D,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEzC,MAAM,CAAC,IAAI,CAAC,sBAAsB,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE3D,gGAAgG;IAChG,2FAA2F;IAC3F,IAAI,YAAY,CAAC,UAAU,EAAE;QACzB,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YACxC,MAAM,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EAAE,IAAI;gBACb,MAAM,EAAE,OAAO;aAClB;YACD,YAAY,EAAE;gBACV,GAAG,EAAE,gEAAgE;gBACrE,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE,MAAM;aACjB;YACD,gBAAgB,EAAE;gBACd,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,OAAO;aAClB;YACD,gBAAgB,EAAE;gBACd,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,OAAO;aAClB;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
1
+ {"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../src/connectors/s3.ts"],"names":[],"mappings":";;AACA,gEAA4D;AAE5D,kBAAe;IACX,MAAM;QACF,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;IAC5G,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,YAAiC,EAAE,MAAc;QAChE,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAc,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC;IACD,aAAa;QACT,OAAO;YACH,QAAQ,EAAE;gBACN,GAAG,EAAE,oBAAoB;gBACzB,OAAO,EAAE,cAAc;aAC1B;YACD,WAAW,EAAE;gBACT,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,MAAM;aACjB;YACD,eAAe,EAAE;gBACb,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,MAAM;aACjB;YACD,MAAM,EAAE;gBACJ,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,WAAW;gBACpB,MAAM,EAAE,MAAM;aACjB;YACD,UAAU,EAAE;gBACR,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,CAAC;gBACV,MAAM,EAAE,MAAM;aACjB;YACD,YAAY,EAAE;gBACV,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE,MAAM;aACjB;YACD,UAAU,EAAE;gBACR,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,OAAO;aAClB;YACD,YAAY,EAAE;gBACV,GAAG,EAAE,gEAAgE;gBACrE,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE,MAAM;aACjB;YACD,gBAAgB,EAAE;gBACd,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,OAAO;aAClB;YACD,gBAAgB,EAAE;gBACd,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,OAAO;aAClB;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "terafoundation",
3
3
  "displayName": "Terafoundation",
4
- "version": "0.42.5",
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.65.5",
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",