@fjell/express-router 4.4.28 → 4.4.30
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/dist/CItemRouter.d.ts +2 -2
- package/dist/CItemRouter.d.ts.map +1 -1
- package/dist/CItemRouter.js +15 -5
- package/dist/CItemRouter.js.map +2 -2
- package/dist/Instance.d.ts +2 -1
- package/dist/Instance.d.ts.map +1 -1
- package/dist/Instance.js.map +2 -2
- package/dist/InstanceFactory.d.ts +2 -1
- package/dist/InstanceFactory.d.ts.map +1 -1
- package/dist/InstanceFactory.js.map +2 -2
- package/dist/Operations.d.ts +2 -0
- package/dist/Operations.d.ts.map +1 -0
- package/dist/Operations.js +1 -0
- package/dist/Operations.js.map +7 -0
- package/dist/PItemRouter.d.ts +4 -4
- package/dist/PItemRouter.d.ts.map +1 -1
- package/dist/PItemRouter.js +50 -11
- package/dist/PItemRouter.js.map +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/util/general.d.ts.map +1 -1
- package/dist/util/general.js +2 -0
- package/dist/util/general.js.map +2 -2
- package/examples/basic-router-example.ts +1 -1
- package/examples/full-application-example.ts +1 -1
- package/examples/nested-router-example.ts +1 -1
- package/package.json +9 -10
package/dist/CItemRouter.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComKey, Item, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { Library } from "@fjell/lib";
|
|
2
3
|
import { Request, Response } from "express";
|
|
3
4
|
import { ItemRouter, ItemRouterOptions } from "./ItemRouter.js";
|
|
4
|
-
import { Instance } from "./Instance.js";
|
|
5
5
|
export declare class CItemRouter<T extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> extends ItemRouter<S, L1, L2, L3, L4, L5> {
|
|
6
|
-
constructor(lib:
|
|
6
|
+
constructor(lib: Library<T, S, L1, L2, L3, L4, L5>, type: S, parentRoute: ItemRouter<L1, L2, L3, L4, L5, never>, options?: ItemRouterOptions<S, L1, L2, L3, L4, L5>);
|
|
7
7
|
hasParent(): boolean;
|
|
8
8
|
getIk(res: Response): ComKey<S, L1, L2, L3, L4, L5>;
|
|
9
9
|
getLKA(res: Response): LocKeyArray<S, L1, L2, L3, L4>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CItemRouter.d.ts","sourceRoot":"","sources":["../src/CItemRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAAE,IAAI,EAAqB,WAAW,EAC7C,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"CItemRouter.d.ts","sourceRoot":"","sources":["../src/CItemRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAAE,IAAI,EAAqB,WAAW,EAC7C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAiB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMhE,qBAAa,WAAW,CACtB,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EACrC,CAAC,SAAS,MAAM,EAChB,EAAE,SAAS,MAAM,EACjB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,CACzB,SAAQ,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;gBAGvC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EACtC,IAAI,EAAE,CAAC,EACP,WAAW,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,EAClD,OAAO,GAAE,iBAAiB,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAM;IAKjD,SAAS,IAAI,OAAO;IAIpB,KAAK,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IAMnD,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IAWrD,YAAY,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IAInE,SAAS,CAAC,UAAU,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,mBAuBvD;IAEF,SAAS,CAAC,SAAS,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,mBAsCtD;CAEH"}
|
package/dist/CItemRouter.js
CHANGED
|
@@ -59,11 +59,21 @@ class CItemRouter extends ItemRouter {
|
|
|
59
59
|
let items = [];
|
|
60
60
|
if (finder) {
|
|
61
61
|
this.logger.default("Finding Items with Finder", { finder, finderParams, one });
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
try {
|
|
63
|
+
const parsedParams = finderParams ? JSON.parse(finderParams) : {};
|
|
64
|
+
if (one === "true") {
|
|
65
|
+
const item = await this.lib.findOne(finder, parsedParams, this.getLocations(res));
|
|
66
|
+
items = item ? [item] : [];
|
|
67
|
+
} else {
|
|
68
|
+
items = await libOperations.find(finder, parsedParams, this.getLocations(res));
|
|
69
|
+
}
|
|
70
|
+
} catch (parseError) {
|
|
71
|
+
this.logger.error("Error parsing finderParams JSON", { finder, finderParams, error: parseError.message });
|
|
72
|
+
res.status(400).json({
|
|
73
|
+
error: "Invalid JSON in finderParams",
|
|
74
|
+
message: parseError.message
|
|
75
|
+
});
|
|
76
|
+
return;
|
|
67
77
|
}
|
|
68
78
|
} else {
|
|
69
79
|
const itemQuery = paramsToQuery(req.query);
|
package/dist/CItemRouter.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/CItemRouter.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n ComKey, Item, ItemQuery, LocKey, LocKeyArray, paramsToQuery, PriKey, QueryParams, validatePK\n} from \"@fjell/core\";\nimport { NotFoundError } from \"@fjell/lib\";\nimport { Request, Response } from \"express\";\nimport { ItemRouter, ItemRouterOptions } from \"./ItemRouter.js\";\
|
|
5
|
-
"mappings": "AAAA;AAAA,EACgD;AAAA,EAAoC;AAAA,OAC7E;AACP,
|
|
4
|
+
"sourcesContent": ["import {\n ComKey, Item, ItemQuery, LocKey, LocKeyArray, paramsToQuery, PriKey, QueryParams, validatePK\n} from \"@fjell/core\";\nimport { Library, NotFoundError } from \"@fjell/lib\";\nimport { Request, Response } from \"express\";\nimport { ItemRouter, ItemRouterOptions } from \"./ItemRouter.js\";\n\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 constructor(\n lib: Library<T, S, L1, L2, L3, L4, L5>,\n type: S,\n parentRoute: ItemRouter<L1, L2, L3, L4, L5, never>,\n options: ItemRouterOptions<S, L1, L2, L3, L4, L5> = {},\n ) {\n super(lib as any, type, options, 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 const libOperations = this.lib.operations;\n this.logger.default('Creating Item', { body: req?.body, query: req?.query, params: req?.params, locals: res?.locals });\n try {\n const itemToCreate = this.convertDates(req.body as Item<S, L1, L2, L3, L4, L5>);\n let item = validatePK(await libOperations.create(\n itemToCreate, { locations: this.getLocations(res) }), this.getPkType()) as Item<S, L1, L2, L3, L4, L5>;\n item = await this.postCreateItem(item);\n this.logger.default('Created Item %j', item);\n res.status(201).json(item);\n } catch (err: any) {\n if (err instanceof NotFoundError) {\n this.logger.error('Item Not Found for Create', { message: err?.message, stack: err?.stack });\n res.status(404).json({\n message: \"Item Not Found\",\n });\n } else {\n this.logger.error('General Error in Create', { message: err?.message, stack: err?.stack });\n res.status(500).json({\n message: \"General Error\",\n });\n }\n }\n };\n\n protected findItems = async (req: Request, res: Response) => {\n const libOperations = this.lib.operations;\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 const one = query['one'] 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 this.logger.default('Finding Items with Finder', { finder, finderParams, one });\n\n try {\n const parsedParams = finderParams ? JSON.parse(finderParams) : {};\n if (one === 'true') {\n const item = await (this.lib as any).findOne(finder, parsedParams, this.getLocations(res));\n items = item ? [item] : [];\n } else {\n items = await libOperations.find(finder, parsedParams, this.getLocations(res));\n }\n } catch (parseError: any) {\n this.logger.error('Error parsing finderParams JSON', { finder, finderParams, error: parseError.message });\n res.status(400).json({\n error: 'Invalid JSON in finderParams',\n message: parseError.message\n });\n return;\n }\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 this.logger.default('Finding Items with Query: %j', itemQuery);\n items = await libOperations.all(itemQuery, this.getLocations(res));\n this.logger.default('Found %d Items with Query', items.length);\n }\n\n res.json(items.map((item: Item<S, L1, L2, L3, L4, L5>) => validatePK(item, this.getPkType())));\n };\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACgD;AAAA,EAAoC;AAAA,OAC7E;AACP,SAAkB,qBAAqB;AAEvC,SAAS,kBAAqC;AAMvC,MAAM,oBAQH,WAAkC;AAAA,EAE1C,YACE,KACA,MACA,aACA,UAAoD,CAAC,GACrD;AACA,UAAM,KAAY,MAAM,SAAS,WAAW;AAAA,EAC9C;AAAA,EAEO,YAAqB;AAC1B,WAAO,CAAC,CAAC,KAAK;AAAA,EAChB;AAAA,EAEO,MAAM,KAA8C;AACzD,UAAM,MAAM,KAAK,MAAM,GAAG;AAC1B,UAAM,MAAM,KAAK,aAAa,GAAG;AACjC,WAAO,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;AAAA,EACvC;AAAA,EAEO,OAAO,KAA+C;AAM3D,QAAI,MAAuC,CAAC,KAAK,MAAM,GAAG,CA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MAAM,MAAM,KAAK;AAEvB,QAAI,QAAuC,CAAC;AAE5C,QAAI,QAAQ;AAEV,WAAK,OAAO,QAAQ,6BAA6B,EAAE,QAAQ,cAAc,IAAI,CAAC;AAE9E,UAAI;AACF,cAAM,eAAe,eAAe,KAAK,MAAM,YAAY,IAAI,CAAC;AAChE,YAAI,QAAQ,QAAQ;AAClB,gBAAM,OAAO,MAAO,KAAK,IAAY,QAAQ,QAAQ,cAAc,KAAK,aAAa,GAAG,CAAC;AACzF,kBAAQ,OAAO,CAAC,IAAI,IAAI,CAAC;AAAA,QAC3B,OAAO;AACL,kBAAQ,MAAM,cAAc,KAAK,QAAQ,cAAc,KAAK,aAAa,GAAG,CAAC;AAAA,QAC/E;AAAA,MACF,SAAS,YAAiB;AACxB,aAAK,OAAO,MAAM,mCAAmC,EAAE,QAAQ,cAAc,OAAO,WAAW,QAAQ,CAAC;AACxG,YAAI,OAAO,GAAG,EAAE,KAAK;AAAA,UACnB,OAAO;AAAA,UACP,SAAS,WAAW;AAAA,QACtB,CAAC;AACD;AAAA,MACF;AAAA,IACF,OAAO;AAEL,YAAM,YAAuB,cAAc,IAAI,KAAoB;AACnE,WAAK,OAAO,QAAQ,gCAAgC,SAAS;AAC7D,cAAQ,MAAM,cAAc,IAAI,WAAW,KAAK,aAAa,GAAG,CAAC;AACjE,WAAK,OAAO,QAAQ,6BAA6B,MAAM,MAAM;AAAA,IAC/D;AAEA,QAAI,KAAK,MAAM,IAAI,CAAC,SAAsC,WAAW,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC;AAAA,EAC/F;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/Instance.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Item } from "@fjell/core";
|
|
2
2
|
import { Instance as BaseInstance, Coordinate, Registry } from "@fjell/registry";
|
|
3
|
-
import { Operations
|
|
3
|
+
import type { Operations } from "./Operations.js";
|
|
4
|
+
import { Options } from "@fjell/lib";
|
|
4
5
|
import { ItemRouter } from "./ItemRouter.js";
|
|
5
6
|
/**
|
|
6
7
|
* The Express Router Instance interface represents a router model instance that extends the base Instance
|
package/dist/Instance.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Instance.d.ts","sourceRoot":"","sources":["../src/Instance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,UAAU,EAAwC,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACvH,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Instance.d.ts","sourceRoot":"","sources":["../src/Instance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,UAAU,EAAwC,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACvH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ,CACvB,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EACrC,CAAC,SAAS,MAAM,EAChB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,CACzB,SAAQ,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,E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,EAAE,CAAC,KAC1C,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAIrC,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,UAAU,GAAG,KAAG,QAAQ,IAAI,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAQhG,CAAA"}
|
package/dist/Instance.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/Instance.ts"],
|
|
4
|
-
"sourcesContent": ["import LibLogger from \"./logger.js\";\nimport { Item } from \"@fjell/core\";\nimport { Instance as BaseInstance, Coordinate, createInstance as createBaseInstance, Registry } from \"@fjell/registry\";\nimport { Operations
|
|
5
|
-
"mappings": "AAAA,OAAO,eAAe;AAEtB,SAA+C,kBAAkB,0BAAoC;
|
|
4
|
+
"sourcesContent": ["import LibLogger from \"./logger.js\";\nimport { Item } from \"@fjell/core\";\nimport { Instance as BaseInstance, Coordinate, createInstance as createBaseInstance, Registry } from \"@fjell/registry\";\nimport type { Operations } from \"./Operations.js\";\nimport { Options } from \"@fjell/lib\";\nimport { ItemRouter } from \"./ItemRouter.js\";\n\nconst logger = LibLogger.get(\"Instance\");\n\n/**\n * The Express Router Instance interface represents a router model instance that extends the base Instance\n * from @fjell/registry and adds express router operations for handling HTTP requests.\n *\n * The interface extends the base Instance (which provides coordinate and registry) with:\n * - router: Provides methods for routing HTTP requests and handling CRUD operations\n * - operations: Provides methods for interacting with the data model (get, find, all, etc.)\n * - options: Provides hooks, validators, finders, actions, and facets\n *\n * @template V - The type of the data model item, extending Item\n * @template S - The string literal type representing the model's key type\n * @template L1-L5 - Optional string literal types for location hierarchy levels\n */\nexport interface Instance<\n V extends Item<S, L1, L2, L3, L4, L5>,\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> extends BaseInstance<S, L1, L2, L3, L4, L5> {\n /** The router object that provides methods for handling HTTP requests */\n router: ItemRouter<S, L1, L2, L3, L4, L5>;\n /** The operations object that provides methods for interacting with the data model */\n operations: Operations<V, S, L1, L2, L3, L4, L5>;\n /** The options object that provides hooks, validators, finders, actions, and facets */\n options: Options<V, S, L1, L2, L3, L4, L5>;\n /** The data model item type (for type safety) */\n readonly itemType?: V;\n}\n\nexport const createInstance = <\n V extends Item<S, L1, L2, L3, L4, L5>,\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 registry: Registry,\n coordinate: Coordinate<S, L1, L2, L3, L4, L5>,\n router: ItemRouter<S, L1, L2, L3, L4, L5>,\n operations: Operations<V, S, L1, L2, L3, L4, L5>,\n options?: Options<V, S, L1, L2, L3, L4, L5>,\n ): Instance<V, S, L1, L2, L3, L4, L5> => {\n logger.debug(\"createInstance\", { coordinate, router, registry, operations, options });\n const baseInstance = createBaseInstance(registry, coordinate);\n return { ...baseInstance, router, operations, options: options || {} as Options<V, S, L1, L2, L3, L4, L5> };\n}\n\nexport const isInstance = (instance: any): instance is Instance<any, any, any, any, any, any, any> => {\n return instance != null &&\n typeof instance === 'object' &&\n instance.coordinate != null &&\n instance.router != null &&\n instance.registry != null &&\n instance.operations != null &&\n instance.options != null;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,eAAe;AAEtB,SAA+C,kBAAkB,0BAAoC;AAKrG,MAAM,SAAS,UAAU,IAAI,UAAU;AAkChC,MAAM,iBAAiB,CAS1B,UACA,YACA,QACA,YACA,YACuC;AACzC,SAAO,MAAM,kBAAkB,EAAE,YAAY,QAAQ,UAAU,YAAY,QAAQ,CAAC;AACpF,QAAM,eAAe,mBAAmB,UAAU,UAAU;AAC5D,SAAO,EAAE,GAAG,cAAc,QAAQ,YAAY,SAAS,WAAW,CAAC,EAAuC;AAC5G;AAEO,MAAM,aAAa,CAAC,aAA2E;AACpG,SAAO,YAAY,QACjB,OAAO,aAAa,YACpB,SAAS,cAAc,QACvB,SAAS,UAAU,QACnB,SAAS,YAAY,QACrB,SAAS,cAAc,QACvB,SAAS,WAAW;AACxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Item } from "@fjell/core";
|
|
2
2
|
import { ItemRouter } from "./ItemRouter.js";
|
|
3
3
|
import { InstanceFactory as BaseInstanceFactory } from "@fjell/registry";
|
|
4
|
-
import { Operations
|
|
4
|
+
import type { Operations } from "./Operations.js";
|
|
5
|
+
import { Options } from "@fjell/lib";
|
|
5
6
|
export type InstanceFactory<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> = (router: ItemRouter<S, L1, L2, L3, L4, L5>, operations: Operations<V, S, L1, L2, L3, L4, L5>, options?: Options<V, S, L1, L2, L3, L4, L5>) => BaseInstanceFactory<S, L1, L2, L3, L4, L5> & {
|
|
6
7
|
readonly _itemType?: V;
|
|
7
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceFactory.d.ts","sourceRoot":"","sources":["../src/InstanceFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAyB,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"InstanceFactory.d.ts","sourceRoot":"","sources":["../src/InstanceFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,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E,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EAEvB,QAAQ,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EACzC,YAAY,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAChD,UAAU,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,KAC1C,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAM7C,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/InstanceFactory.ts"],
|
|
4
|
-
"sourcesContent": ["import { Item } from \"@fjell/core\";\nimport { ItemRouter } from \"./ItemRouter.js\";\nimport { InstanceFactory as BaseInstanceFactory, Registry, RegistryHub } from \"@fjell/registry\";\nimport { Operations
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Item } from \"@fjell/core\";\nimport { ItemRouter } from \"./ItemRouter.js\";\nimport { InstanceFactory as BaseInstanceFactory, Registry, RegistryHub } from \"@fjell/registry\";\nimport type { Operations } from \"./Operations.js\";\nimport { Options } from \"@fjell/lib\";\nimport { createInstance, Instance } from \"./Instance.js\";\nimport { Coordinate } from \"@fjell/registry\";\nimport LibLogger from \"./logger.js\";\n\nconst logger = LibLogger.get(\"InstanceFactory\");\n\nexport type InstanceFactory<\n V extends Item<S, L1, L2, L3, L4, L5>,\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 router: ItemRouter<S, L1, L2, L3, L4, L5>,\n operations: Operations<V, S, L1, L2, L3, L4, L5>,\n options?: Options<V, S, L1, L2, L3, L4, L5>\n) => BaseInstanceFactory<S, L1, L2, L3, L4, L5> & { readonly _itemType?: V };\n\n/**\n * Factory function for creating express-router instances\n */\nexport const createInstanceFactory = <\n V extends Item<S, L1, L2, L3, L4, L5>,\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 router: ItemRouter<S, L1, L2, L3, L4, L5>,\n operations: Operations<V, S, L1, L2, L3, L4, L5>,\n options?: Options<V, S, L1, L2, L3, L4, L5>\n ): BaseInstanceFactory<S, L1, L2, L3, L4, L5> => {\n return (coordinate: Coordinate<S, L1, L2, L3, L4, L5>, context: { registry: Registry, registryHub?: RegistryHub }) => {\n logger.debug(\"Creating express-router instance\", { coordinate, registry: context.registry, router, operations, options });\n\n return createInstance(context.registry, coordinate, router, operations, options) as Instance<V, S, L1, L2, L3, L4, L5>;\n };\n};\n"],
|
|
5
|
+
"mappings": "AAKA,SAAS,sBAAgC;AAEzC,OAAO,eAAe;AAEtB,MAAM,SAAS,UAAU,IAAI,iBAAiB;AAmBvC,MAAM,wBAAwB,CASjC,QACA,YACA,YAC+C;AACjD,SAAO,CAAC,YAA+C,YAA+D;AACpH,WAAO,MAAM,oCAAoC,EAAE,YAAY,UAAU,QAAQ,UAAU,QAAQ,YAAY,QAAQ,CAAC;AAExH,WAAO,eAAe,QAAQ,UAAU,YAAY,QAAQ,YAAY,OAAO;AAAA,EACjF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operations.d.ts","sourceRoot":"","sources":["../src/Operations.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=Operations.js.map
|
package/dist/PItemRouter.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Item, PriKey } from "@fjell/core";
|
|
2
|
-
import { ItemRouter, ItemRouterOptions } from "./ItemRouter.js";
|
|
3
|
-
import { Instance } from "./Instance.js";
|
|
4
2
|
import { Request, Response } from "express";
|
|
3
|
+
import { ItemRouter, ItemRouterOptions } from "./ItemRouter.js";
|
|
4
|
+
import { Library } from "@fjell/lib";
|
|
5
5
|
export declare class PItemRouter<T extends Item<S>, S extends string> extends ItemRouter<S> {
|
|
6
|
-
constructor(lib:
|
|
6
|
+
constructor(lib: Library<T, S>, keyType: S, options?: ItemRouterOptions<S, never, never, never, never, never>);
|
|
7
7
|
getIk(res: Response): PriKey<S>;
|
|
8
|
-
createItem: (req: Request, res: Response) => Promise<void>;
|
|
8
|
+
createItem: (req: Request, res: Response, next?: any) => Promise<void>;
|
|
9
9
|
protected findItems: (req: Request, res: Response) => Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=PItemRouter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PItemRouter.d.ts","sourceRoot":"","sources":["../src/PItemRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA4B,MAAM,EAA2B,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PItemRouter.d.ts","sourceRoot":"","sources":["../src/PItemRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA4B,MAAM,EAA2B,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAMrC,qBAAa,WAAW,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;gBAErE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAE,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAM;IAI1G,KAAK,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC;IAM/B,UAAU,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,OAAO,GAAG,mBAiDhE;IAEF,SAAS,CAAC,SAAS,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,mBAuCtD;CAEH"}
|
package/dist/PItemRouter.js
CHANGED
|
@@ -8,14 +8,43 @@ class PItemRouter extends ItemRouter {
|
|
|
8
8
|
const pri = this.getPk(res);
|
|
9
9
|
return pri;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
|
+
createItem = async (req, res, next) => {
|
|
12
13
|
const libOperations = this.lib.operations;
|
|
13
14
|
this.logger.default("Creating Item", { body: req.body, query: req.query, params: req.params, locals: res.locals });
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
try {
|
|
16
|
+
const itemToCreate = this.convertDates(req.body);
|
|
17
|
+
let item = validatePK(await libOperations.create(itemToCreate), this.getPkType());
|
|
18
|
+
item = await this.postCreateItem(item);
|
|
19
|
+
this.logger.default("Created Item %j", item);
|
|
20
|
+
res.status(201).json(item);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
this.logger.error("Error caught in createItem", {
|
|
23
|
+
errorName: error.name,
|
|
24
|
+
errorMessage: error.message,
|
|
25
|
+
body: req.body
|
|
26
|
+
});
|
|
27
|
+
if (error.name === "CreateValidationError" || error.name === "ValidationError" || error.name === "SequelizeValidationError" || error.message?.includes("validation") || error.message?.includes("Validation failed") || error.message?.includes("required") || error.message?.includes("must be") || error.message?.includes("cannot be") || error.message?.includes("notNull Violation") || error.message?.includes("cannot be null") || error.message?.includes("Required field")) {
|
|
28
|
+
this.logger.error("Validation error in createItem", {
|
|
29
|
+
error: error.message,
|
|
30
|
+
body: req.body
|
|
31
|
+
});
|
|
32
|
+
res.status(400).json({
|
|
33
|
+
success: false,
|
|
34
|
+
error: error.message || "Validation failed"
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
this.logger.error("General error in createItem", {
|
|
38
|
+
error: error.message,
|
|
39
|
+
stack: error.stack,
|
|
40
|
+
body: req.body
|
|
41
|
+
});
|
|
42
|
+
res.status(500).json({
|
|
43
|
+
success: false,
|
|
44
|
+
error: "Internal server error"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
19
48
|
};
|
|
20
49
|
findItems = async (req, res) => {
|
|
21
50
|
const libOperations = this.lib.operations;
|
|
@@ -27,11 +56,21 @@ class PItemRouter extends ItemRouter {
|
|
|
27
56
|
const one = query["one"];
|
|
28
57
|
if (finder) {
|
|
29
58
|
this.logger.default("Finding Items with Finder %s %j one:%s", finder, finderParams, one);
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
59
|
+
try {
|
|
60
|
+
const parsedParams = finderParams ? JSON.parse(finderParams) : {};
|
|
61
|
+
if (one === "true") {
|
|
62
|
+
const item = await this.lib.findOne(finder, parsedParams);
|
|
63
|
+
items = item ? [item] : [];
|
|
64
|
+
} else {
|
|
65
|
+
items = await libOperations.find(finder, parsedParams);
|
|
66
|
+
}
|
|
67
|
+
} catch (parseError) {
|
|
68
|
+
this.logger.error("Error parsing finderParams JSON", { finder, finderParams, error: parseError.message });
|
|
69
|
+
res.status(400).json({
|
|
70
|
+
error: "Invalid JSON in finderParams",
|
|
71
|
+
message: parseError.message
|
|
72
|
+
});
|
|
73
|
+
return;
|
|
35
74
|
}
|
|
36
75
|
} else {
|
|
37
76
|
const itemQuery = paramsToQuery(req.query);
|
package/dist/PItemRouter.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/PItemRouter.ts"],
|
|
4
|
-
"sourcesContent": ["import { Item, ItemQuery, paramsToQuery, PriKey, QueryParams, validatePK } from \"@fjell/core\";\nimport {
|
|
5
|
-
"mappings": "AAAA,SAA0B,eAAoC,kBAAkB;
|
|
4
|
+
"sourcesContent": ["import { Item, ItemQuery, paramsToQuery, PriKey, QueryParams, validatePK } from \"@fjell/core\";\nimport { Request, Response } from \"express\";\nimport { ItemRouter, ItemRouterOptions } from \"./ItemRouter.js\";\nimport { Library } from \"@fjell/lib\";\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: Library<T, S>, keyType: S, options: ItemRouterOptions<S, never, never, never, never, never> = {}) {\n super(lib as any, 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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public createItem = async (req: Request, res: Response, next?: any) => {\n const libOperations = this.lib.operations;\n this.logger.default('Creating Item', { body: req.body, query: req.query, params: req.params, locals: res.locals });\n\n try {\n const itemToCreate = this.convertDates(req.body as Item<S>);\n let item = validatePK(await libOperations.create(itemToCreate), this.getPkType()) as Item<S>;\n item = await this.postCreateItem(item);\n this.logger.default('Created Item %j', item);\n res.status(201).json(item);\n } catch (error: any) {\n this.logger.error('Error caught in createItem', {\n errorName: error.name,\n errorMessage: error.message,\n body: req.body\n });\n\n // Check if this is a validation error (from fjell-lib, custom validators, or database constraints)\n if (error.name === 'CreateValidationError' ||\n error.name === 'ValidationError' ||\n error.name === 'SequelizeValidationError' ||\n error.message?.includes('validation') ||\n error.message?.includes('Validation failed') ||\n error.message?.includes('required') ||\n error.message?.includes('must be') ||\n error.message?.includes('cannot be') ||\n error.message?.includes('notNull Violation') ||\n error.message?.includes('cannot be null') ||\n error.message?.includes('Required field')) {\n this.logger.error('Validation error in createItem', {\n error: error.message,\n body: req.body\n });\n res.status(400).json({\n success: false,\n error: error.message || 'Validation failed'\n });\n } else {\n this.logger.error('General error in createItem', {\n error: error.message,\n stack: error.stack,\n body: req.body\n });\n res.status(500).json({\n success: false,\n error: 'Internal server error'\n });\n }\n }\n };\n\n protected findItems = async (req: Request, res: Response) => {\n const libOperations = this.lib.operations;\n this.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 const one = query['one'] as string;\n\n if (finder) {\n // If finder is defined? Call a finder.\n this.logger.default('Finding Items with Finder %s %j one:%s', finder, finderParams, one);\n\n try {\n const parsedParams = finderParams ? JSON.parse(finderParams) : {};\n if (one === 'true') {\n const item = await (this.lib as any).findOne(finder, parsedParams);\n items = item ? [item] : [];\n } else {\n items = await libOperations.find(finder, parsedParams);\n }\n } catch (parseError: any) {\n this.logger.error('Error parsing finderParams JSON', { finder, finderParams, error: parseError.message });\n res.status(400).json({\n error: 'Invalid JSON in finderParams',\n message: parseError.message\n });\n return;\n }\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 this.logger.default('Finding Items with a query %j', itemQuery);\n items = await libOperations.all(itemQuery);\n }\n\n res.json(items.map((item: Item<S>) => validatePK(item, this.getPkType())));\n };\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAA0B,eAAoC,kBAAkB;AAEhF,SAAS,kBAAqC;AAOvC,MAAM,oBAAyD,WAAc;AAAA,EAElF,YAAY,KAAoB,SAAY,UAAmE,CAAC,GAAG;AACjH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SAAS;AAC9D,cAAQ,MAAM,cAAc,IAAI,SAAS;AAAA,IAC3C;AAEA,QAAI,KAAK,MAAM,IAAI,CAAC,SAAkB,WAAW,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC;AAAA,EAC3E;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./ItemRouter.js\";\nexport * from \"./CItemRouter.js\";\nexport * from \"./PItemRouter.js\";\n\n// Registry components\nexport * from './Instance.js';\nexport * from './InstanceFactory.js';\nexport * from './Registry.js';\n"],
|
|
4
|
+
"sourcesContent": ["export * from \"./ItemRouter.js\";\nexport * from \"./CItemRouter.js\";\nexport * from \"./PItemRouter.js\";\n\n// Registry components\nexport * from './Instance.js';\nexport * from './InstanceFactory.js';\nexport * from './Registry.js';\nexport type { Operations } from './Operations.js';\n"],
|
|
5
5
|
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/util/general.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,GAAI,KAAK,GAAG;;CAI7B,CAAA;AAGD,eAAO,MAAM,aAAa,GAAa,KAAK,GAAG,EAAE,UAAS,GAAG,CAAC,GAAG,CAAa,KAAG,
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/util/general.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,GAAI,KAAK,GAAG;;CAI7B,CAAA;AAGD,eAAO,MAAM,aAAa,GAAa,KAAK,GAAG,EAAE,UAAS,GAAG,CAAC,GAAG,CAAa,KAAG,MA2DhF,CAAC"}
|
package/dist/util/general.js
CHANGED
|
@@ -21,6 +21,7 @@ const stringifyJSON = function(obj, visited = /* @__PURE__ */ new Set()) {
|
|
|
21
21
|
obj.forEach(function(el) {
|
|
22
22
|
arrVals.push(stringifyJSON(el, visited));
|
|
23
23
|
});
|
|
24
|
+
visited.delete(obj);
|
|
24
25
|
return "[" + arrVals + "]";
|
|
25
26
|
}
|
|
26
27
|
} else if (obj instanceof Object) {
|
|
@@ -39,6 +40,7 @@ const stringifyJSON = function(obj, visited = /* @__PURE__ */ new Set()) {
|
|
|
39
40
|
arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut, visited));
|
|
40
41
|
}
|
|
41
42
|
});
|
|
43
|
+
visited.delete(obj);
|
|
42
44
|
return "{" + arrOfKeyVals + "}";
|
|
43
45
|
}
|
|
44
46
|
return "";
|
package/dist/util/general.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/general.ts"],
|
|
4
|
-
"sourcesContent": ["\n/* eslint-disable no-undefined */\nexport const clean = (obj: any) => {\n return Object.fromEntries(\n Object.entries(obj).filter(([_, v]) => v !== undefined)\n );\n}\n\n//Recursive implementation of jSON.stringify;\nexport const stringifyJSON = function (obj: any, visited: Set<any> = new Set()): string {\n const arrOfKeyVals: string[] = [];\n const arrVals: string[] = [];\n let objKeys: string[] = [];\n\n /*********CHECK FOR PRIMITIVE TYPES**********/\n if (typeof obj === 'number' || typeof obj === 'boolean' || obj === null)\n return '' + obj;\n else if (typeof obj === 'string')\n return '\"' + obj + '\"';\n\n /*********DETECT CIRCULAR REFERENCES**********/\n if (obj instanceof Object && visited.has(obj)) {\n return '\"(circular)\"';\n }\n\n /*********CHECK FOR ARRAY**********/\n else if (Array.isArray(obj)) {\n //check for empty array\n if (obj[0] === undefined)\n return '[]';\n else {\n // Add array to visited before processing its elements\n visited.add(obj);\n obj.forEach(function (el) {\n arrVals.push(stringifyJSON(el, visited));\n });\n return '[' + arrVals + ']';\n }\n }\n /*********CHECK FOR OBJECT**********/\n else if (obj instanceof Object) {\n // Add object to visited before processing its properties\n visited.add(obj);\n //get object keys\n objKeys = Object.keys(obj);\n //set key output;\n objKeys.forEach(function (key) {\n const keyOut = '\"' + key + '\":';\n const keyValOut = obj[key];\n //skip functions and undefined properties\n if (keyValOut instanceof Function || keyValOut === undefined)\n return; // Skip this entry entirely instead of pushing an empty string\n else if (typeof keyValOut === 'string')\n arrOfKeyVals.push(keyOut + '\"' + keyValOut + '\"');\n else if (typeof keyValOut === 'boolean' || typeof keyValOut === 'number' || keyValOut === null)\n arrOfKeyVals.push(keyOut + keyValOut);\n //check for nested objects, call recursively until no more objects\n else if (keyValOut instanceof Object) {\n arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut, visited));\n }\n });\n return '{' + arrOfKeyVals + '}';\n }\n return '';\n};\n"],
|
|
5
|
-
"mappings": "AAEO,MAAM,QAAQ,CAAC,QAAa;AACjC,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,MAAS;AAAA,EACxD;AACF;AAGO,MAAM,gBAAgB,SAAU,KAAU,UAAoB,oBAAI,IAAI,GAAW;AACtF,QAAM,eAAyB,CAAC;AAChC,QAAM,UAAoB,CAAC;AAC3B,MAAI,UAAoB,CAAC;AAGzB,MAAI,OAAO,QAAQ,YAAY,OAAO,QAAQ,aAAa,QAAQ;AACjE,WAAO,KAAK;AAAA,WACL,OAAO,QAAQ;AACtB,WAAO,MAAM,MAAM;AAGrB,MAAI,eAAe,UAAU,QAAQ,IAAI,GAAG,GAAG;AAC7C,WAAO;AAAA,EACT,WAGS,MAAM,QAAQ,GAAG,GAAG;AAE3B,QAAI,IAAI,CAAC,MAAM;AACb,aAAO;AAAA,SACJ;AAEH,cAAQ,IAAI,GAAG;AACf,UAAI,QAAQ,SAAU,IAAI;AACxB,gBAAQ,KAAK,cAAc,IAAI,OAAO,CAAC;AAAA,MACzC,CAAC;
|
|
4
|
+
"sourcesContent": ["\n/* eslint-disable no-undefined */\nexport const clean = (obj: any) => {\n return Object.fromEntries(\n Object.entries(obj).filter(([_, v]) => v !== undefined)\n );\n}\n\n//Recursive implementation of jSON.stringify;\nexport const stringifyJSON = function (obj: any, visited: Set<any> = new Set()): string {\n const arrOfKeyVals: string[] = [];\n const arrVals: string[] = [];\n let objKeys: string[] = [];\n\n /*********CHECK FOR PRIMITIVE TYPES**********/\n if (typeof obj === 'number' || typeof obj === 'boolean' || obj === null)\n return '' + obj;\n else if (typeof obj === 'string')\n return '\"' + obj + '\"';\n\n /*********DETECT CIRCULAR REFERENCES**********/\n if (obj instanceof Object && visited.has(obj)) {\n return '\"(circular)\"';\n }\n\n /*********CHECK FOR ARRAY**********/\n else if (Array.isArray(obj)) {\n //check for empty array\n if (obj[0] === undefined)\n return '[]';\n else {\n // Add array to visited before processing its elements\n visited.add(obj);\n obj.forEach(function (el) {\n arrVals.push(stringifyJSON(el, visited));\n });\n // Remove array from visited after processing to prevent memory leaks\n visited.delete(obj);\n return '[' + arrVals + ']';\n }\n }\n /*********CHECK FOR OBJECT**********/\n else if (obj instanceof Object) {\n // Add object to visited before processing its properties\n visited.add(obj);\n //get object keys\n objKeys = Object.keys(obj);\n //set key output;\n objKeys.forEach(function (key) {\n const keyOut = '\"' + key + '\":';\n const keyValOut = obj[key];\n //skip functions and undefined properties\n if (keyValOut instanceof Function || keyValOut === undefined)\n return; // Skip this entry entirely instead of pushing an empty string\n else if (typeof keyValOut === 'string')\n arrOfKeyVals.push(keyOut + '\"' + keyValOut + '\"');\n else if (typeof keyValOut === 'boolean' || typeof keyValOut === 'number' || keyValOut === null)\n arrOfKeyVals.push(keyOut + keyValOut);\n //check for nested objects, call recursively until no more objects\n else if (keyValOut instanceof Object) {\n arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut, visited));\n }\n });\n // Remove object from visited after processing to prevent memory leaks\n visited.delete(obj);\n return '{' + arrOfKeyVals + '}';\n }\n return '';\n};\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,QAAQ,CAAC,QAAa;AACjC,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,MAAS;AAAA,EACxD;AACF;AAGO,MAAM,gBAAgB,SAAU,KAAU,UAAoB,oBAAI,IAAI,GAAW;AACtF,QAAM,eAAyB,CAAC;AAChC,QAAM,UAAoB,CAAC;AAC3B,MAAI,UAAoB,CAAC;AAGzB,MAAI,OAAO,QAAQ,YAAY,OAAO,QAAQ,aAAa,QAAQ;AACjE,WAAO,KAAK;AAAA,WACL,OAAO,QAAQ;AACtB,WAAO,MAAM,MAAM;AAGrB,MAAI,eAAe,UAAU,QAAQ,IAAI,GAAG,GAAG;AAC7C,WAAO;AAAA,EACT,WAGS,MAAM,QAAQ,GAAG,GAAG;AAE3B,QAAI,IAAI,CAAC,MAAM;AACb,aAAO;AAAA,SACJ;AAEH,cAAQ,IAAI,GAAG;AACf,UAAI,QAAQ,SAAU,IAAI;AACxB,gBAAQ,KAAK,cAAc,IAAI,OAAO,CAAC;AAAA,MACzC,CAAC;AAED,cAAQ,OAAO,GAAG;AAClB,aAAO,MAAM,UAAU;AAAA,IACzB;AAAA,EACF,WAES,eAAe,QAAQ;AAE9B,YAAQ,IAAI,GAAG;AAEf,cAAU,OAAO,KAAK,GAAG;AAEzB,YAAQ,QAAQ,SAAU,KAAK;AAC7B,YAAM,SAAS,MAAM,MAAM;AAC3B,YAAM,YAAY,IAAI,GAAG;AAEzB,UAAI,qBAAqB,YAAY,cAAc;AACjD;AAAA,eACO,OAAO,cAAc;AAC5B,qBAAa,KAAK,SAAS,MAAM,YAAY,GAAG;AAAA,eACzC,OAAO,cAAc,aAAa,OAAO,cAAc,YAAY,cAAc;AACxF,qBAAa,KAAK,SAAS,SAAS;AAAA,eAE7B,qBAAqB,QAAQ;AACpC,qBAAa,KAAK,SAAS,cAAc,WAAW,OAAO,CAAC;AAAA,MAC9D;AAAA,IACF,CAAC;AAED,YAAQ,OAAO,GAAG;AAClB,WAAO,MAAM,eAAe;AAAA,EAC9B;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -376,7 +376,7 @@ export const runBasicRouterExample = async (): Promise<{ app: Application; userR
|
|
|
376
376
|
};
|
|
377
377
|
|
|
378
378
|
// If this file is run directly, start the server
|
|
379
|
-
if (
|
|
379
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
380
380
|
runBasicRouterExample().then(({ app }) => {
|
|
381
381
|
const PORT = process.env.PORT || 3001;
|
|
382
382
|
app.listen(PORT, () => {
|
|
@@ -751,7 +751,7 @@ export const runFullApplicationExample = async (): Promise<{ app: Application }>
|
|
|
751
751
|
};
|
|
752
752
|
|
|
753
753
|
// If this file is run directly, start the server
|
|
754
|
-
if (
|
|
754
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
755
755
|
runFullApplicationExample().then(({ app }) => {
|
|
756
756
|
const PORT = process.env.PORT || 3003;
|
|
757
757
|
app.listen(PORT, () => {
|
|
@@ -585,7 +585,7 @@ export const runNestedRouterExample = async (): Promise<{ app: Application }> =>
|
|
|
585
585
|
};
|
|
586
586
|
|
|
587
587
|
// If this file is run directly, start the server
|
|
588
|
-
if (
|
|
588
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
589
589
|
runNestedRouterExample().then(({ app }) => {
|
|
590
590
|
const PORT = process.env.PORT || 3002;
|
|
591
591
|
app.listen(PORT, () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjell/express-router",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.30",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"express",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@fjell/core": "^4.4.29",
|
|
37
|
-
"@fjell/docs-template": "1.0.28",
|
|
38
37
|
"@fjell/lib": "^4.4.31",
|
|
39
38
|
"@fjell/logging": "^4.4.36",
|
|
40
39
|
"@fjell/registry": "^4.4.24",
|
|
@@ -43,23 +42,23 @@
|
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"@eslint/eslintrc": "^3.3.1",
|
|
46
|
-
"@eslint/js": "^9.
|
|
45
|
+
"@eslint/js": "^9.33.0",
|
|
47
46
|
"@fjell/eslint-config": "^1.1.11",
|
|
48
47
|
"@tsconfig/recommended": "^1.0.10",
|
|
49
48
|
"@types/express": "^5.0.3",
|
|
50
|
-
"@types/node": "^24.1
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
52
|
-
"@typescript-eslint/parser": "^8.
|
|
49
|
+
"@types/node": "^24.2.1",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
|
51
|
+
"@typescript-eslint/parser": "^8.39.0",
|
|
53
52
|
"@vitest/coverage-v8": "^3.2.4",
|
|
54
53
|
"esbuild": "^0.25.8",
|
|
55
|
-
"eslint": "^9.
|
|
54
|
+
"eslint": "^9.33.0",
|
|
56
55
|
"nodemon": "^3.1.10",
|
|
57
|
-
"supertest": "^7.
|
|
58
|
-
"typescript": "^5.
|
|
56
|
+
"supertest": "^7.1.4",
|
|
57
|
+
"typescript": "^5.9.2",
|
|
59
58
|
"vitest": "^3.2.4"
|
|
60
59
|
},
|
|
61
60
|
"repository": {
|
|
62
61
|
"type": "git",
|
|
63
62
|
"url": "git+https://github.com/getfjell/express-router.git"
|
|
64
63
|
}
|
|
65
|
-
}
|
|
64
|
+
}
|