@clipboard-health/util-ts 0.7.4 → 0.9.0
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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -1
- package/src/index.js +23 -9
- package/src/index.js.map +1 -1
- package/src/lib/cbh-error.d.ts +7 -2
- package/src/lib/cbh-error.d.ts.map +1 -1
- package/src/lib/cbh-error.js +1 -0
- package/src/lib/cbh-error.js.map +1 -1
- package/src/lib/head.d.ts +2 -0
- package/src/lib/head.d.ts.map +1 -0
- package/src/lib/head.js +8 -0
- package/src/lib/head.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.9.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.8.0...util-ts-0.9.0) (2023-08-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add typed API relationships, add pagination and API error examples ([#256](https://github.com/ClipboardHealth/cbh-core/issues/256)) ([81377e3](https://github.com/ClipboardHealth/cbh-core/commit/81377e357af447c764ed668196a5c025e35aff35))
|
|
11
|
+
|
|
12
|
+
## [0.8.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.4...util-ts-0.8.0) (2023-08-10)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* add API errors with helpers to create them from CbhError ([#252](https://github.com/ClipboardHealth/cbh-core/issues/252)) ([0efb42a](https://github.com/ClipboardHealth/cbh-core/commit/0efb42a9ef44831bf08b05a6ae19a55cfc38742a))
|
|
18
|
+
|
|
5
19
|
## [0.7.4](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.3...util-ts-0.7.4) (2023-07-12)
|
|
6
20
|
|
|
7
21
|
## [0.7.3](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.2...util-ts-0.7.3) (2023-07-10)
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./lib/cbh-error";
|
|
|
2
2
|
export * from "./lib/cbh-response";
|
|
3
3
|
export * from "./lib/defined-utils";
|
|
4
4
|
export * from "./lib/force-cast";
|
|
5
|
+
export * from "./lib/head";
|
|
5
6
|
export * from "./lib/is-string";
|
|
6
7
|
export * from "./lib/non-empty-array";
|
|
7
8
|
export * from "./lib/stringify";
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
package/src/index.js
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
__exportStar(require("./lib/cbh-error"), exports);
|
|
18
|
+
__exportStar(require("./lib/cbh-response"), exports);
|
|
19
|
+
__exportStar(require("./lib/defined-utils"), exports);
|
|
20
|
+
__exportStar(require("./lib/force-cast"), exports);
|
|
21
|
+
__exportStar(require("./lib/head"), exports);
|
|
22
|
+
__exportStar(require("./lib/is-string"), exports);
|
|
23
|
+
__exportStar(require("./lib/non-empty-array"), exports);
|
|
24
|
+
__exportStar(require("./lib/stringify"), exports);
|
|
25
|
+
__exportStar(require("./lib/to-error"), exports);
|
|
12
26
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,qDAAmC;AACnC,sDAAoC;AACpC,mDAAiC;AACjC,6CAA2B;AAC3B,kDAAgC;AAChC,wDAAsC;AACtC,kDAAgC;AAChC,iDAA+B"}
|
package/src/lib/cbh-error.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type OneOrNonEmptyArray } from "./non-empty-array";
|
|
2
|
+
declare const ERROR_STATUS_CODES: readonly [400, 401, 403, 404, 409, 429, 500];
|
|
3
|
+
export type ErrorStatusCode = (typeof ERROR_STATUS_CODES)[number];
|
|
2
4
|
export interface CbhIssue {
|
|
3
5
|
cause?: Error;
|
|
6
|
+
id?: string;
|
|
4
7
|
message: string;
|
|
8
|
+
statusCode?: ErrorStatusCode;
|
|
5
9
|
}
|
|
6
10
|
export declare class CbhError extends Error {
|
|
7
|
-
readonly issues:
|
|
11
|
+
readonly issues: CbhIssue[];
|
|
8
12
|
constructor(issues: OneOrNonEmptyArray<CbhIssue>);
|
|
9
13
|
}
|
|
14
|
+
export {};
|
|
10
15
|
//# sourceMappingURL=cbh-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cbh-error.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"cbh-error.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;AAE7E,QAAA,MAAM,kBAAkB,8CAA+C,CAAC;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAgB,MAAM,EAAE,QAAQ,EAAE,CAAC;gBAEvB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC;CAUjD"}
|
package/src/lib/cbh-error.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CbhError = void 0;
|
|
4
4
|
const non_empty_array_1 = require("./non-empty-array");
|
|
5
|
+
const ERROR_STATUS_CODES = [400, 401, 403, 404, 409, 429, 500];
|
|
5
6
|
class CbhError extends Error {
|
|
6
7
|
issues;
|
|
7
8
|
constructor(issues) {
|
package/src/lib/cbh-error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cbh-error.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-error.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"cbh-error.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-error.ts"],"names":[],"mappings":";;;AAAA,uDAA6E;AAE7E,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAUxE,MAAa,QAAS,SAAQ,KAAK;IACjB,MAAM,CAAa;IAEnC,YAAY,MAAoC;QAC9C,MAAM,EAAE,GAAG,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACpB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/C,6FAA6F;QAC7F,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAElD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAbD,4BAaC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/head.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,SAAS,CAEtD"}
|
package/src/lib/head.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/head.ts"],"names":[],"mappings":";;;AAAA,SAAgB,IAAI,CAAI,KAAe;IACrC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC;AAC9D,CAAC;AAFD,oBAEC"}
|