@8ms/helpers 1.42.8 → 1.42.9

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,5 @@
1
- const require_aws_s3_copyFile = require("./copyFile.cjs");
2
1
  const require_aws_s3_deleteFile = require("./deleteFile.cjs");
2
+ const require_aws_s3_copyFile = require("./copyFile.cjs");
3
3
  //#region src/aws/s3/moveFile.ts
4
4
  /**
5
5
  * It's not possible to just move or rename a file, you must copy then delete the old file.
@@ -1,5 +1,5 @@
1
- import copyFile from "./copyFile.mjs";
2
1
  import deleteFile from "./deleteFile.mjs";
2
+ import copyFile from "./copyFile.mjs";
3
3
  //#region src/aws/s3/moveFile.ts
4
4
  /**
5
5
  * It's not possible to just move or rename a file, you must copy then delete the old file.
@@ -1,6 +1,6 @@
1
1
  const require_date_index = require("../../date/index.cjs");
2
- const require_aws_s3_readGzip = require("../s3/readGzip.cjs");
3
2
  const require_aws_s3cache_getKey = require("./getKey.cjs");
3
+ const require_aws_s3_readGzip = require("../s3/readGzip.cjs");
4
4
  //#region src/aws/s3cache/getCache.ts
5
5
  /**
6
6
  * Get the stored cache if it exists.
@@ -1,6 +1,6 @@
1
1
  import { Interval } from "../../date/index.mjs";
2
- import readGzip from "../s3/readGzip.mjs";
3
2
  import getKey from "./getKey.mjs";
3
+ import readGzip from "../s3/readGzip.mjs";
4
4
  //#region src/aws/s3cache/getCache.ts
5
5
  /**
6
6
  * Get the stored cache if it exists.
@@ -1,6 +1,6 @@
1
- const require_aws_s3_deleteFile = require("../s3/deleteFile.cjs");
2
1
  const require_aws_s3cache_getKey = require("./getKey.cjs");
3
2
  const require_aws_s3cache_saveCache = require("./saveCache.cjs");
3
+ const require_aws_s3_deleteFile = require("../s3/deleteFile.cjs");
4
4
  //#region src/aws/s3cache/updateCache.ts
5
5
  /**
6
6
  * Delete other caches if present, then save the new file.
@@ -1,6 +1,6 @@
1
- import deleteFile from "../s3/deleteFile.mjs";
2
1
  import getKey from "./getKey.mjs";
3
2
  import saveCache from "./saveCache.mjs";
3
+ import deleteFile from "../s3/deleteFile.mjs";
4
4
  //#region src/aws/s3cache/updateCache.ts
5
5
  /**
6
6
  * Delete other caches if present, then save the new file.
@@ -6,7 +6,7 @@ const require_google_bigQuery_getClient = require("./getClient.cjs");
6
6
  */
7
7
  const isTableExists = async ({ datasetId, projectId, tableId }) => {
8
8
  let response;
9
- const dataset = require_google_bigQuery_getClient({ projectId }).dataset(datasetId);
9
+ const dataset = (await require_google_bigQuery_getClient({ projectId })).dataset(datasetId);
10
10
  try {
11
11
  await dataset.table(tableId).get();
12
12
  response = true;
@@ -6,7 +6,7 @@ import getClient from "./getClient.mjs";
6
6
  */
7
7
  const isTableExists = async ({ datasetId, projectId, tableId }) => {
8
8
  let response;
9
- const dataset = getClient({ projectId }).dataset(datasetId);
9
+ const dataset = (await getClient({ projectId })).dataset(datasetId);
10
10
  try {
11
11
  await dataset.table(tableId).get();
12
12
  response = true;
@@ -9,7 +9,7 @@ const createDataset = async ({ datasetId, options, projectId }) => {
9
9
  if (!await require_google_bigQuery_isDatasetExists({
10
10
  datasetId,
11
11
  projectId
12
- })) await require_google_bigQuery_getClient({ projectId }).createDataset(datasetId, options || {});
12
+ })) await (await require_google_bigQuery_getClient({ projectId })).createDataset(datasetId, options || {});
13
13
  };
14
14
  //#endregion
15
15
  module.exports = createDataset;
@@ -9,7 +9,7 @@ const createDataset = async ({ datasetId, options, projectId }) => {
9
9
  if (!await isDatasetExists({
10
10
  datasetId,
11
11
  projectId
12
- })) await getClient({ projectId }).createDataset(datasetId, options || {});
12
+ })) await (await getClient({ projectId })).createDataset(datasetId, options || {});
13
13
  };
14
14
  //#endregion
15
15
  export { createDataset as default };
@@ -15,7 +15,7 @@ const createTable = async ({ datasetId, datasetOptions, options, projectId, tabl
15
15
  datasetId,
16
16
  projectId,
17
17
  tableId
18
- })) await require_google_bigQuery_getClient({ projectId }).dataset(datasetId).createTable(tableId, options || {});
18
+ })) await (await require_google_bigQuery_getClient({ projectId })).dataset(datasetId).createTable(tableId, options || {});
19
19
  };
20
20
  //#endregion
21
21
  module.exports = createTable;
@@ -15,7 +15,7 @@ const createTable = async ({ datasetId, datasetOptions, options, projectId, tabl
15
15
  datasetId,
16
16
  projectId,
17
17
  tableId
18
- })) await getClient({ projectId }).dataset(datasetId).createTable(tableId, options || {});
18
+ })) await (await getClient({ projectId })).dataset(datasetId).createTable(tableId, options || {});
19
19
  };
20
20
  //#endregion
21
21
  export { createTable as default };
@@ -5,7 +5,7 @@ const require_google_bigQuery_getClient = require("./getClient.cjs");
5
5
  */
6
6
  const getDatasets = async ({ projectId }) => {
7
7
  let response = [];
8
- const datasets = await require_google_bigQuery_getClient({ projectId }).getDatasets();
8
+ const datasets = await (await require_google_bigQuery_getClient({ projectId })).getDatasets();
9
9
  if (datasets?.[0]) for (let i = 0; i < datasets[0].length; i++) response.push({
10
10
  id: datasets[0][i].id,
11
11
  location: datasets[0][i].location,
@@ -5,7 +5,7 @@ import getClient from "./getClient.mjs";
5
5
  */
6
6
  const getDatasets = async ({ projectId }) => {
7
7
  let response = [];
8
- const datasets = await getClient({ projectId }).getDatasets();
8
+ const datasets = await (await getClient({ projectId })).getDatasets();
9
9
  if (datasets?.[0]) for (let i = 0; i < datasets[0].length; i++) response.push({
10
10
  id: datasets[0][i].id,
11
11
  location: datasets[0][i].location,
@@ -5,7 +5,7 @@ const require_google_bigQuery_getClient = require("./getClient.cjs");
5
5
  */
6
6
  const getTables = async (props) => {
7
7
  let response = [];
8
- const tables = await require_google_bigQuery_getClient({ projectId: props.projectId }).dataset(props.datasetId).getTables();
8
+ const tables = await (await require_google_bigQuery_getClient({ projectId: props.projectId })).dataset(props.datasetId).getTables();
9
9
  if (tables?.[0]) for (let i = 0; i < tables[0].length; i++) response.push({ id: tables[0][i].id });
10
10
  return response;
11
11
  };
@@ -5,7 +5,7 @@ import getClient from "./getClient.mjs";
5
5
  */
6
6
  const getTables = async (props) => {
7
7
  let response = [];
8
- const tables = await getClient({ projectId: props.projectId }).dataset(props.datasetId).getTables();
8
+ const tables = await (await getClient({ projectId: props.projectId })).dataset(props.datasetId).getTables();
9
9
  if (tables?.[0]) for (let i = 0; i < tables[0].length; i++) response.push({ id: tables[0][i].id });
10
10
  return response;
11
11
  };
@@ -7,7 +7,7 @@ const require_google_bigQuery_getClient = require("./getClient.cjs");
7
7
  */
8
8
  const isDatasetExists = async ({ datasetId, projectId }) => {
9
9
  let response;
10
- let client = require_google_bigQuery_getClient({ projectId });
10
+ let client = await require_google_bigQuery_getClient({ projectId });
11
11
  try {
12
12
  await client.dataset(datasetId).get();
13
13
  response = true;
@@ -7,7 +7,7 @@ import getClient from "./getClient.mjs";
7
7
  */
8
8
  const isDatasetExists = async ({ datasetId, projectId }) => {
9
9
  let response;
10
- let client = getClient({ projectId });
10
+ let client = await getClient({ projectId });
11
11
  try {
12
12
  await client.dataset(datasetId).get();
13
13
  response = true;
@@ -4,7 +4,7 @@ const require_google_bigQuery_getClient = require("./getClient.cjs");
4
4
  * Build the query and return the data.
5
5
  */
6
6
  const query = async ({ input, projectId }) => {
7
- return await require_google_bigQuery_getClient({ projectId }).query(input);
7
+ return await (await require_google_bigQuery_getClient({ projectId })).query(input);
8
8
  };
9
9
  //#endregion
10
10
  module.exports = query;
@@ -4,7 +4,7 @@ import getClient from "./getClient.mjs";
4
4
  * Build the query and return the data.
5
5
  */
6
6
  const query = async ({ input, projectId }) => {
7
- return await getClient({ projectId }).query(input);
7
+ return await (await getClient({ projectId })).query(input);
8
8
  };
9
9
  //#endregion
10
10
  export { query as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "1.42.8",
4
+ "version": "1.42.9",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"