Skip to content

Commit

Permalink
Replace pinejs-client-request with pinejs-client-fetch
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
myarmolinsky committed Jul 5, 2024
1 parent b44ec75 commit 4d9be76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions lib/release/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pMap = require('p-map');
import type { PinejsClientCore, RetryParameters } from 'pinejs-client-core';
import { PinejsClientRequest } from 'pinejs-client-request';
import PinejsClientFetch from 'pinejs-client-fetch';
import * as models from './models';
import type { Dict } from './types';

Expand All @@ -25,16 +25,19 @@ export interface ClientConfig {
retry?: RetryParameters;
}

export function createClient(config: ClientConfig): PinejsClientRequest {
return new PinejsClientRequest({
apiPrefix: `${config.apiEndpoint}/v6/`,
passthrough: {
headers: {
Authorization: config.auth,
export function createClient(config: ClientConfig): PinejsClientFetch {
return new PinejsClientFetch(
{
apiPrefix: `${config.apiEndpoint}/v6/`,
passthrough: {
headers: {
Authorization: config.auth,
},
},
retry: config.retry,
},
retry: config.retry,
});
{ fetch },
);
}

export interface Request {
Expand All @@ -44,7 +47,7 @@ export interface Request {
* configure `apiPrefix` appropriately.
*
* ```
* import Pine = require('pinejs-client-request');
* import Pine = require('pinejs-client-fetch');
* const client = new Pine({
* apiPrefix: 'https://api.balena-cloud.com/v5',
* passthrough: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"mz": "^2.7.0",
"p-map": "^4.0.0",
"pinejs-client-core": "^6.13.0",
"pinejs-client-request": "^7.3.5",
"pinejs-client-fetch": "^1.0.2",
"request": "^2.88.2",
"semver": "^7.3.5",
"stream-to-promise": "^3.0.0",
Expand Down

0 comments on commit 4d9be76

Please sign in to comment.