@8ms/helpers 1.1.57 → 1.1.58

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,10 +1,12 @@
1
1
  import { Config } from '../config';
2
+ declare type InitClient = {
3
+ config: Config;
4
+ database: string;
5
+ s3Bucket: string;
6
+ s3Key: string;
7
+ };
2
8
  /**
3
9
  * Initialise the database using manually provided credentials.
4
10
  */
5
- declare const initClient: ({ athenaS3, config, database }: {
6
- athenaS3?: string;
7
- config?: Config;
8
- database?: string;
9
- }) => void;
11
+ declare const initClient: ({ config, database, s3Bucket, s3Key }: InitClient) => void;
10
12
  export default initClient;
@@ -9,7 +9,7 @@ global.awsAthenaExpressClient = null;
9
9
  * Initialise the database using manually provided credentials.
10
10
  */
11
11
  var initClient = function (_a) {
12
- var athenaS3 = _a.athenaS3, config = _a.config, database = _a.database;
12
+ var config = _a.config, database = _a.database, s3Bucket = _a.s3Bucket, s3Key = _a.s3Key;
13
13
  if (!global.awsAthenaExpressClient) {
14
14
  var athenaExpress = require('athena-express');
15
15
  var awsSdk = require('aws-sdk');
@@ -18,7 +18,7 @@ var initClient = function (_a) {
18
18
  awsSdk.config.update(formattedConfig);
19
19
  global.awsAthenaExpressClient = new athenaExpress.AthenaExpress({
20
20
  aws: awsSdk,
21
- s3: athenaS3,
21
+ s3: "s3://".concat(s3Bucket, "/").concat(s3Key),
22
22
  db: database,
23
23
  formatJson: true,
24
24
  retry: 200,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "1.1.57",
4
+ "version": "1.1.58",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"