@modernpoacher/halacious 7.0.3 → 7.0.4

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/src/utils.mjs ADDED
@@ -0,0 +1,382 @@
1
+ export function getRepresentationSelf (representation) {
2
+ return getSelf(representation)
3
+ }
4
+
5
+ export function hasRepresentationSelf (representation) {
6
+ return hasSelf(representation)
7
+ }
8
+
9
+ export function getRepresentationSelfHref (representation) {
10
+ return getHref(getRepresentationSelf(representation))
11
+ }
12
+
13
+ export function hasRepresentationSelfHref (representation) {
14
+ return hasHref(getRepresentationSelf(representation))
15
+ }
16
+
17
+ export function getRepresentationEntity (representation) {
18
+ return getEntity(representation)
19
+ }
20
+
21
+ export function hasRepresentationEntity (representation) {
22
+ return hasEntity(representation)
23
+ }
24
+
25
+ export function getRepresentationRequest (representation) {
26
+ return getRequest(representation)
27
+ }
28
+
29
+ export function hasRepresentationRequest (representation) {
30
+ return hasRequest(representation)
31
+ }
32
+
33
+ export function getRepresentationRequestServer (representation) {
34
+ return getServer(getRepresentationRequest(representation))
35
+ }
36
+
37
+ export function hasRepresentationRequestServer (representation) {
38
+ return hasServer(getRepresentationRequest(representation))
39
+ }
40
+
41
+ export function getRepresentationRequestPath (representation) {
42
+ return getPath(getRepresentationRequest(representation))
43
+ }
44
+
45
+ export function hasRepresentationRequestPath (representation) {
46
+ return hasPath(getRepresentationRequest(representation))
47
+ }
48
+
49
+ export function getRepresentationRequestRoute (representation) {
50
+ return getRoute(getRepresentationRequest(representation))
51
+ }
52
+
53
+ export function hasRepresentationRequestRoute (representation) {
54
+ return hasRoute(getRepresentationRequest(representation))
55
+ }
56
+
57
+ export function getRepresentationRequestRoutePath (representation) {
58
+ return getPath(getRepresentationRequestRoute(representation))
59
+ }
60
+
61
+ export function hasRepresentationRequestRoutePath (representation) {
62
+ return hasPath(getRepresentationRequestRoute(representation))
63
+ }
64
+
65
+ export function getRepresentationRequestRouteMethod (representation) {
66
+ return getMethod(getRepresentationRequestRoute(representation))
67
+ }
68
+
69
+ export function hasRepresentationRequestRouteMethod (representation) {
70
+ return hasMethod(getRepresentationRequestRoute(representation))
71
+ }
72
+
73
+ export function getRoutePath (route) {
74
+ return getPath(route)
75
+ }
76
+
77
+ export function hasRoutePath (route) {
78
+ return hasPath(route)
79
+ }
80
+
81
+ export function getRouteSettings (route) {
82
+ return getSettings(route)
83
+ }
84
+
85
+ export function hasRouteSettings (route) {
86
+ return hasSettings(route)
87
+ }
88
+
89
+ export function getRouteSettingsIsInternal (route) {
90
+ const {
91
+ isInternal = false
92
+ } = getRouteSettings(route) // ?? {}
93
+
94
+ return isInternal
95
+ }
96
+
97
+ export function getRouteSettingsPlugins (route) {
98
+ const {
99
+ plugins = {}
100
+ } = getRouteSettings(route) // ?? {}
101
+
102
+ return plugins
103
+ }
104
+
105
+ export function getRouteSettingsPluginsHal (route) {
106
+ const {
107
+ hal = {}
108
+ } = getRouteSettingsPlugins(route) // ?? {}
109
+
110
+ return hal
111
+ }
112
+
113
+ export function getRouteSettingsPluginsHalApi (route) {
114
+ const {
115
+ api = null
116
+ } = getRouteSettingsPluginsHal(route) // ?? {}
117
+
118
+ return api
119
+ }
120
+
121
+ export function getRouteSettingsPluginsHalQuery (route) {
122
+ return getQuery(getRouteSettingsPluginsHal(route)) || null
123
+ }
124
+
125
+ export function getRouteSettingsPluginsHalAbsolute (route) {
126
+ return getAbsolute(getRouteSettingsPluginsHal(route)) || null
127
+ }
128
+
129
+ export function getRequestPath (request) {
130
+ return getPath(request)
131
+ }
132
+
133
+ export function hasRequestPath (request) {
134
+ return hasPath(request)
135
+ }
136
+
137
+ export function getRequestMethod (request) {
138
+ return getMethod(request)
139
+ }
140
+
141
+ export function hasRequestMethod (request) {
142
+ return hasMethod(request)
143
+ }
144
+
145
+ export function getRequestRoute (request) {
146
+ return getRoute(request)
147
+ }
148
+
149
+ export function hasRequestRoute (request) {
150
+ return hasRoute(request)
151
+ }
152
+
153
+ export function getRequestRoutePath (request) {
154
+ return getPath(getRequestRoute(request))
155
+ }
156
+
157
+ export function hasRequestRoutePath (request) {
158
+ return hasPath(getRequestRoute(request))
159
+ }
160
+
161
+ export function getRequestRouteMethod (request) {
162
+ return getMethod(getRequestRoute(request))
163
+ }
164
+
165
+ export function hasRequestRouteMethod (request) {
166
+ return hasMethod(getRequestRoute(request))
167
+ }
168
+
169
+ export function getRequestServer (request) {
170
+ return getServer(request)
171
+ }
172
+
173
+ export function hasRequestServer (request) {
174
+ return hasServer(request)
175
+ }
176
+
177
+ export function getRequestHeaders (request) {
178
+ return getHeaders(request)
179
+ }
180
+
181
+ export function hasRequestHeaders (request) {
182
+ return hasHeaders(request)
183
+ }
184
+
185
+ export function getRequestHeadersAccept (request) {
186
+ const {
187
+ accept
188
+ } = getRequestHeaders(request) ?? {}
189
+
190
+ return accept
191
+ }
192
+
193
+ export function getRequestResponse (request) {
194
+ return getResponse(request)
195
+ }
196
+
197
+ export function hasRequestResponse (request) {
198
+ return hasResponse(request)
199
+ }
200
+
201
+ export function getRequestResponseSource (request) {
202
+ const {
203
+ source
204
+ } = getRequestResponse(request) ?? {}
205
+
206
+ return source
207
+ }
208
+
209
+ export function getRequestResponseHeaders (request) {
210
+ return getHeaders(getRequestResponse(request))
211
+ }
212
+
213
+ export function getRequestResponseHeadersLocation (request) {
214
+ const {
215
+ location
216
+ } = getRequestResponseHeaders(request) ?? {}
217
+
218
+ return location
219
+ }
220
+
221
+ export function getResponseVariety ({ variety }) {
222
+ return variety
223
+ }
224
+
225
+ export function getResponseStatusCode ({ statusCode }) {
226
+ return statusCode
227
+ }
228
+
229
+ export function isResponseStatusCodeInSuccessRange (statusCode) {
230
+ return statusCode >= 200 && statusCode < 300
231
+ }
232
+
233
+ export { default as getFieldValueByPath } from './utils/getFieldValueByPath.mjs'
234
+
235
+ export { default as getMediaType } from './utils/getMediaType.mjs'
236
+
237
+ export { default as getTemplateContext } from './utils/getTemplateContext.mjs'
238
+
239
+ export function getPath ({ path }) {
240
+ return path
241
+ }
242
+
243
+ export function hasPath (arg) {
244
+ return Boolean(getPath(arg))
245
+ }
246
+
247
+ export function getMethod ({ method }) {
248
+ return method
249
+ }
250
+
251
+ export function hasMethod (arg) {
252
+ return Boolean(getMethod(arg))
253
+ }
254
+
255
+ export function getSelf ({ self }) {
256
+ return self
257
+ }
258
+
259
+ export function hasSelf (arg) {
260
+ return Boolean(getSelf(arg))
261
+ }
262
+
263
+ export function getHref ({ href }) {
264
+ return href
265
+ }
266
+
267
+ export function hasHref (arg) {
268
+ return Boolean(getHref(arg))
269
+ }
270
+
271
+ export function getServer ({ server }) {
272
+ return server
273
+ }
274
+
275
+ export function hasServer (arg) {
276
+ return Boolean(getServer(arg))
277
+ }
278
+
279
+ export function getRequest ({ request }) {
280
+ return request
281
+ }
282
+
283
+ export function hasRequest (arg) {
284
+ return Boolean(getRequest(arg))
285
+ }
286
+
287
+ export function getResponse ({ response }) {
288
+ return response
289
+ }
290
+
291
+ export function hasResponse (arg) {
292
+ return Boolean(getResponse(arg))
293
+ }
294
+
295
+ export function getSettings ({ settings }) {
296
+ return settings
297
+ }
298
+
299
+ export function hasSettings (arg) {
300
+ return Boolean(getSettings(arg))
301
+ }
302
+
303
+ export function getHeaders ({ headers }) {
304
+ return headers
305
+ }
306
+
307
+ export function hasHeaders (arg) {
308
+ return Boolean(getHeaders(arg))
309
+ }
310
+
311
+ export function getEntity ({ entity }) {
312
+ return entity
313
+ }
314
+
315
+ export function hasEntity (arg) {
316
+ return Boolean(getEntity(arg))
317
+ }
318
+
319
+ export function getRoute ({ route }) {
320
+ return route
321
+ }
322
+
323
+ export function hasRoute (arg) {
324
+ return Boolean(getRoute(arg))
325
+ }
326
+
327
+ export function getName ({ name }) {
328
+ return name
329
+ }
330
+
331
+ export function hasName (arg) {
332
+ return Boolean(getName(arg))
333
+ }
334
+
335
+ export function getPrefix ({ prefix }) {
336
+ return prefix
337
+ }
338
+
339
+ export function hasPrefix (arg) {
340
+ return Boolean(getPrefix(arg))
341
+ }
342
+
343
+ export function getRels ({ rels }) {
344
+ return rels
345
+ }
346
+
347
+ export function hasRels (arg) {
348
+ return Boolean(getRels(arg))
349
+ }
350
+
351
+ export function getAbsolute ({ absolute }) {
352
+ return absolute
353
+ }
354
+
355
+ export function hasAbsolute (arg) {
356
+ return Boolean(getAbsolute(arg))
357
+ }
358
+
359
+ export function getQuery ({ query }) {
360
+ return query
361
+ }
362
+
363
+ export function hasQuery (arg) {
364
+ return Boolean(getQuery(arg))
365
+ }
366
+
367
+ export function getIgnore ({ ignore }) {
368
+ return ignore
369
+ }
370
+
371
+ export function hasIgnore (arg) {
372
+ return Boolean(getIgnore(arg))
373
+ }
374
+
375
+ export function isRelativePath (path = '') {
376
+ const p = String(path ?? '')
377
+
378
+ return (
379
+ p.startsWith('./') ||
380
+ p.startsWith('../')
381
+ )
382
+ }
@@ -0,0 +1,11 @@
1
+ doctype html
2
+ body
3
+ h1 Namespaces
4
+ ul
5
+ each namespace in namespaces
6
+ li
7
+ h2= namespace.name
8
+ =namespace.description
9
+ ul
10
+ each rel in namespace.rels
11
+ li #[a(href=path + "/" + namespace.name + "/" + rel.name) #{rel.name}] #{rel.description}
package/views/rel.jade ADDED
@@ -0,0 +1,7 @@
1
+ doctype html
2
+ head
3
+ title=rel.name
4
+ body
5
+ h1=rel.name
6
+ =rel.description
7
+ !=relData
package/index.d.mts DELETED
@@ -1,7 +0,0 @@
1
- declare module '@modernpoacher/halacious' {
2
- const plugin: object
3
-
4
- export {
5
- plugin
6
- }
7
- }