Skip to content

Commit

Permalink
Update pinejs-client-core to add support for using model specific typ…
Browse files Browse the repository at this point in the history
…ings

Update pinejs-client-core from 6.14.6 to 6.15.1

Change-type: minor
  • Loading branch information
Page- committed Jun 18, 2024
1 parent 574314b commit 8a5d899
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
},
"license": "MIT",
"dependencies": {
"@types/lodash": "^4.17.4",
"@types/lodash": "^4.17.5",
"@types/lru-cache": "^5.1.1",
"@types/request": "^2.48.12",
"lodash": "^4.17.21",
"lru-cache": "^6.0.0",
"pinejs-client-core": "^6.14.6",
"pinejs-client-core": "^6.15.1",
"request": "^2.88.2",
"typed-error": "^3.2.2"
},
"devDependencies": {
"@balena/lint": "^8.0.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.7",
"require-npm4-to-publish": "^1.0.0",
"typescript": "^5.4.5"
},
Expand Down
15 changes: 13 additions & 2 deletions request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type * as LruCache from 'lru-cache';
import type {
Params,
AnyObject,
AnyResource,
Resource,
} from 'pinejs-client-core';

import type { Params, AnyObject } from 'pinejs-client-core';
import { PinejsClientCore } from 'pinejs-client-core';
import * as request from 'request';
import { TypedError } from 'typed-error';
Expand Down Expand Up @@ -50,7 +55,13 @@ export interface BackendParams {
}

const validParams: Array<keyof BackendParams> = ['cache'];
export class PinejsClientRequest extends PinejsClientCore<PinejsClientRequest> {
export class PinejsClientRequest<
Model extends {
[key in keyof Model]: Resource;
} = {
[key in string]: AnyResource;
},
> extends PinejsClientCore<unknown, Model> {
public backendParams: BackendParams = {};
private cache?: LruCache<string, CachedResponse>;

Expand Down

0 comments on commit 8a5d899

Please sign in to comment.