@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
@@ -4,10 +4,10 @@ global.awsAthenaExpressClient = null;
4
4
  /**
5
5
  * Initialise the database using manually provided credentials.
6
6
  */
7
- const initClient = (props) => {
7
+ const initClient = async (props) => {
8
8
  if (!global.awsAthenaExpressClient) {
9
- const athenaExpress = require("athena-express");
10
- const awsSdk = require("aws-sdk");
9
+ const athenaExpress = await import("athena-express");
10
+ const awsSdk = await import("aws-sdk");
11
11
  const formattedConfig = require_aws_getConfig({
12
12
  config: props.config,
13
13
  isAthenaExpress: true
@@ -1,14 +1,13 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getConfig from "../getConfig.mjs";
3
2
  //#region src/aws/athenaExpress/initClient.ts
4
3
  global.awsAthenaExpressClient = null;
5
4
  /**
6
5
  * Initialise the database using manually provided credentials.
7
6
  */
8
- const initClient = (props) => {
7
+ const initClient = async (props) => {
9
8
  if (!global.awsAthenaExpressClient) {
10
- const athenaExpress = __require("athena-express");
11
- const awsSdk = __require("aws-sdk");
9
+ const athenaExpress = await import("athena-express");
10
+ const awsSdk = await import("aws-sdk");
12
11
  const formattedConfig = getConfig({
13
12
  config: props.config,
14
13
  isAthenaExpress: true
@@ -7,9 +7,9 @@ global.awsEc2Client = null;
7
7
  * Library: @aws-sdk/client-ec2
8
8
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/
9
9
  */
10
- const initClient = (props) => {
10
+ const initClient = async (props) => {
11
11
  if (!global.awsEc2Client) {
12
- const { EC2Client } = require("@aws-sdk/client-ec2");
12
+ const { EC2Client } = await import("@aws-sdk/client-ec2");
13
13
  const formattedConfig = require_aws_getConfig({ config: props.config });
14
14
  global.awsEc2Client = new EC2Client(formattedConfig);
15
15
  }
@@ -9,6 +9,6 @@ type InitClient = {
9
9
  * Library: @aws-sdk/client-ec2
10
10
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/
11
11
  */
12
- declare const initClient: (props: InitClient) => void;
12
+ declare const initClient: (props: InitClient) => Promise<void>;
13
13
  //#endregion
14
14
  export { initClient };
@@ -9,6 +9,6 @@ type InitClient = {
9
9
  * Library: @aws-sdk/client-ec2
10
10
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/
11
11
  */
12
- declare const initClient: (props: InitClient) => void;
12
+ declare const initClient: (props: InitClient) => Promise<void>;
13
13
  //#endregion
14
14
  export { initClient };
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getConfig from "../getConfig.mjs";
3
2
  //#region src/aws/ec2/initClient.ts
4
3
  global.awsEc2Client = null;
@@ -7,9 +6,9 @@ global.awsEc2Client = null;
7
6
  * Library: @aws-sdk/client-ec2
8
7
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/
9
8
  */
10
- const initClient = (props) => {
9
+ const initClient = async (props) => {
11
10
  if (!global.awsEc2Client) {
12
- const { EC2Client } = __require("@aws-sdk/client-ec2");
11
+ const { EC2Client } = await import("@aws-sdk/client-ec2");
13
12
  const formattedConfig = getConfig({ config: props.config });
14
13
  global.awsEc2Client = new EC2Client(formattedConfig);
15
14
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
5
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/StartInstancesCommand/
6
6
  */
7
7
  const startInstances = async (props) => {
8
- const { StartInstancesCommand } = require("@aws-sdk/client-ec2");
8
+ const { StartInstancesCommand } = await import("@aws-sdk/client-ec2");
9
9
  const command = new StartInstancesCommand({
10
10
  InstanceIds: props.instanceIds,
11
11
  AdditionalInfo: props?.additionalInfo,
@@ -1,11 +1,10 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/aws/ec2/startInstances.ts
3
2
  /**
4
3
  * Start one or more Ec2 Instances.
5
4
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/StartInstancesCommand/
6
5
  */
7
6
  const startInstances = async (props) => {
8
- const { StartInstancesCommand } = __require("@aws-sdk/client-ec2");
7
+ const { StartInstancesCommand } = await import("@aws-sdk/client-ec2");
9
8
  const command = new StartInstancesCommand({
10
9
  InstanceIds: props.instanceIds,
11
10
  AdditionalInfo: props?.additionalInfo,
@@ -5,7 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
5
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/StopInstancesCommand/
6
6
  */
7
7
  const stopInstances = async (props) => {
8
- const { StopInstancesCommand } = require("@aws-sdk/client-ec2");
8
+ const { StopInstancesCommand } = await import("@aws-sdk/client-ec2");
9
9
  const command = new StopInstancesCommand({
10
10
  InstanceIds: props.instanceIds,
11
11
  Hibernate: props?.hibernate,
@@ -1,11 +1,10 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/aws/ec2/stopInstances.ts
3
2
  /**
4
3
  * Stop one or more Ec2 Instances.
5
4
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/StopInstancesCommand/
6
5
  */
7
6
  const stopInstances = async (props) => {
8
- const { StopInstancesCommand } = __require("@aws-sdk/client-ec2");
7
+ const { StopInstancesCommand } = await import("@aws-sdk/client-ec2");
9
8
  const command = new StopInstancesCommand({
10
9
  InstanceIds: props.instanceIds,
11
10
  Hibernate: props?.hibernate,
@@ -8,7 +8,7 @@ const require_aws_isResponse200 = require("../isResponse200.cjs");
8
8
  const getClusters = async (props) => {
9
9
  let response = [];
10
10
  let apiResponse = null;
11
- const { ListClustersCommand } = require("@aws-sdk/client-ecs");
11
+ const { ListClustersCommand } = await import("@aws-sdk/client-ecs");
12
12
  while (null === apiResponse || apiResponse?.nextToken) {
13
13
  const listClustersCommand = new ListClustersCommand({
14
14
  maxResults: props?.maxResults,
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import isResponse200 from "../isResponse200.mjs";
3
2
  //#region src/aws/ecs/getClusters.ts
4
3
  /**
@@ -8,7 +7,7 @@ import isResponse200 from "../isResponse200.mjs";
8
7
  const getClusters = async (props) => {
9
8
  let response = [];
10
9
  let apiResponse = null;
11
- const { ListClustersCommand } = __require("@aws-sdk/client-ecs");
10
+ const { ListClustersCommand } = await import("@aws-sdk/client-ecs");
12
11
  while (null === apiResponse || apiResponse?.nextToken) {
13
12
  const listClustersCommand = new ListClustersCommand({
14
13
  maxResults: props?.maxResults,
@@ -8,7 +8,7 @@ const require_aws_isResponse200 = require("../isResponse200.cjs");
8
8
  const getTaskDefinitions = async (props) => {
9
9
  let response = [];
10
10
  let apiResponse = null;
11
- const { ListTaskDefinitionsCommand } = require("@aws-sdk/client-ecs");
11
+ const { ListTaskDefinitionsCommand } = await import("@aws-sdk/client-ecs");
12
12
  while (null === apiResponse || apiResponse?.nextToken) {
13
13
  const listTaskDefinitionsCommand = new ListTaskDefinitionsCommand({
14
14
  maxResults: props?.maxResults,
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import isResponse200 from "../isResponse200.mjs";
3
2
  //#region src/aws/ecs/getTaskDefinitions.ts
4
3
  /**
@@ -8,7 +7,7 @@ import isResponse200 from "../isResponse200.mjs";
8
7
  const getTaskDefinitions = async (props) => {
9
8
  let response = [];
10
9
  let apiResponse = null;
11
- const { ListTaskDefinitionsCommand } = __require("@aws-sdk/client-ecs");
10
+ const { ListTaskDefinitionsCommand } = await import("@aws-sdk/client-ecs");
12
11
  while (null === apiResponse || apiResponse?.nextToken) {
13
12
  const listTaskDefinitionsCommand = new ListTaskDefinitionsCommand({
14
13
  maxResults: props?.maxResults,
@@ -8,7 +8,7 @@ const require_aws_isResponse200 = require("../isResponse200.cjs");
8
8
  const getTasks = async (props) => {
9
9
  let response = [];
10
10
  let apiResponse = null;
11
- const { ListTasksCommand } = require("@aws-sdk/client-ecs");
11
+ const { ListTasksCommand } = await import("@aws-sdk/client-ecs");
12
12
  while (null === apiResponse || apiResponse?.nextToken) {
13
13
  const listTasksCommand = new ListTasksCommand({
14
14
  cluster: props?.cluster,
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import isResponse200 from "../isResponse200.mjs";
3
2
  //#region src/aws/ecs/getTasks.ts
4
3
  /**
@@ -8,7 +7,7 @@ import isResponse200 from "../isResponse200.mjs";
8
7
  const getTasks = async (props) => {
9
8
  let response = [];
10
9
  let apiResponse = null;
11
- const { ListTasksCommand } = __require("@aws-sdk/client-ecs");
10
+ const { ListTasksCommand } = await import("@aws-sdk/client-ecs");
12
11
  while (null === apiResponse || apiResponse?.nextToken) {
13
12
  const listTasksCommand = new ListTasksCommand({
14
13
  cluster: props?.cluster,
@@ -7,9 +7,9 @@ global.awsEcsClient = null;
7
7
  * Library: @aws-sdk/client-ecs
8
8
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/
9
9
  */
10
- const initClient = (props) => {
10
+ const initClient = async (props) => {
11
11
  if (!global.awsEcsClient) {
12
- const { ECSClient } = require("@aws-sdk/client-ecs");
12
+ const { ECSClient } = await import("@aws-sdk/client-ecs");
13
13
  const formattedConfig = require_aws_getConfig({ config: props.config });
14
14
  global.awsEcsClient = new ECSClient(formattedConfig);
15
15
  }
@@ -9,6 +9,6 @@ type InitClient = {
9
9
  * Library: @aws-sdk/client-ecs
10
10
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/
11
11
  */
12
- declare const initClient: (props: InitClient) => void;
12
+ declare const initClient: (props: InitClient) => Promise<void>;
13
13
  //#endregion
14
14
  export { initClient };
@@ -9,6 +9,6 @@ type InitClient = {
9
9
  * Library: @aws-sdk/client-ecs
10
10
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/
11
11
  */
12
- declare const initClient: (props: InitClient) => void;
12
+ declare const initClient: (props: InitClient) => Promise<void>;
13
13
  //#endregion
14
14
  export { initClient };
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getConfig from "../getConfig.mjs";
3
2
  //#region src/aws/ecs/initClient.ts
4
3
  global.awsEcsClient = null;
@@ -7,9 +6,9 @@ global.awsEcsClient = null;
7
6
  * Library: @aws-sdk/client-ecs
8
7
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/
9
8
  */
10
- const initClient = (props) => {
9
+ const initClient = async (props) => {
11
10
  if (!global.awsEcsClient) {
12
- const { ECSClient } = __require("@aws-sdk/client-ecs");
11
+ const { ECSClient } = await import("@aws-sdk/client-ecs");
13
12
  const formattedConfig = getConfig({ config: props.config });
14
13
  global.awsEcsClient = new ECSClient(formattedConfig);
15
14
  }
@@ -8,7 +8,7 @@ const require_aws_isResponse200 = require("../isResponse200.cjs");
8
8
  */
9
9
  const runTask = async (props) => {
10
10
  let response = false;
11
- const { RunTaskCommand } = require("@aws-sdk/client-ecs");
11
+ const { RunTaskCommand } = await import("@aws-sdk/client-ecs");
12
12
  const runtTaskCommand = new RunTaskCommand({
13
13
  cluster: props?.cluster,
14
14
  launchType: props?.launchType,
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import isResponse200 from "../isResponse200.mjs";
3
2
  //#region src/aws/ecs/runTask.ts
4
3
  /**
@@ -8,7 +7,7 @@ import isResponse200 from "../isResponse200.mjs";
8
7
  */
9
8
  const runTask = async (props) => {
10
9
  let response = false;
11
- const { RunTaskCommand } = __require("@aws-sdk/client-ecs");
10
+ const { RunTaskCommand } = await import("@aws-sdk/client-ecs");
12
11
  const runtTaskCommand = new RunTaskCommand({
13
12
  cluster: props?.cluster,
14
13
  launchType: props?.launchType,
@@ -5,9 +5,9 @@ global.awsGlueClient = null;
5
5
  * Shorthand function to get the Glue Client.
6
6
  * Library: @aws-sdk/client-glue
7
7
  */
8
- const initClient = (props) => {
8
+ const initClient = async (props) => {
9
9
  if (!global.awsGlueClient) {
10
- const { GlueClient } = require("@aws-sdk/client-glue");
10
+ const { GlueClient } = await import("@aws-sdk/client-glue");
11
11
  const formattedConfig = require_aws_getConfig({ config: props.config });
12
12
  global.awsGlueClient = new GlueClient(formattedConfig);
13
13
  }
@@ -8,5 +8,5 @@ type InitClient = {
8
8
  * Shorthand function to get the Glue Client.
9
9
  * Library: @aws-sdk/client-glue
10
10
  */
11
- declare const initClient: (props: InitClient) => void;
11
+ declare const initClient: (props: InitClient) => Promise<void>;
12
12
  export = initClient;
@@ -8,6 +8,6 @@ type InitClient = {
8
8
  * Shorthand function to get the Glue Client.
9
9
  * Library: @aws-sdk/client-glue
10
10
  */
11
- declare const initClient: (props: InitClient) => void;
11
+ declare const initClient: (props: InitClient) => Promise<void>;
12
12
  //#endregion
13
13
  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/aws/glue/initClient.ts
4
3
  global.awsGlueClient = null;
@@ -6,9 +5,9 @@ global.awsGlueClient = null;
6
5
  * Shorthand function to get the Glue Client.
7
6
  * Library: @aws-sdk/client-glue
8
7
  */
9
- const initClient = (props) => {
8
+ const initClient = async (props) => {
10
9
  if (!global.awsGlueClient) {
11
- const { GlueClient } = __require("@aws-sdk/client-glue");
10
+ const { GlueClient } = await import("@aws-sdk/client-glue");
12
11
  const formattedConfig = getConfig({ config: props.config });
13
12
  global.awsGlueClient = new GlueClient(formattedConfig);
14
13
  }
@@ -5,7 +5,7 @@ const require_aws_isResponse200 = require("../isResponse200.cjs");
5
5
  * Library: @aws-sdk/client-glue
6
6
  */
7
7
  const invoke = async (props) => {
8
- const { StartCrawlerCommand } = require("@aws-sdk/client-glue");
8
+ const { StartCrawlerCommand } = await import("@aws-sdk/client-glue");
9
9
  const command = new StartCrawlerCommand({ Name: props.crawler });
10
10
  return require_aws_isResponse200({ apiResponse: await global.awsGlueClient.send(command) });
11
11
  };
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import isResponse200 from "../isResponse200.mjs";
3
2
  //#region src/aws/glue/invoke.ts
4
3
  /**
@@ -6,7 +5,7 @@ import isResponse200 from "../isResponse200.mjs";
6
5
  * Library: @aws-sdk/client-glue
7
6
  */
8
7
  const invoke = async (props) => {
9
- const { StartCrawlerCommand } = __require("@aws-sdk/client-glue");
8
+ const { StartCrawlerCommand } = await import("@aws-sdk/client-glue");
10
9
  const command = new StartCrawlerCommand({ Name: props.crawler });
11
10
  return isResponse200({ apiResponse: await global.awsGlueClient.send(command) });
12
11
  };
@@ -5,9 +5,9 @@ global.awsLambdaClient = null;
5
5
  * Shorthand function to get the Lambda Client.
6
6
  * Library: @aws-sdk/client-lambda
7
7
  */
8
- const initClient = (props) => {
8
+ const initClient = async (props) => {
9
9
  if (!global.awsLambdaClient) {
10
- const { LambdaClient } = require("@aws-sdk/client-lambda");
10
+ const { LambdaClient } = await import("@aws-sdk/client-lambda");
11
11
  const formattedConfig = require_aws_getConfig({ config: props.config });
12
12
  global.awsLambdaClient = new LambdaClient(formattedConfig);
13
13
  }
@@ -8,5 +8,5 @@ type InitClient = {
8
8
  * Shorthand function to get the Lambda Client.
9
9
  * Library: @aws-sdk/client-lambda
10
10
  */
11
- declare const initClient: (props: InitClient) => void;
11
+ declare const initClient: (props: InitClient) => Promise<void>;
12
12
  export = initClient;
@@ -8,6 +8,6 @@ type InitClient = {
8
8
  * Shorthand function to get the Lambda Client.
9
9
  * Library: @aws-sdk/client-lambda
10
10
  */
11
- declare const initClient: (props: InitClient) => void;
11
+ declare const initClient: (props: InitClient) => Promise<void>;
12
12
  //#endregion
13
13
  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/aws/lambda/initClient.ts
4
3
  global.awsLambdaClient = null;
@@ -6,9 +5,9 @@ global.awsLambdaClient = null;
6
5
  * Shorthand function to get the Lambda Client.
7
6
  * Library: @aws-sdk/client-lambda
8
7
  */
9
- const initClient = (props) => {
8
+ const initClient = async (props) => {
10
9
  if (!global.awsLambdaClient) {
11
- const { LambdaClient } = __require("@aws-sdk/client-lambda");
10
+ const { LambdaClient } = await import("@aws-sdk/client-lambda");
12
11
  const formattedConfig = getConfig({ config: props.config });
13
12
  global.awsLambdaClient = new LambdaClient(formattedConfig);
14
13
  }
@@ -13,7 +13,7 @@ const invoke = async (props) => {
13
13
  InvocationType: true === props.awaitResponse ? "RequestResponse" : "Event"
14
14
  };
15
15
  if (void 0 !== props.payload) params["Payload"] = new Uint8Array(Buffer.from(JSON.stringify(props.payload)));
16
- const { InvokeCommand } = require("@aws-sdk/client-lambda");
16
+ const { InvokeCommand } = await import("@aws-sdk/client-lambda");
17
17
  const command = new InvokeCommand(params);
18
18
  const apiResponse = await global.awsLambdaClient.send(command);
19
19
  if (require_aws_isResponse200({ apiResponse })) if (props.awaitResponse && void 0 !== apiResponse.Payload) {
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import ApiResponse from "../../api/ApiResponse.mjs";
3
2
  import isResponse200 from "../isResponse200.mjs";
4
3
  //#region src/aws/lambda/invoke.ts
@@ -14,7 +13,7 @@ const invoke = async (props) => {
14
13
  InvocationType: true === props.awaitResponse ? "RequestResponse" : "Event"
15
14
  };
16
15
  if (void 0 !== props.payload) params["Payload"] = new Uint8Array(Buffer.from(JSON.stringify(props.payload)));
17
- const { InvokeCommand } = __require("@aws-sdk/client-lambda");
16
+ const { InvokeCommand } = await import("@aws-sdk/client-lambda");
18
17
  const command = new InvokeCommand(params);
19
18
  const apiResponse = await global.awsLambdaClient.send(command);
20
19
  if (isResponse200({ apiResponse })) if (props.awaitResponse && void 0 !== apiResponse.Payload) {
@@ -3,7 +3,7 @@
3
3
  * Copy a file from one bucket/path to another bucket/path.
4
4
  */
5
5
  const copyFile = async ({ from, to }) => {
6
- const { CopyObjectCommand } = require("@aws-sdk/client-s3");
6
+ const { CopyObjectCommand } = await import("@aws-sdk/client-s3");
7
7
  await global.awsS3Client.send(new CopyObjectCommand({
8
8
  Bucket: to.bucket,
9
9
  CopySource: encodeURIComponent(`${from.bucket}/${from.key}`),
@@ -1,10 +1,9 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/aws/s3/copyFile.ts
3
2
  /**
4
3
  * Copy a file from one bucket/path to another bucket/path.
5
4
  */
6
5
  const copyFile = async ({ from, to }) => {
7
- const { CopyObjectCommand } = __require("@aws-sdk/client-s3");
6
+ const { CopyObjectCommand } = await import("@aws-sdk/client-s3");
8
7
  await global.awsS3Client.send(new CopyObjectCommand({
9
8
  Bucket: to.bucket,
10
9
  CopySource: encodeURIComponent(`${from.bucket}/${from.key}`),
@@ -3,7 +3,7 @@
3
3
  * Delete a single file.
4
4
  */
5
5
  const deleteFile = async ({ bucket, key }) => {
6
- const { DeleteObjectCommand } = require("@aws-sdk/client-s3");
6
+ const { DeleteObjectCommand } = await import("@aws-sdk/client-s3");
7
7
  await global.awsS3Client.send(new DeleteObjectCommand({
8
8
  Bucket: bucket,
9
9
  Key: key
@@ -1,10 +1,9 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/aws/s3/deleteFile.ts
3
2
  /**
4
3
  * Delete a single file.
5
4
  */
6
5
  const deleteFile = async ({ bucket, key }) => {
7
- const { DeleteObjectCommand } = __require("@aws-sdk/client-s3");
6
+ const { DeleteObjectCommand } = await import("@aws-sdk/client-s3");
8
7
  await global.awsS3Client.send(new DeleteObjectCommand({
9
8
  Bucket: bucket,
10
9
  Key: key
@@ -3,7 +3,7 @@
3
3
  * Delete multiple files.
4
4
  */
5
5
  const deleteFiles = async ({ bucket, keys }) => {
6
- const { DeleteObjectsCommand } = require("@aws-sdk/client-s3");
6
+ const { DeleteObjectsCommand } = await import("@aws-sdk/client-s3");
7
7
  await global.awsS3Client.send(new DeleteObjectsCommand({
8
8
  Bucket: bucket,
9
9
  Delete: { Objects: keys.map((key) => ({ Key: key })) }
@@ -1,10 +1,9 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/aws/s3/deleteFiles.ts
3
2
  /**
4
3
  * Delete multiple files.
5
4
  */
6
5
  const deleteFiles = async ({ bucket, keys }) => {
7
- const { DeleteObjectsCommand } = __require("@aws-sdk/client-s3");
6
+ const { DeleteObjectsCommand } = await import("@aws-sdk/client-s3");
8
7
  await global.awsS3Client.send(new DeleteObjectsCommand({
9
8
  Bucket: bucket,
10
9
  Delete: { Objects: keys.map((key) => ({ Key: key })) }
@@ -5,7 +5,7 @@ const require_string_getFolder = require("../../string/getFolder.cjs");
5
5
  */
6
6
  const deleteFolder = async ({ bucket, folder }) => {
7
7
  const cleanFolder = require_string_getFolder({ input: folder });
8
- const { ListObjectsV2Command, DeleteObjectsCommand } = require("@aws-sdk/client-s3");
8
+ const { ListObjectsV2Command, DeleteObjectsCommand } = await import("@aws-sdk/client-s3");
9
9
  const apiResponse = await global.awsS3Client.send(new ListObjectsV2Command({
10
10
  Bucket: bucket,
11
11
  Prefix: "" === cleanFolder ? "" : cleanFolder + "/"
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import getFolder from "../../string/getFolder.mjs";
3
2
  //#region src/aws/s3/deleteFolder.ts
4
3
  /**
@@ -6,7 +5,7 @@ import getFolder from "../../string/getFolder.mjs";
6
5
  */
7
6
  const deleteFolder = async ({ bucket, folder }) => {
8
7
  const cleanFolder = getFolder({ input: folder });
9
- const { ListObjectsV2Command, DeleteObjectsCommand } = __require("@aws-sdk/client-s3");
8
+ const { ListObjectsV2Command, DeleteObjectsCommand } = await import("@aws-sdk/client-s3");
10
9
  const apiResponse = await global.awsS3Client.send(new ListObjectsV2Command({
11
10
  Bucket: bucket,
12
11
  Prefix: "" === cleanFolder ? "" : cleanFolder + "/"
@@ -5,7 +5,7 @@
5
5
  * https://github.com/8millionstories-organisation/test-vercel-upload-2/blob/50eb12fcb3870a59ab455811bfaa1bdcb886edf2/pages/api/upload-url.js
6
6
  */
7
7
  const getPresignedPost = async ({ bucket, conditions, expires, fields, key }) => {
8
- const { createPresignedPost } = require("@aws-sdk/client-s3");
8
+ const { createPresignedPost } = await import("@aws-sdk/s3-presigned-post");
9
9
  return await createPresignedPost(global.awsS3Client, {
10
10
  Bucket: bucket,
11
11
  Key: key,
@@ -1,4 +1,3 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/aws/s3/getPresignedPost.ts
3
2
  /**
4
3
  * Returns a presigned post to upload a file directly to S3.
@@ -6,7 +5,7 @@ import { __require } from "../../_virtual/_rolldown/runtime.mjs";
6
5
  * https://github.com/8millionstories-organisation/test-vercel-upload-2/blob/50eb12fcb3870a59ab455811bfaa1bdcb886edf2/pages/api/upload-url.js
7
6
  */
8
7
  const getPresignedPost = async ({ bucket, conditions, expires, fields, key }) => {
9
- const { createPresignedPost } = __require("@aws-sdk/client-s3");
8
+ const { createPresignedPost } = await import("@aws-sdk/s3-presigned-post");
10
9
  return await createPresignedPost(global.awsS3Client, {
11
10
  Bucket: bucket,
12
11
  Key: key,
@@ -4,8 +4,8 @@
4
4
  * Library: @aws-sdk/s3-request-presigner
5
5
  */
6
6
  const getSignedUrl = async ({ bucket, expires, key }) => {
7
- const { GetObjectCommand } = require("@aws-sdk/client-s3");
8
- const { getSignedUrl } = require("@aws-sdk/s3-request-presigner");
7
+ const { GetObjectCommand } = await import("@aws-sdk/client-s3");
8
+ const { getSignedUrl } = await import("@aws-sdk/s3-request-presigner");
9
9
  const command = new GetObjectCommand({
10
10
  Bucket: bucket,
11
11
  Key: key
@@ -1,5 +1,3 @@
1
- import { Response } from "../../api/response.cjs";
2
-
3
1
  //#region src/aws/s3/getSignedUrl.d.ts
4
2
  type GetSignedUrl = {
5
3
  bucket: string;
@@ -14,5 +12,5 @@ declare const getSignedUrl: ({
14
12
  bucket,
15
13
  expires,
16
14
  key
17
- }: GetSignedUrl) => Promise<Response>;
15
+ }: GetSignedUrl) => Promise<string>;
18
16
  export = getSignedUrl;
@@ -1,5 +1,3 @@
1
- import { Response } from "../../api/response.mjs";
2
-
3
1
  //#region src/aws/s3/getSignedUrl.d.ts
4
2
  type GetSignedUrl = {
5
3
  bucket: string;
@@ -14,6 +12,6 @@ declare const getSignedUrl: ({
14
12
  bucket,
15
13
  expires,
16
14
  key
17
- }: GetSignedUrl) => Promise<Response>;
15
+ }: GetSignedUrl) => Promise<string>;
18
16
  //#endregion
19
17
  export { getSignedUrl as default };
@@ -1,12 +1,11 @@
1
- import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  //#region src/aws/s3/getSignedUrl.ts
3
2
  /**
4
3
  * Returns a signed for URL to allow download of private buckets for a given duration.
5
4
  * Library: @aws-sdk/s3-request-presigner
6
5
  */
7
6
  const getSignedUrl = async ({ bucket, expires, key }) => {
8
- const { GetObjectCommand } = __require("@aws-sdk/client-s3");
9
- const { getSignedUrl } = __require("@aws-sdk/s3-request-presigner");
7
+ const { GetObjectCommand } = await import("@aws-sdk/client-s3");
8
+ const { getSignedUrl } = await import("@aws-sdk/s3-request-presigner");
10
9
  const command = new GetObjectCommand({
11
10
  Bucket: bucket,
12
11
  Key: key
@@ -5,9 +5,9 @@ global.awsS3Client = null;
5
5
  * Shorthand function to get the Lambda Client.
6
6
  * Library: @aws-sdk/client-s3
7
7
  */
8
- const initClient = ({ config }) => {
8
+ const initClient = async ({ config }) => {
9
9
  if (!global.awsS3Client) {
10
- const { S3Client } = require("@aws-sdk/client-s3");
10
+ const { S3Client } = await import("@aws-sdk/client-s3");
11
11
  const formattedConfig = require_aws_getConfig({ config });
12
12
  global.awsS3Client = new S3Client(formattedConfig);
13
13
  }
@@ -10,5 +10,5 @@ type InitClient = {
10
10
  */
11
11
  declare const initClient: ({
12
12
  config
13
- }: InitClient) => void;
13
+ }: InitClient) => Promise<void>;
14
14
  export = initClient;