@tsed/formio 7.83.3 → 8.0.0-alpha.10
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/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 +1 -1
- package/lib/esm/components/AlterTemplateExportSteps.js.map +1 -1
- package/lib/esm/components/AlterTemplateImportSteps.js +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/FormioModels.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 +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 +1 -1
- package/lib/esm/services/FormioService.js.map +1 -1
- package/lib/types/decorators/actionCtx.d.ts +1 -1
- package/lib/types/domain/Formio.d.ts +26 -1
- package/lib/types/domain/FormioAction.d.ts +1 -1
- package/lib/types/domain/FormioBaseModel.d.ts +27 -1
- package/lib/types/domain/FormioCtxMapper.d.ts +1 -1
- package/lib/types/domain/FormioHooks.d.ts +26 -0
- package/lib/types/domain/FormioModels.d.ts +26 -1
- package/lib/types/domain/Resource.d.ts +1 -1
- package/lib/types/services/FormioAuthService.d.ts +11 -7
- package/lib/types/services/FormioDatabase.d.ts +36 -21
- package/lib/types/services/FormioHooksService.d.ts +1 -1
- package/lib/types/services/FormioRepository.d.ts +8 -3
- package/lib/types/services/FormioService.d.ts +25 -0
- package/package.json +26 -24
- package/vitest.config.mts +5 -5
- package/lib/cjs/FormioModule.js +0 -132
- package/lib/cjs/FormioModule.js.map +0 -1
- package/lib/cjs/builder/FormioMapper.js +0 -61
- package/lib/cjs/builder/FormioMapper.js.map +0 -1
- package/lib/cjs/components/AlterActions.js +0 -113
- package/lib/cjs/components/AlterActions.js.map +0 -1
- package/lib/cjs/components/AlterAudit.js +0 -16
- package/lib/cjs/components/AlterAudit.js.map +0 -1
- package/lib/cjs/components/AlterHost.js +0 -15
- package/lib/cjs/components/AlterHost.js.map +0 -1
- package/lib/cjs/components/AlterLog.js +0 -16
- package/lib/cjs/components/AlterLog.js.map +0 -1
- package/lib/cjs/components/AlterSkip.js +0 -32
- package/lib/cjs/components/AlterSkip.js.map +0 -1
- package/lib/cjs/components/AlterTemplateExportSteps.js +0 -52
- package/lib/cjs/components/AlterTemplateExportSteps.js.map +0 -1
- package/lib/cjs/components/AlterTemplateImportSteps.js +0 -45
- package/lib/cjs/components/AlterTemplateImportSteps.js.map +0 -1
- package/lib/cjs/decorators/action.js +0 -20
- package/lib/cjs/decorators/action.js.map +0 -1
- package/lib/cjs/decorators/actionCtx.js +0 -23
- package/lib/cjs/decorators/actionCtx.js.map +0 -1
- package/lib/cjs/decorators/alter.js +0 -20
- package/lib/cjs/decorators/alter.js.map +0 -1
- package/lib/cjs/decorators/on.js +0 -20
- package/lib/cjs/decorators/on.js.map +0 -1
- package/lib/cjs/decorators/useFormioAuth.js +0 -15
- package/lib/cjs/decorators/useFormioAuth.js.map +0 -1
- package/lib/cjs/domain/AlterHook.js +0 -3
- package/lib/cjs/domain/AlterHook.js.map +0 -1
- package/lib/cjs/domain/Formio.js +0 -3
- package/lib/cjs/domain/Formio.js.map +0 -1
- package/lib/cjs/domain/FormioAction.js +0 -3
- package/lib/cjs/domain/FormioAction.js.map +0 -1
- package/lib/cjs/domain/FormioActionsIndex.js +0 -3
- package/lib/cjs/domain/FormioActionsIndex.js.map +0 -1
- package/lib/cjs/domain/FormioAuth.js +0 -3
- package/lib/cjs/domain/FormioAuth.js.map +0 -1
- package/lib/cjs/domain/FormioBaseModel.js +0 -3
- package/lib/cjs/domain/FormioBaseModel.js.map +0 -1
- package/lib/cjs/domain/FormioConfig.js +0 -3
- package/lib/cjs/domain/FormioConfig.js.map +0 -1
- package/lib/cjs/domain/FormioCtxMapper.js +0 -3
- package/lib/cjs/domain/FormioCtxMapper.js.map +0 -1
- package/lib/cjs/domain/FormioDecodedToken.js +0 -3
- package/lib/cjs/domain/FormioDecodedToken.js.map +0 -1
- package/lib/cjs/domain/FormioErrors.js +0 -3
- package/lib/cjs/domain/FormioErrors.js.map +0 -1
- package/lib/cjs/domain/FormioHooks.js +0 -3
- package/lib/cjs/domain/FormioHooks.js.map +0 -1
- package/lib/cjs/domain/FormioJs.js +0 -3
- package/lib/cjs/domain/FormioJs.js.map +0 -1
- package/lib/cjs/domain/FormioModels.js +0 -5
- package/lib/cjs/domain/FormioModels.js.map +0 -1
- package/lib/cjs/domain/FormioRouter.js +0 -3
- package/lib/cjs/domain/FormioRouter.js.map +0 -1
- package/lib/cjs/domain/FormioSettings.js +0 -3
- package/lib/cjs/domain/FormioSettings.js.map +0 -1
- package/lib/cjs/domain/FormioTemplate.js +0 -3
- package/lib/cjs/domain/FormioTemplate.js.map +0 -1
- package/lib/cjs/domain/FormioTemplateUtil.js +0 -3
- package/lib/cjs/domain/FormioTemplateUtil.js.map +0 -1
- package/lib/cjs/domain/FormioUpdate.js +0 -3
- package/lib/cjs/domain/FormioUpdate.js.map +0 -1
- package/lib/cjs/domain/FormioUtils.js +0 -3
- package/lib/cjs/domain/FormioUtils.js.map +0 -1
- package/lib/cjs/domain/OnHook.js +0 -3
- package/lib/cjs/domain/OnHook.js.map +0 -1
- package/lib/cjs/domain/Resource.js +0 -3
- package/lib/cjs/domain/Resource.js.map +0 -1
- package/lib/cjs/index.js +0 -50
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/middlewares/FormioAuthMiddleware.js +0 -41
- package/lib/cjs/middlewares/FormioAuthMiddleware.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/services/FormioAuthService.js +0 -182
- package/lib/cjs/services/FormioAuthService.js.map +0 -1
- package/lib/cjs/services/FormioDatabase.js +0 -140
- package/lib/cjs/services/FormioDatabase.js.map +0 -1
- package/lib/cjs/services/FormioHooksService.js +0 -81
- package/lib/cjs/services/FormioHooksService.js.map +0 -1
- package/lib/cjs/services/FormioInstaller.js +0 -44
- package/lib/cjs/services/FormioInstaller.js.map +0 -1
- package/lib/cjs/services/FormioRepository.js +0 -42
- package/lib/cjs/services/FormioRepository.js.map +0 -1
- package/lib/cjs/services/FormioService.js +0 -103
- package/lib/cjs/services/FormioService.js.map +0 -1
- package/lib/cjs/utils/isMongoId.js +0 -8
- package/lib/cjs/utils/isMongoId.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/FormioModule.d.ts +0 -24
- package/lib/types-esm/builder/FormioMapper.d.ts +0 -11
- package/lib/types-esm/components/AlterActions.d.ts +0 -18
- package/lib/types-esm/components/AlterAudit.d.ts +0 -5
- package/lib/types-esm/components/AlterHost.d.ts +0 -5
- package/lib/types-esm/components/AlterLog.d.ts +0 -5
- package/lib/types-esm/components/AlterSkip.d.ts +0 -7
- package/lib/types-esm/components/AlterTemplateExportSteps.d.ts +0 -12
- package/lib/types-esm/components/AlterTemplateImportSteps.d.ts +0 -11
- package/lib/types-esm/decorators/action.d.ts +0 -7
- package/lib/types-esm/decorators/actionCtx.d.ts +0 -23
- package/lib/types-esm/decorators/alter.d.ts +0 -6
- package/lib/types-esm/decorators/on.d.ts +0 -6
- package/lib/types-esm/decorators/useFormioAuth.d.ts +0 -6
- package/lib/types-esm/domain/AlterHook.d.ts +0 -3
- package/lib/types-esm/domain/Formio.d.ts +0 -112
- package/lib/types-esm/domain/FormioAction.d.ts +0 -20
- package/lib/types-esm/domain/FormioActionsIndex.d.ts +0 -15
- package/lib/types-esm/domain/FormioAuth.d.ts +0 -67
- package/lib/types-esm/domain/FormioBaseModel.d.ts +0 -11
- package/lib/types-esm/domain/FormioConfig.d.ts +0 -59
- package/lib/types-esm/domain/FormioCtxMapper.d.ts +0 -7
- package/lib/types-esm/domain/FormioDecodedToken.d.ts +0 -12
- package/lib/types-esm/domain/FormioErrors.d.ts +0 -53
- package/lib/types-esm/domain/FormioHooks.d.ts +0 -194
- package/lib/types-esm/domain/FormioJs.d.ts +0 -17
- package/lib/types-esm/domain/FormioModels.d.ts +0 -42
- package/lib/types-esm/domain/FormioRouter.d.ts +0 -7
- package/lib/types-esm/domain/FormioSettings.d.ts +0 -53
- package/lib/types-esm/domain/FormioTemplate.d.ts +0 -8
- package/lib/types-esm/domain/FormioTemplateUtil.d.ts +0 -13
- package/lib/types-esm/domain/FormioUpdate.d.ts +0 -19
- package/lib/types-esm/domain/FormioUtils.d.ts +0 -307
- package/lib/types-esm/domain/OnHook.d.ts +0 -3
- package/lib/types-esm/domain/Resource.d.ts +0 -18
- package/lib/types-esm/index.d.ts +0 -46
- package/lib/types-esm/middlewares/FormioAuthMiddleware.d.ts +0 -11
- package/lib/types-esm/services/FormioAuthService.d.ts +0 -84
- package/lib/types-esm/services/FormioDatabase.d.ts +0 -84
- package/lib/types-esm/services/FormioHooksService.d.ts +0 -17
- package/lib/types-esm/services/FormioInstaller.d.ts +0 -12
- package/lib/types-esm/services/FormioRepository.d.ts +0 -41
- package/lib/types-esm/services/FormioService.d.ts +0 -36
- package/lib/types-esm/utils/isMongoId.d.ts +0 -1
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { InjectorService, OnReady, OnRoutesInit, PlatformApplication, PlatformRouteDetails } from "@tsed/common";
|
|
2
|
-
import { FormioConfig } from "./domain/FormioConfig.js";
|
|
3
|
-
import { FormioTemplate } from "./domain/FormioTemplate.js";
|
|
4
|
-
import { FormioHooksService } from "./services/FormioHooksService.js";
|
|
5
|
-
import { FormioInstaller } from "./services/FormioInstaller.js";
|
|
6
|
-
import { FormioService } from "./services/FormioService.js";
|
|
7
|
-
export declare class FormioModule implements OnRoutesInit, OnReady {
|
|
8
|
-
protected formio: FormioService;
|
|
9
|
-
protected hooks: FormioHooksService;
|
|
10
|
-
protected installer: FormioInstaller;
|
|
11
|
-
protected app: PlatformApplication;
|
|
12
|
-
protected injector: InjectorService;
|
|
13
|
-
protected settings: FormioConfig;
|
|
14
|
-
protected baseUrl: string;
|
|
15
|
-
protected skipInstall: boolean;
|
|
16
|
-
protected template?: FormioTemplate;
|
|
17
|
-
protected root?: any;
|
|
18
|
-
$onInit(): Promise<import("./index.js").Formio> | undefined;
|
|
19
|
-
init(options: FormioConfig): Promise<import("./index.js").Formio> | undefined;
|
|
20
|
-
$onRoutesInit(): Promise<void>;
|
|
21
|
-
$logRoutes(routes: PlatformRouteDetails[]): Promise<PlatformRouteDetails[]>;
|
|
22
|
-
$onReady(): void;
|
|
23
|
-
protected shouldInstall(): Promise<boolean | undefined>;
|
|
24
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FormioCtxMapper } from "../domain/FormioCtxMapper.js";
|
|
2
|
-
export declare class FormioMapper {
|
|
3
|
-
readonly ctxData: FormioCtxMapper;
|
|
4
|
-
constructor(ctxData: FormioCtxMapper);
|
|
5
|
-
find(key: string): any;
|
|
6
|
-
findId(data: string): any;
|
|
7
|
-
findMachineName(data: any): string | undefined;
|
|
8
|
-
mapToExport(data: any): any;
|
|
9
|
-
mapToImport(data: any): any;
|
|
10
|
-
mapData(data: any, resolver: any): any;
|
|
11
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { InjectorService, Provider } from "@tsed/di";
|
|
2
|
-
import { PlatformParams } from "@tsed/platform-params";
|
|
3
|
-
import { PlatformResponseFilter } from "@tsed/platform-response-filter";
|
|
4
|
-
import { AlterHook } from "../domain/AlterHook.js";
|
|
5
|
-
import { SetActionItemMessage } from "../domain/FormioAction.js";
|
|
6
|
-
import { FormioActions } from "../domain/FormioActionsIndex.js";
|
|
7
|
-
import { FormioService } from "../services/FormioService.js";
|
|
8
|
-
export declare class AlterActions implements AlterHook {
|
|
9
|
-
protected injector: InjectorService;
|
|
10
|
-
protected formio: FormioService;
|
|
11
|
-
protected params: PlatformParams;
|
|
12
|
-
protected responseFilter: PlatformResponseFilter;
|
|
13
|
-
transform(actions: FormioActions): FormioActions;
|
|
14
|
-
protected getActions(): Provider<any>[];
|
|
15
|
-
protected createHandler(provider: Provider, propertyKey: string | symbol): (action: any, handler: string, method: string, req: any, res: any, next: any, setActionItemMessage: SetActionItemMessage) => Promise<void>;
|
|
16
|
-
private onRequest;
|
|
17
|
-
private flush;
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MongooseDocument } from "@tsed/mongoose";
|
|
2
|
-
import { FormioMapper } from "../builder/FormioMapper.js";
|
|
3
|
-
import { AlterHook } from "../domain/AlterHook.js";
|
|
4
|
-
import { FormioSubmission } from "../domain/FormioModels.js";
|
|
5
|
-
import { FormioTemplate } from "../domain/FormioTemplate.js";
|
|
6
|
-
import { FormioDatabase } from "../services/FormioDatabase.js";
|
|
7
|
-
export declare class AlterTemplateExportSteps implements AlterHook {
|
|
8
|
-
protected database: FormioDatabase;
|
|
9
|
-
transform(queue: any[], template: FormioTemplate, map: any, options: any): any;
|
|
10
|
-
protected exportSubmissions(template: FormioTemplate, map: any, options: any, next: any): Promise<void>;
|
|
11
|
-
protected mapSubmissions(submissions: MongooseDocument<FormioSubmission>[], mapper: FormioMapper): any;
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FormioMapper } from "../builder/FormioMapper.js";
|
|
2
|
-
import { AlterHook } from "../domain/AlterHook.js";
|
|
3
|
-
import { FormioSubmission } from "../domain/FormioModels.js";
|
|
4
|
-
import { FormioTemplate } from "../domain/FormioTemplate.js";
|
|
5
|
-
import { FormioDatabase } from "../services/FormioDatabase.js";
|
|
6
|
-
export declare class AlterTemplateImportSteps implements AlterHook {
|
|
7
|
-
protected database: FormioDatabase;
|
|
8
|
-
transform(queue: any[], install: Function, template: Partial<FormioTemplate>): any;
|
|
9
|
-
protected importSubmissions(template: Partial<FormioTemplate>, done: any): Promise<void>;
|
|
10
|
-
protected importSubmission(submission: Partial<FormioSubmission>, mapper: FormioMapper): Promise<any>;
|
|
11
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SetActionItemMessage } from "../domain/FormioAction.js";
|
|
2
|
-
import { FormioAction } from "@tsed/formio-types";
|
|
3
|
-
/**
|
|
4
|
-
* Return the current action context with the following data:
|
|
5
|
-
*
|
|
6
|
-
* ```typescript
|
|
7
|
-
* export type ActionCtx = {
|
|
8
|
-
* handler: string;
|
|
9
|
-
* method: string;
|
|
10
|
-
* setActionItemMessage: SetActionItemMessage;
|
|
11
|
-
* action: FormioAction;
|
|
12
|
-
* };
|
|
13
|
-
* ```
|
|
14
|
-
* @param expression
|
|
15
|
-
* @constructor
|
|
16
|
-
*/
|
|
17
|
-
export declare function ActionCtx(expression?: string): ParameterDecorator;
|
|
18
|
-
export type ActionCtx = {
|
|
19
|
-
handler: string;
|
|
20
|
-
method: string;
|
|
21
|
-
setActionItemMessage: SetActionItemMessage;
|
|
22
|
-
action: FormioAction;
|
|
23
|
-
};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from "events";
|
|
3
|
-
import { NextFunction, Request, Response } from "express";
|
|
4
|
-
import { Db } from "mongodb";
|
|
5
|
-
import { Mongoose, Schema } from "mongoose";
|
|
6
|
-
import { FormioActionModelCtor } from "./FormioAction.js";
|
|
7
|
-
import { FormioActionsIndex } from "./FormioActionsIndex.js";
|
|
8
|
-
import { FormioAuth } from "./FormioAuth.js";
|
|
9
|
-
import { FormioBaseModel } from "./FormioBaseModel.js";
|
|
10
|
-
import { FormioConfig } from "./FormioConfig.js";
|
|
11
|
-
import { FormioHook, FormioHooks } from "./FormioHooks.js";
|
|
12
|
-
import { FormioModels, FormioSchemas } from "./FormioModels.js";
|
|
13
|
-
import { FormioTemplateUtil } from "./FormioTemplateUtil.js";
|
|
14
|
-
import { FormioUpdate } from "./FormioUpdate.js";
|
|
15
|
-
import { FormioUtil } from "./FormioUtils.js";
|
|
16
|
-
export interface FormioBase {
|
|
17
|
-
/**
|
|
18
|
-
* Auth
|
|
19
|
-
*/
|
|
20
|
-
auth: FormioAuth;
|
|
21
|
-
/**
|
|
22
|
-
* Event emitter
|
|
23
|
-
*/
|
|
24
|
-
events: EventEmitter;
|
|
25
|
-
/**
|
|
26
|
-
* Formio configuration
|
|
27
|
-
*/
|
|
28
|
-
config: FormioConfig & {
|
|
29
|
-
schema: string;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Emit alter `log` event. Return false to disable event logging.
|
|
33
|
-
* @param event
|
|
34
|
-
* @param req
|
|
35
|
-
* @param info
|
|
36
|
-
*/
|
|
37
|
-
log(event: string, req: Request, ...info: any[]): void;
|
|
38
|
-
/**
|
|
39
|
-
* Emit alter `audit` event if `config.audit` is enabled. Return false to disable event logging.
|
|
40
|
-
* Use `console.log`.
|
|
41
|
-
* @param event
|
|
42
|
-
* @param req
|
|
43
|
-
* @param info
|
|
44
|
-
*/
|
|
45
|
-
audit(event: string, req: Request, ...info: any[]): void;
|
|
46
|
-
}
|
|
47
|
-
export interface FormioMiddlewares {
|
|
48
|
-
alias(req: Request, res: Response, next: NextFunction): void;
|
|
49
|
-
params(req: Request, res: Response, next: NextFunction): void;
|
|
50
|
-
accessHandler(req: Request, res: Response, next: NextFunction): void;
|
|
51
|
-
/**
|
|
52
|
-
* Authorize all urls based on roles and permissions.
|
|
53
|
-
* @param req
|
|
54
|
-
* @param res
|
|
55
|
-
* @param next
|
|
56
|
-
*/
|
|
57
|
-
permissionHandler(req: Request, res: Response, next: NextFunction): void;
|
|
58
|
-
restrictRequestTypes(req: Request, res: Response, next: NextFunction): void;
|
|
59
|
-
tokenHandler(req: Request, res: Response, next: NextFunction): void;
|
|
60
|
-
}
|
|
61
|
-
export interface Formio extends FormioBase {
|
|
62
|
-
Action: FormioActionModelCtor;
|
|
63
|
-
BaseModel: FormioBaseModel;
|
|
64
|
-
actions: FormioActionsIndex;
|
|
65
|
-
resources: any;
|
|
66
|
-
/**
|
|
67
|
-
* Database connection
|
|
68
|
-
*/
|
|
69
|
-
db: Db;
|
|
70
|
-
schemas: FormioSchemas & {
|
|
71
|
-
AccessSchema: Schema;
|
|
72
|
-
PermissionSchema: Schema;
|
|
73
|
-
FieldMatchAccessPermissionSchema: Schema;
|
|
74
|
-
};
|
|
75
|
-
models: FormioModels;
|
|
76
|
-
/**
|
|
77
|
-
* Mongoose lib.
|
|
78
|
-
*/
|
|
79
|
-
mongoose: Mongoose;
|
|
80
|
-
/**
|
|
81
|
-
* Exported formio middlewares
|
|
82
|
-
*/
|
|
83
|
-
readonly middleware: FormioMiddlewares;
|
|
84
|
-
/**
|
|
85
|
-
* Hooks.
|
|
86
|
-
*/
|
|
87
|
-
hooks: FormioHooks;
|
|
88
|
-
/**
|
|
89
|
-
* Plugins.
|
|
90
|
-
*/
|
|
91
|
-
plugins: any;
|
|
92
|
-
/**
|
|
93
|
-
* Formio hook util.
|
|
94
|
-
*/
|
|
95
|
-
readonly hook: FormioHook;
|
|
96
|
-
/**
|
|
97
|
-
* The formio utils.
|
|
98
|
-
*/
|
|
99
|
-
readonly util: FormioUtil;
|
|
100
|
-
/**
|
|
101
|
-
* Update system.
|
|
102
|
-
*/
|
|
103
|
-
readonly update: FormioUpdate;
|
|
104
|
-
/**
|
|
105
|
-
* Template export/import
|
|
106
|
-
*/
|
|
107
|
-
readonly template: FormioTemplateUtil;
|
|
108
|
-
/**
|
|
109
|
-
* Encryption system.
|
|
110
|
-
*/
|
|
111
|
-
encrypt(text: string, next: (err: null | Error, hash: string) => void): void;
|
|
112
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Request, Response } from "express";
|
|
2
|
-
import { FormioMongooseSchema } from "./FormioBaseModel.js";
|
|
3
|
-
import { FormioComponent } from "./FormioModels.js";
|
|
4
|
-
import { FormioAction, FormioActionInfo } from "@tsed/formio-types";
|
|
5
|
-
export interface FormioActionModel extends FormioAction {
|
|
6
|
-
resolve(handler: string, method: string, req: Request, res: Response, next: Function, setActionItemMessage: SetActionItemMessage): void;
|
|
7
|
-
}
|
|
8
|
-
export type FormioActionMongooseSchema = FormioMongooseSchema<FormioAction>;
|
|
9
|
-
export type SetActionItemMessage = (message: string, data?: any, state?: any) => void;
|
|
10
|
-
export interface FormioActionModelCtor {
|
|
11
|
-
schema?: FormioActionMongooseSchema;
|
|
12
|
-
info(req: Request, response: Response, next: (err: any, info: FormioActionInfo) => void): void;
|
|
13
|
-
settingsForm(req: Request, response: Response, next: (err: any, info: FormioComponent[]) => void): void;
|
|
14
|
-
new (data: FormioAction, req: Request, res: Response): FormioActionModel;
|
|
15
|
-
}
|
|
16
|
-
export interface ActionMethods {
|
|
17
|
-
info?(req: Request, response: Response): Promise<FormioAction>;
|
|
18
|
-
settingsForm(req: Request, response: Response): Promise<FormioComponent[]>;
|
|
19
|
-
resolve(...args: any[]): Promise<any>;
|
|
20
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { FormioActionModelCtor } from "./FormioAction.js";
|
|
3
|
-
export interface FormioActions {
|
|
4
|
-
email: FormioActionModelCtor;
|
|
5
|
-
login: FormioActionModelCtor;
|
|
6
|
-
resetpass: FormioActionModelCtor;
|
|
7
|
-
role: FormioActionModelCtor;
|
|
8
|
-
save: FormioActionModelCtor;
|
|
9
|
-
sql: FormioActionModelCtor;
|
|
10
|
-
webhook: FormioActionModelCtor;
|
|
11
|
-
[key: string]: FormioActionModelCtor;
|
|
12
|
-
}
|
|
13
|
-
export interface FormioActionsIndex {
|
|
14
|
-
actions: FormioActions & Record<string, Type<FormioActionModelCtor>>;
|
|
15
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Next, Req, Res } from "@tsed/common";
|
|
2
|
-
import { FormioDecodedToken, FormioPayloadToken } from "./FormioDecodedToken.js";
|
|
3
|
-
import { FormioForm } from "./FormioModels.js";
|
|
4
|
-
export interface FormioAuth {
|
|
5
|
-
/**
|
|
6
|
-
* Send the current user.
|
|
7
|
-
*
|
|
8
|
-
* @param req
|
|
9
|
-
* @param res
|
|
10
|
-
* @param next
|
|
11
|
-
*/
|
|
12
|
-
currentUser(req: Req, res: Res, next: Function): void;
|
|
13
|
-
/**
|
|
14
|
-
* Checks to see if a decoded token is allowed to access this path.
|
|
15
|
-
* @param req
|
|
16
|
-
* @param decoded
|
|
17
|
-
* @return {boolean}
|
|
18
|
-
*/
|
|
19
|
-
isTokenAllowed(req: Req, decoded: FormioDecodedToken): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Generate our JWT with the given payload, and pass it to the given callback function.
|
|
22
|
-
*
|
|
23
|
-
* @param payload {Object}
|
|
24
|
-
* The decoded JWT.
|
|
25
|
-
*
|
|
26
|
-
* @return {String|Boolean}
|
|
27
|
-
* The JWT from the given payload, or false if the jwt payload is still valid.
|
|
28
|
-
*/
|
|
29
|
-
getToken(payload: FormioPayloadToken): string | boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Generate a temporary token for a specific path and expiration.
|
|
32
|
-
*
|
|
33
|
-
* @param req
|
|
34
|
-
* @param res
|
|
35
|
-
* @param allow
|
|
36
|
-
* @param expire
|
|
37
|
-
* @param admin
|
|
38
|
-
* @param cb
|
|
39
|
-
*/
|
|
40
|
-
getTempToken(req: Req, res: Res, allow: boolean, expire: number, admin: boolean, cb: Function): void;
|
|
41
|
-
tempToken(req: Req, res: Res): void;
|
|
42
|
-
/**
|
|
43
|
-
* Authenticate a user.
|
|
44
|
-
*
|
|
45
|
-
* @param req
|
|
46
|
-
* @param forms {Mixed}
|
|
47
|
-
* A single form or an array of forms to authenticate against.
|
|
48
|
-
* @param userField {String}
|
|
49
|
-
* The user submission field that contains the username.
|
|
50
|
-
* @param passField {String}
|
|
51
|
-
* The user submission field that contains the password.
|
|
52
|
-
* @param username {String}
|
|
53
|
-
* The user submission username to login with.
|
|
54
|
-
* @param password {String}
|
|
55
|
-
* The user submission password to login with.
|
|
56
|
-
* @param next {Function}
|
|
57
|
-
* The callback function to call after authentication.
|
|
58
|
-
*/
|
|
59
|
-
authenticate(req: Req, forms: FormioForm | FormioForm[], userField: string, passField: string, username: string, password: string, next: Function): void;
|
|
60
|
-
/**
|
|
61
|
-
* Interception logout request.
|
|
62
|
-
* @param req
|
|
63
|
-
* @param res
|
|
64
|
-
* @param next
|
|
65
|
-
*/
|
|
66
|
-
logout(req: Req, res: Res, next: Next): void;
|
|
67
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MongooseDocument } from "@tsed/mongoose";
|
|
2
|
-
import { Schema, Document } from "mongoose";
|
|
3
|
-
export type FormioMongooseSchema<T> = Schema<Document<T>> & {
|
|
4
|
-
machineName(document: MongooseDocument<T>, done: Function): void;
|
|
5
|
-
};
|
|
6
|
-
export interface FormioBaseModel<T = any> {
|
|
7
|
-
schema: Schema<Document<T>>;
|
|
8
|
-
}
|
|
9
|
-
export interface FormioModel<T = any> extends FormioBaseModel<T> {
|
|
10
|
-
schema: FormioMongooseSchema<T>;
|
|
11
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { FormioSettings } from "./FormioSettings.js";
|
|
2
|
-
import { FormioTemplate } from "./FormioTemplate.js";
|
|
3
|
-
export interface FormioJwtConfig {
|
|
4
|
-
secret: string;
|
|
5
|
-
expireTime?: number;
|
|
6
|
-
}
|
|
7
|
-
export interface FormioEmailConfig {
|
|
8
|
-
type: string;
|
|
9
|
-
username: string;
|
|
10
|
-
password: string;
|
|
11
|
-
}
|
|
12
|
-
export interface FormioConfig {
|
|
13
|
-
/**
|
|
14
|
-
* Base url to mount the formio endpoints with Ts.ED server. Default: '/'
|
|
15
|
-
*/
|
|
16
|
-
baseUrl: string;
|
|
17
|
-
/**
|
|
18
|
-
* Skip installation process
|
|
19
|
-
*/
|
|
20
|
-
skipInstall?: boolean;
|
|
21
|
-
template?: FormioTemplate;
|
|
22
|
-
/**
|
|
23
|
-
* Cors allowed origin configuration. Default: `["*"]`.
|
|
24
|
-
*/
|
|
25
|
-
allowedOrigins?: string[];
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
mongoCA?: any;
|
|
30
|
-
mongo?: string;
|
|
31
|
-
mongoConfig?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Reserved keywords form name list
|
|
34
|
-
*/
|
|
35
|
-
reservedForms?: string[];
|
|
36
|
-
/**
|
|
37
|
-
* Jwt configuration
|
|
38
|
-
*/
|
|
39
|
-
jwt: FormioJwtConfig;
|
|
40
|
-
/**
|
|
41
|
-
* Email sendgrid settings
|
|
42
|
-
*/
|
|
43
|
-
email?: FormioEmailConfig;
|
|
44
|
-
/**
|
|
45
|
-
* Settings of external formio services
|
|
46
|
-
*/
|
|
47
|
-
settings?: FormioSettings;
|
|
48
|
-
/**
|
|
49
|
-
* Enable audit log. Default: false
|
|
50
|
-
*/
|
|
51
|
-
audit?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* User root credentials
|
|
54
|
-
*/
|
|
55
|
-
root: {
|
|
56
|
-
email: string;
|
|
57
|
-
password: string;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MongooseDocument } from "@tsed/mongoose";
|
|
2
|
-
import { FormioAction, FormioForm, FormioRole } from "@tsed/formio-types";
|
|
3
|
-
export interface FormioCtxMapper {
|
|
4
|
-
forms: Map<string, MongooseDocument<FormioForm>>;
|
|
5
|
-
actions: Map<string, MongooseDocument<FormioAction>>;
|
|
6
|
-
roles: Map<string, MongooseDocument<FormioRole>>;
|
|
7
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export interface FormioErrors {
|
|
2
|
-
app: {
|
|
3
|
-
ESETTINGSLOAD: "Cannot load app settings.";
|
|
4
|
-
EDBCONFIG: "Database settings is missing.";
|
|
5
|
-
EDBHOST: "Invalid SQL Host.";
|
|
6
|
-
};
|
|
7
|
-
db: {
|
|
8
|
-
EINVQUERY: "Invalid query.";
|
|
9
|
-
EDBCONN: "Connection error.";
|
|
10
|
-
EQUERY: "Query request error.";
|
|
11
|
-
};
|
|
12
|
-
emailer: {
|
|
13
|
-
ENOTRANSP: "Cannot get emailer transports.";
|
|
14
|
-
ESENDMAIL: "Email sending failed.";
|
|
15
|
-
ESUBPARAMS: "Failed to get substitution parameters.";
|
|
16
|
-
};
|
|
17
|
-
cache: {
|
|
18
|
-
EFORMLOAD: "Cannot load form.";
|
|
19
|
-
};
|
|
20
|
-
form: {
|
|
21
|
-
ENOFORM: "Form not found.";
|
|
22
|
-
};
|
|
23
|
-
auth: {
|
|
24
|
-
EAUTH: "Authentication failed.";
|
|
25
|
-
EPASSFIELD: "Invalid password field.";
|
|
26
|
-
EPASSRESET: "Unable to change password.";
|
|
27
|
-
ERESETTOKEN: "Invalid reset password token.";
|
|
28
|
-
ENOPASSP: "No password provided.";
|
|
29
|
-
ELOGINCOUNT: "Unable to update login count.";
|
|
30
|
-
};
|
|
31
|
-
submission: {
|
|
32
|
-
ENOSUB: "Submission not found.";
|
|
33
|
-
ESUBLOAD: "Cannot load submission.";
|
|
34
|
-
ESUBSAVE: "Cannot save submission.";
|
|
35
|
-
};
|
|
36
|
-
user: {
|
|
37
|
-
ENOUSER: "User not found.";
|
|
38
|
-
ENONAMEP: "No user name provided.";
|
|
39
|
-
};
|
|
40
|
-
role: {
|
|
41
|
-
EROLESLOAD: "Cannot load the Roles.";
|
|
42
|
-
ENOROLE: "Role not found.";
|
|
43
|
-
EROLELOAD: "Cannot load role.";
|
|
44
|
-
EROLEEXIST: "Provided role already exists.";
|
|
45
|
-
};
|
|
46
|
-
request: {
|
|
47
|
-
EREQRECUR: "Too many recursive requests.";
|
|
48
|
-
};
|
|
49
|
-
resource: {
|
|
50
|
-
ENOIDP: "Resource id is missing.";
|
|
51
|
-
ENOHANDLER: "Resource handler not found.";
|
|
52
|
-
};
|
|
53
|
-
}
|