GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — storage: support resumable uploads by stephenplusplus · Pull Request #299 · googleapis/google-cloud-node

Conversation

@stephenplusplus

@stephenplusplus stephenplusplus commented Nov 11, 2014

Copy link
Copy Markdown
Contributor
  • Allow a choice in upload and createWriteStream between simple/resumable upload technique
  • upload: Stat the incoming file for size, default to simple for < 5mb, resumable for > 5mb
  • createWriteStream: default to resumable uploads
  • Integrate { resumableThreshold: n } option on storage instantiation (defaults to 5mb)
  • test integrity upload stream
  • finalize error messaging & objects

Fixes #298

createWriteStream uses the Resumable Upload API: http://goo.gl/jb0e9D.

The process involves these steps:

  1. POST the file's metadata. We get a resumable upload URI back, then cache it with ConfigStore.
  2. PUT data to that URI with a Content-Range header noting what position the data is beginning from. We also cache, at most, the first 16 bytes of the data being uploaded.
  3. Delete the ConfigStore cache after the upload completes.

If the initial upload operation is interrupted, the next time the user uploads the file, these steps occur:

  1. Detect the presence of a cached URI in ConfigStore.
  2. Make an empty PUT request to that URI to get the last byte written to the remote file.
  3. PUT data to the URI starting from the first byte after the last byte returned from the call above.

If the user tries to upload entirely different data to the remote file:

  1. -- same as above --
  2. -- same as above --
  3. -- same as above --
  4. Compare the first chunk of the new data with the chunk in cache. If it's different, start a new resumable upload (Step 1 of the first example).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@stephenplusplus
stephenplusplus force-pushed the spp--storage-resumable-uploads branch 3 times, most recently from e5a72fe to ba2e8cf Compare November 11, 2014 22:05
stephenplusplus
stephenplusplus reviewed Nov 11, 2014
View reviewed changes
Comment thread lib/storage/file.js Outdated

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus
stephenplusplus force-pushed the spp--storage-resumable-uploads branch 2 times, most recently from a665191 to f76c406 Compare November 12, 2014 19:13
ryanseys
ryanseys reviewed Nov 12, 2014
View reviewed changes
Comment thread lib/storage/file.js Outdated

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Nov 13, 2014

Copy link
Copy Markdown
Contributor

Overall this looks good. No big issues. RETRY_LIMIT might want to be increased if we put in exponential backoff as suggested. 5 seems like a more sane default (as suggested here).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes dhermes mentioned this pull request Nov 13, 2014
Storage: Support Resumable Uploads googleapis/google-cloud-python#375
Closed
@stephenplusplus
stephenplusplus force-pushed the spp--storage-resumable-uploads branch from 76ed7ac to 7bd17d9 Compare November 14, 2014 15:43
stephenplusplus
stephenplusplus reviewed Nov 14, 2014
View reviewed changes
Comment thread lib/storage/file.js

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Nov 20, 2014

Copy link
Copy Markdown
Contributor Author

Recent best practices have emerged, so I figured we should put these in place before merging. I've added a task list in the initial post with the intended revisions so far; more will likely be coming.

One of the revisions is allowing a user to specify a preference of a simple or resumable upload. I'm seeking opinions on converting the upload method to a different signature than what we have currently.

Current:

myBucket.upload("./photo.jpg", myFile, { my: "metadata" }, function (err, file) {})

Suggested:

myBucket.upload("./photo.jpg", {
  destination: myFile,
  metadata: {
    my: "metadata"
  },
  resumable: (true || false)
}, function (err, file) {})

file.createWriteStream() will also need this functionality added.

Current:

myFile.createWriteStream({ my: "metadata" })

Suggested:

myFile.createWriteStream({
  resumable: false, // default: true
  metadata: {
    my: "metadata"
  }
})

Any better ideas?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silvolu

silvolu commented Nov 20, 2014

Copy link
Copy Markdown
Contributor

Looks good, but I'd like the user to be able to change the resumable_threshold (that defaults to 5MB). Could we expose a configuration for storage, or add setters for similar values? In the future we might need it for the chunk size as well, and we could use it to allow the user to change the default for createWriteStream at a global level.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Nov 20, 2014

Copy link
Copy Markdown
Contributor Author

Config on the storage level makes sense to me.

var gcloud = require("gcloud")({ /* conn info */ })
gcloud.storage({ resumableThreshold: n })

&

var gcloud = require("gcloud")
var storage = gcloud.storage({ /* conn info */, resumableThreshold: n  })
  1. What format do we accept for n? (bytes, kb, mb?)
  2. Is it ok to rely on our docs to explain resumableThreshold won't have an effect on createWriteStream uploads? I can see that being a point of confusion
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Nov 20, 2014

Copy link
Copy Markdown
Contributor

What format do we accept for n? (bytes, kb, mb?)

Bytes. The header is in bytes, so this seems like a simple choice.

Is it ok to rely on our docs to explain resumableThreshold won't have an effect on createWriteStream uploads?

Wait, why not?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Nov 20, 2014

Copy link
Copy Markdown
Contributor Author

In a stream, we can't stat a file for its size. It comes to us in small kb chunks, meaning we don't know if it's over a threshold until after we've already formed the request.

I suppose if we wanted to, we could buffer n threshold into memory before beginning the request (which is the time we have to say resumable vs simple), but that seems like a dangerous approach.

& +1 on bytes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Nov 20, 2014

Copy link
Copy Markdown
Contributor

Fair enough. Plus you don't really know that the readable stream is a file at all. That being said, should resumable even work with streams unless they explicitly give us the filename to use?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Nov 20, 2014

Copy link
Copy Markdown
Contributor Author

That's a great question, but I think it's impossible to answer. Still, I anticipate resumable will be a desirable default, and speaking technically, we have a solution for if we resume an upload, but are sent different data than we were originally (we bail and start a new upload).

And in any case, the user knows best what they are doing, so we [will] allow them to be explicit about what type of upload to use at the time of the upload.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Nov 20, 2014

Copy link
Copy Markdown
Contributor

Can we get access to the readable stream that is piping their data to our writable stream? In theory, if we can, we could try to yank the fd (file descriptor) from it and then we could sneakily stat the file to find out its name and size? This is a total shot in the dark though.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Nov 20, 2014

Copy link
Copy Markdown
Contributor Author

With a stream, we should only be aware of the data coming in, and not about how/where/etc. It would also be a bit magical if we tried to implement something like that. And usually, whenever there's magic, the solution is to add an option or variation of the method that gives the user explicit control of the outcome. We will have both of those things ({ resumable: false } and bucket.upload)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Nov 20, 2014

Copy link
Copy Markdown
Contributor

Yeah, that would be too much magic, agreed. Getting back to the original question, I think that it's safe to say that if the developer is uploading using a stream, they know that resumableThreshold won't work. I would only expect it to work if we explicitly give the filename i.e. like in .upload(), so if you can do better than that, that's exceeding expectations in my mind.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus
stephenplusplus force-pushed the spp--storage-resumable-uploads branch from 7bd17d9 to 7e1dde8 Compare November 20, 2014 17:13
sofisl pushed a commit that referenced this pull request Feb 4, 2026
@DominicKramer @JustinBeckwith
chore(deps): upgrade to gts 1.0.0 (#299)
f434d3a
This was referenced Feb 4, 2026
migrate code from googleapis/nodejs-logging-bunyan #7136
Closed
migrate code from googleapis/nodejs-logging-bunyan #7137
Closed
migrate code from googleapis/nodejs-logging-bunyan #7138
Merged
sofisl pushed a commit that referenced this pull request Feb 24, 2026
@schmidt-sebastian
Bump Firestore version to v0.16 (#299)
6509a98
sofisl pushed a commit that referenced this pull request Feb 25, 2026
@jkwlui
refactor(ts): merge initial TypeScript conversion (#334)
943b50c
* refactor(ts): Typescript conversion (initial) (#255)

* refactor(ts): Rename *.js to .ts

* refactor(ts): setup typescript tools

* refactor(ts): install available @types packages

* refactor(ts): remove .js extension from imports

* refactor(ts): gts fix

* refactor(ts): function to arrow =>

* refactor(ts): for...in => for...of Object.keys(...

* refactor(ts): use native `extends Error` for custom error classes

...instead of relying on package 'create-error-class'

* refactor(ts): module.exports => export { ... }

* refactor(ts): temporarily disable noImplicitAny before augmenting types

* refactor(ts): eof \n

* refactor(ts): use typescipt ~2.9.2

* Revert "refactor(ts): module.exports => export { ... }"

This reverts commit 219ef2f2b4c1f423afd15246bea6735e42b15d3b.

* refactor(ts): temporarily remove posttest npm script

* refactor(ts): internalize class and object members into class (#260)

* refactor(ts): Acl: internalize static/object properties to class

* refactor(ts): Bucket: internalize static/object properties to class

* refactor(ts): File: internalize static/object properties to class

* refactor(ts): Iam: internalize static/object properties to class

* refactor(ts): File: internalized missed properties to class

* chore: update package-lock.json

* refactor(ts): Storage: internalize class/object properties into class

* refactor(ts): Iam: import Bucket

* refactor(ts): File: internal Acl

* refactor(ts): add 'any' type to suppress compiler error (#261)

* refactor(ts): Channel: type cast this.metadata as any

* refactor(ts): Bucket: add types to make tsc work

* refactor(ts): Acl: add any types

* refactor(ts): File: add any types

* refactor(ts): Storage: add any types

* refactor(ts): Notification: add any[] type

* refactor(ts): File: add any[] type

* Typescript: use ts-style exports instead of module.exports (#267)

* refactor(ts): use es6/ts export in project files

* refactor(ts): import from file in project

* refactor(ts): export = Storage; fix import from Storage from other classes

* chore: update gcs-resumable-upload to 0.11.1

* refactor(ts): misc. fixes to make tsc happy (#268)

* refactor(ts): File: add optional types for uninitialized members

* refactor(ts): Bucket: options is optional in constructor

* refactor(ts): File: various `any` cast; optional callback? and type fixes

* refactor(ts): add Acl#default as a member

* refactor(ts): Bucket: various any cast; optional callback? and type fixes

* refactor(ts): Notification: add any cast; optional callback?

* refactor(ts): Iam: type cast any

* refactor(ts): Acl.default is optional

* refactor(ts): require pumpify

* refactor(ts): !assert this.acl.default exists in bucket

* cleanup: no longer need to set Storage.X

* refactor(ts): export = Storage proxy

* refactor(ts): destructure apply Proxy and call Storage with single argument

* refactor(ts): fix Date comparisons

* cleanup: remove ignore no-class-assign

* refactor(ts): convert tests to typescript (1) (#272)

* refactor(ts): Tests: *.js => *.ts

* refactor(ts): add missing @types/ in tests

* refactor(ts): iam use ts-style imports

* refactor(ts): test/index.ts use ts-style imports

* refactor(ts): test/file.ts use ts-style imports

* refactor(ts): test/bucket.ts use ts-style imports

* refactor(ts): test/acl.ts use ts-style imports

* refactor(ts): test/acl.ts move fakes inside describe(..)
So tsc won't complain we're redeclaring sth.

* refactor(ts): test/channel.ts use ts-style imports

* refactor(ts): test/notification.ts use ts-style imports

* refactor(ts): move let Acl back to outer scope

* Typescript: setup package.json and .circleci/config.yaml (#271)

* refactor(ts): update package.json with ts project specify paths

* refactor(ts): add tsc compile step to npm; npm run check instead of lint

* refactor(ts): npm run compile comes after npm install

* refactor(ts): dont need to compile ts explicitly

* refactor(ts): lint should run eslint on js tests, and run gts check on ts

* refactor(es6): ts-ify 2

* refactor(ts): allow implicit this as any temporarily

* refactor(ts): add any-cast and optional arg? to make test/bucket.ts compile

* refactor(ts): add any-cast to test/notification.ts

* refactor(ts): test/file.ts: add any-casts and optional arg? to make it compile

* refactor(ts): test/file.ts: Date comparisons using .valueOf()

* refactor(ts): test/file.ts Request fakes uses class syntax

* refactor(ts): main src is in build/ now so require('..') will not work (#286)

* refactor(ts): import individual exports from @google-cloud/common (#287)

* refactor(ts): make test/notification.ts pass (#290)

* refactor(ts): test/notification.ts: import indiv common exports

* refactor(ts): fix Notification import from named export

* refactor(ts): test/iam.ts: fix proxyquire import

* refactor(ts): test/channel.ts: fix proxyquire import

* refactor(ts): make test/acl.ts pass (#288)

* TypeScript: make test/index.ts pass (#292)

* refactor(ts): Storage test: fix relative path

* refactor(ts): Storage test: fix FakeChannel proxyquire

* refactor(ts): test-no-cover should compile ts before running test (#289)

* build: test-no-cover should compile ts before running test

* refactor(ts): change npm scripts to conform to typescript best practices

* refactor(ts): checkin mocha.opts and add mocha deps

* cleanup(codecov): ignore build/test for code coverage (#293)

* TypeScript: make Bucket test pass (#291)

* refactor(ts): test/bucket: fix proxyquire import

* refactor(ts): fix testdata file path

* refactor(ts): test/bucket.ts: fix common util

* refactor(ts): test/bucket.ts: proxyquire async via default import

* refactor(ts): make test/file.ts pass (#294)

* refactor(ts): assign .name property to custom File error types

* refactor(ts): test/file: FakeRequest#getRequestOptions should be static

* refactor(ts): resumable-upload uses es6 modules, so proxyquire as default

* refactor(ts): run gts fix (#295)

* refactor(ts): function to arrow => (#297)

* refactor(ts): function to arrow =>

* style

* Revert "refactor(ts): function to arrow => (#297)" (#298)

This reverts commit c35e9ccccf70161ffbae2e5ba18bc06072c80f81.

* refactor(ts): tests function() to arrow => (#299)

* refactor(ts): function to arrow =>

* style

* refactor(ts): test/acl.ts: replace ref `arguments` in arrow function

* refactor(ts): test/bucket.ts fix arrow function `this` and `arguments` ref

* refactor(ts): test/file.ts fix arrow function `this` and `arguments` ref

* refactor(ts): test/iam.ts fix arrow function `this` ref

* refactor(ts): tslint:disable-next-line:variable-name (#300)

* Typescript: workaround explicit 'any' cast in tests (#307)

* ts: avoid using extend to override request methods

* ts: no allowSyntheticDefaultImports (#316)

* dep: update [email protected] and [email protected]

* ts: no allowSyntheticDefaultImports

* ts: gts fix

* TypeScript: export {Storage} as named export (#327)

* ts: export Storage as named export - const {Storage} = req...

BREAKING CHANGE:
Storage will need to be imported as a named import:
const { Storage } = require('@google-cloud/storage');

Storage cannot be instantiated without new:
𝘅 const storage = Storage();  // deprecated
✔ const storage = new Storage();

* ts: fix tests now that Storage is named

* ts(docs): fix all in-line samples to use named-exported Storage (#329)

* ts(docs): fix all in-line samples to use named-exported Storage

* ts: named Storage import in samples and system tests

* dep: Use v0.21.0 of @google-cloud/common (#330)

* dep: bring in [email protected]

* install @google-cloud/promisify and paginator and use them

* extract paginator and promisify from proxyquire of @google-cloud/common

* Delete package-lock.json

* ts: more fixes (#333)

* ts: add interfaces to get rid of any

* ts: strip any

* ts: add interface

* dep: upgrade @google-cloud/common to ^0.21.1

* ts: get rid of any cast in bucket.ts with types

* ts: fix anys

* fix remaining check issues

* ts: fix test

* fix: use new Storage() constructor in system-test

* doc: fix init in README.md quickstart

* fix: arrow functions

* more arrow funcitons

* add ignore no-any for now;

* ts doesnt like for..in, fix it

* gts fix

* fix test
GautamSharda pushed a commit that referenced this pull request Feb 25, 2026
@gcf-owl-bot
docs: remove stale header guidance for AppendRows (#299)
bd13045
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 485941276

Source-Link: https://togithub.com/googleapis/googleapis/commit/a5f5928e736ea88c03e48c506a19fa632b43de9e

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/61ebfaa325101bc9b29ee34900b45b2f0d23981e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlYmZhYTMyNTEwMWJjOWIyOWVlMzQ5MDBiNDViMmYwZDIzOTgxZSJ9

BEGIN_NESTED_COMMIT
chore: override API mixins when needed
PiperOrigin-RevId: 477248447

Source-Link: https://togithub.com/googleapis/googleapis/commit/4689c7380444972caf11fd1b96e7ec1f864b7dfb

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c4059786a5cd805a0151d95b477fbc486bcbcedc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzQwNTk3ODZhNWNkODA1YTAxNTFkOTViNDc3ZmJjNDg2YmNiY2VkYyJ9
END_NESTED_COMMIT
@GautamSharda GautamSharda mentioned this pull request Feb 25, 2026
migrate code from googleapis/nodejs-bigquery-storage #7306
Closed
4 tasks
This was referenced Feb 26, 2026
migrate code from googleapis/nodejs-firestore #7311
Closed
migrate code from googleapis/nodejs-firestore #7410
Merged
@GautamSharda GautamSharda mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-bigquery-storage #7496
Merged
4 tasks
codyoss pushed a commit that referenced this pull request Mar 5, 2026
@sofisl @gcf-owl-bot
build!: update library to use Node 12 (#299)
62ce85b
* feat!: Update library to use Node 12
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
@codyoss codyoss mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-projectify #7511
Merged
GautamSharda pushed a commit that referenced this pull request Mar 5, 2026
@JustinBeckwith
chore: remove a few unused deps (#299)
f9838c4
@GautamSharda GautamSharda mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-logging #7514
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Mar 5, 2026
@ddelgrosso1
fix: use pipeline in place of pipe to better handle cleanup / errors (#…
420e9a6
…299)
@codyoss codyoss mentioned this pull request Mar 9, 2026
migrate code from googleapis/nodejs-paginator #7536
Closed
codyoss pushed a commit that referenced this pull request Mar 9, 2026
@parthea
chore: add api_shortname and library_type to repo metadata (#299)
42effdc
@meltsufin meltsufin mentioned this pull request Mar 10, 2026
chore: migrate code from googleapis/nodejs-logging #7550
Merged
codyoss pushed a commit that referenced this pull request Mar 11, 2026
@parthea @codyoss
chore: add api_shortname and library_type to repo metadata (#299)
08400f7
@codyoss codyoss mentioned this pull request Mar 11, 2026
migrate code from googleapis/nodejs-paginator #7590
Merged
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
@JustinBeckwith
chore: update issue templates (#299)
8f9e17f
This was referenced Mar 11, 2026
migrate code from googleapis/nodejs-pubsub #7592
Merged
migrate code from googleapis/nodejs-promisify #7595
Closed
GautamSharda pushed a commit that referenced this pull request Mar 12, 2026
@gcf-owl-bot
build: add srs yaml file (#299)
f76a973
* build: add sync-repo-settings and change branch protection
Source-Link: googleapis/synthtool@ed8079c
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:80bfa0c67226453b37b501be7748b2fa2a2676cfeec0012e79e3a1a8f1cbe6a3
@GautamSharda GautamSharda mentioned this pull request Mar 12, 2026
migrate code from googleapis/nodejs-promisify #7596
Merged
4 tasks
GautamSharda pushed a commit that referenced this pull request Mar 12, 2026
@gcf-owl-bot
build: add srs yaml file (#299)
09f43f4
* build: add sync-repo-settings and change branch protection
Source-Link: googleapis/synthtool@ed8079c
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:80bfa0c67226453b37b501be7748b2fa2a2676cfeec0012e79e3a1a8f1cbe6a3
GautamSharda pushed a commit that referenced this pull request Mar 12, 2026
@JustinBeckwith
chore: update eslintignore config (#299)
1304059
@GautamSharda GautamSharda mentioned this pull request Mar 12, 2026
migrate code from googleapis/nodejs-common #7597
Merged
4 tasks
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request Mar 18, 2026
@jkwlui
refactor(ts): merge initial TypeScript conversion (googleapis#334)
03e06b0
* refactor(ts): Typescript conversion (initial) (googleapis#255)

* refactor(ts): Rename *.js to .ts

* refactor(ts): setup typescript tools

* refactor(ts): install available @types packages

* refactor(ts): remove .js extension from imports

* refactor(ts): gts fix

* refactor(ts): function to arrow =>

* refactor(ts): for...in => for...of Object.keys(...

* refactor(ts): use native `extends Error` for custom error classes

...instead of relying on package 'create-error-class'

* refactor(ts): module.exports => export { ... }

* refactor(ts): temporarily disable noImplicitAny before augmenting types

* refactor(ts): eof \n

* refactor(ts): use typescipt ~2.9.2

* Revert "refactor(ts): module.exports => export { ... }"

This reverts commit 219ef2f2b4c1f423afd15246bea6735e42b15d3b.

* refactor(ts): temporarily remove posttest npm script

* refactor(ts): internalize class and object members into class (googleapis#260)

* refactor(ts): Acl: internalize static/object properties to class

* refactor(ts): Bucket: internalize static/object properties to class

* refactor(ts): File: internalize static/object properties to class

* refactor(ts): Iam: internalize static/object properties to class

* refactor(ts): File: internalized missed properties to class

* chore: update package-lock.json

* refactor(ts): Storage: internalize class/object properties into class

* refactor(ts): Iam: import Bucket

* refactor(ts): File: internal Acl

* refactor(ts): add 'any' type to suppress compiler error (googleapis#261)

* refactor(ts): Channel: type cast this.metadata as any

* refactor(ts): Bucket: add types to make tsc work

* refactor(ts): Acl: add any types

* refactor(ts): File: add any types

* refactor(ts): Storage: add any types

* refactor(ts): Notification: add any[] type

* refactor(ts): File: add any[] type

* Typescript: use ts-style exports instead of module.exports (googleapis#267)

* refactor(ts): use es6/ts export in project files

* refactor(ts): import from file in project

* refactor(ts): export = Storage; fix import from Storage from other classes

* chore: update gcs-resumable-upload to 0.11.1

* refactor(ts): misc. fixes to make tsc happy (googleapis#268)

* refactor(ts): File: add optional types for uninitialized members

* refactor(ts): Bucket: options is optional in constructor

* refactor(ts): File: various `any` cast; optional callback? and type fixes

* refactor(ts): add Acl#default as a member

* refactor(ts): Bucket: various any cast; optional callback? and type fixes

* refactor(ts): Notification: add any cast; optional callback?

* refactor(ts): Iam: type cast any

* refactor(ts): Acl.default is optional

* refactor(ts): require pumpify

* refactor(ts): !assert this.acl.default exists in bucket

* cleanup: no longer need to set Storage.X

* refactor(ts): export = Storage proxy

* refactor(ts): destructure apply Proxy and call Storage with single argument

* refactor(ts): fix Date comparisons

* cleanup: remove ignore no-class-assign

* refactor(ts): convert tests to typescript (1) (googleapis#272)

* refactor(ts): Tests: *.js => *.ts

* refactor(ts): add missing @types/ in tests

* refactor(ts): iam use ts-style imports

* refactor(ts): test/index.ts use ts-style imports

* refactor(ts): test/file.ts use ts-style imports

* refactor(ts): test/bucket.ts use ts-style imports

* refactor(ts): test/acl.ts use ts-style imports

* refactor(ts): test/acl.ts move fakes inside describe(..)
So tsc won't complain we're redeclaring sth.

* refactor(ts): test/channel.ts use ts-style imports

* refactor(ts): test/notification.ts use ts-style imports

* refactor(ts): move let Acl back to outer scope

* Typescript: setup package.json and .circleci/config.yaml (googleapis#271)

* refactor(ts): update package.json with ts project specify paths

* refactor(ts): add tsc compile step to npm; npm run check instead of lint

* refactor(ts): npm run compile comes after npm install

* refactor(ts): dont need to compile ts explicitly

* refactor(ts): lint should run eslint on js tests, and run gts check on ts

* refactor(es6): ts-ify 2

* refactor(ts): allow implicit this as any temporarily

* refactor(ts): add any-cast and optional arg? to make test/bucket.ts compile

* refactor(ts): add any-cast to test/notification.ts

* refactor(ts): test/file.ts: add any-casts and optional arg? to make it compile

* refactor(ts): test/file.ts: Date comparisons using .valueOf()

* refactor(ts): test/file.ts Request fakes uses class syntax

* refactor(ts): main src is in build/ now so require('..') will not work (googleapis#286)

* refactor(ts): import individual exports from @google-cloud/common (googleapis#287)

* refactor(ts): make test/notification.ts pass (googleapis#290)

* refactor(ts): test/notification.ts: import indiv common exports

* refactor(ts): fix Notification import from named export

* refactor(ts): test/iam.ts: fix proxyquire import

* refactor(ts): test/channel.ts: fix proxyquire import

* refactor(ts): make test/acl.ts pass (googleapis#288)

* TypeScript: make test/index.ts pass (googleapis#292)

* refactor(ts): Storage test: fix relative path

* refactor(ts): Storage test: fix FakeChannel proxyquire

* refactor(ts): test-no-cover should compile ts before running test (googleapis#289)

* build: test-no-cover should compile ts before running test

* refactor(ts): change npm scripts to conform to typescript best practices

* refactor(ts): checkin mocha.opts and add mocha deps

* cleanup(codecov): ignore build/test for code coverage (googleapis#293)

* TypeScript: make Bucket test pass (googleapis#291)

* refactor(ts): test/bucket: fix proxyquire import

* refactor(ts): fix testdata file path

* refactor(ts): test/bucket.ts: fix common util

* refactor(ts): test/bucket.ts: proxyquire async via default import

* refactor(ts): make test/file.ts pass (googleapis#294)

* refactor(ts): assign .name property to custom File error types

* refactor(ts): test/file: FakeRequest#getRequestOptions should be static

* refactor(ts): resumable-upload uses es6 modules, so proxyquire as default

* refactor(ts): run gts fix (googleapis#295)

* refactor(ts): function to arrow => (googleapis#297)

* refactor(ts): function to arrow =>

* style

* Revert "refactor(ts): function to arrow => (googleapis#297)" (googleapis#298)

This reverts commit c35e9ccccf70161ffbae2e5ba18bc06072c80f81.

* refactor(ts): tests function() to arrow => (googleapis#299)

* refactor(ts): function to arrow =>

* style

* refactor(ts): test/acl.ts: replace ref `arguments` in arrow function

* refactor(ts): test/bucket.ts fix arrow function `this` and `arguments` ref

* refactor(ts): test/file.ts fix arrow function `this` and `arguments` ref

* refactor(ts): test/iam.ts fix arrow function `this` ref

* refactor(ts): tslint:disable-next-line:variable-name (googleapis#300)

* Typescript: workaround explicit 'any' cast in tests (googleapis#307)

* ts: avoid using extend to override request methods

* ts: no allowSyntheticDefaultImports (googleapis#316)

* dep: update [email protected] and [email protected]

* ts: no allowSyntheticDefaultImports

* ts: gts fix

* TypeScript: export {Storage} as named export (googleapis#327)

* ts: export Storage as named export - const {Storage} = req...

BREAKING CHANGE:
Storage will need to be imported as a named import:
const { Storage } = require('@google-cloud/storage');

Storage cannot be instantiated without new:
𝘅 const storage = Storage();  // deprecated
✔ const storage = new Storage();

* ts: fix tests now that Storage is named

* ts(docs): fix all in-line samples to use named-exported Storage (googleapis#329)

* ts(docs): fix all in-line samples to use named-exported Storage

* ts: named Storage import in samples and system tests

* dep: Use v0.21.0 of @google-cloud/common (googleapis#330)

* dep: bring in [email protected]

* install @google-cloud/promisify and paginator and use them

* extract paginator and promisify from proxyquire of @google-cloud/common

* Delete package-lock.json

* ts: more fixes (googleapis#333)

* ts: add interfaces to get rid of any

* ts: strip any

* ts: add interface

* dep: upgrade @google-cloud/common to ^0.21.1

* ts: get rid of any cast in bucket.ts with types

* ts: fix anys

* fix remaining check issues

* ts: fix test

* fix: use new Storage() constructor in system-test

* doc: fix init in README.md quickstart

* fix: arrow functions

* more arrow funcitons

* add ignore no-any for now;

* ts doesnt like for..in, fix it

* gts fix

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

storage: resumable uploads

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@stephenplusplus @ryanseys @silvolu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.