@firebase/storage 0.8.4-2021920175447 → 0.8.4-canary.dfed7f83f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,6 @@
16
16
  */
17
17
  import { RequestInfo } from './requestinfo';
18
18
  import { Headers, Connection } from './connection';
19
- import { ConnectionPool } from './connectionPool';
20
19
  export interface Request<T> {
21
20
  getPromise(): Promise<T>;
22
21
  /**
@@ -45,4 +44,4 @@ export declare function addAuthHeader_(headers: Headers, authToken: string | nul
45
44
  export declare function addVersionHeader_(headers: Headers, firebaseVersion?: string): void;
46
45
  export declare function addGmpidHeader_(headers: Headers, appId: string | null): void;
47
46
  export declare function addAppCheckHeader_(headers: Headers, appCheckToken: string | null): void;
48
- export declare function makeRequest<T>(requestInfo: RequestInfo<T>, appId: string | null, authToken: string | null, appCheckToken: string | null, pool: ConnectionPool, firebaseVersion?: string): Request<T>;
47
+ export declare function makeRequest<T>(requestInfo: RequestInfo<T>, appId: string | null, authToken: string | null, appCheckToken: string | null, requestFactory: () => Connection, firebaseVersion?: string): Request<T>;
@@ -36,3 +36,4 @@ export declare class XhrConnection implements Connection {
36
36
  removeUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
37
37
  }
38
38
  export declare function newConnection(): Connection;
39
+ export declare function injectTestConnection(factory: (() => Connection) | null): void;
@@ -16,3 +16,4 @@
16
16
  */
17
17
  import { Connection } from '../implementation/connection';
18
18
  export declare function newConnection(): Connection;
19
+ export declare function injectTestConnection(factory: (() => Connection) | null): void;
@@ -42,3 +42,4 @@ export declare class FetchConnection implements Connection {
42
42
  removeUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
43
43
  }
44
44
  export declare function newConnection(): Connection;
45
+ export declare function injectTestConnection(factory: (() => Connection) | null): void;
@@ -17,7 +17,6 @@
17
17
  import { Location } from './implementation/location';
18
18
  import { Request } from './implementation/request';
19
19
  import { RequestInfo } from './implementation/requestinfo';
20
- import { ConnectionPool } from './implementation/connectionPool';
21
20
  import { Reference } from './reference';
22
21
  import { Provider } from '@firebase/component';
23
22
  import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
@@ -25,6 +24,7 @@ import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types
25
24
  import { FirebaseApp } from '@firebase/app';
26
25
  import { FirebaseStorage } from './public-types';
27
26
  import { EmulatorMockTokenOptions } from '@firebase/util';
27
+ import { Connection } from './implementation/connection';
28
28
  export declare function isUrl(path?: string): boolean;
29
29
  /**
30
30
  * Returns a storage Reference for the given url.
@@ -64,7 +64,6 @@ export declare class FirebaseStorageImpl implements FirebaseStorage {
64
64
  /**
65
65
  * @internal
66
66
  */
67
- readonly _pool: ConnectionPool;
68
67
  readonly _url?: string | undefined;
69
68
  readonly _firebaseVersion?: string | undefined;
70
69
  _bucket: Location | null;
@@ -93,7 +92,7 @@ export declare class FirebaseStorageImpl implements FirebaseStorage {
93
92
  /**
94
93
  * @internal
95
94
  */
96
- _pool: ConnectionPool, _url?: string | undefined, _firebaseVersion?: string | undefined);
95
+ _url?: string | undefined, _firebaseVersion?: string | undefined);
97
96
  /**
98
97
  * The host string for this service, in the form of `host` or
99
98
  * `host:port`.
@@ -126,6 +125,6 @@ export declare class FirebaseStorageImpl implements FirebaseStorage {
126
125
  * @param requestInfo - HTTP RequestInfo object
127
126
  * @param authToken - Firebase auth token
128
127
  */
129
- _makeRequest<T>(requestInfo: RequestInfo<T>, authToken: string | null, appCheckToken: string | null): Request<T>;
130
- makeRequestWithTokens<T>(requestInfo: RequestInfo<T>): Promise<Request<T>>;
128
+ _makeRequest<T>(requestInfo: RequestInfo<T>, requestFactory: () => Connection, authToken: string | null, appCheckToken: string | null): Request<T>;
129
+ makeRequestWithTokens<T>(requestInfo: RequestInfo<T>, requestFactory: () => Connection): Promise<T>;
131
130
  }
package/dist/storage.d.ts CHANGED
@@ -43,13 +43,6 @@ declare interface Connection {
43
43
  removeUploadProgressListener(listener: (p1: ProgressEvent) => void): void;
44
44
  }
45
45
 
46
- /**
47
- * Factory-like class for creating XhrIo instances.
48
- */
49
- declare class ConnectionPool {
50
- createConnection(): Connection;
51
- }
52
-
53
46
  /**
54
47
  * Modify this {@link FirebaseStorage} instance to communicate with the Cloud Storage emulator.
55
48
  *
@@ -167,7 +160,6 @@ export declare class _FirebaseStorageImpl implements FirebaseStorage {
167
160
  /**
168
161
  * @internal
169
162
  */
170
- readonly _pool: ConnectionPool;
171
163
  readonly _url?: string | undefined;
172
164
  readonly _firebaseVersion?: string | undefined;
173
165
  _bucket: _Location | null;
@@ -196,7 +188,7 @@ export declare class _FirebaseStorageImpl implements FirebaseStorage {
196
188
  /**
197
189
  * @internal
198
190
  */
199
- _pool: ConnectionPool, _url?: string | undefined, _firebaseVersion?: string | undefined);
191
+ _url?: string | undefined, _firebaseVersion?: string | undefined);
200
192
  /**
201
193
  * The host string for this service, in the form of `host` or
202
194
  * `host:port`.
@@ -229,8 +221,8 @@ export declare class _FirebaseStorageImpl implements FirebaseStorage {
229
221
  * @param requestInfo - HTTP RequestInfo object
230
222
  * @param authToken - Firebase auth token
231
223
  */
232
- _makeRequest<T>(requestInfo: RequestInfo_2<T>, authToken: string | null, appCheckToken: string | null): Request_2<T>;
233
- makeRequestWithTokens<T>(requestInfo: RequestInfo_2<T>): Promise<Request_2<T>>;
224
+ _makeRequest<T>(requestInfo: RequestInfo_2<T>, requestFactory: () => Connection, authToken: string | null, appCheckToken: string | null): Request_2<T>;
225
+ makeRequestWithTokens<T>(requestInfo: RequestInfo_2<T>, requestFactory: () => Connection): Promise<T>;
234
226
  }
235
227
 
236
228
  /**
@@ -43,3 +43,4 @@ export declare class TestingConnection implements Connection {
43
43
  addUploadProgressListener(): void;
44
44
  removeUploadProgressListener(): void;
45
45
  }
46
+ export declare function newTestConnection(sendHook?: SendHook | null): Connection;
@@ -1,8 +1,6 @@
1
1
  import { FirebaseApp } from '@firebase/app-types';
2
2
  import { StorageError } from '../../src/implementation/error';
3
3
  import { Headers, Connection } from '../../src/implementation/connection';
4
- import { ConnectionPool } from '../../src/implementation/connectionPool';
5
- import { SendHook } from './connection';
6
4
  import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
7
5
  import { Provider } from '@firebase/component';
8
6
  import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
@@ -22,7 +20,6 @@ export declare function makeFakeAuthProvider(token: {
22
20
  export declare function makeFakeAppCheckProvider(tokenResult: {
23
21
  token: string;
24
22
  }): Provider<AppCheckInternalComponentName>;
25
- export declare function makePool(sendHook: SendHook | null): ConnectionPool;
26
23
  /**
27
24
  * Returns something that looks like an fbs.XhrIo with the given headers
28
25
  * and status.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/storage",
3
- "version": "0.8.4-2021920175447",
3
+ "version": "0.8.4-canary.dfed7f83f",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -30,17 +30,17 @@
30
30
  },
31
31
  "license": "Apache-2.0",
32
32
  "dependencies": {
33
- "@firebase/util": "1.4.0",
34
- "@firebase/component": "0.5.7",
33
+ "@firebase/util": "1.4.0-canary.dfed7f83f",
34
+ "@firebase/component": "0.5.7-canary.dfed7f83f",
35
35
  "node-fetch": "2.6.5",
36
36
  "tslib": "^2.1.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@firebase/app": "0.x"
39
+ "@firebase/app": "0.7.4-canary.dfed7f83f"
40
40
  },
41
41
  "devDependencies": {
42
- "@firebase/app": "0.7.4",
43
- "@firebase/auth": "0.19.0-2021920175447",
42
+ "@firebase/app": "0.7.4-canary.dfed7f83f",
43
+ "@firebase/auth": "0.18.3-canary.dfed7f83f",
44
44
  "rollup": "2.57.0",
45
45
  "@rollup/plugin-alias": "3.1.5",
46
46
  "@rollup/plugin-json": "4.1.0",
@@ -1,26 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- /**
18
- * @fileoverview Replacement for goog.net.XhrIoPool that works with fbs.XhrIo.
19
- */
20
- import { Connection } from './connection';
21
- /**
22
- * Factory-like class for creating XhrIo instances.
23
- */
24
- export declare class ConnectionPool {
25
- createConnection(): Connection;
26
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { Request } from './request';
18
- import { RequestInfo } from './requestinfo';
19
- import { ConnectionPool } from './connectionPool';
20
- declare type requestMaker = <T>(requestInfo: RequestInfo<T>, appId: string | null, authToken: string | null, pool: ConnectionPool) => Request<T>;
21
- export { requestMaker };