@furystack/rest 7.0.0 → 7.0.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.
@@ -1,5 +1,5 @@
1
1
  export declare class RequestError extends Error {
2
- responseCode: number;
2
+ readonly responseCode: number;
3
3
  constructor(msg: string, responseCode: number);
4
4
  }
5
5
  //# sourceMappingURL=request-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-error.d.ts","sourceRoot":"","sources":["../src/request-error.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IAG5B,YAAY,EAAE,MAAM;gBAD3B,GAAG,EAAE,MAAM,EACJ,YAAY,EAAE,MAAM;CAI9B"}
1
+ {"version":3,"file":"request-error.d.ts","sourceRoot":"","sources":["../src/request-error.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;aAGnB,YAAY,EAAE,MAAM;gBADpC,GAAG,EAAE,MAAM,EACK,YAAY,EAAE,MAAM;CAIvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"request-error.js","sourceRoot":"","sources":["../src/request-error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IAG5B;IAFT,YACE,GAAW,EACJ,YAAoB;QAE3B,KAAK,CAAC,GAAG,CAAC,CAAA;QAFH,iBAAY,GAAZ,YAAY,CAAQ;IAG7B,CAAC;CACF"}
1
+ {"version":3,"file":"request-error.js","sourceRoot":"","sources":["../src/request-error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IAGnB;IAFlB,YACE,GAAW,EACK,YAAoB;QAEpC,KAAK,CAAC,GAAG,CAAC,CAAA;QAFM,iBAAY,GAAZ,YAAY,CAAQ;IAGtC,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=request-error.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-error.spec.d.ts","sourceRoot":"","sources":["../src/request-error.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { RequestError } from './request-error.js';
2
+ import { describe, expect, it } from 'vitest';
3
+ describe('RequestError', () => {
4
+ it('Should be constructed', () => {
5
+ const error = new RequestError('unauthorized', 401);
6
+ expect(error).toBeInstanceOf(Error);
7
+ expect(error.responseCode).toBe(401);
8
+ expect(error.message).toBe('unauthorized');
9
+ });
10
+ });
11
+ //# sourceMappingURL=request-error.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-error.spec.js","sourceRoot":"","sources":["../src/request-error.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;QACnD,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACpC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@furystack/rest",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Generic REST package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "homepage": "https://github.com/furystack/furystack",
39
39
  "dependencies": {
40
- "@furystack/core": "^14.0.0",
41
- "@furystack/inject": "^10.0.0"
40
+ "@furystack/core": "^14.0.1",
41
+ "@furystack/inject": "^11.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/node": "^20.11.29",
45
- "typescript": "^5.4.2",
44
+ "@types/node": "^20.11.30",
45
+ "typescript": "^5.4.3",
46
46
  "vitest": "^1.4.0"
47
47
  },
48
48
  "gitHead": "1045d854bfd8c475b7035471d130d401417a2321"
@@ -0,0 +1,11 @@
1
+ import { RequestError } from './request-error.js'
2
+ import { describe, expect, it } from 'vitest'
3
+
4
+ describe('RequestError', () => {
5
+ it('Should be constructed', () => {
6
+ const error = new RequestError('unauthorized', 401)
7
+ expect(error).toBeInstanceOf(Error)
8
+ expect(error.responseCode).toBe(401)
9
+ expect(error.message).toBe('unauthorized')
10
+ })
11
+ })
@@ -1,7 +1,7 @@
1
1
  export class RequestError extends Error {
2
2
  constructor(
3
3
  msg: string,
4
- public responseCode: number,
4
+ public readonly responseCode: number,
5
5
  ) {
6
6
  super(msg)
7
7
  }