Skip to content

Commit

Permalink
tested against googleapis@36.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPaulBrewer committed Dec 8, 2018
1 parent 4df8221 commit e53e96e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Initialize googleapi's Google Drive[tm] nodejs client, decorated with some useful 3rd party extensions.

## new in v4.3.1
* tested against googleapis@36.0.0

## new in v4.3
* the `drive.x.hexid()` formula was changed. The new `crypto.createHmac` formula is more secure, and effectively case insensitive
as `.toLowerCase().trim()` is called on email strings before processing. But it does yield different hex values than v4.2.
Expand All @@ -25,11 +28,11 @@ as `.toLowerCase().trim()` is called on email strings before processing. But it

### Install

Pre-requisites are `googleapis@30.0.0` and `request`
Pre-requisites are `googleapis@36.0.0` and `request`

**Note:** To use older googleapi versions, such as `googleapis@24.0.0` try `decorated-google-drive@3`

npm i googleapis@30.0.0 -S
npm i googleapis@36.0.0 -S
npm i request -S
npm i decorated-google-drive -S

Expand All @@ -40,7 +43,7 @@ Pass the googleapis and request modules, and your keys and tokens. The `keys` ar
The `tokens` are obtained when a user "Logs in with Google" in your app. There is various middleware for "Log in with Google", such as
`passport` for `express`, `grant` and `bell` for `hapi`, and even a client-Javascript side library you can get from Google.

const {google} = require('googleapis'); // works with googleapis-30.0.0
const {google} = require('googleapis'); // works with googleapis-36.0.0
const request = require('request'); // worked with request-2.83.0
const driveX = require('decorated-google-drive');
const salt = "100% Organic Sea Salt, or some other string for salting the email addresses when making hexids";
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"homepage": "https://github.com/DrPaulBrewer/decorated-google-drive#readme",
"devDependencies": {
"assert": "^1.4.1",
"eslint": "^4.19.1",
"googleapis": "^30.0.0",
"eslint": "^5.9.0",
"googleapis": "^36.0.0",
"mocha": "^5.1.1",
"request": "^2.83.0",
"should": "^13.2.1",
"string-to-stream": "^1.1.0"
"request": "^2.88.0",
"should": "^13.2.3",
"string-to-stream": "^1.1.1"
},
"dependencies": {
"boom": "^7.1.1",
"boom": "^7.3.0",
"digest-stream": "^2.0.0",
"p-reduce": "^1.0.0",
"search-string-for-google-drive": "^1.0.0"
Expand Down
48 changes: 24 additions & 24 deletions testResults.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@
✓ drive should not be undefined
✓ drive.x should be an object
drive.x.aboutMe
✓ should return the test users email address (410ms)
✓ should return a storageQuota object with properties limit, usage (205ms)
✓ drive.about.get still works, as well, and the outputs match (192ms)
✓ should return the test users email address (438ms)
✓ should return a storageQuota object with properties limit, usage (189ms)
✓ drive.about.get still works, as well, and the outputs match (175ms)
drive.x.hexid
✓ should return a 64 char hex id (372ms)
✓ should consistently return the same 64 char hex when called 3 times (209ms)
✓ should return a 64 char hex id (175ms)
✓ should consistently return the same 64 char hex when called 3 times (194ms)
drive.x.appDataFolder.upload2: upload a string to appDataFolder
✓ uploading the string to appDataFolder file myaccount should resolve with expected file metadata
✓ drive.x.appDataFolder.searcher should report there is exactly one myaccount file in the folder and it should match upload file id
✓ drive.x.appDataFolder.contents should resolve to contents Hello-World-Test-1-2-3
drive.x.upload2: upload a file README.md to Drive folder /path/to/test/Files
✓ uploading the README.md file to /path/to/test/Files/README.md should resolve with expected file metadata
✓ the parents[0] folder should have the name 'Files' (198ms)
✓ searching the parents[0] folder for README.md find a file with matching id (231ms)
✓ the parents[0] folder should have the name 'Files' (194ms)
✓ searching the parents[0] folder for README.md find a file with matching id (268ms)
after drive.x.upload2
✓ searching root for anything should yield folder 'path' with .isFolder===true (227ms)
✓ searching root for folders should yield folder 'path' with .isFolder===true (220ms)
✓ searching root for non-folders should be empty (203ms)
✓ searching all folders for any non-trashed file should be non-empty and include file README.md in results (244ms)
✓ searching all folders or a file with appProperties: { 'role': 'documentation' } should be empty (192ms)
✓ checking existence of /path/to/test/Files/README.md with drive.x.findPath should yield expected file metadata (1277ms)
✓ checking existence of /path/to/test should yield expected folder metadata (1401ms)
✓ checking existence on wrong path should throw Boom.notfound (215ms)
✓ downloading content with drive.x.download should yield contents string including 'License: MIT' (1416ms)
✓ updating README.md appProperties to {'role': 'documentation'} should succeed (2471ms)
✓ searching all folders or a file with appProperties: { 'role': 'documentation' } should find README.md (262ms)
✓ drive.x.upload2 uploading the file again with {clobber:false} will throw Boom.conflict error because file already exists (1188ms)
✓ searching root for anything should yield folder 'path' with .isFolder===true (249ms)
✓ searching root for folders should yield folder 'path' with .isFolder===true (232ms)
✓ searching root for non-folders should be empty (202ms)
✓ searching all folders for any non-trashed file should be non-empty and include file README.md in results (278ms)
✓ searching all folders or a file with appProperties: { 'role': 'documentation' } should be empty (244ms)
✓ checking existence of /path/to/test/Files/README.md with drive.x.findPath should yield expected file metadata (1253ms)
✓ checking existence of /path/to/test should yield expected folder metadata (709ms)
✓ checking existence on wrong path should throw Boom.notfound (231ms)
✓ downloading content with drive.x.download should yield contents string including 'License: MIT' (1420ms)
✓ updating README.md appProperties to {'role': 'documentation'} should succeed (1800ms)
✓ searching all folders or a file with appProperties: { 'role': 'documentation' } should find README.md (201ms)
✓ drive.x.upload2 uploading the file again with {clobber:false} will throw Boom.conflict error because file already exists (1244ms)
drive.x.upload2: upload test/test.zip to Drive folder /path/to/test/Files
✓ uploading the test.zip file to /path/to/test/Files/test.zip should resolve with expected file metadata and md5 match
create folder /path/to/test2
Expand All @@ -46,12 +46,12 @@
use folderId of /path/to/test2 to upload test.zip
✓ uploading the test.zip file to /path/to/test2/test.zip should resolve with expected file metadata and md5 match
cleanup via drive.x.janitor
✓ janitor hopefully deletes the README.md file(s) OK and resolves correctly (1482ms)
✓ drive.x.findPath will throw Boom.notFound if the file was successfully deleted (1178ms)
✓ janitor will throw an error if told to delete an invalid file (157ms)
✓ janitor hopefully deletes the README.md file(s) OK and resolves correctly (1659ms)
✓ drive.x.findPath will throw Boom.notFound if the file was successfully deleted (1340ms)
✓ janitor will throw an error if told to delete an invalid file (155ms)
✓ janitor should not throw an error if given an empty filelist
✓ final cleanup: delete the path folder and check non-existence (1202ms)
✓ final cleanup: delete the path folder and check non-existence (1276ms)


40 passing (26s)
40 passing (28s)

0 comments on commit e53e96e

Please sign in to comment.