@8ms/helpers 3.0.2 → 3.0.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.
Files changed (81) hide show
  1. package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.cjs +1 -0
  2. package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.d.cts +1 -1
  3. package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.d.mts +1 -1
  4. package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.mjs +1 -0
  5. package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.cjs +1 -0
  6. package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.d.cts +1 -1
  7. package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.d.mts +1 -1
  8. package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.mjs +1 -0
  9. package/dist/aws/ec2/server/AwsEc2.cjs +1 -0
  10. package/dist/aws/ec2/server/AwsEc2.d.cts +1 -1
  11. package/dist/aws/ec2/server/AwsEc2.d.mts +1 -1
  12. package/dist/aws/ec2/server/AwsEc2.mjs +1 -0
  13. package/dist/aws/ecs/server/AwsEcs.cjs +1 -0
  14. package/dist/aws/ecs/server/AwsEcs.d.cts +1 -1
  15. package/dist/aws/ecs/server/AwsEcs.d.mts +1 -1
  16. package/dist/aws/ecs/server/AwsEcs.mjs +1 -0
  17. package/dist/aws/glue/server/AwsGlue.cjs +1 -0
  18. package/dist/aws/glue/server/AwsGlue.d.cts +1 -1
  19. package/dist/aws/glue/server/AwsGlue.d.mts +1 -1
  20. package/dist/aws/glue/server/AwsGlue.mjs +1 -0
  21. package/dist/aws/lambda/server/AwsLambda.cjs +1 -0
  22. package/dist/aws/lambda/server/AwsLambda.d.cts +1 -1
  23. package/dist/aws/lambda/server/AwsLambda.d.mts +1 -1
  24. package/dist/aws/lambda/server/AwsLambda.mjs +1 -0
  25. package/dist/aws/s3/server/AwsS3.cjs +3 -2
  26. package/dist/aws/s3/server/AwsS3.d.cts +1 -1
  27. package/dist/aws/s3/server/AwsS3.d.mts +1 -1
  28. package/dist/aws/s3/server/AwsS3.mjs +3 -2
  29. package/dist/aws/ses/server/AwsSes.cjs +1 -0
  30. package/dist/aws/ses/server/AwsSes.d.cts +1 -1
  31. package/dist/aws/ses/server/AwsSes.d.mts +1 -1
  32. package/dist/aws/ses/server/AwsSes.mjs +1 -0
  33. package/dist/aws/sqs/server/AwsSqs.cjs +1 -0
  34. package/dist/aws/sqs/server/AwsSqs.d.cts +1 -1
  35. package/dist/aws/sqs/server/AwsSqs.d.mts +1 -1
  36. package/dist/aws/sqs/server/AwsSqs.mjs +1 -0
  37. package/dist/aws/ssm/server/AwsSsm.cjs +1 -0
  38. package/dist/aws/ssm/server/AwsSsm.d.cts +1 -1
  39. package/dist/aws/ssm/server/AwsSsm.d.mts +1 -1
  40. package/dist/aws/ssm/server/AwsSsm.mjs +1 -0
  41. package/dist/drizzle/server/Drizzle.cjs +1 -0
  42. package/dist/drizzle/server/Drizzle.d.cts +5 -3
  43. package/dist/drizzle/server/Drizzle.d.mts +5 -3
  44. package/dist/drizzle/server/Drizzle.mjs +1 -0
  45. package/dist/googleAds/server/GoogleAds.cjs +1 -0
  46. package/dist/googleAds/server/GoogleAds.d.cts +1 -1
  47. package/dist/googleAds/server/GoogleAds.d.mts +1 -1
  48. package/dist/googleAds/server/GoogleAds.mjs +1 -0
  49. package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.cjs +1 -0
  50. package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.d.cts +1 -1
  51. package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.d.mts +1 -1
  52. package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.mjs +1 -0
  53. package/dist/googleCloud/sheets/server/GoogleCloudSheets.cjs +1 -0
  54. package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.cts +1 -1
  55. package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.mts +1 -1
  56. package/dist/googleCloud/sheets/server/GoogleCloudSheets.mjs +1 -0
  57. package/dist/googleCloud/storage/server/GoogleCloudStorage.cjs +1 -0
  58. package/dist/googleCloud/storage/server/GoogleCloudStorage.d.cts +1 -1
  59. package/dist/googleCloud/storage/server/GoogleCloudStorage.d.mts +1 -1
  60. package/dist/googleCloud/storage/server/GoogleCloudStorage.mjs +1 -0
  61. package/dist/googlePageSpeed/server/GooglePageSpeed.cjs +1 -0
  62. package/dist/googlePageSpeed/server/GooglePageSpeed.d.cts +1 -1
  63. package/dist/googlePageSpeed/server/GooglePageSpeed.d.mts +1 -1
  64. package/dist/googlePageSpeed/server/GooglePageSpeed.mjs +1 -0
  65. package/dist/littleWarden/server/LittleWarden.cjs +1 -0
  66. package/dist/littleWarden/server/LittleWarden.d.cts +1 -1
  67. package/dist/littleWarden/server/LittleWarden.d.mts +1 -1
  68. package/dist/littleWarden/server/LittleWarden.mjs +1 -0
  69. package/dist/onePassword/server/OnePassword.cjs +1 -0
  70. package/dist/onePassword/server/OnePassword.d.cts +1 -1
  71. package/dist/onePassword/server/OnePassword.d.mts +1 -1
  72. package/dist/onePassword/server/OnePassword.mjs +1 -0
  73. package/dist/openAi/server/OpenAi.cjs +1 -0
  74. package/dist/openAi/server/OpenAi.d.cts +1 -1
  75. package/dist/openAi/server/OpenAi.d.mts +1 -1
  76. package/dist/openAi/server/OpenAi.mjs +1 -0
  77. package/dist/snapchat/server/Snapchat.cjs +1 -0
  78. package/dist/snapchat/server/Snapchat.d.cts +1 -1
  79. package/dist/snapchat/server/Snapchat.d.mts +1 -1
  80. package/dist/snapchat/server/Snapchat.mjs +1 -0
  81. package/package.json +1 -1
@@ -15,6 +15,7 @@ var AwsCloudWatchLog = class extends require__class_BaseNamespace.BaseNamespace
15
15
  } catch (e) {
16
16
  throw new Error("AWS CloudWatch Logs Client not installed");
17
17
  }
18
+ return this;
18
19
  };
19
20
  /**
20
21
  * Create a CloudWatch Log Group.
@@ -7,7 +7,7 @@ import { CloudWatchLogsClient } from "@aws-sdk/client-cloudwatch-logs";
7
7
  declare class AwsCloudWatchLog extends BaseNamespace {
8
8
  client: CloudWatchLogsClient;
9
9
  config: any;
10
- init: (config: any, region?: string) => Promise<void>;
10
+ init: (config: any, region?: string) => Promise<this>;
11
11
  /**
12
12
  * Create a CloudWatch Log Group.
13
13
  * This should typically be the name of the application + environment
@@ -7,7 +7,7 @@ import { CloudWatchLogsClient } from "@aws-sdk/client-cloudwatch-logs";
7
7
  declare class AwsCloudWatchLog extends BaseNamespace {
8
8
  client: CloudWatchLogsClient;
9
9
  config: any;
10
- init: (config: any, region?: string) => Promise<void>;
10
+ init: (config: any, region?: string) => Promise<this>;
11
11
  /**
12
12
  * Create a CloudWatch Log Group.
13
13
  * This should typically be the name of the application + environment
@@ -14,6 +14,7 @@ var AwsCloudWatchLog = class extends BaseNamespace {
14
14
  } catch (e) {
15
15
  throw new Error("AWS CloudWatch Logs Client not installed");
16
16
  }
17
+ return this;
17
18
  };
18
19
  /**
19
20
  * Create a CloudWatch Log Group.
@@ -16,6 +16,7 @@ var AwsCloudWatchMetric = class extends require__class_BaseNamespace.BaseNamespa
16
16
  } catch (e) {
17
17
  throw new Error("AWS CloudWatch Client not installed");
18
18
  }
19
+ return this;
19
20
  };
20
21
  /**
21
22
  * Publishes metric data to CloudWatch.
@@ -7,7 +7,7 @@ import { CloudWatchClient } from "@aws-sdk/client-cloudwatch";
7
7
  declare class AwsCloudWatchMetric extends BaseNamespace {
8
8
  client: CloudWatchClient;
9
9
  config: any;
10
- init: (config: any, region?: string) => Promise<void>;
10
+ init: (config: any, region?: string) => Promise<this>;
11
11
  /**
12
12
  * Publishes metric data to CloudWatch.
13
13
  * The namespace is created automatically.
@@ -7,7 +7,7 @@ import { CloudWatchClient } from "@aws-sdk/client-cloudwatch";
7
7
  declare class AwsCloudWatchMetric extends BaseNamespace {
8
8
  client: CloudWatchClient;
9
9
  config: any;
10
- init: (config: any, region?: string) => Promise<void>;
10
+ init: (config: any, region?: string) => Promise<this>;
11
11
  /**
12
12
  * Publishes metric data to CloudWatch.
13
13
  * The namespace is created automatically.
@@ -15,6 +15,7 @@ var AwsCloudWatchMetric = class extends BaseNamespace {
15
15
  } catch (e) {
16
16
  throw new Error("AWS CloudWatch Client not installed");
17
17
  }
18
+ return this;
18
19
  };
19
20
  /**
20
21
  * Publishes metric data to CloudWatch.
@@ -13,6 +13,7 @@ var AwsEc2 = class extends require__class_BaseNamespace.BaseNamespace {
13
13
  } catch (e) {
14
14
  throw new Error("AWS EC2 Client not installed");
15
15
  }
16
+ return this;
16
17
  };
17
18
  startInstances = async (instanceIds, additionalInfo, dryRun) => {
18
19
  const { StartInstancesCommand } = await import("@aws-sdk/client-ec2");
@@ -6,7 +6,7 @@ import { EC2Client } from "@aws-sdk/client-ec2";
6
6
  declare class AwsEc2 extends BaseNamespace {
7
7
  client: EC2Client;
8
8
  config: any;
9
- init: (config: any, region?: string) => Promise<void>;
9
+ init: (config: any, region?: string) => Promise<this>;
10
10
  startInstances: (instanceIds: string[], additionalInfo?: string, dryRun?: boolean) => Promise<_$_aws_sdk_client_ec20.StartInstancesCommandOutput>;
11
11
  stopInstances: (instanceIds: string[], hibernate?: boolean, force?: boolean, dryRun?: boolean) => Promise<_$_aws_sdk_client_ec20.StopInstancesCommandOutput>;
12
12
  }
@@ -6,7 +6,7 @@ import { EC2Client } from "@aws-sdk/client-ec2";
6
6
  declare class AwsEc2 extends BaseNamespace {
7
7
  client: EC2Client;
8
8
  config: any;
9
- init: (config: any, region?: string) => Promise<void>;
9
+ init: (config: any, region?: string) => Promise<this>;
10
10
  startInstances: (instanceIds: string[], additionalInfo?: string, dryRun?: boolean) => Promise<_$_aws_sdk_client_ec20.StartInstancesCommandOutput>;
11
11
  stopInstances: (instanceIds: string[], hibernate?: boolean, force?: boolean, dryRun?: boolean) => Promise<_$_aws_sdk_client_ec20.StopInstancesCommandOutput>;
12
12
  }
@@ -12,6 +12,7 @@ var AwsEc2 = class extends BaseNamespace {
12
12
  } catch (e) {
13
13
  throw new Error("AWS EC2 Client not installed");
14
14
  }
15
+ return this;
15
16
  };
16
17
  startInstances = async (instanceIds, additionalInfo, dryRun) => {
17
18
  const { StartInstancesCommand } = await import("@aws-sdk/client-ec2");
@@ -15,6 +15,7 @@ var AwsEcs = class extends require__class_BaseNamespace.BaseNamespace {
15
15
  } catch (e) {
16
16
  throw new Error("AWS ECS Client not installed");
17
17
  }
18
+ return this;
18
19
  };
19
20
  /**
20
21
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListClustersCommand/
@@ -28,7 +28,7 @@ type RunTaskProps = {
28
28
  declare class AwsEcs extends BaseNamespace {
29
29
  client: ECSClient;
30
30
  config: any;
31
- init: (config: any, region?: string) => Promise<void>;
31
+ init: (config: any, region?: string) => Promise<this>;
32
32
  /**
33
33
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListClustersCommand/
34
34
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListClustersCommandInput/
@@ -28,7 +28,7 @@ type RunTaskProps = {
28
28
  declare class AwsEcs extends BaseNamespace {
29
29
  client: ECSClient;
30
30
  config: any;
31
- init: (config: any, region?: string) => Promise<void>;
31
+ init: (config: any, region?: string) => Promise<this>;
32
32
  /**
33
33
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListClustersCommand/
34
34
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListClustersCommandInput/
@@ -14,6 +14,7 @@ var AwsEcs = class extends BaseNamespace {
14
14
  } catch (e) {
15
15
  throw new Error("AWS ECS Client not installed");
16
16
  }
17
+ return this;
17
18
  };
18
19
  /**
19
20
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListClustersCommand/
@@ -15,6 +15,7 @@ var AwsGlue = class extends require__class_BaseNamespace.BaseNamespace {
15
15
  } catch (e) {
16
16
  throw new Error("AWS Glue Client not installed");
17
17
  }
18
+ return this;
18
19
  };
19
20
  /**
20
21
  * Invoke an AWS Glue Crawler by passing in the name of the Crawler.
@@ -5,7 +5,7 @@ import { GlueClient } from "@aws-sdk/client-glue";
5
5
  declare class AwsGlue extends BaseNamespace {
6
6
  client: GlueClient;
7
7
  config: any;
8
- init: (config: any, region?: string) => Promise<void>;
8
+ init: (config: any, region?: string) => Promise<this>;
9
9
  /**
10
10
  * Invoke an AWS Glue Crawler by passing in the name of the Crawler.
11
11
  */
@@ -5,7 +5,7 @@ import { GlueClient } from "@aws-sdk/client-glue";
5
5
  declare class AwsGlue extends BaseNamespace {
6
6
  client: GlueClient;
7
7
  config: any;
8
- init: (config: any, region?: string) => Promise<void>;
8
+ init: (config: any, region?: string) => Promise<this>;
9
9
  /**
10
10
  * Invoke an AWS Glue Crawler by passing in the name of the Crawler.
11
11
  */
@@ -14,6 +14,7 @@ var AwsGlue = class extends BaseNamespace {
14
14
  } catch (e) {
15
15
  throw new Error("AWS Glue Client not installed");
16
16
  }
17
+ return this;
17
18
  };
18
19
  /**
19
20
  * Invoke an AWS Glue Crawler by passing in the name of the Crawler.
@@ -17,6 +17,7 @@ var AwsLambda = class extends require__class_BaseNamespace.BaseNamespace {
17
17
  } catch (e) {
18
18
  throw new Error("AWS Lambda Client not installed");
19
19
  }
20
+ return this;
20
21
  };
21
22
  /**
22
23
  * Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
@@ -11,7 +11,7 @@ type InvokeProps = {
11
11
  declare class AwsLambda extends BaseNamespace {
12
12
  client: LambdaClient;
13
13
  config: any;
14
- init: (config: any, region?: string) => Promise<void>;
14
+ init: (config: any, region?: string) => Promise<this>;
15
15
  /**
16
16
  * Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
17
17
  * Runs asynchronously, doesn't wait for function to fully end.
@@ -11,7 +11,7 @@ type InvokeProps = {
11
11
  declare class AwsLambda extends BaseNamespace {
12
12
  client: LambdaClient;
13
13
  config: any;
14
- init: (config: any, region?: string) => Promise<void>;
14
+ init: (config: any, region?: string) => Promise<this>;
15
15
  /**
16
16
  * Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
17
17
  * Runs asynchronously, doesn't wait for function to fully end.
@@ -16,6 +16,7 @@ var AwsLambda = class extends BaseNamespace {
16
16
  } catch (e) {
17
17
  throw new Error("AWS Lambda Client not installed");
18
18
  }
19
+ return this;
19
20
  };
20
21
  /**
21
22
  * Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
@@ -7,12 +7,12 @@ require("../../../date/index.cjs");
7
7
  const require_string_getFolder = require("../../../string/getFolder.cjs");
8
8
  const require_string_getStringFromStream = require("../../../string/getStringFromStream.cjs");
9
9
  require("../../../string/index.cjs");
10
- const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs");
11
- require("../../server/index.cjs");
12
10
  const require_util_server_getBrotliCompressed = require("../../../util/server/getBrotliCompressed.cjs");
13
11
  const require_util_server_getBrotliDecompressed = require("../../../util/server/getBrotliDecompressed.cjs");
14
12
  const require_util_server_getGzipCompressed = require("../../../util/server/getGzipCompressed.cjs");
15
13
  const require_util_server_getGzipDecompressed = require("../../../util/server/getGzipDecompressed.cjs");
14
+ const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs");
15
+ require("../../server/index.cjs");
16
16
  const require_aws_s3_server_awsS3File = require("./awsS3File.cjs");
17
17
  require("./index.cjs");
18
18
  let ky = require("ky");
@@ -30,6 +30,7 @@ var AwsS3 = class extends require__class_BaseNamespace.BaseNamespace {
30
30
  } catch (e) {
31
31
  throw new Error("AWS S3 Client not installed");
32
32
  }
33
+ return this;
33
34
  };
34
35
  copy = async (fromBucket, fromKey, toBucket, toKey) => {
35
36
  const { CopyObjectCommand } = await import("@aws-sdk/client-s3");
@@ -20,7 +20,7 @@ type WritePresignedPostProps = {
20
20
  declare class AwsS3 extends BaseNamespace {
21
21
  client: S3Client;
22
22
  config: any;
23
- init: (config: any, region?: string) => Promise<void>;
23
+ init: (config: any, region?: string) => Promise<this>;
24
24
  copy: (fromBucket: string, fromKey: string, toBucket: string, toKey: string) => Promise<void>;
25
25
  deleteFile: (bucket: string, key: string) => Promise<void>;
26
26
  deleteFiles: (bucket: string, keys: string[]) => Promise<void>;
@@ -20,7 +20,7 @@ type WritePresignedPostProps = {
20
20
  declare class AwsS3 extends BaseNamespace {
21
21
  client: S3Client;
22
22
  config: any;
23
- init: (config: any, region?: string) => Promise<void>;
23
+ init: (config: any, region?: string) => Promise<this>;
24
24
  copy: (fromBucket: string, fromKey: string, toBucket: string, toKey: string) => Promise<void>;
25
25
  deleteFile: (bucket: string, key: string) => Promise<void>;
26
26
  deleteFiles: (bucket: string, keys: string[]) => Promise<void>;
@@ -5,12 +5,12 @@ import "../../../date/index.mjs";
5
5
  import { getFolder } from "../../../string/getFolder.mjs";
6
6
  import { getStringFromStream } from "../../../string/getStringFromStream.mjs";
7
7
  import "../../../string/index.mjs";
8
- import { isResponse200 } from "../../server/isResponse200.mjs";
9
- import "../../server/index.mjs";
10
8
  import { getBrotliCompressed } from "../../../util/server/getBrotliCompressed.mjs";
11
9
  import { getBrotliDecompressed } from "../../../util/server/getBrotliDecompressed.mjs";
12
10
  import { getGzipCompressed } from "../../../util/server/getGzipCompressed.mjs";
13
11
  import { getGzipDecompressed } from "../../../util/server/getGzipDecompressed.mjs";
12
+ import { isResponse200 } from "../../server/isResponse200.mjs";
13
+ import "../../server/index.mjs";
14
14
  import { readFileDefault } from "./awsS3File.mjs";
15
15
  import "./index.mjs";
16
16
  import ky from "ky";
@@ -27,6 +27,7 @@ var AwsS3 = class extends BaseNamespace {
27
27
  } catch (e) {
28
28
  throw new Error("AWS S3 Client not installed");
29
29
  }
30
+ return this;
30
31
  };
31
32
  copy = async (fromBucket, fromKey, toBucket, toKey) => {
32
33
  const { CopyObjectCommand } = await import("@aws-sdk/client-s3");
@@ -13,6 +13,7 @@ var AwsSes = class extends require__class_BaseNamespace.BaseNamespace {
13
13
  } catch (e) {
14
14
  throw new Error("AWS SES Client not installed");
15
15
  }
16
+ return this;
16
17
  };
17
18
  send = async (input) => {
18
19
  let response;
@@ -5,7 +5,7 @@ import { SESClient, SendEmailCommandInput, SendRawEmailCommandInput } from "@aws
5
5
  declare class AwsSes extends BaseNamespace {
6
6
  client: SESClient;
7
7
  config: any;
8
- init: (config: any, region?: string) => Promise<void>;
8
+ init: (config: any, region?: string) => Promise<this>;
9
9
  send: (input: SendEmailCommandInput | SendRawEmailCommandInput) => Promise<unknown>;
10
10
  }
11
11
  //#endregion
@@ -5,7 +5,7 @@ import { SESClient, SendEmailCommandInput, SendRawEmailCommandInput } from "@aws
5
5
  declare class AwsSes extends BaseNamespace {
6
6
  client: SESClient;
7
7
  config: any;
8
- init: (config: any, region?: string) => Promise<void>;
8
+ init: (config: any, region?: string) => Promise<this>;
9
9
  send: (input: SendEmailCommandInput | SendRawEmailCommandInput) => Promise<unknown>;
10
10
  }
11
11
  //#endregion
@@ -12,6 +12,7 @@ var AwsSes = class extends BaseNamespace {
12
12
  } catch (e) {
13
13
  throw new Error("AWS SES Client not installed");
14
14
  }
15
+ return this;
15
16
  };
16
17
  send = async (input) => {
17
18
  let response;
@@ -13,6 +13,7 @@ var AwsSqs = class extends require__class_BaseNamespace.BaseNamespace {
13
13
  } catch (e) {
14
14
  throw new Error("AWS SQS Client not installed");
15
15
  }
16
+ return this;
16
17
  };
17
18
  addToQueue = async (props) => {
18
19
  const { SendMessageCommand } = await import("@aws-sdk/client-sqs");
@@ -28,7 +28,7 @@ type AddToQueue = {
28
28
  declare class AwsSqs extends BaseNamespace {
29
29
  client: SQSClient;
30
30
  config: any;
31
- init: (config: any, region?: string) => Promise<void>;
31
+ init: (config: any, region?: string) => Promise<this>;
32
32
  addToQueue: (props: AddToQueue) => Promise<_$_aws_sdk_client_sqs0.SendMessageCommandOutput>;
33
33
  deleteFromQueue: (queueUrl: string, recipientHandle: string) => Promise<_$_aws_sdk_client_sqs0.DeleteMessageCommandOutput>;
34
34
  isEventSqs: (event: SqsEvent) => Promise<boolean>;
@@ -28,7 +28,7 @@ type AddToQueue = {
28
28
  declare class AwsSqs extends BaseNamespace {
29
29
  client: SQSClient;
30
30
  config: any;
31
- init: (config: any, region?: string) => Promise<void>;
31
+ init: (config: any, region?: string) => Promise<this>;
32
32
  addToQueue: (props: AddToQueue) => Promise<_$_aws_sdk_client_sqs0.SendMessageCommandOutput>;
33
33
  deleteFromQueue: (queueUrl: string, recipientHandle: string) => Promise<_$_aws_sdk_client_sqs0.DeleteMessageCommandOutput>;
34
34
  isEventSqs: (event: SqsEvent) => Promise<boolean>;
@@ -12,6 +12,7 @@ var AwsSqs = class extends BaseNamespace {
12
12
  } catch (e) {
13
13
  throw new Error("AWS SQS Client not installed");
14
14
  }
15
+ return this;
15
16
  };
16
17
  addToQueue = async (props) => {
17
18
  const { SendMessageCommand } = await import("@aws-sdk/client-sqs");
@@ -15,6 +15,7 @@ var AwsSsm = class extends require__class_BaseNamespace.BaseNamespace {
15
15
  } catch (e) {
16
16
  throw new Error("AWS SSM Client not installed");
17
17
  }
18
+ return this;
18
19
  };
19
20
  getParameter = async (name, withDecryption = false, isJson = true) => {
20
21
  if (!this.parameters.has(name)) {
@@ -6,7 +6,7 @@ declare class AwsSsm extends BaseNamespace {
6
6
  client: SSMClient;
7
7
  config: any;
8
8
  parameters: Map<string, any>;
9
- init: (config: any, region?: string) => Promise<void>;
9
+ init: (config: any, region?: string) => Promise<this>;
10
10
  getParameter: (name: string, withDecryption?: boolean, isJson?: boolean) => Promise<any>;
11
11
  }
12
12
  //#endregion
@@ -6,7 +6,7 @@ declare class AwsSsm extends BaseNamespace {
6
6
  client: SSMClient;
7
7
  config: any;
8
8
  parameters: Map<string, any>;
9
- init: (config: any, region?: string) => Promise<void>;
9
+ init: (config: any, region?: string) => Promise<this>;
10
10
  getParameter: (name: string, withDecryption?: boolean, isJson?: boolean) => Promise<any>;
11
11
  }
12
12
  //#endregion
@@ -14,6 +14,7 @@ var AwsSsm = class extends BaseNamespace {
14
14
  } catch (e) {
15
15
  throw new Error("AWS SSM Client not installed");
16
16
  }
17
+ return this;
17
18
  };
18
19
  getParameter = async (name, withDecryption = false, isJson = true) => {
19
20
  if (!this.parameters.has(name)) {
@@ -65,6 +65,7 @@ var Drizzle = class extends require__class_BaseNamespace.BaseNamespace {
65
65
  }
66
66
  else throw new Error(`No database type configured`);
67
67
  }
68
+ return this;
68
69
  };
69
70
  };
70
71
  //#endregion
@@ -17,10 +17,12 @@ type DrizzleConfig<TSchema extends Record<string, unknown> = Record<string, unkn
17
17
  connectTimeoutMs?: number;
18
18
  };
19
19
  };
20
- declare class Drizzle<TClient = any> extends BaseNamespace {
21
- client: TClient;
20
+ declare class Drizzle extends BaseNamespace {
21
+ client: any;
22
22
  config: DrizzleConfig;
23
- init: (config: DrizzleConfig) => Promise<void>;
23
+ init: <TClient = any>(config: DrizzleConfig) => Promise<Drizzle & {
24
+ client: TClient;
25
+ }>;
24
26
  }
25
27
  //#endregion
26
28
  export { Drizzle, DrizzleConfig };
@@ -17,10 +17,12 @@ type DrizzleConfig<TSchema extends Record<string, unknown> = Record<string, unkn
17
17
  connectTimeoutMs?: number;
18
18
  };
19
19
  };
20
- declare class Drizzle<TClient = any> extends BaseNamespace {
21
- client: TClient;
20
+ declare class Drizzle extends BaseNamespace {
21
+ client: any;
22
22
  config: DrizzleConfig;
23
- init: (config: DrizzleConfig) => Promise<void>;
23
+ init: <TClient = any>(config: DrizzleConfig) => Promise<Drizzle & {
24
+ client: TClient;
25
+ }>;
24
26
  }
25
27
  //#endregion
26
28
  export { Drizzle, DrizzleConfig };
@@ -64,6 +64,7 @@ var Drizzle = class extends BaseNamespace {
64
64
  }
65
65
  else throw new Error(`No database type configured`);
66
66
  }
67
+ return this;
67
68
  };
68
69
  };
69
70
  //#endregion
@@ -16,6 +16,7 @@ var GoogleAds = class extends require__class_BaseNamespace.BaseNamespace {
16
16
  } catch (e) {
17
17
  throw new Error("Google Sheets Client not installed");
18
18
  }
19
+ return this;
19
20
  };
20
21
  getCustomer = async (customerId) => {
21
22
  return {
@@ -11,7 +11,7 @@ declare class GoogleAds extends BaseNamespace {
11
11
  config: Config;
12
12
  mccAccountId: string;
13
13
  refreshToken: string;
14
- init: (config: Config, mccAccountId: string, refreshToken: string) => Promise<void>;
14
+ init: (config: Config, mccAccountId: string, refreshToken: string) => Promise<this>;
15
15
  getCustomer: (customerId: string) => Promise<{
16
16
  customer_id: string;
17
17
  login_customer_id: string;
@@ -11,7 +11,7 @@ declare class GoogleAds extends BaseNamespace {
11
11
  config: Config;
12
12
  mccAccountId: string;
13
13
  refreshToken: string;
14
- init: (config: Config, mccAccountId: string, refreshToken: string) => Promise<void>;
14
+ init: (config: Config, mccAccountId: string, refreshToken: string) => Promise<this>;
15
15
  getCustomer: (customerId: string) => Promise<{
16
16
  customer_id: string;
17
17
  login_customer_id: string;
@@ -15,6 +15,7 @@ var GoogleAds = class extends BaseNamespace {
15
15
  } catch (e) {
16
16
  throw new Error("Google Sheets Client not installed");
17
17
  }
18
+ return this;
18
19
  };
19
20
  getCustomer = async (customerId) => {
20
21
  return {
@@ -20,6 +20,7 @@ var GoogleCloudBigquery = class extends require__class_BaseNamespace.BaseNamespa
20
20
  } catch (e) {
21
21
  throw new Error("Google BigQuery Client not installed");
22
22
  }
23
+ return this;
23
24
  };
24
25
  /**
25
26
  * Create a Dataset if it doesn't already exist.
@@ -23,7 +23,7 @@ declare class GoogleCloudBigquery extends BaseNamespace {
23
23
  /**
24
24
  * Either a Google Cloud JSON Config or V10 Auth helper.
25
25
  */
26
- init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<void>;
26
+ init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
27
27
  /**
28
28
  * Create a Dataset if it doesn't already exist.
29
29
  * Returns table instance.
@@ -23,7 +23,7 @@ declare class GoogleCloudBigquery extends BaseNamespace {
23
23
  /**
24
24
  * Either a Google Cloud JSON Config or V10 Auth helper.
25
25
  */
26
- init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<void>;
26
+ init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
27
27
  /**
28
28
  * Create a Dataset if it doesn't already exist.
29
29
  * Returns table instance.
@@ -19,6 +19,7 @@ var GoogleCloudBigquery = class extends BaseNamespace {
19
19
  } catch (e) {
20
20
  throw new Error("Google BigQuery Client not installed");
21
21
  }
22
+ return this;
22
23
  };
23
24
  /**
24
25
  * Create a Dataset if it doesn't already exist.
@@ -17,6 +17,7 @@ var GoogleCloudSheets = class extends require__class_BaseNamespace.BaseNamespace
17
17
  } catch (e) {
18
18
  throw new Error("Google Sheets Client not installed");
19
19
  }
20
+ return this;
20
21
  };
21
22
  getBatchData = async (props) => {
22
23
  return (await (await import("@googleapis/sheets")).sheets("v4").spreadsheets.values.batchGet({
@@ -15,7 +15,7 @@ declare class GoogleCloudSheets extends BaseNamespace {
15
15
  /**
16
16
  * Either a Google Cloud JSON Config or V10 Auth helper.
17
17
  */
18
- init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<void>;
18
+ init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
19
19
  getBatchData: (props: GetBatchDataProps) => Promise<_$_googleapis_sheets0.sheets_v4.Schema$BatchGetValuesResponse>;
20
20
  }
21
21
  //#endregion
@@ -15,7 +15,7 @@ declare class GoogleCloudSheets extends BaseNamespace {
15
15
  /**
16
16
  * Either a Google Cloud JSON Config or V10 Auth helper.
17
17
  */
18
- init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<void>;
18
+ init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
19
19
  getBatchData: (props: GetBatchDataProps) => Promise<_$_googleapis_sheets0.sheets_v4.Schema$BatchGetValuesResponse>;
20
20
  }
21
21
  //#endregion
@@ -16,6 +16,7 @@ var GoogleCloudSheets = class extends BaseNamespace {
16
16
  } catch (e) {
17
17
  throw new Error("Google Sheets Client not installed");
18
18
  }
19
+ return this;
19
20
  };
20
21
  getBatchData = async (props) => {
21
22
  return (await (await import("@googleapis/sheets")).sheets("v4").spreadsheets.values.batchGet({
@@ -22,6 +22,7 @@ var GoogleCloudStorage = class extends require__class_BaseNamespace.BaseNamespac
22
22
  } catch (e) {
23
23
  throw new Error("Google Cloud Storage Client not installed");
24
24
  }
25
+ return this;
25
26
  };
26
27
  /**
27
28
  * Copy a local file to Google Cloud Storage.
@@ -11,7 +11,7 @@ declare class GoogleCloudStorage extends BaseNamespace {
11
11
  /**
12
12
  * Either a Google Cloud JSON Config or V9 Auth helper.
13
13
  */
14
- init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<void>;
14
+ init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
15
15
  /**
16
16
  * Copy a local file to Google Cloud Storage.
17
17
  */
@@ -11,7 +11,7 @@ declare class GoogleCloudStorage extends BaseNamespace {
11
11
  /**
12
12
  * Either a Google Cloud JSON Config or V9 Auth helper.
13
13
  */
14
- init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<void>;
14
+ init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
15
15
  /**
16
16
  * Copy a local file to Google Cloud Storage.
17
17
  */
@@ -19,6 +19,7 @@ var GoogleCloudStorage = class extends BaseNamespace {
19
19
  } catch (e) {
20
20
  throw new Error("Google Cloud Storage Client not installed");
21
21
  }
22
+ return this;
22
23
  };
23
24
  /**
24
25
  * Copy a local file to Google Cloud Storage.
@@ -15,6 +15,7 @@ var GooglePageSpeed = class extends require__class_BaseNamespace.BaseNamespace {
15
15
  } catch (e) {
16
16
  throw new Error("Google PageSpeed Client not installed");
17
17
  }
18
+ return this;
18
19
  };
19
20
  getReport = async (url, inputCategory = require_googlePageSpeed_server_category.category.PERFORMANCE, inputStrategy = require_googlePageSpeed_server_strategy.strategy.MOBILE) => {
20
21
  const apiResponse = await require_api_get.get(`https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${url}&strategy=${inputStrategy}&category=${inputCategory}&key=${this.config.apiKey}`);
@@ -12,7 +12,7 @@ type GooglePageSpeedConfig = {
12
12
  declare class GooglePageSpeed extends BaseNamespace {
13
13
  client: boolean;
14
14
  config: GooglePageSpeedConfig;
15
- init: (config: GooglePageSpeedConfig) => Promise<void>;
15
+ init: (config: GooglePageSpeedConfig) => Promise<this>;
16
16
  getReport: (url: string, inputCategory?: Category, inputStrategy?: Strategy) => Promise<any>;
17
17
  }
18
18
  //#endregion
@@ -12,7 +12,7 @@ type GooglePageSpeedConfig = {
12
12
  declare class GooglePageSpeed extends BaseNamespace {
13
13
  client: boolean;
14
14
  config: GooglePageSpeedConfig;
15
- init: (config: GooglePageSpeedConfig) => Promise<void>;
15
+ init: (config: GooglePageSpeedConfig) => Promise<this>;
16
16
  getReport: (url: string, inputCategory?: Category, inputStrategy?: Strategy) => Promise<any>;
17
17
  }
18
18
  //#endregion
@@ -14,6 +14,7 @@ var GooglePageSpeed = class extends BaseNamespace {
14
14
  } catch (e) {
15
15
  throw new Error("Google PageSpeed Client not installed");
16
16
  }
17
+ return this;
17
18
  };
18
19
  getReport = async (url, inputCategory = category.PERFORMANCE, inputStrategy = strategy.MOBILE) => {
19
20
  const apiResponse = await get(`https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${url}&strategy=${inputStrategy}&category=${inputCategory}&key=${this.config.apiKey}`);
@@ -13,6 +13,7 @@ var LittleWarden = class extends require__class_BaseNamespace.BaseNamespace {
13
13
  } catch (e) {
14
14
  throw new Error("Google PageSpeed Client not installed");
15
15
  }
16
+ return this;
16
17
  };
17
18
  getReport = async (urlId) => {
18
19
  const apiResponse = await require_api_get.get(`https://littlewarden.com/api/sites/${urlId}`, { headers: { "Authorization": `Token token="${this.config.apiKey}"` } });
@@ -10,7 +10,7 @@ type LittleWardenConfig = {
10
10
  declare class LittleWarden extends BaseNamespace {
11
11
  client: boolean;
12
12
  config: LittleWardenConfig;
13
- init: (config: LittleWardenConfig) => Promise<void>;
13
+ init: (config: LittleWardenConfig) => Promise<this>;
14
14
  getReport: (urlId: string) => Promise<any>;
15
15
  }
16
16
  //#endregion
@@ -10,7 +10,7 @@ type LittleWardenConfig = {
10
10
  declare class LittleWarden extends BaseNamespace {
11
11
  client: boolean;
12
12
  config: LittleWardenConfig;
13
- init: (config: LittleWardenConfig) => Promise<void>;
13
+ init: (config: LittleWardenConfig) => Promise<this>;
14
14
  getReport: (urlId: string) => Promise<any>;
15
15
  }
16
16
  //#endregion
@@ -12,6 +12,7 @@ var LittleWarden = class extends BaseNamespace {
12
12
  } catch (e) {
13
13
  throw new Error("Google PageSpeed Client not installed");
14
14
  }
15
+ return this;
15
16
  };
16
17
  getReport = async (urlId) => {
17
18
  const apiResponse = await get(`https://littlewarden.com/api/sites/${urlId}`, { headers: { "Authorization": `Token token="${this.config.apiKey}"` } });
@@ -16,6 +16,7 @@ var OnePassword = class extends require__class_BaseNamespace.BaseNamespace {
16
16
  if (e instanceof Error) throw new Error("Error initialising 1Password client", e);
17
17
  throw new Error("An unexpected error occurred during 1Password setup");
18
18
  }
19
+ return this;
19
20
  };
20
21
  listVaults = async () => {
21
22
  return this.client.vaults.list();
@@ -10,7 +10,7 @@ type OnePasswordConfig = {
10
10
  };
11
11
  declare class OnePassword extends BaseNamespace {
12
12
  client: Client;
13
- init: (config: OnePasswordConfig) => Promise<this | undefined>;
13
+ init: (config: OnePasswordConfig) => Promise<this>;
14
14
  listVaults: () => Promise<_$_1password_sdk0.VaultOverview[]>;
15
15
  getItem: (url: string) => Promise<_$_1password_sdk0.Item>;
16
16
  getNote: (url: string) => Promise<string | null>;
@@ -10,7 +10,7 @@ type OnePasswordConfig = {
10
10
  };
11
11
  declare class OnePassword extends BaseNamespace {
12
12
  client: Client;
13
- init: (config: OnePasswordConfig) => Promise<this | undefined>;
13
+ init: (config: OnePasswordConfig) => Promise<this>;
14
14
  listVaults: () => Promise<_$_1password_sdk0.VaultOverview[]>;
15
15
  getItem: (url: string) => Promise<_$_1password_sdk0.Item>;
16
16
  getNote: (url: string) => Promise<string | null>;
@@ -15,6 +15,7 @@ var OnePassword = class extends BaseNamespace {
15
15
  if (e instanceof Error) throw new Error("Error initialising 1Password client", e);
16
16
  throw new Error("An unexpected error occurred during 1Password setup");
17
17
  }
18
+ return this;
18
19
  };
19
20
  listVaults = async () => {
20
21
  return this.client.vaults.list();
@@ -11,6 +11,7 @@ var OpenAi = class extends require__class_BaseNamespace.BaseNamespace {
11
11
  this.client = true;
12
12
  this.config = config;
13
13
  }
14
+ return this;
14
15
  };
15
16
  completion = async (prompt, temperature = 1, maxTokens = -1, model = "gpt-3.5-turbo") => {
16
17
  let response = null;
@@ -10,7 +10,7 @@ declare class OpenAi extends BaseNamespace {
10
10
  /**
11
11
  * Renew the access token as it expires every 3 hours.
12
12
  */
13
- init: (config: OpenAiConfig) => Promise<void>;
13
+ init: (config: OpenAiConfig) => Promise<this>;
14
14
  completion: (prompt: string, temperature?: number, maxTokens?: number, model?: string) => Promise<any>;
15
15
  }
16
16
  //#endregion
@@ -10,7 +10,7 @@ declare class OpenAi extends BaseNamespace {
10
10
  /**
11
11
  * Renew the access token as it expires every 3 hours.
12
12
  */
13
- init: (config: OpenAiConfig) => Promise<void>;
13
+ init: (config: OpenAiConfig) => Promise<this>;
14
14
  completion: (prompt: string, temperature?: number, maxTokens?: number, model?: string) => Promise<any>;
15
15
  }
16
16
  //#endregion
@@ -10,6 +10,7 @@ var OpenAi = class extends BaseNamespace {
10
10
  this.client = true;
11
11
  this.config = config;
12
12
  }
13
+ return this;
13
14
  };
14
15
  completion = async (prompt, temperature = 1, maxTokens = -1, model = "gpt-3.5-turbo") => {
15
16
  let response = null;
@@ -17,6 +17,7 @@ var Snapchat = class extends require__class_BaseNamespace.BaseNamespace {
17
17
  refreshToken: apiResponse.getBodyDefaultTo(["data", "access_token"], null)
18
18
  };
19
19
  }
20
+ return this;
20
21
  };
21
22
  };
22
23
  //#endregion
@@ -16,7 +16,7 @@ declare class Snapchat extends BaseNamespace {
16
16
  /**
17
17
  * Renew the access token as it expires every 3 hours.
18
18
  */
19
- init: (config: SnapchatConfig) => Promise<void>;
19
+ init: (config: SnapchatConfig) => Promise<this>;
20
20
  }
21
21
  //#endregion
22
22
  export { Snapchat, SnapchatConfig };
@@ -16,7 +16,7 @@ declare class Snapchat extends BaseNamespace {
16
16
  /**
17
17
  * Renew the access token as it expires every 3 hours.
18
18
  */
19
- init: (config: SnapchatConfig) => Promise<void>;
19
+ init: (config: SnapchatConfig) => Promise<this>;
20
20
  }
21
21
  //#endregion
22
22
  export { Snapchat, SnapchatConfig };
@@ -15,6 +15,7 @@ var Snapchat = class extends BaseNamespace {
15
15
  refreshToken: apiResponse.getBodyDefaultTo(["data", "access_token"], null)
16
16
  };
17
17
  }
18
+ return this;
18
19
  };
19
20
  };
20
21
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "3.0.2",
4
+ "version": "3.0.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"