@tsed/formio 7.0.0-beta.12 → 7.0.0-beta.13
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/jest.config.js +14 -0
- package/lib/cjs/FormioModule.js +12 -1
- package/lib/cjs/FormioModule.js.map +1 -1
- package/lib/cjs/builder/FormioMapper.js +2 -1
- package/lib/cjs/builder/FormioMapper.js.map +1 -1
- package/lib/cjs/components/AlterActions.js +19 -17
- package/lib/cjs/components/AlterActions.js.map +1 -1
- package/lib/cjs/components/AlterSkip.js +2 -0
- package/lib/cjs/components/AlterSkip.js.map +1 -1
- package/lib/cjs/components/AlterTemplateExportSteps.js +1 -0
- package/lib/cjs/components/AlterTemplateExportSteps.js.map +1 -1
- package/lib/cjs/components/AlterTemplateImportSteps.js +1 -0
- package/lib/cjs/components/AlterTemplateImportSteps.js.map +1 -1
- package/lib/cjs/middlewares/FormioAuthMiddleware.js +1 -0
- package/lib/cjs/middlewares/FormioAuthMiddleware.js.map +1 -1
- package/lib/cjs/services/FormioAuthService.js +4 -1
- package/lib/cjs/services/FormioAuthService.js.map +1 -1
- package/lib/cjs/services/FormioDatabase.js +1 -0
- package/lib/cjs/services/FormioDatabase.js.map +1 -1
- package/lib/cjs/services/FormioHooksService.js +2 -0
- package/lib/cjs/services/FormioHooksService.js.map +1 -1
- package/lib/cjs/services/FormioInstaller.js +2 -7
- package/lib/cjs/services/FormioInstaller.js.map +1 -1
- package/lib/cjs/services/FormioRepository.js +2 -0
- package/lib/cjs/services/FormioRepository.js.map +1 -1
- package/lib/cjs/services/FormioService.js +2 -0
- package/lib/cjs/services/FormioService.js.map +1 -1
- package/lib/esm/FormioModule.js +12 -1
- package/lib/esm/FormioModule.js.map +1 -1
- package/lib/esm/builder/FormioMapper.js +2 -1
- package/lib/esm/builder/FormioMapper.js.map +1 -1
- package/lib/esm/components/AlterActions.js +19 -17
- package/lib/esm/components/AlterActions.js.map +1 -1
- package/lib/esm/components/AlterSkip.js +2 -0
- package/lib/esm/components/AlterSkip.js.map +1 -1
- package/lib/esm/components/AlterTemplateExportSteps.js +1 -0
- package/lib/esm/components/AlterTemplateExportSteps.js.map +1 -1
- package/lib/esm/components/AlterTemplateImportSteps.js +1 -0
- package/lib/esm/components/AlterTemplateImportSteps.js.map +1 -1
- package/lib/esm/middlewares/FormioAuthMiddleware.js +1 -0
- package/lib/esm/middlewares/FormioAuthMiddleware.js.map +1 -1
- package/lib/esm/services/FormioAuthService.js +4 -1
- package/lib/esm/services/FormioAuthService.js.map +1 -1
- package/lib/esm/services/FormioDatabase.js +1 -0
- package/lib/esm/services/FormioDatabase.js.map +1 -1
- package/lib/esm/services/FormioHooksService.js +2 -0
- package/lib/esm/services/FormioHooksService.js.map +1 -1
- package/lib/esm/services/FormioInstaller.js +2 -7
- package/lib/esm/services/FormioInstaller.js.map +1 -1
- package/lib/esm/services/FormioRepository.js +2 -0
- package/lib/esm/services/FormioRepository.js.map +1 -1
- package/lib/esm/services/FormioService.js +2 -0
- package/lib/esm/services/FormioService.js.map +1 -1
- package/lib/types/services/FormioInstaller.d.ts +0 -2
- package/package.json +9 -9
- package/.mocharc.js +0 -5
- package/.nycrc +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormioService.js","sourceRoot":"","sources":["../../../src/services/FormioService.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,eAAe,EAAC,MAAM,cAAc,CAAC;AAIjE,OAAO,EAAC,SAAS,EAAC,MAAM,MAAM,CAAC;AAQ/B,aAAa;AACb,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,aAAa;AACb,OAAO,OAAO,MAAM,4BAA4B,CAAC;AACjD,aAAa;AACb,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAG3C,IAAa,aAAa,GAA1B,MAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"FormioService.js","sourceRoot":"","sources":["../../../src/services/FormioService.ts"],"names":[],"mappings":";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,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAChC;IACH,CAAC;IAES,gBAAgB,CAAC,OAAqB;QAC9C,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QACxB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAA4B,YAAY,CAAC,CAAC;QAExF,IAAI,gBAAgB,EAAE;YACpB,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,gBAAgB,CAAC,GAAG,CAAC;YACtD,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;SACjG;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAES,UAAU;QAClB,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF,CAAA;AA3GC;IADC,MAAM,EAAE;8BACW,eAAe;+CAAC;AAJzB,aAAa;IADzB,UAAU,EAAE;GACA,aAAa,CA+GzB;SA/GY,aAAa","sourcesContent":["import {Inject, Injectable, InjectorService} from \"@tsed/common\";\nimport {MongooseConnectionOptions} from \"@tsed/mongoose\";\nimport {Db} from \"mongodb\";\nimport {Mongoose} from \"mongoose\";\nimport {promisify} from \"util\";\nimport {Formio} from \"../domain/Formio\";\nimport {FormioConfig} from \"../domain/FormioConfig\";\nimport {FormioHook, FormioHooks} from \"../domain/FormioHooks\";\nimport {FormioSchemas} from \"../domain/FormioModels\";\nimport {FormioRouter} from \"../domain/FormioRouter\";\nimport {FormioTemplate} from \"../domain/FormioTemplate\";\nimport {FormioExportOptions} from \"../domain/FormioTemplateUtil\";\n// @ts-ignore\nimport createRouter from \"formio\";\n// @ts-ignore\nimport swagger from \"formio/src/util/swagger.js\";\n// @ts-ignore\nimport util from \"formio/src/util/util.js\";\n\n@Injectable()\nexport class FormioService {\n router: FormioRouter;\n\n @Inject()\n protected injector: InjectorService;\n\n get audit(): Function {\n return this.formio.audit || (() => {});\n }\n\n get auth() {\n return this.formio.auth;\n }\n\n // istanbul ignore next\n get swagger() {\n return (...args: any[]) => new Promise((resolve) => swagger(...args, resolve));\n }\n\n get config(): FormioConfig {\n return this.formio.config;\n }\n\n get db(): Db {\n return this.formio.db;\n }\n\n get resources() {\n return this.formio.resources;\n }\n\n get mongoose(): Mongoose {\n return this.formio.mongoose;\n }\n\n get middleware() {\n return this.formio.middleware;\n }\n\n get schemas(): FormioSchemas {\n return this.formio.schemas;\n }\n\n get formio(): Formio {\n return this.router.formio as Formio;\n }\n\n get hook(): FormioHook {\n return this.formio.hook;\n }\n\n get util() {\n return this.formio.util;\n }\n\n get template() {\n return this.formio.template;\n }\n\n get Action() {\n return this.formio.Action;\n }\n\n async exportTemplate(options: Partial<FormioExportOptions> = {}): Promise<FormioTemplate> {\n return promisify(this.formio.template.export)(options);\n }\n\n async importTemplate(template: FormioTemplate): Promise<FormioTemplate> {\n return promisify(this.formio.template.import.template)(template);\n }\n\n encrypt(text: string) {\n return promisify(this.formio.encrypt)(text);\n }\n\n isInit() {\n return !!this.router;\n }\n\n // istanbul ignore next\n public createRouter(options: FormioConfig) {\n return createRouter(options);\n }\n\n public init(options: FormioConfig, hooks: FormioHooks = {}) {\n if (options && Object.keys(options).length) {\n this.router = this.createRouter(this.mapConfiguration(options));\n this.bindLogger();\n\n return this.router.init(hooks);\n }\n }\n\n protected mapConfiguration(options: FormioConfig) {\n const {injector} = this;\n const mongooseSettings = injector.settings.get<MongooseConnectionOptions>(\"mongoose.0\");\n\n if (mongooseSettings) {\n options.mongo = options.mongo || mongooseSettings.url;\n options.mongoConfig = options.mongoConfig || JSON.stringify(mongooseSettings.connectionOptions);\n }\n\n return options;\n }\n\n protected bindLogger() {\n const {injector} = this;\n\n util.log = injector.logger.info.bind(injector.logger);\n util.error = injector.logger.error.bind(injector.logger);\n }\n}\n"]}
|
|
@@ -2,9 +2,7 @@ import { Logger } from "@tsed/logger";
|
|
|
2
2
|
import { FormioSubmission } from "../domain/FormioModels";
|
|
3
3
|
import { FormioTemplate } from "../domain/FormioTemplate";
|
|
4
4
|
import { FormioDatabase } from "./FormioDatabase";
|
|
5
|
-
import { FormioService } from "./FormioService";
|
|
6
5
|
export declare class FormioInstaller extends FormioDatabase {
|
|
7
|
-
protected formio: FormioService;
|
|
8
6
|
protected logger: Logger;
|
|
9
7
|
install(template: FormioTemplate, root: any): Promise<void>;
|
|
10
8
|
createRootUser<User = unknown>(user: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/formio",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.13",
|
|
4
4
|
"description": "Formio package for Ts.ED framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
28
28
|
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
29
29
|
"start": "ts-node -r tsconfig-paths/register test/app/index.ts",
|
|
30
|
-
"test": "cross-env NODE_ENV=test
|
|
30
|
+
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@tsed/formio-types": "7.0.0-beta.
|
|
34
|
-
"tslib": "2.
|
|
33
|
+
"@tsed/formio-types": "7.0.0-beta.13",
|
|
34
|
+
"tslib": "2.4.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tsed/common": "7.0.0-beta.
|
|
38
|
-
"@tsed/core": "7.0.0-beta.
|
|
39
|
-
"@tsed/di": "7.0.0-beta.
|
|
40
|
-
"@tsed/mongoose": "7.0.0-beta.
|
|
37
|
+
"@tsed/common": "7.0.0-beta.13",
|
|
38
|
+
"@tsed/core": "7.0.0-beta.13",
|
|
39
|
+
"@tsed/di": "7.0.0-beta.13",
|
|
40
|
+
"@tsed/mongoose": "7.0.0-beta.13",
|
|
41
41
|
"@types/async": "3.2.12",
|
|
42
42
|
"express": "^4.17.1",
|
|
43
43
|
"formio": "^2.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"mongoose": "^6.1.7"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@tsed/common": "^7.0.0-beta.
|
|
48
|
+
"@tsed/common": "^7.0.0-beta.13",
|
|
49
49
|
"express": "^4.17.1",
|
|
50
50
|
"formio": "^2.0.0",
|
|
51
51
|
"lodash": "^4.17.21",
|
package/.mocharc.js
DELETED
package/.nycrc
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"include": [
|
|
3
|
-
"src/**/*.ts"
|
|
4
|
-
],
|
|
5
|
-
"exclude": [
|
|
6
|
-
"**/*.d.ts",
|
|
7
|
-
"node_modules",
|
|
8
|
-
"**/interfaces/**",
|
|
9
|
-
"**/index.ts",
|
|
10
|
-
"**/*.spec.ts"
|
|
11
|
-
],
|
|
12
|
-
"extension": [
|
|
13
|
-
".ts"
|
|
14
|
-
],
|
|
15
|
-
"require": [],
|
|
16
|
-
"reporter": [
|
|
17
|
-
"text-summary",
|
|
18
|
-
"html",
|
|
19
|
-
"lcov",
|
|
20
|
-
"json"
|
|
21
|
-
],
|
|
22
|
-
"check-coverage": true,
|
|
23
|
-
"statements": 100,
|
|
24
|
-
"branches": 80.42,
|
|
25
|
-
"functions": 100,
|
|
26
|
-
"lines": 100
|
|
27
|
-
}
|