@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.
- package/.yarn/install-state.gz +0 -0
- package/adverity/server.d.ts +1 -0
- package/adverity/server.js +5 -0
- package/aws/athenaExpress/AwsAthenaNamespace.d.ts +1 -1
- package/aws/athenaExpress/{index.js → server.js} +3 -3
- package/aws/ec2/AwsEc2Namespace.d.ts +1 -1
- package/aws/ec2/{index.d.ts → server.d.ts} +1 -1
- package/aws/ec2/{index.js → server.js} +2 -2
- package/aws/ecs/AwsEcsNamespace.d.ts +1 -1
- package/aws/ecs/AwsEcsNamespace.js +5 -5
- package/aws/ecs/{index.d.ts → server.d.ts} +1 -1
- package/aws/ecs/{index.js → server.js} +2 -2
- package/aws/glue/AwsGlueNamespace.d.ts +1 -1
- package/aws/glue/AwsGlueNamespace.js +2 -2
- package/aws/glue/{index.d.ts → server.d.ts} +1 -1
- package/aws/glue/{index.js → server.js} +2 -2
- package/aws/lambda/AwsLambdaNamespace.d.ts +1 -1
- package/aws/lambda/AwsLambdaNamespace.js +2 -2
- package/aws/lambda/{index.d.ts → server.d.ts} +1 -1
- package/aws/lambda/{index.js → server.js} +2 -2
- package/aws/s3/AwsS3Namespace.d.ts +2 -2
- package/aws/s3/AwsS3Namespace.js +12 -12
- package/aws/s3/{index.d.ts → server.d.ts} +1 -1
- package/aws/s3/{index.js → server.js} +2 -2
- package/aws/{index.js → server.js} +3 -3
- package/aws/ses/AwsSesNamespace.d.ts +1 -1
- package/aws/ses/{index.d.ts → server.d.ts} +1 -1
- package/aws/ses/{index.js → server.js} +2 -2
- package/aws/sqs/AwsSqsNamespace.d.ts +1 -1
- package/aws/sqs/{index.d.ts → server.d.ts} +1 -1
- package/aws/sqs/{index.js → server.js} +2 -2
- package/aws/ssm/AwsSsmNamespace.d.ts +1 -1
- package/aws/ssm/{index.d.ts → server.d.ts} +1 -1
- package/aws/ssm/{index.js → server.js} +2 -2
- package/boolean/index.d.ts +4 -1
- package/boolean/index.js +20 -2
- package/brightData/serpApi/getAsyncRequestId.d.ts +2 -2
- package/brightData/serpApi/getAsyncRequestId.js +5 -5
- package/brightData/serpApi/getAsyncResults.d.ts +1 -1
- package/brightData/serpApi/getAsyncResults.js +3 -3
- package/brightData/serpApi/getRealtime.d.ts +1 -1
- package/brightData/webScraperIde/getBatch.d.ts +1 -1
- package/brightData/webScraperIde/getRealtime.d.ts +1 -1
- package/cache/{index.d.ts → server.d.ts} +5 -0
- package/cache/test/cache.test.js +5 -5
- package/eskimi/getAgeGroup.js +2 -2
- package/eskimi/getDevice.js +2 -2
- package/eskimi/getGender.js +2 -2
- package/file/index.d.ts +5 -1
- package/file/index.js +47 -2
- package/google/bigQuery/GoogleBigQueryNamespace.d.ts +1 -1
- package/google/bigQuery/GoogleBigQueryNamespace.js +2 -2
- package/google/bigQuery/{index.js → server.js} +3 -3
- package/google/sheets/GoogleSheetsNamespace.d.ts +1 -1
- package/google/sheets/GoogleSheetsNamespace.js +2 -2
- package/google/sheets/{index.js → server.js} +3 -3
- package/google/storage/GoogleCloudStorageNamespace.d.ts +1 -1
- package/google/storage/GoogleCloudStorageNamespace.js +2 -2
- package/google/storage/{index.js → server.js} +3 -3
- package/googleAds/GoogleAdsNamespace.d.ts +1 -1
- package/googleAds/{index.js → server.js} +3 -3
- package/googlePageSpeed/GooglePageSpeedNamespace.d.ts +1 -1
- package/googlePageSpeed/GooglePageSpeedNamespace.js +2 -2
- package/googlePageSpeed/{index.js → server.js} +3 -3
- package/littleWarden/LittleWardenNamespace.d.ts +1 -1
- package/littleWarden/{index.js → server.js} +3 -3
- package/lumar/api/buildRequest.d.ts +1 -1
- package/lumar/api/buildRequest.js +13 -13
- package/lumar/graphql/queries/getReportDifferences.js +2 -2
- package/onePassword/OnePasswordNamespace.d.ts +1 -1
- package/openAi/OpenAiNamespace.d.ts +1 -1
- package/openAi/{index.js → server.js} +3 -3
- package/package.json +1 -1
- package/prisma/PrismaNamespace.d.ts +1 -1
- package/prisma/{index.d.ts → server.d.ts} +1 -1
- package/snapchat/SnapchatNamespace.d.ts +1 -1
- package/snapchat/{index.js → server.js} +3 -3
- package/upTimeRobot/UpTimeRobotNamespace.d.ts +1 -1
- package/upTimeRobot/{index.js → server.js} +3 -3
- package/url/index.d.ts +0 -4
- package/url/index.js +1 -45
- package/url/server.d.ts +1 -0
- package/url/server.js +5 -0
- package/util/index.d.ts +0 -4
- package/util/index.js +1 -9
- package/util/server.d.ts +4 -0
- package/util/server.js +11 -0
- package/boolean/getBoolean.d.ts +0 -4
- package/boolean/getBoolean.js +0 -23
- package/file/createDirectory.d.ts +0 -5
- package/file/createDirectory.js +0 -50
- /package/aws/athenaExpress/{index.d.ts → server.d.ts} +0 -0
- /package/aws/{index.d.ts → server.d.ts} +0 -0
- /package/brightData/serpApi/{index.d.ts → server.d.ts} +0 -0
- /package/brightData/serpApi/{index.js → server.js} +0 -0
- /package/brightData/{index.d.ts → server.d.ts} +0 -0
- /package/brightData/{index.js → server.js} +0 -0
- /package/brightData/webScraperIde/{index.d.ts → server.d.ts} +0 -0
- /package/brightData/webScraperIde/{index.js → server.js} +0 -0
- /package/cache/{index.js → server.js} +0 -0
- /package/eskimi/{index.d.ts → server.d.ts} +0 -0
- /package/eskimi/{index.js → server.js} +0 -0
- /package/google/bigQuery/{index.d.ts → server.d.ts} +0 -0
- /package/google/{index.d.ts → server.d.ts} +0 -0
- /package/google/{index.js → server.js} +0 -0
- /package/google/sheets/{index.d.ts → server.d.ts} +0 -0
- /package/google/storage/{index.d.ts → server.d.ts} +0 -0
- /package/googleAds/keywordPlanner/{index.d.ts → server.d.ts} +0 -0
- /package/googleAds/keywordPlanner/{index.js → server.js} +0 -0
- /package/googleAds/{index.d.ts → server.d.ts} +0 -0
- /package/googlePageSpeed/{index.d.ts → server.d.ts} +0 -0
- /package/googleSearchIncidents/{index.d.ts → server.d.ts} +0 -0
- /package/googleSearchIncidents/{index.js → server.js} +0 -0
- /package/greenDomain/{index.d.ts → server.d.ts} +0 -0
- /package/greenDomain/{index.js → server.js} +0 -0
- /package/inngest/{index.d.ts → server.d.ts} +0 -0
- /package/inngest/{index.js → server.js} +0 -0
- /package/littleWarden/{index.d.ts → server.d.ts} +0 -0
- /package/lumar/api/{index.d.ts → server.d.ts} +0 -0
- /package/lumar/api/{index.js → server.js} +0 -0
- /package/lumar/graphql/{index.d.ts → server.d.ts} +0 -0
- /package/lumar/graphql/{index.js → server.js} +0 -0
- /package/myTarget/{request.d.ts → server.d.ts} +0 -0
- /package/myTarget/{request.js → server.js} +0 -0
- /package/onePassword/{index.d.ts → server.d.ts} +0 -0
- /package/onePassword/{index.js → server.js} +0 -0
- /package/openAi/{index.d.ts → server.d.ts} +0 -0
- /package/prisma/{index.js → server.js} +0 -0
- /package/snapchat/{index.d.ts → server.d.ts} +0 -0
- /package/stream/{index.d.ts → server.d.ts} +0 -0
- /package/stream/{index.js → server.js} +0 -0
- /package/upTimeRobot/{index.d.ts → server.d.ts} +0 -0
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getJobs } from "./getJobs";
|
|
@@ -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
|
|
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,
|
|
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,
|
|
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 "../
|
|
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;
|
|
@@ -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
|
|
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,
|
|
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 "../
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
152
|
+
if ((0, server_1.isResponse200)(apiResponse)) {
|
|
153
153
|
response = apiResponse;
|
|
154
154
|
}
|
|
155
155
|
return response;
|
|
@@ -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
|
|
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,
|
|
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 "../
|
|
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
|
|
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,
|
|
66
|
+
return (0, server_1.isResponse200)(apiResponse);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -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
|
|
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,
|
|
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;
|
|
@@ -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
|
|
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,
|
|
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 "../
|
|
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
|
|
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,
|
|
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 "../
|
|
2
|
+
import { AwsConfig } from "../server";
|
|
3
3
|
import type { S3Client } from "@aws-sdk/client-s3";
|
|
4
|
-
import { Modified, ReadFileResponse } from "./
|
|
4
|
+
import { Modified, ReadFileResponse } from "./server";
|
|
5
5
|
export type ReadBufferResponse = Modified & {
|
|
6
6
|
buffer: any;
|
|
7
7
|
};
|
package/aws/s3/AwsS3Namespace.js
CHANGED
|
@@ -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
|
|
41
|
+
const server_1 = require("../server");
|
|
42
42
|
const string_1 = require("../../string");
|
|
43
|
-
const
|
|
44
|
-
const
|
|
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,
|
|
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
|
-
...
|
|
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,
|
|
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,
|
|
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)(
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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 "../
|
|
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
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,4 +1,4 @@
|
|
|
1
1
|
import { AwsSesNamespace } from "./AwsSesNamespace";
|
|
2
|
-
import { AwsConfig } from "../
|
|
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
|
|
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,
|
|
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;
|
|
@@ -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
|
|
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,
|
|
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 "../
|
|
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;
|
|
@@ -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
|
|
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,
|
|
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;
|
package/boolean/index.d.ts
CHANGED
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
|
-
|
|
5
|
-
|
|
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
|
|
6
|
-
const
|
|
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,
|
|
18
|
-
const zone = (0,
|
|
17
|
+
const customerId = (0, server_1.getCustomerId)(auth);
|
|
18
|
+
const zone = (0, server_1.getZone)(auth);
|
|
19
19
|
switch (type) {
|
|
20
|
-
case
|
|
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:
|
|
@@ -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
|
|
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,
|
|
16
|
-
const zone = (0,
|
|
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}`
|