@8ms/helpers 1.3.3 → 1.3.4

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,5 +1,6 @@
1
1
  import { Config } from '../getConfig';
2
2
  type InitClient = {
3
+ options?: object;
3
4
  parameter: Config;
4
5
  projectId: string;
5
6
  };
@@ -7,5 +8,5 @@ type InitClient = {
7
8
  * Initialise the Big Query client.
8
9
  * It's possible to use multiple clients, so we set one up per project id.
9
10
  */
10
- declare const initClient: ({ parameter, projectId }: InitClient) => void;
11
+ declare const initClient: ({ options, parameter, projectId }: InitClient) => void;
11
12
  export default initClient;
@@ -13,7 +13,7 @@ global.googleBigQueryClient = null;
13
13
  * Initialise the Big Query client.
14
14
  * It's possible to use multiple clients, so we set one up per project id.
15
15
  */
16
- const initClient = ({ parameter, projectId }) => {
16
+ const initClient = ({ options, parameter, projectId }) => {
17
17
  if (!global.googleBigQueryClient) {
18
18
  const { BigQuery } = require('@google-cloud/bigquery');
19
19
  const formattedConfig = (0, getConfig_1.default)({ parameter });
@@ -22,6 +22,7 @@ const initClient = ({ parameter, projectId }) => {
22
22
  global.googleBigQueryClient = new BigQuery({
23
23
  credentials: global.googleBigQueryDefault.credentials,
24
24
  projectId: global.googleBigQueryDefault.projectId,
25
+ ...options || {},
25
26
  });
26
27
  }
27
28
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "1.3.3",
4
+ "version": "1.3.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"