@8ms/helpers 2.0.41 → 2.0.43
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/aws/athenaExpress/server.js +2 -2
- package/aws/server.js +2 -2
- package/google/bigQuery/GoogleBigQueryNamespace.d.ts +2 -2
- package/google/bigQuery/GoogleBigQueryNamespace.js +3 -6
- package/google/bigQuery/server.js +1 -1
- package/google/server.d.ts +13 -11
- package/google/server.js +17 -12
- package/google/sheets/GoogleSheetsNamespace.js +2 -3
- package/google/sheets/server.js +1 -1
- package/google/storage/GoogleCloudStorageNamespace.js +2 -5
- package/google/storage/server.js +1 -1
- package/googleAds/server.js +1 -1
- package/googlePageSpeed/server.js +1 -1
- package/littleWarden/server.js +1 -1
- package/openAi/server.js +1 -1
- package/package.json +1 -1
- package/snapchat/server.js +1 -1
- package/upTimeRobot/server.js +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -16,11 +16,11 @@ const awsAthenaClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
16
16
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
17
|
.getJsonNote(vaultId, itemId);
|
|
18
18
|
}
|
|
19
|
-
else if (
|
|
19
|
+
else if (process.env.AWS_VAULT_ID && process.env.AWS_ITEM_ID) {
|
|
20
20
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.AWS_VAULT_ID, process.env.AWS_ITEM_ID);
|
|
22
22
|
}
|
|
23
|
-
else if (
|
|
23
|
+
else if (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) {
|
|
24
24
|
instanceConfig = {
|
|
25
25
|
region: process.env.ATHENA_REGION,
|
|
26
26
|
accessKeyId: process.env.ATHENA_ACCESS_KEY_ID,
|
package/aws/server.js
CHANGED
|
@@ -11,11 +11,11 @@ const getConfig = async (key, config, vaultId, itemId) => {
|
|
|
11
11
|
response = await (await (0, server_1.onePasswordClient)())
|
|
12
12
|
.getJsonNote(vaultId, itemId);
|
|
13
13
|
}
|
|
14
|
-
else if (
|
|
14
|
+
else if (process.env.AWS_VAULT_ID && process.env.AWS_ITEM_ID) {
|
|
15
15
|
response = await (await (0, server_1.onePasswordClient)())
|
|
16
16
|
.getJsonNote(process.env.AWS_VAULT_ID, process.env.AWS_ITEM_ID);
|
|
17
17
|
}
|
|
18
|
-
else if (
|
|
18
|
+
else if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_REGION && process.env.AWS_SECRET_ACCESS_KEY) {
|
|
19
19
|
response = {
|
|
20
20
|
region: process.env.AWS_REGION,
|
|
21
21
|
credentials: {
|
|
@@ -6,7 +6,7 @@ export type QueryInput = string | {
|
|
|
6
6
|
location?: string;
|
|
7
7
|
params: QueryOptions;
|
|
8
8
|
};
|
|
9
|
-
type
|
|
9
|
+
type Dataset = {
|
|
10
10
|
id: string;
|
|
11
11
|
location: string;
|
|
12
12
|
projectId: string;
|
|
@@ -34,7 +34,7 @@ export declare class GoogleBigQueryNamespace extends BaseNamespace {
|
|
|
34
34
|
/**
|
|
35
35
|
* Retrieve all the Datasets
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
getDatasets: () => Promise<Dataset[]>;
|
|
38
38
|
query: (props: QueryInput) => Promise<any>;
|
|
39
39
|
/**
|
|
40
40
|
* Create a Table if it doesn't already exist.
|
|
@@ -43,11 +43,8 @@ class GoogleBigQueryNamespace extends _class_1.BaseNamespace {
|
|
|
43
43
|
if (!this.client) {
|
|
44
44
|
try {
|
|
45
45
|
const { BigQuery } = await Promise.resolve().then(() => __importStar(require("@google-cloud/bigquery")));
|
|
46
|
-
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
47
|
-
this.client = new BigQuery(
|
|
48
|
-
...formattedConfig,
|
|
49
|
-
projectId: this.config?.projectId,
|
|
50
|
-
});
|
|
46
|
+
const formattedConfig = (0, server_1.getConfig)(this.config, this.config?.projectId);
|
|
47
|
+
this.client = new BigQuery(formattedConfig);
|
|
51
48
|
}
|
|
52
49
|
catch (e) {
|
|
53
50
|
throw new Error("Google BigQuery Client not installed");
|
|
@@ -87,7 +84,7 @@ class GoogleBigQueryNamespace extends _class_1.BaseNamespace {
|
|
|
87
84
|
/**
|
|
88
85
|
* Retrieve all the Datasets
|
|
89
86
|
*/
|
|
90
|
-
this.
|
|
87
|
+
this.getDatasets = async () => {
|
|
91
88
|
await this.ensureInit();
|
|
92
89
|
let response = [];
|
|
93
90
|
const datasets = await this.client.getDatasets();
|
|
@@ -23,7 +23,7 @@ const googleBigQueryClient = async (key = "default", projectId, config, vaultId,
|
|
|
23
23
|
projectId,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
else if (
|
|
26
|
+
else if (process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
27
27
|
const onePasswordConfig = await (await (0, server_1.onePasswordClient)())
|
|
28
28
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
29
29
|
instanceConfig = {
|
package/google/server.d.ts
CHANGED
|
@@ -13,15 +13,17 @@ export type GoogleCloudConfig = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Using the response from Parameter Store and format it ready to be used with Google API.
|
|
15
15
|
*/
|
|
16
|
-
export declare const getConfig: (parameter: GoogleCloudConfig) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
export declare const getConfig: (parameter: GoogleCloudConfig, projectId?: string) => {
|
|
17
|
+
credentials: {
|
|
18
|
+
type: string;
|
|
19
|
+
project_id: string;
|
|
20
|
+
private_key_id: string;
|
|
21
|
+
private_key: string;
|
|
22
|
+
client_email: string;
|
|
23
|
+
client_id: string;
|
|
24
|
+
auth_uri: string;
|
|
25
|
+
token_uri: string;
|
|
26
|
+
auth_provider_x509_cert_url: string;
|
|
27
|
+
client_x509_cert_url: string;
|
|
28
|
+
};
|
|
27
29
|
};
|
package/google/server.js
CHANGED
|
@@ -4,21 +4,26 @@ exports.getConfig = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* Using the response from Parameter Store and format it ready to be used with Google API.
|
|
6
6
|
*/
|
|
7
|
-
const getConfig = (parameter) => {
|
|
7
|
+
const getConfig = (parameter, projectId) => {
|
|
8
8
|
// Format the private key to be in the same format as required by Google
|
|
9
9
|
const privateKey = parameter["private_key"].replace(/\\n/g, "\n");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
let response = {
|
|
11
|
+
credentials: {
|
|
12
|
+
type: parameter["type"],
|
|
13
|
+
project_id: parameter["project_id"],
|
|
14
|
+
private_key_id: parameter["private_key_id"],
|
|
15
|
+
private_key: privateKey,
|
|
16
|
+
client_email: parameter["client_email"],
|
|
17
|
+
client_id: parameter["client_id"],
|
|
18
|
+
auth_uri: parameter["auth_uri"],
|
|
19
|
+
token_uri: parameter["token_uri"],
|
|
20
|
+
auth_provider_x509_cert_url: parameter["auth_provider_x509_cert_url"],
|
|
21
|
+
client_x509_cert_url: parameter["client_x509_cert_url"],
|
|
22
|
+
},
|
|
21
23
|
};
|
|
24
|
+
if (projectId) {
|
|
25
|
+
response['projectId'] = projectId;
|
|
26
|
+
}
|
|
22
27
|
return response;
|
|
23
28
|
};
|
|
24
29
|
exports.getConfig = getConfig;
|
|
@@ -43,10 +43,9 @@ class GoogleSheetsNamespace extends _class_1.BaseNamespace {
|
|
|
43
43
|
if (!this.client) {
|
|
44
44
|
try {
|
|
45
45
|
const googleApisSheets = await Promise.resolve().then(() => __importStar(require("@googleapis/sheets")));
|
|
46
|
-
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
46
|
+
const formattedConfig = (0, server_1.getConfig)(this.config, this.config?.projectId);
|
|
47
47
|
this.client = new googleApisSheets.auth.GoogleAuth({
|
|
48
|
-
|
|
49
|
-
projectId: this.config?.projectId,
|
|
48
|
+
...formattedConfig,
|
|
50
49
|
scopes: [
|
|
51
50
|
"https://www.googleapis.com/auth/spreadsheets",
|
|
52
51
|
],
|
package/google/sheets/server.js
CHANGED
|
@@ -23,7 +23,7 @@ const googleSheetsAuths = async (key = "default", projectId, config, vaultId, it
|
|
|
23
23
|
projectId,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
else if (
|
|
26
|
+
else if (process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
27
27
|
const onePasswordConfig = await (await (0, server_1.onePasswordClient)())
|
|
28
28
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
29
29
|
instanceConfig = {
|
|
@@ -43,11 +43,8 @@ class GoogleCloudStorageNamespace extends _class_1.BaseNamespace {
|
|
|
43
43
|
if (!this.client) {
|
|
44
44
|
try {
|
|
45
45
|
const { Storage } = await Promise.resolve().then(() => __importStar(require("@google-cloud/storage")));
|
|
46
|
-
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
47
|
-
this.client = new Storage(
|
|
48
|
-
...formattedConfig,
|
|
49
|
-
projectId: this.config?.projectId,
|
|
50
|
-
});
|
|
46
|
+
const formattedConfig = (0, server_1.getConfig)(this.config, this.config?.projectId);
|
|
47
|
+
this.client = new Storage(formattedConfig);
|
|
51
48
|
}
|
|
52
49
|
catch (e) {
|
|
53
50
|
throw new Error("Google Cloud Storage Client not installed");
|
package/google/storage/server.js
CHANGED
|
@@ -23,7 +23,7 @@ const googleCloudStorageClient = async (key = "default", projectId, config, vaul
|
|
|
23
23
|
projectId,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
else if (
|
|
26
|
+
else if (process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
27
27
|
const onePasswordConfig = await (await (0, server_1.onePasswordClient)())
|
|
28
28
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
29
29
|
instanceConfig = {
|
package/googleAds/server.js
CHANGED
|
@@ -16,7 +16,7 @@ const googleAdsClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
16
16
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
17
|
.getJsonNote(vaultId, itemId);
|
|
18
18
|
}
|
|
19
|
-
else if (
|
|
19
|
+
else if (process.env.GOOGLE_ADS_VAULT_ID && process.env.GOOGLE_ADS_ITEM_ID) {
|
|
20
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
|
}
|
|
@@ -16,7 +16,7 @@ const googlePageSpeedClient = async (key = "default", config, vaultId, itemId) =
|
|
|
16
16
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
17
|
.getJsonNote(vaultId, itemId);
|
|
18
18
|
}
|
|
19
|
-
else if (
|
|
19
|
+
else if (process.env.GOOGLE_PAGE_SPEED_VAULT_ID && process.env.GOOGLE_PAGE_SPEED_ITEM_ID) {
|
|
20
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
|
}
|
package/littleWarden/server.js
CHANGED
|
@@ -16,7 +16,7 @@ const littleWardenClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
16
16
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
17
|
.getJsonNote(vaultId, itemId);
|
|
18
18
|
}
|
|
19
|
-
else if (
|
|
19
|
+
else if (process.env.LITTLE_WARDEN_VAULT_ID && process.env.LITTLE_WARDEN_ITEM_ID) {
|
|
20
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
|
}
|
package/openAi/server.js
CHANGED
|
@@ -16,7 +16,7 @@ const openAiClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
16
16
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
17
|
.getJsonNote(vaultId, itemId);
|
|
18
18
|
}
|
|
19
|
-
else if (
|
|
19
|
+
else if (process.env.OPEN_AI_VAULT_ID && process.env.OPEN_AI_ITEM_ID) {
|
|
20
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
|
}
|
package/package.json
CHANGED
package/snapchat/server.js
CHANGED
|
@@ -16,7 +16,7 @@ const snapchatClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
16
16
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
17
|
.getJsonNote(vaultId, itemId);
|
|
18
18
|
}
|
|
19
|
-
else if (
|
|
19
|
+
else if (process.env.SNAPCHAT_VAULT_ID && process.env.SNAPCHAT_ITEM_ID) {
|
|
20
20
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
21
|
.getJsonNote(process.env.SNAPCHAT_VAULT_ID, process.env.SNAPCHAT_ITEM_ID);
|
|
22
22
|
}
|
package/upTimeRobot/server.js
CHANGED
|
@@ -16,7 +16,7 @@ const upTimeRobotClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
16
16
|
instanceConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
17
|
.getJsonNote(vaultId, itemId);
|
|
18
18
|
}
|
|
19
|
-
else if (
|
|
19
|
+
else if (process.env.UP_TIME_ROBOT_VAULT_ID && process.env.UP_TIME_ROBOT_ITEM_ID) {
|
|
20
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
|
}
|