sml-baseline 1.3.6 → 1.3.8
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/LICENSE +674 -674
- package/README.md +53 -53
- package/dist/common/core/SmlBaseService.d.ts +5 -5
- package/dist/common/utility/dto/filter-options-dto.js +1 -1
- package/dist/common/utility/dto/filter-options-dto.js.map +1 -1
- package/dist/factoryViewModules/smlimagemapview.module.d.ts +1 -0
- package/dist/factoryViewModules/smlimagemapview.module.js +98 -0
- package/dist/factoryViewModules/smlimagemapview.module.js.map +1 -0
- package/dist/factoryViewModules/smltimelineview.module.d.ts +1 -0
- package/dist/factoryViewModules/smltimelineview.module.js +84 -0
- package/dist/factoryViewModules/smltimelineview.module.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/smlcustomcode/smlcustomcode.controller.js +30 -30
- package/dist/smlcustomfunction/smlcustomfunction.service.js +2 -2
- package/dist/smlform/dto/item.dto.d.ts +1 -0
- package/dist/smlform/dto/item.dto.js +10 -0
- package/dist/smlform/dto/item.dto.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +125 -125
- package/dist/viewschema/schemas/dashboard.schema.d.ts +0 -322
- package/dist/viewschema/schemas/dashboard.schema.js +0 -98
- package/dist/viewschema/schemas/dashboard.schema.js.map +0 -1
- package/dist/viewschema/viewschema.controller.d.ts +0 -6
- package/dist/viewschema/viewschema.controller.js +0 -45
- package/dist/viewschema/viewschema.controller.js.map +0 -1
- package/dist/viewschema/viewschema.module.d.ts +0 -2
- package/dist/viewschema/viewschema.module.js +0 -23
- package/dist/viewschema/viewschema.module.js.map +0 -1
- package/dist/viewschema/viewschema.service.d.ts +0 -13
- package/dist/viewschema/viewschema.service.js +0 -77
- package/dist/viewschema/viewschema.service.js.map +0 -1
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VIEW_SCHEMAS = exports.dashboardSchema = void 0;
|
|
4
|
-
exports.dashboardSchema = {
|
|
5
|
-
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
6
|
-
$id: 'viewschema/dashboard',
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {
|
|
9
|
-
columns: { type: 'integer', default: 12, 'x-widget': 'number', 'x-group': 'Layout' },
|
|
10
|
-
gap: { type: 'number', default: 16, 'x-widget': 'number', 'x-group': 'Layout' },
|
|
11
|
-
globalContexts: { type: 'array', items: { $ref: '#/$defs/globalContext' } },
|
|
12
|
-
components: { type: 'array', items: { $ref: '#/$defs/component' } },
|
|
13
|
-
},
|
|
14
|
-
required: ['components'],
|
|
15
|
-
$defs: {
|
|
16
|
-
common: {
|
|
17
|
-
type: 'object',
|
|
18
|
-
properties: {
|
|
19
|
-
visibleIf: { type: 'string', 'x-widget': 'template', 'x-jsonata': true, 'x-group': 'Comune' },
|
|
20
|
-
colSpan: { type: 'integer', minimum: 1, maximum: 12, 'x-widget': 'number', 'x-group': 'Layout', 'x-render': 'grid.span' },
|
|
21
|
-
flexGrow: { type: 'integer', minimum: 0, 'x-widget': 'number', 'x-group': 'Layout', 'x-render': 'sx.flexGrow' },
|
|
22
|
-
padding: { type: 'string', 'x-widget': 'cssLength', 'x-group': 'Layout', 'x-render': 'sx.p' },
|
|
23
|
-
background: { type: 'string', 'x-widget': 'color', 'x-group': 'Layout', 'x-render': 'sx.bgcolor' },
|
|
24
|
-
minHeight: { type: 'string', 'x-widget': 'cssLength', 'x-group': 'Layout', 'x-render': 'sx.minHeight' },
|
|
25
|
-
storeKey: { type: 'string', 'x-widget': 'text', 'x-group': 'Layout' },
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
globalContext: {
|
|
29
|
-
type: 'object',
|
|
30
|
-
properties: {
|
|
31
|
-
id: { type: 'string', 'x-widget': 'text' },
|
|
32
|
-
contextId: { type: 'string', 'x-widget': 'text' },
|
|
33
|
-
autoLoad: { type: 'boolean', 'x-widget': 'boolean', default: true },
|
|
34
|
-
queries: { type: 'string', 'x-widget': 'template', 'x-jsonata': true },
|
|
35
|
-
dependsOn: { type: 'string', 'x-widget': 'text' },
|
|
36
|
-
refreshInterval: { type: 'number', 'x-widget': 'number', default: 0 },
|
|
37
|
-
mapTemplate: { type: 'string', 'x-widget': 'template', 'x-jsonata': true },
|
|
38
|
-
errorCondition: { type: 'string', 'x-widget': 'template', 'x-jsonata': true },
|
|
39
|
-
},
|
|
40
|
-
required: ['contextId', 'queries'],
|
|
41
|
-
},
|
|
42
|
-
component: {
|
|
43
|
-
type: 'object',
|
|
44
|
-
properties: {
|
|
45
|
-
id: { type: 'string' },
|
|
46
|
-
type: { type: 'string' },
|
|
47
|
-
props: { type: 'object' },
|
|
48
|
-
children: { type: 'array', items: { $ref: '#/$defs/component' } },
|
|
49
|
-
},
|
|
50
|
-
required: ['id', 'type'],
|
|
51
|
-
allOf: [
|
|
52
|
-
{ if: { properties: { type: { const: 'text' } } }, then: { properties: { props: { $ref: '#/$defs/props_text' } } } },
|
|
53
|
-
{ if: { properties: { type: { const: 'chip' } } }, then: { properties: { props: { $ref: '#/$defs/props_chip' } } } },
|
|
54
|
-
{ if: { properties: { type: { const: 'flex' } } }, then: { properties: { props: { $ref: '#/$defs/props_flex' } } } },
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
props_text: {
|
|
58
|
-
type: 'object',
|
|
59
|
-
allOf: [{ $ref: '#/$defs/common' }],
|
|
60
|
-
properties: {
|
|
61
|
-
content: { type: 'string', 'x-widget': 'template', 'x-jsonata': true, 'x-group': 'Text' },
|
|
62
|
-
textVariant: { type: 'string', enum: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'body1', 'body2', 'caption', 'subtitle1', 'subtitle2'], 'x-widget': 'select', 'x-group': 'Text' },
|
|
63
|
-
textAlign: { type: 'string', enum: ['left', 'center', 'right'], 'x-widget': 'select', 'x-group': 'Text' },
|
|
64
|
-
bold: { type: 'boolean', 'x-widget': 'boolean', 'x-group': 'Text' },
|
|
65
|
-
italic: { type: 'boolean', 'x-widget': 'boolean', 'x-group': 'Text' },
|
|
66
|
-
},
|
|
67
|
-
unevaluatedProperties: false,
|
|
68
|
-
'x-component': { label: 'Text', icon: 'Type', category: 'content', isContainer: false },
|
|
69
|
-
},
|
|
70
|
-
props_chip: {
|
|
71
|
-
type: 'object',
|
|
72
|
-
allOf: [{ $ref: '#/$defs/common' }],
|
|
73
|
-
properties: {
|
|
74
|
-
label: { type: 'string', 'x-widget': 'template', 'x-jsonata': true, 'x-group': 'Chip' },
|
|
75
|
-
chipColor: { type: 'string', enum: ['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning'], 'x-widget': 'select', default: 'primary', 'x-group': 'Chip' },
|
|
76
|
-
chipVariant: { type: 'string', enum: ['filled', 'outlined'], 'x-widget': 'select', 'x-group': 'Chip' },
|
|
77
|
-
chipSize: { type: 'string', enum: ['small', 'medium'], 'x-widget': 'select', 'x-group': 'Chip' },
|
|
78
|
-
},
|
|
79
|
-
unevaluatedProperties: false,
|
|
80
|
-
'x-component': { label: 'Chip', icon: 'Tag', category: 'content', isContainer: false },
|
|
81
|
-
},
|
|
82
|
-
props_flex: {
|
|
83
|
-
type: 'object',
|
|
84
|
-
allOf: [{ $ref: '#/$defs/common' }],
|
|
85
|
-
properties: {
|
|
86
|
-
flexDirection: { type: 'string', enum: ['row', 'column', 'row-reverse', 'column-reverse'], 'x-widget': 'select', 'x-group': 'Flex' },
|
|
87
|
-
flexWrap: { type: 'string', enum: ['nowrap', 'wrap', 'wrap-reverse'], 'x-widget': 'select', 'x-group': 'Flex' },
|
|
88
|
-
justifyContent: { type: 'string', enum: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'], 'x-widget': 'select', 'x-group': 'Flex' },
|
|
89
|
-
alignItems: { type: 'string', enum: ['flex-start', 'flex-end', 'center', 'stretch', 'baseline'], 'x-widget': 'select', 'x-group': 'Flex' },
|
|
90
|
-
flexGap: { type: 'string', 'x-widget': 'cssLength', 'x-group': 'Flex' },
|
|
91
|
-
},
|
|
92
|
-
unevaluatedProperties: false,
|
|
93
|
-
'x-component': { label: 'Flex', icon: 'Columns', category: 'layout', isContainer: true },
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
exports.VIEW_SCHEMAS = { dashboard: exports.dashboardSchema };
|
|
98
|
-
//# sourceMappingURL=dashboard.schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.schema.js","sourceRoot":"","sources":["../../../src/viewschema/schemas/dashboard.schema.ts"],"names":[],"mappings":";;;AAUa,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,sBAAsB;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;QACpF,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;QAC/E,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE;QAC3E,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE;KACpE;IACD,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAA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,EAAE,SAAS,EAAE,MAAM,EAAE;gBACpI,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE;gBAC/G,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE;gBACxK,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE;gBAC1I,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE;aACxE;YACD,qBAAqB,EAAE,KAAK;YAC5B,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE;SACzF;KACF;CACO,CAAC;AAIE,QAAA,YAAY,GAAiC,EAAE,SAAS,EAAE,uBAAe,EAAE,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ViewschemaController = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
-
const viewschema_service_1 = require("./viewschema.service");
|
|
19
|
-
let ViewschemaController = class ViewschemaController {
|
|
20
|
-
constructor(service) {
|
|
21
|
-
this.service = service;
|
|
22
|
-
}
|
|
23
|
-
getSchema(artifact) {
|
|
24
|
-
const schema = this.service.getSchema(artifact);
|
|
25
|
-
if (!schema)
|
|
26
|
-
throw new common_1.NotFoundException(`Schema sconosciuto: ${artifact}`);
|
|
27
|
-
return schema;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
exports.ViewschemaController = ViewschemaController;
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, common_1.Get)(':artifact'),
|
|
33
|
-
(0, common_1.Version)('1'),
|
|
34
|
-
(0, swagger_1.ApiOperation)({ summary: 'Ritorna il JSON Schema (SSOT) di un artefatto view' }),
|
|
35
|
-
__param(0, (0, common_1.Param)('artifact')),
|
|
36
|
-
__metadata("design:type", Function),
|
|
37
|
-
__metadata("design:paramtypes", [String]),
|
|
38
|
-
__metadata("design:returntype", void 0)
|
|
39
|
-
], ViewschemaController.prototype, "getSchema", null);
|
|
40
|
-
exports.ViewschemaController = ViewschemaController = __decorate([
|
|
41
|
-
(0, swagger_1.ApiTags)('viewschema'),
|
|
42
|
-
(0, common_1.Controller)('viewschema'),
|
|
43
|
-
__metadata("design:paramtypes", [viewschema_service_1.ViewschemaService])
|
|
44
|
-
], ViewschemaController);
|
|
45
|
-
//# sourceMappingURL=viewschema.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewschema.controller.js","sourceRoot":"","sources":["../../src/viewschema/viewschema.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoF;AACpF,6CAAwD;AACxD,6DAAyD;AAKlD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAA6B,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAK3D,SAAS,CAAoB,QAAgB;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,QAAwB,CAAC,CAAC;QAChE,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,0BAAiB,CAAC,uBAAuB,QAAQ,EAAE,CAAC,CAAC;QAC5E,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAXY,oDAAoB;AAM/B;IAHC,IAAA,YAAG,EAAC,WAAW,CAAC;IAChB,IAAA,gBAAO,EAAC,GAAG,CAAC;IACZ,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,oDAAoD,EAAE,CAAC;IACrE,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;;;qDAI3B;+BAVU,oBAAoB;IAFhC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,YAAY,CAAC;qCAEe,sCAAiB;GAD5C,oBAAoB,CAWhC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ViewschemaModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const viewschema_controller_1 = require("./viewschema.controller");
|
|
12
|
-
const viewschema_service_1 = require("./viewschema.service");
|
|
13
|
-
let ViewschemaModule = class ViewschemaModule {
|
|
14
|
-
};
|
|
15
|
-
exports.ViewschemaModule = ViewschemaModule;
|
|
16
|
-
exports.ViewschemaModule = ViewschemaModule = __decorate([
|
|
17
|
-
(0, common_1.Module)({
|
|
18
|
-
controllers: [viewschema_controller_1.ViewschemaController],
|
|
19
|
-
providers: [viewschema_service_1.ViewschemaService],
|
|
20
|
-
exports: [viewschema_service_1.ViewschemaService],
|
|
21
|
-
})
|
|
22
|
-
], ViewschemaModule);
|
|
23
|
-
//# sourceMappingURL=viewschema.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewschema.module.js","sourceRoot":"","sources":["../../src/viewschema/viewschema.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mEAA+D;AAC/D,6DAAyD;AAOlD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,4CAAoB,CAAC;QACnC,SAAS,EAAE,CAAC,sCAAiB,CAAC;QAC9B,OAAO,EAAE,CAAC,sCAAiB,CAAC;KAC7B,CAAC;GACW,gBAAgB,CAAG"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ArtifactName } from './schemas/dashboard.schema';
|
|
2
|
-
export interface ValidationError {
|
|
3
|
-
instancePath: string;
|
|
4
|
-
keyword: string;
|
|
5
|
-
message: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class ViewschemaService {
|
|
8
|
-
private readonly ajv;
|
|
9
|
-
private readonly validators;
|
|
10
|
-
constructor();
|
|
11
|
-
getSchema(artifact: ArtifactName): object | null;
|
|
12
|
-
validate(artifact: ArtifactName, config: unknown): ValidationError[];
|
|
13
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ViewschemaService = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const _2020_1 = __importDefault(require("ajv/dist/2020"));
|
|
18
|
-
const ajv_formats_1 = __importDefault(require("ajv-formats"));
|
|
19
|
-
const jsonata_1 = __importDefault(require("jsonata"));
|
|
20
|
-
const dashboard_schema_1 = require("./schemas/dashboard.schema");
|
|
21
|
-
let ViewschemaService = class ViewschemaService {
|
|
22
|
-
constructor() {
|
|
23
|
-
this.validators = new Map();
|
|
24
|
-
this.ajv = new _2020_1.default({ allErrors: true, strict: false });
|
|
25
|
-
(0, ajv_formats_1.default)(this.ajv);
|
|
26
|
-
this.ajv.addKeyword({
|
|
27
|
-
keyword: 'x-jsonata',
|
|
28
|
-
schemaType: 'boolean',
|
|
29
|
-
validate: function vjsonata(on, data) {
|
|
30
|
-
if (!on || typeof data !== 'string')
|
|
31
|
-
return true;
|
|
32
|
-
const m = data.trim().match(/^\[\[([\s\S]*)\]\]$/);
|
|
33
|
-
if (!m)
|
|
34
|
-
return true;
|
|
35
|
-
try {
|
|
36
|
-
(0, jsonata_1.default)(m[1].trim());
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
vjsonata.errors = [
|
|
41
|
-
{ keyword: 'x-jsonata', message: `JSONata non valida: ${e.message}`, params: {} },
|
|
42
|
-
];
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
errors: true,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
getSchema(artifact) {
|
|
50
|
-
return dashboard_schema_1.VIEW_SCHEMAS[artifact] ?? null;
|
|
51
|
-
}
|
|
52
|
-
validate(artifact, config) {
|
|
53
|
-
const schema = this.getSchema(artifact);
|
|
54
|
-
if (!schema) {
|
|
55
|
-
return [{ instancePath: '', keyword: 'artifact', message: `Schema sconosciuto: ${artifact}` }];
|
|
56
|
-
}
|
|
57
|
-
let v = this.validators.get(artifact);
|
|
58
|
-
if (!v) {
|
|
59
|
-
v = this.ajv.compile(schema);
|
|
60
|
-
this.validators.set(artifact, v);
|
|
61
|
-
}
|
|
62
|
-
const ok = v(config);
|
|
63
|
-
if (ok)
|
|
64
|
-
return [];
|
|
65
|
-
return (v.errors ?? []).map((e) => ({
|
|
66
|
-
instancePath: e.instancePath,
|
|
67
|
-
keyword: e.keyword,
|
|
68
|
-
message: e.message ?? 'invalid',
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
exports.ViewschemaService = ViewschemaService;
|
|
73
|
-
exports.ViewschemaService = ViewschemaService = __decorate([
|
|
74
|
-
(0, common_1.Injectable)(),
|
|
75
|
-
__metadata("design:paramtypes", [])
|
|
76
|
-
], ViewschemaService);
|
|
77
|
-
//# sourceMappingURL=viewschema.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewschema.service.js","sourceRoot":"","sources":["../../src/viewschema/viewschema.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,0DAAuE;AACvE,8DAAqC;AACrC,sDAA8B;AAC9B,iEAAwE;AASjE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAI5B;QAFiB,eAAU,GAAG,IAAI,GAAG,EAA4B,CAAC;QAKhE,IAAI,CAAC,GAAG,GAAG,IAAI,eAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3D,IAAA,qBAAU,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAGrB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;YAClB,OAAO,EAAE,WAAW;YACpB,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,SAAS,QAAQ,CAAC,EAAW,EAAE,IAAa;gBACpD,IAAI,CAAC,EAAE,IAAI,OAAO,IAAI,KAAK,QAAQ;oBAAE,OAAO,IAAI,CAAC;gBACjD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;gBACnD,IAAI,CAAC,CAAC;oBAAE,OAAO,IAAI,CAAC;gBACpB,IAAI,CAAC;oBACH,IAAA,iBAAO,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;oBACrB,OAAO,IAAI,CAAC;gBACd,CAA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