@open-norantec/herbal 1.0.0-alpha.0

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 (58) hide show
  1. package/LICENSE +22 -0
  2. package/dist/abstracts/auth-adapter.abstract.class.d.ts +19 -0
  3. package/dist/abstracts/auth-adapter.abstract.class.js +11 -0
  4. package/dist/abstracts/index.d.ts +1 -0
  5. package/dist/abstracts/index.js +17 -0
  6. package/dist/builder/index.d.ts +47 -0
  7. package/dist/builder/index.js +606 -0
  8. package/dist/cli/herbal.d.ts +1 -0
  9. package/dist/cli/herbal.js +34 -0
  10. package/dist/common.d.ts +1 -0
  11. package/dist/common.js +17 -0
  12. package/dist/constants/headers.constant.d.ts +4 -0
  13. package/dist/constants/headers.constant.js +7 -0
  14. package/dist/constants/index.d.ts +1 -0
  15. package/dist/constants/index.js +17 -0
  16. package/dist/core.d.ts +18 -0
  17. package/dist/core.js +135 -0
  18. package/dist/create.d.ts +27 -0
  19. package/dist/create.js +132 -0
  20. package/dist/decorators/auth-adapter.decorator.d.ts +7 -0
  21. package/dist/decorators/auth-adapter.decorator.js +18 -0
  22. package/dist/decorators/hide-in-client.decorator.d.ts +6 -0
  23. package/dist/decorators/hide-in-client.decorator.js +15 -0
  24. package/dist/decorators/index.d.ts +2 -0
  25. package/dist/decorators/index.js +18 -0
  26. package/dist/index.d.ts +12 -0
  27. package/dist/index.js +28 -0
  28. package/dist/modules/index.d.ts +1 -0
  29. package/dist/modules/index.js +17 -0
  30. package/dist/modules/logger/index.d.ts +2 -0
  31. package/dist/modules/logger/index.js +18 -0
  32. package/dist/modules/logger/logger.module.d.ts +2 -0
  33. package/dist/modules/logger/logger.module.js +25 -0
  34. package/dist/modules/logger/logger.service.d.ts +13 -0
  35. package/dist/modules/logger/logger.service.js +57 -0
  36. package/dist/sequelize-di.d.ts +11 -0
  37. package/dist/sequelize-di.js +93 -0
  38. package/dist/sequelize.d.ts +1 -0
  39. package/dist/sequelize.js +17 -0
  40. package/dist/transformers/reflect-declaration.d.ts +3 -0
  41. package/dist/transformers/reflect-declaration.js +63 -0
  42. package/dist/tsconfig.tsbuildinfo +1 -0
  43. package/dist/types/http-response-body.type.d.ts +4 -0
  44. package/dist/types/http-response-body.type.js +2 -0
  45. package/dist/types/index.d.ts +2 -0
  46. package/dist/types/index.js +18 -0
  47. package/dist/types/request.type.d.ts +9 -0
  48. package/dist/types/request.type.js +2 -0
  49. package/dist/utilities/controller-util.class.d.ts +18 -0
  50. package/dist/utilities/controller-util.class.js +214 -0
  51. package/dist/utilities/index.d.ts +3 -0
  52. package/dist/utilities/index.js +19 -0
  53. package/dist/utilities/model-util.class.d.ts +6 -0
  54. package/dist/utilities/model-util.class.js +31 -0
  55. package/dist/utilities/nest-util.class.d.ts +5 -0
  56. package/dist/utilities/nest-util.class.js +27 -0
  57. package/package.json +80 -0
  58. package/preserved/@@notfound.js +0 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT LICENSE
2
+
3
+ Copyright (c) 2014-present Norantec Inc. <no-reply@norantec.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ import { ModuleRef } from '@nestjs/core';
2
+ import { Constructor } from 'type-fest';
3
+ import { Request } from 'express';
4
+ export interface AuthenticateReturn {
5
+ challengeValue: string;
6
+ identifier: string;
7
+ forbidden?: boolean;
8
+ nextToken?: string;
9
+ }
10
+ export interface AuthenticateResult extends AuthenticateReturn {
11
+ AuthenticatorClass: Constructor<AuthAdapter>;
12
+ }
13
+ export declare abstract class AuthAdapter {
14
+ protected readonly request: Request;
15
+ protected readonly ref: ModuleRef;
16
+ constructor(request: Request, ref: ModuleRef);
17
+ abstract match(): boolean;
18
+ abstract authenticate(): Promise<AuthenticateReturn | null>;
19
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthAdapter = void 0;
4
+ var AuthAdapter = (function () {
5
+ function AuthAdapter(request, ref) {
6
+ this.request = request;
7
+ this.ref = ref;
8
+ }
9
+ return AuthAdapter;
10
+ }());
11
+ exports.AuthAdapter = AuthAdapter;
@@ -0,0 +1 @@
1
+ export * from './auth-adapter.abstract.class';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth-adapter.abstract.class"), exports);
@@ -0,0 +1,47 @@
1
+ import * as ts from 'typescript';
2
+ import { z } from 'zod';
3
+ import * as winston from 'winston';
4
+ export declare const OPTIONS_SCHEMA: z.ZodObject<{
5
+ clean: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
+ entry: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined]>;
7
+ outputDir: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined]>;
8
+ outputName: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined]>;
9
+ outputNameFormat: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined]>;
10
+ sourceDir: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined]>;
11
+ tsProject: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined]>;
12
+ workDir: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined]>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ clean: boolean;
15
+ entry?: string | undefined;
16
+ outputDir?: string | undefined;
17
+ outputName?: string | undefined;
18
+ outputNameFormat?: string | undefined;
19
+ sourceDir?: string | undefined;
20
+ tsProject?: string | undefined;
21
+ workDir?: string | undefined;
22
+ }, {
23
+ clean?: boolean | undefined;
24
+ entry?: string | undefined;
25
+ outputDir?: string | undefined;
26
+ outputName?: string | undefined;
27
+ outputNameFormat?: string | undefined;
28
+ sourceDir?: string | undefined;
29
+ tsProject?: string | undefined;
30
+ workDir?: string | undefined;
31
+ }>;
32
+ declare const COMPILER_GENERATION_TYPE: z.ZodEnum<["build", "client", "watch"]>;
33
+ type CompilerGenerationType = z.infer<typeof COMPILER_GENERATION_TYPE>;
34
+ export type BuilderOptions = z.infer<typeof OPTIONS_SCHEMA>;
35
+ export declare class Builder {
36
+ private readonly inputOptions;
37
+ protected readonly logger: winston.Logger;
38
+ protected options: BuilderOptions;
39
+ protected tsConfig: ts.ParsedCommandLine;
40
+ protected entryFilePath: string;
41
+ protected entryDirPath: string;
42
+ protected outputPath: string;
43
+ protected virtualEntryFilePath: string;
44
+ constructor(inputOptions: BuilderOptions);
45
+ run(inputType: CompilerGenerationType, debug?: boolean): void;
46
+ }
47
+ export {};