@ipfs-shipyard/pinning-service-client
Advanced tools
Comparing version 1.0.3 to 2.0.0
@@ -43,3 +43,3 @@ /** | ||
}; | ||
export declare type FetchAPI = GlobalFetch['fetch']; | ||
export type FetchAPI = GlobalFetch['fetch']; | ||
export interface ConfigurationParameters { | ||
@@ -71,12 +71,12 @@ basePath?: string; | ||
} | ||
export declare type Json = any; | ||
export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; | ||
export declare type HTTPHeaders = { | ||
export type Json = any; | ||
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; | ||
export type HTTPHeaders = { | ||
[key: string]: string; | ||
}; | ||
export declare type HTTPQuery = { | ||
export type HTTPQuery = { | ||
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | HTTPQuery; | ||
}; | ||
export declare type HTTPBody = Json | FormData | URLSearchParams; | ||
export declare type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; | ||
export type HTTPBody = Json | FormData | URLSearchParams; | ||
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; | ||
export interface FetchParams { | ||
@@ -83,0 +83,0 @@ url: string; |
@@ -0,4 +1,4 @@ | ||
import { PinsApi as RemotePinningServiceClient } from '../dist.generated/apis/index.js'; | ||
import { Configuration as GeneratedConfiguration } from '../dist.generated/index.js'; | ||
import type { ConfigurationParameters as GeneratedConfigurationParameters } from '../dist.generated/index.js'; | ||
import { PinsApi as RemotePinningServiceClient } from '../dist.generated/apis/index.js'; | ||
interface ConfigurationParameters extends Omit<GeneratedConfigurationParameters, 'basePath'> { | ||
@@ -5,0 +5,0 @@ endpointUrl?: string; |
@@ -1,4 +0,3 @@ | ||
import fetchPonyfill from 'fetch-ponyfill'; | ||
import { PinsApi as RemotePinningServiceClient } from '../dist.generated/apis/index.js'; | ||
import { Configuration as GeneratedConfiguration } from '../dist.generated/index.js'; | ||
import { PinsApi as RemotePinningServiceClient } from '../dist.generated/apis/index.js'; | ||
class Configuration extends GeneratedConfiguration { | ||
@@ -11,3 +10,3 @@ constructor(options) { | ||
if (options.fetchApi == null) { | ||
finalOptions.fetchApi = fetchPonyfill().fetch; | ||
finalOptions.fetchApi = fetch; | ||
} | ||
@@ -14,0 +13,0 @@ // @see https://github.com/ipfs-shipyard/js-pinning-service-http-client/issues/3 |
{ | ||
"name": "@ipfs-shipyard/pinning-service-client", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "A lightweight client generated from the ipfs-pinning-service-spec defined at https://raw.githubusercontent.com/ipfs/pinning-services-api-spec/main/ipfs-pinning-service.yaml", | ||
@@ -61,8 +61,2 @@ "author": "Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>", | ||
}, | ||
"eslintConfig": { | ||
"extends": "ipfs", | ||
"parserOptions": { | ||
"sourceType": "module" | ||
} | ||
}, | ||
"release": { | ||
@@ -151,3 +145,3 @@ "branches": [ | ||
"ci:test": "run-s test:*", | ||
"dep-check": "aegir dep-check dist/**/*.js -- --ignore @openapitools/openapi-generator-cli @typescript-eslint/eslint-plugin @typescript-eslint/parser", | ||
"dep-check": "aegir dep-check dist/**/*.js", | ||
"fix": "run-s fix:*", | ||
@@ -170,3 +164,3 @@ "fix:lint": "aegir lint --fix", | ||
"test:electron-main": "aegir test -t electron-main", | ||
"posttest": "npx nyc report", | ||
"posttest": "npx nyc report || echo 'coverage report temporarily broken'", | ||
"pregen": "openapi-generator-cli validate -i https://raw.githubusercontent.com/ipfs/pinning-services-api-spec/v1.0.0/ipfs-pinning-service.yaml", | ||
@@ -179,39 +173,29 @@ "gen": "run-p gen:fetch", | ||
"clean": "aegir clean", | ||
"reset": "aegir clean node_modules dist dist.generated", | ||
"lint": "aegir lint" | ||
}, | ||
"dependencies": { | ||
"fetch-ponyfill": "^7.1.0" | ||
}, | ||
"devDependencies": { | ||
"@openapitools/openapi-generator-cli": "^2.4.26", | ||
"@swc/cli": "^0.1.55", | ||
"@swc/core": "^1.2.157", | ||
"@swc/helpers": "^0.3.3", | ||
"@types/cors": "^2.8.12", | ||
"@types/eslint": "^8.4.2", | ||
"@types/express": "^4.17.13", | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "^18.8.2", | ||
"@types/portscanner": "^2.1.1", | ||
"@openapitools/openapi-generator-cli": "^2.13.5", | ||
"@swc/cli": "^0.4.0", | ||
"@swc/core": "^1.7.18", | ||
"@swc/helpers": "^0.5.12", | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"@types/mocha": "^10.0.7", | ||
"@types/node": "^22.5.0", | ||
"@types/portscanner": "^2.1.4", | ||
"@types/winston": "^2.4.4", | ||
"@typescript-eslint/eslint-plugin": "^5.22.0", | ||
"@typescript-eslint/parser": "^5.22.0", | ||
"aegir": "^37.0.15", | ||
"check-aegir-project": "^1.0.3", | ||
"aegir": "^44.1.1", | ||
"cors": "^2.8.5", | ||
"cp-cli": "^2.0.0", | ||
"dotenvrc": "^1.0.1", | ||
"eslint": "^8.14.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"express": "^4.17.3", | ||
"express": "^4.19.2", | ||
"express-promise-router": "^4.1.1", | ||
"mock-ipfs-pinning-service": "^0.4.0", | ||
"mock-ipfs-pinning-service": "^0.4.2", | ||
"npm-run-all": "^4.1.5", | ||
"portscanner": "^2.2.0", | ||
"regenerator-runtime": "^0.13.9", | ||
"ts-node": "^10.7.0", | ||
"tsc-silent": "^1.2.1", | ||
"typescript": "^4.6.4", | ||
"winston": "^3.6.0" | ||
"regenerator-runtime": "^0.14.1", | ||
"tsc-silent": "^1.2.2", | ||
"winston": "^3.14.2" | ||
} | ||
} |
@@ -23,3 +23,3 @@ ## IPFS Pinning Service API Client for JS | ||
accessToken, // the secret token/key given to you by your pinning provider | ||
// fetchApi: fetch, // You can pass your own fetchApi implementation, but we use fetch-ponyfill by default. | ||
// fetchApi: fetch, // You can pass your own fetchApi implementation, but we use NodeJS fetch by default. | ||
}) | ||
@@ -53,2 +53,8 @@ | ||
### Updating the generated client | ||
To update the client, you need to `npm run gen` npm script. This will fetch the latest version of the OpenAPI spec and generate the client. However, openapi-generator-cli does not currently generate the client code with proper import syntax. So you must modify the imports in `generated/fetch/**` directly, or just `git checkout -p` to remove the invalid import path changes. | ||
If you need to modify the generated code's import paths, you will have to run `npm run postgen` manually. | ||
### Contributing | ||
@@ -55,0 +61,0 @@ |
@@ -1,8 +0,6 @@ | ||
import fetchPonyfill from 'fetch-ponyfill' | ||
import { PinsApi as RemotePinningServiceClient } from '../dist.generated/apis/index.js' | ||
import { Configuration as GeneratedConfiguration } from '../dist.generated/index.js' | ||
import type { ConfigurationParameters as GeneratedConfigurationParameters } from '../dist.generated/index.js' | ||
import { PinsApi as RemotePinningServiceClient } from '../dist.generated/apis/index.js' | ||
interface ConfigurationParameters extends Omit<GeneratedConfigurationParameters, 'basePath'>{ | ||
interface ConfigurationParameters extends Omit<GeneratedConfigurationParameters, 'basePath'> { | ||
endpointUrl?: string | ||
@@ -17,3 +15,3 @@ } | ||
if (options.fetchApi == null) { | ||
finalOptions.fetchApi = fetchPonyfill().fetch | ||
finalOptions.fetchApi = fetch | ||
} | ||
@@ -20,0 +18,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
221067
0
22
76
1873
2
- Removedfetch-ponyfill@^7.1.0
- Removedfetch-ponyfill@7.1.0(transitive)
- Removednode-fetch@2.6.13(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)