@8ms/helpers 3.0.24 → 3.0.26
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/dist/googleCloud/drive/server/GoogleCloudDrive.cjs +139 -0
- package/dist/googleCloud/drive/server/GoogleCloudDrive.d.cts +53 -0
- package/dist/googleCloud/drive/server/GoogleCloudDrive.d.mts +53 -0
- package/dist/googleCloud/drive/server/GoogleCloudDrive.mjs +138 -0
- package/dist/googleCloud/drive/server/index.cjs +3 -0
- package/dist/googleCloud/drive/server/index.d.cts +2 -0
- package/dist/googleCloud/drive/server/index.d.mts +2 -0
- package/dist/googleCloud/drive/server/index.mjs +2 -0
- package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.cts +2 -3
- package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.mts +2 -3
- package/package.json +14 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require__class_BaseNamespace = require("../../../_class/BaseNamespace.cjs");
|
|
3
|
+
const require_util_server_getGzipCompressed = require("../../../util/server/getGzipCompressed.cjs");
|
|
4
|
+
const require_util_server_getGzipDecompressed = require("../../../util/server/getGzipDecompressed.cjs");
|
|
5
|
+
//#region src/googleCloud/drive/server/GoogleCloudDrive.ts
|
|
6
|
+
var GoogleCloudDrive = class extends require__class_BaseNamespace.BaseNamespace {
|
|
7
|
+
/**
|
|
8
|
+
* Either a Google Cloud JSON Config or V10 Auth helper.
|
|
9
|
+
*/
|
|
10
|
+
init = async (isOidc, config, projectId, region) => {
|
|
11
|
+
if (!this.client) try {
|
|
12
|
+
const googleApisDrive = await import("@googleapis/drive");
|
|
13
|
+
this.client = new googleApisDrive.auth.GoogleAuth({
|
|
14
|
+
authClient: isOidc ? config : void 0,
|
|
15
|
+
credentials: isOidc ? void 0 : config,
|
|
16
|
+
projectId,
|
|
17
|
+
scopes: ["https://www.googleapis.com/auth/drive"]
|
|
18
|
+
});
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw new Error("Google Drive Client not installed");
|
|
21
|
+
}
|
|
22
|
+
return this;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* List the files within the given (optional) parent folder.
|
|
26
|
+
*/
|
|
27
|
+
listFiles = async (parentFolderId) => {
|
|
28
|
+
const googleApisDrive = await import("@googleapis/drive");
|
|
29
|
+
const parentClause = parentFolderId ? `'${parentFolderId}' in parents and ` : "";
|
|
30
|
+
const apiResponse = await googleApisDrive.drive("v3").files.list({
|
|
31
|
+
auth: this.client,
|
|
32
|
+
fields: "files(id, name, mimeType, modifiedTime)",
|
|
33
|
+
q: `${parentClause}mimeType != 'application/vnd.google-apps.folder' and trashed = false`
|
|
34
|
+
});
|
|
35
|
+
if (!apiResponse?.data?.files) return [];
|
|
36
|
+
return apiResponse.data.files.filter((file) => !!file?.id).map((file) => ({
|
|
37
|
+
id: file.id,
|
|
38
|
+
name: file.name ?? "",
|
|
39
|
+
mimeType: file.mimeType ?? "",
|
|
40
|
+
modifiedTime: file.modifiedTime ?? ""
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* List the folders within the given (optional) parent folder.
|
|
45
|
+
*/
|
|
46
|
+
listFolders = async (parentFolderId) => {
|
|
47
|
+
const googleApisDrive = await import("@googleapis/drive");
|
|
48
|
+
const parentClause = parentFolderId ? `'${parentFolderId}' in parents and ` : "";
|
|
49
|
+
const apiResponse = await googleApisDrive.drive("v3").files.list({
|
|
50
|
+
auth: this.client,
|
|
51
|
+
fields: "files(id, name, mimeType, modifiedTime)",
|
|
52
|
+
q: `${parentClause}mimeType = 'application/vnd.google-apps.folder' and trashed = false`
|
|
53
|
+
});
|
|
54
|
+
if (!apiResponse?.data?.files) return [];
|
|
55
|
+
return apiResponse.data.files.filter((file) => !!file?.id).map((file) => ({
|
|
56
|
+
id: file.id,
|
|
57
|
+
name: file.name ?? "",
|
|
58
|
+
mimeType: file.mimeType ?? "",
|
|
59
|
+
modifiedTime: file.modifiedTime ?? ""
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Check to see if a file with the given name exists in the given parent folder.
|
|
64
|
+
*/
|
|
65
|
+
fileExists = async (parentFolderId, fileName) => {
|
|
66
|
+
let response = false;
|
|
67
|
+
try {
|
|
68
|
+
response = 0 < ((await (await import("@googleapis/drive")).drive("v3").files.list({
|
|
69
|
+
auth: this.client,
|
|
70
|
+
fields: "files(id)",
|
|
71
|
+
q: `name = '${fileName}' and '${parentFolderId}' in parents and trashed = false`
|
|
72
|
+
}))?.data?.files?.length ?? 0);
|
|
73
|
+
} catch (exception) {
|
|
74
|
+
response = false;
|
|
75
|
+
}
|
|
76
|
+
return response;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Move a file to the Google Drive trash.
|
|
80
|
+
*/
|
|
81
|
+
deleteFile = async (fileId) => {
|
|
82
|
+
await (await import("@googleapis/drive")).drive("v3").files.update({
|
|
83
|
+
auth: this.client,
|
|
84
|
+
fileId,
|
|
85
|
+
requestBody: { trashed: true }
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Write a file to Google Drive within the given parent folder.
|
|
90
|
+
*/
|
|
91
|
+
writeFile = async (parentFolderId, fileName, data, options = {}) => {
|
|
92
|
+
return (await (await import("@googleapis/drive")).drive("v3").files.create({
|
|
93
|
+
auth: this.client,
|
|
94
|
+
fields: "id, name",
|
|
95
|
+
media: {
|
|
96
|
+
body: data,
|
|
97
|
+
mimeType: options.mimeType ?? "text/plain"
|
|
98
|
+
},
|
|
99
|
+
requestBody: {
|
|
100
|
+
name: fileName,
|
|
101
|
+
parents: [parentFolderId]
|
|
102
|
+
}
|
|
103
|
+
})).data;
|
|
104
|
+
};
|
|
105
|
+
writeJson = async (parentFolderId, fileName, data, options = {}) => {
|
|
106
|
+
return await this.writeFile(parentFolderId, fileName, JSON.stringify(data), options);
|
|
107
|
+
};
|
|
108
|
+
writeJsonGzip = async (parentFolderId, fileName, data, gzipOptions = {}, driveOptions = {}) => {
|
|
109
|
+
let finalData = JSON.stringify(data);
|
|
110
|
+
finalData = await require_util_server_getGzipCompressed.getGzipCompressed(finalData, gzipOptions);
|
|
111
|
+
return await this.writeFile(parentFolderId, fileName, finalData, driveOptions);
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Read a file's contents from Google Drive.
|
|
115
|
+
*/
|
|
116
|
+
readFile = async (fileId, options = {}) => {
|
|
117
|
+
return { body: (await (await import("@googleapis/drive")).drive("v3").files.get({
|
|
118
|
+
auth: this.client,
|
|
119
|
+
fileId,
|
|
120
|
+
alt: "media",
|
|
121
|
+
...options
|
|
122
|
+
}, { responseType: "text" })).data };
|
|
123
|
+
};
|
|
124
|
+
readJson = async (fileId) => {
|
|
125
|
+
const apiResponse = await this.readFile(fileId);
|
|
126
|
+
apiResponse.body = JSON.parse(apiResponse.body) || null;
|
|
127
|
+
return apiResponse;
|
|
128
|
+
};
|
|
129
|
+
readJsonGzip = async (fileId, gzipOptions = {}, driveOptions = {}) => {
|
|
130
|
+
const apiResponse = await this.readFile(fileId, driveOptions);
|
|
131
|
+
if (void 0 !== apiResponse.body) {
|
|
132
|
+
apiResponse.body = await require_util_server_getGzipDecompressed.getGzipDecompressed(apiResponse.body, gzipOptions);
|
|
133
|
+
apiResponse.body = JSON.parse(apiResponse.body) || null;
|
|
134
|
+
}
|
|
135
|
+
return apiResponse;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
//#endregion
|
|
139
|
+
exports.GoogleCloudDrive = GoogleCloudDrive;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BaseNamespace } from "../../../_class/BaseNamespace.cjs";
|
|
2
|
+
//#region src/googleCloud/drive/server/GoogleCloudDrive.d.ts
|
|
3
|
+
type Options = {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
type DriveFile = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
modifiedTime: string;
|
|
11
|
+
};
|
|
12
|
+
declare class GoogleCloudDrive extends BaseNamespace {
|
|
13
|
+
client: any;
|
|
14
|
+
config: any;
|
|
15
|
+
/**
|
|
16
|
+
* Either a Google Cloud JSON Config or V10 Auth helper.
|
|
17
|
+
*/
|
|
18
|
+
init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
|
|
19
|
+
/**
|
|
20
|
+
* List the files within the given (optional) parent folder.
|
|
21
|
+
*/
|
|
22
|
+
listFiles: (parentFolderId?: string) => Promise<DriveFile[]>;
|
|
23
|
+
/**
|
|
24
|
+
* List the folders within the given (optional) parent folder.
|
|
25
|
+
*/
|
|
26
|
+
listFolders: (parentFolderId?: string) => Promise<DriveFile[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Check to see if a file with the given name exists in the given parent folder.
|
|
29
|
+
*/
|
|
30
|
+
fileExists: (parentFolderId: string, fileName: string) => Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Move a file to the Google Drive trash.
|
|
33
|
+
*/
|
|
34
|
+
deleteFile: (fileId: string) => Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Write a file to Google Drive within the given parent folder.
|
|
37
|
+
*/
|
|
38
|
+
writeFile: (parentFolderId: string, fileName: string, data: any, options?: Options) => Promise<import("@googleapis/drive").drive_v3.Schema$File>;
|
|
39
|
+
writeJson: (parentFolderId: string, fileName: string, data: any, options?: Options) => Promise<import("@googleapis/drive").drive_v3.Schema$File>;
|
|
40
|
+
writeJsonGzip: (parentFolderId: string, fileName: string, data: any, gzipOptions?: object, driveOptions?: Options) => Promise<import("@googleapis/drive").drive_v3.Schema$File>;
|
|
41
|
+
/**
|
|
42
|
+
* Read a file's contents from Google Drive.
|
|
43
|
+
*/
|
|
44
|
+
readFile: (fileId: string, options?: Options) => Promise<{
|
|
45
|
+
body: string;
|
|
46
|
+
}>;
|
|
47
|
+
readJson: (fileId: string) => Promise<{
|
|
48
|
+
body: string;
|
|
49
|
+
}>;
|
|
50
|
+
readJsonGzip: (fileId: string, gzipOptions?: object, driveOptions?: Options) => Promise<any>;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { GoogleCloudDrive };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BaseNamespace } from "../../../_class/BaseNamespace.mjs";
|
|
2
|
+
//#region src/googleCloud/drive/server/GoogleCloudDrive.d.ts
|
|
3
|
+
type Options = {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
type DriveFile = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
modifiedTime: string;
|
|
11
|
+
};
|
|
12
|
+
declare class GoogleCloudDrive extends BaseNamespace {
|
|
13
|
+
client: any;
|
|
14
|
+
config: any;
|
|
15
|
+
/**
|
|
16
|
+
* Either a Google Cloud JSON Config or V10 Auth helper.
|
|
17
|
+
*/
|
|
18
|
+
init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
|
|
19
|
+
/**
|
|
20
|
+
* List the files within the given (optional) parent folder.
|
|
21
|
+
*/
|
|
22
|
+
listFiles: (parentFolderId?: string) => Promise<DriveFile[]>;
|
|
23
|
+
/**
|
|
24
|
+
* List the folders within the given (optional) parent folder.
|
|
25
|
+
*/
|
|
26
|
+
listFolders: (parentFolderId?: string) => Promise<DriveFile[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Check to see if a file with the given name exists in the given parent folder.
|
|
29
|
+
*/
|
|
30
|
+
fileExists: (parentFolderId: string, fileName: string) => Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Move a file to the Google Drive trash.
|
|
33
|
+
*/
|
|
34
|
+
deleteFile: (fileId: string) => Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Write a file to Google Drive within the given parent folder.
|
|
37
|
+
*/
|
|
38
|
+
writeFile: (parentFolderId: string, fileName: string, data: any, options?: Options) => Promise<import("@googleapis/drive").drive_v3.Schema$File>;
|
|
39
|
+
writeJson: (parentFolderId: string, fileName: string, data: any, options?: Options) => Promise<import("@googleapis/drive").drive_v3.Schema$File>;
|
|
40
|
+
writeJsonGzip: (parentFolderId: string, fileName: string, data: any, gzipOptions?: object, driveOptions?: Options) => Promise<import("@googleapis/drive").drive_v3.Schema$File>;
|
|
41
|
+
/**
|
|
42
|
+
* Read a file's contents from Google Drive.
|
|
43
|
+
*/
|
|
44
|
+
readFile: (fileId: string, options?: Options) => Promise<{
|
|
45
|
+
body: string;
|
|
46
|
+
}>;
|
|
47
|
+
readJson: (fileId: string) => Promise<{
|
|
48
|
+
body: string;
|
|
49
|
+
}>;
|
|
50
|
+
readJsonGzip: (fileId: string, gzipOptions?: object, driveOptions?: Options) => Promise<any>;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { GoogleCloudDrive };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { BaseNamespace } from "../../../_class/BaseNamespace.mjs";
|
|
2
|
+
import { getGzipCompressed } from "../../../util/server/getGzipCompressed.mjs";
|
|
3
|
+
import { getGzipDecompressed } from "../../../util/server/getGzipDecompressed.mjs";
|
|
4
|
+
//#region src/googleCloud/drive/server/GoogleCloudDrive.ts
|
|
5
|
+
var GoogleCloudDrive = class extends BaseNamespace {
|
|
6
|
+
/**
|
|
7
|
+
* Either a Google Cloud JSON Config or V10 Auth helper.
|
|
8
|
+
*/
|
|
9
|
+
init = async (isOidc, config, projectId, region) => {
|
|
10
|
+
if (!this.client) try {
|
|
11
|
+
const googleApisDrive = await import("@googleapis/drive");
|
|
12
|
+
this.client = new googleApisDrive.auth.GoogleAuth({
|
|
13
|
+
authClient: isOidc ? config : void 0,
|
|
14
|
+
credentials: isOidc ? void 0 : config,
|
|
15
|
+
projectId,
|
|
16
|
+
scopes: ["https://www.googleapis.com/auth/drive"]
|
|
17
|
+
});
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw new Error("Google Drive Client not installed");
|
|
20
|
+
}
|
|
21
|
+
return this;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* List the files within the given (optional) parent folder.
|
|
25
|
+
*/
|
|
26
|
+
listFiles = async (parentFolderId) => {
|
|
27
|
+
const googleApisDrive = await import("@googleapis/drive");
|
|
28
|
+
const parentClause = parentFolderId ? `'${parentFolderId}' in parents and ` : "";
|
|
29
|
+
const apiResponse = await googleApisDrive.drive("v3").files.list({
|
|
30
|
+
auth: this.client,
|
|
31
|
+
fields: "files(id, name, mimeType, modifiedTime)",
|
|
32
|
+
q: `${parentClause}mimeType != 'application/vnd.google-apps.folder' and trashed = false`
|
|
33
|
+
});
|
|
34
|
+
if (!apiResponse?.data?.files) return [];
|
|
35
|
+
return apiResponse.data.files.filter((file) => !!file?.id).map((file) => ({
|
|
36
|
+
id: file.id,
|
|
37
|
+
name: file.name ?? "",
|
|
38
|
+
mimeType: file.mimeType ?? "",
|
|
39
|
+
modifiedTime: file.modifiedTime ?? ""
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* List the folders within the given (optional) parent folder.
|
|
44
|
+
*/
|
|
45
|
+
listFolders = async (parentFolderId) => {
|
|
46
|
+
const googleApisDrive = await import("@googleapis/drive");
|
|
47
|
+
const parentClause = parentFolderId ? `'${parentFolderId}' in parents and ` : "";
|
|
48
|
+
const apiResponse = await googleApisDrive.drive("v3").files.list({
|
|
49
|
+
auth: this.client,
|
|
50
|
+
fields: "files(id, name, mimeType, modifiedTime)",
|
|
51
|
+
q: `${parentClause}mimeType = 'application/vnd.google-apps.folder' and trashed = false`
|
|
52
|
+
});
|
|
53
|
+
if (!apiResponse?.data?.files) return [];
|
|
54
|
+
return apiResponse.data.files.filter((file) => !!file?.id).map((file) => ({
|
|
55
|
+
id: file.id,
|
|
56
|
+
name: file.name ?? "",
|
|
57
|
+
mimeType: file.mimeType ?? "",
|
|
58
|
+
modifiedTime: file.modifiedTime ?? ""
|
|
59
|
+
}));
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Check to see if a file with the given name exists in the given parent folder.
|
|
63
|
+
*/
|
|
64
|
+
fileExists = async (parentFolderId, fileName) => {
|
|
65
|
+
let response = false;
|
|
66
|
+
try {
|
|
67
|
+
response = 0 < ((await (await import("@googleapis/drive")).drive("v3").files.list({
|
|
68
|
+
auth: this.client,
|
|
69
|
+
fields: "files(id)",
|
|
70
|
+
q: `name = '${fileName}' and '${parentFolderId}' in parents and trashed = false`
|
|
71
|
+
}))?.data?.files?.length ?? 0);
|
|
72
|
+
} catch (exception) {
|
|
73
|
+
response = false;
|
|
74
|
+
}
|
|
75
|
+
return response;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Move a file to the Google Drive trash.
|
|
79
|
+
*/
|
|
80
|
+
deleteFile = async (fileId) => {
|
|
81
|
+
await (await import("@googleapis/drive")).drive("v3").files.update({
|
|
82
|
+
auth: this.client,
|
|
83
|
+
fileId,
|
|
84
|
+
requestBody: { trashed: true }
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Write a file to Google Drive within the given parent folder.
|
|
89
|
+
*/
|
|
90
|
+
writeFile = async (parentFolderId, fileName, data, options = {}) => {
|
|
91
|
+
return (await (await import("@googleapis/drive")).drive("v3").files.create({
|
|
92
|
+
auth: this.client,
|
|
93
|
+
fields: "id, name",
|
|
94
|
+
media: {
|
|
95
|
+
body: data,
|
|
96
|
+
mimeType: options.mimeType ?? "text/plain"
|
|
97
|
+
},
|
|
98
|
+
requestBody: {
|
|
99
|
+
name: fileName,
|
|
100
|
+
parents: [parentFolderId]
|
|
101
|
+
}
|
|
102
|
+
})).data;
|
|
103
|
+
};
|
|
104
|
+
writeJson = async (parentFolderId, fileName, data, options = {}) => {
|
|
105
|
+
return await this.writeFile(parentFolderId, fileName, JSON.stringify(data), options);
|
|
106
|
+
};
|
|
107
|
+
writeJsonGzip = async (parentFolderId, fileName, data, gzipOptions = {}, driveOptions = {}) => {
|
|
108
|
+
let finalData = JSON.stringify(data);
|
|
109
|
+
finalData = await getGzipCompressed(finalData, gzipOptions);
|
|
110
|
+
return await this.writeFile(parentFolderId, fileName, finalData, driveOptions);
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Read a file's contents from Google Drive.
|
|
114
|
+
*/
|
|
115
|
+
readFile = async (fileId, options = {}) => {
|
|
116
|
+
return { body: (await (await import("@googleapis/drive")).drive("v3").files.get({
|
|
117
|
+
auth: this.client,
|
|
118
|
+
fileId,
|
|
119
|
+
alt: "media",
|
|
120
|
+
...options
|
|
121
|
+
}, { responseType: "text" })).data };
|
|
122
|
+
};
|
|
123
|
+
readJson = async (fileId) => {
|
|
124
|
+
const apiResponse = await this.readFile(fileId);
|
|
125
|
+
apiResponse.body = JSON.parse(apiResponse.body) || null;
|
|
126
|
+
return apiResponse;
|
|
127
|
+
};
|
|
128
|
+
readJsonGzip = async (fileId, gzipOptions = {}, driveOptions = {}) => {
|
|
129
|
+
const apiResponse = await this.readFile(fileId, driveOptions);
|
|
130
|
+
if (void 0 !== apiResponse.body) {
|
|
131
|
+
apiResponse.body = await getGzipDecompressed(apiResponse.body, gzipOptions);
|
|
132
|
+
apiResponse.body = JSON.parse(apiResponse.body) || null;
|
|
133
|
+
}
|
|
134
|
+
return apiResponse;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
//#endregion
|
|
138
|
+
export { GoogleCloudDrive };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../../_class/BaseNamespace.cjs";
|
|
2
|
-
import { GoogleAuth } from "googleapis-common";
|
|
3
2
|
//#region src/googleCloud/sheets/server/GoogleCloudSheets.d.ts
|
|
4
3
|
type GetBatchDataProps = {
|
|
5
4
|
spreadsheetId: string;
|
|
@@ -8,13 +7,13 @@ type GetBatchDataProps = {
|
|
|
8
7
|
valueRender?: string;
|
|
9
8
|
};
|
|
10
9
|
declare class GoogleCloudSheets extends BaseNamespace {
|
|
11
|
-
client:
|
|
10
|
+
client: any;
|
|
12
11
|
config: any;
|
|
13
12
|
/**
|
|
14
13
|
* Either a Google Cloud JSON Config or V10 Auth helper.
|
|
15
14
|
*/
|
|
16
15
|
init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
|
|
17
|
-
getBatchData: (props: GetBatchDataProps) => Promise<
|
|
16
|
+
getBatchData: (props: GetBatchDataProps) => Promise<import("@googleapis/sheets").sheets_v4.Schema$BatchGetValuesResponse>;
|
|
18
17
|
}
|
|
19
18
|
//#endregion
|
|
20
19
|
export { GoogleCloudSheets };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../../_class/BaseNamespace.mjs";
|
|
2
|
-
import { GoogleAuth } from "googleapis-common";
|
|
3
2
|
//#region src/googleCloud/sheets/server/GoogleCloudSheets.d.ts
|
|
4
3
|
type GetBatchDataProps = {
|
|
5
4
|
spreadsheetId: string;
|
|
@@ -8,13 +7,13 @@ type GetBatchDataProps = {
|
|
|
8
7
|
valueRender?: string;
|
|
9
8
|
};
|
|
10
9
|
declare class GoogleCloudSheets extends BaseNamespace {
|
|
11
|
-
client:
|
|
10
|
+
client: any;
|
|
12
11
|
config: any;
|
|
13
12
|
/**
|
|
14
13
|
* Either a Google Cloud JSON Config or V10 Auth helper.
|
|
15
14
|
*/
|
|
16
15
|
init: (isOidc: boolean, config: any, projectId: string, region?: string) => Promise<this>;
|
|
17
|
-
getBatchData: (props: GetBatchDataProps) => Promise<
|
|
16
|
+
getBatchData: (props: GetBatchDataProps) => Promise<import("@googleapis/sheets").sheets_v4.Schema$BatchGetValuesResponse>;
|
|
18
17
|
}
|
|
19
18
|
//#endregion
|
|
20
19
|
export { GoogleCloudSheets };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@8ms/helpers",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.26",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@google-cloud/bigquery": "^9.0.0",
|
|
57
57
|
"@google-cloud/common": "^8.0.0",
|
|
58
58
|
"@google-cloud/storage": "^8.0.0",
|
|
59
|
+
"@googleapis/drive": "^21.0.0",
|
|
59
60
|
"@googleapis/sheets": "^14.0.0",
|
|
60
61
|
"@planetscale/database": "^1.0.0",
|
|
61
62
|
"@prisma/adapter-mariadb": "^7.0.0",
|
|
@@ -128,6 +129,9 @@
|
|
|
128
129
|
"@google-cloud/storage": {
|
|
129
130
|
"optional": true
|
|
130
131
|
},
|
|
132
|
+
"@googleapis/drive": {
|
|
133
|
+
"optional": true
|
|
134
|
+
},
|
|
131
135
|
"@googleapis/sheets": {
|
|
132
136
|
"optional": true
|
|
133
137
|
},
|
|
@@ -205,6 +209,7 @@
|
|
|
205
209
|
"@google-cloud/bigquery": "^9.0.2",
|
|
206
210
|
"@google-cloud/common": "^8.0.1",
|
|
207
211
|
"@google-cloud/storage": "^8.0.1",
|
|
212
|
+
"@googleapis/drive": "^21.0.0",
|
|
208
213
|
"@googleapis/sheets": "^14.0.0",
|
|
209
214
|
"@planetscale/database": "^1.20.1",
|
|
210
215
|
"@prisma/adapter-mariadb": "^7.9.1",
|
|
@@ -674,6 +679,14 @@
|
|
|
674
679
|
"import": "./dist/googleCloud/bigquery/server/loadData.mjs",
|
|
675
680
|
"require": "./dist/googleCloud/bigquery/server/loadData.cjs"
|
|
676
681
|
},
|
|
682
|
+
"./googleCloud/drive/server": {
|
|
683
|
+
"import": "./dist/googleCloud/drive/server/index.mjs",
|
|
684
|
+
"require": "./dist/googleCloud/drive/server/index.cjs"
|
|
685
|
+
},
|
|
686
|
+
"./googleCloud/drive/server/GoogleCloudDrive": {
|
|
687
|
+
"import": "./dist/googleCloud/drive/server/GoogleCloudDrive.mjs",
|
|
688
|
+
"require": "./dist/googleCloud/drive/server/GoogleCloudDrive.cjs"
|
|
689
|
+
},
|
|
677
690
|
"./googleCloud/server": {
|
|
678
691
|
"import": "./dist/googleCloud/server/index.mjs",
|
|
679
692
|
"require": "./dist/googleCloud/server/index.cjs"
|