Skip to content

Commit

Permalink
Fix some readme/docs bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mackenzie McClane committed Jun 21, 2020
1 parent 535cb3b commit 56ed329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
- [`BulkData.definitionById (id: string): Promise<BulkDataDefinition>;`](#bulkdatadefinitionbyid-id-string-promisebulkdatadefinition-)
- [Misc](#misc-)
- [`homepageLinks (): Promise<string[]>;`](#homepagelinks--promisestring-)
- [`bulkData (): Promise<BulkData[]>;`](#bulkdata--promisebulkdata-)
- [`error (): SearchError | undefined;`](#error--searcherror--undefined-)
- [`setRetry (attempts: number, timeout?: number, canRetry?: (error: SearchError) => boolean): void;`](#setretry-attempts-number-timeout-number-canretry-error-searcherror--boolean-void-)
- [`MagicEmitter<T, NOT_FOUND>`](#magicemittert-not_found-)
Expand Down Expand Up @@ -415,7 +414,7 @@ Scry.Catalog.watermarks().then(result => console.log(result.length)); // 50

## Bulk Data [🡅](#table-of-contents)

### `downloadByType (type: string): Promise<Stream | undefined>;` [🡅](#table-of-contents)
### `BulkData.downloadByType (type: string): Promise<Stream | undefined>;` [🡅](#table-of-contents)
Returns a stream for a bulk data file by its type, or `undefined` if the bulk data file hasn't been updated since the last download time.

```ts
Expand All @@ -436,29 +435,29 @@ if (rulingsStream)
rulingsStream.pipe(fs.createWriteStream("rulings.json"));
```

### `downloadById (id: string): Promise<Stream | undefined>;` [🡅](#table-of-contents)
### `BulkData.downloadById (id: string): Promise<Stream | undefined>;` [🡅](#table-of-contents)
Returns a stream for a bulk data file by its id, or `undefined` if the bulk data file hasn't been updated since the last download time.

```ts
const id = "<an id here>"; // a UUID identifying the bulk data definition
Scry.BulkData.downloadById(id, lastDownloadTime).then(result => console.log(result)); // either a stream or undefined
```

### `definitions (): Promise<BulkDataDefinition[]>;` [🡅](#table-of-contents)
### `BulkData.definitions (): Promise<BulkDataDefinition[]>;` [🡅](#table-of-contents)
Returns the definitions of all bulk data files that Scryfall is currently providing.

```ts
Scry.BulkData.definitions().then(result => console.log(result.length)); // 5
```

### `definitionByType (type: string): Promise<BulkDataDefinition>;` [🡅](#table-of-contents)
### `BulkData.definitionByType (type: string): Promise<BulkDataDefinition>;` [🡅](#table-of-contents)
Returns a single bulk data file definition by its type.

```ts
Scry.BulkData.definitionByType("rulings").then(result => console.log(result.object, result.type)); // "bulk_data rulings"
```

### `definitionById (id: string): Promise<BulkDataDefinition>;` [🡅](#table-of-contents)
### `BulkData.definitionById (id: string): Promise<BulkDataDefinition>;` [🡅](#table-of-contents)
Returns a single bulk data file definition by its id.

```ts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

A Node.js SDK for [Scryfall](https://scryfall.com/docs/api) written in Typescript.

As of [March 2nd, 2020](./CHANGELOG.md), all features described in the [Scryfall documentation](https://scryfall.com/docs/api) are supported. If you see something that isn't supported, make an issue! See [support readme](./SUPPORT.md).
As of [June 21st, 2020](./CHANGELOG.md), all features described in the [Scryfall documentation](https://scryfall.com/docs/api) are supported. If you see something that isn't supported, make an issue! See [support readme](./SUPPORT.md).


## Installation
Expand Down

0 comments on commit 56ed329

Please sign in to comment.