Firebase Update

This commit is contained in:
Lukas Nowy
2018-12-22 23:30:39 +01:00
parent befb44764d
commit acffe619b3
11523 changed files with 1614327 additions and 930246 deletions

View File

@ -0,0 +1,5 @@
# @firebase/storage
This is the Cloud Storage component of the Firebase JS SDK.
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
import * as types from '@firebase/storage-types';
export declare function registerStorage(instance: any): void;
/**
* Define extension behavior for `registerStorage`
*/
declare module '@firebase/app-types' {
interface FirebaseNamespace {
storage?: {
(app?: FirebaseApp): types.FirebaseStorage;
Storage: typeof types.FirebaseStorage;
StringFormat: {
BASE64: types.StringFormat;
BASE64URL: types.StringFormat;
DATA_URL: types.StringFormat;
RAW: types.StringFormat;
};
TaskEvent: {
STATE_CHANGED: types.TaskEvent;
};
TaskState: {
CANCELED: types.TaskState;
ERROR: types.TaskState;
PAUSED: types.TaskState;
RUNNING: types.TaskState;
SUCCESS: types.TaskState;
};
};
}
interface FirebaseApp {
storage?(storageBucket?: string): types.FirebaseStorage;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
/**
* @param name Name of the function.
* @param specs Argument specs.
* @param passed The actual arguments passed to the function.
* @throws {fbs.Error} If the arguments are invalid.
*/
export declare function validate(name: string, specs: ArgSpec[], passed: IArguments): void;
/**
* @struct
*/
export declare class ArgSpec {
validator: (p1: any) => void;
optional: boolean;
constructor(validator: (p1: any) => void, opt_optional?: boolean);
}
export declare function and_(v1: (p1: any) => void, v2: Function): (p1: any) => void;
export declare function stringSpec(opt_validator?: (p1: any) => void | null, opt_optional?: boolean): ArgSpec;
export declare function uploadDataSpec(): ArgSpec;
export declare function metadataSpec(opt_optional?: boolean): ArgSpec;
export declare function nonNegativeNumberSpec(): ArgSpec;
export declare function looseObjectSpec(opt_validator?: ((p1: any) => void) | null, opt_optional?: boolean): ArgSpec;
export declare function nullFunctionSpec(opt_optional?: boolean): ArgSpec;

View File

@ -0,0 +1,31 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Returns true if the object is contained in the array (compared with ===).
* @template T
*/
export declare function contains<T>(array: T[], elem: T): boolean;
/**
* Returns a shallow copy of the array or array-like object (e.g. arguments).
* @template T
*/
export declare function clone<T>(arraylike: T[]): T[];
/**
* Removes the given element from the given array, if it is contained.
* Directly modifies the passed-in array.
* @template T
*/
export declare function remove<T>(array: T[], elem: T): void;

View File

@ -0,0 +1,6 @@
/**
* Returns a function that invokes f with its arguments asynchronously as a
* microtask, i.e. as soon as possible after the current script returns back
* into browser code.
*/
export declare function async(f: Function): Function;

View File

@ -0,0 +1,70 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Reference } from '../reference';
import { Service } from '../service';
import { Location } from './location';
import { Request } from './request';
import { RequestInfo } from './requestinfo';
import { requestMaker } from './requestmaker';
import { XhrIoPool } from './xhriopool';
import { FirebaseApp } from '@firebase/app-types';
/**
* @param app If null, getAuthToken always resolves with null.
* @param service The storage service associated with this auth wrapper.
* Untyped to avoid circular type dependencies.
* @struct
*/
export declare class AuthWrapper {
private app_;
private bucket_;
/**
maker
*/
private storageRefMaker_;
private requestMaker_;
private pool_;
private service_;
private maxOperationRetryTime_;
private maxUploadRetryTime_;
private requestMap_;
private deleted_;
constructor(app: FirebaseApp | null, maker: (p1: AuthWrapper, p2: Location) => Reference, requestMaker: requestMaker, service: Service, pool: XhrIoPool);
private static extractBucket_(config);
getAuthToken(): Promise<string | null>;
bucket(): string | null;
/**
* The service associated with this auth wrapper. Untyped to avoid circular
* type dependencies.
*/
service(): Service;
/**
* Returns a new firebaseStorage.Reference object referencing this AuthWrapper
* at the given Location.
* @param loc The Location.
* @return Actually a firebaseStorage.Reference, typing not allowed
* because of circular dependency problems.
*/
makeStorageReference(loc: Location): Reference;
makeRequest<T>(requestInfo: RequestInfo<T>, authToken: string | null): Request<T>;
/**
* Stop running requests and prevent more from being created.
*/
deleteApp(): void;
maxUploadRetryTime(): number;
setMaxUploadRetryTime(time: number): void;
maxOperationRetryTime(): number;
setMaxOperationRetryTime(time: number): void;
}

View File

@ -0,0 +1,36 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Provides a method for running a function with exponential
* backoff.
*/
declare type id = (p1: boolean) => void;
export { id };
/**
* @param f May be invoked
* before the function returns.
* @param callback Get all the arguments passed to the function
* passed to f, including the initial boolean.
*/
export declare function start(f: (p1: (success: boolean, ...rest: any[]) => void, canceled: boolean) => void, callback: Function, timeout: number): id;
/**
* Stops the retry loop from repeating.
* If the function is currently "in between" retries, it is invoked immediately
* with the second parameter as "true". Otherwise, it will be invoked once more
* after the current invocation finishes iff the current invocation would have
* triggered another retry.
*/
export declare function stop(id: id): void;

View File

@ -0,0 +1,16 @@
/**
* @param opt_elideCopy If true, doesn't copy mutable input data
* (e.g. Uint8Arrays). Pass true only if you know the objects will not be
* modified after this blob's construction.
*/
export declare class FbsBlob {
private data_;
private size_;
private type_;
constructor(data: Blob | Uint8Array | ArrayBuffer, opt_elideCopy?: boolean);
size(): number;
type(): string;
slice(startByte: number, endByte: number): FbsBlob | null;
static getBlob(...var_args: (string | FbsBlob)[]): FbsBlob | null;
uploadData(): Blob | Uint8Array;
}

View File

@ -0,0 +1,53 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Constants used in the Firebase Storage library.
*/
/**
* Domain and scheme for API calls.
*/
export declare const domainBase: string;
/**
* Domain and scheme for object downloads.
*/
export declare const downloadBase: string;
/**
* Base URL for non-upload calls to the API.
*/
export declare const apiBaseUrl: string;
/**
* Base URL for upload calls to the API.
*/
export declare const apiUploadBaseUrl: string;
export declare function setDomainBase(domainBase: string): void;
export declare const configOption: string;
/**
* 1 minute
*/
export declare const shortMaxOperationRetryTime: number;
/**
* 2 minutes
*/
export declare const defaultMaxOperationRetryTime: number;
/**
* 10 minutes
*/
export declare const defaultMaxUploadRetryTime: number;
/**
* This is the value of Number.MIN_SAFE_INTEGER, which is not well supported
* enough for us to use it directly.
*/
export declare const minSafeInteger: number;

View File

@ -0,0 +1,79 @@
export declare class FirebaseStorageError implements Error {
private code_;
private message_;
private serverResponse_;
private name_;
constructor(code: Code, message: string);
codeProp(): string;
codeEquals(code: Code): boolean;
serverResponseProp(): string | null;
setServerResponseProp(serverResponse: string | null): void;
readonly name: string;
readonly code: string;
readonly message: string;
readonly serverResponse: null | string;
}
export declare const errors: {};
/**
* @enum {string}
*/
export declare type Code = string;
export declare const Code: {
UNKNOWN: string;
OBJECT_NOT_FOUND: string;
BUCKET_NOT_FOUND: string;
PROJECT_NOT_FOUND: string;
QUOTA_EXCEEDED: string;
UNAUTHENTICATED: string;
UNAUTHORIZED: string;
RETRY_LIMIT_EXCEEDED: string;
INVALID_CHECKSUM: string;
CANCELED: string;
INVALID_EVENT_NAME: string;
INVALID_URL: string;
INVALID_DEFAULT_BUCKET: string;
NO_DEFAULT_BUCKET: string;
CANNOT_SLICE_BLOB: string;
SERVER_FILE_WRONG_SIZE: string;
NO_DOWNLOAD_URL: string;
INVALID_ARGUMENT: string;
INVALID_ARGUMENT_COUNT: string;
APP_DELETED: string;
INVALID_ROOT_OPERATION: string;
INVALID_FORMAT: string;
INTERNAL_ERROR: string;
};
export declare function prependCode(code: Code): string;
export declare function unknown(): FirebaseStorageError;
export declare function objectNotFound(path: string): FirebaseStorageError;
export declare function bucketNotFound(bucket: string): FirebaseStorageError;
export declare function projectNotFound(project: string): FirebaseStorageError;
export declare function quotaExceeded(bucket: string): FirebaseStorageError;
export declare function unauthenticated(): FirebaseStorageError;
export declare function unauthorized(path: string): FirebaseStorageError;
export declare function retryLimitExceeded(): FirebaseStorageError;
export declare function invalidChecksum(path: string, checksum: string, calculated: string): FirebaseStorageError;
export declare function canceled(): FirebaseStorageError;
export declare function invalidEventName(name: string): FirebaseStorageError;
export declare function invalidUrl(url: string): FirebaseStorageError;
export declare function invalidDefaultBucket(bucket: string): FirebaseStorageError;
export declare function noDefaultBucket(): FirebaseStorageError;
export declare function cannotSliceBlob(): FirebaseStorageError;
export declare function serverFileWrongSize(): FirebaseStorageError;
export declare function noDownloadURL(): FirebaseStorageError;
export declare function invalidArgument(index: number, fnName: string, message: string): FirebaseStorageError;
export declare function invalidArgumentCount(argMin: number, argMax: number, fnName: string, real: number): FirebaseStorageError;
export declare function appDeleted(): FirebaseStorageError;
/**
* @param name The name of the operation that was invalid.
*/
export declare function invalidRootOperation(name: string): FirebaseStorageError;
/**
* @param format The format that was not valid.
* @param message A message describing the format violation.
*/
export declare function invalidFormat(format: string, message: string): FirebaseStorageError;
/**
* @param message A message describing the internal error.
*/
export declare function internalError(message: string): FirebaseStorageError;

View File

@ -0,0 +1,30 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseStorageError } from './error';
import { Request } from './request';
/**
* A request whose promise always fails.
* @struct
* @template T
*/
export declare class FailRequest<T> implements Request<T> {
promise_: Promise<T>;
constructor(error: FirebaseStorageError);
/** @inheritDoc */
getPromise(): Promise<T>;
/** @inheritDoc */
cancel(appDelete?: boolean): void;
}

View File

@ -0,0 +1,17 @@
/**
* Concatenates one or more values together and converts them to a Blob.
*
* @param var_args The values that will make up the resulting blob.
* @return The blob.
*/
export declare function getBlob(...var_args: (string | Blob | ArrayBuffer)[]): Blob;
/**
* Slices the blob. The returned blob contains data from the start byte
* (inclusive) till the end byte (exclusive). Negative indices cannot be used.
*
* @param blob The blob to be sliced.
* @param start Index of the starting byte.
* @param end Index of the ending byte.
* @return The blob slice or null if not supported.
*/
export declare function sliceBlob(blob: Blob, start: number, end: number): Blob | null;

View File

@ -0,0 +1,7 @@
/**
* Returns the Object resulting from parsing the given JSON, or null if the
* given string does not represent a JSON object.
*/
export declare function jsonObjectOrNull(s: string): {
[name: string]: any;
} | null;

View File

@ -0,0 +1,13 @@
/**
* @struct
*/
export declare class Location {
readonly bucket: string;
private path_;
constructor(bucket: string, path: string);
readonly path: string;
fullServerUrl(): string;
bucketOnlyServerUrl(): string;
static makeFromBucketSpec(bucketString: string): Location;
static makeFromUrl(url: string): Location;
}

View File

@ -0,0 +1,43 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Documentation for the metadata format
*/
import { Metadata } from '../metadata';
import { AuthWrapper } from './authwrapper';
export declare function noXform_(metadata: Metadata, value: any): any;
/**
* @struct
*/
export declare class Mapping {
server: string;
local: string;
writable: boolean;
xform: (p1: Metadata, p2: any) => any;
constructor(server: string, opt_local?: string | null, opt_writable?: boolean, opt_xform?: (p1: Metadata, p2: any) => any | null);
}
declare type Mappings = Mapping[];
export { Mappings };
export declare function xformPath(fullPath: any): string;
export declare function getMappings(): Mappings;
export declare function addRef(metadata: Metadata, authWrapper: AuthWrapper): void;
export declare function fromResource(authWrapper: AuthWrapper, resource: {
[name: string]: any;
}, mappings: Mappings): Metadata;
export declare function fromResourceString(authWrapper: AuthWrapper, resourceString: string, mappings: Mappings): Metadata | null;
export declare function downloadUrlFromResourceString(metadata: Metadata, resourceString: string): string | null;
export declare function toResourceString(metadata: Metadata, mappings: Mappings): string;
export declare function metadataValidator(p: any): void;

View File

@ -0,0 +1,25 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Contains methods for working with objects.
*/
export declare function contains(obj: Object, prop: string): boolean;
export declare function forEach<T>(obj: {
[key: string]: T;
}, f: (p1: string, p2: T) => void): void;
export declare function clone<T>(obj?: {
[key: string]: any;
} | null): T;

View File

@ -0,0 +1,19 @@
declare type NextFn<T> = (value: T) => void;
declare type ErrorFn = (error: Error) => void;
declare type CompleteFn = () => void;
declare type Unsubscribe = () => void;
declare type Subscribe<T> = (next: NextFn<T> | {
[name: string]: string | null;
}, error?: ErrorFn, complete?: CompleteFn) => Unsubscribe;
export { NextFn, ErrorFn, CompleteFn, Unsubscribe, Subscribe };
/**
* @struct
*/
export declare class Observer<T> {
next: NextFn<T> | null;
error: ErrorFn | null;
complete: CompleteFn | null;
constructor(nextOrObserver: NextFn<T> | {
[name: string]: string | null;
} | null, opt_error?: ErrorFn | null, opt_complete?: CompleteFn | null);
}

View File

@ -0,0 +1,30 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Contains helper methods for manipulating paths.
*/
/**
* @return Null if the path is already at the root.
*/
export declare function parent(path: string): string | null;
export declare function child(path: string, childPath: string): string;
/**
* Returns the last component of a path.
* '/foo/bar' -> 'bar'
* '/foo/bar/baz/' -> 'baz/'
* '/a' -> 'a'
*/
export declare function lastComponent(path: string): string;

View File

@ -0,0 +1,30 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Implements the promise abstraction interface for external
* (public SDK) packaging, which just passes through to the firebase-app impl.
*/
/**
* @template T
* @param {function((function(T): void),
* (function(!Error): void))} resolver
*/
export declare function make<T>(resolver: (p1: (p1: T) => void, p2: (p1: Error) => void) => void): Promise<T>;
/**
* @template T
*/
export declare function resolve<T>(value: T): Promise<T>;
export declare function reject<T>(error: Error): Promise<T>;

View File

@ -0,0 +1,37 @@
import { RequestInfo } from './requestinfo';
import { Headers, XhrIo } from './xhrio';
import { XhrIoPool } from './xhriopool';
/**
* @template T
*/
export interface Request<T> {
getPromise(): Promise<T>;
/**
* Cancels the request. IMPORTANT: the promise may still be resolved with an
* appropriate value (if the request is finished before you call this method,
* but the promise has not yet been resolved), so don't just assume it will be
* rejected if you call this function.
* @param appDelete True if the cancelation came from the app being deleted.
*/
cancel(appDelete?: boolean): void;
}
/**
* A collection of information about the result of a network request.
* @param opt_canceled Defaults to false.
* @struct
*/
export declare class RequestEndStatus {
wasSuccessCode: boolean;
xhr: XhrIo | null;
/**
* True if the request was canceled.
*/
canceled: boolean;
constructor(wasSuccessCode: boolean, xhr: XhrIo | null, opt_canceled?: boolean);
}
export declare function addAuthHeader_(headers: Headers, authToken: string | null): void;
export declare function addVersionHeader_(headers: Headers): void;
/**
* @template T
*/
export declare function makeRequest<T>(requestInfo: RequestInfo<T>, authToken: string | null, pool: XhrIoPool): Request<T>;

View File

@ -0,0 +1,53 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseStorageError } from './error';
import { Headers, XhrIo } from './xhrio';
export declare type UrlParams = {
[name: string]: string;
};
export declare class RequestInfo<T> {
url: string;
method: string;
/**
* Returns the value with which to resolve the request's promise. Only called
* if the request is successful. Throw from this function to reject the
* returned Request's promise with the thrown error.
* Note: The XhrIo passed to this function may be reused after this callback
* returns. Do not keep a reference to it in any way.
*/
handler: (p1: XhrIo, p2: string) => T;
timeout: number;
urlParams: UrlParams;
headers: Headers;
body: Blob | string | Uint8Array | null;
errorHandler: ((p1: XhrIo, p2: FirebaseStorageError) => FirebaseStorageError) | null;
/**
* Called with the current number of bytes uploaded and total size (-1 if not
* computable) of the request body (i.e. used to report upload progress).
*/
progressCallback: ((p1: number, p2: number) => void) | null;
successCodes: number[];
additionalRetryCodes: number[];
constructor(url: string, method: string,
/**
* Returns the value with which to resolve the request's promise. Only called
* if the request is successful. Throw from this function to reject the
* returned Request's promise with the thrown error.
* Note: The XhrIo passed to this function may be reused after this callback
* returns. Do not keep a reference to it in any way.
*/
handler: (p1: XhrIo, p2: string) => T, timeout: number);
}

View File

@ -0,0 +1,20 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Request } from './request';
import { RequestInfo } from './requestinfo';
import { XhrIoPool } from './xhriopool';
declare type requestMaker = <T>(requestInfo: RequestInfo<T>, authToken: string | null, pool: XhrIoPool) => Request<T>;
export { requestMaker };

View File

@ -0,0 +1,19 @@
import { Request } from './request';
/**
* @struct
*/
export declare class RequestMap {
private map_;
private id_;
constructor();
/**
* Registers the given request with this map.
* The request is unregistered when it completes.
* @param r The request to register.
*/
addRequest(r: Request<any>): void;
/**
* Cancels all registered requests.
*/
clear(): void;
}

View File

@ -0,0 +1,77 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Defines methods for interacting with the network.
*/
import { Metadata } from '../metadata';
import { AuthWrapper } from './authwrapper';
import { FbsBlob } from './blob';
import { FirebaseStorageError } from './error';
import { Location } from './location';
import * as MetadataUtils from './metadata';
import { RequestInfo } from './requestinfo';
import { XhrIo } from './xhrio';
/**
* Throws the UNKNOWN FirebaseStorageError if cndn is false.
*/
export declare function handlerCheck(cndn: boolean): void;
export declare function metadataHandler(authWrapper: AuthWrapper, mappings: MetadataUtils.Mappings): (p1: XhrIo, p2: string) => Metadata;
export declare function downloadUrlHandler(authWrapper: AuthWrapper, mappings: MetadataUtils.Mappings): (p1: XhrIo, p2: string) => string;
export declare function sharedErrorHandler(location: Location): (p1: XhrIo, p2: FirebaseStorageError) => FirebaseStorageError;
export declare function objectErrorHandler(location: Location): (p1: XhrIo, p2: FirebaseStorageError) => FirebaseStorageError;
export declare function getMetadata(authWrapper: AuthWrapper, location: Location, mappings: MetadataUtils.Mappings): RequestInfo<Metadata>;
export declare function getDownloadUrl(authWrapper: AuthWrapper, location: Location, mappings: MetadataUtils.Mappings): RequestInfo<string | null>;
export declare function updateMetadata(authWrapper: AuthWrapper, location: Location, metadata: Metadata, mappings: MetadataUtils.Mappings): RequestInfo<Metadata>;
export declare function deleteObject(authWrapper: AuthWrapper, location: Location): RequestInfo<void>;
export declare function determineContentType_(metadata: Metadata | null, blob: FbsBlob | null): string;
export declare function metadataForUpload_(location: Location, blob: FbsBlob, opt_metadata?: Metadata | null): Metadata;
export declare function multipartUpload(authWrapper: AuthWrapper, location: Location, mappings: MetadataUtils.Mappings, blob: FbsBlob, opt_metadata?: Metadata | null): RequestInfo<Metadata>;
/**
* @param current The number of bytes that have been uploaded so far.
* @param total The total number of bytes in the upload.
* @param opt_finalized True if the server has finished the upload.
* @param opt_metadata The upload metadata, should
* only be passed if opt_finalized is true.
* @struct
*/
export declare class ResumableUploadStatus {
current: number;
total: number;
finalized: boolean;
metadata: Metadata | null;
constructor(current: number, total: number, finalized?: boolean, metadata?: Metadata | null);
}
export declare function checkResumeHeader_(xhr: XhrIo, opt_allowed?: string[]): string;
export declare function createResumableUpload(authWrapper: AuthWrapper, location: Location, mappings: MetadataUtils.Mappings, blob: FbsBlob, opt_metadata?: Metadata | null): RequestInfo<string>;
/**
* @param url From a call to fbs.requests.createResumableUpload.
*/
export declare function getResumableUploadStatus(authWrapper: AuthWrapper, location: Location, url: string, blob: FbsBlob): RequestInfo<ResumableUploadStatus>;
/**
* Any uploads via the resumable upload API must transfer a number of bytes
* that is a multiple of this number.
*/
export declare const resumableUploadChunkSize: number;
/**
* @param url From a call to fbs.requests.createResumableUpload.
* @param chunkSize Number of bytes to upload.
* @param opt_status The previous status.
* If not passed or null, we start from the beginning.
* @throws fbs.Error If the upload is already complete, the passed in status
* has a final size inconsistent with the blob, or the blob cannot be sliced
* for upload.
*/
export declare function continueResumableUpload(location: Location, authWrapper: AuthWrapper, url: string, blob: FbsBlob, chunkSize: number, mappings: MetadataUtils.Mappings, opt_status?: ResumableUploadStatus | null, opt_progressCallback?: ((p1: number, p2: number) => void) | null): RequestInfo<ResumableUploadStatus>;

View File

@ -0,0 +1,25 @@
/**
* @enum {string}
*/
export declare type StringFormat = string;
export declare const StringFormat: {
RAW: string;
BASE64: string;
BASE64URL: string;
DATA_URL: string;
};
export declare function formatValidator(stringFormat: string): void;
/**
* @struct
*/
export declare class StringData {
data: Uint8Array;
contentType: string | null;
constructor(data: Uint8Array, opt_contentType?: string | null);
}
export declare function dataFromString(format: StringFormat, string: string): StringData;
export declare function utf8Bytes_(string: string): Uint8Array;
export declare function percentEncodedBytes_(string: string): Uint8Array;
export declare function base64Bytes_(format: StringFormat, string: string): Uint8Array;
export declare function dataURLBytes_(string: string): Uint8Array;
export declare function dataURLContentType_(string: string): string | null;

View File

@ -0,0 +1,53 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Enumerations used for upload tasks.
*/
/**
* Enum for task events.
* @enum {string}
*/
export declare type TaskEvent = string;
export declare const TaskEvent: {
STATE_CHANGED: string;
};
/**
* Internal enum for task state.
* @enum {string}
*/
export declare type InternalTaskState = string;
export declare const InternalTaskState: {
RUNNING: string;
PAUSING: string;
PAUSED: string;
SUCCESS: string;
CANCELING: string;
CANCELED: string;
ERROR: string;
};
/**
* External (API-surfaced) enum for task state.
* @enum {string}
*/
export declare type TaskState = string;
export declare const TaskState: {
RUNNING: string;
PAUSED: string;
SUCCESS: string;
CANCELED: string;
ERROR: string;
};
export declare function taskStateFromInternalTaskState(state: InternalTaskState): TaskState;

View File

@ -0,0 +1,28 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @return False if the object is undefined or null, true otherwise.
*/
export declare function isDef(p: any): boolean;
export declare function isJustDef(p: any): boolean;
export declare function isFunction(p: any): boolean;
export declare function isObject(p: any): boolean;
export declare function isNonNullObject(p: any): boolean;
export declare function isNonArrayObject(p: any): boolean;
export declare function isString(p: any): boolean;
export declare function isNumber(p: any): boolean;
export declare function isNativeBlob(p: any): boolean;
export declare function isNativeBlobDefined(): boolean;

View File

@ -0,0 +1,6 @@
export declare function makeNormalUrl(urlPart: string): string;
export declare function makeDownloadUrl(urlPart: string): string;
export declare function makeUploadUrl(urlPart: string): string;
export declare function makeQueryString(params: {
[key: string]: string;
}): string;

View File

@ -0,0 +1,43 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview A lightweight wrapper around XMLHttpRequest with a
* goog.net.XhrIo-like interface.
*/
export declare type Headers = {
[name: string]: string | number;
};
export interface XhrIo {
send(url: string, method: string, opt_body?: ArrayBufferView | Blob | string | null, opt_headers?: Headers): Promise<XhrIo>;
getErrorCode(): ErrorCode;
getStatus(): number;
getResponseText(): string;
/**
* Abort the request.
*/
abort(): void;
getResponseHeader(header: string): string | null;
addUploadProgressListener(listener: (p1: Event) => void): void;
removeUploadProgressListener(listener: (p1: Event) => void): void;
}
/**
* @enum{number}
*/
export declare enum ErrorCode {
NO_ERROR = 0,
NETWORK_ERROR = 1,
ABORT = 2,
}

View File

@ -0,0 +1,46 @@
import * as XhrIoExports from './xhrio';
import { Headers, XhrIo } from './xhrio';
/**
* We use this instead of goog.net.XhrIo because goog.net.XhrIo is hyuuuuge and
* doesn't work in React Native on Android.
*/
export declare class NetworkXhrIo implements XhrIo {
private xhr_;
private errorCode_;
private sendPromise_;
private sent_;
constructor();
/**
* @override
*/
send(url: string, method: string, opt_body?: ArrayBufferView | Blob | string | null, opt_headers?: Headers): Promise<XhrIo>;
/**
* @override
*/
getErrorCode(): XhrIoExports.ErrorCode;
/**
* @override
*/
getStatus(): number;
/**
* @override
*/
getResponseText(): string;
/**
* Aborts the request.
* @override
*/
abort(): void;
/**
* @override
*/
getResponseHeader(header: string): string | null;
/**
* @override
*/
addUploadProgressListener(listener: (p1: Event) => void): void;
/**
* @override
*/
removeUploadProgressListener(listener: (p1: Event) => void): void;
}

View File

@ -0,0 +1,25 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Replacement for goog.net.XhrIoPool that works with fbs.XhrIo.
*/
import { XhrIo } from './xhrio';
/**
* Factory-like class for creating XhrIo instances.
*/
export declare class XhrIoPool {
createXhrIo(): XhrIo;
}

View File

@ -0,0 +1,43 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Reference } from './reference';
/**
* @fileoverview Documentation for the metadata format.
*/
declare type Metadata = {
bucket: string | undefined;
generation: string | undefined;
metageneration: string | undefined;
fullPath: string | undefined;
name: string | undefined;
size: number | undefined;
type: string | undefined;
timeCreated: string | undefined;
updated: string | undefined;
md5Hash: string | undefined;
cacheControl: string | undefined;
contentDisposition: string | undefined;
contentEncoding: string | undefined;
contentLanguage: string | undefined;
contentType: string | undefined;
downloadTokens: string[] | undefined;
customMetadata: {
[key: string]: string;
} | undefined;
ref: Reference | undefined;
[prop: string]: any;
};
export { Metadata };

View File

@ -0,0 +1,93 @@
import { AuthWrapper } from './implementation/authwrapper';
import { Location } from './implementation/location';
import * as metadata from './implementation/metadata';
import { StringFormat } from './implementation/string';
import { Metadata } from './metadata';
import { Service } from './service';
import { UploadTask } from './task';
/**
* Provides methods to interact with a bucket in the Firebase Storage service.
* @param location An fbs.location, or the URL at
* which to base this object, in one of the following forms:
* gs://<bucket>/<object-path>
* http[s]://firebasestorage.googleapis.com/
* <api-version>/b/<bucket>/o/<object-path>
* Any query or fragment strings will be ignored in the http[s]
* format. If no value is passed, the storage object will use a URL based on
* the project ID of the base firebase.App instance.
*/
export declare class Reference {
protected authWrapper: AuthWrapper;
protected location: Location;
constructor(authWrapper: AuthWrapper, location: string | Location);
/**
* @return The URL for the bucket and path this object references,
* in the form gs://<bucket>/<object-path>
* @override
*/
toString(): string;
protected newRef(authWrapper: AuthWrapper, location: Location): Reference;
protected mappings(): metadata.Mappings;
/**
* @return A reference to the object obtained by
* appending childPath, removing any duplicate, beginning, or trailing
* slashes.
*/
child(childPath: string): Reference;
/**
* @return A reference to the parent of the
* current object, or null if the current object is the root.
*/
readonly parent: Reference | null;
/**
* @return An reference to the root of this
* object's bucket.
*/
readonly root: Reference;
readonly bucket: string;
readonly fullPath: string;
readonly name: string;
readonly storage: Service;
/**
* Uploads a blob to this object's location.
* @param data The blob to upload.
* @return An UploadTask that lets you control and
* observe the upload.
*/
put(data: Blob | Uint8Array | ArrayBuffer, metadata?: Metadata | null): UploadTask;
/**
* Uploads a string to this object's location.
* @param string The string to upload.
* @param opt_format The format of the string to upload.
* @return An UploadTask that lets you control and
* observe the upload.
*/
putString(string: string, format?: StringFormat, opt_metadata?: Metadata): UploadTask;
/**
* Deletes the object at this location.
* @return A promise that resolves if the deletion succeeds.
*/
delete(): Promise<void>;
/**
* A promise that resolves with the metadata for this object. If this
* object doesn't exist or metadata cannot be retreived, the promise is
* rejected.
*/
getMetadata(): Promise<Metadata>;
/**
* Updates the metadata for this object.
* @param metadata The new metadata for the object.
* Only values that have been explicitly set will be changed. Explicitly
* setting a value to null will remove the metadata.
* @return A promise that resolves
* with the new metadata for this object.
* @see firebaseStorage.Reference.prototype.getMetadata
*/
updateMetadata(metadata: Metadata): Promise<Metadata>;
/**
* @return A promise that resolves with the download
* URL for this object.
*/
getDownloadURL(): Promise<string>;
private throwIfRoot_(name);
}

View File

@ -0,0 +1,60 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseApp } from '@firebase/app-types';
import { AuthWrapper } from './implementation/authwrapper';
import { XhrIoPool } from './implementation/xhriopool';
import { Reference } from './reference';
/**
* A service that provides firebaseStorage.Reference instances.
* @param opt_url gs:// url to a custom Storage Bucket
*
* @struct
*/
export declare class Service {
authWrapper_: AuthWrapper;
private app_;
private bucket_;
private internals_;
constructor(app: FirebaseApp, pool: XhrIoPool, url?: string);
/**
* Returns a firebaseStorage.Reference for the given path in the default
* bucket.
*/
ref(path?: string): Reference;
/**
* Returns a firebaseStorage.Reference object for the given absolute URL,
* which must be a gs:// or http[s]:// URL.
*/
refFromURL(url: string): Reference;
readonly maxUploadRetryTime: number;
setMaxUploadRetryTime(time: number): void;
readonly maxOperationRetryTime: number;
setMaxOperationRetryTime(time: number): void;
readonly app: FirebaseApp;
readonly INTERNAL: ServiceInternals;
}
/**
* @struct
*/
export declare class ServiceInternals {
service_: Service;
constructor(service: Service);
/**
* Called when the associated app is deleted.
* @see {!fbs.AuthWrapper.prototype.deleteApp}
*/
delete(): Promise<void>;
}

View File

@ -0,0 +1,118 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Defines types for interacting with blob transfer tasks.
*/
import { AuthWrapper } from './implementation/authwrapper';
import { FbsBlob } from './implementation/blob';
import { Metadata } from './metadata';
import { Unsubscribe } from './implementation/observer';
import { Subscribe } from './implementation/observer';
import { TaskEvent } from './implementation/taskenums';
import { UploadTaskSnapshot } from './tasksnapshot';
import { Location } from './implementation/location';
import * as fbsMetadata from './implementation/metadata';
import { Reference } from './reference';
/**
* Represents a blob being uploaded. Can be used to pause/resume/cancel the
* upload and manage callbacks for various events.
*/
export declare class UploadTask {
private ref_;
private authWrapper_;
private location_;
private blob_;
private metadata_;
private mappings_;
private transferred_;
private needToFetchStatus_;
private needToFetchMetadata_;
private observers_;
private resumable_;
private state_;
private error_;
private uploadUrl_;
private request_;
private chunkMultiplier_;
private errorHandler_;
private metadataErrorHandler_;
private resolve_;
private reject_;
private promise_;
/**
* @param ref The firebaseStorage.Reference object this task came
* from, untyped to avoid cyclic dependencies.
* @param blob The blob to upload.
*/
constructor(ref: Reference, authWrapper: AuthWrapper, location: Location, mappings: fbsMetadata.Mappings, blob: FbsBlob, metadata?: Metadata | null);
private makeProgressCallback_();
private shouldDoResumable_(blob);
private start_();
private resolveToken_(callback);
private createResumable_();
private fetchStatus_();
private continueUpload_();
private increaseMultiplier_();
private fetchMetadata_();
private oneShotUpload_();
private updateProgress_(transferred);
private transition_(state);
private completeTransitions_();
readonly snapshot: UploadTaskSnapshot;
/**
* Adds a callback for an event.
* @param type The type of event to listen for.
*/
on(type: TaskEvent, nextOrObserver?: any, error?: any, completed?: any): Unsubscribe | Subscribe<UploadTaskSnapshot>;
/**
* This object behaves like a Promise, and resolves with its snapshot data
* when the upload completes.
* @param onFulfilled The fulfillment callback. Promise chaining works as normal.
* @param onRejected The rejection callback.
*/
then<U>(onFulfilled?: ((value: UploadTaskSnapshot) => U | Promise<U>) | null, onRejected?: ((error: any) => U | Promise<U>) | null): Promise<U>;
/**
* Equivalent to calling `then(null, onRejected)`.
*/
catch<T>(onRejected: (p1: Error) => T | Promise<T>): Promise<T>;
/**
* Adds the given observer.
*/
private addObserver_(observer);
/**
* Removes the given observer.
*/
private removeObserver_(observer);
private notifyObservers_();
private finishPromise_();
private notifyObserver_(observer);
/**
* Resumes a paused task. Has no effect on a currently running or failed task.
* @return True if the operation took effect, false if ignored.
*/
resume(): boolean;
/**
* Pauses a currently running task. Has no effect on a paused or failed task.
* @return True if the operation took effect, false if ignored.
*/
pause(): boolean;
/**
* Cancels a currently running or paused task. Has no effect on a complete or
* failed task.
* @return True if the operation took effect, false if ignored.
*/
cancel(): boolean;
}

View File

@ -0,0 +1,28 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TaskState } from './implementation/taskenums';
import { Metadata } from './metadata';
import { Reference } from './reference';
import { UploadTask } from './task';
export declare class UploadTaskSnapshot {
readonly bytesTransferred: number;
readonly totalBytes: number;
readonly state: TaskState;
readonly metadata: Metadata | null;
readonly task: UploadTask;
readonly ref: Reference;
constructor(bytesTransferred: number, totalBytes: number, state: TaskState, metadata: Metadata | null, task: UploadTask, ref: Reference);
}

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,27 @@
import { FirebaseApp } from '@firebase/app-types';
import { Code, FirebaseStorageError } from '../src/implementation/error';
import { Headers, XhrIo } from '../src/implementation/xhrio';
import { XhrIoPool } from '../src/implementation/xhriopool';
import { SendHook } from './xhrio';
export declare const authToken = "totally-legit-auth-token";
export declare const bucket = "mybucket";
export declare const fakeApp: FirebaseApp;
export declare const fakeAppNoAuth: FirebaseApp;
export declare function makeFakeApp(token: Object | null, bucket_arg?: string): FirebaseApp;
export declare function makePool(sendHook: SendHook): XhrIoPool;
/**
* Returns something that looks like an fbs.XhrIo with the given headers
* and status.
*/
export declare function fakeXhrIo(headers: Headers, status?: number): XhrIo;
/**
* Binds ignoring types. Used to test calls involving improper arguments.
*/
export declare function bind(f: Function, ctx: any, ...args: any[]): () => void;
export declare function assertThrows(f: () => void, code: Code): FirebaseStorageError;
export declare function assertUint8ArrayEquals(arr1: Uint8Array, arr2: Uint8Array): void;
export declare function assertObjectIncludes(included: {
[name: string]: any;
}, obj: {
[name: string]: any;
}): void;

View File

@ -0,0 +1,30 @@
import { ErrorCode, Headers, XhrIo } from '../src/implementation/xhrio';
export declare type SendHook = (xhrio: TestingXhrIo, url: string, method: string, body?: ArrayBufferView | Blob | string | null, headers?: Headers) => void;
export declare enum State {
START = 0,
SENT = 1,
DONE = 2,
}
export declare type StringHeaders = {
[name: string]: string;
};
export declare class TestingXhrIo implements XhrIo {
private state;
private sendPromise;
private resolve;
private sendHook;
private status;
private responseText;
private headers;
private errorCode;
constructor(sendHook: SendHook);
send(url: string, method: string, body?: ArrayBufferView | Blob | string | null, headers?: Headers): Promise<XhrIo>;
simulateResponse(status: number, body: string, headers: Headers): void;
getErrorCode(): ErrorCode;
getStatus(): number;
getResponseText(): string;
abort(): void;
getResponseHeader(header: string): string;
addUploadProgressListener(listener: any): void;
removeUploadProgressListener(listener: any): void;
}

View File

@ -0,0 +1,90 @@
{
"_from": "@firebase/storage@0.2.4",
"_id": "@firebase/storage@0.2.4",
"_inBundle": false,
"_integrity": "sha512-uqA6CoZYkugk69ImqB16VBPP7JRPRfZwcUP9CsE0GPVGQkZQQfBGwzIyEoFA8lUfVLrvxQiL0sQvHUXZ945LMg==",
"_location": "/@firebase/storage",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@firebase/storage@0.2.4",
"name": "@firebase/storage",
"escapedName": "@firebase%2fstorage",
"scope": "@firebase",
"rawSpec": "0.2.4",
"saveSpec": null,
"fetchSpec": "0.2.4"
},
"_requiredBy": [
"/firebase"
],
"_resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.2.4.tgz",
"_shasum": "8393822d29cdba2a4993d643273c104ad9a033f3",
"_spec": "@firebase/storage@0.2.4",
"_where": "D:\\Desktop\\smartshopperNodeReworkFirebase\\node_modules\\firebase",
"author": {
"name": "Firebase",
"email": "firebase-support@google.com",
"url": "https://firebase.google.com/"
},
"bugs": {
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"bundleDependencies": false,
"dependencies": {
"@firebase/storage-types": "0.2.3",
"tslib": "1.9.0"
},
"deprecated": false,
"description": "This is the Cloud Storage component of the Firebase JS SDK.",
"devDependencies": {
"@types/chai": "4.1.2",
"@types/mocha": "5.0.0",
"@types/sinon": "4.3.1",
"chai": "4.1.2",
"karma": "2.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-firefox-launcher": "1.1.0",
"karma-mocha": "1.3.0",
"karma-sauce-launcher": "1.2.0",
"karma-sourcemap-loader": "0.3.7",
"karma-spec-reporter": "0.0.32",
"karma-webpack": "2.0.9",
"npm-run-all": "4.1.2",
"rollup": "0.57.1",
"rollup-plugin-commonjs": "9.1.0",
"rollup-plugin-node-resolve": "3.3.0",
"rollup-plugin-typescript2": "0.12.0",
"sinon": "4.5.0",
"source-map-loader": "0.2.3",
"ts-loader": "3.5.0",
"typescript": "2.8.1",
"webpack": "3.11.0"
},
"files": [
"dist"
],
"license": "Apache-2.0",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"name": "@firebase/storage",
"peerDependencies": {
"@firebase/app": "0.x",
"@firebase/app-types": "0.x"
},
"repository": {
"type": "git",
"url": "https://github.com/firebase/firebase-js-sdk/tree/master/packages/storage"
},
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"prepare": "npm run build",
"test": "run-p test:browser",
"test:browser": "karma start --single-run"
},
"typings": "dist/index.d.ts",
"version": "0.2.4"
}