Skip to content

Commit

Permalink
Merge pull request #302 from blockfrost/fix-ipfs-types-open-api
Browse files Browse the repository at this point in the history
fix: use IPFS types from openapi
  • Loading branch information
slowbackspace authored Nov 1, 2024
2 parents 8a636b8 + 9ec12c5 commit 2991126
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 23 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Use IPFS types from `@blockfrost/openapi` package

### Added

- Methods for querying [governance DReps endpoints](https://docs.blockfrost.io/#tag/cardano--governance.) - `governance.dreps`, `governance.drepsById`, `governance.drepsByIdDelegators`, `governance.drepsByIdMetadata`, `governance.drepsByIdUpdates`, `governance.drepsByIdVotes`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"coverage-ci": "vitest run --coverage"
},
"dependencies": {
"@blockfrost/openapi": "0.1.67",
"@blockfrost/openapi": "0.1.7-beta.0",
"@emurgo/cardano-serialization-lib-nodejs": "^11.5.0",
"@emurgo/cip14-js": "3.0.1",
"bottleneck": "^2.19.5",
Expand Down
24 changes: 7 additions & 17 deletions src/types/ipfs.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
type State = 'queued' | 'pinned' | 'unpinned' | 'failed' | 'gc';
import { paths } from '@blockfrost/openapi';

export type AddResponse = {
name: string;
ipfs_hash: string;
size: number;
};
export type PinResponse =
paths['/ipfs/pin/add/{IPFS_path}']['post']['responses']['200']['content']['application/json'];

export type PinResponse = {
ipfs_hash: string;
state: State;
};
export type AddResponse =
paths['/ipfs/add']['post']['responses']['200']['content']['application/json'];

export type ListResponse = {
time_created: number;
time_pinned: number;
ipfs_hash: string;
size: string;
state: State;
};
export type ListResponse =
paths['/ipfs/pin/list']['get']['responses']['200']['content']['application/json'];
88 changes: 83 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@blockfrost/blockfrost-js@workspace:."
dependencies:
"@blockfrost/openapi": "npm:0.1.67"
"@blockfrost/openapi": "npm:0.1.7-beta.0"
"@emurgo/cardano-serialization-lib-nodejs": "npm:^11.5.0"
"@emurgo/cip14-js": "npm:3.0.1"
"@types/json-bigint": "npm:^1.0.2"
Expand Down Expand Up @@ -63,14 +63,15 @@ __metadata:
languageName: unknown
linkType: soft

"@blockfrost/openapi@npm:0.1.67":
version: 0.1.67
resolution: "@blockfrost/openapi@npm:0.1.67"
"@blockfrost/openapi@npm:0.1.7-beta.0":
version: 0.1.7-beta.0
resolution: "@blockfrost/openapi@npm:0.1.7-beta.0"
dependencies:
ajv: "npm:^8.12.0"
cbor: "npm:^9.0.1"
rimraf: "npm:6.0.1"
yaml: "npm:^2.3.4"
checksum: 464cfa9ae4d7911ed963f559c95e97b68763466276d5663596028038faa53c8c1ef415855c6de7b6ff363f3a9576ebcad8d374a1684549096019255cdc1c501f
checksum: 2384e78a74538c83405525959b9c911ec6a4399fbebd2182ba386421d759dd8369fe989bd8264375a15dab103c269cf72102f1788da28452fc7c1e89eb3f33aa
languageName: node
linkType: hard

Expand Down Expand Up @@ -2319,6 +2320,22 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^11.0.0":
version: 11.0.0
resolution: "glob@npm:11.0.0"
dependencies:
foreground-child: "npm:^3.1.0"
jackspeak: "npm:^4.0.1"
minimatch: "npm:^10.0.0"
minipass: "npm:^7.1.2"
package-json-from-dist: "npm:^1.0.0"
path-scurry: "npm:^2.0.0"
bin:
glob: dist/esm/bin.mjs
checksum: e66939201d11ae30fe97e3364ac2be5c59d6c9bfce18ac633edfad473eb6b46a7553f6f73658f67caaf6cccc1df1ae336298a45e9021fa5695fd78754cc1603e
languageName: node
linkType: hard

"glob@npm:^7.1.3, glob@npm:^7.1.4":
version: 7.2.3
resolution: "glob@npm:7.2.3"
Expand Down Expand Up @@ -2911,6 +2928,15 @@ __metadata:
languageName: node
linkType: hard

"jackspeak@npm:^4.0.1":
version: 4.0.2
resolution: "jackspeak@npm:4.0.2"
dependencies:
"@isaacs/cliui": "npm:^8.0.2"
checksum: d9722f0e55f6c322c57aedf094c405f4201b834204629817187953988075521cfddb23df83e2a7b845723ca7eb0555068c5ce1556732e9c275d32a531881efa8
languageName: node
linkType: hard

"jju@npm:~1.4.0":
version: 1.4.0
resolution: "jju@npm:1.4.0"
Expand Down Expand Up @@ -3062,6 +3088,13 @@ __metadata:
languageName: node
linkType: hard

"lru-cache@npm:^11.0.0":
version: 11.0.2
resolution: "lru-cache@npm:11.0.2"
checksum: 25fcb66e9d91eaf17227c6abfe526a7bed5903de74f93bfde380eb8a13410c5e8d3f14fe447293f3f322a7493adf6f9f015c6f1df7a235ff24ec30f366e1c058
languageName: node
linkType: hard

"lru-cache@npm:^6.0.0":
version: 6.0.0
resolution: "lru-cache@npm:6.0.0"
Expand Down Expand Up @@ -3231,6 +3264,15 @@ __metadata:
languageName: node
linkType: hard

"minimatch@npm:^10.0.0":
version: 10.0.1
resolution: "minimatch@npm:10.0.1"
dependencies:
brace-expansion: "npm:^2.0.1"
checksum: 082e7ccbc090d5f8c4e4e029255d5a1d1e3af37bda837da2b8b0085b1503a1210c91ac90d9ebfe741d8a5f286ece820a1abb4f61dc1f82ce602a055d461d93f3
languageName: node
linkType: hard

"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2":
version: 3.1.2
resolution: "minimatch@npm:3.1.2"
Expand Down Expand Up @@ -3341,6 +3383,13 @@ __metadata:
languageName: node
linkType: hard

"minipass@npm:^7.1.2":
version: 7.1.2
resolution: "minipass@npm:7.1.2"
checksum: c25f0ee8196d8e6036661104bacd743785b2599a21de5c516b32b3fa2b83113ac89a2358465bc04956baab37ffb956ae43be679b2262bf7be15fce467ccd7950
languageName: node
linkType: hard

"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2":
version: 2.1.2
resolution: "minizlib@npm:2.1.2"
Expand Down Expand Up @@ -3725,6 +3774,13 @@ __metadata:
languageName: node
linkType: hard

"package-json-from-dist@npm:^1.0.0":
version: 1.0.1
resolution: "package-json-from-dist@npm:1.0.1"
checksum: 58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602
languageName: node
linkType: hard

"parent-module@npm:^1.0.0":
version: 1.0.1
resolution: "parent-module@npm:1.0.1"
Expand Down Expand Up @@ -3779,6 +3835,16 @@ __metadata:
languageName: node
linkType: hard

"path-scurry@npm:^2.0.0":
version: 2.0.0
resolution: "path-scurry@npm:2.0.0"
dependencies:
lru-cache: "npm:^11.0.0"
minipass: "npm:^7.1.2"
checksum: 285ae0c2d6c34ae91dc1d5378ede21981c9a2f6de1ea9ca5a88b5a270ce9763b83dbadc7a324d512211d8d36b0c540427d3d0817030849d97a60fa840a2c59ec
languageName: node
linkType: hard

"path-to-regexp@npm:^6.2.0":
version: 6.2.1
resolution: "path-to-regexp@npm:6.2.1"
Expand Down Expand Up @@ -4060,6 +4126,18 @@ __metadata:
languageName: node
linkType: hard

"rimraf@npm:6.0.1":
version: 6.0.1
resolution: "rimraf@npm:6.0.1"
dependencies:
glob: "npm:^11.0.0"
package-json-from-dist: "npm:^1.0.0"
bin:
rimraf: dist/esm/bin.mjs
checksum: 0eb7edf08aa39017496c99ba675552dda11a20811ba78f8232da2ba945308c91e9cd673f95998b1a8202bc7436d33390831d23ea38ae52751038d56373ad99e2
languageName: node
linkType: hard

"rimraf@npm:^3.0.2":
version: 3.0.2
resolution: "rimraf@npm:3.0.2"
Expand Down

0 comments on commit 2991126

Please sign in to comment.