@expressots/adapter-express 1.8.2 → 3.0.0-beta.2

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 (49) hide show
  1. package/lib/CHANGELOG.md +168 -139
  2. package/lib/cjs/adapter-express/application-express.base.js +2 -12
  3. package/lib/cjs/adapter-express/application-express.js +132 -52
  4. package/lib/cjs/adapter-express/application-express.types.js +0 -20
  5. package/lib/cjs/adapter-express/express-utils/base-middleware.js +2 -2
  6. package/lib/cjs/adapter-express/express-utils/constants.js +1 -3
  7. package/lib/cjs/adapter-express/express-utils/decorators.js +26 -12
  8. package/lib/cjs/adapter-express/express-utils/http-status-middleware.js +10 -5
  9. package/lib/cjs/adapter-express/express-utils/utils.js +3 -0
  10. package/lib/cjs/adapter-express/index.js +4 -1
  11. package/lib/cjs/adapter-express/micro-api/application-express-micro-container.js +51 -0
  12. package/lib/cjs/adapter-express/micro-api/application-express-micro-route.js +101 -0
  13. package/lib/cjs/adapter-express/micro-api/application-express-micro.js +177 -0
  14. package/lib/cjs/adapter-express/micro-api/index.js +5 -0
  15. package/lib/cjs/adapter-express/render/constants.js +40 -0
  16. package/lib/cjs/adapter-express/render/engine.js +52 -11
  17. package/lib/cjs/adapter-express/render/index.js +0 -3
  18. package/lib/cjs/di/di.interfaces.js +10 -0
  19. package/lib/cjs/types/adapter-express/application-express.base.d.ts +17 -0
  20. package/lib/cjs/types/adapter-express/application-express.d.ts +58 -23
  21. package/lib/cjs/types/adapter-express/application-express.types.d.ts +1 -41
  22. package/lib/cjs/types/adapter-express/express-utils/base-middleware.d.ts +1 -1
  23. package/lib/cjs/types/adapter-express/express-utils/constants.d.ts +1 -1
  24. package/lib/cjs/types/adapter-express/express-utils/decorators.d.ts +18 -4
  25. package/lib/cjs/types/adapter-express/express-utils/http-status-middleware.d.ts +2 -0
  26. package/lib/cjs/types/adapter-express/express-utils/interfaces.d.ts +1 -1
  27. package/lib/cjs/types/adapter-express/express-utils/inversify-express-server.d.ts +1 -1
  28. package/lib/cjs/types/adapter-express/express-utils/utils.d.ts +1 -1
  29. package/lib/cjs/types/adapter-express/index.d.ts +2 -2
  30. package/lib/cjs/types/adapter-express/micro-api/application-express-micro-container.d.ts +47 -0
  31. package/lib/cjs/types/adapter-express/micro-api/application-express-micro-route.d.ts +93 -0
  32. package/lib/cjs/types/adapter-express/micro-api/application-express-micro.d.ts +79 -0
  33. package/lib/cjs/types/adapter-express/micro-api/index.d.ts +1 -0
  34. package/lib/cjs/types/adapter-express/render/constants.d.ts +26 -0
  35. package/lib/cjs/types/adapter-express/render/engine.d.ts +14 -22
  36. package/lib/cjs/types/adapter-express/render/index.d.ts +4 -4
  37. package/lib/cjs/types/di/di.interfaces.d.ts +289 -0
  38. package/lib/package.json +11 -16
  39. package/package.json +11 -16
  40. package/lib/cjs/adapter-express/application-express.interface.js +0 -2
  41. package/lib/cjs/adapter-express/render/ejs/ejs.config.js +0 -37
  42. package/lib/cjs/adapter-express/render/ejs/ejs.types.js +0 -3
  43. package/lib/cjs/adapter-express/render/handlebars/hbs.config.js +0 -38
  44. package/lib/cjs/adapter-express/render/pug/pug.config.js +0 -25
  45. package/lib/cjs/types/adapter-express/application-express.interface.d.ts +0 -20
  46. package/lib/cjs/types/adapter-express/render/ejs/ejs.config.d.ts +0 -21
  47. package/lib/cjs/types/adapter-express/render/ejs/ejs.types.d.ts +0 -169
  48. package/lib/cjs/types/adapter-express/render/handlebars/hbs.config.d.ts +0 -20
  49. package/lib/cjs/types/adapter-express/render/pug/pug.config.d.ts +0 -17
@@ -1,169 +0,0 @@
1
- /**
2
- * An object where {@link filename} is the final parsed path or {@link template} is the content of the included template
3
- */
4
- export type IncluderResult = {
5
- filename: string;
6
- template?: never;
7
- } | {
8
- template: string;
9
- filename?: never;
10
- };
11
- /**
12
- * @param originalPath the path as it appears in the include statement
13
- * @param parsedPath the previously resolved path
14
- *
15
- * @return An {@link IncluderResult} object containing the filename or template data.
16
- */
17
- type IncluderCallback = (originalPath: string, parsedPath: string) => IncluderResult;
18
- /**
19
- * Escapes a string using HTML/XML escaping rules.
20
- *
21
- * Returns the empty string for `null` or `undefined`.
22
- *
23
- * @param markup Input string
24
- * @return Escaped string
25
- */
26
- type EscapeCallback = (markup?: any) => string;
27
- export interface Options {
28
- /**
29
- * Log the generated JavaScript source for the EJS template to the console.
30
- *
31
- * @default false
32
- */
33
- debug?: boolean | undefined;
34
- /**
35
- * Include additional runtime debugging information in generated template
36
- * functions.
37
- *
38
- * @default true
39
- */
40
- compileDebug?: boolean | undefined;
41
- /**
42
- * Whether or not to use `with () {}` construct in the generated template
43
- * functions. If set to `false`, data is still accessible through the object
44
- * whose name is specified by `ejs.localsName` (defaults to `locals`).
45
- *
46
- * @default true
47
- */
48
- _with?: boolean | undefined;
49
- /**
50
- * Whether to run in strict mode or not.
51
- * Enforces `_with=false`.
52
- *
53
- * @default false
54
- */
55
- strict?: boolean | undefined;
56
- /**
57
- * An array of local variables that are always destructured from `localsName`,
58
- * available even in strict mode.
59
- *
60
- * @default []
61
- */
62
- destructuredLocals?: Array<string> | undefined;
63
- /**
64
- * Remove all safe-to-remove whitespace, including leading and trailing
65
- * whitespace. It also enables a safer version of `-%>` line slurping for all
66
- * scriptlet tags (it does not strip new lines of tags in the middle of a
67
- * line).
68
- *
69
- * @default false
70
- */
71
- rmWhitespace?: boolean | undefined;
72
- /**
73
- * Whether or not to compile a `ClientFunction` that can be rendered
74
- * in the browser without depending on ejs.js. Otherwise, a `TemplateFunction`
75
- * will be compiled.
76
- *
77
- * @default false
78
- */
79
- client?: boolean | undefined;
80
- /**
81
- * The escaping function used with `<%=` construct. It is used in rendering
82
- * and is `.toString()`ed in the generation of client functions.
83
- *
84
- * @default ejs.escapeXML
85
- */
86
- escape?: EscapeCallback | undefined;
87
- /**
88
- * The filename of the template. Required for inclusion and caching unless
89
- * you are using `renderFile`. Also used for error reporting.
90
- *
91
- * @default undefined
92
- */
93
- filename?: string | undefined;
94
- /**
95
- * The path to templates root(s). When this is set, absolute paths for includes
96
- * (/filename.ejs) will be relative to the templates root(s).
97
- *
98
- * @default undefined
99
- */
100
- root?: Array<string> | string | undefined;
101
- /**
102
- * The opening delimiter for all statements. This allows you to clearly delinate
103
- * the difference between template code and existing delimiters. (It is recommended
104
- * to synchronize this with the closeDelimiter property.)
105
- *
106
- * @default ejs.openDelimiter
107
- */
108
- openDelimiter?: string | undefined;
109
- /**
110
- * The closing delimiter for all statements. This allows to to clearly delinate
111
- * the difference between template code and existing delimiters. (It is recommended
112
- * to synchronize this with the openDelimiter property.)
113
- *
114
- * @default ejs.closeDelimiter
115
- */
116
- closeDelimiter?: string | undefined;
117
- /**
118
- * Character to use with angle brackets for open/close
119
- * @default '%'
120
- */
121
- delimiter?: string | undefined;
122
- /**
123
- * Whether or not to enable caching of template functions. Beware that
124
- * the options of compilation are not checked as being the same, so
125
- * special handling is required if, for example, you want to cache client
126
- * and regular functions of the same file.
127
- *
128
- * Requires `filename` to be set. Only works with rendering function.
129
- *
130
- * @default false
131
- */
132
- cache?: boolean | undefined;
133
- /**
134
- * The Object to which `this` is set during rendering.
135
- *
136
- * @default this
137
- */
138
- context?: any;
139
- /**
140
- * Whether or not to create an async function instead of a regular function.
141
- * This requires language support.
142
- *
143
- * @default false
144
- */
145
- async?: boolean | undefined;
146
- /**
147
- * Make sure to set this to 'false' in order to skip UglifyJS parsing,
148
- * when using ES6 features (`const`, etc) as UglifyJS doesn't understand them.
149
- * @default true
150
- */
151
- beautify?: boolean | undefined;
152
- /**
153
- * Name to use for the object storing local variables when not using `with` or destructuring.
154
- *
155
- * @default ejs.localsName
156
- */
157
- localsName?: string | undefined;
158
- /** Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags. */
159
- outputFunctionName?: string | undefined;
160
- /**
161
- * An array of paths to use when resolving includes with relative paths
162
- */
163
- views?: Array<string> | undefined;
164
- /**
165
- * Custom function to handle EJS includes
166
- */
167
- includer?: IncluderCallback;
168
- }
169
- export {};
@@ -1,20 +0,0 @@
1
- import express from "express";
2
- /**
3
- * Handlebars options
4
- * @typedef {Object} HandlebarsOptions
5
- * @property {string} viewsDir - The path to the views folder
6
- * @property {string} viewEngine - The view engine to be used
7
- * @property {ConfigOptions} [serverOptions] - The server options
8
- *
9
- */
10
- export type HandlebarsOptions = {
11
- viewEngine?: string;
12
- viewsDir?: string;
13
- partialsDir?: string;
14
- };
15
- /**
16
- * Set Handlebars as the view engine
17
- * @param {express.Application} app - The express application
18
- * @param {HandlebarsOptions} [options=HANDLEBARS_DEFAULTS] - The handlebars options
19
- */
20
- export declare function setEngineHandlebars(app: express.Application, options?: HandlebarsOptions): Promise<void>;
@@ -1,17 +0,0 @@
1
- import { Application } from "express";
2
- /**
3
- * Pug options
4
- * @typedef {Object} PugOptions
5
- * @property {string} viewEngine - The view engine to be used
6
- * @property {string} viewsDir - The path to the views folder
7
- */
8
- export type PugOptions = {
9
- viewEngine?: string;
10
- viewsDir?: string;
11
- };
12
- /**
13
- * Set Pug as the view engine
14
- * @param {express.Application} app - The express application
15
- * @param {PugOptions} [options=PUG_DEFAULTS] - The pug options
16
- */
17
- export declare function setEnginePug(app: Application, options?: PugOptions): Promise<void>;