Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.vscode/settings.json
node_modules
demos/reactnative/.expo
lib.cjs
lib.esm
dist
.DS_Store
yarn-error.log
Expand Down
3 changes: 2 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Tests are implemented using Jasmine and can be found in the `test/` directory. T

- To run the tests inside **Node.js** use the command `yarn run test-node`.
- To run the tests inside **Puppeteer** (an automated browser) use the command `yarn run test-puppeteer`.
- To run the tests in your browser open `test/SpecRunner.html` in a browser and you should see a visual representation of the test results. No web server is required, you can open `SpecRunner.html` using the `file:///` protocol.
- To run the tests in your browser open `test/SpecRunner.html` in a browser, and you should see a visual representation of the
test results. No web server is required, you can open `SpecRunner.html` using the `file:///` protocol.
- To run the tests on BrowserStack's cloud testing infrastructure use `yarn run test-browserstack`. Before using this command, you have to set up your BrowserStack account by filling the `BROWSERSTACK_USERNAME` and `BROWSERSTACK_KEY` variables or else the command will fail.

Also note that you have to rebuild the library before you run the tests. So either you automatically let `yarn run watch` listen for file changes and automatically rebuild the needed artifacts, or you run `yarn run build` on your own before you execute the tests.
7 changes: 7 additions & 0 deletions lib.cjs/DetailedError.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { HttpRequest, HttpResponse } from './options.js';
export declare class DetailedError extends Error {
originalRequest?: HttpRequest;
originalResponse?: HttpResponse;
causingError?: Error;
constructor(message: string, causingErr?: Error, req?: HttpRequest, res?: HttpResponse);
}
25 changes: 25 additions & 0 deletions lib.cjs/DetailedError.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib.cjs/DetailedError.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions lib.cjs/NoopUrlStorage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { PreviousUpload, UrlStorage } from './options.js';
export declare class NoopUrlStorage implements UrlStorage {
findAllUploads(): Promise<never[]>;
findUploadsByFingerprint(_fingerprint: string): Promise<never[]>;
removeUpload(_urlStorageKey: string): Promise<void>;
addUpload(_urlStorageKey: string, _upload: PreviousUpload): Promise<undefined>;
}
19 changes: 19 additions & 0 deletions lib.cjs/NoopUrlStorage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib.cjs/NoopUrlStorage.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib.cjs/browser/BrowserFileReader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { FileReader, FileSource, UploadInput } from '../options.js';
export declare class BrowserFileReader implements FileReader {
openFile(input: UploadInput, chunkSize: number): Promise<FileSource>;
}
33 changes: 33 additions & 0 deletions lib.cjs/browser/BrowserFileReader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib.cjs/browser/BrowserFileReader.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions lib.cjs/browser/FetchHttpStack.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { HttpProgressHandler, HttpRequest, HttpResponse, HttpStack, SliceType } from '../options.js';
export declare class FetchHttpStack implements HttpStack {
createRequest(method: string, url: string): FetchRequest;
getName(): string;
}
declare class FetchRequest implements HttpRequest {
private _method;
private _url;
private _headers;
private _controller;
constructor(method: string, url: string);
getMethod(): string;
getURL(): string;
setHeader(header: string, value: string): void;
getHeader(header: string): string;
setProgressHandler(_progressHandler: HttpProgressHandler): void;
send(body?: SliceType): Promise<FetchResponse>;
abort(): Promise<void>;
getUnderlyingObject(): undefined;
}
declare class FetchResponse implements HttpResponse {
private _res;
private _body;
constructor(res: Response, body: string);
getStatus(): number;
getHeader(header: string): string | undefined;
getBody(): string;
getUnderlyingObject(): Response;
}
export {};
77 changes: 77 additions & 0 deletions lib.cjs/browser/FetchHttpStack.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib.cjs/browser/FetchHttpStack.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lib.cjs/browser/XHRHttpStack.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { HttpRequest, HttpStack } from '../options.js';
export declare class XHRHttpStack implements HttpStack {
createRequest(method: string, url: string): HttpRequest;
getName(): string;
}
86 changes: 86 additions & 0 deletions lib.cjs/browser/XHRHttpStack.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib.cjs/browser/XHRHttpStack.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lib.cjs/browser/fileSignature.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { UploadInput, UploadOptions } from '../options.js';
/**
* Generate a fingerprint for a file which will be used the store the endpoint
*/
export declare function fingerprint(file: UploadInput, options: UploadOptions): Promise<string> | Promise<null>;
37 changes: 37 additions & 0 deletions lib.cjs/browser/fileSignature.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading