@modernpoacher/halacious 7.0.25 → 7.0.26
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 +3 -3
- package/src/index.d.mts +43 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/halacious",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.26",
|
|
4
4
|
"description": "A HAL processor for Hapi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"HAL",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@modernpoacher/hooks": "^1.0.466",
|
|
61
61
|
"@sequencemedia/sinon-chai": "^0.0.6",
|
|
62
62
|
"@types/negotiator": "^0.6.3",
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^7.0
|
|
64
|
-
"@typescript-eslint/parser": "^7.0
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
64
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
65
65
|
"chai": "^5.1.0",
|
|
66
66
|
"cross-env": "^7.0.3",
|
|
67
67
|
"eslint": "^8.57.0",
|
package/src/index.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
7
7
|
|
|
8
8
|
type Representation = HalaciousTypes.Representation
|
|
9
9
|
|
|
10
|
-
export function getRepresentationSelf (arg: Representation): Record<string,
|
|
10
|
+
export function getRepresentationSelf (arg: Representation): Record<string, unknown> | undefined
|
|
11
11
|
|
|
12
12
|
export function hasRepresentationSelf (arg: Representation): boolean
|
|
13
13
|
|
|
@@ -15,15 +15,15 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
15
15
|
|
|
16
16
|
export function hasRepresentationSelfHref (arg: Representation): boolean
|
|
17
17
|
|
|
18
|
-
export function getRepresentationEntity (arg: Representation): Record<string,
|
|
18
|
+
export function getRepresentationEntity (arg: Representation): Record<string, unknown> | undefined
|
|
19
19
|
|
|
20
20
|
export function hasRepresentationEntity (arg: Representation): boolean
|
|
21
21
|
|
|
22
|
-
export function getRepresentationRequest (arg: Representation): Record<string,
|
|
22
|
+
export function getRepresentationRequest (arg: Representation): Record<string, unknown> | undefined
|
|
23
23
|
|
|
24
24
|
export function hasRepresentationRequest (arg: Representation): boolean
|
|
25
25
|
|
|
26
|
-
export function getRepresentationRequestServer (arg: Representation): Record<string,
|
|
26
|
+
export function getRepresentationRequestServer (arg: Representation): Record<string, unknown> | undefined
|
|
27
27
|
|
|
28
28
|
export function hasRepresentationRequestServer (arg: Representation): boolean
|
|
29
29
|
|
|
@@ -31,7 +31,7 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
31
31
|
|
|
32
32
|
export function hasRepresentationRequestPath (arg: Representation): boolean
|
|
33
33
|
|
|
34
|
-
export function getRepresentationRequestRoute (arg: Representation): Record<string,
|
|
34
|
+
export function getRepresentationRequestRoute (arg: Representation): Record<string, unknown> | undefined
|
|
35
35
|
|
|
36
36
|
export function hasRepresentationRequestRoute (arg: Representation): boolean
|
|
37
37
|
|
|
@@ -47,15 +47,15 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
47
47
|
|
|
48
48
|
export function hasRoutePath (arg: { path?: string }): boolean
|
|
49
49
|
|
|
50
|
-
export function getRouteSettings (arg: { settings?: Record<string,
|
|
50
|
+
export function getRouteSettings (arg: { settings?: Record<string, unknown> }): Record<string, unknown>
|
|
51
51
|
|
|
52
52
|
export function getRouteSettingsIsInternal (arg: { settings?: { isInternal?: boolean } }): boolean
|
|
53
53
|
|
|
54
|
-
export function getRouteSettingsPlugins (arg: { settings?: { plugins?: Record<string,
|
|
54
|
+
export function getRouteSettingsPlugins (arg: { settings?: { plugins?: Record<string, unknown> } }): Record<string, unknown>
|
|
55
55
|
|
|
56
|
-
export function getRouteSettingsPluginsHal (arg: { settings?: { plugins?: { hal?: Record<string,
|
|
56
|
+
export function getRouteSettingsPluginsHal (arg: { settings?: { plugins?: { hal?: Record<string, unknown> } } }): Record<string, unknown>
|
|
57
57
|
|
|
58
|
-
export function getRouteSettingsPluginsHalApi (arg: { settings?: { plugins?: { hal?: { api?: Record<string,
|
|
58
|
+
export function getRouteSettingsPluginsHalApi (arg: { settings?: { plugins?: { hal?: { api?: Record<string, unknown> } } } }): Record<string, unknown> | null
|
|
59
59
|
|
|
60
60
|
export function getRouteSettingsPluginsHalQuery (arg: { settings?: { plugins?: { hal?: { query?: string } } } }): string | null
|
|
61
61
|
|
|
@@ -69,9 +69,9 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
69
69
|
|
|
70
70
|
export function hasRequestMethod (arg: { method?: string }): boolean
|
|
71
71
|
|
|
72
|
-
export function getRequestRoute (arg: { route?: Record<string,
|
|
72
|
+
export function getRequestRoute (arg: { route?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
73
73
|
|
|
74
|
-
export function hasRequestRoute (arg: { route?: Record<string,
|
|
74
|
+
export function hasRequestRoute (arg: { route?: Record<string, unknown> }): boolean
|
|
75
75
|
|
|
76
76
|
export function getRequestRoutePath (arg: { route?: { path?: string } }): string | undefined
|
|
77
77
|
|
|
@@ -81,23 +81,23 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
81
81
|
|
|
82
82
|
export function hasRequestRouteMethod (arg: { route?: { method?: string } }): boolean
|
|
83
83
|
|
|
84
|
-
export function getRequestServer (arg: { server?: Record<string,
|
|
84
|
+
export function getRequestServer (arg: { server?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
85
85
|
|
|
86
|
-
export function hasRequestServer (arg: { server?: Record<string,
|
|
86
|
+
export function hasRequestServer (arg: { server?: Record<string, unknown> }): boolean
|
|
87
87
|
|
|
88
|
-
export function getRequestHeaders (arg: { headers?: Record<string,
|
|
88
|
+
export function getRequestHeaders (arg: { headers?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
89
89
|
|
|
90
|
-
export function hasRequestHeaders (arg: { headers?: Record<string,
|
|
90
|
+
export function hasRequestHeaders (arg: { headers?: Record<string, unknown> }): boolean
|
|
91
91
|
|
|
92
92
|
export function getRequestHeadersAccept (arg: { headers?: { accept?: string } }): string | undefined
|
|
93
93
|
|
|
94
|
-
export function getRequestResponse (arg: { response?: Record<string,
|
|
94
|
+
export function getRequestResponse (arg: { response?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
95
95
|
|
|
96
|
-
export function hasRequestResponse (arg: { response?: Record<string,
|
|
96
|
+
export function hasRequestResponse (arg: { response?: Record<string, unknown> }): boolean
|
|
97
97
|
|
|
98
|
-
export function getRequestResponseSource (arg: { response?: { source?: Record<string,
|
|
98
|
+
export function getRequestResponseSource (arg: { response?: { source?: Record<string, unknown> } }): Record<string, unknown> | undefined
|
|
99
99
|
|
|
100
|
-
export function getRequestResponseHeaders (arg: { response?: { headers?: Record<string,
|
|
100
|
+
export function getRequestResponseHeaders (arg: { response?: { headers?: Record<string, unknown> } }): Record<string, unknown> | undefined
|
|
101
101
|
|
|
102
102
|
export function getRequestResponseHeadersLocation (arg: { response?: { headers?: { location?: string } } }): string | undefined
|
|
103
103
|
|
|
@@ -107,11 +107,11 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
107
107
|
|
|
108
108
|
export function isResponseStatusCodeInSuccessRange (statusCode: number | undefined): boolean
|
|
109
109
|
|
|
110
|
-
export function getFieldValueByPath (path?: string, context?: Record<string,
|
|
110
|
+
export function getFieldValueByPath (path?: string, context?: Record<string, unknown>): Record<string, unknown>
|
|
111
111
|
|
|
112
112
|
export function getMediaType (request: { headers: Negotiator.Headers }, mediaTypes: string[]): string
|
|
113
113
|
|
|
114
|
-
export function getTemplateContext (template: string, context: Record<string,
|
|
114
|
+
export function getTemplateContext (template: string, context: Record<string, unknown>): Record<string, unknown>
|
|
115
115
|
|
|
116
116
|
export function getPath (arg: { path?: string }): string | undefined
|
|
117
117
|
|
|
@@ -121,37 +121,37 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
121
121
|
|
|
122
122
|
export function hasMethod (arg: { method?: string }): boolean
|
|
123
123
|
|
|
124
|
-
export function getSelf (arg: { self?: Record<string,
|
|
124
|
+
export function getSelf (arg: { self?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
125
125
|
|
|
126
|
-
export function hasSelf (arg: { self?: Record<string,
|
|
126
|
+
export function hasSelf (arg: { self?: Record<string, unknown> }): boolean
|
|
127
127
|
|
|
128
128
|
export function getHref (arg: { href?: string }): string | undefined
|
|
129
129
|
|
|
130
130
|
export function hasHref (arg: { href?: string }): boolean
|
|
131
131
|
|
|
132
|
-
export function getServer (arg: { server?: Record<string,
|
|
132
|
+
export function getServer (arg: { server?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
133
133
|
|
|
134
|
-
export function hasServer (arg: { server?: Record<string,
|
|
134
|
+
export function hasServer (arg: { server?: Record<string, unknown> }): boolean
|
|
135
135
|
|
|
136
|
-
export function getRequest (arg: { request?: Record<string,
|
|
136
|
+
export function getRequest (arg: { request?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
137
137
|
|
|
138
|
-
export function hasRequest (arg: { request?: Record<string,
|
|
138
|
+
export function hasRequest (arg: { request?: Record<string, unknown> }): boolean
|
|
139
139
|
|
|
140
|
-
export function getResponse (arg: { response?: Record<string,
|
|
140
|
+
export function getResponse (arg: { response?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
141
141
|
|
|
142
|
-
export function hasResponse (arg: { response?: Record<string,
|
|
142
|
+
export function hasResponse (arg: { response?: Record<string, unknown> }): boolean
|
|
143
143
|
|
|
144
|
-
export function getSettings (arg: { settings?: Record<string,
|
|
144
|
+
export function getSettings (arg: { settings?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
145
145
|
|
|
146
|
-
export function hasSettings (arg: { settings?: Record<string,
|
|
146
|
+
export function hasSettings (arg: { settings?: Record<string, unknown> }): boolean
|
|
147
147
|
|
|
148
|
-
export function getHeaders (arg: { headers?: Record<string,
|
|
148
|
+
export function getHeaders (arg: { headers?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
149
149
|
|
|
150
|
-
export function hasHeaders (arg: { headers?: Record<string,
|
|
150
|
+
export function hasHeaders (arg: { headers?: Record<string, unknown> }): boolean
|
|
151
151
|
|
|
152
|
-
export function getEntity (arg: { entity?: Record<string,
|
|
152
|
+
export function getEntity (arg: { entity?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
153
153
|
|
|
154
|
-
export function hasEntity (arg: { entity?: Record<string,
|
|
154
|
+
export function hasEntity (arg: { entity?: Record<string, unknown> }): boolean
|
|
155
155
|
|
|
156
156
|
export function getRoute (arg: { route?: string }): string | undefined
|
|
157
157
|
|
|
@@ -165,9 +165,9 @@ declare module '@modernpoacher/halacious/utils' {
|
|
|
165
165
|
|
|
166
166
|
export function hasPrefix (arg: { prefix?: string }): boolean
|
|
167
167
|
|
|
168
|
-
export function getRels (arg: { rels?: Record<string,
|
|
168
|
+
export function getRels (arg: { rels?: Record<string, unknown> }): Record<string, unknown> | undefined
|
|
169
169
|
|
|
170
|
-
export function hasRels (arg: { rels?: Record<string,
|
|
170
|
+
export function hasRels (arg: { rels?: Record<string, unknown> }): boolean
|
|
171
171
|
|
|
172
172
|
export function getAbsolute (arg: { absolute?: boolean }): boolean | undefined
|
|
173
173
|
|
|
@@ -189,25 +189,25 @@ declare module '@modernpoacher/halacious' {
|
|
|
189
189
|
interface Request {
|
|
190
190
|
method?: string
|
|
191
191
|
path?: string
|
|
192
|
-
server: Record<string,
|
|
192
|
+
server: Record<string, unknown>
|
|
193
193
|
route: {
|
|
194
194
|
method?: string
|
|
195
195
|
path?: string
|
|
196
196
|
}
|
|
197
|
-
params: Record<string,
|
|
197
|
+
params: Record<string, unknown>
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
export interface Representation {
|
|
201
201
|
factory: RepresentationFactory
|
|
202
202
|
request: Request
|
|
203
203
|
self: string | { href?: string }
|
|
204
|
-
entity: Record<string,
|
|
205
|
-
ignore: (v: string) =>
|
|
206
|
-
embed: (v: string, u: string, m:
|
|
204
|
+
entity: Record<string, unknown>
|
|
205
|
+
ignore: (v: string) => undefined
|
|
206
|
+
embed: (v: string, u: string, m: unknown[] | Record<string, unknown>) => undefined
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
export interface RepresentationFactory {
|
|
210
|
-
create: (entity: Record<string,
|
|
210
|
+
create: (entity: Record<string, string | number | object>, self?: string | { href?: string }, root?: Representation) => Representation
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|