@8ms/helpers 2.0.38 → 2.0.39
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/google/bigQuery/GoogleBigQueryNamespace.d.ts +1 -1
- package/google/bigQuery/GoogleBigQueryNamespace.js +1 -1
- package/google/bigQuery/server.d.ts +1 -1
- package/google/bigQuery/server.js +4 -4
- package/google/sheets/GoogleSheetsNamespace.d.ts +3 -1
- package/google/sheets/GoogleSheetsNamespace.js +1 -1
- package/google/sheets/server.d.ts +1 -1
- package/google/sheets/server.js +15 -4
- package/google/storage/GoogleCloudStorageNamespace.d.ts +3 -1
- package/google/storage/GoogleCloudStorageNamespace.js +4 -2
- package/google/storage/server.d.ts +1 -1
- package/google/storage/server.js +15 -4
- package/package.json +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -46,7 +46,7 @@ class GoogleBigQueryNamespace extends _class_1.BaseNamespace {
|
|
|
46
46
|
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
47
47
|
this.client = new BigQuery({
|
|
48
48
|
...formattedConfig,
|
|
49
|
-
projectId: this.config.
|
|
49
|
+
projectId: this.config.projectId,
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
catch (e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GoogleBigQueryNamespace } from "./GoogleBigQueryNamespace";
|
|
2
2
|
import type { GoogleAuthOptions } from "@google-cloud/common";
|
|
3
|
-
export declare const googleBigQueryClient: (
|
|
3
|
+
export declare const googleBigQueryClient: (key: string, projectId: string, config?: GoogleAuthOptions, vaultId?: string, itemId?: string) => Promise<GoogleBigQueryNamespace>;
|
|
4
4
|
export declare const getHandlerPath: (input: string) => string;
|
|
5
5
|
export { loadData } from "./loadData";
|
|
6
6
|
export type { QueryInput } from "./GoogleBigQueryNamespace";
|
|
@@ -4,7 +4,7 @@ exports.loadData = exports.getHandlerPath = exports.googleBigQueryClient = void
|
|
|
4
4
|
const GoogleBigQueryNamespace_1 = require("./GoogleBigQueryNamespace");
|
|
5
5
|
const server_1 = require("../../onePassword/server");
|
|
6
6
|
const googleBigQueryNamespaces = new Map();
|
|
7
|
-
const googleBigQueryClient = async (
|
|
7
|
+
const googleBigQueryClient = async (key = "default", projectId, config, vaultId, itemId) => {
|
|
8
8
|
if (googleBigQueryNamespaces.has(key)) {
|
|
9
9
|
return googleBigQueryNamespaces.get(key);
|
|
10
10
|
}
|
|
@@ -12,7 +12,7 @@ const googleBigQueryClient = async (defaultProjectId, key = "default", config, v
|
|
|
12
12
|
if (config) {
|
|
13
13
|
instanceConfig = {
|
|
14
14
|
...config,
|
|
15
|
-
|
|
15
|
+
projectId,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
else if (vaultId && itemId) {
|
|
@@ -20,7 +20,7 @@ const googleBigQueryClient = async (defaultProjectId, key = "default", config, v
|
|
|
20
20
|
.getJsonNote(vaultId, itemId);
|
|
21
21
|
instanceConfig = {
|
|
22
22
|
...onePasswordConfig,
|
|
23
|
-
|
|
23
|
+
projectId,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
else if ("default" === key && process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
@@ -28,7 +28,7 @@ const googleBigQueryClient = async (defaultProjectId, key = "default", config, v
|
|
|
28
28
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
29
29
|
instanceConfig = {
|
|
30
30
|
...onePasswordConfig,
|
|
31
|
-
|
|
31
|
+
projectId,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
@@ -9,7 +9,9 @@ type GetBatchDataProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare class GoogleSheetsNamespace extends BaseNamespace {
|
|
11
11
|
client: GoogleAuth;
|
|
12
|
-
config: GoogleCloudConfig
|
|
12
|
+
config: GoogleCloudConfig & {
|
|
13
|
+
projectId: string;
|
|
14
|
+
};
|
|
13
15
|
ensureInit: () => Promise<void>;
|
|
14
16
|
getBatchData: (props: GetBatchDataProps) => Promise<import("@googleapis/sheets").sheets_v4.Schema$BatchGetValuesResponse>;
|
|
15
17
|
}
|
|
@@ -45,8 +45,8 @@ class GoogleSheetsNamespace extends _class_1.BaseNamespace {
|
|
|
45
45
|
const googleApisSheets = await Promise.resolve().then(() => __importStar(require("@googleapis/sheets")));
|
|
46
46
|
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
47
47
|
this.client = new googleApisSheets.auth.GoogleAuth({
|
|
48
|
-
// @ts-ignore
|
|
49
48
|
credentials: formattedConfig,
|
|
49
|
+
projectId: this.config.projectId,
|
|
50
50
|
scopes: [
|
|
51
51
|
"https://www.googleapis.com/auth/spreadsheets",
|
|
52
52
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GoogleSheetsNamespace } from "./GoogleSheetsNamespace";
|
|
2
2
|
import type { GoogleAuthOptions } from "@google-cloud/common";
|
|
3
|
-
export declare const googleSheetsAuths: (key
|
|
3
|
+
export declare const googleSheetsAuths: (key: string, projectId: string, config?: GoogleAuthOptions, vaultId?: string, itemId?: string) => Promise<GoogleSheetsNamespace>;
|
|
4
4
|
/**
|
|
5
5
|
* Noticed sometimes Google Sheets can struggle with import XML resulting to N/A values.
|
|
6
6
|
*/
|
package/google/sheets/server.js
CHANGED
|
@@ -4,21 +4,32 @@ exports.getAssociatedData = exports.isCellNa = exports.googleSheetsAuths = void
|
|
|
4
4
|
const GoogleSheetsNamespace_1 = require("./GoogleSheetsNamespace");
|
|
5
5
|
const server_1 = require("../../onePassword/server");
|
|
6
6
|
const googleSheetsNamespaces = new Map();
|
|
7
|
-
const googleSheetsAuths = async (key = "default", config, vaultId, itemId) => {
|
|
7
|
+
const googleSheetsAuths = async (key = "default", projectId, config, vaultId, itemId) => {
|
|
8
8
|
if (googleSheetsNamespaces.has(key)) {
|
|
9
9
|
return googleSheetsNamespaces.get(key);
|
|
10
10
|
}
|
|
11
11
|
let instanceConfig;
|
|
12
12
|
if (config) {
|
|
13
|
-
instanceConfig =
|
|
13
|
+
instanceConfig = {
|
|
14
|
+
...config,
|
|
15
|
+
projectId,
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
else if (vaultId && itemId) {
|
|
16
|
-
|
|
19
|
+
const onePasswordConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
20
|
.getJsonNote(vaultId, itemId);
|
|
21
|
+
instanceConfig = {
|
|
22
|
+
...onePasswordConfig,
|
|
23
|
+
projectId,
|
|
24
|
+
};
|
|
18
25
|
}
|
|
19
26
|
else if ('default' === key && process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
20
|
-
|
|
27
|
+
const onePasswordConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
28
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
29
|
+
instanceConfig = {
|
|
30
|
+
...onePasswordConfig,
|
|
31
|
+
projectId,
|
|
32
|
+
};
|
|
22
33
|
}
|
|
23
34
|
else {
|
|
24
35
|
throw new Error(`Config required for namespace '${key}'`);
|
|
@@ -3,7 +3,9 @@ import type { Storage } from "@google-cloud/storage";
|
|
|
3
3
|
import { GoogleCloudConfig } from "../server";
|
|
4
4
|
export declare class GoogleCloudStorageNamespace extends BaseNamespace {
|
|
5
5
|
client: Storage;
|
|
6
|
-
config: GoogleCloudConfig
|
|
6
|
+
config: GoogleCloudConfig & {
|
|
7
|
+
projectId: string;
|
|
8
|
+
};
|
|
7
9
|
ensureInit: () => Promise<void>;
|
|
8
10
|
/**
|
|
9
11
|
* Copy a local file to Google Cloud Storage.
|
|
@@ -44,8 +44,10 @@ class GoogleCloudStorageNamespace extends _class_1.BaseNamespace {
|
|
|
44
44
|
try {
|
|
45
45
|
const { Storage } = await Promise.resolve().then(() => __importStar(require("@google-cloud/storage")));
|
|
46
46
|
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
this.client = new Storage({
|
|
48
|
+
...formattedConfig,
|
|
49
|
+
projectId: this.config.projectId,
|
|
50
|
+
});
|
|
49
51
|
}
|
|
50
52
|
catch (e) {
|
|
51
53
|
throw new Error("Google Cloud Storage Client not installed");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GoogleCloudStorageNamespace } from "./GoogleCloudStorageNamespace";
|
|
2
2
|
import type { GoogleAuthOptions } from "@google-cloud/common";
|
|
3
|
-
export declare const googleCloudStorageClient: (key
|
|
3
|
+
export declare const googleCloudStorageClient: (key: string, projectId: string, config?: GoogleAuthOptions, vaultId?: string, itemId?: string) => Promise<GoogleCloudStorageNamespace>;
|
package/google/storage/server.js
CHANGED
|
@@ -4,21 +4,32 @@ exports.googleCloudStorageClient = void 0;
|
|
|
4
4
|
const GoogleCloudStorageNamespace_1 = require("./GoogleCloudStorageNamespace");
|
|
5
5
|
const server_1 = require("../../onePassword/server");
|
|
6
6
|
const googleCloudStorageNamespaces = new Map();
|
|
7
|
-
const googleCloudStorageClient = async (key = "default", config, vaultId, itemId) => {
|
|
7
|
+
const googleCloudStorageClient = async (key = "default", projectId, config, vaultId, itemId) => {
|
|
8
8
|
if (googleCloudStorageNamespaces.has(key)) {
|
|
9
9
|
return googleCloudStorageNamespaces.get(key);
|
|
10
10
|
}
|
|
11
11
|
let instanceConfig;
|
|
12
12
|
if (config) {
|
|
13
|
-
instanceConfig =
|
|
13
|
+
instanceConfig = {
|
|
14
|
+
...config,
|
|
15
|
+
projectId,
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
else if (vaultId && itemId) {
|
|
16
|
-
|
|
19
|
+
const onePasswordConfig = await (await (0, server_1.onePasswordClient)())
|
|
17
20
|
.getJsonNote(vaultId, itemId);
|
|
21
|
+
instanceConfig = {
|
|
22
|
+
...onePasswordConfig,
|
|
23
|
+
projectId,
|
|
24
|
+
};
|
|
18
25
|
}
|
|
19
26
|
else if ('default' === key && process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) {
|
|
20
|
-
|
|
27
|
+
const onePasswordConfig = await (await (0, server_1.onePasswordClient)())
|
|
21
28
|
.getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID);
|
|
29
|
+
instanceConfig = {
|
|
30
|
+
...onePasswordConfig,
|
|
31
|
+
projectId,
|
|
32
|
+
};
|
|
22
33
|
}
|
|
23
34
|
else {
|
|
24
35
|
throw new Error(`Config required for namespace '${key}'`);
|