@8ms/helpers 1.42.7 → 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.
Files changed (165) hide show
  1. package/dist/aws/athenaExpress/initClient.cjs +3 -3
  2. package/dist/aws/athenaExpress/initClient.mjs +3 -4
  3. package/dist/aws/ec2/initClient.cjs +2 -2
  4. package/dist/aws/ec2/initClient.d.cts +1 -1
  5. package/dist/aws/ec2/initClient.d.mts +1 -1
  6. package/dist/aws/ec2/initClient.mjs +2 -3
  7. package/dist/aws/ec2/startInstances.cjs +1 -1
  8. package/dist/aws/ec2/startInstances.mjs +1 -2
  9. package/dist/aws/ec2/stopInstances.cjs +1 -1
  10. package/dist/aws/ec2/stopInstances.mjs +1 -2
  11. package/dist/aws/ecs/getClusters.cjs +1 -1
  12. package/dist/aws/ecs/getClusters.mjs +1 -2
  13. package/dist/aws/ecs/getTaskDefinitions.cjs +1 -1
  14. package/dist/aws/ecs/getTaskDefinitions.mjs +1 -2
  15. package/dist/aws/ecs/getTasks.cjs +1 -1
  16. package/dist/aws/ecs/getTasks.mjs +1 -2
  17. package/dist/aws/ecs/initClient.cjs +2 -2
  18. package/dist/aws/ecs/initClient.d.cts +1 -1
  19. package/dist/aws/ecs/initClient.d.mts +1 -1
  20. package/dist/aws/ecs/initClient.mjs +2 -3
  21. package/dist/aws/ecs/runTask.cjs +1 -1
  22. package/dist/aws/ecs/runTask.mjs +1 -2
  23. package/dist/aws/glue/initClient.cjs +2 -2
  24. package/dist/aws/glue/initClient.d.cts +1 -1
  25. package/dist/aws/glue/initClient.d.mts +1 -1
  26. package/dist/aws/glue/initClient.mjs +2 -3
  27. package/dist/aws/glue/invoke.cjs +1 -1
  28. package/dist/aws/glue/invoke.mjs +1 -2
  29. package/dist/aws/lambda/initClient.cjs +2 -2
  30. package/dist/aws/lambda/initClient.d.cts +1 -1
  31. package/dist/aws/lambda/initClient.d.mts +1 -1
  32. package/dist/aws/lambda/initClient.mjs +2 -3
  33. package/dist/aws/lambda/invoke.cjs +1 -1
  34. package/dist/aws/lambda/invoke.mjs +1 -2
  35. package/dist/aws/s3/copyFile.cjs +1 -1
  36. package/dist/aws/s3/copyFile.mjs +1 -2
  37. package/dist/aws/s3/deleteFile.cjs +1 -1
  38. package/dist/aws/s3/deleteFile.mjs +1 -2
  39. package/dist/aws/s3/deleteFiles.cjs +1 -1
  40. package/dist/aws/s3/deleteFiles.mjs +1 -2
  41. package/dist/aws/s3/deleteFolder.cjs +1 -1
  42. package/dist/aws/s3/deleteFolder.mjs +1 -2
  43. package/dist/aws/s3/getPresignedPost.cjs +1 -1
  44. package/dist/aws/s3/getPresignedPost.mjs +1 -2
  45. package/dist/aws/s3/getSignedUrl.cjs +2 -2
  46. package/dist/aws/s3/getSignedUrl.d.cts +1 -3
  47. package/dist/aws/s3/getSignedUrl.d.mts +1 -3
  48. package/dist/aws/s3/getSignedUrl.mjs +2 -3
  49. package/dist/aws/s3/initClient.cjs +2 -2
  50. package/dist/aws/s3/initClient.d.cts +1 -1
  51. package/dist/aws/s3/initClient.d.mts +1 -1
  52. package/dist/aws/s3/initClient.mjs +2 -3
  53. package/dist/aws/s3/isFileExists.cjs +1 -1
  54. package/dist/aws/s3/isFileExists.mjs +1 -2
  55. package/dist/aws/s3/listFiles.cjs +1 -1
  56. package/dist/aws/s3/listFiles.mjs +1 -2
  57. package/dist/aws/s3/listFolders.cjs +1 -1
  58. package/dist/aws/s3/listFolders.mjs +1 -2
  59. package/dist/aws/s3/moveFile.cjs +1 -1
  60. package/dist/aws/s3/moveFile.mjs +1 -1
  61. package/dist/aws/s3/readBuffer.cjs +1 -1
  62. package/dist/aws/s3/readBuffer.mjs +1 -2
  63. package/dist/aws/s3/readFile.cjs +1 -1
  64. package/dist/aws/s3/readFile.mjs +1 -2
  65. package/dist/aws/s3/writeFile.cjs +1 -1
  66. package/dist/aws/s3/writeFile.mjs +1 -2
  67. package/dist/aws/s3cache/getCache.cjs +1 -1
  68. package/dist/aws/s3cache/getCache.mjs +1 -1
  69. package/dist/aws/s3cache/updateCache.cjs +1 -1
  70. package/dist/aws/s3cache/updateCache.mjs +1 -1
  71. package/dist/aws/ses/SimpleEmail.cjs +1 -1
  72. package/dist/aws/ses/SimpleEmail.mjs +1 -2
  73. package/dist/aws/ses/initClient.cjs +2 -2
  74. package/dist/aws/ses/initClient.d.cts +1 -1
  75. package/dist/aws/ses/initClient.d.mts +1 -1
  76. package/dist/aws/ses/initClient.mjs +2 -3
  77. package/dist/aws/sqs/addToQueue.cjs +1 -1
  78. package/dist/aws/sqs/addToQueue.mjs +1 -2
  79. package/dist/aws/sqs/deleteFromQueue.cjs +1 -1
  80. package/dist/aws/sqs/deleteFromQueue.mjs +1 -2
  81. package/dist/aws/sqs/initClient.cjs +2 -2
  82. package/dist/aws/sqs/initClient.d.cts +1 -1
  83. package/dist/aws/sqs/initClient.d.mts +1 -1
  84. package/dist/aws/sqs/initClient.mjs +2 -3
  85. package/dist/aws/ssm/getParameter.cjs +1 -1
  86. package/dist/aws/ssm/getParameter.mjs +1 -2
  87. package/dist/aws/ssm/initClient.cjs +2 -2
  88. package/dist/aws/ssm/initClient.d.cts +1 -1
  89. package/dist/aws/ssm/initClient.d.mts +1 -1
  90. package/dist/aws/ssm/initClient.mjs +2 -3
  91. package/dist/crypto/getDecrypt.cjs +2 -2
  92. package/dist/crypto/getDecrypt.d.cts +1 -1
  93. package/dist/crypto/getDecrypt.d.mts +1 -1
  94. package/dist/crypto/getDecrypt.mjs +2 -3
  95. package/dist/crypto/getEncrypt.cjs +2 -2
  96. package/dist/crypto/getEncrypt.d.cts +1 -1
  97. package/dist/crypto/getEncrypt.d.mts +1 -1
  98. package/dist/crypto/getEncrypt.mjs +2 -3
  99. package/dist/crypto/getSha256.cjs +2 -2
  100. package/dist/crypto/getSha256.d.cts +1 -1
  101. package/dist/crypto/getSha256.d.mts +1 -1
  102. package/dist/crypto/getSha256.mjs +2 -3
  103. package/dist/file/createDirectory.cjs +2 -2
  104. package/dist/file/createDirectory.mjs +2 -3
  105. package/dist/google/bigQuery/IsTableExists.cjs +1 -1
  106. package/dist/google/bigQuery/IsTableExists.mjs +1 -1
  107. package/dist/google/bigQuery/createDataset.cjs +1 -1
  108. package/dist/google/bigQuery/createDataset.mjs +1 -1
  109. package/dist/google/bigQuery/createTable.cjs +1 -1
  110. package/dist/google/bigQuery/createTable.mjs +1 -1
  111. package/dist/google/bigQuery/getClient.cjs +2 -2
  112. package/dist/google/bigQuery/getClient.d.cts +1 -1
  113. package/dist/google/bigQuery/getClient.d.mts +1 -1
  114. package/dist/google/bigQuery/getClient.mjs +2 -3
  115. package/dist/google/bigQuery/getDatasets.cjs +1 -1
  116. package/dist/google/bigQuery/getDatasets.mjs +1 -1
  117. package/dist/google/bigQuery/getTables.cjs +1 -1
  118. package/dist/google/bigQuery/getTables.mjs +1 -1
  119. package/dist/google/bigQuery/initClient.cjs +2 -2
  120. package/dist/google/bigQuery/initClient.d.cts +1 -1
  121. package/dist/google/bigQuery/initClient.d.mts +1 -1
  122. package/dist/google/bigQuery/initClient.mjs +2 -3
  123. package/dist/google/bigQuery/isDatasetExists.cjs +1 -1
  124. package/dist/google/bigQuery/isDatasetExists.mjs +1 -1
  125. package/dist/google/bigQuery/query.cjs +1 -1
  126. package/dist/google/bigQuery/query.mjs +1 -1
  127. package/dist/google/sheets/getBatchData.cjs +1 -1
  128. package/dist/google/sheets/getBatchData.mjs +1 -2
  129. package/dist/google/sheets/initClient.cjs +2 -2
  130. package/dist/google/sheets/initClient.d.cts +1 -1
  131. package/dist/google/sheets/initClient.d.mts +1 -1
  132. package/dist/google/sheets/initClient.mjs +2 -3
  133. package/dist/google/storage/copyToCloud.cjs +1 -1
  134. package/dist/google/storage/copyToCloud.mjs +1 -1
  135. package/dist/google/storage/getClient.cjs +2 -3
  136. package/dist/google/storage/getClient.d.cts +1 -1
  137. package/dist/google/storage/getClient.d.mts +1 -1
  138. package/dist/google/storage/getClient.mjs +2 -4
  139. package/dist/google/storage/initClient.cjs +2 -2
  140. package/dist/google/storage/initClient.d.cts +1 -1
  141. package/dist/google/storage/initClient.d.mts +1 -1
  142. package/dist/google/storage/initClient.mjs +2 -3
  143. package/dist/google/storage/isFileExists.cjs +1 -1
  144. package/dist/google/storage/isFileExists.mjs +1 -1
  145. package/dist/google/storage/writeFile.cjs +2 -2
  146. package/dist/google/storage/writeFile.mjs +2 -3
  147. package/dist/googleAds/initClient.cjs +1 -1
  148. package/dist/googleAds/initClient.mjs +1 -2
  149. package/dist/initClients.cjs +16 -16
  150. package/dist/initClients.d.cts +1 -1
  151. package/dist/initClients.d.mts +1 -1
  152. package/dist/initClients.mjs +16 -16
  153. package/dist/prisma/initClient.cjs +4 -4
  154. package/dist/prisma/initClient.d.cts +1 -1
  155. package/dist/prisma/initClient.d.mts +1 -1
  156. package/dist/prisma/initClient.mjs +4 -5
  157. package/dist/util/getBrotliCompressed.cjs +2 -2
  158. package/dist/util/getBrotliCompressed.mjs +2 -3
  159. package/dist/util/getBrotliDecompressed.cjs +2 -2
  160. package/dist/util/getBrotliDecompressed.mjs +2 -3
  161. package/dist/util/getGzipCompressed.cjs +2 -2
  162. package/dist/util/getGzipCompressed.mjs +2 -3
  163. package/dist/util/getGzipDecompressed.cjs +2 -2
  164. package/dist/util/getGzipDecompressed.mjs +2 -3
  165. package/package.json +6 -1
@@ -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 };
@@ -2,10 +2,10 @@
2
2
  /**
3
3
  * Create a new client if the project id differs from the global.
4
4
  */
5
- const getClient = (props) => {
5
+ const getClient = async (props) => {
6
6
  let client = global.googleBigQueryClient;
7
7
  if (props?.projectId && props?.projectId !== global.googleBigQueryDefaultProjectId) {
8
- const { BigQuery } = require("@google-cloud/bigquery");
8
+ const { BigQuery } = await import("@google-cloud/bigquery");
9
9
  client = new BigQuery({
10
10
  credentials: global.googleBigQueryDefault.credentials,
11
11
  location: props?.location || "europe-west2",
@@ -6,5 +6,5 @@ type GetClient = {
6
6
  /**
7
7
  * Create a new client if the project id differs from the global.
8
8
  */
9
- declare const getClient: (props: GetClient) => any;
9
+ declare const getClient: (props: GetClient) => Promise<any>;
10
10
  export = getClient;
@@ -6,6 +6,6 @@ type GetClient = {
6
6
  /**
7
7
  * Create a new client if the project id differs from the global.
8
8
  */
9
- declare const getClient: (props: GetClient) => any;
9
+ declare const getClient: (props: GetClient) => Promise<any>;
10
10
  //#endregion
11
11
  export { getClient as default };
@@ -1,12 +1,11 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/google/bigQuery/getClient.ts
3
2
  /**
4
3
  * Create a new client if the project id differs from the global.
5
4
  */
6
- const getClient = (props) => {
5
+ const getClient = async (props) => {
7
6
  let client = global.googleBigQueryClient;
8
7
  if (props?.projectId && props?.projectId !== global.googleBigQueryDefaultProjectId) {
9
- const { BigQuery } = __require("@google-cloud/bigquery");
8
+ const { BigQuery } = await import("@google-cloud/bigquery");
10
9
  client = new BigQuery({
11
10
  credentials: global.googleBigQueryDefault.credentials,
12
11
  location: props?.location || "europe-west2",
@@ -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
  };
@@ -9,9 +9,9 @@ global.googleBigQueryClient = null;
9
9
  * Initialise the Big Query client.
10
10
  * It's possible to use multiple clients, so we set one up per project id.
11
11
  */
12
- const initClient = ({ parameter, projectId }) => {
12
+ const initClient = async ({ parameter, projectId }) => {
13
13
  if (!global.googleBigQueryClient) {
14
- const { BigQuery } = require("@google-cloud/bigquery");
14
+ const { BigQuery } = await import("@google-cloud/bigquery");
15
15
  const formattedConfig = require_google_getConfig({ parameter });
16
16
  global.googleBigQueryDefault.credentials = formattedConfig;
17
17
  global.googleBigQueryDefault.projectId = projectId;
@@ -12,5 +12,5 @@ type InitClient = {
12
12
  declare const initClient: ({
13
13
  parameter,
14
14
  projectId
15
- }: InitClient) => void;
15
+ }: InitClient) => Promise<void>;
16
16
  export = initClient;
@@ -12,6 +12,6 @@ type InitClient = {
12
12
  declare const initClient: ({
13
13
  parameter,
14
14
  projectId
15
- }: InitClient) => void;
15
+ }: InitClient) => Promise<void>;
16
16
  //#endregion
17
17
  export { initClient as default };
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getConfig from "../getConfig.mjs";
3
2
  //#region src/google/bigQuery/initClient.ts
4
3
  global.googleBigQueryDefault = {
@@ -10,9 +9,9 @@ global.googleBigQueryClient = null;
10
9
  * Initialise the Big Query client.
11
10
  * It's possible to use multiple clients, so we set one up per project id.
12
11
  */
13
- const initClient = ({ parameter, projectId }) => {
12
+ const initClient = async ({ parameter, projectId }) => {
14
13
  if (!global.googleBigQueryClient) {
15
- const { BigQuery } = __require("@google-cloud/bigquery");
14
+ const { BigQuery } = await import("@google-cloud/bigquery");
16
15
  const formattedConfig = getConfig({ parameter });
17
16
  global.googleBigQueryDefault.credentials = formattedConfig;
18
17
  global.googleBigQueryDefault.projectId = projectId;
@@ -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 };
@@ -1,6 +1,6 @@
1
1
  //#region src/google/sheets/getBatchData.ts
2
2
  const getBatchData = async ({ spreadsheetId, ranges, dateTimeRender = "FORMATTED_STRING", valueRender = "UNFORMATTED_VALUE" }) => {
3
- const googleApisSheets = require("@googleapis/sheets");
3
+ const googleApisSheets = await import("@googleapis/sheets");
4
4
  const request = {
5
5
  auth: global.googleSheetsClient,
6
6
  dateTimeRenderOption: dateTimeRender,
@@ -1,7 +1,6 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/google/sheets/getBatchData.ts
3
2
  const getBatchData = async ({ spreadsheetId, ranges, dateTimeRender = "FORMATTED_STRING", valueRender = "UNFORMATTED_VALUE" }) => {
4
- const googleApisSheets = __require("@googleapis/sheets");
3
+ const googleApisSheets = await import("@googleapis/sheets");
5
4
  const request = {
6
5
  auth: global.googleSheetsClient,
7
6
  dateTimeRenderOption: dateTimeRender,
@@ -6,9 +6,9 @@ global.googleSheetsClient = null;
6
6
  * https://github.com/googleapis/google-api-nodejs-client
7
7
  * Library: @googleapis/sheets
8
8
  */
9
- const initClient = ({ parameter }) => {
9
+ const initClient = async ({ parameter }) => {
10
10
  if (!global.googleSheetsClient) {
11
- const googleApisSheets = require("@googleapis/sheets");
11
+ const googleApisSheets = await import("@googleapis/sheets");
12
12
  const formattedConfig = require_google_getConfig({ parameter });
13
13
  global.googleSheetsClient = new googleApisSheets.auth.GoogleAuth({
14
14
  credentials: formattedConfig,
@@ -11,5 +11,5 @@ type InitClient = {
11
11
  */
12
12
  declare const initClient: ({
13
13
  parameter
14
- }: InitClient) => void;
14
+ }: InitClient) => Promise<void>;
15
15
  export = initClient;
@@ -11,6 +11,6 @@ type InitClient = {
11
11
  */
12
12
  declare const initClient: ({
13
13
  parameter
14
- }: InitClient) => void;
14
+ }: InitClient) => Promise<void>;
15
15
  //#endregion
16
16
  export { initClient as default };
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getConfig from "../getConfig.mjs";
3
2
  //#region src/google/sheets/initClient.ts
4
3
  global.googleSheetsClient = null;
@@ -7,9 +6,9 @@ global.googleSheetsClient = null;
7
6
  * https://github.com/googleapis/google-api-nodejs-client
8
7
  * Library: @googleapis/sheets
9
8
  */
10
- const initClient = ({ parameter }) => {
9
+ const initClient = async ({ parameter }) => {
11
10
  if (!global.googleSheetsClient) {
12
- const googleApisSheets = __require("@googleapis/sheets");
11
+ const googleApisSheets = await import("@googleapis/sheets");
13
12
  const formattedConfig = getConfig({ parameter });
14
13
  global.googleSheetsClient = new googleApisSheets.auth.GoogleAuth({
15
14
  credentials: formattedConfig,
@@ -8,7 +8,7 @@ const require_google_storage_getClient = require("./getClient.cjs");
8
8
  * Copy a local file to Google Cloud Storage.
9
9
  */
10
10
  const copyToCloud = async ({ bucket, localFile, options, projectId }) => {
11
- return await require_google_storage_getClient({ projectId }).bucket(bucket).upload(localFile, options);
11
+ return await (await require_google_storage_getClient({ projectId })).bucket(bucket).upload(localFile, options);
12
12
  };
13
13
  //#endregion
14
14
  exports.copyToCloud = copyToCloud;
@@ -4,7 +4,7 @@ import getClient from "./getClient.mjs";
4
4
  * Copy a local file to Google Cloud Storage.
5
5
  */
6
6
  const copyToCloud = async ({ bucket, localFile, options, projectId }) => {
7
- return await getClient({ projectId }).bucket(bucket).upload(localFile, options);
7
+ return await (await getClient({ projectId })).bucket(bucket).upload(localFile, options);
8
8
  };
9
9
  //#endregion
10
10
  export { copyToCloud, copyToCloud as default };
@@ -2,13 +2,12 @@
2
2
  /**
3
3
  * Create a new client if the project id differs from the global.
4
4
  */
5
- const getClient = ({ projectId }) => {
5
+ const getClient = async ({ projectId }) => {
6
6
  let client = global.googleStorageClient;
7
7
  if (void 0 !== projectId && projectId !== global.googleStorageDefault.projectId) {
8
- const { Storage } = require("@google-cloud/storage");
8
+ const { Storage } = await import("@google-cloud/storage");
9
9
  client = new Storage({
10
10
  credentials: global.googleStorageDefault.credentials,
11
- location: "europe-west2",
12
11
  projectId
13
12
  });
14
13
  }
@@ -7,5 +7,5 @@ type GetClient = {
7
7
  */
8
8
  declare const getClient: ({
9
9
  projectId
10
- }: GetClient) => any;
10
+ }: GetClient) => Promise<any>;
11
11
  export = getClient;
@@ -7,6 +7,6 @@ type GetClient = {
7
7
  */
8
8
  declare const getClient: ({
9
9
  projectId
10
- }: GetClient) => any;
10
+ }: GetClient) => Promise<any>;
11
11
  //#endregion
12
12
  export { getClient as default };
@@ -1,15 +1,13 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/google/storage/getClient.ts
3
2
  /**
4
3
  * Create a new client if the project id differs from the global.
5
4
  */
6
- const getClient = ({ projectId }) => {
5
+ const getClient = async ({ projectId }) => {
7
6
  let client = global.googleStorageClient;
8
7
  if (void 0 !== projectId && projectId !== global.googleStorageDefault.projectId) {
9
- const { Storage } = __require("@google-cloud/storage");
8
+ const { Storage } = await import("@google-cloud/storage");
10
9
  client = new Storage({
11
10
  credentials: global.googleStorageDefault.credentials,
12
- location: "europe-west2",
13
11
  projectId
14
12
  });
15
13
  }
@@ -10,9 +10,9 @@ global.googleStorageClient = null;
10
10
  * https://github.com/googleapis/google-api-nodejs-client
11
11
  * Library: @googleapis/sheets
12
12
  */
13
- const initClient = ({ parameter, projectId }) => {
13
+ const initClient = async ({ parameter, projectId }) => {
14
14
  if (!global.googleStorageClient) {
15
- const { Storage } = require("@google-cloud/storage");
15
+ const { Storage } = await import("@google-cloud/storage");
16
16
  const formattedConfig = require_google_getConfig({ parameter });
17
17
  global.googleStorageDefault.credentials = formattedConfig;
18
18
  global.googleStorageDefault.projectId = projectId;
@@ -13,5 +13,5 @@ type InitClient = {
13
13
  declare const initClient: ({
14
14
  parameter,
15
15
  projectId
16
- }: InitClient) => void;
16
+ }: InitClient) => Promise<void>;
17
17
  export = initClient;
@@ -13,6 +13,6 @@ type InitClient = {
13
13
  declare const initClient: ({
14
14
  parameter,
15
15
  projectId
16
- }: InitClient) => void;
16
+ }: InitClient) => Promise<void>;
17
17
  //#endregion
18
18
  export { initClient as default };
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getConfig from "../getConfig.mjs";
3
2
  //#region src/google/storage/initClient.ts
4
3
  global.googleStorageDefault = {
@@ -11,9 +10,9 @@ global.googleStorageClient = null;
11
10
  * https://github.com/googleapis/google-api-nodejs-client
12
11
  * Library: @googleapis/sheets
13
12
  */
14
- const initClient = ({ parameter, projectId }) => {
13
+ const initClient = async ({ parameter, projectId }) => {
15
14
  if (!global.googleStorageClient) {
16
- const { Storage } = __require("@google-cloud/storage");
15
+ const { Storage } = await import("@google-cloud/storage");
17
16
  const formattedConfig = getConfig({ parameter });
18
17
  global.googleStorageDefault.credentials = formattedConfig;
19
18
  global.googleStorageDefault.projectId = projectId;
@@ -5,7 +5,7 @@ const require_google_storage_getClient = require("./getClient.cjs");
5
5
  */
6
6
  const isFileExists = async (props) => {
7
7
  const { bucket, key, projectId } = props;
8
- return (await require_google_storage_getClient({ projectId }).bucket(bucket).file(key).exists())?.[0];
8
+ return (await require_google_storage_getClient({ projectId })).bucket(bucket).file(key).exists()?.[0];
9
9
  };
10
10
  //#endregion
11
11
  module.exports = isFileExists;
@@ -5,7 +5,7 @@ import getClient from "./getClient.mjs";
5
5
  */
6
6
  const isFileExists = async (props) => {
7
7
  const { bucket, key, projectId } = props;
8
- return (await getClient({ projectId }).bucket(bucket).file(key).exists())?.[0];
8
+ return (await getClient({ projectId })).bucket(bucket).file(key).exists()?.[0];
9
9
  };
10
10
  //#endregion
11
11
  export { isFileExists as default };
@@ -9,8 +9,8 @@ const require_google_storage_getClient = require("./getClient.cjs");
9
9
  */
10
10
  const writeFile = async (props) => {
11
11
  const { bucket, contentType, data, key, projectId, ...options } = props;
12
- const dataStream = new (require("stream")).PassThrough();
13
- const googleFile = require_google_storage_getClient({ projectId }).bucket(bucket).file(key);
12
+ const dataStream = new (await (import("stream"))).PassThrough();
13
+ const googleFile = (await require_google_storage_getClient({ projectId })).bucket(bucket).file(key);
14
14
  dataStream.push(data);
15
15
  dataStream.push(null);
16
16
  return await new Promise((resolve, reject) => {
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getClient from "./getClient.mjs";
3
2
  //#region src/google/storage/writeFile.ts
4
3
  /**
@@ -6,8 +5,8 @@ import getClient from "./getClient.mjs";
6
5
  */
7
6
  const writeFile = async (props) => {
8
7
  const { bucket, contentType, data, key, projectId, ...options } = props;
9
- const dataStream = new (__require("stream")).PassThrough();
10
- const googleFile = getClient({ projectId }).bucket(bucket).file(key);
8
+ const dataStream = new (await (import("stream"))).PassThrough();
9
+ const googleFile = (await getClient({ projectId })).bucket(bucket).file(key);
11
10
  dataStream.push(data);
12
11
  dataStream.push(null);
13
12
  return await new Promise((resolve, reject) => {
@@ -10,7 +10,7 @@ global.googleAdsClient = {
10
10
  */
11
11
  const initClient = async ({ parameter }) => {
12
12
  if (!global.googleAdsClient.instance) {
13
- const { GoogleAdsApi } = require("google-ads-api");
13
+ const { GoogleAdsApi } = await import("google-ads-api");
14
14
  global.googleAdsClient.instance = new GoogleAdsApi({
15
15
  client_id: parameter.clientId,
16
16
  client_secret: parameter.clientSecret,
@@ -1,4 +1,3 @@
1
- import { __require } from "../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/googleAds/initClient.ts
3
2
  global.googleAdsClient = {
4
3
  instance: null,
@@ -11,7 +10,7 @@ global.googleAdsClient = {
11
10
  */
12
11
  const initClient = async ({ parameter }) => {
13
12
  if (!global.googleAdsClient.instance) {
14
- const { GoogleAdsApi } = __require("google-ads-api");
13
+ const { GoogleAdsApi } = await import("google-ads-api");
15
14
  global.googleAdsClient.instance = new GoogleAdsApi({
16
15
  client_id: parameter.clientId,
17
16
  client_secret: parameter.clientSecret,
@@ -16,38 +16,38 @@ const require_googleAds_initClient = require("./googleAds/initClient.cjs");
16
16
  const require_prisma_initClient = require("./prisma/initClient.cjs");
17
17
  //#region src/initClients.ts
18
18
  /**
19
- * Function to simplify initialising the clients.
19
+ * Function to simplify await initialising the clients.
20
20
  */
21
21
  const initClients = async (props) => {
22
- if (props?.athenaExpress) require_aws_athenaExpress_initClient({
22
+ if (props?.athenaExpress) await require_aws_athenaExpress_initClient({
23
23
  config: props.awsConfig,
24
24
  database: props.athenaExpress.database,
25
25
  s3Bucket: props.athenaExpress.s3Bucket,
26
26
  s3Key: props.athenaExpress.s3Key
27
27
  });
28
- if (props?.awsEc2) require_aws_ec2_initClient.initClient({ config: props.awsConfig });
29
- if (props?.awsEcs) require_aws_ecs_initClient.initClient({ config: props.awsConfig });
30
- if (props?.awsGlue) require_aws_glue_initClient({ config: props.awsConfig });
31
- if (props?.awsLambda) require_aws_lambda_initClient({ config: props.awsConfig });
32
- if (props?.awsS3) require_aws_s3_initClient({ config: props.awsConfig });
33
- if (props?.awsSes) require_aws_ses_initClient({ config: props.awsConfig });
34
- if (props?.awsSsm || props?.lumarApi || props?.lumarGraphql || props?.googleAds || props?.googleConfig) require_aws_ssm_initClient({ config: props.awsConfig });
35
- if (props?.lumarApi) await require_lumar_api_initClient({ auth: await require_aws_ssm_getParameter({ name: props.lumarApi.parameterName }) });
36
- if (props?.lumarGraphql) await require_lumar_graphql_initClient({ auth: await require_aws_ssm_getParameter({ name: props.lumarGraphql.parameterName }) });
28
+ if (props?.awsEc2) await require_aws_ec2_initClient.initClient({ config: props.awsConfig });
29
+ if (props?.awsEcs) await require_aws_ecs_initClient.initClient({ config: props.awsConfig });
30
+ if (props?.awsGlue) await require_aws_glue_initClient({ config: props.awsConfig });
31
+ if (props?.awsLambda) await require_aws_lambda_initClient({ config: props.awsConfig });
32
+ if (props?.awsS3) await require_aws_s3_initClient({ config: props.awsConfig });
33
+ if (props?.awsSes) await require_aws_ses_initClient({ config: props.awsConfig });
34
+ if (props?.awsSsm || props?.lumarApi || props?.lumarGraphql || props?.googleAds || props?.googleConfig) await require_aws_ssm_initClient({ config: props.awsConfig });
35
+ if (props?.lumarApi) await await require_lumar_api_initClient({ auth: await require_aws_ssm_getParameter({ name: props.lumarApi.parameterName }) });
36
+ if (props?.lumarGraphql) await await require_lumar_graphql_initClient({ auth: await require_aws_ssm_getParameter({ name: props.lumarGraphql.parameterName }) });
37
37
  if (props?.googleConfig) {
38
38
  const googleParameter = await require_aws_ssm_getParameter({ name: props.googleConfig.parameterName });
39
- if (props?.googleBigQuery && props?.googleConfig?.projectId) require_google_bigQuery_initClient({
39
+ if (props?.googleBigQuery && props?.googleConfig?.projectId) await require_google_bigQuery_initClient({
40
40
  parameter: googleParameter,
41
41
  projectId: props.googleConfig.projectId
42
42
  });
43
- if (props?.googleSheets) require_google_sheets_initClient({ parameter: googleParameter });
44
- if (props?.googleStorage && props?.googleConfig?.projectId) require_google_storage_initClient({
43
+ if (props?.googleSheets) await require_google_sheets_initClient({ parameter: googleParameter });
44
+ if (props?.googleStorage && props?.googleConfig?.projectId) await require_google_storage_initClient({
45
45
  parameter: googleParameter,
46
46
  projectId: props.googleConfig.projectId
47
47
  });
48
48
  }
49
- if (props?.googleAds) await require_googleAds_initClient({ parameter: await require_aws_ssm_getParameter({ name: props.googleAds.parameterName }) });
50
- if (props?.prisma) require_prisma_initClient({
49
+ if (props?.googleAds) await await require_googleAds_initClient({ parameter: await require_aws_ssm_getParameter({ name: props.googleAds.parameterName }) });
50
+ if (props?.prisma) await require_prisma_initClient({
51
51
  debug: props?.prisma?.debug ?? false,
52
52
  planetScale: props?.prisma?.planetScale ?? false
53
53
  });
@@ -39,7 +39,7 @@ type InitClients = {
39
39
  myTarget?: boolean;
40
40
  };
41
41
  /**
42
- * Function to simplify initialising the clients.
42
+ * Function to simplify await initialising the clients.
43
43
  */
44
44
  declare const initClients: (props: InitClients) => Promise<void>;
45
45
  export = initClients;
@@ -39,7 +39,7 @@ type InitClients = {
39
39
  myTarget?: boolean;
40
40
  };
41
41
  /**
42
- * Function to simplify initialising the clients.
42
+ * Function to simplify await initialising the clients.
43
43
  */
44
44
  declare const initClients: (props: InitClients) => Promise<void>;
45
45
  //#endregion