@o/drive-app
Advanced tools
Comparing version 2.6.1 to 2.7.0
@@ -16,3 +16,3 @@ { | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$About>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$About>", | ||
"comment": "" | ||
@@ -34,3 +34,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$StartPageToken>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$StartPageToken>", | ||
"comment": "" | ||
@@ -52,3 +52,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$ChangeList>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$ChangeList>", | ||
"comment": "" | ||
@@ -70,3 +70,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Comment>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Comment>", | ||
"comment": "" | ||
@@ -88,3 +88,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -106,3 +106,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Comment>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Comment>", | ||
"comment": "" | ||
@@ -124,3 +124,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$CommentList>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$CommentList>", | ||
"comment": "" | ||
@@ -142,3 +142,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Comment>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Comment>", | ||
"comment": "" | ||
@@ -160,3 +160,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$File>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$File>", | ||
"comment": "" | ||
@@ -178,3 +178,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$File>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$File>", | ||
"comment": "" | ||
@@ -196,3 +196,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -214,3 +214,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -232,3 +232,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -250,3 +250,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$GeneratedIds>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$GeneratedIds>", | ||
"comment": "" | ||
@@ -268,3 +268,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$File>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$File>", | ||
"comment": "" | ||
@@ -286,3 +286,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$FileList>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$FileList>", | ||
"comment": "" | ||
@@ -304,3 +304,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$File>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$File>", | ||
"comment": "" | ||
@@ -322,3 +322,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Channel>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Channel>", | ||
"comment": "" | ||
@@ -340,3 +340,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Permission>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Permission>", | ||
"comment": "" | ||
@@ -358,3 +358,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -376,3 +376,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Permission>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Permission>", | ||
"comment": "" | ||
@@ -394,3 +394,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$PermissionList>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$PermissionList>", | ||
"comment": "" | ||
@@ -412,3 +412,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Permission>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Permission>", | ||
"comment": "" | ||
@@ -430,3 +430,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Reply>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Reply>", | ||
"comment": "" | ||
@@ -448,3 +448,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -466,3 +466,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Reply>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Reply>", | ||
"comment": "" | ||
@@ -484,3 +484,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$ReplyList>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$ReplyList>", | ||
"comment": "" | ||
@@ -502,3 +502,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Reply>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Reply>", | ||
"comment": "" | ||
@@ -520,3 +520,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -538,3 +538,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Revision>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Revision>", | ||
"comment": "" | ||
@@ -556,3 +556,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$RevisionList>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$RevisionList>", | ||
"comment": "" | ||
@@ -574,3 +574,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$Revision>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$Revision>", | ||
"comment": "" | ||
@@ -592,3 +592,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$TeamDrive>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$TeamDrive>", | ||
"comment": "" | ||
@@ -610,3 +610,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<void>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<void>", | ||
"comment": "" | ||
@@ -628,3 +628,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$TeamDrive>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$TeamDrive>", | ||
"comment": "" | ||
@@ -646,3 +646,3 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$TeamDriveList>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$TeamDriveList>", | ||
"comment": "" | ||
@@ -664,5 +664,5 @@ }, | ||
], | ||
"typeString": "(params?: any, options?: MethodOptions) => Promise<GaxiosResponse<Schema$TeamDrive>>", | ||
"typeString": "(params?: any, options?: MethodOptions) => GaxiosPromise<Schema$TeamDrive>", | ||
"comment": "" | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
{"identifier":"drive","name":"Drive","buildId":1564764321341,"appVersion":"2.6.0","orbitVersion":"2.6.0","api":true,"app":false,"graph":true,"workers":true} | ||
{"configFiles":2983135551,"appHash":{"name":"drive-app","children":[{"name":"DriveBitFactory.ts","hash":"0hdRAbWlLDDTkWmE3FDkvVID+Bg="},{"name":"DriveLoader.ts","hash":"HFXT296Ih8Jz3oABqNiUBv7eUYk="},{"name":"DriveModels.ts","hash":"1ADc5sSZM9wOqFdIUBqVOV6IG1Q="},{"name":"DriveQueries.ts","hash":"vRkx2CAlgr/+E/48OJhReREkGe8="},{"name":"DriveSettings.tsx","hash":"EwSXi7YGex/TCyEyZeW5j84N814="},{"name":"DriveSyncer.node.ts","hash":"Nsc2dRet5bbhV34COhnhIZkPFww="},{"name":"DriveSyncerWorker.node.ts","hash":"xd7s7CPXgupWOQ3PG+Or7BmUFVA="},{"name":"api.graph.node.ts","hash":"XUqEGm7wH4jRazQBYP8jELXk+FE="},{"name":"api.node.ts","hash":"4fqAhfHw+MAb+0fuAxN8+ZJMc5s="},{"name":"index.tsx","hash":"GO7WhFlFLpvwxutEnvYucGh9wXg="},{"name":"package.json","hash":"AbqFI7oM5cTG8iGsJxSHgtttCPo="},{"name":"tsconfig.json","hash":"hLLkLBQFhqm94AYEYuC5dbPBHN4="}],"hash":"oGOHAO3iUpNq9lvSo2ytj9DeARM="},"appPackage":{"name":"@o/drive-app","description":"Query, explore and sync the full Google Drive API. Supports reading documents across Sheets, Slides, Docs, etc.","version":"2.6.1","main":"index.tsx","config":{"orbitApp":true},"scripts":{"start":"orbit dev","build":"orbit build"},"dependencies":{"@o/kit":"^2.6.0","@o/ui":"^2.6.0","@o/worker-kit":"^2.6.0","gapi-to-graphql":"^2.0.5","lodash":"^4.17.11"}},"orbitConfig":2411174163} |
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
module.exports = factory(require("@o/kit/node"), require("@o/ui/node"), require("@o/worker-kit")); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
define(["@o/kit/node", "@o/ui/node", "@o/worker-kit"], factory); | ||
else if(typeof exports === 'object') | ||
exports["main"] = factory(); | ||
exports["test"] = factory(require("@o/kit/node"), require("@o/ui/node"), require("@o/worker-kit")); | ||
else | ||
root["main"] = factory(); | ||
})((typeof self !== 'undefined' ? self : this), function() { | ||
root["test"] = factory(root["@o/kit/node"], root["@o/ui/node"], root["@o/worker-kit"]); | ||
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__o_kit__, __WEBPACK_EXTERNAL_MODULE__o_ui__, __WEBPACK_EXTERNAL_MODULE__o_worker_kit__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
@@ -103,8 +103,9 @@ /******/ // The module cache | ||
\****************************/ | ||
/*! no static exports found */ | ||
/*! exports provided: DriveBitFactory */ | ||
/*! exports used: DriveBitFactory */ | ||
/***/ (function(module, exports) { | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DriveBitFactory; });\nclass DriveBitFactory {\n constructor(utils) {\n this.utils = utils;\n }\n /**\n * Creates person entity from a given Drive user.\n */\n\n\n createPersonBit(user) {\n return this.utils.createBit({\n type: 'person',\n originalId: user.emailAddress,\n title: user.displayName,\n email: user.emailAddress,\n photo: user.photoLink\n });\n }\n /**\n * Builds a document bit from the given google drive aggregated file.\n */\n\n\n createDocumentBit(file) {\n return this.utils.createBit({\n type: 'document',\n originalId: file.file.id,\n title: file.file.name,\n body: file.content || 'empty',\n data: {},\n webLink: file.file.webViewLink ? file.file.webViewLink : file.file.webContentLink,\n location: file.parent ? {\n id: file.parent.id,\n name: file.parent.name,\n webLink: file.file.webViewLink || file.parent.webContentLink,\n desktopLink: ''\n } : undefined,\n bitCreatedAt: new Date(file.file.createdTime).getTime(),\n bitUpdatedAt: new Date(file.file.modifiedTime).getTime() // image:\n // file.file.fileExtension && file.file.thumbnailLink\n // ? file.file.id + '.' + file.file.fileExtension\n // : undefined,\n\n });\n }\n\n}\n\n//# sourceURL=webpack://test/./DriveBitFactory.ts?"); | ||
/***/ }), | ||
@@ -116,8 +117,22 @@ | ||
\************************/ | ||
/*! no static exports found */ | ||
/*! exports provided: DriveLoader */ | ||
/*! exports used: DriveLoader */ | ||
/***/ (function(module, exports) { | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DriveLoader; });\n/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/kit */ \"@o/kit\");\n/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_kit__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _DriveQueries__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DriveQueries */ \"./DriveQueries.ts\");\n// import * as path from 'path'\n\n\n\n/**\n * Defines a loading throttling.\n * This is required to not overload user network with service queries.\n */\n\nvar THROTTLING = {\n /**\n * Delay before files load.\n */\n files: 100,\n\n /**\n * Delay before file content load.\n */\n fileContent: 100,\n\n /**\n * Delay before file comments load.\n */\n comments: 100,\n\n /**\n * Delay before file revisions load.\n */\n revisions: 100,\n\n /**\n * Delay before file thumbnail download.\n */\n thumbnailDownload: 100\n};\n/**\n * Loads data from google drive api.\n */\n\nclass DriveLoader {\n constructor(app, log, saveCallback) {\n this.app = void 0;\n this.log = void 0;\n this.loader = void 0;\n this.app = app;\n this.log = log || new _o_kit__WEBPACK_IMPORTED_MODULE_0__[\"Logger\"]('service:drive:loader:' + app.id);\n this.loader = new _o_kit__WEBPACK_IMPORTED_MODULE_0__[\"ServiceLoader\"](this.app, this.log, {\n saveCallback,\n baseUrl: 'https://content.googleapis.com/drive/v3',\n headers: {\n Authorization: \"Bearer \" + this.app.token,\n 'Access-Control-Allow-Origin': Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"getGlobalConfig\"])().urls.server,\n 'Access-Control-Allow-Methods': 'GET'\n }\n });\n }\n /**\n * Loads generation \"about\" information of current drive account.\n */\n\n\n async loadAbout() {\n return await this.loader.load(_DriveQueries__WEBPACK_IMPORTED_MODULE_2__[/* DriveQueries */ \"a\"].about());\n }\n /**\n * Loads google drive files.\n */\n\n\n async loadFiles(handler) {\n var _this = this;\n\n var loadRecursively = async cursor => {\n await Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"sleep\"])(THROTTLING.files);\n var {\n files,\n nextPageToken\n } = await this.loader.load(_DriveQueries__WEBPACK_IMPORTED_MODULE_2__[/* DriveQueries */ \"a\"].files(cursor));\n\n var _loop = async function _loop(i) {\n var file = files[i]; // try to find a file folder to create a Bit.location later on\n\n var parent = null;\n\n if (file.parents && file.parents.length) {\n parent = files.find(otherFile => otherFile.id === file.parents[0]);\n } // const thumbnailFilePath = await this.downloadThumbnail(file)\n\n\n var content = await _this.loadFileContent(file);\n var comments = await _this.loadComments(file);\n var revisions = await _this.loadRevisions(file);\n var users = [...file.owners, ...comments.map(comment => comment.author), ...revisions.map(revision => revision.lastModifyingUser)].filter(user => {\n // some users are not defined in where they come from. we skip such cases\n // some users don't have emails. we skip such cases\n // if author of the comment is current user we don't need to add him to users list\n return user && user.emailAddress && user.me === false;\n });\n var driveFile = {\n file,\n thumbnailFilePath: '',\n content,\n comments,\n revisions,\n users: Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"uniqBy\"])(users, user => user.emailAddress),\n // @ts-ignore\n parent\n };\n\n try {\n var _isLast = i === files.length - 1 && !!nextPageToken;\n\n var result = await handler(driveFile, nextPageToken, _isLast); // if callback returned true we don't continue syncing\n\n if (result === false) {\n _this.log.info('stopped issues syncing, no need to sync more', {\n file: driveFile,\n index: i\n });\n\n return {\n v: void 0\n }; // return from the function, not from the loop!\n }\n } catch (error) {\n _this.log.warning('error during file handling', driveFile, error);\n }\n };\n\n for (var i = 0; i < files.length; i++) {\n var _ret = await _loop(i);\n\n if (typeof _ret === \"object\") return _ret.v;\n }\n\n if (nextPageToken) {\n await loadRecursively(nextPageToken);\n }\n };\n\n this.log.timer('load files and people from API');\n await loadRecursively();\n this.log.timer('load files and people from API');\n }\n /**\n * Loads file's content.\n */\n\n\n async loadFileContent(file) {\n if (file.mimeType !== 'application/vnd.google-apps.document') return '';\n await Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"sleep\"])(THROTTLING.fileContent);\n this.log.verbose('loading file content for', file);\n var content = await this.loader.load(_DriveQueries__WEBPACK_IMPORTED_MODULE_2__[/* DriveQueries */ \"a\"].fileExport(file.id));\n this.log.verbose('content for file was loaded', {\n content\n });\n return content;\n }\n /**\n * Loads file comments.\n */\n\n\n async loadComments(file, pageToken) {\n // for some reason google gives fatal errors when comments for map items are requested, so we skip them\n if (file.mimeType === 'application/vnd.google-apps.map' || file.mimeType === 'application/vnd.google-apps.script') return [];\n await Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"sleep\"])(THROTTLING.comments);\n this.log.verbose('loading comments for', file);\n var result = await this.loader.load(_DriveQueries__WEBPACK_IMPORTED_MODULE_2__[/* DriveQueries */ \"a\"].fileComments(file.id, pageToken));\n\n if (result.nextPageToken) {\n var nextPageComments = await this.loadComments(file, result.nextPageToken);\n return [...result.comments, ...nextPageComments];\n }\n\n return result.comments;\n }\n /**\n * Loads file revisions.\n */\n\n\n async loadRevisions(file, pageToken) {\n // check if user have access to the revisions of this file\n if (!file.capabilities.canReadRevisions) return []; // for some reason google gives fatal errors when comments for map items are requested, so we skip them\n\n if (file.mimeType === 'application/vnd.google-apps.map' || file.mimeType === 'application/vnd.google-apps.script') return [];\n await Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"sleep\"])(THROTTLING.revisions);\n this.log.verbose('loading revisions for', file);\n var result = await this.loader.load(_DriveQueries__WEBPACK_IMPORTED_MODULE_2__[/* DriveQueries */ \"a\"].fileRevisions(file.id, pageToken));\n\n if (result.nextPageToken) {\n var nextPageRevisions = await this.loadRevisions(file, result.nextPageToken);\n return [...result.revisions, ...nextPageRevisions];\n }\n\n return result.revisions;\n }\n /**\n * Downloads file thumbnail.\n */\n // private async downloadThumbnail(file: DriveFile): Promise<string> {\n // if (!file.thumbnailLink) return ''\n // await sleep(THROTTLING.thumbnailDownload)\n // this.log.verbose('downloading file thumbnail for', file)\n // const destination = path.normalize(\n // __dirname + '/../../../../uploads/' + file.id + '.' + file.fileExtension,\n // )\n // await this.loader.downloadFile({\n // path: file.thumbnailLink,\n // destination,\n // })\n // this.log.verbose('thumbnail downloaded and saved as', destination)\n // }\n\n\n}\n\n//# sourceURL=webpack://test/./DriveLoader.ts?"); | ||
/***/ }), | ||
/***/ "./DriveQueries.ts": | ||
/*!*************************!*\ | ||
!*** ./DriveQueries.ts ***! | ||
\*************************/ | ||
/*! exports provided: DriveQueries */ | ||
/*! exports used: DriveQueries */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DriveQueries; });\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"@babel/runtime/helpers/extends\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n\nclass DriveQueries {\n /**\n * @see https://developers.google.com/drive/api/v3/reference/about/get\n */\n static about() {\n return {\n cors: true,\n path: '/about',\n query: {\n fields: ['user']\n }\n };\n }\n /**\n * @see https://developers.google.com/drive/api/v3/reference/files/list\n */\n\n\n static files(pageToken) {\n return {\n cors: true,\n path: '/files',\n query: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n orderBy: ['modifiedByMeTime desc', 'modifiedTime desc', 'sharedWithMeTime desc', 'viewedByMeTime desc']\n }, pageToken ? {\n pageToken: pageToken\n } : {}, {\n fields: ['kind', 'nextPageToken', 'files(' + ['id', 'name', 'mimeType', 'description', 'starred', 'trashed', 'parents', 'properties', 'spaces', 'version', 'webViewLink', 'webContentLink', 'iconLink', 'thumbnailLink', 'viewedByMe', 'viewedByMeTime', 'createdTime', 'modifiedTime', 'sharingUser', 'owners', 'shared', 'ownedByMe', 'folderColorRgb', 'originalFilename', 'fileExtension', 'size', 'capabilities', 'modifiedByMe', 'teamDriveId'].join(',') + ')']\n })\n };\n }\n /**\n * @see https://developers.google.com/drive/api/v3/reference/files/export\n */\n\n\n static fileExport(fileId) {\n return {\n plain: true,\n path: \"/files/\" + fileId + \"/export\",\n query: {\n mimeType: 'text/plain'\n }\n };\n }\n /**\n * @see https://developers.google.com/drive/api/v3/reference/comments/list\n */\n\n\n static fileComments(fileId, pageToken) {\n return {\n cors: true,\n path: \"/files/\" + fileId + \"/comments\",\n query: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n pageSize: 100\n }, pageToken ? {\n pageToken: pageToken\n } : {}, {\n fields: ['kind', 'nextPageToken', 'comments(' + ['id', 'createdTime', 'author', 'content'].join(',') + ')']\n })\n };\n }\n /**\n * @see https://developers.google.com/drive/api/v3/reference/revisions/list\n */\n\n\n static fileRevisions(fileId, pageToken) {\n return {\n cors: true,\n path: \"/files/\" + fileId + \"/revisions\",\n query: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n pageSize: 1000\n }, pageToken ? {\n pageToken: pageToken\n } : {}, {\n fields: ['kind', 'nextPageToken', 'revisions(' + ['kind', 'id', 'mimeType', 'modifiedTime', 'keepForever', 'published', 'publishAuto', 'publishedOutsideDomain', 'lastModifyingUser', 'originalFilename'].join(',') + ')']\n })\n };\n }\n\n}\n\n//# sourceURL=webpack://test/./DriveQueries.ts?"); | ||
/***/ }), | ||
@@ -129,8 +144,9 @@ | ||
\***************************/ | ||
/*! no static exports found */ | ||
/*! exports provided: DriveSettings */ | ||
/*! exports used: DriveSettings */ | ||
/***/ (function(module, exports) { | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DriveSettings; });\n/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/kit */ \"@o/kit\");\n/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_kit__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _o_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @o/ui */ \"@o/ui\");\n/* harmony import */ var _o_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_o_ui__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n\nclass DriveSettingsStore {\n constructor() {\n this.props = void 0;\n this.popularFolders = [];\n\n this.onSyncSetter = id => () => {\n console.log('should set', id);\n return false;\n };\n }\n\n async fetchFiles() {\n if (!this.service.fetch) return;\n var {\n files\n } = await this.service.fetch('/files', {\n query: {\n pageSize: 1000,\n q: 'mimeType=\"application/vnd.google-apps.folder\"',\n orderBy: ['sharedWithMeTime desc', 'viewedByMeTime desc', 'modifiedByMeTime desc', 'modifiedTime desc']\n }\n });\n this.popularFolders = files;\n }\n\n get service() {\n // todo: broken by umed please fix me\n // !TODO this should come from first class api for fetching from apps\n console.warn('todo: broken by umed please fix me');\n return {};\n }\n\n}\n\nfunction DriveSettings(_ref) {\n var {\n subId\n } = _ref;\n var [app] = Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"useModel\"])(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"AppModel\"], {\n where: {\n id: +subId\n }\n });\n var store = Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"useStore\"])(DriveSettingsStore, {\n app\n });\n var folders = store.popularFolders;\n return react__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_2__[\"Fragment\"], null, react__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"](_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"SettingManageRow\"], {\n app: app,\n whitelist: null\n }), react__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"](_o_ui__WEBPACK_IMPORTED_MODULE_1__[\"Table\"], {\n columns: {\n name: {\n value: 'Folder Name'\n },\n active: {\n value: 'Active'\n }\n },\n selectable: \"multi\",\n items: folders.map((file, index) => ({\n key: \"\" + index,\n name: file.name,\n active: false\n }))\n }));\n}\nDriveSettings.displayName = \"DriveSettings\";\n\n//# sourceURL=webpack://test/./DriveSettings.tsx?"); | ||
/***/ }), | ||
@@ -147,83 +163,4 @@ | ||
"use strict"; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DriveSyncer; }); | ||
/* harmony import */ var _DriveBitFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DriveBitFactory */ "./DriveBitFactory.ts"); | ||
/* harmony import */ var _DriveBitFactory__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_DriveBitFactory__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var _DriveLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DriveLoader */ "./DriveLoader.ts"); | ||
/* harmony import */ var _DriveLoader__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_DriveLoader__WEBPACK_IMPORTED_MODULE_1__); | ||
eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DriveSyncer; });\n/* harmony import */ var _DriveBitFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DriveBitFactory */ \"./DriveBitFactory.ts\");\n/* harmony import */ var _DriveLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DriveLoader */ \"./DriveLoader.ts\");\n\n\nvar DriveSyncer = async (_ref) => {\n var {\n app,\n log,\n utils\n } = _ref;\n var factory = new _DriveBitFactory__WEBPACK_IMPORTED_MODULE_0__[/* DriveBitFactory */ \"a\"](utils);\n var loader = new _DriveLoader__WEBPACK_IMPORTED_MODULE_1__[/* DriveLoader */ \"a\"](app, log, () => utils.updateAppData());\n var appData = app.data;\n if (!appData.values.lastSync) appData.values.lastSync = {};\n var lastSync = appData.values.lastSync; // load users from API\n\n await loader.loadFiles(async (file, cursor, isLast) => {\n await utils.isAborted();\n var updatedAt = new Date(file.file.modifiedByMeTime || file.file.modifiedTime).getTime(); // if we have synced stuff previously already, we need to prevent same files syncing\n // check if file's updated date is newer than our last synced date\n\n if (lastSync.lastSyncedDate && updatedAt <= lastSync.lastSyncedDate) {\n log.info('reached last synced date, stop syncing...', {\n file,\n updatedAt,\n lastSync\n }); // if its actually older we don't need to sync this file and all next ones (since they are sorted by updated date)\n\n if (lastSync.lastCursorSyncedDate) {\n // important check, because we can be in this block without loading by cursor\n lastSync.lastSyncedDate = lastSync.lastCursorSyncedDate;\n }\n\n lastSync.lastCursor = undefined;\n lastSync.lastCursorSyncedDate = undefined;\n await utils.updateAppData();\n return false; // this tells from the callback to stop file proceeding\n } // for the first ever synced file we store its updated date, and once sync is done,\n // next time we make sync again we don't want to sync files less then this date\n\n\n if (!lastSync.lastCursorSyncedDate) {\n lastSync.lastCursorSyncedDate = updatedAt;\n log.info('looks like its the first syncing file, set last synced date', lastSync);\n await utils.updateAppData();\n }\n\n var bit = factory.createDocumentBit(file);\n bit.people = file.users.map(user => factory.createPersonBit(user));\n await utils.saveBits(bit.people);\n await utils.saveBit(bit); // in the case if its the last issue we need to cleanup last cursor stuff and save last synced date\n\n if (isLast) {\n log.info('looks like its the last issue in this sync, removing last cursor and source last sync date', lastSync);\n lastSync.lastSyncedDate = lastSync.lastCursorSyncedDate;\n lastSync.lastCursor = undefined;\n lastSync.lastCursorSyncedDate = undefined;\n await utils.updateAppData();\n return true;\n } // update last sync settings to make sure we continue from the last point in the case if application will stop\n\n\n if (lastSync.lastCursor !== cursor) {\n log.verbose('updating last cursor in settings', {\n cursor\n });\n lastSync.lastCursor = cursor;\n await utils.updateAppData();\n }\n\n return true;\n });\n};\n\n//# sourceURL=webpack://test/./DriveSyncer.node.ts?"); | ||
/** | ||
* Syncs Google Drive files. | ||
*/ | ||
const DriveSyncer = async (_ref) => { | ||
let { | ||
app, | ||
log, | ||
utils | ||
} = _ref; | ||
const factory = new _DriveBitFactory__WEBPACK_IMPORTED_MODULE_0__["DriveBitFactory"](utils); | ||
const loader = new _DriveLoader__WEBPACK_IMPORTED_MODULE_1__["DriveLoader"](app, log, () => utils.updateAppData()); | ||
const appData = app.data; | ||
if (!appData.values.lastSync) appData.values.lastSync = {}; | ||
const lastSync = appData.values.lastSync; // load users from API | ||
await loader.loadFiles(async (file, cursor, isLast) => { | ||
await utils.isAborted(); | ||
const updatedAt = new Date(file.file.modifiedByMeTime || file.file.modifiedTime).getTime(); // if we have synced stuff previously already, we need to prevent same files syncing | ||
// check if file's updated date is newer than our last synced date | ||
if (lastSync.lastSyncedDate && updatedAt <= lastSync.lastSyncedDate) { | ||
log.info('reached last synced date, stop syncing...', { | ||
file, | ||
updatedAt, | ||
lastSync | ||
}); // if its actually older we don't need to sync this file and all next ones (since they are sorted by updated date) | ||
if (lastSync.lastCursorSyncedDate) { | ||
// important check, because we can be in this block without loading by cursor | ||
lastSync.lastSyncedDate = lastSync.lastCursorSyncedDate; | ||
} | ||
lastSync.lastCursor = undefined; | ||
lastSync.lastCursorSyncedDate = undefined; | ||
await utils.updateAppData(); | ||
return false; // this tells from the callback to stop file proceeding | ||
} // for the first ever synced file we store its updated date, and once sync is done, | ||
// next time we make sync again we don't want to sync files less then this date | ||
if (!lastSync.lastCursorSyncedDate) { | ||
lastSync.lastCursorSyncedDate = updatedAt; | ||
log.info('looks like its the first syncing file, set last synced date', lastSync); | ||
await utils.updateAppData(); | ||
} | ||
const bit = factory.createDocumentBit(file); | ||
bit.people = file.users.map(user => factory.createPersonBit(user)); | ||
await utils.saveBits(bit.people); | ||
await utils.saveBit(bit); // in the case if its the last issue we need to cleanup last cursor stuff and save last synced date | ||
if (isLast) { | ||
log.info('looks like its the last issue in this sync, removing last cursor and source last sync date', lastSync); | ||
lastSync.lastSyncedDate = lastSync.lastCursorSyncedDate; | ||
lastSync.lastCursor = undefined; | ||
lastSync.lastCursorSyncedDate = undefined; | ||
await utils.updateAppData(); | ||
return true; | ||
} // update last sync settings to make sure we continue from the last point in the case if application will stop | ||
if (lastSync.lastCursor !== cursor) { | ||
log.verbose('updating last cursor in settings', { | ||
cursor | ||
}); | ||
lastSync.lastCursor = cursor; | ||
await utils.updateAppData(); | ||
} | ||
return true; | ||
}); | ||
}; | ||
/***/ }), | ||
@@ -240,20 +177,4 @@ | ||
"use strict"; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DriverSyncerWorker; }); | ||
/* harmony import */ var _o_worker_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/worker-kit */ "@o/worker-kit"); | ||
/* harmony import */ var _o_worker_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_worker_kit__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var _DriveSyncer_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DriveSyncer.node */ "./DriveSyncer.node.ts"); | ||
eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DriverSyncerWorker; });\n/* harmony import */ var _o_worker_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/worker-kit */ \"@o/worker-kit\");\n/* harmony import */ var _o_worker_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_worker_kit__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _DriveSyncer_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DriveSyncer.node */ \"./DriveSyncer.node.ts\");\n\n\nvar DriverSyncerWorker = async () => {\n var syncer = new _o_worker_kit__WEBPACK_IMPORTED_MODULE_0__[\"Syncer\"]({\n id: 'drive',\n appIdentifier: 'drive',\n name: 'Drive',\n runner: _DriveSyncer_node__WEBPACK_IMPORTED_MODULE_1__[/* DriveSyncer */ \"a\"],\n interval: 1000 * 60 * 5 // 5 minutes\n\n });\n await syncer.start();\n};\n\n//# sourceURL=webpack://test/./DriveSyncerWorker.node.ts?"); | ||
const DriverSyncerWorker = async () => { | ||
const syncer = new _o_worker_kit__WEBPACK_IMPORTED_MODULE_0__["Syncer"]({ | ||
id: 'drive', | ||
appIdentifier: 'drive', | ||
name: 'Drive', | ||
runner: _DriveSyncer_node__WEBPACK_IMPORTED_MODULE_1__[/* DriveSyncer */ "a"], | ||
interval: 1000 * 60 * 5 // 5 minutes | ||
}); | ||
await syncer.start(); | ||
}; | ||
/***/ }), | ||
@@ -270,15 +191,4 @@ | ||
"use strict"; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return graph; }); | ||
/* harmony import */ var gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gapi-to-graphql */ "gapi-to-graphql"); | ||
/* harmony import */ var gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gapi-to-graphql/google_apis/drive-v3 */ "gapi-to-graphql/google_apis/drive-v3"); | ||
/* harmony import */ var gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1__); | ||
eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return graph; });\n/* harmony import */ var gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gapi-to-graphql */ \"gapi-to-graphql\");\n/* harmony import */ var gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gapi-to-graphql/google_apis/drive-v3 */ \"gapi-to-graphql/google_apis/drive-v3\");\n/* harmony import */ var gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1__);\n\n\nasync function graph() {\n return gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0___default()({\n gapiAsJsonSchema: gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1___default.a\n });\n}\n\n//# sourceURL=webpack://test/./api.graph.node.ts?"); | ||
async function graph() { | ||
return gapi_to_graphql__WEBPACK_IMPORTED_MODULE_0___default()({ | ||
gapiAsJsonSchema: gapi_to_graphql_google_apis_drive_v3__WEBPACK_IMPORTED_MODULE_1___default.a | ||
}); | ||
} | ||
/***/ }), | ||
@@ -295,171 +205,4 @@ | ||
"use strict"; | ||
/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/kit */ "@o/kit"); | ||
/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_kit__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var googleapis__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googleapis */ "googleapis"); | ||
/* harmony import */ var googleapis__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googleapis__WEBPACK_IMPORTED_MODULE_1__); | ||
eval("/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/kit */ \"@o/kit\");\n/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_kit__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var googleapis__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googleapis */ \"googleapis\");\n/* harmony import */ var googleapis__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googleapis__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar Config = Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"getGlobalConfig\"])();\n/* harmony default export */ __webpack_exports__[\"a\"] = (app => {\n var oauth2Client = new googleapis__WEBPACK_IMPORTED_MODULE_1__[\"google\"].auth.OAuth2('97251911865-qm0isevf5m3omuice4eg3s4uq9i99gcn.apps.googleusercontent.com', 'LLXP2Vq36socQtgXy_XQqLOW', Config.urls.auth + '/auth/drive/callback');\n oauth2Client.setCredentials({\n access_token: app.token,\n refresh_token: app.data.values.oauth.refreshToken\n });\n var gdrive = googleapis__WEBPACK_IMPORTED_MODULE_1__[\"google\"].drive({\n version: 'v3',\n auth: oauth2Client\n });\n return {\n about(params, options) {\n return gdrive.about.get(params, options);\n },\n\n getChangesStartPageToken(params, options) {\n return gdrive.changes.getStartPageToken(params, options);\n },\n\n listChanges(params, options) {\n return gdrive.changes.list(params, options);\n },\n\n createComment(params, options) {\n return gdrive.comments.create(params, options);\n },\n\n deleteComment(params, options) {\n return gdrive.comments.delete(params, options);\n },\n\n getComment(params, options) {\n return gdrive.comments.get(params, options);\n },\n\n listComments(params, options) {\n return gdrive.comments.list(params, options);\n },\n\n updateComment(params, options) {\n return gdrive.comments.update(params, options);\n },\n\n copyFile(params, options) {\n return gdrive.files.copy(params, options);\n },\n\n createFile(params, options) {\n return gdrive.files.create(params, options);\n },\n\n deleteFile(params, options) {\n return gdrive.files.delete(params, options);\n },\n\n emptyTrash(params, options) {\n return gdrive.files.emptyTrash(params, options);\n },\n\n exportFile(params, options) {\n return gdrive.files.export(params, options);\n },\n\n fileGenerateIds(params, options) {\n return gdrive.files.generateIds(params, options);\n },\n\n getFile(params, options) {\n return gdrive.files.get(params, options);\n },\n\n listFiles(params, options) {\n return gdrive.files.list(params, options);\n },\n\n updateFile(params, options) {\n return gdrive.files.update(params, options);\n },\n\n watchFile(params, options) {\n return gdrive.files.watch(params, options);\n },\n\n createPermission(params, options) {\n return gdrive.permissions.create(params, options);\n },\n\n deletePermission(params, options) {\n return gdrive.permissions.delete(params, options);\n },\n\n getPermission(params, options) {\n return gdrive.permissions.get(params, options);\n },\n\n listPermissions(params, options) {\n return gdrive.permissions.list(params, options);\n },\n\n updatePermission(params, options) {\n return gdrive.permissions.update(params, options);\n },\n\n createReply(params, options) {\n return gdrive.replies.create(params, options);\n },\n\n deleteReply(params, options) {\n return gdrive.replies.delete(params, options);\n },\n\n getReply(params, options) {\n return gdrive.replies.get(params, options);\n },\n\n listReplies(params, options) {\n return gdrive.replies.list(params, options);\n },\n\n updateReply(params, options) {\n return gdrive.replies.update(params, options);\n },\n\n deleteRevision(params, options) {\n return gdrive.revisions.delete(params, options);\n },\n\n getRevision(params, options) {\n return gdrive.revisions.get(params, options);\n },\n\n listRevisions(params, options) {\n return gdrive.revisions.list(params, options);\n },\n\n updateRevision(params, options) {\n return gdrive.revisions.update(params, options);\n },\n\n createTeamdrive(params, options) {\n return gdrive.teamdrives.create(params, options);\n },\n\n deleteTeamdrive(params, options) {\n return gdrive.teamdrives.delete(params, options);\n },\n\n getTeamdrive(params, options) {\n return gdrive.teamdrives.get(params, options);\n },\n\n listTeamdrives(params, options) {\n return gdrive.teamdrives.list(params, options);\n },\n\n updateTeamdrive(params, options) {\n return gdrive.teamdrives.update(params, options);\n }\n\n };\n});\n\n//# sourceURL=webpack://test/./api.node.ts?"); | ||
const Config = Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__["getGlobalConfig"])(); | ||
/* harmony default export */ __webpack_exports__["a"] = (app => { | ||
const oauth2Client = new googleapis__WEBPACK_IMPORTED_MODULE_1__["google"].auth.OAuth2('97251911865-qm0isevf5m3omuice4eg3s4uq9i99gcn.apps.googleusercontent.com', 'LLXP2Vq36socQtgXy_XQqLOW', Config.urls.auth + '/auth/drive/callback'); | ||
oauth2Client.setCredentials({ | ||
access_token: app.token, | ||
refresh_token: app.data.values.oauth.refreshToken | ||
}); | ||
const gdrive = googleapis__WEBPACK_IMPORTED_MODULE_1__["google"].drive({ | ||
version: 'v3', | ||
auth: oauth2Client | ||
}); | ||
return { | ||
about(params, options) { | ||
return gdrive.about.get(params, options); | ||
}, | ||
getChangesStartPageToken(params, options) { | ||
return gdrive.changes.getStartPageToken(params, options); | ||
}, | ||
listChanges(params, options) { | ||
return gdrive.changes.list(params, options); | ||
}, | ||
createComment(params, options) { | ||
return gdrive.comments.create(params, options); | ||
}, | ||
deleteComment(params, options) { | ||
return gdrive.comments.delete(params, options); | ||
}, | ||
getComment(params, options) { | ||
return gdrive.comments.get(params, options); | ||
}, | ||
listComments(params, options) { | ||
return gdrive.comments.list(params, options); | ||
}, | ||
updateComment(params, options) { | ||
return gdrive.comments.update(params, options); | ||
}, | ||
copyFile(params, options) { | ||
return gdrive.files.copy(params, options); | ||
}, | ||
createFile(params, options) { | ||
return gdrive.files.create(params, options); | ||
}, | ||
deleteFile(params, options) { | ||
return gdrive.files.delete(params, options); | ||
}, | ||
emptyTrash(params, options) { | ||
return gdrive.files.emptyTrash(params, options); | ||
}, | ||
exportFile(params, options) { | ||
return gdrive.files.export(params, options); | ||
}, | ||
fileGenerateIds(params, options) { | ||
return gdrive.files.generateIds(params, options); | ||
}, | ||
getFile(params, options) { | ||
return gdrive.files.get(params, options); | ||
}, | ||
listFiles(params, options) { | ||
return gdrive.files.list(params, options); | ||
}, | ||
updateFile(params, options) { | ||
return gdrive.files.update(params, options); | ||
}, | ||
watchFile(params, options) { | ||
return gdrive.files.watch(params, options); | ||
}, | ||
createPermission(params, options) { | ||
return gdrive.permissions.create(params, options); | ||
}, | ||
deletePermission(params, options) { | ||
return gdrive.permissions.delete(params, options); | ||
}, | ||
getPermission(params, options) { | ||
return gdrive.permissions.get(params, options); | ||
}, | ||
listPermissions(params, options) { | ||
return gdrive.permissions.list(params, options); | ||
}, | ||
updatePermission(params, options) { | ||
return gdrive.permissions.update(params, options); | ||
}, | ||
createReply(params, options) { | ||
return gdrive.replies.create(params, options); | ||
}, | ||
deleteReply(params, options) { | ||
return gdrive.replies.delete(params, options); | ||
}, | ||
getReply(params, options) { | ||
return gdrive.replies.get(params, options); | ||
}, | ||
listReplies(params, options) { | ||
return gdrive.replies.list(params, options); | ||
}, | ||
updateReply(params, options) { | ||
return gdrive.replies.update(params, options); | ||
}, | ||
deleteRevision(params, options) { | ||
return gdrive.revisions.delete(params, options); | ||
}, | ||
getRevision(params, options) { | ||
return gdrive.revisions.get(params, options); | ||
}, | ||
listRevisions(params, options) { | ||
return gdrive.revisions.list(params, options); | ||
}, | ||
updateRevision(params, options) { | ||
return gdrive.revisions.update(params, options); | ||
}, | ||
createTeamdrive(params, options) { | ||
return gdrive.teamdrives.create(params, options); | ||
}, | ||
deleteTeamdrive(params, options) { | ||
return gdrive.teamdrives.delete(params, options); | ||
}, | ||
getTeamdrive(params, options) { | ||
return gdrive.teamdrives.get(params, options); | ||
}, | ||
listTeamdrives(params, options) { | ||
return gdrive.teamdrives.list(params, options); | ||
}, | ||
updateTeamdrive(params, options) { | ||
return gdrive.teamdrives.update(params, options); | ||
} | ||
}; | ||
}); | ||
/***/ }), | ||
@@ -476,38 +219,4 @@ | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/kit */ "@o/kit"); | ||
/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_kit__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var _api_graph_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./api.graph.node */ "./api.graph.node.ts"); | ||
/* harmony import */ var _api_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api.node */ "./api.node.ts"); | ||
/* harmony import */ var _DriveLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DriveLoader */ "./DriveLoader.ts"); | ||
/* harmony import */ var _DriveLoader__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_DriveLoader__WEBPACK_IMPORTED_MODULE_3__); | ||
/* harmony import */ var _DriveSettings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DriveSettings */ "./DriveSettings.tsx"); | ||
/* harmony import */ var _DriveSettings__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_DriveSettings__WEBPACK_IMPORTED_MODULE_4__); | ||
/* harmony import */ var _DriveSyncerWorker_node__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DriveSyncerWorker.node */ "./DriveSyncerWorker.node.ts"); | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @o/kit */ \"@o/kit\");\n/* harmony import */ var _o_kit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_o_kit__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _api_graph_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./api.graph.node */ \"./api.graph.node.ts\");\n/* harmony import */ var _api_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api.node */ \"./api.node.ts\");\n/* harmony import */ var _DriveLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DriveLoader */ \"./DriveLoader.ts\");\n/* harmony import */ var _DriveSettings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DriveSettings */ \"./DriveSettings.tsx\");\n/* harmony import */ var _DriveSyncerWorker_node__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DriveSyncerWorker.node */ \"./DriveSyncerWorker.node.ts\");\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__[\"createApp\"])({\n id: 'drive',\n name: 'Drive',\n auth: 'drive',\n finishAuth: async (app, _values, oauth) => {\n var loader = new _DriveLoader__WEBPACK_IMPORTED_MODULE_3__[/* DriveLoader */ \"a\"](app);\n var about = await loader.loadAbout();\n app.name = about.user.emailAddress;\n app.data.values.oauth.secret = oauth.credentials.clientSecret;\n app.data.values.oauth.clientId = oauth.credentials.clientID;\n return app;\n },\n itemType: 'task',\n settings: _DriveSettings__WEBPACK_IMPORTED_MODULE_4__[/* DriveSettings */ \"a\"],\n workers: [_DriveSyncerWorker_node__WEBPACK_IMPORTED_MODULE_5__[/* DriverSyncerWorker */ \"a\"]],\n api: _api_node__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"],\n graph: _api_graph_node__WEBPACK_IMPORTED_MODULE_1__[/* graph */ \"a\"],\n icon: \"\\n <svg version=\\\"1.1\\\" id=\\\"Layer_1\\\" x=\\\"0px\\\" y=\\\"0px\\\" viewBox=\\\"0 0 512 512\\\">\\n <polygon style=\\\"fill:#28B446;\\\" points=\\\"165.891,334.343 161.611,419.266 82.713,479.21 0,333.399 172.602,32.79 253.414,88.26\\n 256.078,178.175 255.315,178.614 \\\"/>\\n <polygon style=\\\"fill:#219B38;\\\" points=\\\"172.602,32.79 221.718,237.124 256.078,178.175 253.414,59.814 \\\"/>\\n <polygon style=\\\"fill:#FFD837;\\\" points=\\\"339.385,32.79 512,333.399 418.917,380.477 345.204,333.851 345.204,333.399\\n 256.078,178.175 172.602,32.79 \\\"/>\\n <polygon style=\\\"fill:#518EF8;\\\" points=\\\"512,333.399 429.339,478.266 82.713,479.21 165.891,334.343 345.204,333.851 \\\"/>\\n <polygon style=\\\"fill:#3A5BBC;\\\" points=\\\"82.713,479.21 227.749,334.173 165.891,334.343 \\\"/>\\n <polygon style=\\\"fill:#FBBB00;\\\" points=\\\"512,333.399 322.76,294.31 345.204,333.851 \\\"/>\\n </svg>\\n \"\n}));\n\n//# sourceURL=webpack://test/./index.tsx?"); | ||
/* harmony default export */ __webpack_exports__["default"] = (Object(_o_kit__WEBPACK_IMPORTED_MODULE_0__["createApp"])({ | ||
id: 'drive', | ||
name: 'Drive', | ||
auth: 'drive', | ||
finishAuth: async (app, _values, oauth) => { | ||
const loader = new _DriveLoader__WEBPACK_IMPORTED_MODULE_3__["DriveLoader"](app); | ||
const about = await loader.loadAbout(); | ||
app.name = about.user.emailAddress; | ||
app.data.values.oauth.secret = oauth.credentials.clientSecret; | ||
app.data.values.oauth.clientId = oauth.credentials.clientID; | ||
return app; | ||
}, | ||
itemType: 'task', | ||
settings: _DriveSettings__WEBPACK_IMPORTED_MODULE_4__["DriveSettings"], | ||
workers: [_DriveSyncerWorker_node__WEBPACK_IMPORTED_MODULE_5__[/* DriverSyncerWorker */ "a"]], | ||
api: _api_node__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], | ||
graph: _api_graph_node__WEBPACK_IMPORTED_MODULE_1__[/* graph */ "a"], | ||
icon: "\n <svg version=\"1.1\" id=\"Layer_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 512 512\">\n <polygon style=\"fill:#28B446;\" points=\"165.891,334.343 161.611,419.266 82.713,479.21 0,333.399 172.602,32.79 253.414,88.26\n 256.078,178.175 255.315,178.614 \"/>\n <polygon style=\"fill:#219B38;\" points=\"172.602,32.79 221.718,237.124 256.078,178.175 253.414,59.814 \"/>\n <polygon style=\"fill:#FFD837;\" points=\"339.385,32.79 512,333.399 418.917,380.477 345.204,333.851 345.204,333.399\n 256.078,178.175 172.602,32.79 \"/>\n <polygon style=\"fill:#518EF8;\" points=\"512,333.399 429.339,478.266 82.713,479.21 165.891,334.343 345.204,333.851 \"/>\n <polygon style=\"fill:#3A5BBC;\" points=\"82.713,479.21 227.749,334.173 165.891,334.343 \"/>\n <polygon style=\"fill:#FBBB00;\" points=\"512,333.399 322.76,294.31 345.204,333.851 \"/>\n </svg>\n " | ||
})); | ||
/***/ }), | ||
@@ -523,19 +232,42 @@ | ||
module.exports = __webpack_require__(/*! /Users/nw/projects/motion/orbit/apps/drive-app/index.tsx */"./index.tsx"); | ||
eval("module.exports = __webpack_require__(/*! /Users/nw/projects/motion/orbit/apps/drive-app/index.tsx */\"./index.tsx\");\n\n\n//# sourceURL=webpack://test/multi_./index.tsx?"); | ||
/***/ }), | ||
/***/ "@babel/runtime/helpers/extends": | ||
/*!*************************************************!*\ | ||
!*** external "@babel/runtime/helpers/extends" ***! | ||
\*************************************************/ | ||
/*! no static exports found */ | ||
/*! exports used: default */ | ||
/***/ (function(module, exports) { | ||
eval("module.exports = require(\"@babel/runtime/helpers/extends\");\n\n//# sourceURL=webpack://test/external_%22@babel/runtime/helpers/extends%22?"); | ||
/***/ }), | ||
/***/ "@o/kit": | ||
/*!*************************!*\ | ||
!*** external "@o/kit" ***! | ||
\*************************/ | ||
/*!******************************!*\ | ||
!*** external "@o/kit/node" ***! | ||
\******************************/ | ||
/*! no static exports found */ | ||
/*! exports used: createApp, getGlobalConfig */ | ||
/*! exports used: AppModel, Logger, ServiceLoader, SettingManageRow, createApp, getGlobalConfig, sleep, useModel, useStore */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("@o/kit"); | ||
eval("module.exports = __WEBPACK_EXTERNAL_MODULE__o_kit__;\n\n//# sourceURL=webpack://test/external_%22@o/kit/node%22?"); | ||
/***/ }), | ||
/***/ "@o/ui": | ||
/*!*****************************!*\ | ||
!*** external "@o/ui/node" ***! | ||
\*****************************/ | ||
/*! no static exports found */ | ||
/*! exports used: Table */ | ||
/***/ (function(module, exports) { | ||
eval("module.exports = __WEBPACK_EXTERNAL_MODULE__o_ui__;\n\n//# sourceURL=webpack://test/external_%22@o/ui/node%22?"); | ||
/***/ }), | ||
/***/ "@o/worker-kit": | ||
@@ -549,3 +281,3 @@ /*!********************************!*\ | ||
module.exports = require("@o/worker-kit"); | ||
eval("module.exports = __WEBPACK_EXTERNAL_MODULE__o_worker_kit__;\n\n//# sourceURL=webpack://test/external_%22@o/worker-kit%22?"); | ||
@@ -562,3 +294,3 @@ /***/ }), | ||
module.exports = require("gapi-to-graphql"); | ||
eval("module.exports = require(\"gapi-to-graphql\");\n\n//# sourceURL=webpack://test/external_%22gapi-to-graphql%22?"); | ||
@@ -575,3 +307,3 @@ /***/ }), | ||
module.exports = require("gapi-to-graphql/google_apis/drive-v3"); | ||
eval("module.exports = require(\"gapi-to-graphql/google_apis/drive-v3\");\n\n//# sourceURL=webpack://test/external_%22gapi-to-graphql/google_apis/drive-v3%22?"); | ||
@@ -588,8 +320,31 @@ /***/ }), | ||
module.exports = require("googleapis"); | ||
eval("module.exports = require(\"googleapis\");\n\n//# sourceURL=webpack://test/external_%22googleapis%22?"); | ||
/***/ }), | ||
/***/ "lodash": | ||
/*!*************************!*\ | ||
!*** external "lodash" ***! | ||
\*************************/ | ||
/*! no static exports found */ | ||
/*! exports used: uniqBy */ | ||
/***/ (function(module, exports) { | ||
eval("module.exports = require(\"lodash\");\n\n//# sourceURL=webpack://test/external_%22lodash%22?"); | ||
/***/ }), | ||
/***/ "react": | ||
/*!************************!*\ | ||
!*** external "react" ***! | ||
\************************/ | ||
/*! no static exports found */ | ||
/*! exports used: Fragment, createElement */ | ||
/***/ (function(module, exports) { | ||
eval("module.exports = require(\"react\");\n\n//# sourceURL=webpack://test/external_%22react%22?"); | ||
/***/ }) | ||
/******/ }); | ||
}); | ||
//# sourceMappingURL=index.node.js.map | ||
}); |
{ | ||
"name": "@o/drive-app", | ||
"description": "Query, explore and sync the full Google Drive API. Supports reading documents across Sheets, Slides, Docs, etc.", | ||
"version": "2.6.1", | ||
"version": "2.7.0", | ||
"main": "index.tsx", | ||
@@ -14,8 +14,9 @@ "config": { | ||
"dependencies": { | ||
"@o/kit": "^2.6.0", | ||
"@o/ui": "^2.6.0", | ||
"@o/worker-kit": "^2.6.0", | ||
"@o/kit": "^2.7.0", | ||
"@o/ui": "^2.7.0", | ||
"@o/worker-kit": "^2.7.0", | ||
"gapi-to-graphql": "^2.0.5", | ||
"lodash": "^4.17.11" | ||
} | ||
}, | ||
"gitHead": "cedfe08ce0ef7045a44fda403a3fad4b859dec72" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
87754
16
2030
9
20
+ Addedcss-in-js-utils@3.1.0(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addederror-stack-parser@2.1.4(transitive)
+ Addedflatted@3.3.2(transitive)
+ Addedmdn-data@2.0.14(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedsource-map@0.5.6(transitive)
+ Addedstack-generator@2.0.10(transitive)
+ Addedstacktrace-gps@3.1.2(transitive)
Updated@o/kit@^2.7.0
Updated@o/ui@^2.7.0
Updated@o/worker-kit@^2.7.0