@firebase/storage 0.13.3 → 0.13.4
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.
- package/dist/index.browser.cjs.js +3571 -3571
- package/dist/index.browser.cjs.js.map +1 -1
- package/dist/index.cjs.js +3571 -3571
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +3571 -3571
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +3596 -3596
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +3596 -3596
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api.browser.d.ts +47 -47
- package/dist/node-esm/src/api.d.ts +200 -200
- package/dist/node-esm/src/api.node.d.ts +47 -47
- package/dist/node-esm/src/constants.d.ts +20 -20
- package/dist/node-esm/src/implementation/async.d.ts +22 -22
- package/dist/node-esm/src/implementation/backoff.d.ts +43 -43
- package/dist/node-esm/src/implementation/blob.d.ts +34 -34
- package/dist/node-esm/src/implementation/connection.d.ts +56 -56
- package/dist/node-esm/src/implementation/constants.d.ts +48 -48
- package/dist/node-esm/src/implementation/error.d.ts +126 -126
- package/dist/node-esm/src/implementation/failrequest.d.ts +29 -29
- package/dist/node-esm/src/implementation/fs.d.ts +17 -17
- package/dist/node-esm/src/implementation/json.d.ts +7 -7
- package/dist/node-esm/src/implementation/list.d.ts +19 -19
- package/dist/node-esm/src/implementation/location.d.ts +32 -32
- package/dist/node-esm/src/implementation/metadata.d.ts +40 -40
- package/dist/node-esm/src/implementation/observer.d.ts +47 -47
- package/dist/node-esm/src/implementation/path.d.ts +31 -31
- package/dist/node-esm/src/implementation/request.d.ts +47 -47
- package/dist/node-esm/src/implementation/requestinfo.d.ts +73 -73
- package/dist/node-esm/src/implementation/requests.d.ts +84 -84
- package/dist/node-esm/src/implementation/string.d.ts +73 -73
- package/dist/node-esm/src/implementation/taskenums.d.ts +77 -77
- package/dist/node-esm/src/implementation/type.d.ts +23 -23
- package/dist/node-esm/src/implementation/url.d.ts +22 -22
- package/dist/node-esm/src/implementation/utils.d.ts +23 -23
- package/dist/node-esm/src/index.d.ts +7 -7
- package/dist/node-esm/src/index.node.d.ts +7 -7
- package/dist/node-esm/src/list.d.ts +41 -41
- package/dist/node-esm/src/metadata.d.ts +27 -27
- package/dist/node-esm/src/platform/base64.d.ts +20 -20
- package/dist/node-esm/src/platform/browser/base64.d.ts +19 -19
- package/dist/node-esm/src/platform/browser/connection.d.ts +55 -55
- package/dist/node-esm/src/platform/connection.d.ts +22 -22
- package/dist/node-esm/src/platform/node/base64.d.ts +19 -19
- package/dist/node-esm/src/platform/node/connection.d.ts +58 -59
- package/dist/node-esm/src/public-types.d.ts +424 -424
- package/dist/node-esm/src/reference.d.ts +208 -208
- package/dist/node-esm/src/service.d.ts +130 -130
- package/dist/node-esm/src/task.d.ts +148 -148
- package/dist/node-esm/test/browser/blob.test.d.ts +17 -17
- package/dist/node-esm/test/browser/connection.test.d.ts +17 -17
- package/dist/node-esm/test/browser/string.browser.test.d.ts +17 -17
- package/dist/node-esm/test/integration/integration.test.d.ts +24 -24
- package/dist/node-esm/test/node/connection.test.d.ts +17 -17
- package/dist/node-esm/test/node/stream.test.d.ts +17 -17
- package/dist/node-esm/test/unit/connection.d.ts +47 -47
- package/dist/node-esm/test/unit/index.test.d.ts +4 -4
- package/dist/node-esm/test/unit/location.test.d.ts +1 -1
- package/dist/node-esm/test/unit/reference.test.d.ts +1 -1
- package/dist/node-esm/test/unit/request.test.d.ts +1 -1
- package/dist/node-esm/test/unit/requests.test.d.ts +1 -1
- package/dist/node-esm/test/unit/service.test.d.ts +1 -1
- package/dist/node-esm/test/unit/string.test.d.ts +1 -1
- package/dist/node-esm/test/unit/task.test.d.ts +1 -1
- package/dist/node-esm/test/unit/testshared.d.ts +60 -60
- package/dist/node-esm/test/unit/utils.test.d.ts +17 -17
- package/dist/src/api.browser.d.ts +47 -47
- package/dist/src/api.d.ts +200 -200
- package/dist/src/api.node.d.ts +47 -47
- package/dist/src/constants.d.ts +20 -20
- package/dist/src/implementation/async.d.ts +22 -22
- package/dist/src/implementation/backoff.d.ts +43 -43
- package/dist/src/implementation/blob.d.ts +34 -34
- package/dist/src/implementation/connection.d.ts +56 -56
- package/dist/src/implementation/constants.d.ts +48 -48
- package/dist/src/implementation/error.d.ts +126 -126
- package/dist/src/implementation/failrequest.d.ts +29 -29
- package/dist/src/implementation/fs.d.ts +17 -17
- package/dist/src/implementation/json.d.ts +7 -7
- package/dist/src/implementation/list.d.ts +19 -19
- package/dist/src/implementation/location.d.ts +32 -32
- package/dist/src/implementation/metadata.d.ts +40 -40
- package/dist/src/implementation/observer.d.ts +47 -47
- package/dist/src/implementation/path.d.ts +31 -31
- package/dist/src/implementation/request.d.ts +47 -47
- package/dist/src/implementation/requestinfo.d.ts +73 -73
- package/dist/src/implementation/requests.d.ts +84 -84
- package/dist/src/implementation/string.d.ts +73 -73
- package/dist/src/implementation/taskenums.d.ts +77 -77
- package/dist/src/implementation/type.d.ts +23 -23
- package/dist/src/implementation/url.d.ts +22 -22
- package/dist/src/implementation/utils.d.ts +23 -23
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.node.d.ts +7 -7
- package/dist/src/list.d.ts +41 -41
- package/dist/src/metadata.d.ts +27 -27
- package/dist/src/platform/base64.d.ts +20 -20
- package/dist/src/platform/browser/base64.d.ts +19 -19
- package/dist/src/platform/browser/connection.d.ts +55 -55
- package/dist/src/platform/connection.d.ts +22 -22
- package/dist/src/platform/node/base64.d.ts +19 -19
- package/dist/src/platform/node/connection.d.ts +58 -59
- package/dist/src/public-types.d.ts +424 -424
- package/dist/src/reference.d.ts +208 -208
- package/dist/src/service.d.ts +130 -130
- package/dist/src/task.d.ts +148 -148
- package/dist/test/browser/blob.test.d.ts +17 -17
- package/dist/test/browser/connection.test.d.ts +17 -17
- package/dist/test/browser/string.browser.test.d.ts +17 -17
- package/dist/test/integration/integration.test.d.ts +24 -24
- package/dist/test/node/connection.test.d.ts +17 -17
- package/dist/test/node/stream.test.d.ts +17 -17
- package/dist/test/unit/connection.d.ts +47 -47
- package/dist/test/unit/index.test.d.ts +4 -4
- package/dist/test/unit/location.test.d.ts +1 -1
- package/dist/test/unit/reference.test.d.ts +1 -1
- package/dist/test/unit/request.test.d.ts +1 -1
- package/dist/test/unit/requests.test.d.ts +1 -1
- package/dist/test/unit/service.test.d.ts +1 -1
- package/dist/test/unit/string.test.d.ts +1 -1
- package/dist/test/unit/task.test.d.ts +1 -1
- package/dist/test/unit/testshared.d.ts +60 -60
- package/dist/test/unit/utils.test.d.ts +17 -17
- package/package.json +6 -6
|
@@ -1,126 +1,126 @@
|
|
|
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 { FirebaseError } from '@firebase/util';
|
|
18
|
-
/**
|
|
19
|
-
* An error returned by the Firebase Storage SDK.
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export declare class StorageError extends FirebaseError {
|
|
23
|
-
private status_;
|
|
24
|
-
private readonly _baseMessage;
|
|
25
|
-
/**
|
|
26
|
-
* Stores custom error data unique to the `StorageError`.
|
|
27
|
-
*/
|
|
28
|
-
customData: {
|
|
29
|
-
serverResponse: string | null;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and
|
|
33
|
-
* added to the end of the message.
|
|
34
|
-
* @param message - Error message.
|
|
35
|
-
* @param status_ - Corresponding HTTP Status Code
|
|
36
|
-
*/
|
|
37
|
-
constructor(code: StorageErrorCode, message: string, status_?: number);
|
|
38
|
-
get status(): number;
|
|
39
|
-
set status(status: number);
|
|
40
|
-
/**
|
|
41
|
-
* Compares a `StorageErrorCode` against this error's code, filtering out the prefix.
|
|
42
|
-
*/
|
|
43
|
-
_codeEquals(code: StorageErrorCode): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Optional response message that was added by the server.
|
|
46
|
-
*/
|
|
47
|
-
get serverResponse(): null | string;
|
|
48
|
-
set serverResponse(serverResponse: string | null);
|
|
49
|
-
}
|
|
50
|
-
export declare const errors: {};
|
|
51
|
-
/**
|
|
52
|
-
* @public
|
|
53
|
-
* Error codes that can be attached to `StorageError` objects.
|
|
54
|
-
*/
|
|
55
|
-
export declare enum StorageErrorCode {
|
|
56
|
-
UNKNOWN = "unknown",
|
|
57
|
-
OBJECT_NOT_FOUND = "object-not-found",
|
|
58
|
-
BUCKET_NOT_FOUND = "bucket-not-found",
|
|
59
|
-
PROJECT_NOT_FOUND = "project-not-found",
|
|
60
|
-
QUOTA_EXCEEDED = "quota-exceeded",
|
|
61
|
-
UNAUTHENTICATED = "unauthenticated",
|
|
62
|
-
UNAUTHORIZED = "unauthorized",
|
|
63
|
-
UNAUTHORIZED_APP = "unauthorized-app",
|
|
64
|
-
RETRY_LIMIT_EXCEEDED = "retry-limit-exceeded",
|
|
65
|
-
INVALID_CHECKSUM = "invalid-checksum",
|
|
66
|
-
CANCELED = "canceled",
|
|
67
|
-
INVALID_EVENT_NAME = "invalid-event-name",
|
|
68
|
-
INVALID_URL = "invalid-url",
|
|
69
|
-
INVALID_DEFAULT_BUCKET = "invalid-default-bucket",
|
|
70
|
-
NO_DEFAULT_BUCKET = "no-default-bucket",
|
|
71
|
-
CANNOT_SLICE_BLOB = "cannot-slice-blob",
|
|
72
|
-
SERVER_FILE_WRONG_SIZE = "server-file-wrong-size",
|
|
73
|
-
NO_DOWNLOAD_URL = "no-download-url",
|
|
74
|
-
INVALID_ARGUMENT = "invalid-argument",
|
|
75
|
-
INVALID_ARGUMENT_COUNT = "invalid-argument-count",
|
|
76
|
-
APP_DELETED = "app-deleted",
|
|
77
|
-
INVALID_ROOT_OPERATION = "invalid-root-operation",
|
|
78
|
-
INVALID_FORMAT = "invalid-format",
|
|
79
|
-
INTERNAL_ERROR = "internal-error",
|
|
80
|
-
UNSUPPORTED_ENVIRONMENT = "unsupported-environment"
|
|
81
|
-
}
|
|
82
|
-
export declare function prependCode(code: StorageErrorCode): string;
|
|
83
|
-
export declare function unknown(): StorageError;
|
|
84
|
-
export declare function objectNotFound(path: string): StorageError;
|
|
85
|
-
export declare function bucketNotFound(bucket: string): StorageError;
|
|
86
|
-
export declare function projectNotFound(project: string): StorageError;
|
|
87
|
-
export declare function quotaExceeded(bucket: string): StorageError;
|
|
88
|
-
export declare function unauthenticated(): StorageError;
|
|
89
|
-
export declare function unauthorizedApp(): StorageError;
|
|
90
|
-
export declare function unauthorized(path: string): StorageError;
|
|
91
|
-
export declare function retryLimitExceeded(): StorageError;
|
|
92
|
-
export declare function invalidChecksum(path: string, checksum: string, calculated: string): StorageError;
|
|
93
|
-
export declare function canceled(): StorageError;
|
|
94
|
-
export declare function invalidEventName(name: string): StorageError;
|
|
95
|
-
export declare function invalidUrl(url: string): StorageError;
|
|
96
|
-
export declare function invalidDefaultBucket(bucket: string): StorageError;
|
|
97
|
-
export declare function noDefaultBucket(): StorageError;
|
|
98
|
-
export declare function cannotSliceBlob(): StorageError;
|
|
99
|
-
export declare function serverFileWrongSize(): StorageError;
|
|
100
|
-
export declare function noDownloadURL(): StorageError;
|
|
101
|
-
export declare function missingPolyFill(polyFill: string): StorageError;
|
|
102
|
-
/**
|
|
103
|
-
* @internal
|
|
104
|
-
*/
|
|
105
|
-
export declare function invalidArgument(message: string): StorageError;
|
|
106
|
-
export declare function invalidArgumentCount(argMin: number, argMax: number, fnName: string, real: number): StorageError;
|
|
107
|
-
export declare function appDeleted(): StorageError;
|
|
108
|
-
/**
|
|
109
|
-
* @param name - The name of the operation that was invalid.
|
|
110
|
-
*
|
|
111
|
-
* @internal
|
|
112
|
-
*/
|
|
113
|
-
export declare function invalidRootOperation(name: string): StorageError;
|
|
114
|
-
/**
|
|
115
|
-
* @param format - The format that was not valid.
|
|
116
|
-
* @param message - A message describing the format violation.
|
|
117
|
-
*/
|
|
118
|
-
export declare function invalidFormat(format: string, message: string): StorageError;
|
|
119
|
-
/**
|
|
120
|
-
* @param message - A message describing the internal error.
|
|
121
|
-
*/
|
|
122
|
-
export declare function unsupportedEnvironment(message: string): StorageError;
|
|
123
|
-
/**
|
|
124
|
-
* @param message - A message describing the internal error.
|
|
125
|
-
*/
|
|
126
|
-
export declare function internalError(message: string): StorageError;
|
|
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 { FirebaseError } from '@firebase/util';
|
|
18
|
+
/**
|
|
19
|
+
* An error returned by the Firebase Storage SDK.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare class StorageError extends FirebaseError {
|
|
23
|
+
private status_;
|
|
24
|
+
private readonly _baseMessage;
|
|
25
|
+
/**
|
|
26
|
+
* Stores custom error data unique to the `StorageError`.
|
|
27
|
+
*/
|
|
28
|
+
customData: {
|
|
29
|
+
serverResponse: string | null;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and
|
|
33
|
+
* added to the end of the message.
|
|
34
|
+
* @param message - Error message.
|
|
35
|
+
* @param status_ - Corresponding HTTP Status Code
|
|
36
|
+
*/
|
|
37
|
+
constructor(code: StorageErrorCode, message: string, status_?: number);
|
|
38
|
+
get status(): number;
|
|
39
|
+
set status(status: number);
|
|
40
|
+
/**
|
|
41
|
+
* Compares a `StorageErrorCode` against this error's code, filtering out the prefix.
|
|
42
|
+
*/
|
|
43
|
+
_codeEquals(code: StorageErrorCode): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Optional response message that was added by the server.
|
|
46
|
+
*/
|
|
47
|
+
get serverResponse(): null | string;
|
|
48
|
+
set serverResponse(serverResponse: string | null);
|
|
49
|
+
}
|
|
50
|
+
export declare const errors: {};
|
|
51
|
+
/**
|
|
52
|
+
* @public
|
|
53
|
+
* Error codes that can be attached to `StorageError` objects.
|
|
54
|
+
*/
|
|
55
|
+
export declare enum StorageErrorCode {
|
|
56
|
+
UNKNOWN = "unknown",
|
|
57
|
+
OBJECT_NOT_FOUND = "object-not-found",
|
|
58
|
+
BUCKET_NOT_FOUND = "bucket-not-found",
|
|
59
|
+
PROJECT_NOT_FOUND = "project-not-found",
|
|
60
|
+
QUOTA_EXCEEDED = "quota-exceeded",
|
|
61
|
+
UNAUTHENTICATED = "unauthenticated",
|
|
62
|
+
UNAUTHORIZED = "unauthorized",
|
|
63
|
+
UNAUTHORIZED_APP = "unauthorized-app",
|
|
64
|
+
RETRY_LIMIT_EXCEEDED = "retry-limit-exceeded",
|
|
65
|
+
INVALID_CHECKSUM = "invalid-checksum",
|
|
66
|
+
CANCELED = "canceled",
|
|
67
|
+
INVALID_EVENT_NAME = "invalid-event-name",
|
|
68
|
+
INVALID_URL = "invalid-url",
|
|
69
|
+
INVALID_DEFAULT_BUCKET = "invalid-default-bucket",
|
|
70
|
+
NO_DEFAULT_BUCKET = "no-default-bucket",
|
|
71
|
+
CANNOT_SLICE_BLOB = "cannot-slice-blob",
|
|
72
|
+
SERVER_FILE_WRONG_SIZE = "server-file-wrong-size",
|
|
73
|
+
NO_DOWNLOAD_URL = "no-download-url",
|
|
74
|
+
INVALID_ARGUMENT = "invalid-argument",
|
|
75
|
+
INVALID_ARGUMENT_COUNT = "invalid-argument-count",
|
|
76
|
+
APP_DELETED = "app-deleted",
|
|
77
|
+
INVALID_ROOT_OPERATION = "invalid-root-operation",
|
|
78
|
+
INVALID_FORMAT = "invalid-format",
|
|
79
|
+
INTERNAL_ERROR = "internal-error",
|
|
80
|
+
UNSUPPORTED_ENVIRONMENT = "unsupported-environment"
|
|
81
|
+
}
|
|
82
|
+
export declare function prependCode(code: StorageErrorCode): string;
|
|
83
|
+
export declare function unknown(): StorageError;
|
|
84
|
+
export declare function objectNotFound(path: string): StorageError;
|
|
85
|
+
export declare function bucketNotFound(bucket: string): StorageError;
|
|
86
|
+
export declare function projectNotFound(project: string): StorageError;
|
|
87
|
+
export declare function quotaExceeded(bucket: string): StorageError;
|
|
88
|
+
export declare function unauthenticated(): StorageError;
|
|
89
|
+
export declare function unauthorizedApp(): StorageError;
|
|
90
|
+
export declare function unauthorized(path: string): StorageError;
|
|
91
|
+
export declare function retryLimitExceeded(): StorageError;
|
|
92
|
+
export declare function invalidChecksum(path: string, checksum: string, calculated: string): StorageError;
|
|
93
|
+
export declare function canceled(): StorageError;
|
|
94
|
+
export declare function invalidEventName(name: string): StorageError;
|
|
95
|
+
export declare function invalidUrl(url: string): StorageError;
|
|
96
|
+
export declare function invalidDefaultBucket(bucket: string): StorageError;
|
|
97
|
+
export declare function noDefaultBucket(): StorageError;
|
|
98
|
+
export declare function cannotSliceBlob(): StorageError;
|
|
99
|
+
export declare function serverFileWrongSize(): StorageError;
|
|
100
|
+
export declare function noDownloadURL(): StorageError;
|
|
101
|
+
export declare function missingPolyFill(polyFill: string): StorageError;
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
export declare function invalidArgument(message: string): StorageError;
|
|
106
|
+
export declare function invalidArgumentCount(argMin: number, argMax: number, fnName: string, real: number): StorageError;
|
|
107
|
+
export declare function appDeleted(): StorageError;
|
|
108
|
+
/**
|
|
109
|
+
* @param name - The name of the operation that was invalid.
|
|
110
|
+
*
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
export declare function invalidRootOperation(name: string): StorageError;
|
|
114
|
+
/**
|
|
115
|
+
* @param format - The format that was not valid.
|
|
116
|
+
* @param message - A message describing the format violation.
|
|
117
|
+
*/
|
|
118
|
+
export declare function invalidFormat(format: string, message: string): StorageError;
|
|
119
|
+
/**
|
|
120
|
+
* @param message - A message describing the internal error.
|
|
121
|
+
*/
|
|
122
|
+
export declare function unsupportedEnvironment(message: string): StorageError;
|
|
123
|
+
/**
|
|
124
|
+
* @param message - A message describing the internal error.
|
|
125
|
+
*/
|
|
126
|
+
export declare function internalError(message: string): StorageError;
|
|
@@ -1,29 +1,29 @@
|
|
|
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 { StorageError } from './error';
|
|
18
|
-
import { Request } from './request';
|
|
19
|
-
/**
|
|
20
|
-
* A request whose promise always fails.
|
|
21
|
-
*/
|
|
22
|
-
export declare class FailRequest<T> implements Request<T> {
|
|
23
|
-
promise_: Promise<T>;
|
|
24
|
-
constructor(error: StorageError);
|
|
25
|
-
/** @inheritDoc */
|
|
26
|
-
getPromise(): Promise<T>;
|
|
27
|
-
/** @inheritDoc */
|
|
28
|
-
cancel(_appDelete?: boolean): void;
|
|
29
|
-
}
|
|
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 { StorageError } from './error';
|
|
18
|
+
import { Request } from './request';
|
|
19
|
+
/**
|
|
20
|
+
* A request whose promise always fails.
|
|
21
|
+
*/
|
|
22
|
+
export declare class FailRequest<T> implements Request<T> {
|
|
23
|
+
promise_: Promise<T>;
|
|
24
|
+
constructor(error: StorageError);
|
|
25
|
+
/** @inheritDoc */
|
|
26
|
+
getPromise(): Promise<T>;
|
|
27
|
+
/** @inheritDoc */
|
|
28
|
+
cancel(_appDelete?: boolean): void;
|
|
29
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Concatenates one or more values together and converts them to a Blob.
|
|
3
|
-
*
|
|
4
|
-
* @param args The values that will make up the resulting blob.
|
|
5
|
-
* @return The blob.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getBlob(...args: Array<string | Blob | ArrayBuffer>): Blob;
|
|
8
|
-
/**
|
|
9
|
-
* Slices the blob. The returned blob contains data from the start byte
|
|
10
|
-
* (inclusive) till the end byte (exclusive). Negative indices cannot be used.
|
|
11
|
-
*
|
|
12
|
-
* @param blob The blob to be sliced.
|
|
13
|
-
* @param start Index of the starting byte.
|
|
14
|
-
* @param end Index of the ending byte.
|
|
15
|
-
* @return The blob slice or null if not supported.
|
|
16
|
-
*/
|
|
17
|
-
export declare function sliceBlob(blob: Blob, start: number, end: number): Blob | null;
|
|
1
|
+
/**
|
|
2
|
+
* Concatenates one or more values together and converts them to a Blob.
|
|
3
|
+
*
|
|
4
|
+
* @param args The values that will make up the resulting blob.
|
|
5
|
+
* @return The blob.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getBlob(...args: Array<string | Blob | ArrayBuffer>): Blob;
|
|
8
|
+
/**
|
|
9
|
+
* Slices the blob. The returned blob contains data from the start byte
|
|
10
|
+
* (inclusive) till the end byte (exclusive). Negative indices cannot be used.
|
|
11
|
+
*
|
|
12
|
+
* @param blob The blob to be sliced.
|
|
13
|
+
* @param start Index of the starting byte.
|
|
14
|
+
* @param end Index of the ending byte.
|
|
15
|
+
* @return The blob slice or null if not supported.
|
|
16
|
+
*/
|
|
17
|
+
export declare function sliceBlob(blob: Blob, start: number, end: number): Blob | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the Object resulting from parsing the given JSON, or null if the
|
|
3
|
-
* given string does not represent a JSON object.
|
|
4
|
-
*/
|
|
5
|
-
export declare function jsonObjectOrNull(s: string): {
|
|
6
|
-
[name: string]: unknown;
|
|
7
|
-
} | null;
|
|
1
|
+
/**
|
|
2
|
+
* Returns the Object resulting from parsing the given JSON, or null if the
|
|
3
|
+
* given string does not represent a JSON object.
|
|
4
|
+
*/
|
|
5
|
+
export declare function jsonObjectOrNull(s: string): {
|
|
6
|
+
[name: string]: unknown;
|
|
7
|
+
} | null;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 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 { ListResult } from '../list';
|
|
18
|
-
import { FirebaseStorageImpl } from '../service';
|
|
19
|
-
export declare function fromResponseString(service: FirebaseStorageImpl, bucket: string, resourceString: string): ListResult | null;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 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 { ListResult } from '../list';
|
|
18
|
+
import { FirebaseStorageImpl } from '../service';
|
|
19
|
+
export declare function fromResponseString(service: FirebaseStorageImpl, bucket: string, resourceString: string): ListResult | null;
|
|
@@ -1,32 +1,32 @@
|
|
|
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
|
-
* Firebase Storage location data.
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare class Location {
|
|
23
|
-
readonly bucket: string;
|
|
24
|
-
private path_;
|
|
25
|
-
constructor(bucket: string, path: string);
|
|
26
|
-
get path(): string;
|
|
27
|
-
get isRoot(): boolean;
|
|
28
|
-
fullServerUrl(): string;
|
|
29
|
-
bucketOnlyServerUrl(): string;
|
|
30
|
-
static makeFromBucketSpec(bucketString: string, host: string): Location;
|
|
31
|
-
static makeFromUrl(url: string, host: string): Location;
|
|
32
|
-
}
|
|
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
|
+
* Firebase Storage location data.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare class Location {
|
|
23
|
+
readonly bucket: string;
|
|
24
|
+
private path_;
|
|
25
|
+
constructor(bucket: string, path: string);
|
|
26
|
+
get path(): string;
|
|
27
|
+
get isRoot(): boolean;
|
|
28
|
+
fullServerUrl(): string;
|
|
29
|
+
bucketOnlyServerUrl(): string;
|
|
30
|
+
static makeFromBucketSpec(bucketString: string, host: string): Location;
|
|
31
|
+
static makeFromUrl(url: string, host: string): Location;
|
|
32
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
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 Documentation for the metadata format
|
|
19
|
-
*/
|
|
20
|
-
import { Metadata } from '../metadata';
|
|
21
|
-
import { FirebaseStorageImpl } from '../service';
|
|
22
|
-
export declare function noXform_<T>(metadata: Metadata, value: T): T;
|
|
23
|
-
declare class Mapping<T> {
|
|
24
|
-
server: string;
|
|
25
|
-
local: string;
|
|
26
|
-
writable: boolean;
|
|
27
|
-
xform: (p1: Metadata, p2?: T) => T | undefined;
|
|
28
|
-
constructor(server: string, local?: string | null, writable?: boolean, xform?: ((p1: Metadata, p2?: T) => T | undefined) | null);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Mappings };
|
|
32
|
-
export declare function xformPath(fullPath: string | undefined): string | undefined;
|
|
33
|
-
export declare function getMappings(): Mappings;
|
|
34
|
-
export declare function addRef(metadata: Metadata, service: FirebaseStorageImpl): void;
|
|
35
|
-
export declare function fromResource(service: FirebaseStorageImpl, resource: {
|
|
36
|
-
[name: string]: unknown;
|
|
37
|
-
}, mappings: Mappings): Metadata;
|
|
38
|
-
export declare function fromResourceString(service: FirebaseStorageImpl, resourceString: string, mappings: Mappings): Metadata | null;
|
|
39
|
-
export declare function downloadUrlFromResourceString(metadata: Metadata, resourceString: string, host: string, protocol: string): string | null;
|
|
40
|
-
export declare function toResourceString(metadata: Partial<Metadata>, mappings: Mappings): string;
|
|
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 Documentation for the metadata format
|
|
19
|
+
*/
|
|
20
|
+
import { Metadata } from '../metadata';
|
|
21
|
+
import { FirebaseStorageImpl } from '../service';
|
|
22
|
+
export declare function noXform_<T>(metadata: Metadata, value: T): T;
|
|
23
|
+
declare class Mapping<T> {
|
|
24
|
+
server: string;
|
|
25
|
+
local: string;
|
|
26
|
+
writable: boolean;
|
|
27
|
+
xform: (p1: Metadata, p2?: T) => T | undefined;
|
|
28
|
+
constructor(server: string, local?: string | null, writable?: boolean, xform?: ((p1: Metadata, p2?: T) => T | undefined) | null);
|
|
29
|
+
}
|
|
30
|
+
type Mappings = Array<Mapping<string> | Mapping<number>>;
|
|
31
|
+
export { Mappings };
|
|
32
|
+
export declare function xformPath(fullPath: string | undefined): string | undefined;
|
|
33
|
+
export declare function getMappings(): Mappings;
|
|
34
|
+
export declare function addRef(metadata: Metadata, service: FirebaseStorageImpl): void;
|
|
35
|
+
export declare function fromResource(service: FirebaseStorageImpl, resource: {
|
|
36
|
+
[name: string]: unknown;
|
|
37
|
+
}, mappings: Mappings): Metadata;
|
|
38
|
+
export declare function fromResourceString(service: FirebaseStorageImpl, resourceString: string, mappings: Mappings): Metadata | null;
|
|
39
|
+
export declare function downloadUrlFromResourceString(metadata: Metadata, resourceString: string, host: string, protocol: string): string | null;
|
|
40
|
+
export declare function toResourceString(metadata: Partial<Metadata>, mappings: Mappings): string;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { StorageError } from './error';
|
|
2
|
-
/**
|
|
3
|
-
* Function that is called once for each value in a stream of values.
|
|
4
|
-
*/
|
|
5
|
-
export
|
|
6
|
-
/**
|
|
7
|
-
* A function that is called with a `StorageError`
|
|
8
|
-
* if the event stream ends due to an error.
|
|
9
|
-
*/
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* A function that is called if the event stream ends normally.
|
|
13
|
-
*/
|
|
14
|
-
export
|
|
15
|
-
/**
|
|
16
|
-
* Unsubscribes from a stream.
|
|
17
|
-
*/
|
|
18
|
-
export
|
|
19
|
-
/**
|
|
20
|
-
* An observer identical to the `Observer` defined in packages/util except the
|
|
21
|
-
* error passed into the ErrorFn is specifically a `StorageError`.
|
|
22
|
-
*/
|
|
23
|
-
export interface StorageObserver<T> {
|
|
24
|
-
/**
|
|
25
|
-
* Function that is called once for each value in the event stream.
|
|
26
|
-
*/
|
|
27
|
-
next?: NextFn<T>;
|
|
28
|
-
/**
|
|
29
|
-
* A function that is called with a `StorageError`
|
|
30
|
-
* if the event stream ends due to an error.
|
|
31
|
-
*/
|
|
32
|
-
error?: ErrorFn;
|
|
33
|
-
/**
|
|
34
|
-
* A function that is called if the event stream ends normally.
|
|
35
|
-
*/
|
|
36
|
-
complete?: CompleteFn;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Subscribes to an event stream.
|
|
40
|
-
*/
|
|
41
|
-
export
|
|
42
|
-
export declare class Observer<T> implements StorageObserver<T> {
|
|
43
|
-
next?: NextFn<T>;
|
|
44
|
-
error?: ErrorFn;
|
|
45
|
-
complete?: CompleteFn;
|
|
46
|
-
constructor(nextOrObserver?: NextFn<T> | StorageObserver<T>, error?: ErrorFn, complete?: CompleteFn);
|
|
47
|
-
}
|
|
1
|
+
import { StorageError } from './error';
|
|
2
|
+
/**
|
|
3
|
+
* Function that is called once for each value in a stream of values.
|
|
4
|
+
*/
|
|
5
|
+
export type NextFn<T> = (value: T) => void;
|
|
6
|
+
/**
|
|
7
|
+
* A function that is called with a `StorageError`
|
|
8
|
+
* if the event stream ends due to an error.
|
|
9
|
+
*/
|
|
10
|
+
export type ErrorFn = (error: StorageError) => void;
|
|
11
|
+
/**
|
|
12
|
+
* A function that is called if the event stream ends normally.
|
|
13
|
+
*/
|
|
14
|
+
export type CompleteFn = () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Unsubscribes from a stream.
|
|
17
|
+
*/
|
|
18
|
+
export type Unsubscribe = () => void;
|
|
19
|
+
/**
|
|
20
|
+
* An observer identical to the `Observer` defined in packages/util except the
|
|
21
|
+
* error passed into the ErrorFn is specifically a `StorageError`.
|
|
22
|
+
*/
|
|
23
|
+
export interface StorageObserver<T> {
|
|
24
|
+
/**
|
|
25
|
+
* Function that is called once for each value in the event stream.
|
|
26
|
+
*/
|
|
27
|
+
next?: NextFn<T>;
|
|
28
|
+
/**
|
|
29
|
+
* A function that is called with a `StorageError`
|
|
30
|
+
* if the event stream ends due to an error.
|
|
31
|
+
*/
|
|
32
|
+
error?: ErrorFn;
|
|
33
|
+
/**
|
|
34
|
+
* A function that is called if the event stream ends normally.
|
|
35
|
+
*/
|
|
36
|
+
complete?: CompleteFn;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Subscribes to an event stream.
|
|
40
|
+
*/
|
|
41
|
+
export type Subscribe<T> = (next?: NextFn<T> | StorageObserver<T>, error?: ErrorFn, complete?: CompleteFn) => Unsubscribe;
|
|
42
|
+
export declare class Observer<T> implements StorageObserver<T> {
|
|
43
|
+
next?: NextFn<T>;
|
|
44
|
+
error?: ErrorFn;
|
|
45
|
+
complete?: CompleteFn;
|
|
46
|
+
constructor(nextOrObserver?: NextFn<T> | StorageObserver<T>, error?: ErrorFn, complete?: CompleteFn);
|
|
47
|
+
}
|