pinejs-client-request 8.1.0 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.versionbot/CHANGELOG.yml +44 -1
- package/CHANGELOG.md +17 -0
- package/package.json +4 -5
- package/request.d.ts +2 -4
- package/request.js +2 -5
- package/request.js.map +1 -1
- package/request.ts +7 -5
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
- commits:
|
|
2
|
+
- subject: Sub-class the `StatusError` for errors as pinejs-client-core expects
|
|
3
|
+
hash: c866977804481b50a81a62bb5a585c1f3ec53bd5
|
|
4
|
+
body: |
|
|
5
|
+
This increases standardization across implementations
|
|
6
|
+
|
|
7
|
+
Update pinejs-client-core from 8.3.2 to 8.4.0
|
|
8
|
+
footer:
|
|
9
|
+
Change-type: patch
|
|
10
|
+
change-type: patch
|
|
11
|
+
author: Pagan Gazzard
|
|
12
|
+
nested:
|
|
13
|
+
- commits:
|
|
14
|
+
- subject: Add a `StatusError` class that downstream is expected to use for errors
|
|
15
|
+
hash: 5c589f1ddb12ffac87c13d3daed2bda09d386378
|
|
16
|
+
body: >
|
|
17
|
+
This isn't enforced currently but it will help to standardize
|
|
18
|
+
errors
|
|
19
|
+
|
|
20
|
+
across implementations and make it easier to switch between them
|
|
21
|
+
footer:
|
|
22
|
+
Change-type: minor
|
|
23
|
+
change-type: minor
|
|
24
|
+
author: Pagan Gazzard
|
|
25
|
+
nested: []
|
|
26
|
+
version: pinejs-client-js-8.4.0
|
|
27
|
+
title: ""
|
|
28
|
+
date: 2025-10-10T16:59:39.572Z
|
|
29
|
+
- commits:
|
|
30
|
+
- subject: "Types: make use of inference for some simplification"
|
|
31
|
+
hash: 9622554854b58352a581300d7a6cf97b156d2a9a
|
|
32
|
+
body: ""
|
|
33
|
+
footer:
|
|
34
|
+
Change-type: patch
|
|
35
|
+
change-type: patch
|
|
36
|
+
author: Pagan Gazzard
|
|
37
|
+
nested: []
|
|
38
|
+
version: pinejs-client-js-8.3.3
|
|
39
|
+
title: ""
|
|
40
|
+
date: 2025-10-10T13:05:32.557Z
|
|
41
|
+
version: 8.1.1
|
|
42
|
+
title: ""
|
|
43
|
+
date: 2025-10-10T17:07:31.655Z
|
|
1
44
|
- commits:
|
|
2
45
|
- subject: Switch to Node20 module resolution
|
|
3
46
|
hash: b2c8478ed1e2c657adda4017aff53bcae4a6e0d8
|
|
@@ -154,7 +197,7 @@
|
|
|
154
197
|
date: 2024-10-09T13:01:51.754Z
|
|
155
198
|
version: 8.1.0
|
|
156
199
|
title: ""
|
|
157
|
-
date: 2025-09-16T15:
|
|
200
|
+
date: 2025-09-16T15:57:45.524Z
|
|
158
201
|
- commits:
|
|
159
202
|
- subject: Update dependency lint-staged to v16
|
|
160
203
|
hash: c713d1000bb9ff12950890e3ac2dab550fad26e3
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file
|
|
|
4
4
|
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
+
## 8.1.1 - 2025-10-10
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<details>
|
|
11
|
+
<summary> Sub-class the `StatusError` for errors as pinejs-client-core expects [Pagan Gazzard] </summary>
|
|
12
|
+
|
|
13
|
+
> ### pinejs-client-js-8.4.0 - 2025-10-10
|
|
14
|
+
>
|
|
15
|
+
> * Add a `StatusError` class that downstream is expected to use for errors [Pagan Gazzard]
|
|
16
|
+
>
|
|
17
|
+
> ### pinejs-client-js-8.3.3 - 2025-10-10
|
|
18
|
+
>
|
|
19
|
+
> * Types: make use of inference for some simplification [Pagan Gazzard]
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
7
24
|
## 8.1.0 - 2025-09-16
|
|
8
25
|
|
|
9
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinejs-client-request",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.1",
|
|
4
4
|
"description": "This module provides a request backend for pinejs-client.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "request.js",
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@types/request": "^2.48.13",
|
|
29
29
|
"lru-cache": "^11.2.1",
|
|
30
|
-
"pinejs-client-core": "^8.
|
|
31
|
-
"request": "^2.88.2"
|
|
32
|
-
"typed-error": "^3.2.2"
|
|
30
|
+
"pinejs-client-core": "^8.4.0",
|
|
31
|
+
"request": "^2.88.2"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@balena/lint": "^9.3.6",
|
|
@@ -49,6 +48,6 @@
|
|
|
49
48
|
]
|
|
50
49
|
},
|
|
51
50
|
"versionist": {
|
|
52
|
-
"publishedAt": "2025-
|
|
51
|
+
"publishedAt": "2025-10-10T17:07:33.138Z"
|
|
53
52
|
}
|
|
54
53
|
}
|
package/request.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { LRUCache } from 'lru-cache';
|
|
2
2
|
import type { Params, AnyObject, AnyResource, Resource } from 'pinejs-client-core';
|
|
3
|
-
import { PinejsClientCore } from 'pinejs-client-core';
|
|
3
|
+
import { PinejsClientCore, StatusError as CoreStatusError } from 'pinejs-client-core';
|
|
4
4
|
import request from 'request';
|
|
5
|
-
import { TypedError } from 'typed-error';
|
|
6
5
|
declare const headersOfInterest: readonly ["retry-after"];
|
|
7
|
-
export declare class StatusError extends
|
|
8
|
-
statusCode: number;
|
|
6
|
+
export declare class StatusError extends CoreStatusError {
|
|
9
7
|
headers: Pick<request.Response['headers'], (typeof headersOfInterest)[number]>;
|
|
10
8
|
constructor(message: string, statusCode: number, headers: request.Response['headers']);
|
|
11
9
|
}
|
package/request.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.PinejsClientRequest = exports.StatusError = void 0;
|
|
7
7
|
const pinejs_client_core_1 = require("pinejs-client-core");
|
|
8
8
|
const request_1 = __importDefault(require("request"));
|
|
9
|
-
const typed_error_1 = require("typed-error");
|
|
10
9
|
const requestAsync = (opts) => new Promise((resolve, reject) => {
|
|
11
10
|
(0, request_1.default)(opts, (err, response) => {
|
|
12
11
|
if (err) {
|
|
@@ -17,12 +16,10 @@ const requestAsync = (opts) => new Promise((resolve, reject) => {
|
|
|
17
16
|
});
|
|
18
17
|
});
|
|
19
18
|
const headersOfInterest = ['retry-after'];
|
|
20
|
-
class StatusError extends
|
|
21
|
-
statusCode;
|
|
19
|
+
class StatusError extends pinejs_client_core_1.StatusError {
|
|
22
20
|
headers = {};
|
|
23
21
|
constructor(message, statusCode, headers) {
|
|
24
|
-
super(message);
|
|
25
|
-
this.statusCode = statusCode;
|
|
22
|
+
super(message, statusCode);
|
|
26
23
|
if (headers != null) {
|
|
27
24
|
for (const header of headersOfInterest) {
|
|
28
25
|
this.headers[header] = headers[header];
|
package/request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["request.ts"],"names":[],"mappings":";;;;;;AAQA,
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["request.ts"],"names":[],"mappings":";;;;;;AAQA,2DAG4B;AAC5B,sDAA8B;AAE9B,MAAM,YAAY,GAAG,CACpB,IAE6C,EACjB,EAAE,CAC9B,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/B,IAAA,iBAAO,EAAC,IAAI,EAAE,CAAC,GAAU,EAAE,QAAQ,EAAE,EAAE;QACtC,IAAI,GAAG,EAAE,CAAC;YACT,MAAM,CAAC,GAAG,CAAC,CAAC;YACZ,OAAO;QACR,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC,CAAC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O,CAAC,IAAK;oBACnB,IAAI;iBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACP,MAAM,IAAI,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YAClD,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACnC,OAAO,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACP,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;YACjE,IAAI,GAAG,IAAI,UAAU,IAAI,UAAU,GAAG,GAAG,EAAE,CAAC;gBAC3C,OAAO,IAAI,CAAC;YACb,CAAC;YACD,MAAM,IAAI,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;IACF,CAAC;CACD;AAtFD,kDAsFC"}
|
package/request.ts
CHANGED
|
@@ -6,9 +6,11 @@ import type {
|
|
|
6
6
|
Resource,
|
|
7
7
|
} from 'pinejs-client-core';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
PinejsClientCore,
|
|
11
|
+
StatusError as CoreStatusError,
|
|
12
|
+
} from 'pinejs-client-core';
|
|
10
13
|
import request from 'request';
|
|
11
|
-
import { TypedError } from 'typed-error';
|
|
12
14
|
|
|
13
15
|
const requestAsync = (
|
|
14
16
|
opts:
|
|
@@ -27,7 +29,7 @@ const requestAsync = (
|
|
|
27
29
|
|
|
28
30
|
const headersOfInterest = ['retry-after'] as const;
|
|
29
31
|
|
|
30
|
-
export class StatusError extends
|
|
32
|
+
export class StatusError extends CoreStatusError {
|
|
31
33
|
public headers: Pick<
|
|
32
34
|
request.Response['headers'],
|
|
33
35
|
(typeof headersOfInterest)[number]
|
|
@@ -35,10 +37,10 @@ export class StatusError extends TypedError {
|
|
|
35
37
|
|
|
36
38
|
constructor(
|
|
37
39
|
message: string,
|
|
38
|
-
|
|
40
|
+
statusCode: number,
|
|
39
41
|
headers: request.Response['headers'],
|
|
40
42
|
) {
|
|
41
|
-
super(message);
|
|
43
|
+
super(message, statusCode);
|
|
42
44
|
if (headers != null) {
|
|
43
45
|
for (const header of headersOfInterest) {
|
|
44
46
|
this.headers[header] = headers[header];
|