@point-hub/papi 0.1.10 → 0.1.12

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.
Files changed (40) hide show
  1. package/lib/index.js +3 -3
  2. package/lib/src/app.d.ts +3 -0
  3. package/lib/src/app.d.ts.map +1 -0
  4. package/lib/src/app.spec.d.ts +2 -0
  5. package/lib/src/app.spec.d.ts.map +1 -0
  6. package/lib/src/console/commands/make-command/index.command.d.ts +6 -0
  7. package/lib/src/console/commands/make-command/index.spec.d.ts +2 -0
  8. package/lib/src/console/commands/make-middleware/index.command.d.ts +8 -0
  9. package/lib/src/console/commands/make-middleware/index.spec.d.ts +2 -0
  10. package/lib/src/console/index.d.ts +13 -0
  11. package/lib/src/console/index.spec.d.ts +2 -0
  12. package/lib/src/database/connection.d.ts +33 -0
  13. package/lib/src/database/mongodb/connection.d.ts +38 -0
  14. package/lib/src/database/mongodb/mongodb-error-handler.d.ts +10 -0
  15. package/lib/src/database/mongodb/mongodb-error-handler.d.ts.map +1 -0
  16. package/lib/src/database/mongodb/mongodb-helper.d.ts +36 -0
  17. package/lib/src/database/mongodb/mongodb-querystring.d.ts +82 -0
  18. package/lib/src/database/mongodb/mongodb-querystring.d.ts.map +1 -0
  19. package/lib/src/database/mongodb/mongodb-querystring.spec.d.ts +2 -0
  20. package/lib/src/database/mongodb/mongodb-querystring.spec.d.ts.map +1 -0
  21. package/lib/src/index.d.ts +2 -0
  22. package/lib/src/index.d.ts.map +1 -1
  23. package/lib/src/middleware/mongodb-error-handler.middleware.d.ts +3 -0
  24. package/lib/src/middleware/mongodb-error-handler.middleware.d.ts.map +1 -0
  25. package/lib/src/server.d.ts +16 -0
  26. package/lib/src/server.d.ts.map +1 -0
  27. package/lib/src/server.spec.d.ts +2 -0
  28. package/lib/stub/command/index.command.d.ts +6 -0
  29. package/lib/stub/command/index.command.d.ts.map +1 -0
  30. package/lib/stub/command/index.spec.d.ts +2 -0
  31. package/lib/stub/command/index.spec.d.ts.map +1 -0
  32. package/lib/stub/middleware/configurable.middleware.d.ts +3 -0
  33. package/lib/stub/middleware/configurable.middleware.d.ts.map +1 -0
  34. package/lib/stub/middleware/configurable.spec.d.ts +2 -0
  35. package/lib/stub/middleware/configurable.spec.d.ts.map +1 -0
  36. package/lib/stub/middleware/new.middleware.d.ts +3 -0
  37. package/lib/stub/middleware/new.middleware.d.ts.map +1 -0
  38. package/lib/stub/middleware/new.spec.d.ts +2 -0
  39. package/lib/stub/middleware/new.spec.d.ts.map +1 -0
  40. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ import express from 'express';
2
+ export declare function createApp(): Promise<express.Express>;
3
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAuC,MAAM,SAAS,CAAA;AAE7D,wBAAsB,SAAS,6BAU9B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=app.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.spec.d.ts","sourceRoot":"","sources":["../../src/app.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from '@point-hub/express-cli';
2
+ export default class MakeCommand extends BaseCommand {
3
+ constructor();
4
+ handle(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=index.command.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.spec.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { BaseCommand } from '@point-hub/express-cli';
2
+ export default class MakeMiddleware extends BaseCommand {
3
+ constructor();
4
+ handle(): Promise<void>;
5
+ private copyMiddleware;
6
+ private copyConfigureableMiddleware;
7
+ }
8
+ //# sourceMappingURL=index.command.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.spec.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { ExpressCli } from '@point-hub/express-cli';
2
+ export declare class ConsoleKernel {
3
+ private command;
4
+ constructor(command: ExpressCli);
5
+ /**
6
+ * Register the commands for the application.
7
+ *
8
+ * @example
9
+ * this.command.register(new ExampleCommand());
10
+ */
11
+ register(): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.spec.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { IAggregateOutput, ICreateManyOutput, ICreateOutput, IDatabase, IDeleteManyOutput, IDeleteOutput, IDocument, IPipeline, IQuery, IRetrieveAllOutput, IRetrieveOutput, IUpdateManyOutput, IUpdateOutput } from '../index';
2
+ export declare class DatabaseConnection implements IDatabase {
3
+ adapter: IDatabase;
4
+ session: unknown;
5
+ constructor(adapter: IDatabase);
6
+ open(): Promise<void>;
7
+ close(): Promise<void>;
8
+ database(name: string): this;
9
+ collection(name: string): this;
10
+ listCollections(): Promise<{
11
+ name: string;
12
+ }[]>;
13
+ startSession(): import("../index").IClientSession;
14
+ endSession(): Promise<void>;
15
+ startTransaction(): void;
16
+ commitTransaction(): Promise<void>;
17
+ abortTransaction(): Promise<void>;
18
+ createIndex(name: string, spec: unknown, options?: unknown): Promise<void>;
19
+ createCollection(name: string, options?: unknown): Promise<void>;
20
+ dropCollection(name: string, options?: unknown): Promise<void>;
21
+ updateSchema(name: string, schema: unknown): Promise<void>;
22
+ create(document: IDocument, options?: unknown): Promise<ICreateOutput>;
23
+ createMany(documents: IDocument[], options?: unknown): Promise<ICreateManyOutput>;
24
+ retrieveAll(query: IQuery, options?: unknown): Promise<IRetrieveAllOutput>;
25
+ retrieve(_id: string, options?: unknown): Promise<IRetrieveOutput>;
26
+ update(_id: string, document: IDocument, options?: unknown): Promise<IUpdateOutput>;
27
+ updateMany(filter: IDocument, document: IDocument, options?: unknown): Promise<IUpdateManyOutput>;
28
+ delete(_id: string, options?: unknown): Promise<IDeleteOutput>;
29
+ deleteMany(_ids: string[], options?: unknown): Promise<IDeleteManyOutput>;
30
+ deleteAll(options?: unknown): Promise<IDeleteManyOutput>;
31
+ aggregate(pipeline: IPipeline[], query: IQuery, options?: unknown): Promise<IAggregateOutput>;
32
+ }
33
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1,38 @@
1
+ import type { ClientSession, Collection, CollectionOptions, CreateIndexesOptions, Db, DbOptions, IndexSpecification } from 'mongodb';
2
+ import { MongoClient } from 'mongodb';
3
+ import { IAggregateOutput, ICreateManyOutput, ICreateOutput, IDatabase, IDeleteManyOutput, IDeleteOutput, IDocument, IPipeline, IQuery, IRetrieveAllOutput, IRetrieveOutput, IUpdateManyOutput, IUpdateOutput } from '../../index';
4
+ export declare class MongoDBConnection implements IDatabase {
5
+ databaseName: string;
6
+ client: MongoClient;
7
+ _database: Db | undefined;
8
+ _collection: Collection | undefined;
9
+ session: ClientSession | undefined;
10
+ constructor(connectionString: string, databaseName: string);
11
+ open(): Promise<void>;
12
+ close(): Promise<void>;
13
+ database(name: string, options?: DbOptions): this;
14
+ collection(name: string, options?: CollectionOptions): this;
15
+ listCollections(): Promise<{
16
+ name: string;
17
+ }[]>;
18
+ createIndex(name: string, spec: IndexSpecification, options: CreateIndexesOptions): Promise<void>;
19
+ updateSchema(name: string, schema: unknown): Promise<void>;
20
+ createCollection(name: string, options: any): Promise<void>;
21
+ dropCollection(name: string, options: any): Promise<void>;
22
+ startSession(): ClientSession;
23
+ endSession(): Promise<void>;
24
+ startTransaction(): void;
25
+ commitTransaction(): Promise<void>;
26
+ abortTransaction(): Promise<void>;
27
+ create(document: IDocument, options?: unknown): Promise<ICreateOutput>;
28
+ createMany(documents: IDocument[], options?: unknown): Promise<ICreateManyOutput>;
29
+ retrieveAll(query: IQuery, options?: any): Promise<IRetrieveAllOutput>;
30
+ retrieve(_id: string, options?: any): Promise<IRetrieveOutput>;
31
+ update(_id: string, document: IDocument, options?: any): Promise<IUpdateOutput>;
32
+ updateMany(filter: IDocument[], document: IDocument[], options?: any): Promise<IUpdateManyOutput>;
33
+ delete(_id: string, options?: any): Promise<IDeleteOutput>;
34
+ deleteMany(_ids: string[], options?: any): Promise<IDeleteManyOutput>;
35
+ deleteAll(options?: any): Promise<IDeleteManyOutput>;
36
+ aggregate(pipeline: IPipeline[], query: IQuery, options?: any): Promise<IAggregateOutput>;
37
+ }
38
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { BaseError, type IError } from '@point-hub/express-error-handler';
2
+ import { MongoServerError } from 'mongodb';
3
+ export declare function handleSchemaValidation(err: MongoServerError, error: IError): void;
4
+ export declare function handleUniqueValidation(err: MongoServerError, error: IError): void;
5
+ export declare class MongoErrorHandler extends BaseError {
6
+ constructor(err: MongoServerError);
7
+ get isOperational(): boolean;
8
+ get name(): string;
9
+ }
10
+ //# sourceMappingURL=mongodb-error-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-error-handler.d.ts","sourceRoot":"","sources":["../../../../src/database/mongodb/mongodb-error-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAQ,KAAK,MAAM,EAAoB,MAAM,kCAAkC,CAAA;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,QAS1E;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,QA4B1E;AAED,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,GAAG,EAAE,gBAAgB;IAUjC,IAAI,aAAa,YAEhB;IACD,IAAa,IAAI,WAEhB;CACF"}
@@ -0,0 +1,36 @@
1
+ import { IDatabase } from '../../index';
2
+ /**
3
+ * https://www.mongodb.com/docs/drivers/node/current/fundamentals/indexes/
4
+ * https://www.mongodb.com/docs/manual/reference/collation/
5
+ * https://www.mongodb.com/docs/manual/core/index-sparse/
6
+ * https://www.mongodb.com/docs/manual/core/index-partial/
7
+ */
8
+ export declare class MongoDBHelper {
9
+ private db;
10
+ constructor(db: IDatabase);
11
+ /**
12
+ * Create unique column
13
+ *
14
+ * @example
15
+ * create unique attribute "name"
16
+ * createUnique(collection, {
17
+ * name: -1,
18
+ * })
19
+ *
20
+ * @example
21
+ * create unique attribute for multiple column "first_name" and "last_name"
22
+ * createUnique(collection, {
23
+ * firstName: -1,
24
+ * lastName: -1,
25
+ * })
26
+ */
27
+ createUnique(collection: string, properties: object): Promise<void>;
28
+ /**
29
+ * Create unique if column is exists
30
+ */
31
+ createUniqueIfNotNull(collection: string, properties: object): Promise<void>;
32
+ isExists(name: string): Promise<boolean>;
33
+ static stringToObjectId(val: any): any;
34
+ static objectIdToString(val: any): any;
35
+ }
36
+ //# sourceMappingURL=mongodb-helper.d.ts.map
@@ -0,0 +1,82 @@
1
+ import { SortDirection } from 'mongodb';
2
+ interface IFieldsObject {
3
+ [key: string]: number;
4
+ }
5
+ interface ISortObject {
6
+ [key: string]: SortDirection;
7
+ }
8
+ /**
9
+ * Parse query string to number
10
+ *
11
+ * @example
12
+ * page("10") // => 10
13
+ * page(10) // => 10
14
+ */
15
+ export declare function page(page?: string | number): number;
16
+ /**
17
+ * Parse query string to number
18
+ *
19
+ * @example
20
+ * limit("10") // => 10
21
+ * limit(10) // => 10
22
+ */
23
+ export declare function limit(pageSize?: string | number): number;
24
+ /**
25
+ * Skip number of data from page
26
+ *
27
+ * @example
28
+ * skip(1, 10) // => 0
29
+ * skip(2, 10) // => 10
30
+ * skip(3, 10) // => 20
31
+ */
32
+ export declare function skip(currentPage: string | number, pageSize: string | number): number;
33
+ export declare function filter(filter: never): never;
34
+ /**
35
+ * Convert string param to mongodb field object
36
+ *
37
+ * @example
38
+ * fields("name, address") // => { name: 1, address: 1 }
39
+ */
40
+ export declare function fields(fields?: string, excludeFields?: string[]): IFieldsObject;
41
+ /**
42
+ * Convert string to array
43
+ *
44
+ * @example
45
+ * convertStringToArray("name, address") // => ["name", "address"]
46
+ */
47
+ export declare function convertStringToArray(fields: string): string[];
48
+ /**
49
+ * Convert array to mongodb field object
50
+ *
51
+ * @example
52
+ * convertArrayToObject(["name", "address"]) // => { name: 1, address: 1 }
53
+ * convertArrayToObject(["name", "address"], -1) // => { name: -1, address: -1 }
54
+ */
55
+ export declare function convertArrayToObject(array: string[], value?: number): IFieldsObject;
56
+ /**
57
+ * Remove excluded fields
58
+ *
59
+ * @example
60
+ * ex: { password: 0 }
61
+ */
62
+ export declare function filterExludeFields(obj: IFieldsObject, excludeFields: string[]): IFieldsObject;
63
+ /**
64
+ * Convert string param to mongodb sort object
65
+ *
66
+ * @example
67
+ * sort("name, -createdAt") // => { name: 1, createdAt: -1 }
68
+ */
69
+ export declare function sort(fields: string): ISortObject;
70
+ declare const _default: {
71
+ page: typeof page;
72
+ limit: typeof limit;
73
+ skip: typeof skip;
74
+ sort: typeof sort;
75
+ fields: typeof fields;
76
+ filter: typeof filter;
77
+ filterExludeFields: typeof filterExludeFields;
78
+ convertStringToArray: typeof convertStringToArray;
79
+ convertArrayToObject: typeof convertArrayToObject;
80
+ };
81
+ export default _default;
82
+ //# sourceMappingURL=mongodb-querystring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-querystring.d.ts","sourceRoot":"","sources":["../../../../src/database/mongodb/mongodb-querystring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,UAAU,aAAa;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB;AAED,UAAU,WAAW;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,MAAM,GAAG,MAAU,GAAG,MAAM,CAMtD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,QAAQ,GAAE,MAAM,GAAG,MAAW,GAAG,MAAM,CAM5D;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAEpF;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,KAAK,SAEnC;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,SAAK,EAAE,aAAa,GAAE,MAAM,EAAO,GAAG,aAAa,CAI/E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAM7D;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,SAAI,GAAG,aAAa,CAM9E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,aAAa,CAK7F;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAchD;;;;;;;;;;;;AAED,wBAUC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mongodb-querystring.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-querystring.spec.d.ts","sourceRoot":"","sources":["../../../../src/database/mongodb/mongodb-querystring.spec.ts"],"names":[],"mappings":""}
@@ -6,6 +6,7 @@ import { DatabaseConnection } from './database/connection';
6
6
  import { MongoDBConnection } from './database/mongodb/connection';
7
7
  import { MongoErrorHandler } from './database/mongodb/mongodb-error-handler';
8
8
  import { MongoDBHelper } from './database/mongodb/mongodb-helper';
9
+ import mongodbErrorHandlerMiddleware from './middleware/mongodb-error-handler.middleware';
9
10
  export declare const stubDir: string;
10
11
  export { ExpressCli as BaseConsoleCli } from '@point-hub/express-cli';
11
12
  export declare const BaseConsoleCommand: typeof BaseCommand;
@@ -32,6 +33,7 @@ export declare const BaseErrorHandler: {
32
33
  BaseError: typeof BaseError;
33
34
  isTrustedError: (err: Error) => boolean;
34
35
  getHttpError: typeof find;
36
+ mongodbErrorHandlerMiddleware: typeof mongodbErrorHandlerMiddleware;
35
37
  errorHandlerMiddleware: typeof errorHandlerMiddleware;
36
38
  invalidPathMiddleware: typeof invalidPathMiddleware;
37
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EACL,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,IAAI,EACJ,qBAAqB,EAEtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAGjE,eAAO,MAAM,OAAO,QAAqF,CAAA;AAGzG,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACrE,eAAO,MAAM,kBAAkB,oBAAc,CAAA;AAC7C,eAAO,MAAM,iBAAiB,sBAAgB,CAAA;AAE9C,eAAO,MAAM,sBAAsB,2BAAqB,CAAA;AACxD,eAAO,MAAM,qBAAqB,0BAAoB,CAAA;AACtD,eAAO,MAAM,iBAAiB,sBAAgB,CAAA;AAC9C,eAAO,MAAM,sBAAsB;;;;;;;;;;CAAc,CAAA;AACjD,eAAO,MAAM,oBAAoB,yBAAmB,CAAA;AACpD,eAAO,MAAM,qBAAqB,0BAAoB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAEnE,eAAO,MAAM,gBAAgB;;;;;;;CAO5B,CAAA;AAED,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAE/C,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,QAAQ,GACT,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EACL,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,IAAI,EACJ,qBAAqB,EAEtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEjE,OAAO,6BAA6B,MAAM,+CAA+C,CAAA;AAEzF,eAAO,MAAM,OAAO,QAAqF,CAAA;AAGzG,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACrE,eAAO,MAAM,kBAAkB,oBAAc,CAAA;AAC7C,eAAO,MAAM,iBAAiB,sBAAgB,CAAA;AAE9C,eAAO,MAAM,sBAAsB,2BAAqB,CAAA;AACxD,eAAO,MAAM,qBAAqB,0BAAoB,CAAA;AACtD,eAAO,MAAM,iBAAiB,sBAAgB,CAAA;AAC9C,eAAO,MAAM,sBAAsB;;;;;;;;;;CAAc,CAAA;AACjD,eAAO,MAAM,oBAAoB,yBAAmB,CAAA;AACpD,eAAO,MAAM,qBAAqB,0BAAoB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAEnE,eAAO,MAAM,gBAAgB;;;;;;;;CAQ5B,CAAA;AAED,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAE/C,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,QAAQ,GACT,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { NextFunction, Request, Response } from 'express';
2
+ export default function mongodbErrorHandlerMiddleware(): (err: Error, req: Request, res: Response, next: NextFunction) => void;
3
+ //# sourceMappingURL=mongodb-error-handler.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-error-handler.middleware.d.ts","sourceRoot":"","sources":["../../../src/middleware/mongodb-error-handler.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAIzD,MAAM,CAAC,OAAO,UAAU,6BAA6B,UACtC,KAAK,OAAO,OAAO,OAAO,QAAQ,QAAQ,YAAY,UAMpE"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="bun-types" />
3
+ import { Express } from 'express';
4
+ import { Server as HttpServer } from 'http';
5
+ export declare class Server {
6
+ app: Express;
7
+ server: HttpServer | null;
8
+ constructor(app: Express);
9
+ listen(port: number, hostname?: string): Promise<unknown>;
10
+ start(port: number, hostname?: string): Promise<void>;
11
+ stop(): void;
12
+ get host(): string;
13
+ get port(): number;
14
+ get url(): string;
15
+ }
16
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAG3C,qBAAa,MAAM;IACjB,GAAG,EAAE,OAAO,CAAA;IACZ,MAAM,EAAE,UAAU,GAAG,IAAI,CAAO;gBAEpB,GAAG,EAAE,OAAO;IAIxB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAUhC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAI3C,IAAI;IAKJ,IAAI,IAAI,WAOP;IAED,IAAI,IAAI,WAGP;IAED,IAAI,GAAG,WAEN;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=server.spec.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from '@point-hub/express-cli';
2
+ export default class NewCommand extends BaseCommand {
3
+ constructor();
4
+ handle(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=index.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.command.d.ts","sourceRoot":"","sources":["../../../stub/command/index.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;;IAU3C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../stub/command/index.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { NextFunction, Request, Response } from 'express';
2
+ export default function newMiddleware<T>(options?: T): (req: Request, res: Response, next: NextFunction) => void;
3
+ //# sourceMappingURL=configurable.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurable.middleware.d.ts","sourceRoot":"","sources":["../../../stub/middleware/configurable.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEzD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,SAC5B,OAAO,OAAO,QAAQ,QAAQ,YAAY,UAIjE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=configurable.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurable.spec.d.ts","sourceRoot":"","sources":["../../../stub/middleware/configurable.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { NextFunction, Request, Response } from 'express';
2
+ export default function (req: Request, res: Response, next: NextFunction): void;
3
+ //# sourceMappingURL=new.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new.middleware.d.ts","sourceRoot":"","sources":["../../../stub/middleware/new.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEzD,MAAM,CAAC,OAAO,WAAW,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,QAEvE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=new.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new.spec.d.ts","sourceRoot":"","sources":["../../../stub/middleware/new.spec.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@point-hub/papi",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Point API Framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -13,7 +13,7 @@
13
13
  "check-types": "tsc -p tsconfig.json",
14
14
  "dev": "shx rm -rf lib && bun run build.ts --watch",
15
15
  "build": "shx rm -rf lib && bun run check-types && bun run build.ts && bun run build:declaration",
16
- "build:declaration": "tsc -p tsconfig.types.json",
16
+ "build:declaration": "shx rm tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json",
17
17
  "lint": "eslint ./src/**/*.ts",
18
18
  "lint:fix": "bun run lint -- --fix"
19
19
  },