@8ms/helpers 2.0.39 → 2.0.41
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 +4 -7
- package/google/bigQuery/GoogleBigQueryNamespace.js +9 -14
- package/google/bigQuery/server.d.ts +1 -1
- package/google/sheets/GoogleSheetsNamespace.d.ts +1 -1
- package/google/sheets/GoogleSheetsNamespace.js +1 -1
- package/google/sheets/server.d.ts +1 -1
- package/google/storage/GoogleCloudStorageNamespace.d.ts +1 -1
- package/google/storage/GoogleCloudStorageNamespace.js +1 -1
- package/google/storage/server.d.ts +1 -1
- package/package.json +1 -1
- package/webWorker/index.d.ts +3 -1
- package/webWorker/index.js +3 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -11,13 +11,13 @@ type Datasets = {
|
|
|
11
11
|
location: string;
|
|
12
12
|
projectId: string;
|
|
13
13
|
};
|
|
14
|
-
type
|
|
14
|
+
type Table = {
|
|
15
15
|
id: string;
|
|
16
16
|
};
|
|
17
17
|
export declare class GoogleBigQueryNamespace extends BaseNamespace {
|
|
18
18
|
client: BigQuery;
|
|
19
19
|
config: GoogleCloudConfig & {
|
|
20
|
-
projectId
|
|
20
|
+
projectId?: string;
|
|
21
21
|
};
|
|
22
22
|
ensureInit: () => Promise<void>;
|
|
23
23
|
/**
|
|
@@ -44,10 +44,7 @@ export declare class GoogleBigQueryNamespace extends BaseNamespace {
|
|
|
44
44
|
* Check to see whether a given BigQuery table exists.
|
|
45
45
|
* https://cloud.google.com/bigquery/docs/samples/bigquery-table-exists
|
|
46
46
|
*/
|
|
47
|
-
tableExists: (datasetId: string, tableId: string) => Promise<
|
|
48
|
-
|
|
49
|
-
* Retrieve all the Tables from a given Project/Dataset.
|
|
50
|
-
*/
|
|
51
|
-
getTable: (datasetId: string) => Promise<Tables[]>;
|
|
47
|
+
tableExists: (datasetId: string, tableId: string) => Promise<boolean>;
|
|
48
|
+
getTables: (datasetId: string) => Promise<Table[]>;
|
|
52
49
|
}
|
|
53
50
|
export {};
|
|
@@ -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) {
|
|
@@ -129,22 +129,17 @@ class GoogleBigQueryNamespace extends _class_1.BaseNamespace {
|
|
|
129
129
|
*/
|
|
130
130
|
this.tableExists = async (datasetId, tableId) => {
|
|
131
131
|
await this.ensureInit();
|
|
132
|
-
let response;
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
catch (exception) {
|
|
140
|
-
response = false;
|
|
132
|
+
let response = false;
|
|
133
|
+
const tables = await this.getTables(datasetId);
|
|
134
|
+
for (let i = 0; i < tables.length; i++) {
|
|
135
|
+
if (tables[i].id === tableId) {
|
|
136
|
+
response = true;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
141
139
|
}
|
|
142
140
|
return response;
|
|
143
141
|
};
|
|
144
|
-
|
|
145
|
-
* Retrieve all the Tables from a given Project/Dataset.
|
|
146
|
-
*/
|
|
147
|
-
this.getTable = async (datasetId) => {
|
|
142
|
+
this.getTables = async (datasetId) => {
|
|
148
143
|
await this.ensureInit();
|
|
149
144
|
let response = [];
|
|
150
145
|
const tables = await this.client.dataset(datasetId)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GoogleBigQueryNamespace } from "./GoogleBigQueryNamespace";
|
|
2
2
|
import type { GoogleAuthOptions } from "@google-cloud/common";
|
|
3
|
-
export declare const googleBigQueryClient: (key
|
|
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";
|
|
@@ -10,7 +10,7 @@ type GetBatchDataProps = {
|
|
|
10
10
|
export declare class GoogleSheetsNamespace extends BaseNamespace {
|
|
11
11
|
client: GoogleAuth;
|
|
12
12
|
config: GoogleCloudConfig & {
|
|
13
|
-
projectId
|
|
13
|
+
projectId?: string;
|
|
14
14
|
};
|
|
15
15
|
ensureInit: () => Promise<void>;
|
|
16
16
|
getBatchData: (props: GetBatchDataProps) => Promise<import("@googleapis/sheets").sheets_v4.Schema$BatchGetValuesResponse>;
|
|
@@ -46,7 +46,7 @@ class GoogleSheetsNamespace extends _class_1.BaseNamespace {
|
|
|
46
46
|
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
47
47
|
this.client = new googleApisSheets.auth.GoogleAuth({
|
|
48
48
|
credentials: formattedConfig,
|
|
49
|
-
projectId: this.config
|
|
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
|
*/
|
|
@@ -46,7 +46,7 @@ class GoogleCloudStorageNamespace extends _class_1.BaseNamespace {
|
|
|
46
46
|
const formattedConfig = (0, server_1.getConfig)(this.config);
|
|
47
47
|
this.client = new Storage({
|
|
48
48
|
...formattedConfig,
|
|
49
|
-
projectId: this.config
|
|
49
|
+
projectId: this.config?.projectId,
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
catch (e) {
|
|
@@ -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/package.json
CHANGED
package/webWorker/index.d.ts
CHANGED
package/webWorker/index.js
CHANGED