@point-hub/papi 0.1.6 → 0.1.8

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 (71) hide show
  1. package/lib/src/app.d.ts +3 -0
  2. package/lib/src/app.d.ts.map +1 -0
  3. package/lib/src/app.spec.d.ts +2 -0
  4. package/lib/src/app.spec.d.ts.map +1 -0
  5. package/lib/src/console/commands/make-command/index.command.d.ts +6 -0
  6. package/lib/src/console/commands/make-command/index.command.d.ts.map +1 -0
  7. package/lib/src/console/commands/make-command/index.spec.d.ts +2 -0
  8. package/lib/src/console/commands/make-command/index.spec.d.ts.map +1 -0
  9. package/lib/src/console/commands/make-middleware/index.command.d.ts +8 -0
  10. package/lib/src/console/commands/make-middleware/index.command.d.ts.map +1 -0
  11. package/lib/src/console/commands/make-middleware/index.spec.d.ts +2 -0
  12. package/lib/src/console/commands/make-middleware/index.spec.d.ts.map +1 -0
  13. package/lib/src/console/index.d.ts +13 -0
  14. package/lib/src/console/index.d.ts.map +1 -0
  15. package/lib/src/console/index.spec.d.ts +2 -0
  16. package/lib/src/console/index.spec.d.ts.map +1 -0
  17. package/lib/src/database/connection.d.ts +33 -0
  18. package/lib/src/database/connection.d.ts.map +1 -0
  19. package/lib/src/database/mongodb/connection.d.ts +38 -0
  20. package/lib/src/database/mongodb/connection.d.ts.map +1 -0
  21. package/lib/src/database/mongodb/mongodb-error-handler.d.ts +10 -0
  22. package/lib/src/database/mongodb/mongodb-error-handler.d.ts.map +1 -0
  23. package/lib/src/database/mongodb/mongodb-helper.d.ts +36 -0
  24. package/lib/src/database/mongodb/mongodb-helper.d.ts.map +1 -0
  25. package/lib/src/database/mongodb/mongodb-querystring.d.ts +82 -0
  26. package/lib/src/database/mongodb/mongodb-querystring.d.ts.map +1 -0
  27. package/lib/src/database/mongodb/mongodb-querystring.spec.d.ts +2 -0
  28. package/lib/src/database/mongodb/mongodb-querystring.spec.d.ts.map +1 -0
  29. package/lib/src/index.d.ts +39 -0
  30. package/lib/src/index.d.ts.map +1 -0
  31. package/lib/src/interfaces/types.d.ts +112 -0
  32. package/lib/src/interfaces/types.d.ts.map +1 -0
  33. package/lib/src/server.d.ts +16 -0
  34. package/lib/src/server.d.ts.map +1 -0
  35. package/lib/src/server.spec.d.ts +2 -0
  36. package/lib/src/server.spec.d.ts.map +1 -0
  37. package/lib/stub/command/index.command.d.ts +6 -0
  38. package/lib/stub/command/index.command.d.ts.map +1 -0
  39. package/lib/stub/command/index.spec.d.ts +2 -0
  40. package/lib/stub/command/index.spec.d.ts.map +1 -0
  41. package/lib/stub/middleware/configurable.middleware.d.ts +3 -0
  42. package/lib/stub/middleware/configurable.middleware.d.ts.map +1 -0
  43. package/lib/stub/middleware/configurable.spec.d.ts +2 -0
  44. package/lib/stub/middleware/configurable.spec.d.ts.map +1 -0
  45. package/lib/stub/middleware/new.middleware.d.ts +3 -0
  46. package/lib/stub/middleware/new.middleware.d.ts.map +1 -0
  47. package/lib/stub/middleware/new.spec.d.ts +2 -0
  48. package/lib/stub/middleware/new.spec.d.ts.map +1 -0
  49. package/package.json +4 -5
  50. package/lib/index.d.ts +0 -318
  51. package/lib/index.tsbuildinfo +0 -1
  52. package/src/app.spec.ts +0 -8
  53. package/src/app.ts +0 -13
  54. package/src/console/commands/make-command/index.command.ts +0 -52
  55. package/src/console/commands/make-command/index.spec.ts +0 -58
  56. package/src/console/commands/make-middleware/index.command.ts +0 -86
  57. package/src/console/commands/make-middleware/index.spec.ts +0 -73
  58. package/src/console/index.spec.ts +0 -14
  59. package/src/console/index.ts +0 -23
  60. package/src/database/connection.ts +0 -78
  61. package/src/database/mongodb/connection.ts +0 -339
  62. package/src/database/mongodb/mongodb-error-handler.ts +0 -63
  63. package/src/database/mongodb/mongodb-helper.ts +0 -109
  64. package/src/database/mongodb/mongodb-querystring.spec.ts +0 -80
  65. package/src/database/mongodb/mongodb-querystring.ts +0 -143
  66. package/src/index.ts +0 -42
  67. package/src/server.spec.ts +0 -68
  68. package/src/server.ts +0 -49
  69. package/src/types/controller.d.ts +0 -18
  70. package/src/types/database.d.ts +0 -104
  71. package/src/types/use-case.d.ts +0 -3
@@ -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 @@
1
+ {"version":3,"file":"index.command.d.ts","sourceRoot":"","sources":["../../../../../src/console/commands/make-command/index.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,wBAAwB,CAAA;AAO3D,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;;IAe5C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CA6B9B"}
@@ -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":["../../../../../src/console/commands/make-command/index.spec.ts"],"names":[],"mappings":""}
@@ -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 @@
1
+ {"version":3,"file":"index.command.d.ts","sourceRoot":"","sources":["../../../../../src/console/commands/make-middleware/index.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,wBAAwB,CAAA;AAO3D,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;;IAuB/C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB7B,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,2BAA2B;CAkBpC"}
@@ -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":["../../../../../src/console/commands/make-middleware/index.spec.ts"],"names":[],"mappings":""}
@@ -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 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/console/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAKnD,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAY;gBAEf,OAAO,EAAE,UAAU;IAI/B;;;;;OAKG;IACG,QAAQ;CAIf"}
@@ -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":["../../../src/console/index.spec.ts"],"names":[],"mappings":""}
@@ -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 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/database/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,iBAAiB,EAC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G,OAAO,CAAC,eAAe,CAAC;IAGlE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IAGnF,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAGjG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IAG9D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAGzE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG3G"}
@@ -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 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../src/database/mongodb/connection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,EAAE,EACF,SAAS,EAGT,kBAAkB,EAInB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,WAAW,EAAY,MAAM,SAAS,CAAA;AAE/C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,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EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkCtE,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,eAAe,CAAC;IAiB9D,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC;IAmB/E,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAmBjG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC;IAiB1D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAmBrE,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAYpD,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAwCvG"}
@@ -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 @@
1
+ {"version":3,"file":"mongodb-helper.d.ts","sourceRoot":"","sources":["../../../../src/database/mongodb/mongodb-helper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,EAAE,CAAA;gBAEE,EAAE,EAAE,SAAS;IAIzB;;;;;;;;;;;;;;;OAeG;IACU,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAUhE;;OAEG;IACU,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAW5D,QAAQ,CAAC,IAAI,EAAE,MAAM;WAQpB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;WAqB/B,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;CAuB9C"}
@@ -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":""}
@@ -0,0 +1,39 @@
1
+ import { BaseCommand } from '@point-hub/express-cli';
2
+ import { ApiError, BaseError, errorHandlerMiddleware, find, invalidPathMiddleware } from '@point-hub/express-error-handler';
3
+ import { MongoServerError } from 'mongodb';
4
+ import { ConsoleKernel } from './console';
5
+ import { DatabaseConnection } from './database/connection';
6
+ import { MongoDBConnection } from './database/mongodb/connection';
7
+ import { MongoErrorHandler } from './database/mongodb/mongodb-error-handler';
8
+ import { MongoDBHelper } from './database/mongodb/mongodb-helper';
9
+ export declare const stubDir: string;
10
+ export { ExpressCli as BaseConsoleCli } from '@point-hub/express-cli';
11
+ export declare const BaseConsoleCommand: typeof BaseCommand;
12
+ export declare const BaseConsoleKernel: typeof ConsoleKernel;
13
+ export declare const BaseDatabaseConnection: typeof DatabaseConnection;
14
+ export declare const BaseMongoDBConnection: typeof MongoDBConnection;
15
+ export declare const BaseMongoDBHelper: typeof MongoDBHelper;
16
+ export declare const BaseMongoDBQuerystring: {
17
+ page: typeof import("./database/mongodb/mongodb-querystring").page;
18
+ limit: typeof import("./database/mongodb/mongodb-querystring").limit;
19
+ skip: typeof import("./database/mongodb/mongodb-querystring").skip;
20
+ sort: typeof import("./database/mongodb/mongodb-querystring").sort;
21
+ fields: typeof import("./database/mongodb/mongodb-querystring").fields;
22
+ filter: typeof import("./database/mongodb/mongodb-querystring").filter;
23
+ filterExludeFields: typeof import("./database/mongodb/mongodb-querystring").filterExludeFields;
24
+ convertStringToArray: typeof import("./database/mongodb/mongodb-querystring").convertStringToArray;
25
+ convertArrayToObject: typeof import("./database/mongodb/mongodb-querystring").convertArrayToObject;
26
+ };
27
+ export declare const BaseMongoServerError: typeof MongoServerError;
28
+ export declare const BaseMongoErrorHandler: typeof MongoErrorHandler;
29
+ export declare const BaseErrorHandler: {
30
+ ApiError: typeof ApiError;
31
+ BaseError: typeof BaseError;
32
+ isTrustedError: (err: Error) => boolean;
33
+ getHttpError: typeof find;
34
+ errorHandlerMiddleware: typeof errorHandlerMiddleware;
35
+ invalidPathMiddleware: typeof invalidPathMiddleware;
36
+ };
37
+ export { Server as BaseServer } from './server';
38
+ export type { IAggregateOutput, IClientSession, IController, IControllerInput, IControllerOutput, ICreateManyOutput, ICreateOutput, IDatabase, IDeleteManyOutput, IDeleteOutput, IDocument, IHttpRequest, IPipeline, IQuery, IRetrieveAllOutput, IRetrieveOutput, IUpdateManyOutput, IUpdateOutput, IUseCase, } from './interfaces/types';
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,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,GACT,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,112 @@
1
+ export interface IHttpRequest {
2
+ [key: string]: any;
3
+ }
4
+ export interface IControllerInput {
5
+ httpRequest: IHttpRequest;
6
+ dbConnection: IDatabase;
7
+ }
8
+ export interface IController {
9
+ (input: IControllerInput): Promise<IControllerOutput>;
10
+ }
11
+ export interface IControllerOutput {
12
+ status: number;
13
+ json?: any;
14
+ }
15
+ export interface IUseCase<TInput, TDeps, TOptions, TOutput> {
16
+ handle(input: TInput, deps: TDeps, options?: TOptions): Promise<TOutput>;
17
+ }
18
+ export interface IDocument {
19
+ [key: string]: any;
20
+ }
21
+ export interface IQuery {
22
+ fields?: string;
23
+ excludeFields?: string[];
24
+ filter?: {
25
+ [key: string]: unknown;
26
+ };
27
+ page?: number;
28
+ pageSize?: number;
29
+ sort?: string;
30
+ }
31
+ export interface IPipeline {
32
+ [key: string]: any;
33
+ }
34
+ export interface ICreateOutput {
35
+ insertedId: string;
36
+ }
37
+ export interface ICreateManyOutput {
38
+ insertedCount: number;
39
+ insertedIds: string[];
40
+ }
41
+ export interface IRetrieveOutput {
42
+ _id: string;
43
+ [key: string]: unknown;
44
+ }
45
+ export interface IRetrieveAllOutput {
46
+ data: IRetrieveOutput[];
47
+ pagination: {
48
+ page: number;
49
+ pageCount: number;
50
+ pageSize: number;
51
+ totalDocument: number;
52
+ };
53
+ }
54
+ export interface IUpdateOutput {
55
+ matchedCount: number;
56
+ modifiedCount: number;
57
+ }
58
+ export interface IUpdateManyOutput {
59
+ matchedCount: number;
60
+ modifiedCount: number;
61
+ }
62
+ export interface IDeleteOutput {
63
+ deletedCount: number;
64
+ }
65
+ export interface IDeleteManyOutput {
66
+ deletedCount: number;
67
+ }
68
+ export interface IAggregateOutput {
69
+ data: IRetrieveOutput[];
70
+ pagination: {
71
+ page: number;
72
+ pageCount: number;
73
+ pageSize: number;
74
+ totalDocument: number;
75
+ };
76
+ }
77
+ export interface IClientSession {
78
+ startTransaction(options?: unknown): void;
79
+ commitTransaction(): Promise<void>;
80
+ abortTransaction(): Promise<void>;
81
+ endSession(): Promise<void>;
82
+ }
83
+ export interface IDatabase {
84
+ session: unknown;
85
+ open(): Promise<void>;
86
+ close(): Promise<void>;
87
+ database(name: string, options?: unknown): this;
88
+ collection(name: string, options?: unknown): this;
89
+ listCollections(): Promise<{
90
+ name: string;
91
+ }[]>;
92
+ startSession(): IClientSession;
93
+ endSession(): Promise<void>;
94
+ startTransaction(): void;
95
+ commitTransaction(): Promise<void>;
96
+ abortTransaction(): Promise<void>;
97
+ createIndex(name: string, spec: unknown, options?: unknown): Promise<void>;
98
+ createCollection(name: string, options?: unknown): Promise<void>;
99
+ dropCollection(name: string, options?: unknown): Promise<void>;
100
+ updateSchema(name: string, schema: unknown): Promise<void>;
101
+ create(document: IDocument, options?: unknown): Promise<ICreateOutput>;
102
+ createMany(documents: IDocument[], options?: unknown): Promise<ICreateManyOutput>;
103
+ retrieveAll(query: IQuery, options?: unknown): Promise<IRetrieveAllOutput>;
104
+ retrieve(_id: string, options?: unknown): Promise<IRetrieveOutput>;
105
+ update(_id: string, document: IDocument, options?: unknown): Promise<IUpdateOutput>;
106
+ updateMany(filter: IDocument, document: IDocument, options?: unknown): Promise<IUpdateManyOutput>;
107
+ delete(_id: string, options?: unknown): Promise<IDeleteOutput>;
108
+ deleteMany(_ids: string[], options?: unknown): Promise<IDeleteManyOutput>;
109
+ deleteAll(options?: unknown): Promise<IDeleteManyOutput>;
110
+ aggregate(pipeline: IPipeline, query: IQuery, options?: unknown): Promise<IAggregateOutput>;
111
+ }
112
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interfaces/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,YAAY,CAAA;I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,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IACnF,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACjG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC9D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACzE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACxD,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAC5F"}
@@ -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 @@
1
+ {"version":3,"file":"server.spec.d.ts","sourceRoot":"","sources":["../../src/server.spec.ts"],"names":[],"mappings":""}
@@ -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,14 +1,13 @@
1
1
  {
2
2
  "name": "@point-hub/papi",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Point API Framework",
5
5
  "type": "module",
6
- "main": "src/index.ts",
7
- "types": "lib/index.d.ts",
6
+ "main": "lib/index.js",
7
+ "types": "lib/src/index.d.ts",
8
8
  "files": [
9
9
  "lib/",
10
- "stub/",
11
- "src/"
10
+ "stub/"
12
11
  ],
13
12
  "scripts": {
14
13
  "check-types": "tsc -p tsconfig.json",