@8ms/helpers 2.0.4 → 2.0.7

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 (132) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/adverity/server.d.ts +1 -0
  3. package/adverity/server.js +5 -0
  4. package/aws/athenaExpress/AwsAthenaNamespace.d.ts +1 -1
  5. package/aws/athenaExpress/{index.js → server.js} +3 -3
  6. package/aws/ec2/AwsEc2Namespace.d.ts +1 -1
  7. package/aws/ec2/{index.d.ts → server.d.ts} +1 -1
  8. package/aws/ec2/{index.js → server.js} +2 -2
  9. package/aws/ecs/AwsEcsNamespace.d.ts +1 -1
  10. package/aws/ecs/AwsEcsNamespace.js +5 -5
  11. package/aws/ecs/{index.d.ts → server.d.ts} +1 -1
  12. package/aws/ecs/{index.js → server.js} +2 -2
  13. package/aws/glue/AwsGlueNamespace.d.ts +1 -1
  14. package/aws/glue/AwsGlueNamespace.js +2 -2
  15. package/aws/glue/{index.d.ts → server.d.ts} +1 -1
  16. package/aws/glue/{index.js → server.js} +2 -2
  17. package/aws/lambda/AwsLambdaNamespace.d.ts +1 -1
  18. package/aws/lambda/AwsLambdaNamespace.js +2 -2
  19. package/aws/lambda/{index.d.ts → server.d.ts} +1 -1
  20. package/aws/lambda/{index.js → server.js} +2 -2
  21. package/aws/s3/AwsS3Namespace.d.ts +2 -2
  22. package/aws/s3/AwsS3Namespace.js +12 -12
  23. package/aws/s3/{index.d.ts → server.d.ts} +1 -1
  24. package/aws/s3/{index.js → server.js} +2 -2
  25. package/aws/{index.js → server.js} +3 -3
  26. package/aws/ses/AwsSesNamespace.d.ts +1 -1
  27. package/aws/ses/{index.d.ts → server.d.ts} +1 -1
  28. package/aws/ses/{index.js → server.js} +2 -2
  29. package/aws/sqs/AwsSqsNamespace.d.ts +1 -1
  30. package/aws/sqs/{index.d.ts → server.d.ts} +1 -1
  31. package/aws/sqs/{index.js → server.js} +2 -2
  32. package/aws/ssm/AwsSsmNamespace.d.ts +1 -1
  33. package/aws/ssm/{index.d.ts → server.d.ts} +1 -1
  34. package/aws/ssm/{index.js → server.js} +2 -2
  35. package/boolean/index.d.ts +4 -1
  36. package/boolean/index.js +20 -2
  37. package/brightData/serpApi/getAsyncRequestId.d.ts +2 -2
  38. package/brightData/serpApi/getAsyncRequestId.js +5 -5
  39. package/brightData/serpApi/getAsyncResults.d.ts +1 -1
  40. package/brightData/serpApi/getAsyncResults.js +3 -3
  41. package/brightData/serpApi/getRealtime.d.ts +1 -1
  42. package/brightData/webScraperIde/getBatch.d.ts +1 -1
  43. package/brightData/webScraperIde/getRealtime.d.ts +1 -1
  44. package/cache/{index.d.ts → server.d.ts} +5 -0
  45. package/cache/test/cache.test.js +5 -5
  46. package/eskimi/getAgeGroup.js +2 -2
  47. package/eskimi/getDevice.js +2 -2
  48. package/eskimi/getGender.js +2 -2
  49. package/file/index.d.ts +5 -1
  50. package/file/index.js +47 -2
  51. package/google/bigQuery/GoogleBigQueryNamespace.d.ts +1 -1
  52. package/google/bigQuery/GoogleBigQueryNamespace.js +2 -2
  53. package/google/bigQuery/{index.js → server.js} +3 -3
  54. package/google/sheets/GoogleSheetsNamespace.d.ts +1 -1
  55. package/google/sheets/GoogleSheetsNamespace.js +2 -2
  56. package/google/sheets/{index.js → server.js} +3 -3
  57. package/google/storage/GoogleCloudStorageNamespace.d.ts +1 -1
  58. package/google/storage/GoogleCloudStorageNamespace.js +2 -2
  59. package/google/storage/{index.js → server.js} +3 -3
  60. package/googleAds/GoogleAdsNamespace.d.ts +1 -1
  61. package/googleAds/{index.js → server.js} +3 -3
  62. package/googlePageSpeed/GooglePageSpeedNamespace.d.ts +1 -1
  63. package/googlePageSpeed/GooglePageSpeedNamespace.js +2 -2
  64. package/googlePageSpeed/{index.js → server.js} +3 -3
  65. package/littleWarden/LittleWardenNamespace.d.ts +1 -1
  66. package/littleWarden/{index.js → server.js} +3 -3
  67. package/lumar/api/buildRequest.d.ts +1 -1
  68. package/lumar/api/buildRequest.js +13 -13
  69. package/lumar/graphql/queries/getReportDifferences.js +2 -2
  70. package/onePassword/OnePasswordNamespace.d.ts +1 -1
  71. package/openAi/OpenAiNamespace.d.ts +1 -1
  72. package/openAi/{index.js → server.js} +3 -3
  73. package/package.json +1 -1
  74. package/prisma/PrismaNamespace.d.ts +1 -1
  75. package/prisma/{index.d.ts → server.d.ts} +1 -1
  76. package/snapchat/SnapchatNamespace.d.ts +1 -1
  77. package/snapchat/{index.js → server.js} +3 -3
  78. package/upTimeRobot/UpTimeRobotNamespace.d.ts +1 -1
  79. package/upTimeRobot/{index.js → server.js} +3 -3
  80. package/url/index.d.ts +0 -4
  81. package/url/index.js +1 -45
  82. package/url/server.d.ts +1 -0
  83. package/url/server.js +5 -0
  84. package/util/index.d.ts +0 -4
  85. package/util/index.js +1 -9
  86. package/util/server.d.ts +4 -0
  87. package/util/server.js +11 -0
  88. package/boolean/getBoolean.d.ts +0 -4
  89. package/boolean/getBoolean.js +0 -23
  90. package/file/createDirectory.d.ts +0 -5
  91. package/file/createDirectory.js +0 -50
  92. /package/aws/athenaExpress/{index.d.ts → server.d.ts} +0 -0
  93. /package/aws/{index.d.ts → server.d.ts} +0 -0
  94. /package/brightData/serpApi/{index.d.ts → server.d.ts} +0 -0
  95. /package/brightData/serpApi/{index.js → server.js} +0 -0
  96. /package/brightData/{index.d.ts → server.d.ts} +0 -0
  97. /package/brightData/{index.js → server.js} +0 -0
  98. /package/brightData/webScraperIde/{index.d.ts → server.d.ts} +0 -0
  99. /package/brightData/webScraperIde/{index.js → server.js} +0 -0
  100. /package/cache/{index.js → server.js} +0 -0
  101. /package/eskimi/{index.d.ts → server.d.ts} +0 -0
  102. /package/eskimi/{index.js → server.js} +0 -0
  103. /package/google/bigQuery/{index.d.ts → server.d.ts} +0 -0
  104. /package/google/{index.d.ts → server.d.ts} +0 -0
  105. /package/google/{index.js → server.js} +0 -0
  106. /package/google/sheets/{index.d.ts → server.d.ts} +0 -0
  107. /package/google/storage/{index.d.ts → server.d.ts} +0 -0
  108. /package/googleAds/keywordPlanner/{index.d.ts → server.d.ts} +0 -0
  109. /package/googleAds/keywordPlanner/{index.js → server.js} +0 -0
  110. /package/googleAds/{index.d.ts → server.d.ts} +0 -0
  111. /package/googlePageSpeed/{index.d.ts → server.d.ts} +0 -0
  112. /package/googleSearchIncidents/{index.d.ts → server.d.ts} +0 -0
  113. /package/googleSearchIncidents/{index.js → server.js} +0 -0
  114. /package/greenDomain/{index.d.ts → server.d.ts} +0 -0
  115. /package/greenDomain/{index.js → server.js} +0 -0
  116. /package/inngest/{index.d.ts → server.d.ts} +0 -0
  117. /package/inngest/{index.js → server.js} +0 -0
  118. /package/littleWarden/{index.d.ts → server.d.ts} +0 -0
  119. /package/lumar/api/{index.d.ts → server.d.ts} +0 -0
  120. /package/lumar/api/{index.js → server.js} +0 -0
  121. /package/lumar/graphql/{index.d.ts → server.d.ts} +0 -0
  122. /package/lumar/graphql/{index.js → server.js} +0 -0
  123. /package/myTarget/{request.d.ts → server.d.ts} +0 -0
  124. /package/myTarget/{request.js → server.js} +0 -0
  125. /package/onePassword/{index.d.ts → server.d.ts} +0 -0
  126. /package/onePassword/{index.js → server.js} +0 -0
  127. /package/openAi/{index.d.ts → server.d.ts} +0 -0
  128. /package/prisma/{index.js → server.js} +0 -0
  129. /package/snapchat/{index.d.ts → server.d.ts} +0 -0
  130. /package/stream/{index.d.ts → server.d.ts} +0 -0
  131. /package/stream/{index.js → server.js} +0 -0
  132. /package/upTimeRobot/{index.d.ts → server.d.ts} +0 -0
Binary file
@@ -0,0 +1 @@
1
+ export { getJobs } from "./getJobs";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getJobs = void 0;
4
+ var getJobs_1 = require("./getJobs");
5
+ Object.defineProperty(exports, "getJobs", { enumerable: true, get: function () { return getJobs_1.getJobs; } });
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AthenaConfig } from "./index";
2
+ import { AthenaConfig } from "./server";
3
3
  export declare class AwsAthenaNamespace extends BaseNamespace {
4
4
  client: any | null;
5
5
  config: AthenaConfig;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.awsAthenaClient = void 0;
4
4
  const AwsAthenaNamespace_1 = require("./AwsAthenaNamespace");
5
- const onePassword_1 = require("../../onePassword");
5
+ const server_1 = require("../../onePassword/server");
6
6
  const awsAthenaNamespaces = new Map();
7
7
  const awsAthenaClient = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsAthenaNamespaces.has(key)) {
@@ -13,11 +13,11 @@ const awsAthenaClient = async (key = "default", config, vaultId, itemId) => {
13
13
  instanceConfig = config;
14
14
  }
15
15
  else if (vaultId && itemId) {
16
- instanceConfig = await (await (0, onePassword_1.onePasswordClient)())
16
+ instanceConfig = await (await (0, server_1.onePasswordClient)())
17
17
  .getJsonNote(vaultId, itemId);
18
18
  }
19
19
  else if ("default" === key && process.env.AWS_VAULT_ID && process.env.AWS_ITEM_ID) {
20
- instanceConfig = await (await (0, onePassword_1.onePasswordClient)())
20
+ instanceConfig = await (await (0, server_1.onePasswordClient)())
21
21
  .getJsonNote(process.env.AWS_VAULT_ID, process.env.AWS_ITEM_ID);
22
22
  }
23
23
  else if ("default" === key && process.env.ATHENA_REGION && process.env.ATHENA_ACCESS_KEY_ID && process.env.ATHENA_SECRET_ACCESS_KEY && process.env.ATHENA_S3_BUCKET && process.env.ATHENA_S3_KEY && process.env.ATHENA_DATABASE) {
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { EC2Client } from "@aws-sdk/client-ec2";
4
4
  export declare class AwsEc2Namespace extends BaseNamespace {
5
5
  client: EC2Client | null;
@@ -1,3 +1,3 @@
1
1
  import { AwsEc2Namespace } from "./AwsEc2Namespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsEc2Client: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsEc2Namespace>;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.awsEc2Client = void 0;
4
4
  const AwsEc2Namespace_1 = require("./AwsEc2Namespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsEc2Namespaces = new Map();
7
7
  const awsEc2Client = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsEc2Namespaces.has(key)) {
9
9
  return awsEc2Namespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsEc2Namespace_1.AwsEc2Namespace(key, instanceConfig);
13
13
  awsEc2Namespaces.set(key, namespace);
14
14
  return namespace;
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { DesiredStatus, ECSClient, LaunchType, NetworkConfiguration, SortOrder, TaskDefinitionStatus, TaskOverride } from "@aws-sdk/client-ecs";
4
4
  type GetTaskDefinitionsProps = {
5
5
  familyPrefix?: string;
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.AwsEcsNamespace = void 0;
37
37
  const _class_1 = require("../../_class");
38
- const __1 = require("../");
38
+ const server_1 = require("../server");
39
39
  class AwsEcsNamespace extends _class_1.BaseNamespace {
40
40
  constructor() {
41
41
  super(...arguments);
@@ -66,7 +66,7 @@ class AwsEcsNamespace extends _class_1.BaseNamespace {
66
66
  nextToken: apiResponse?.nextToken,
67
67
  });
68
68
  apiResponse = await this.client.send(listClustersCommand);
69
- if ((0, __1.isResponse200)(apiResponse)) {
69
+ if ((0, server_1.isResponse200)(apiResponse)) {
70
70
  response = [
71
71
  ...response,
72
72
  ...apiResponse.clusterArns,
@@ -93,7 +93,7 @@ class AwsEcsNamespace extends _class_1.BaseNamespace {
93
93
  nextToken: apiResponse?.nextToken,
94
94
  });
95
95
  apiResponse = await global.awsEcsClient.send(listTaskDefinitionsCommand);
96
- if ((0, __1.isResponse200)(apiResponse)) {
96
+ if ((0, server_1.isResponse200)(apiResponse)) {
97
97
  response = [
98
98
  ...response,
99
99
  ...apiResponse.taskDefinitionArns,
@@ -123,7 +123,7 @@ class AwsEcsNamespace extends _class_1.BaseNamespace {
123
123
  startedBy: props?.startedBy,
124
124
  });
125
125
  apiResponse = await global.awsEcsClient.send(listTasksCommand);
126
- if ((0, __1.isResponse200)(apiResponse)) {
126
+ if ((0, server_1.isResponse200)(apiResponse)) {
127
127
  response = [
128
128
  ...response,
129
129
  ...apiResponse.taskArns,
@@ -149,7 +149,7 @@ class AwsEcsNamespace extends _class_1.BaseNamespace {
149
149
  taskDefinition: props?.taskDefinition,
150
150
  });
151
151
  const apiResponse = await global.awsEcsClient.send(runtTaskCommand);
152
- if ((0, __1.isResponse200)(apiResponse)) {
152
+ if ((0, server_1.isResponse200)(apiResponse)) {
153
153
  response = apiResponse;
154
154
  }
155
155
  return response;
@@ -1,3 +1,3 @@
1
1
  import { AwsEcsNamespace } from "./AwsEcsNamespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsEcsClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsEcsNamespace>;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.awsEcsClient = void 0;
4
4
  const AwsEcsNamespace_1 = require("./AwsEcsNamespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsEcsNamespaces = new Map();
7
7
  const awsEcsClient = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsEcsNamespaces.has(key)) {
9
9
  return awsEcsNamespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsEcsNamespace_1.AwsEcsNamespace(key, instanceConfig);
13
13
  awsEcsNamespaces.set(key, namespace);
14
14
  return namespace;
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { GlueClient } from "@aws-sdk/client-glue";
4
4
  export declare class AwsGlueNamespace extends BaseNamespace {
5
5
  client: GlueClient | null;
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.AwsGlueNamespace = void 0;
37
37
  const _class_1 = require("../../_class");
38
- const __1 = require("../");
38
+ const server_1 = require("../server");
39
39
  class AwsGlueNamespace extends _class_1.BaseNamespace {
40
40
  constructor() {
41
41
  super(...arguments);
@@ -63,7 +63,7 @@ class AwsGlueNamespace extends _class_1.BaseNamespace {
63
63
  // Fire the event but don't wait for it to complete
64
64
  const apiResponse = await this.client.send(command);
65
65
  // Success
66
- return (0, __1.isResponse200)(apiResponse);
66
+ return (0, server_1.isResponse200)(apiResponse);
67
67
  };
68
68
  }
69
69
  }
@@ -1,3 +1,3 @@
1
1
  import { AwsGlueNamespace } from "./AwsGlueNamespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsGlueClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsGlueNamespace>;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.awsGlueClient = void 0;
4
4
  const AwsGlueNamespace_1 = require("./AwsGlueNamespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsGlueNamespaces = new Map();
7
7
  const awsGlueClient = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsGlueNamespaces.has(key)) {
9
9
  return awsGlueNamespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsGlueNamespace_1.AwsGlueNamespace(key, instanceConfig);
13
13
  awsGlueNamespaces.set(key, namespace);
14
14
  return namespace;
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { LambdaClient } from "@aws-sdk/client-lambda";
4
4
  type InvokeProps = {
5
5
  awaitResponse?: boolean;
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.AwsLambdaNamespace = void 0;
37
37
  const _class_1 = require("../../_class");
38
- const __1 = require("../");
38
+ const server_1 = require("../server");
39
39
  const api_1 = require("../../api");
40
40
  class AwsLambdaNamespace extends _class_1.BaseNamespace {
41
41
  constructor() {
@@ -75,7 +75,7 @@ class AwsLambdaNamespace extends _class_1.BaseNamespace {
75
75
  // Fire the event but don't wait for it to complete
76
76
  const apiResponse = await this.client.send(command);
77
77
  // Success
78
- if ((0, __1.isResponse200)(apiResponse)) {
78
+ if ((0, server_1.isResponse200)(apiResponse)) {
79
79
  // Return the data
80
80
  if (props.awaitResponse && undefined !== apiResponse.Payload) {
81
81
  const asciiDecoder = new TextDecoder("ascii");
@@ -1,4 +1,4 @@
1
1
  import { AwsLambdaNamespace } from "./AwsLambdaNamespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsLambdaClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsLambdaNamespace>;
4
4
  export declare const getHandlerPath: (input: string) => string;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getHandlerPath = exports.awsLambdaClient = void 0;
4
4
  const AwsLambdaNamespace_1 = require("./AwsLambdaNamespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsLambdaNamespaces = new Map();
7
7
  const awsLambdaClient = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsLambdaNamespaces.has(key)) {
9
9
  return awsLambdaNamespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsLambdaNamespace_1.AwsLambdaNamespace(key, instanceConfig);
13
13
  awsLambdaNamespaces.set(key, namespace);
14
14
  return namespace;
@@ -1,7 +1,7 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { S3Client } from "@aws-sdk/client-s3";
4
- import { Modified, ReadFileResponse } from "./index";
4
+ import { Modified, ReadFileResponse } from "./server";
5
5
  export type ReadBufferResponse = Modified & {
6
6
  buffer: any;
7
7
  };
@@ -38,10 +38,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.AwsS3Namespace = void 0;
40
40
  const _class_1 = require("../../_class");
41
- const index_1 = require("../index");
41
+ const server_1 = require("../server");
42
42
  const string_1 = require("../../string");
43
- const util_1 = require("../../util");
44
- const index_2 = require("./index");
43
+ const server_2 = require("../../util/server");
44
+ const server_3 = require("./server");
45
45
  const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
46
46
  const date_1 = require("../../date");
47
47
  const axios_1 = __importDefault(require("axios"));
@@ -212,7 +212,7 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
212
212
  let response = await this.readFile(bucket, key, isJson);
213
213
  // Cache exists and is still within our caching timeframe
214
214
  if (undefined !== response.body) {
215
- response.body = await (0, util_1.getBrotliDecompressed)(response.body);
215
+ response.body = await (0, server_2.getBrotliDecompressed)(response.body);
216
216
  if (false !== isJson) {
217
217
  response.body = JSON.parse(response.body);
218
218
  }
@@ -223,14 +223,14 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
223
223
  await this.ensureInit();
224
224
  const { GetObjectCommand } = await Promise.resolve().then(() => __importStar(require("@aws-sdk/client-s3")));
225
225
  let response = {
226
- ...index_2.readFileDefault,
226
+ ...server_3.readFileDefault,
227
227
  buffer: undefined,
228
228
  };
229
229
  const apiResponse = await this.client.send(new GetObjectCommand({
230
230
  Bucket: bucket,
231
231
  Key: key,
232
232
  }));
233
- if ((0, index_1.isResponse200)(apiResponse)) {
233
+ if ((0, server_1.isResponse200)(apiResponse)) {
234
234
  const chunks = [];
235
235
  // Store the response
236
236
  response.buffer = await new Promise((resolve, reject) => {
@@ -258,7 +258,7 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
258
258
  Key: key,
259
259
  }));
260
260
  // If the status is 200 then it does exist
261
- response = (0, index_1.isResponse200)(apiResponse);
261
+ response = (0, server_1.isResponse200)(apiResponse);
262
262
  }
263
263
  catch (exception) {
264
264
  response = false;
@@ -267,7 +267,7 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
267
267
  };
268
268
  this.readFile = async (bucket, key, isJson = true) => {
269
269
  await this.ensureInit();
270
- let response = (0, cloneDeep_1.default)(index_2.readFileDefault);
270
+ let response = (0, cloneDeep_1.default)(server_3.readFileDefault);
271
271
  const today = (0, date_1.getToday)();
272
272
  const midnight = (0, date_1.getToday)(true);
273
273
  try {
@@ -279,7 +279,7 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
279
279
  Key: key,
280
280
  }));
281
281
  //console.log('apiResponse', apiResponse);
282
- if ((0, index_1.isResponse200)(apiResponse)) {
282
+ if ((0, server_1.isResponse200)(apiResponse)) {
283
283
  let modified = (0, date_1.getDate)(apiResponse.LastModified);
284
284
  // Convert the date to unix
285
285
  response.modified.unix = modified.toUnixInteger();
@@ -310,7 +310,7 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
310
310
  let response = await this.readFile(bucket, key, isJson);
311
311
  // Cache exists and is still within our caching timeframe
312
312
  if (undefined !== response.body) {
313
- response.body = await (0, util_1.getGzipDecompressed)(response.body);
313
+ response.body = await (0, server_2.getGzipDecompressed)(response.body);
314
314
  if (false !== isJson) {
315
315
  response.body = JSON.parse(response.body);
316
316
  }
@@ -324,7 +324,7 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
324
324
  finalData = JSON.stringify(data);
325
325
  }
326
326
  // Compress the data
327
- const brotliData = await (0, util_1.getBrotliCompressed)({
327
+ const brotliData = await (0, server_2.getBrotliCompressed)({
328
328
  input: finalData,
329
329
  });
330
330
  const apiResponse = await this.writeFile(bucket, key, brotliData, options);
@@ -348,7 +348,7 @@ class AwsS3Namespace extends _class_1.BaseNamespace {
348
348
  finalData = JSON.stringify(data);
349
349
  }
350
350
  // Compress the data
351
- const gzipData = await (0, util_1.getGzipCompressed)(finalData);
351
+ const gzipData = await (0, server_2.getGzipCompressed)(finalData);
352
352
  const apiResponse = await this.writeFile(bucket, key, gzipData, options);
353
353
  return apiResponse;
354
354
  };
@@ -1,5 +1,5 @@
1
1
  import { AwsS3Namespace } from "./AwsS3Namespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsS3Client: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsS3Namespace>;
4
4
  export type Modified = {
5
5
  now: number;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.payloadSchema = exports.readFileDefault = exports.awsS3Client = void 0;
4
4
  const AwsS3Namespace_1 = require("./AwsS3Namespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsS3Namespaces = new Map();
7
7
  const awsS3Client = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsS3Namespaces.has(key)) {
9
9
  return awsS3Namespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsS3Namespace_1.AwsS3Namespace(key, instanceConfig);
13
13
  awsS3Namespaces.set(key, namespace);
14
14
  return namespace;
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isResponse200 = exports.getConfig = void 0;
4
- const onePassword_1 = require("../onePassword");
4
+ const server_1 = require("../onePassword/server");
5
5
  const getConfig = async (key, config, vaultId, itemId) => {
6
6
  let response;
7
7
  if (config) {
8
8
  response = config;
9
9
  }
10
10
  else if (vaultId && itemId) {
11
- response = await (await (0, onePassword_1.onePasswordClient)())
11
+ response = await (await (0, server_1.onePasswordClient)())
12
12
  .getJsonNote(vaultId, itemId);
13
13
  }
14
14
  else if ("default" === key && process.env.AWS_VAULT_ID && process.env.AWS_ITEM_ID) {
15
- response = await (await (0, onePassword_1.onePasswordClient)())
15
+ response = await (await (0, server_1.onePasswordClient)())
16
16
  .getJsonNote(process.env.AWS_VAULT_ID, process.env.AWS_ITEM_ID);
17
17
  }
18
18
  else if ("default" === key && process.env.AWS_ACCESS_KEY_ID && process.env.AWS_REGION && process.env.AWS_SECRET_ACCESS_KEY) {
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { SESClient } from "@aws-sdk/client-ses";
4
4
  type SendProps = {
5
5
  bcc?: string[];
@@ -1,4 +1,4 @@
1
1
  import { AwsSesNamespace } from "./AwsSesNamespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsSesClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSesNamespace>;
4
4
  export { SimpleEmail } from "./SimpleEmail";
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SimpleEmail = exports.awsSesClient = void 0;
4
4
  const AwsSesNamespace_1 = require("./AwsSesNamespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsSesNamespaces = new Map();
7
7
  const awsSesClient = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsSesNamespaces.has(key)) {
9
9
  return awsSesNamespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsSesNamespace_1.AwsSesNamespace(key, instanceConfig);
13
13
  awsSesNamespaces.set(key, namespace);
14
14
  return namespace;
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { SQSClient } from "@aws-sdk/client-sqs";
4
4
  type SqsEventRecord = {
5
5
  messageId: string;
@@ -1,3 +1,3 @@
1
1
  import { AwsSqsNamespace } from "./AwsSqsNamespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsSqsClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSqsNamespace>;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.awsSqsClient = void 0;
4
4
  const AwsSqsNamespace_1 = require("./AwsSqsNamespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsSqsNamespaces = new Map();
7
7
  const awsSqsClient = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsSqsNamespaces.has(key)) {
9
9
  return awsSqsNamespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsSqsNamespace_1.AwsSqsNamespace(key, instanceConfig);
13
13
  awsSqsNamespaces.set(key, namespace);
14
14
  return namespace;
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  import type { SSMClient } from "@aws-sdk/client-ssm";
4
4
  export declare class AwsSsmNamespace extends BaseNamespace {
5
5
  client: SSMClient | null;
@@ -1,3 +1,3 @@
1
1
  import { AwsSsmNamespace } from "./AwsSsmNamespace";
2
- import { AwsConfig } from "../index";
2
+ import { AwsConfig } from "../server";
3
3
  export declare const awsSsmClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSsmNamespace>;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.awsSsmClient = void 0;
4
4
  const AwsSsmNamespace_1 = require("./AwsSsmNamespace");
5
- const index_1 = require("../index");
5
+ const server_1 = require("../server");
6
6
  const awsSsmNamespaces = new Map();
7
7
  const awsSsmClient = async (key = "default", config, vaultId, itemId) => {
8
8
  if (awsSsmNamespaces.has(key)) {
9
9
  return awsSsmNamespaces.get(key);
10
10
  }
11
- const instanceConfig = await (0, index_1.getConfig)(key, config, vaultId, itemId);
11
+ const instanceConfig = await (0, server_1.getConfig)(key, config, vaultId, itemId);
12
12
  const namespace = new AwsSsmNamespace_1.AwsSsmNamespace(key, instanceConfig);
13
13
  awsSsmNamespaces.set(key, namespace);
14
14
  return namespace;
@@ -1 +1,4 @@
1
- export { getBoolean } from "./getBoolean";
1
+ /**
2
+ * Convert an input from a variety of forms into boolean.
3
+ */
4
+ export declare const getBoolean: (input: any, defaultValue?: boolean) => boolean;
package/boolean/index.js CHANGED
@@ -1,5 +1,23 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.getBoolean = void 0;
4
- var getBoolean_1 = require("./getBoolean");
5
- Object.defineProperty(exports, "getBoolean", { enumerable: true, get: function () { return getBoolean_1.getBoolean; } });
7
+ const isBoolean_1 = __importDefault(require("lodash/isBoolean"));
8
+ /**
9
+ * Convert an input from a variety of forms into boolean.
10
+ */
11
+ const getBoolean = (input, defaultValue = false) => {
12
+ if ((0, isBoolean_1.default)(input)) {
13
+ return input;
14
+ }
15
+ else if ("string" === typeof input) {
16
+ return "true" === input || "1" === input || "yes" === input || "y" === input;
17
+ }
18
+ else if ("number" === typeof input) {
19
+ return 1 === input;
20
+ }
21
+ return defaultValue;
22
+ };
23
+ exports.getBoolean = getBoolean;
@@ -1,5 +1,5 @@
1
- import { Auth } from "../";
2
- import { BrightDataSerpApiType } from "./";
1
+ import { Auth } from "../server";
2
+ import { BrightDataSerpApiType } from "./server";
3
3
  /**
4
4
  * Make an async request to the SERP API using the Bright Data proxy.
5
5
  * Returns a request ID used with getAsyncResults
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAsyncRequestId = void 0;
4
4
  const axios_1 = require("../../axios");
5
- const __1 = require("../");
6
- const _1 = require("./");
5
+ const server_1 = require("../server");
6
+ const server_2 = require("./server");
7
7
  /**
8
8
  * Make an async request to the SERP API using the Bright Data proxy.
9
9
  * Returns a request ID used with getAsyncResults
@@ -14,10 +14,10 @@ const getAsyncRequestId = async (auth, data = {}, type) => {
14
14
  let response = "";
15
15
  // Prevent auth requests getting blocked
16
16
  process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";
17
- const customerId = (0, __1.getCustomerId)(auth);
18
- const zone = (0, __1.getZone)(auth);
17
+ const customerId = (0, server_1.getCustomerId)(auth);
18
+ const zone = (0, server_1.getZone)(auth);
19
19
  switch (type) {
20
- case _1.BrightDataSerpApiType.GOOGLE_TRENDS:
20
+ case server_2.BrightDataSerpApiType.GOOGLE_TRENDS:
21
21
  url = `https://api.brightdata.com/serp/trends?customer=${customerId}&zone=${zone}`;
22
22
  break;
23
23
  default:
@@ -1,4 +1,4 @@
1
- import { Auth } from "../";
1
+ import { Auth } from "../server";
2
2
  import { ApiResponseClass } from "../../api";
3
3
  /**
4
4
  * Using the request ID from getAsyncRequestId fetch to see if the data is available.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAsyncResults = void 0;
4
4
  const axios_1 = require("../../axios");
5
- const __1 = require("../");
5
+ const server_1 = require("../server");
6
6
  const api_1 = require("../../api");
7
7
  /**
8
8
  * Using the request ID from getAsyncRequestId fetch to see if the data is available.
@@ -12,8 +12,8 @@ const getAsyncResults = async (auth, requestId) => {
12
12
  let response = (new api_1.ApiResponseClass());
13
13
  // Prevent auth requests getting blocked
14
14
  process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";
15
- const customerId = (0, __1.getCustomerId)(auth);
16
- const zone = (0, __1.getZone)(auth);
15
+ const customerId = (0, server_1.getCustomerId)(auth);
16
+ const zone = (0, server_1.getZone)(auth);
17
17
  const requestResponse = await (0, axios_1.get)(`https://api.brightdata.com/serp/get_result?customer=${customerId}&zone=${zone}&response_id=${requestId}`, {
18
18
  headers: {
19
19
  Authorization: `Bearer ${auth.apiKey}`
@@ -1,4 +1,4 @@
1
- import { Auth } from "../";
1
+ import { Auth } from "../server";
2
2
  /**
3
3
  * Make a request to the SERP API using the Bright Data proxy
4
4
  */
@@ -1,4 +1,4 @@
1
- import { Auth } from "../";
1
+ import { Auth } from "../server";
2
2
  /**
3
3
  * Depends on the Scraper setup!
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Auth } from "../";
1
+ import { Auth } from "../server";
2
2
  /**
3
3
  * Depends on the Scraper setup!
4
4
  *
@@ -1,2 +1,7 @@
1
+ export type CacheEntry = {
2
+ data: any;
3
+ expires: number;
4
+ insertedAt: number;
5
+ };
1
6
  export declare const getCache: (key: string) => any;
2
7
  export declare const setCache: (key: string, data: any, expires?: number, force?: boolean) => any;