@8ms/helpers 1.1.89 → 1.1.91

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.
@@ -10,7 +10,6 @@ global.awsAthenaExpressClient = null;
10
10
  */
11
11
  const initClient = ({ config, database, s3Bucket, s3Key }) => {
12
12
  if (!global.awsAthenaExpressClient) {
13
- console.log('athenaExpress/initClient');
14
13
  const athenaExpress = require('athena-express');
15
14
  const awsSdk = require('aws-sdk');
16
15
  const formattedConfig = (0, getConfig_1.default)({ config, isAthenaExpress: true });
@@ -1,11 +1,11 @@
1
1
  declare type WriteFile = {
2
2
  bucket: string;
3
- credentials: any;
4
3
  data: any;
5
4
  key: string;
5
+ metadata?: object;
6
6
  };
7
7
  /**
8
8
  * Write a file to Google Cloud Storage.
9
9
  */
10
- export declare const writeFile: ({ bucket, data, key }: WriteFile) => Promise<any>;
10
+ export declare const writeFile: ({ bucket, data, key, metadata }: WriteFile) => Promise<any>;
11
11
  export default writeFile;
@@ -4,7 +4,7 @@ exports.writeFile = void 0;
4
4
  /**
5
5
  * Write a file to Google Cloud Storage.
6
6
  */
7
- const writeFile = async ({ bucket, data, key }) => {
7
+ const writeFile = async ({ bucket, data, key, metadata }) => {
8
8
  const stream = require('stream');
9
9
  const dataStream = new stream.PassThrough();
10
10
  const googleFile = global.googleStorageClient.bucket(bucket)
@@ -16,7 +16,7 @@ const writeFile = async ({ bucket, data, key }) => {
16
16
  contentType: 'auto',
17
17
  resumable: false,
18
18
  validation: false,
19
- metadata: {},
19
+ metadata: undefined === metadata ? {} : metadata,
20
20
  }))
21
21
  .on('error', (error) => {
22
22
  reject(error);
package/initClients.js CHANGED
@@ -20,9 +20,7 @@ const initClient_12 = __importDefault(require("./prisma/initClient"));
20
20
  * Function to simplify initialising the clients.
21
21
  */
22
22
  const initClients = async ({ athenaExpress, awsConfig, awsGlue, awsLambda, awsS3, awsSes, awsSsm, deepcrawlApi, googleAds, googleConfig, googleBigQuery, googleSheets, googleStorage, prisma, }) => {
23
- console.log('athenaExpress', athenaExpress);
24
23
  if (athenaExpress) {
25
- console.log('loading athena express?');
26
24
  (0, initClient_1.default)({
27
25
  config: awsConfig,
28
26
  database: athenaExpress.database,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "1.1.89",
4
+ "version": "1.1.91",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"