@clipboard-health/json-api 0.32.1 → 1.0.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/package.json +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +0 -1
- package/src/index.js.map +1 -1
- package/src/lib/types.d.ts +4 -12
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipboard-health/json-api",
|
|
3
3
|
"description": "TypeScript-friendly utilities for adhering to the JSON:API specification.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"tslib": "2.8.1"
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -3,5 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./lib/query/parseQuery"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./lib/query/stringifyQuery"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/types"), exports);
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/json-api/src/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,qEAA2C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/json-api/src/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,qEAA2C"}
|
package/src/lib/types.d.ts
CHANGED
|
@@ -11,9 +11,7 @@ export type FilterOperator = "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
|
11
11
|
export type PageKey = "cursor" | "limit" | "number" | "offset" | "size";
|
|
12
12
|
export { type URLSearchParams } from "node:url";
|
|
13
13
|
export type FilterValue = Date | number | string | boolean;
|
|
14
|
-
export type FilterObject =
|
|
15
|
-
[K in FilterOperator]?: FilterValue | FilterValue[];
|
|
16
|
-
};
|
|
14
|
+
export type FilterObject = Partial<Record<FilterOperator, FilterValue | FilterValue[]>>;
|
|
17
15
|
export interface NestedFilter {
|
|
18
16
|
[key: string]: FilterValue | FilterValue[] | FilterObject | NestedFilter | undefined;
|
|
19
17
|
}
|
|
@@ -46,9 +44,7 @@ export interface ClientJsonApiQuery {
|
|
|
46
44
|
* @see {@link https://jsonapi.org/format/#fetching-pagination JSON:API pagination}
|
|
47
45
|
* @see {@link https://jsonapi.org/examples/#pagination JSON:API pagination examples}
|
|
48
46
|
*/
|
|
49
|
-
page?:
|
|
50
|
-
[K in PageKey]?: number | string;
|
|
51
|
-
};
|
|
47
|
+
page?: Partial<Record<PageKey, number | string>>;
|
|
52
48
|
/**
|
|
53
49
|
* Sorting data. Include the "-" prefix for descending order.
|
|
54
50
|
*
|
|
@@ -72,9 +68,7 @@ export interface ServerJsonApiQuery {
|
|
|
72
68
|
* @see {@link https://jsonapi.org/recommendations/#filtering JSON:API filtering}
|
|
73
69
|
* @see {@link https://discuss.jsonapi.org/t/share-propose-a-filtering-strategy/257 JSON:API filtering strategy}
|
|
74
70
|
*/
|
|
75
|
-
filter?: Record<string, string | string[] |
|
|
76
|
-
[K in FilterOperator]?: string | string[];
|
|
77
|
-
}>;
|
|
71
|
+
filter?: Record<string, string | string[] | Partial<Record<FilterOperator, string | string[]>>>;
|
|
78
72
|
/**
|
|
79
73
|
* Relationships to include in the response.
|
|
80
74
|
*
|
|
@@ -87,9 +81,7 @@ export interface ServerJsonApiQuery {
|
|
|
87
81
|
* @see {@link https://jsonapi.org/format/#fetching-pagination JSON:API pagination}
|
|
88
82
|
* @see {@link https://jsonapi.org/examples/#pagination JSON:API pagination examples}
|
|
89
83
|
*/
|
|
90
|
-
page?:
|
|
91
|
-
[K in PageKey]?: string;
|
|
92
|
-
};
|
|
84
|
+
page?: Partial<Record<PageKey, string>>;
|
|
93
85
|
/**
|
|
94
86
|
* Sorting data. Include the "-" prefix for descending order.
|
|
95
87
|
*
|