gdrivekit 1.0.4 → 1.0.5

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.
Files changed (3) hide show
  1. package/README.md +11 -1
  2. package/dist/index.js +45 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -45,6 +45,7 @@ await generateCredentialsAndTokens({
45
45
  projectid: process.env.GOOGLE_PROJECT_ID!,
46
46
  clientsecret: process.env.GOOGLE_CLIENT_SECRET!,
47
47
  redirecturis: ["http://localhost:3000/oauth2callback"],
48
+ javascriptorigins: ["http://localhost:3000"],
48
49
  });
49
50
  ```
50
51
 
@@ -125,6 +126,15 @@ main();
125
126
  | `listRecentFiles()` | List recently modified or added files |
126
127
  | `listPDFs()` | List all PDF files |
127
128
  | `listImages()` | List all image files |
129
+ | `listVideos()` | List all video files |
130
+ | `listAudios()` | List all audio files |
131
+ | `listArchives()` | List all archive files |
132
+ | `listJSONs()` | List all json files |
133
+ | `listSheets()` | List all sheet files |
134
+ | `listPresentations()`| List all presentation files |
135
+ | `listDocs()` | List all docs files |
136
+
137
+
128
138
 
129
139
  ---
130
140
 
@@ -148,7 +158,7 @@ main();
148
158
 
149
159
  ---
150
160
 
151
- ## Json Operation
161
+ ### ❴❵ **Json Operation**
152
162
  | Method | Description |
153
163
  | ----------------------- | ----------------------------------------- |
154
164
  | `readJsonFileData()` | Read JSON file content |
package/dist/index.js CHANGED
@@ -778718,11 +778718,18 @@ __export(exports_operations, {
778718
778718
  readFileData: () => readFileData,
778719
778719
  moveFileByName: () => moveFileByName,
778720
778720
  moveFile: () => moveFile,
778721
+ listVideos: () => listVideos,
778722
+ listSheets: () => listSheets,
778721
778723
  listRecentFiles: () => listRecentFiles,
778724
+ listPresentations: () => listPresentations,
778722
778725
  listPDFs: () => listPDFs,
778726
+ listJSONs: () => listJSONs,
778723
778727
  listImages: () => listImages,
778724
778728
  listFilesInFolder: () => listFilesInFolder,
778725
778729
  listFiles: () => listFiles,
778730
+ listDocs: () => listDocs,
778731
+ listAudios: () => listAudios,
778732
+ listArchives: () => listArchives,
778726
778733
  listAllFolders: () => listAllFolders,
778727
778734
  getFolderIdByName: () => getFolderIdByName,
778728
778735
  getFileInfo: () => getFileInfo,
@@ -778764,6 +778771,8 @@ var MIME_TYPES = {
778764
778771
  SVG: "image/svg+xml",
778765
778772
  MP4: "video/mp4",
778766
778773
  AVI: "video/x-msvideo",
778774
+ MKV: "video/x-matroska",
778775
+ WEBM: "video/webm",
778767
778776
  MP3: "audio/mpeg",
778768
778777
  WAV: "audio/wav",
778769
778778
  ZIP: "application/zip",
@@ -779032,7 +779041,42 @@ async function listPDFs() {
779032
779041
  }
779033
779042
  async function listImages() {
779034
779043
  return await driveService.listFiles({
779035
- query: `mimeType contains 'image/' and trashed=false`
779044
+ query: `mimeType='${MIME_TYPES.JPEG}' or mimeType='${MIME_TYPES.PNG}' or mimeType='${MIME_TYPES.GIF}' or mimeType='${MIME_TYPES.SVG}' and trashed=false`
779045
+ });
779046
+ }
779047
+ async function listVideos() {
779048
+ return await driveService.listFiles({
779049
+ query: `mimeType='${MIME_TYPES.MP4}' or mimeType='${MIME_TYPES.MKV}' or mimeType='${MIME_TYPES.WEBM}' or mimeType='${MIME_TYPES.AVI}' and trashed=false`
779050
+ });
779051
+ }
779052
+ async function listAudios() {
779053
+ return await driveService.listFiles({
779054
+ query: `mimeType='${MIME_TYPES.MP3}' or mimeType='${MIME_TYPES.WAV}' and trashed=false`
779055
+ });
779056
+ }
779057
+ async function listArchives() {
779058
+ return await driveService.listFiles({
779059
+ query: `mimeType='${MIME_TYPES.ZIP}' or mimeType='${MIME_TYPES.RAR}' and trashed=false`
779060
+ });
779061
+ }
779062
+ async function listJSONs() {
779063
+ return await driveService.listFiles({
779064
+ query: `mimeType='${MIME_TYPES.JSON}' and trashed=false`
779065
+ });
779066
+ }
779067
+ async function listSheets() {
779068
+ return await driveService.listFiles({
779069
+ query: `mimeType='${MIME_TYPES.SPREADSHEET}' and trashed=false`
779070
+ });
779071
+ }
779072
+ async function listPresentations() {
779073
+ return await driveService.listFiles({
779074
+ query: `mimeType='${MIME_TYPES.PRESENTATION}' and trashed=false`
779075
+ });
779076
+ }
779077
+ async function listDocs() {
779078
+ return await driveService.listFiles({
779079
+ query: `mimeType='${MIME_TYPES.DOCUMENT}' and trashed=false`
779036
779080
  });
779037
779081
  }
779038
779082
  async function uploadMultipleFiles(filePaths, folderId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdrivekit",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "A lightweight Google Drive toolkit for File Management. Handle Google Drive operations easily — upload, download, and other file operations in a few lines of code.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",