@tsed/formio 7.18.2 → 7.18.3
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/.eslintignore +13 -0
- package/.eslintrc.js +1 -0
- package/jest.config.js +8 -5
- package/lib/cjs/FormioModule.js.map +1 -1
- package/lib/cjs/builder/FormioMapper.js.map +1 -1
- package/lib/cjs/components/AlterActions.js.map +1 -1
- package/lib/cjs/components/AlterAudit.js.map +1 -1
- package/lib/cjs/components/AlterHost.js.map +1 -1
- package/lib/cjs/components/AlterLog.js.map +1 -1
- package/lib/cjs/components/AlterSkip.js.map +1 -1
- package/lib/cjs/components/AlterTemplateExportSteps.js.map +1 -1
- package/lib/cjs/components/AlterTemplateImportSteps.js.map +1 -1
- package/lib/cjs/decorators/action.js.map +1 -1
- package/lib/cjs/decorators/actionCtx.js.map +1 -1
- package/lib/cjs/decorators/alter.js.map +1 -1
- package/lib/cjs/decorators/on.js.map +1 -1
- package/lib/cjs/decorators/useFormioAuth.js.map +1 -1
- package/lib/cjs/domain/AlterHook.js.map +1 -1
- package/lib/cjs/domain/Formio.js.map +1 -1
- package/lib/cjs/domain/FormioAction.js.map +1 -1
- package/lib/cjs/domain/FormioActionsIndex.js.map +1 -1
- package/lib/cjs/domain/FormioAuth.js.map +1 -1
- package/lib/cjs/domain/FormioBaseModel.js.map +1 -1
- package/lib/cjs/domain/FormioConfig.js.map +1 -1
- package/lib/cjs/domain/FormioCtxMapper.js.map +1 -1
- package/lib/cjs/domain/FormioDecodedToken.js.map +1 -1
- package/lib/cjs/domain/FormioErrors.js.map +1 -1
- package/lib/cjs/domain/FormioHooks.js.map +1 -1
- package/lib/cjs/domain/FormioJs.js.map +1 -1
- package/lib/cjs/domain/FormioModels.js.map +1 -1
- package/lib/cjs/domain/FormioRouter.js.map +1 -1
- package/lib/cjs/domain/FormioSettings.js.map +1 -1
- package/lib/cjs/domain/FormioTemplate.js.map +1 -1
- package/lib/cjs/domain/FormioTemplateUtil.js.map +1 -1
- package/lib/cjs/domain/FormioUpdate.js.map +1 -1
- package/lib/cjs/domain/FormioUtils.js.map +1 -1
- package/lib/cjs/domain/OnHook.js.map +1 -1
- package/lib/cjs/domain/Resource.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/middlewares/FormioAuthMiddleware.js.map +1 -1
- package/lib/cjs/services/FormioAuthService.js.map +1 -1
- package/lib/cjs/services/FormioDatabase.js.map +1 -1
- package/lib/cjs/services/FormioHooksService.js.map +1 -1
- package/lib/cjs/services/FormioInstaller.js.map +1 -1
- package/lib/cjs/services/FormioRepository.js.map +1 -1
- package/lib/cjs/services/FormioService.js.map +1 -1
- package/lib/cjs/utils/isMongoId.js.map +1 -1
- package/lib/esm/FormioModule.js.map +1 -1
- package/lib/esm/builder/FormioMapper.js.map +1 -1
- package/lib/esm/components/AlterActions.js.map +1 -1
- package/lib/esm/components/AlterAudit.js.map +1 -1
- package/lib/esm/components/AlterHost.js.map +1 -1
- package/lib/esm/components/AlterLog.js.map +1 -1
- package/lib/esm/components/AlterSkip.js.map +1 -1
- package/lib/esm/components/AlterTemplateExportSteps.js.map +1 -1
- package/lib/esm/components/AlterTemplateImportSteps.js.map +1 -1
- package/lib/esm/decorators/action.js.map +1 -1
- package/lib/esm/decorators/actionCtx.js.map +1 -1
- package/lib/esm/decorators/alter.js.map +1 -1
- package/lib/esm/decorators/on.js.map +1 -1
- package/lib/esm/decorators/useFormioAuth.js.map +1 -1
- package/lib/esm/domain/AlterHook.js.map +1 -1
- package/lib/esm/domain/Formio.js.map +1 -1
- package/lib/esm/domain/FormioAction.js.map +1 -1
- package/lib/esm/domain/FormioActionsIndex.js.map +1 -1
- package/lib/esm/domain/FormioAuth.js.map +1 -1
- package/lib/esm/domain/FormioBaseModel.js.map +1 -1
- package/lib/esm/domain/FormioConfig.js.map +1 -1
- package/lib/esm/domain/FormioCtxMapper.js.map +1 -1
- package/lib/esm/domain/FormioDecodedToken.js.map +1 -1
- package/lib/esm/domain/FormioErrors.js.map +1 -1
- package/lib/esm/domain/FormioHooks.js.map +1 -1
- package/lib/esm/domain/FormioJs.js.map +1 -1
- package/lib/esm/domain/FormioModels.js.map +1 -1
- package/lib/esm/domain/FormioRouter.js.map +1 -1
- package/lib/esm/domain/FormioSettings.js.map +1 -1
- package/lib/esm/domain/FormioTemplate.js.map +1 -1
- package/lib/esm/domain/FormioTemplateUtil.js.map +1 -1
- package/lib/esm/domain/FormioUpdate.js.map +1 -1
- package/lib/esm/domain/FormioUtils.js.map +1 -1
- package/lib/esm/domain/OnHook.js.map +1 -1
- package/lib/esm/domain/Resource.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/middlewares/FormioAuthMiddleware.js.map +1 -1
- package/lib/esm/services/FormioAuthService.js.map +1 -1
- package/lib/esm/services/FormioDatabase.js.map +1 -1
- package/lib/esm/services/FormioHooksService.js.map +1 -1
- package/lib/esm/services/FormioInstaller.js.map +1 -1
- package/lib/esm/services/FormioRepository.js.map +1 -1
- package/lib/esm/services/FormioService.js.map +1 -1
- package/lib/esm/utils/isMongoId.js.map +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/decorators/actionCtx.d.ts +1 -1
- package/lib/types/domain/FormioAction.d.ts +2 -2
- package/lib/types/domain/FormioBaseModel.d.ts +1 -1
- package/lib/types/domain/FormioHooks.d.ts +1 -1
- package/lib/types/domain/FormioModels.d.ts +2 -2
- package/lib/types/domain/Resource.d.ts +1 -1
- package/package.json +18 -14
- package/tsconfig.esm.json +48 -0
- package/tsconfig.compile.esm.json +0 -12
|
@@ -15,7 +15,7 @@ import { FormioAction } from "@tsed/formio-types";
|
|
|
15
15
|
* @constructor
|
|
16
16
|
*/
|
|
17
17
|
export declare function ActionCtx(expression?: string): ParameterDecorator;
|
|
18
|
-
export
|
|
18
|
+
export type ActionCtx = {
|
|
19
19
|
handler: string;
|
|
20
20
|
method: string;
|
|
21
21
|
setActionItemMessage: SetActionItemMessage;
|
|
@@ -5,8 +5,8 @@ import { FormioAction, FormioActionInfo } from "@tsed/formio-types";
|
|
|
5
5
|
export interface FormioActionModel extends FormioAction {
|
|
6
6
|
resolve(handler: string, method: string, req: Request, res: Response, next: Function, setActionItemMessage: SetActionItemMessage): void;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type FormioActionMongooseSchema = FormioMongooseSchema<FormioAction>;
|
|
9
|
+
export type SetActionItemMessage = (message: string, data?: any, state?: any) => void;
|
|
10
10
|
export interface FormioActionModelCtor {
|
|
11
11
|
schema?: FormioActionMongooseSchema;
|
|
12
12
|
info(req: Request, response: Response, next: (err: any, info: FormioActionInfo) => void): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MongooseDocument } from "@tsed/mongoose";
|
|
2
2
|
import { Schema, Document } from "mongoose";
|
|
3
|
-
export
|
|
3
|
+
export type FormioMongooseSchema<T> = Schema<Document<T>> & {
|
|
4
4
|
machineName(document: MongooseDocument<T>, done: Function): void;
|
|
5
5
|
};
|
|
6
6
|
export interface FormioBaseModel<T = any> {
|
|
@@ -9,7 +9,7 @@ import { FormioJs } from "./FormioJs";
|
|
|
9
9
|
import { FormioActionItem, FormioForm, FormioModelsModels, FormioSubmission } from "./FormioModels";
|
|
10
10
|
import { FormioSettings } from "./FormioSettings";
|
|
11
11
|
import { ResourceRestOptions } from "./Resource";
|
|
12
|
-
export
|
|
12
|
+
export type FormioInitEvent = "alias" | "params" | "token" | "getTempToken" | "logout" | "current" | "access" | "perms";
|
|
13
13
|
export interface FormioHooks {
|
|
14
14
|
settings?: (settings: FormioSettings, req: Request, cb: Function) => FormioSettings;
|
|
15
15
|
alter?: {
|
|
@@ -4,7 +4,7 @@ import { FormioActionModelCtor, FormioActionMongooseSchema } from "./FormioActio
|
|
|
4
4
|
import { FormioBaseModel, FormioModel, FormioMongooseSchema } from "./FormioBaseModel";
|
|
5
5
|
import { FormioActionItem, FormioForm, FormioRole, FormioSchema, FormioSubmission, FormioToken } from "@tsed/formio-types";
|
|
6
6
|
export * from "@tsed/formio-types";
|
|
7
|
-
export
|
|
7
|
+
export type WithID<T> = T & {
|
|
8
8
|
_id: string;
|
|
9
9
|
};
|
|
10
10
|
export interface FormioSchemas {
|
|
@@ -17,7 +17,7 @@ export interface FormioSchemas {
|
|
|
17
17
|
token: Schema<MongooseDocument<FormioToken>>;
|
|
18
18
|
[key: string]: Schema<MongooseDocument<any>>;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type FormioModelsModels = {
|
|
21
21
|
action: FormioActionModelCtor;
|
|
22
22
|
actionItem: FormioBaseModel<FormioActionItem>;
|
|
23
23
|
form: FormioModel<FormioForm>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response, NextFunction } from "express";
|
|
2
|
-
export
|
|
2
|
+
export type ResourceHttpHandler = (req: Request, res: Response, next: NextFunction) => void;
|
|
3
3
|
export interface ResourceHttpMethodOptions {
|
|
4
4
|
before?: ResourceHttpHandler;
|
|
5
5
|
after?: ResourceHttpHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/formio",
|
|
3
|
-
"version": "7.18.
|
|
3
|
+
"version": "7.18.3",
|
|
4
4
|
"description": "Formio package for Ts.ED framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -22,31 +22,35 @@
|
|
|
22
22
|
"default": "./lib/esm/index.js"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
|
-
"build": "yarn barrels && yarn
|
|
26
|
-
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
27
|
-
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
25
|
+
"build": "yarn barrels && yarn build:ts",
|
|
28
26
|
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
29
|
-
"start": "ts-node
|
|
30
|
-
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
|
|
27
|
+
"start": "ts-node test/app/index.ts",
|
|
28
|
+
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2 && jest-coverage-thresholds-bumper",
|
|
29
|
+
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json",
|
|
30
|
+
"lint": "eslint '**/*.{ts,js}'",
|
|
31
|
+
"lint:fix": "eslint '**/*.{ts,js}' --fix"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@tsed/formio-types": "7.18.
|
|
34
|
-
"@tsed/normalize-path": "7.18.
|
|
35
|
-
"tslib": "2.
|
|
34
|
+
"@tsed/formio-types": "7.18.3",
|
|
35
|
+
"@tsed/normalize-path": "7.18.3",
|
|
36
|
+
"tslib": "2.5.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@tsed/common": "7.18.
|
|
39
|
-
"@tsed/core": "7.18.
|
|
40
|
-
"@tsed/di": "7.18.
|
|
41
|
-
"@tsed/
|
|
39
|
+
"@tsed/common": "7.18.3",
|
|
40
|
+
"@tsed/core": "7.18.3",
|
|
41
|
+
"@tsed/di": "7.18.3",
|
|
42
|
+
"@tsed/eslint": "7.18.3",
|
|
43
|
+
"@tsed/mongoose": "7.18.3",
|
|
44
|
+
"@tsed/typescript": "7.18.3",
|
|
42
45
|
"@types/async": "3.2.15",
|
|
46
|
+
"eslint": "^8.12.0",
|
|
43
47
|
"express": "^4.17.1",
|
|
44
48
|
"formio": "^2.0.0",
|
|
45
49
|
"mongodb": "*",
|
|
46
50
|
"mongoose": "^6.1.7"
|
|
47
51
|
},
|
|
48
52
|
"peerDependencies": {
|
|
49
|
-
"@tsed/common": "^7.18.
|
|
53
|
+
"@tsed/common": "^7.18.3",
|
|
50
54
|
"express": "^4.17.1",
|
|
51
55
|
"formio": "^2.0.0",
|
|
52
56
|
"lodash": "^4.17.21",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsed/typescript/tsconfig.node.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"module": "ES2020",
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "./lib/esm",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationDir": "./lib/types",
|
|
10
|
+
"composite": true,
|
|
11
|
+
"noEmit": false
|
|
12
|
+
},
|
|
13
|
+
"include": ["src", "src/**/*.json"],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"node_modules",
|
|
16
|
+
"test",
|
|
17
|
+
"lib",
|
|
18
|
+
"benchmark",
|
|
19
|
+
"coverage",
|
|
20
|
+
"spec",
|
|
21
|
+
"**/*.benchmark.ts",
|
|
22
|
+
"**/*.spec.ts",
|
|
23
|
+
"keys",
|
|
24
|
+
"jest.config.js",
|
|
25
|
+
"**/__mock__/**",
|
|
26
|
+
"webpack.config.js"
|
|
27
|
+
],
|
|
28
|
+
"references": [
|
|
29
|
+
{
|
|
30
|
+
"path": "../../platform/common"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "../../core"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../di"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../orm/mongoose"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../formio-types"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "../../utils/normalize-path"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.compile.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"module": "ES2020",
|
|
6
|
-
"rootDir": "src",
|
|
7
|
-
"outDir": "./lib/esm",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationDir": "./lib/types"
|
|
10
|
-
},
|
|
11
|
-
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
12
|
-
}
|