@fjell/express-router 4.4.0 → 4.4.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.
@@ -64,4 +64,4 @@ class PItemRouter extends ItemRouter {
64
64
  }
65
65
 
66
66
  export { PItemRouter };
67
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUEl0ZW1Sb3V0ZXIuanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
67
+ //# sourceMappingURL=PItemRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PItemRouter.js","sources":["../src/PItemRouter.ts"],"sourcesContent":["import { Item, ItemQuery, paramsToQuery, PriKey, QueryParams, validatePK } from \"@fjell/core\";\nimport { Primary } from \"@fjell/lib\";\nimport { ItemRouter, ItemRouterOptions } from \"@/ItemRouter\";\nimport { Request, Response } from \"express\";\nimport LibLogger from \"@/logger\";\n\nconst logger = LibLogger.get('PItemRouter');\n\ninterface ParsedQuery {\n [key: string]: undefined | string | string[] | ParsedQuery | ParsedQuery[];\n}\n\nexport class PItemRouter<T extends Item<S>, S extends string> extends ItemRouter<S> {\n\n constructor(lib: Primary.Operations<T, S>, keyType: S, options: ItemRouterOptions = {}) {\n super(lib, keyType, options);\n }\n\n public getIk(res: Response): PriKey<S> {\n const pri = this.getPk(res) as PriKey<S>;\n return pri\n }\n\n public createItem = async (req: Request, res: Response) => {\n logger.default('Creating Item 2', { body: req.body, query: req.query, params: req.params, locals: res.locals });\n const itemToCreate = this.convertDates(req.body as Item<S>);\n let item =\n validatePK(await this.lib.create(itemToCreate), this.getPkType()) as Item<S>;\n item = await this.postCreateItem(item);\n return res.json(item);\n };\n\n /* eslint-disable */\n protected findItems = async (req: Request, res: Response) => {\n logger.default('Finding Items', { query: req.query, params: req.params, locals: res.locals });\n\n let items: Item<S>[] = [];\n\n const query: ParsedQuery = req.query as unknown as ParsedQuery;\n const finder = query['finder'] as string;\n const finderParams = query['finderParams'] as string;\n\n if( finder ) { \n // If finder is defined? Call a finder.\n logger.default('Finding Items with a finder', { finder, finderParams });\n items = await this.lib.find(finder, JSON.parse(finderParams));\n } else {\n logger.default('Finding Items with a query', { query: req.query });\n // TODO: This is once of the more important places to perform some validaation and feedback\n const itemQuery: ItemQuery = paramsToQuery(req.query as QueryParams);\n items = await this.lib.all(itemQuery);\n }\n\n return res.json(items.map((item: Item<S>) => validatePK(item, this.getPkType())));\n };\n /* eslint-enable */\n}\n"],"names":["logger","LibLogger","get","PItemRouter","ItemRouter","getIk","res","pri","getPk","lib","keyType","options","createItem","req","default","body","query","params","locals","itemToCreate","convertDates","item","validatePK","create","getPkType","postCreateItem","json","findItems","items","finder","finderParams","find","JSON","parse","itemQuery","paramsToQuery","all","map"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAMA,MAAAA,GAASC,SAAUC,CAAAA,GAAG,CAAC,aAAA,CAAA;AAMtB,MAAMC,WAAyDC,SAAAA,UAAAA,CAAAA;AAM7DC,IAAAA,KAAAA,CAAMC,GAAa,EAAa;AACrC,QAAA,MAAMC,GAAM,GAAA,IAAI,CAACC,KAAK,CAACF,GAAAA,CAAAA;QACvB,OAAOC,GAAAA;AACT;AAPA,IAAA,WAAA,CAAYE,GAA6B,EAAEC,OAAU,EAAEC,OAA6B,GAAA,EAAE,CAAE;AACtF,QAAA,KAAK,CAACF,GAAKC,EAAAA,OAAAA,EAASC,UAQtB,gBAAOC,CAAAA,IAAAA,EAAAA,YAAAA,EAAa,OAAOC,GAAcP,EAAAA,GAAAA,GAAAA;YACvCN,MAAOc,CAAAA,OAAO,CAAC,iBAAmB,EAAA;AAAEC,gBAAAA,IA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YAAAA,CAAAA,CAAAA;aAC1C,MAAA;gBACL9B,MAAOc,CAAAA,OAAO,CAAC,4BAA8B,EAAA;AAAEE,oBAAAA,KAAAA,EAAOH,IAAIG;AAAM,iBAAA,CAAA;;gBAEhE,MAAMkB,SAAAA,GAAuBC,aAActB,CAAAA,GAAAA,CAAIG,KAAK,CAAA;AACpDY,gBAAAA,KAAAA,GAAQ,MAAM,IAAI,CAACnB,GAAG,CAAC2B,GAAG,CAACF,SAAAA,CAAAA;AAC7B;AAEA,YAAA,OAAO5B,GAAIoB,CAAAA,IAAI,CAACE,KAAAA,CAAMS,GAAG,CAAC,CAAChB,IAAAA,GAAkBC,UAAWD,CAAAA,IAAAA,EAAM,IAAI,CAACG,SAAS,EAAA,CAAA,CAAA,CAAA;AAC9E,SAAA,CAAA;AAtCA;AAwCF;;;;"}
package/dist/index.cjs ADDED
@@ -0,0 +1,437 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const core = require('@fjell/core');
6
+ const lib = require('@fjell/lib');
7
+ const deepmerge = require('deepmerge');
8
+ const express = require('express');
9
+ const Logging = require('@fjell/logging');
10
+
11
+ const LibLogger = Logging.getLogger('@fjell/express-router');
12
+
13
+ function _define_property$2(obj, key, value) {
14
+ if (key in obj) {
15
+ Object.defineProperty(obj, key, {
16
+ value: value,
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true
20
+ });
21
+ } else {
22
+ obj[key] = value;
23
+ }
24
+ return obj;
25
+ }
26
+ class ItemRouter {
27
+ getLk(res) {
28
+ return {
29
+ kt: this.keyType,
30
+ lk: res.locals[this.getPkParam()]
31
+ };
32
+ }
33
+ // this is meant to be consumed by children routers
34
+ getLKA(res) {
35
+ return [
36
+ this.getLk(res)
37
+ ];
38
+ }
39
+ getPk(res) {
40
+ return core.cPK(res.locals[this.getPkParam()], this.getPkType());
41
+ }
42
+ // Unless this is a contained router, the locations will always be an empty array.
43
+ /* eslint-disable */ getLocations(res) {
44
+ throw new Error('Method not implemented in an abstract router');
45
+ }
46
+ /* eslint-enable */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
+ getIk(res) {
48
+ throw new Error('Method not implemented in an abstract router');
49
+ }
50
+ /* istanbul ignore next */ configureItemActions() {
51
+ this.logger.debug('ARouter - No Item Actions Configured');
52
+ return {};
53
+ }
54
+ /* istanbul ignore next */ configureAllActions() {
55
+ this.logger.debug('ARouter - No All Actions Configured');
56
+ return {};
57
+ }
58
+ /* istanbul ignore next */ getRouter() {
59
+ const router = express.Router();
60
+ this.configure(router);
61
+ return router;
62
+ }
63
+ constructor(lib$1, keyType, options = {}){
64
+ _define_property$2(this, "lib", void 0);
65
+ _define_property$2(this, "keyType", void 0);
66
+ _define_property$2(this, "options", void 0);
67
+ _define_property$2(this, "childRouters", {});
68
+ _define_property$2(this, "logger", void 0);
69
+ _define_property$2(this, "itemActions", void 0);
70
+ _define_property$2(this, "getPkType", ()=>{
71
+ return this.keyType;
72
+ });
73
+ _define_property$2(this, "getPkParam", ()=>{
74
+ return `${this.getPkType()}Pk`;
75
+ });
76
+ _define_property$2(this, "postItemAction", async (req, res)=>{
77
+ this.logger.default('Getting Item', {
78
+ query: req === null || req === void 0 ? void 0 : req.query,
79
+ params: req === null || req === void 0 ? void 0 : req.params,
80
+ locals: res === null || res === void 0 ? void 0 : res.locals
81
+ });
82
+ const ik = this.getIk(res);
83
+ const actionKey = req.path.substring(req.path.lastIndexOf('/') + 1);
84
+ if (!this.itemActions) {
85
+ this.logger.error('Item Actions are not configured');
86
+ return res.status(500).json({
87
+ error: 'Item Actions are not configured'
88
+ });
89
+ }
90
+ try {
91
+ const item = core.validatePK(await this.lib.get(ik), this.getPkType());
92
+ return res.json(await this.itemActions[actionKey](req, res, item, req.params, req.body));
93
+ } catch (err) {
94
+ this.logger.error('Error in Item Action', {
95
+ message: err === null || err === void 0 ? void 0 : err.message,
96
+ stack: err === null || err === void 0 ? void 0 : err.stack
97
+ });
98
+ return res.status(500).json(err);
99
+ }
100
+ });
101
+ _define_property$2(this, "configure", (router)=>{
102
+ this.logger.default('Configuring Router', {
103
+ pkType: this.getPkType()
104
+ });
105
+ router.get('/', this.findItems);
106
+ router.post('/', this.createItem);
107
+ const allActions = this.configureAllActions();
108
+ this.logger.debug('All Actions supplied to Router', {
109
+ allActions
110
+ });
111
+ if (allActions) {
112
+ Object.keys(allActions).forEach((actionKey)=>{
113
+ this.logger.default('Configuring All Action', {
114
+ actionKey
115
+ });
116
+ // TODO: Ok, this is a bit of a hack, but we need to customize the types of the request handlers
117
+ router.post(`/${actionKey}`, ...allActions[actionKey]);
118
+ });
119
+ }
120
+ const itemRouter = express.Router();
121
+ itemRouter.get('/', this.getItem);
122
+ itemRouter.put('/', this.updateItem);
123
+ itemRouter.delete('/', this.deleteItem);
124
+ this.itemActions = this.configureItemActions();
125
+ this.logger.debug('Item Actions supplied to Router', {
126
+ itemActions: this.itemActions
127
+ });
128
+ if (this.itemActions) {
129
+ Object.keys(this.itemActions).forEach((actionKey)=>{
130
+ this.logger.default('Configuring Item Action', {
131
+ actionKey
132
+ });
133
+ // TODO: Ok, this is a bit of a hack, but we need to customize the types of the request handlers
134
+ itemRouter.post(`/${actionKey}`, this.postItemAction);
135
+ });
136
+ }
137
+ this.logger.default('Configuring Item Operations under PK Param', {
138
+ pkParam: this.getPkParam()
139
+ });
140
+ router.use(`/:${this.getPkParam()}`, this.validatePrimaryKeyValue, itemRouter);
141
+ if (this.childRouters) {
142
+ this.configureChildRouters(itemRouter, this.childRouters);
143
+ }
144
+ return router;
145
+ });
146
+ _define_property$2(this, "validatePrimaryKeyValue", (req, res, next)=>{
147
+ const pkParamValue = req.params[this.getPkParam()];
148
+ if (this.validatePKParam(pkParamValue)) {
149
+ res.locals[this.getPkParam()] = pkParamValue;
150
+ next();
151
+ } else {
152
+ this.logger.error('Invalid Primary Key', {
153
+ pkParamValue,
154
+ path: req === null || req === void 0 ? void 0 : req.path
155
+ });
156
+ res.status(500).json({
157
+ error: 'Invalid Primary Key',
158
+ path: req === null || req === void 0 ? void 0 : req.path
159
+ });
160
+ }
161
+ });
162
+ _define_property$2(this, "configureChildRouters", (router, childRouters)=>{
163
+ for(const path in childRouters){
164
+ this.logger.default('Configuring Child Router at Path', {
165
+ path
166
+ });
167
+ router.use(`/${path}`, childRouters[path]);
168
+ }
169
+ return router;
170
+ });
171
+ _define_property$2(this, "addChildRouter", (path, router)=>{
172
+ this.childRouters[path] = router;
173
+ });
174
+ /* istanbul ignore next */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
175
+ _define_property$2(this, "createItem", async (req, res)=>{
176
+ throw new Error('Method not implemented in an abstract router');
177
+ });
178
+ // TODO: Probably a better way to do this, but this postCreate hook only needs the item.
179
+ /* istanbul ignore next */ _define_property$2(this, "postCreateItem", async (item)=>{
180
+ this.logger.default('Post Create Item', {
181
+ item
182
+ });
183
+ return item;
184
+ });
185
+ _define_property$2(this, "deleteItem", async (req, res)=>{
186
+ this.logger.default('Deleting Item', {
187
+ query: req.query,
188
+ params: req.params,
189
+ locals: res.locals
190
+ });
191
+ const ik = this.getIk(res);
192
+ const removedItem = await this.lib.remove(ik);
193
+ const item = core.validatePK(removedItem, this.getPkType());
194
+ return res.json(item);
195
+ });
196
+ /* eslint-disable */ /* istanbul ignore next */ _define_property$2(this, "findItems", async (req, res)=>{
197
+ throw new Error('Method not implemented in an abstract router');
198
+ });
199
+ /* eslint-enable */ _define_property$2(this, "getItem", async (req, res)=>{
200
+ this.logger.default('Getting Item', {
201
+ query: req.query,
202
+ params: req.params,
203
+ locals: res.locals
204
+ });
205
+ const ik = this.getIk(res);
206
+ try {
207
+ // TODO: What error does validate PK throw, when can that fail?
208
+ const item = core.validatePK(await this.lib.get(ik), this.getPkType());
209
+ return res.json(item);
210
+ } catch (err) {
211
+ if (err instanceof lib.NotFoundError) {
212
+ this.logger.error('Item Not Found', {
213
+ ik,
214
+ message: err === null || err === void 0 ? void 0 : err.message,
215
+ stack: err === null || err === void 0 ? void 0 : err.stack
216
+ });
217
+ return res.status(404).json({
218
+ ik,
219
+ message: "Item Not Found"
220
+ });
221
+ } else {
222
+ this.logger.error('General Error', {
223
+ ik,
224
+ message: err === null || err === void 0 ? void 0 : err.message,
225
+ stack: err === null || err === void 0 ? void 0 : err.stack
226
+ });
227
+ return res.status(500).json({
228
+ ik,
229
+ message: "General Error"
230
+ });
231
+ }
232
+ }
233
+ });
234
+ _define_property$2(this, "updateItem", async (req, res)=>{
235
+ this.logger.default('Updating Item', {
236
+ body: req === null || req === void 0 ? void 0 : req.body,
237
+ query: req === null || req === void 0 ? void 0 : req.query,
238
+ params: req === null || req === void 0 ? void 0 : req.params,
239
+ locals: res === null || res === void 0 ? void 0 : res.locals
240
+ });
241
+ const ik = this.getIk(res);
242
+ const itemToUpdate = this.convertDates(req.body);
243
+ const retItem = core.validatePK(await this.lib.update(ik, itemToUpdate), this.getPkType());
244
+ return res.json(retItem);
245
+ });
246
+ _define_property$2(this, "convertDates", (item)=>{
247
+ const events = item.events;
248
+ this.logger.default('Converting Dates', {
249
+ item
250
+ });
251
+ if (events) {
252
+ Object.keys(events).forEach((key)=>{
253
+ Object.assign(events, {
254
+ [key]: deepmerge(events[key], {
255
+ at: events[key].at ? new Date(events[key].at) : null
256
+ })
257
+ });
258
+ });
259
+ }
260
+ Object.assign(item, {
261
+ events
262
+ });
263
+ return item;
264
+ });
265
+ // TODO: Maybe just simplify this and require that everything is a UUID?
266
+ /**
267
+ * This method might be an annoyance, but we need to capture a few cases where someone passes
268
+ * a PK parameter that has an odd string in it.
269
+ *
270
+ * @param pkParamValue The value of the primary key parameter
271
+ * @returns if the value is valid.
272
+ */ _define_property$2(this, "validatePKParam", (pkParamValue)=>{
273
+ let validPkParam = true;
274
+ if (pkParamValue.length <= 0) {
275
+ this.logger.error('Primary Key is an Empty String', {
276
+ pkParamValue
277
+ });
278
+ validPkParam = false;
279
+ } else if (pkParamValue === 'undefined') {
280
+ this.logger.error('Primary Key is the string \'undefined\'', {
281
+ pkParamValue
282
+ });
283
+ validPkParam = false;
284
+ }
285
+ return validPkParam;
286
+ });
287
+ this.lib = lib$1;
288
+ this.keyType = keyType;
289
+ this.options = options;
290
+ this.logger = LibLogger.get("ItemRouter", keyType);
291
+ }
292
+ }
293
+
294
+ function _define_property$1(obj, key, value) {
295
+ if (key in obj) {
296
+ Object.defineProperty(obj, key, {
297
+ value: value,
298
+ enumerable: true,
299
+ configurable: true,
300
+ writable: true
301
+ });
302
+ } else {
303
+ obj[key] = value;
304
+ }
305
+ return obj;
306
+ }
307
+ const logger$1 = LibLogger.get('CItemRouter');
308
+ class CItemRouter extends ItemRouter {
309
+ hasParent() {
310
+ return !!this.parentRoute;
311
+ }
312
+ getIk(res) {
313
+ const pri = this.getPk(res);
314
+ const loc = this.getLocations(res);
315
+ return {
316
+ kt: pri.kt,
317
+ pk: pri.pk,
318
+ loc
319
+ };
320
+ }
321
+ getLKA(res) {
322
+ /**
323
+ * A location key array is passed to a child router to provide contextfor the items it will
324
+ * be working with. It is always a concatenation of "My LKA" + "Parent LKA" which will
325
+ * bubble all the way up to the root Primary.
326
+ */ let lka = [
327
+ this.getLk(res)
328
+ ];
329
+ lka = lka.concat(this.parentRoute.getLKA(res));
330
+ return lka;
331
+ }
332
+ getLocations(res) {
333
+ return this.parentRoute.getLKA(res);
334
+ }
335
+ constructor(lib, type, parentRoute, options = {}){
336
+ super(lib, type, options), _define_property$1(this, "parentRoute", void 0), _define_property$1(this, "createItem", async (req, res)=>{
337
+ logger$1.trace('Creating Item 2', {
338
+ body: req === null || req === void 0 ? void 0 : req.body,
339
+ query: req === null || req === void 0 ? void 0 : req.query,
340
+ params: req === null || req === void 0 ? void 0 : req.params,
341
+ locals: res === null || res === void 0 ? void 0 : res.locals
342
+ });
343
+ const itemToCreate = this.convertDates(req.body);
344
+ let item = core.validatePK(await this.lib.create(itemToCreate, {
345
+ locations: this.getLocations(res)
346
+ }), this.getPkType());
347
+ item = await this.postCreateItem(item);
348
+ return res.json(item);
349
+ }), /* eslint-disable */ _define_property$1(this, "findItems", async (req, res)=>{
350
+ logger$1.trace('Finding Items', {
351
+ query: req.query,
352
+ params: req.params,
353
+ locals: res.locals
354
+ });
355
+ const query = req.query;
356
+ const finder = query['finder'];
357
+ const finderParams = query['finderParams'];
358
+ let items = [];
359
+ if (finder) {
360
+ // If finder is defined? Call a finder.
361
+ items = await this.lib.find(finder, JSON.parse(finderParams), this.getLocations(res));
362
+ } else {
363
+ // TODO: This is once of the more important places to perform some validaation and feedback
364
+ const itemQuery = core.paramsToQuery(req.query);
365
+ items = await this.lib.all(itemQuery, this.getLocations(res));
366
+ }
367
+ return res.json(items.map((item)=>core.validatePK(item, this.getPkType())));
368
+ });
369
+ this.parentRoute = parentRoute;
370
+ }
371
+ }
372
+
373
+ function _define_property(obj, key, value) {
374
+ if (key in obj) {
375
+ Object.defineProperty(obj, key, {
376
+ value: value,
377
+ enumerable: true,
378
+ configurable: true,
379
+ writable: true
380
+ });
381
+ } else {
382
+ obj[key] = value;
383
+ }
384
+ return obj;
385
+ }
386
+ const logger = LibLogger.get('PItemRouter');
387
+ class PItemRouter extends ItemRouter {
388
+ getIk(res) {
389
+ const pri = this.getPk(res);
390
+ return pri;
391
+ }
392
+ constructor(lib, keyType, options = {}){
393
+ super(lib, keyType, options), _define_property(this, "createItem", async (req, res)=>{
394
+ logger.default('Creating Item 2', {
395
+ body: req.body,
396
+ query: req.query,
397
+ params: req.params,
398
+ locals: res.locals
399
+ });
400
+ const itemToCreate = this.convertDates(req.body);
401
+ let item = core.validatePK(await this.lib.create(itemToCreate), this.getPkType());
402
+ item = await this.postCreateItem(item);
403
+ return res.json(item);
404
+ }), /* eslint-disable */ _define_property(this, "findItems", async (req, res)=>{
405
+ logger.default('Finding Items', {
406
+ query: req.query,
407
+ params: req.params,
408
+ locals: res.locals
409
+ });
410
+ let items = [];
411
+ const query = req.query;
412
+ const finder = query['finder'];
413
+ const finderParams = query['finderParams'];
414
+ if (finder) {
415
+ // If finder is defined? Call a finder.
416
+ logger.default('Finding Items with a finder', {
417
+ finder,
418
+ finderParams
419
+ });
420
+ items = await this.lib.find(finder, JSON.parse(finderParams));
421
+ } else {
422
+ logger.default('Finding Items with a query', {
423
+ query: req.query
424
+ });
425
+ // TODO: This is once of the more important places to perform some validaation and feedback
426
+ const itemQuery = core.paramsToQuery(req.query);
427
+ items = await this.lib.all(itemQuery);
428
+ }
429
+ return res.json(items.map((item)=>core.validatePK(item, this.getPkType())));
430
+ });
431
+ }
432
+ }
433
+
434
+ exports.CItemRouter = CItemRouter;
435
+ exports.ItemRouter = ItemRouter;
436
+ exports.PItemRouter = PItemRouter;
437
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/logger.ts","../src/ItemRouter.ts","../src/CItemRouter.ts","../src/PItemRouter.ts"],"sourcesContent":["import Logging from '@fjell/logging';\n\nconst LibLogger = Logging.getLogger('@fjell/express-router');\n\nexport default LibLogger;\n","import {\n ComKey,\n cPK,\n Item,\n ItemEvent,\n ItemProperties,\n LocKey,\n LocKeyArray,\n PriKey,\n validatePK\n} from \"@fjell/core\";\nimport { NotFoundError, Operations } from \"@fjell/lib\";\nimport deepmerge from \"deepmerge\";\nimport { Request, RequestHandler, Response, Router } from \"express\";\nimport LibLogger from \"./logger\";\n\nexport type ItemRouterOptions = Record<string, never>;\n\n// TODO: body is in the request, it's not needed in the parameters\nexport type ActionMethod = <\n S extends string,\n L1 extends string = never,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n>(req: Request, res: Response, item: Item<S, L1, L2, L3, L4, L5>, params: any, body: any) =>\n Promise<Item<S, L1, L2, L3, L4, L5>>;\n\n// TODO: body is in the request, it's not needed in the parameters\nexport type AllActionMethods = Array<RequestHandler>;\n\nexport class ItemRouter<\n S extends string,\n L1 extends string = never,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n> {\n\n protected lib: Operations<Item<S, L1, L2, L3, L4, L5>, S, L1, L2, L3, L4, L5>;\n private keyType: S;\n protected options: ItemRouterOptions;\n private childRouters: Record<string, Router> = {};\n private logger;\n private itemActions: Record<string, ActionMethod> | undefined;\n\n constructor(\n lib: Operations<Item<S, L1, L2, L3, L4, L5>, S, L1, L2, L3, L4, L5>,\n keyType: S,\n options: ItemRouterOptions = {}\n ) {\n this.lib = lib;\n this.keyType = keyType;\n this.options = options;\n this.logger = LibLogger.get(\"ItemRouter\", keyType);\n }\n\n public getPkType = (): S => {\n return this.keyType;\n }\n\n protected getPkParam = (): string => {\n return `${this.getPkType()}Pk`;\n }\n\n protected getLk(res: Response): LocKey<S> {\n return { kt: this.keyType, lk: res.locals[this.getPkParam()] };\n }\n\n // this is meant to be consumed by children routers\n public getLKA(res: Response): LocKeyArray<S, L1, L2, L3, L4> {\n return [this.getLk(res)] as LocKeyArray<S, L1, L2, L3, L4>;\n }\n\n public getPk(res: Response): PriKey<S> {\n return cPK<S>(res.locals[this.getPkParam()], this.getPkType());\n }\n\n // Unless this is a contained router, the locations will always be an empty array.\n /* eslint-disable */\n protected getLocations(res: Response): LocKeyArray<L1, L2, L3, L4, L5> | [] {\n throw new Error('Method not implemented in an abstract router');\n }\n /* eslint-enable */\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected getIk(res: Response): PriKey<S> | ComKey<S, L1, L2, L3, L4, L5> {\n throw new Error('Method not implemented in an abstract router');\n }\n\n protected postItemAction = async (req: Request, res: Response) => {\n this.logger.default('Getting Item', { query: req?.query, params: req?.params, locals: res?.locals });\n const ik = this.getIk(res);\n const actionKey = req.path.substring(req.path.lastIndexOf('/') + 1);\n if (!this.itemActions) {\n this.logger.error('Item Actions are not configured');\n return res.status(500).json({ error: 'Item Actions are not configured' });\n }\n try {\n const item =\n validatePK(await this.lib.get(ik), this.getPkType()) as Item<S, L1, L2, L3, L4, L5>;\n return res.json(await this.itemActions[actionKey](req, res, item, req.params, req.body));\n } catch (err: any) {\n this.logger.error('Error in Item Action', { message: err?.message, stack: err?.stack });\n return res.status(500).json(err);\n }\n }\n\n private configure = (router: Router) => {\n this.logger.default('Configuring Router', { pkType: this.getPkType() });\n router.get('/', this.findItems);\n router.post('/', this.createItem);\n\n const allActions = this.configureAllActions();\n this.logger.debug('All Actions supplied to Router', { allActions });\n if (allActions) {\n Object.keys(allActions).forEach((actionKey) => {\n this.logger.default('Configuring All Action', { actionKey });\n // TODO: Ok, this is a bit of a hack, but we need to customize the types of the request handlers\n router.post(`/${actionKey}`, ...allActions[actionKey]);\n });\n }\n\n const itemRouter = Router();\n itemRouter.get('/', this.getItem);\n itemRouter.put('/', this.updateItem);\n itemRouter.delete('/', this.deleteItem);\n\n this.itemActions = this.configureItemActions();\n this.logger.debug('Item Actions supplied to Router', { itemActions: this.itemActions });\n if (this.itemActions) {\n Object.keys(this.itemActions).forEach((actionKey) => {\n this.logger.default('Configuring Item Action', { actionKey });\n // TODO: Ok, this is a bit of a hack, but we need to customize the types of the request handlers\n itemRouter.post(`/${actionKey}`, this.postItemAction)\n });\n }\n\n this.logger.default('Configuring Item Operations under PK Param', { pkParam: this.getPkParam() });\n router.use(`/:${this.getPkParam()}`, this.validatePrimaryKeyValue, itemRouter);\n\n if (this.childRouters) {\n this.configureChildRouters(itemRouter, this.childRouters);\n }\n return router;\n }\n\n private validatePrimaryKeyValue = (req: Request, res: Response, next: any) => {\n const pkParamValue = req.params[this.getPkParam()];\n if (this.validatePKParam(pkParamValue)) {\n res.locals[this.getPkParam()] = pkParamValue;\n next();\n } else {\n this.logger.error('Invalid Primary Key', { pkParamValue, path: req?.path });\n res.status(500).json({ error: 'Invalid Primary Key', path: req?.path });\n }\n }\n\n private configureChildRouters = (router: Router, childRouters: Record<string, Router>) => {\n for (const path in childRouters) {\n this.logger.default('Configuring Child Router at Path', { path });\n\n router.use(`/${path}`, childRouters[path]);\n }\n return router;\n }\n\n public addChildRouter = (path: string, router: Router) => {\n this.childRouters[path] = router;\n }\n\n /* istanbul ignore next */\n protected configureItemActions(): Record<string, ActionMethod> {\n this.logger.debug('ARouter - No Item Actions Configured');\n return {};\n }\n\n /* istanbul ignore next */\n protected configureAllActions(): Record<string, AllActionMethods> {\n this.logger.debug('ARouter - No All Actions Configured');\n return {};\n }\n\n /* istanbul ignore next */\n public getRouter(): Router {\n const router = Router();\n this.configure(router);\n return router;\n }\n\n /* istanbul ignore next */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected createItem = async (req: Request, res: Response): Promise<Response<any, Record<string, any>>> => {\n throw new Error('Method not implemented in an abstract router');\n };\n\n // TODO: Probably a better way to do this, but this postCreate hook only needs the item.\n /* istanbul ignore next */\n public postCreateItem = async (item: Item<S, L1, L2, L3, L4, L5>): Promise<Item<S, L1, L2, L3, L4, L5>> => {\n this.logger.default('Post Create Item', { item });\n return item;\n };\n\n protected deleteItem = async (req: Request, res: Response): Promise<Response<any, Record<string, any>>> => {\n this.logger.default('Deleting Item', { query: req.query, params: req.params, locals: res.locals });\n const ik = this.getIk(res);\n const removedItem = await this.lib.remove(ik);\n const item = validatePK(removedItem, this.getPkType());\n return res.json(item);\n };\n\n /* eslint-disable */\n /* istanbul ignore next */\n protected findItems = async (req: Request, res: Response): Promise<Response<any, Record<string, any>>> => {\n throw new Error('Method not implemented in an abstract router');\n };\n /* eslint-enable */\n\n protected getItem = async (req: Request, res: Response) => {\n this.logger.default('Getting Item', { query: req.query, params: req.params, locals: res.locals });\n const ik = this.getIk(res);\n try {\n // TODO: What error does validate PK throw, when can that fail?\n const item = validatePK(await this.lib.get(ik), this.getPkType());\n return res.json(item);\n } catch (err: any) {\n if (err instanceof NotFoundError) {\n this.logger.error('Item Not Found', { ik, message: err?.message, stack: err?.stack });\n return res.status(404).json({\n ik,\n message: \"Item Not Found\",\n });\n } else {\n this.logger.error('General Error', { ik, message: err?.message, stack: err?.stack });\n return res.status(500).json({\n ik,\n message: \"General Error\",\n });\n }\n }\n }\n\n protected updateItem = async (req: Request, res: Response) => {\n this.logger.default('Updating Item',\n { body: req?.body, query: req?.query, params: req?.params, locals: res?.locals });\n const ik = this.getIk(res);\n const itemToUpdate = this.convertDates(req.body as ItemProperties<S, L1, L2, L3, L4, L5>);\n const retItem = validatePK(await this.lib.update(ik, itemToUpdate), this.getPkType());\n return res.json(retItem);\n };\n\n public convertDates = (item: Item<S, L1, L2, L3, L4, L5> | ItemProperties<S, L1, L2, L3, L4, L5>):\n Item<S, L1, L2, L3, L4, L5> | ItemProperties<S, L1, L2, L3, L4, L5> => {\n const events = item.events as Record<string, ItemEvent>;\n this.logger.default('Converting Dates', { item });\n if (events) {\n Object.keys(events).forEach((key: string) => {\n Object.assign(events, {\n [key]: deepmerge(events[key], { at: events[key].at ? new Date(events[key].at) : null })\n });\n });\n }\n Object.assign(item, { events });\n return item;\n };\n\n // TODO: Maybe just simplify this and require that everything is a UUID?\n /**\n * This method might be an annoyance, but we need to capture a few cases where someone passes\n * a PK parameter that has an odd string in it.\n *\n * @param pkParamValue The value of the primary key parameter\n * @returns if the value is valid.\n */\n protected validatePKParam = (pkParamValue: string): boolean => {\n let validPkParam = true;\n if (pkParamValue.length <= 0) {\n this.logger.error('Primary Key is an Empty String', { pkParamValue });\n validPkParam = false;\n } else if (pkParamValue === 'undefined') {\n this.logger.error('Primary Key is the string \\'undefined\\'', { pkParamValue });\n validPkParam = false;\n }\n return validPkParam;\n }\n\n}\n","import {\n ComKey, Item, ItemQuery, LocKey, LocKeyArray, paramsToQuery, PriKey, QueryParams, validatePK\n} from \"@fjell/core\";\nimport { Request, Response } from \"express\";\nimport { ItemRouter, ItemRouterOptions } from \"@/ItemRouter\";\nimport LibLogger from \"@/logger\";\nimport { Contained } from \"@fjell/lib\";\n\nconst logger = LibLogger.get('CItemRouter');\ninterface ParsedQuery {\n [key: string]: undefined | string | string[] | ParsedQuery | ParsedQuery[];\n}\n\nexport class CItemRouter<\n T extends Item<S, L1, L2, L3, L4, L5>,\n S extends string,\n L1 extends string,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n> extends ItemRouter<S, L1, L2, L3, L4, L5> {\n\n private parentRoute: ItemRouter<L1, L2, L3, L4, L5, never>;\n\n constructor(\n lib: Contained.Operations<T, S, L1, L2, L3, L4, L5>,\n type: S,\n parentRoute: ItemRouter<L1, L2, L3, L4, L5, never>,\n options: ItemRouterOptions = {},\n ) {\n super(lib, type, options);\n this.parentRoute = parentRoute;\n }\n\n public hasParent(): boolean {\n return !!this.parentRoute;\n }\n\n public getIk(res: Response): ComKey<S, L1, L2, L3, L4, L5> {\n const pri = this.getPk(res) as PriKey<S>;\n const loc = this.getLocations(res) as LocKeyArray<L1, L2, L3, L4, L5>;\n return { kt: pri.kt, pk: pri.pk, loc }\n }\n\n public getLKA(res: Response): LocKeyArray<S, L1, L2, L3, L4> {\n /**\n * A location key array is passed to a child router to provide contextfor the items it will\n * be working with. It is always a concatenation of \"My LKA\" + \"Parent LKA\" which will\n * bubble all the way up to the root Primary.\n */\n let lka: LocKey<S | L1 | L2 | L3 | L4>[] = [this.getLk(res)];\n lka = lka.concat(this.parentRoute.getLKA(res) as LocKey<S | L1 | L2 | L3 | L4>[]);\n return lka as LocKeyArray<S, L1, L2, L3, L4>;\n }\n\n public getLocations(res: Response): LocKeyArray<L1, L2, L3, L4, L5> {\n return this.parentRoute.getLKA(res) as LocKeyArray<L1, L2, L3, L4, L5>;\n }\n\n protected createItem = async (req: Request, res: Response) => {\n logger.trace('Creating Item 2',\n { body: req?.body, query: req?.query, params: req?.params, locals: res?.locals });\n const itemToCreate = this.convertDates(req.body as Item<S, L1, L2, L3, L4, L5>);\n let item =\n validatePK(await this.lib.create(\n itemToCreate, { locations: this.getLocations(res) }), this.getPkType()) as Item<S, L1, L2, L3, L4, L5>;\n item = await this.postCreateItem(item);\n return res.json(item);\n };\n\n /* eslint-disable */\n protected findItems = async (req: Request, res: Response) => {\n logger.trace('Finding Items', { query: req.query, params: req.params, locals: res.locals });\n\n const query: ParsedQuery = req.query as unknown as ParsedQuery;\n const finder = query['finder'] as string;\n const finderParams = query['finderParams'] as string;\n\n let items: Item<S, L1, L2, L3, L4, L5>[] = [];\n\n if( finder ) { \n // If finder is defined? Call a finder.\n items = await this.lib.find(finder, JSON.parse(finderParams), this.getLocations(res));\n } else {\n // TODO: This is once of the more important places to perform some validaation and feedback\n const itemQuery: ItemQuery = paramsToQuery(req.query as QueryParams);\n items = await this.lib.all(itemQuery, this.getLocations(res));\n }\n\n return res.json(items.map((item: Item<S, L1, L2, L3, L4, L5>) => validatePK(item, this.getPkType())));\n };\n /* eslint-enable */\n\n}\n","import { Item, ItemQuery, paramsToQuery, PriKey, QueryParams, validatePK } from \"@fjell/core\";\nimport { Primary } from \"@fjell/lib\";\nimport { ItemRouter, ItemRouterOptions } from \"@/ItemRouter\";\nimport { Request, Response } from \"express\";\nimport LibLogger from \"@/logger\";\n\nconst logger = LibLogger.get('PItemRouter');\n\ninterface ParsedQuery {\n [key: string]: undefined | string | string[] | ParsedQuery | ParsedQuery[];\n}\n\nexport class PItemRouter<T extends Item<S>, S extends string> extends ItemRouter<S> {\n\n constructor(lib: Primary.Operations<T, S>, keyType: S, options: ItemRouterOptions = {}) {\n super(lib, keyType, options);\n }\n\n public getIk(res: Response): PriKey<S> {\n const pri = this.getPk(res) as PriKey<S>;\n return pri\n }\n\n public createItem = async (req: Request, res: Response) => {\n logger.default('Creating Item 2', { body: req.body, query: req.query, params: req.params, locals: res.locals });\n const itemToCreate = this.convertDates(req.body as Item<S>);\n let item =\n validatePK(await this.lib.create(itemToCreate), this.getPkType()) as Item<S>;\n item = await this.postCreateItem(item);\n return res.json(item);\n };\n\n /* eslint-disable */\n protected findItems = async (req: Request, res: Response) => {\n logger.default('Finding Items', { query: req.query, params: req.params, locals: res.locals });\n\n let items: Item<S>[] = [];\n\n const query: ParsedQuery = req.query as unknown as ParsedQuery;\n const finder = query['finder'] as string;\n const finderParams = query['finderParams'] as string;\n\n if( finder ) { \n // If finder is defined? Call a finder.\n logger.default('Finding Items with a finder', { finder, finderParams });\n items = await this.lib.find(finder, JSON.parse(finderParams));\n } else {\n logger.default('Finding Items with a query', { query: req.query });\n // TODO: This is once of the more important places to perform some validaation and feedback\n const itemQuery: ItemQuery = paramsToQuery(req.query as QueryParams);\n items = await this.lib.all(itemQuery);\n }\n\n return res.json(items.map((item: Item<S>) => validatePK(item, this.getPkType())));\n };\n /* eslint-enable */\n}\n"],"names":["LibLogger","Logging","getLogger","ItemRouter","getLk","res","kt","keyType","lk","locals","getPkParam","getLKA","getPk","cPK","getPkType","getLocations","Error","getIk","logger","debug","router","Router","configure","lib","options","_define_property","childRouters","itemActions","postItemAction","req","default","query","params","ik","actionKey","path","substring","lastIndexOf","error","status","json","item","validatePK","get","body","err","message","stack","pkType","findItems","post","createItem","allActions","configureAllActions","Object","keys","forEach","itemRouter","getItem","put","updateItem","delete","deleteItem","configureItemActions","pkParam","use","validatePrimaryKeyValue","configureChildRouters","next","pkParamValue","validatePKParam","addChildRouter","postCreateItem","removedItem","remove","NotFoundError","itemToUpdate","convertDates","retItem","update","events","key","assign","deepmerge","at","Date","validPkParam","length","CItemRouter","hasParent","parentRoute","pri","loc","pk","lka","concat","type","trace","itemToCreate","create","locations","finder","finderParams","items","find","JSON","parse","itemQuery","paramsToQuery","all","map","PItemRouter"],"mappings":";;;;;;;;;;AAEA,MAAMA,SAAAA,GAAYC,OAAQC,CAAAA,SAAS,CAAC,uBAAA,CAAA;;;;;;;;;;;;;;;AC8B7B,MAAMC,UAAAA,CAAAA;AAmCDC,IAAAA,KAAAA,CAAMC,GAAa,EAAa;QACxC,OAAO;YAAEC,EAAI,EAAA,IAAI,CAACC,OAAO;AAAEC,YAAAA,EAAAA,EAAIH,IAAII,MAAM,CAAC,IAAI,CAACC,UAAU,EAAG;AAAC,SAAA;AAC/D;;AAGOC,IAAAA,MAAAA,CAAON,GAAa,EAAkC;QAC3D,OAAO;YAAC,IAAI,CAACD,KAAK,CAACC,GAAAA;AAAK,SAAA;AAC1B;A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CAAA;gBACrEC,KAAQ,GAAA,MAAM,IAAI,CAAChF,GAAG,CAACiF,IAAI,CAACH,MAAAA,EAAQI,IAAKC,CAAAA,KAAK,CAACJ,YAAAA,CAAAA,CAAAA;aAC1C,MAAA;gBACLpF,MAAOY,CAAAA,OAAO,CAAC,4BAA8B,EAAA;AAAEC,oBAAAA,KAAAA,EAAOF,IAAIE;AAAM,iBAAA,CAAA;;gBAEhE,MAAM4E,SAAAA,GAAuBC,kBAAc/E,CAAAA,GAAAA,CAAIE,KAAK,CAAA;AACpDwE,gBAAAA,KAAAA,GAAQ,MAAM,IAAI,CAAChF,GAAG,CAACsF,GAAG,CAACF,SAAAA,CAAAA;AAC7B;AAEA,YAAA,OAAOtG,GAAImC,CAAAA,IAAI,CAAC+D,KAAAA,CAAMO,GAAG,CAAC,CAACrE,IAAAA,GAAkBC,eAAWD,CAAAA,IAAAA,EAAM,IAAI,CAAC3B,SAAS,EAAA,CAAA,CAAA,CAAA;AAC9E,SAAA,CAAA;AAtCA;AAwCF;;;;;;"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { ItemRouter } from './ItemRouter.js';
2
2
  export { CItemRouter } from './CItemRouter.js';
3
3
  export { PItemRouter } from './PItemRouter.js';
4
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzsifQ==
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const Logging = require('@fjell/logging');
6
+
7
+ const LibLogger = Logging.getLogger('@fjell/express-router');
8
+
9
+ exports.default = LibLogger;
10
+ //# sourceMappingURL=logger.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.cjs","sources":["../src/logger.ts"],"sourcesContent":["import Logging from '@fjell/logging';\n\nconst LibLogger = Logging.getLogger('@fjell/express-router');\n\nexport default LibLogger;\n"],"names":["LibLogger","Logging","getLogger"],"mappings":";;;;;;AAEMA,MAAAA,SAAAA,GAAYC,OAAQC,CAAAA,SAAS,CAAC,uBAAA;;;;"}
package/dist/logger.js CHANGED
@@ -3,4 +3,4 @@ import Logging from '@fjell/logging';
3
3
  const LibLogger = Logging.getLogger('@fjell/express-router');
4
4
 
5
5
  export { LibLogger as default };
6
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OyJ9
6
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sources":["../src/logger.ts"],"sourcesContent":["import Logging from '@fjell/logging';\n\nconst LibLogger = Logging.getLogger('@fjell/express-router');\n\nexport default LibLogger;\n"],"names":["LibLogger","Logging","getLogger"],"mappings":";;AAEMA,MAAAA,SAAAA,GAAYC,OAAQC,CAAAA,SAAS,CAAC,uBAAA;;;;"}