Commit 03e06b0
authored
refactor(ts): merge initial TypeScript conversion (googleapis#334)
* 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 gts@0.8 and typescript@3.0.1
* 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 nodejs-common@0.21.0
* 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 test1 parent 6230169 commit 03e06b0
38 files changed
Lines changed: 4157 additions & 3837 deletions
File tree
- handwritten/storage
- .circleci
- samples
- system-test
- src
- system-test
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
| 175 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 59 | + | |
63 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
| |||
90 | 103 | | |
91 | 104 | | |
92 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
93 | 123 | | |
94 | 124 | | |
95 | 125 | | |
96 | 126 | | |
97 | 127 | | |
| 128 | + | |
| 129 | + | |
98 | 130 | | |
99 | 131 | | |
100 | 132 | | |
| |||
107 | 139 | | |
108 | 140 | | |
109 | 141 | | |
| 142 | + | |
110 | 143 | | |
| 144 | + | |
111 | 145 | | |
112 | 146 | | |
113 | 147 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
0 commit comments