@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/cache/test/cache.test.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
test(
|
|
5
|
-
const item1 = (0,
|
|
3
|
+
const server_1 = require("../server");
|
|
4
|
+
test("cache", () => {
|
|
5
|
+
const item1 = (0, server_1.getCache)("test");
|
|
6
6
|
// console.log('item1', item1);
|
|
7
|
-
(0,
|
|
8
|
-
const item2 = (0,
|
|
7
|
+
(0, server_1.setCache)("test", { "this is something": "item" });
|
|
8
|
+
const item2 = (0, server_1.getCache)("test");
|
|
9
9
|
// console.log('item2', item2);
|
|
10
10
|
});
|
package/eskimi/getAgeGroup.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAgeGroup = void 0;
|
|
4
|
-
const
|
|
4
|
+
const server_1 = require("./server");
|
|
5
5
|
/**
|
|
6
6
|
* Map the Age Group and return the user-friendly string.
|
|
7
7
|
*/
|
|
8
8
|
const getAgeGroup = (input) => {
|
|
9
|
-
const matches =
|
|
9
|
+
const matches = server_1.ageGroups.filter(group => group.id === input);
|
|
10
10
|
if (1 === matches.length) {
|
|
11
11
|
return matches[0].name;
|
|
12
12
|
}
|
package/eskimi/getDevice.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDevice = void 0;
|
|
4
|
-
const
|
|
4
|
+
const server_1 = require("./server");
|
|
5
5
|
/**
|
|
6
6
|
* Map the Devices and return the user-friendly string.
|
|
7
7
|
*/
|
|
8
8
|
const getDevice = (input) => {
|
|
9
|
-
const matches =
|
|
9
|
+
const matches = server_1.devices.filter(device => device.id === input);
|
|
10
10
|
if (1 === matches.length) {
|
|
11
11
|
return matches[0].name;
|
|
12
12
|
}
|
package/eskimi/getGender.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getGender = void 0;
|
|
4
|
-
const
|
|
4
|
+
const server_1 = require("./server");
|
|
5
5
|
/**
|
|
6
6
|
* Map the Gender and return the user-friendly string.
|
|
7
7
|
*/
|
|
8
8
|
const getGender = (input) => {
|
|
9
|
-
const matches =
|
|
9
|
+
const matches = server_1.genders.filter(gender => gender.id === input);
|
|
10
10
|
if (1 === matches.length) {
|
|
11
11
|
return matches[0].name;
|
|
12
12
|
}
|
package/file/index.d.ts
CHANGED
package/file/index.js
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.createDirectory = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Create a directory recursively.
|
|
39
|
+
* Requires fs-extra
|
|
40
|
+
*/
|
|
41
|
+
const createDirectory = (filePath) => {
|
|
42
|
+
return new Promise(async (resolve, reject) => {
|
|
43
|
+
const fs = await Promise.resolve().then(() => __importStar(require("fs-extra")));
|
|
44
|
+
const path = await Promise.resolve().then(() => __importStar(require("path")));
|
|
45
|
+
const fileDir = path.parse(filePath).dir;
|
|
46
|
+
fs.ensureDirSync(fileDir);
|
|
47
|
+
resolve(true);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.createDirectory = createDirectory;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class";
|
|
2
2
|
import type { BigQuery, QueryOptions } from "@google-cloud/bigquery";
|
|
3
|
-
import { GoogleCloudConfig } from "../
|
|
3
|
+
import { GoogleCloudConfig } from "../server";
|
|
4
4
|
type Query = string | {
|
|
5
5
|
query: string;
|
|
6
6
|
location?: string;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.GoogleBigQueryNamespace = void 0;
|
|
37
37
|
const _class_1 = require("../../_class");
|
|
38
|
-
const
|
|
38
|
+
const server_1 = require("../server");
|
|
39
39
|
class GoogleBigQueryNamespace extends _class_1.BaseNamespace {
|
|
40
40
|
constructor() {
|
|
41
41
|
super(...arguments);
|
|
@@ -44,7 +44,7 @@ class GoogleBigQueryNamespace extends _class_1.BaseNamespace {
|
|
|
44
44
|
if (!this.client) {
|
|
45
45
|
try {
|
|
46
46
|
const { BigQuery } = await Promise.resolve().then(() => __importStar(require("@google-cloud/bigquery")));
|
|
47
|
-
const formattedConfig = (0,
|
|
47
|
+
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
48
48
|
// @ts-ignore
|
|
49
49
|
this.client = new BigQuery(formattedConfig);
|
|
50
50
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadData = exports.getHandlerPath = exports.googleBigQueryClient = void 0;
|
|
4
4
|
const GoogleBigQueryNamespace_1 = require("./GoogleBigQueryNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../../onePassword/server");
|
|
6
6
|
const googleBigQueryNamespaces = new Map();
|
|
7
7
|
const googleBigQueryClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (googleBigQueryNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const googleBigQueryClient = 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.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.GoogleSheetsNamespace = void 0;
|
|
37
37
|
const _class_1 = require("../../_class");
|
|
38
|
-
const
|
|
38
|
+
const server_1 = require("../server");
|
|
39
39
|
class GoogleSheetsNamespace extends _class_1.BaseNamespace {
|
|
40
40
|
constructor() {
|
|
41
41
|
super(...arguments);
|
|
@@ -46,7 +46,7 @@ class GoogleSheetsNamespace extends _class_1.BaseNamespace {
|
|
|
46
46
|
if (!this.client) {
|
|
47
47
|
try {
|
|
48
48
|
const googleApisSheets = await Promise.resolve().then(() => __importStar(require("@googleapis/sheets")));
|
|
49
|
-
const formattedConfig = (0,
|
|
49
|
+
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
50
50
|
this.client = new googleApisSheets.auth.GoogleAuth({
|
|
51
51
|
// @ts-ignore
|
|
52
52
|
credentials: formattedConfig,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAssociatedData = exports.isCellNa = exports.googleSheetsAuths = void 0;
|
|
4
4
|
const GoogleSheetsNamespace_1 = require("./GoogleSheetsNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../../onePassword/server");
|
|
6
6
|
const googleSheetsNamespaces = new Map();
|
|
7
7
|
const googleSheetsAuths = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (googleSheetsNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const googleSheetsAuths = 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.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class";
|
|
2
2
|
import type { Storage } from "@google-cloud/storage";
|
|
3
|
-
import { GoogleCloudConfig } from "../
|
|
3
|
+
import { GoogleCloudConfig } from "../server";
|
|
4
4
|
export declare class GoogleCloudStorageNamespace extends BaseNamespace {
|
|
5
5
|
client: Storage | null;
|
|
6
6
|
config: GoogleCloudConfig;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.GoogleCloudStorageNamespace = void 0;
|
|
37
37
|
const _class_1 = require("../../_class");
|
|
38
|
-
const
|
|
38
|
+
const server_1 = require("../server");
|
|
39
39
|
class GoogleCloudStorageNamespace extends _class_1.BaseNamespace {
|
|
40
40
|
constructor() {
|
|
41
41
|
super(...arguments);
|
|
@@ -44,7 +44,7 @@ class GoogleCloudStorageNamespace extends _class_1.BaseNamespace {
|
|
|
44
44
|
if (!this.client) {
|
|
45
45
|
try {
|
|
46
46
|
const { Storage } = await Promise.resolve().then(() => __importStar(require("@google-cloud/storage")));
|
|
47
|
-
const formattedConfig = (0,
|
|
47
|
+
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
48
48
|
// @ts-ignore
|
|
49
49
|
this.client = new Storage(formattedConfig);
|
|
50
50
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.googleCloudStorageClient = void 0;
|
|
4
4
|
const GoogleCloudStorageNamespace_1 = require("./GoogleCloudStorageNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../../onePassword/server");
|
|
6
6
|
const googleCloudStorageNamespaces = new Map();
|
|
7
7
|
const googleCloudStorageClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (googleCloudStorageNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const googleCloudStorageClient = 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.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseNamespace } from "../_class";
|
|
2
2
|
import type { GoogleAdsApi } from "google-ads-api";
|
|
3
|
-
import { Config } from "./
|
|
3
|
+
import { Config } from "./server";
|
|
4
4
|
export declare class GoogleAdsNamespace extends BaseNamespace {
|
|
5
5
|
client: GoogleAdsApi | null;
|
|
6
6
|
config: Config | null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.googleAdsClient = void 0;
|
|
4
4
|
const GoogleAdsNamespace_1 = require("./GoogleAdsNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../onePassword/server");
|
|
6
6
|
const googleAdsNamespaces = new Map();
|
|
7
7
|
const googleAdsClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (googleAdsNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const googleAdsClient = 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.GOOGLE_ADS_VAULT_ID && process.env.GOOGLE_ADS_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.GOOGLE_ADS_VAULT_ID, process.env.GOOGLE_ADS_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseNamespace } from "../_class";
|
|
2
|
-
import { Category, GooglePageSpeedConfig, Strategy } from "./
|
|
2
|
+
import { Category, GooglePageSpeedConfig, Strategy } from "./server";
|
|
3
3
|
/**
|
|
4
4
|
* Based on https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed
|
|
5
5
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GooglePageSpeedNamespace = void 0;
|
|
4
4
|
const _class_1 = require("../_class");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("./server");
|
|
6
6
|
const axios_1 = require("../axios");
|
|
7
7
|
/**
|
|
8
8
|
* Based on https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed
|
|
@@ -22,7 +22,7 @@ class GooglePageSpeedNamespace extends _class_1.BaseNamespace {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
this.getReport = async (url, category =
|
|
25
|
+
this.getReport = async (url, category = server_1.Category.PERFORMANCE, strategy = server_1.Strategy.MOBILE) => {
|
|
26
26
|
const requestUrl = `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${url}&strategy=${strategy}&category=${category}&key=${this.config.apiKey}`;
|
|
27
27
|
const apiResponse = await (0, axios_1.get)(requestUrl);
|
|
28
28
|
if (apiResponse.isSuccess()) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Strategy = exports.Category = exports.googlePageSpeedClient = void 0;
|
|
4
4
|
const GooglePageSpeedNamespace_1 = require("./GooglePageSpeedNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../onePassword/server");
|
|
6
6
|
const googlePageSpeedNamespaces = new Map();
|
|
7
7
|
const googlePageSpeedClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (googlePageSpeedNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const googlePageSpeedClient = 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.GOOGLE_PAGE_SPEED_VAULT_ID && process.env.GOOGLE_PAGE_SPEED_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.GOOGLE_PAGE_SPEED_VAULT_ID, process.env.GOOGLE_PAGE_SPEED_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUrlStatus = exports.isDanger = exports.isWarning = exports.isAllGood = exports.LittleWardenState = exports.littleWardenClient = void 0;
|
|
4
4
|
const LittleWardenNamespace_1 = require("./LittleWardenNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../onePassword/server");
|
|
6
6
|
const littleWardenNamespaces = new Map();
|
|
7
7
|
const littleWardenClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (littleWardenNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const littleWardenClient = 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.LITTLE_WARDEN_VAULT_ID && process.env.LITTLE_WARDEN_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.LITTLE_WARDEN_VAULT_ID, process.env.LITTLE_WARDEN_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildRequest = void 0;
|
|
4
|
-
const
|
|
4
|
+
const server_1 = require("./server");
|
|
5
5
|
const buildRequest = (props) => {
|
|
6
6
|
let url = `https://api.deepcrawl.com/accounts/37204`;
|
|
7
7
|
// Limit must be greater than 0 but also less than 200
|
|
@@ -18,35 +18,35 @@ const buildRequest = (props) => {
|
|
|
18
18
|
props.limit = 200;
|
|
19
19
|
}
|
|
20
20
|
// If a report other than List Crawls is selected, Crawl ID must be defined
|
|
21
|
-
if (undefined !== props.report &&
|
|
21
|
+
if (undefined !== props.report && server_1.reports.LIST_CRAWLS !== props.report && undefined == props.crawlId) {
|
|
22
22
|
throw `Crawl ID must be defined.`;
|
|
23
23
|
}
|
|
24
24
|
switch (props.report) {
|
|
25
|
-
case
|
|
25
|
+
case server_1.reports.LIST_CRAWLS:
|
|
26
26
|
url += `/projects/${props.projectId}/crawls`;
|
|
27
27
|
break;
|
|
28
|
-
case
|
|
28
|
+
case server_1.reports.LIST_PROJECTS:
|
|
29
29
|
url += `/projects`;
|
|
30
30
|
break;
|
|
31
|
-
case
|
|
31
|
+
case server_1.reports.CUSTOM:
|
|
32
32
|
url += props.customPath;
|
|
33
33
|
url = url.replace("[PROJECT]", props.projectId.toString());
|
|
34
34
|
url = url.replace("[CRAWL]", props.crawlId.toString());
|
|
35
35
|
break;
|
|
36
|
-
case
|
|
36
|
+
case server_1.reports.CRAWL_STATISTICS:
|
|
37
37
|
url += `/projects/${props.projectId}/crawls/${props.crawlId}/statistics`;
|
|
38
38
|
break;
|
|
39
|
-
case
|
|
39
|
+
case server_1.reports.LIST_REPORTS:
|
|
40
40
|
url += `/projects/${props.projectId}/crawls/${props.crawlId}/reports`;
|
|
41
41
|
break;
|
|
42
|
-
case
|
|
43
|
-
case
|
|
44
|
-
case
|
|
42
|
+
case server_1.reports.REPORT_ROWS:
|
|
43
|
+
case server_1.reports.REPORT_STATISTICS:
|
|
44
|
+
case server_1.reports.REPORT_SUMMARY:
|
|
45
45
|
url += `/projects/${props.projectId}/crawls/${props.crawlId}/reports/${props.subReport}`;
|
|
46
|
-
if (
|
|
46
|
+
if (server_1.reports.REPORT_ROWS === props.report) {
|
|
47
47
|
url += `/report_rows`;
|
|
48
48
|
}
|
|
49
|
-
else if (
|
|
49
|
+
else if (server_1.reports.REPORT_STATISTICS === props.report) {
|
|
50
50
|
url += `/statistics`;
|
|
51
51
|
}
|
|
52
52
|
break;
|
|
@@ -71,7 +71,7 @@ const buildRequest = (props) => {
|
|
|
71
71
|
url += -1 === url.indexOf("?") ? "?" : "&";
|
|
72
72
|
props.orders.map((order, index) => {
|
|
73
73
|
url += 0 === index ? "sort=" : ",";
|
|
74
|
-
url +=
|
|
74
|
+
url += server_1.orders.DESCENDING === order.direction ? "-" : "";
|
|
75
75
|
url += order.field;
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const server_1 = require("../server");
|
|
4
4
|
/**
|
|
5
5
|
* Used to return the number for: Basic, Added, Missing, Removed for a given report.
|
|
6
6
|
*/
|
|
@@ -30,7 +30,7 @@ const getReportDifferences = ({ crawlId, filter, reportTemplateCode }) => ({
|
|
|
30
30
|
input: {
|
|
31
31
|
crawlId,
|
|
32
32
|
reportTemplateCode,
|
|
33
|
-
reportTypeCode:
|
|
33
|
+
reportTypeCode: server_1.reportTypes.BASIC,
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.openAiClient = void 0;
|
|
4
4
|
const OpenAiNamespace_1 = require("./OpenAiNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../onePassword/server");
|
|
6
6
|
const openAiNamespaces = new Map();
|
|
7
7
|
const openAiClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (openAiNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const openAiClient = 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.OPEN_AI_VAULT_ID && process.env.OPEN_AI_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.OPEN_AI_VAULT_ID, process.env.OPEN_AI_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
package/package.json
CHANGED
|
@@ -4,5 +4,5 @@ export type PrismaConfig = {
|
|
|
4
4
|
isDebug: boolean;
|
|
5
5
|
isPlanetScale: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const prismaClient: (key
|
|
7
|
+
export declare const prismaClient: (key?: string, config?: PrismaConfig) => Promise<PrismaNamespace>;
|
|
8
8
|
export { getDecimal } from "./getDecimal";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.snapchatClient = void 0;
|
|
4
4
|
const SnapchatNamespace_1 = require("./SnapchatNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../onePassword/server");
|
|
6
6
|
const snapchatNamespaces = new Map();
|
|
7
7
|
const snapchatClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (snapchatNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const snapchatClient = 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.SNAPCHAT_VAULT_ID && process.env.SNAPCHAT_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.SNAPCHAT_VAULT_ID, process.env.SNAPCHAT_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.requestStatuses = exports.monitorTypes = exports.monitorSubTypes = exports.monitorStatuses = exports.logTypes = exports.upTimeRobotClient = void 0;
|
|
4
4
|
const UpTimeRobotNamespace_1 = require("./UpTimeRobotNamespace");
|
|
5
|
-
const
|
|
5
|
+
const server_1 = require("../onePassword/server");
|
|
6
6
|
const upTimeRobotNamespaces = new Map();
|
|
7
7
|
const upTimeRobotClient = async (key = "default", config, vaultId, itemId) => {
|
|
8
8
|
if (upTimeRobotNamespaces.has(key)) {
|
|
@@ -13,11 +13,11 @@ const upTimeRobotClient = 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.UP_TIME_ROBOT_VAULT_ID && process.env.UP_TIME_ROBOT_ITEM_ID) {
|
|
20
|
-
instanceConfig = await (await (0,
|
|
20
|
+
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.UP_TIME_ROBOT_VAULT_ID, process.env.UP_TIME_ROBOT_ITEM_ID);
|
|
22
22
|
}
|
|
23
23
|
else {
|
package/url/index.d.ts
CHANGED
|
@@ -27,7 +27,3 @@ export declare const buildRelative: ({ router, updated }: {
|
|
|
27
27
|
* Get the current base url.
|
|
28
28
|
*/
|
|
29
29
|
export declare const buildEnvironmentUrl: (path: string, url: EnvironmentUrl) => string;
|
|
30
|
-
/**
|
|
31
|
-
* Server-side only function - dynamically imported to avoid client bundling
|
|
32
|
-
*/
|
|
33
|
-
export declare const writeUrlContents: (...args: Parameters<typeof import("./writeUrlContents").writeUrlContents>) => Promise<void>;
|