@loopstack/core 0.1.2 → 0.3.0
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/CHANGELOG.md +22 -0
- package/dist/modules/common/common.module.js +9 -15
- package/dist/modules/common/common.module.js.map +1 -1
- package/dist/modules/common/errors/object-expression.error.d.ts +4 -0
- package/dist/modules/common/errors/object-expression.error.js +13 -0
- package/dist/modules/common/errors/object-expression.error.js.map +1 -0
- package/dist/modules/common/errors/template-expression.error.d.ts +4 -0
- package/dist/modules/common/errors/template-expression.error.js +13 -0
- package/dist/modules/common/errors/template-expression.error.js.map +1 -0
- package/dist/modules/common/services/context.service.d.ts +1 -0
- package/dist/modules/common/services/context.service.js +4 -0
- package/dist/modules/common/services/context.service.js.map +1 -1
- package/dist/modules/common/services/expression-handler/object-expression.handler.d.ts +20 -0
- package/dist/modules/common/services/expression-handler/object-expression.handler.js +125 -0
- package/dist/modules/common/services/expression-handler/object-expression.handler.js.map +1 -0
- package/dist/modules/common/services/expression-handler/template-expression.handler.d.ts +12 -0
- package/dist/modules/common/services/expression-handler/template-expression.handler.js +63 -0
- package/dist/modules/common/services/expression-handler/template-expression.handler.js.map +1 -0
- package/dist/modules/common/services/handlebars-helpers/date-formatter-handlebars-helper.service.d.ts +9 -0
- package/dist/modules/common/services/handlebars-helpers/date-formatter-handlebars-helper.service.js +124 -0
- package/dist/modules/common/services/handlebars-helpers/date-formatter-handlebars-helper.service.js.map +1 -0
- package/dist/modules/common/services/handlebars-helpers/index.d.ts +1 -0
- package/dist/modules/common/services/handlebars-helpers/index.js +18 -0
- package/dist/modules/common/services/handlebars-helpers/index.js.map +1 -0
- package/dist/modules/common/services/handlebars-processor.service.d.ts +12 -0
- package/dist/modules/common/services/handlebars-processor.service.js +70 -0
- package/dist/modules/common/services/handlebars-processor.service.js.map +1 -0
- package/dist/modules/common/services/index.d.ts +6 -5
- package/dist/modules/common/services/index.js +6 -5
- package/dist/modules/common/services/index.js.map +1 -1
- package/dist/modules/common/services/template.service.d.ts +16 -0
- package/dist/modules/common/services/template.service.js +64 -0
- package/dist/modules/common/services/template.service.js.map +1 -0
- package/dist/modules/common/services/variable-sanitizer.service.d.ts +9 -0
- package/dist/modules/common/services/variable-sanitizer.service.js +84 -0
- package/dist/modules/common/services/variable-sanitizer.service.js.map +1 -0
- package/dist/modules/configuration/configuration.module.js +2 -1
- package/dist/modules/configuration/configuration.module.js.map +1 -1
- package/dist/modules/configuration/services/configuration.service.d.ts +15 -14
- package/dist/modules/configuration/services/configuration.service.js +97 -107
- package/dist/modules/configuration/services/configuration.service.js.map +1 -1
- package/dist/modules/configuration/services/dynamic-schema-generator.service.js +3 -1
- package/dist/modules/configuration/services/dynamic-schema-generator.service.js.map +1 -1
- package/dist/modules/configuration/services/index.d.ts +1 -0
- package/dist/modules/configuration/services/index.js +1 -0
- package/dist/modules/configuration/services/index.js.map +1 -1
- package/dist/modules/configuration/services/schema-registry.service.d.ts +9 -0
- package/dist/modules/configuration/services/schema-registry.service.js +41 -0
- package/dist/modules/configuration/services/schema-registry.service.js.map +1 -0
- package/dist/modules/configuration/services/service-registry.service.js +1 -1
- package/dist/modules/configuration/services/service-registry.service.js.map +1 -1
- package/dist/modules/persistence/services/document.service.d.ts +6 -2
- package/dist/modules/persistence/services/document.service.js +29 -17
- package/dist/modules/persistence/services/document.service.js.map +1 -1
- package/dist/modules/persistence/services/namespace.service.js.map +1 -1
- package/dist/modules/persistence/services/workflow.service.js.map +1 -1
- package/dist/modules/workflow-processor/services/index.d.ts +4 -1
- package/dist/modules/workflow-processor/services/index.js +4 -1
- package/dist/modules/workflow-processor/services/index.js.map +1 -1
- package/dist/modules/workflow-processor/services/pipeline-processor.service.d.ts +15 -8
- package/dist/modules/workflow-processor/services/pipeline-processor.service.js +163 -29
- package/dist/modules/workflow-processor/services/pipeline-processor.service.js.map +1 -1
- package/dist/modules/workflow-processor/services/root-processor.service.d.ts +12 -0
- package/dist/modules/workflow-processor/services/root-processor.service.js +49 -0
- package/dist/modules/workflow-processor/services/root-processor.service.js.map +1 -0
- package/dist/modules/workflow-processor/services/service-execution.service.d.ts +12 -0
- package/dist/modules/workflow-processor/services/service-execution.service.js +53 -0
- package/dist/modules/workflow-processor/services/service-execution.service.js.map +1 -0
- package/dist/modules/workflow-processor/services/state-machine-config.service.d.ts +2 -17
- package/dist/modules/workflow-processor/services/state-machine-config.service.js +33 -17
- package/dist/modules/workflow-processor/services/state-machine-config.service.js.map +1 -1
- package/dist/modules/workflow-processor/services/state-machine-processor.service.d.ts +11 -7
- package/dist/modules/workflow-processor/services/state-machine-processor.service.js +95 -30
- package/dist/modules/workflow-processor/services/state-machine-processor.service.js.map +1 -1
- package/dist/modules/workflow-processor/services/template-expression-evaluator.service.d.ts +24 -4
- package/dist/modules/workflow-processor/services/template-expression-evaluator.service.js +90 -21
- package/dist/modules/workflow-processor/services/template-expression-evaluator.service.js.map +1 -1
- package/dist/modules/workflow-processor/services/tool-execution.service.d.ts +8 -20
- package/dist/modules/workflow-processor/services/tool-execution.service.js +31 -55
- package/dist/modules/workflow-processor/services/tool-execution.service.js.map +1 -1
- package/dist/modules/workflow-processor/services/workflow-context.service.d.ts +4 -0
- package/dist/modules/{common/services/template-engine.service.js → workflow-processor/services/workflow-context.service.js} +12 -15
- package/dist/modules/workflow-processor/services/workflow-context.service.js.map +1 -0
- package/dist/modules/workflow-processor/services/workflow-processor.service.d.ts +5 -26
- package/dist/modules/workflow-processor/services/workflow-processor.service.js +18 -184
- package/dist/modules/workflow-processor/services/workflow-processor.service.js.map +1 -1
- package/dist/modules/workflow-processor/services/workflow-state.service.d.ts +8 -0
- package/dist/modules/workflow-processor/services/workflow-state.service.js +49 -0
- package/dist/modules/workflow-processor/services/workflow-state.service.js.map +1 -0
- package/dist/modules/workflow-processor/tool-services/add-namespace.service.js +4 -4
- package/dist/modules/workflow-processor/tool-services/add-namespace.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.d.ts +6 -10
- package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.js +39 -27
- package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/create-document.service.d.ts +7 -142
- package/dist/modules/workflow-processor/tool-services/create-document.service.js +91 -35
- package/dist/modules/workflow-processor/tool-services/create-document.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/load-document.service.d.ts +26 -51
- package/dist/modules/workflow-processor/tool-services/load-document.service.js +59 -81
- package/dist/modules/workflow-processor/tool-services/load-document.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/mock.service.d.ts +11 -8
- package/dist/modules/workflow-processor/tool-services/mock.service.js +41 -9
- package/dist/modules/workflow-processor/tool-services/mock.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/set-context.service.d.ts +3 -0
- package/dist/modules/workflow-processor/tool-services/set-context.service.js +11 -5
- package/dist/modules/workflow-processor/tool-services/set-context.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/set-target-place.service.d.ts +1 -1
- package/dist/modules/workflow-processor/tool-services/set-target-place.service.js +6 -5
- package/dist/modules/workflow-processor/tool-services/set-target-place.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/transition-selector.service.js +2 -2
- package/dist/modules/workflow-processor/tool-services/transition-selector.service.js.map +1 -1
- package/dist/modules/workflow-processor/tool-services/update-document.service.d.ts +32 -62
- package/dist/modules/workflow-processor/tool-services/update-document.service.js +92 -7
- package/dist/modules/workflow-processor/tool-services/update-document.service.js.map +1 -1
- package/dist/modules/workflow-processor/validators/workflow-option.validator.d.ts +1 -1
- package/dist/modules/workflow-processor/validators/workflow-option.validator.js +3 -3
- package/dist/modules/workflow-processor/validators/workflow-option.validator.js.map +1 -1
- package/dist/modules/workflow-processor/workflow-processor.module.js +9 -2
- package/dist/modules/workflow-processor/workflow-processor.module.js.map +1 -1
- package/dist/utils/load-configuration.js +5 -3
- package/dist/utils/load-configuration.js.map +1 -1
- package/package.json +5 -3
- package/dist/modules/common/services/document-helper.service.d.ts +0 -212
- package/dist/modules/common/services/document-helper.service.js +0 -53
- package/dist/modules/common/services/document-helper.service.js.map +0 -1
- package/dist/modules/common/services/expression-evaluator.service.d.ts +0 -5
- package/dist/modules/common/services/expression-evaluator.service.js +0 -44
- package/dist/modules/common/services/expression-evaluator.service.js.map +0 -1
- package/dist/modules/common/services/schema-validator.service.d.ts +0 -7
- package/dist/modules/common/services/schema-validator.service.js +0 -41
- package/dist/modules/common/services/schema-validator.service.js.map +0 -1
- package/dist/modules/common/services/template-engine.service.d.ts +0 -5
- package/dist/modules/common/services/template-engine.service.js.map +0 -1
- package/dist/modules/common/services/value-parser.service.d.ts +0 -19
- package/dist/modules/common/services/value-parser.service.js +0 -68
- package/dist/modules/common/services/value-parser.service.js.map +0 -1
- package/dist/modules/configuration/commands/generate-schemas.command.d.ts +0 -8
- package/dist/modules/configuration/commands/generate-schemas.command.js +0 -34
- package/dist/modules/configuration/commands/generate-schemas.command.js.map +0 -1
- package/dist/modules/workflow-processor/services/tool-schema-validator.service.d.ts +0 -5
- package/dist/modules/workflow-processor/services/tool-schema-validator.service.js +0 -41
- package/dist/modules/workflow-processor/services/tool-schema-validator.service.js.map +0 -1
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { DocumentType } from '@loopstack/shared';
|
|
3
|
-
import { ValueParserService } from './value-parser.service';
|
|
4
|
-
export declare const CreateDocumentWithSchema: z.ZodObject<{
|
|
5
|
-
update: z.ZodOptional<z.ZodObject<{
|
|
6
|
-
name: z.ZodOptional<z.ZodString>;
|
|
7
|
-
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
8
|
-
content: z.ZodOptional<z.ZodAny>;
|
|
9
|
-
schema: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
10
|
-
ui: z.ZodOptional<z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>>;
|
|
11
|
-
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
12
|
-
meta: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
13
|
-
mimeType: z.ZodOptional<z.ZodEnum<["text/plain", "text/html", "text/css", "text/xml", "text/markdown", "application/javascript", "application/typescript", "application/json", "application/xml", "application/yaml"]>>;
|
|
14
|
-
invalidate: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
-
level: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"debug">, z.ZodLiteral<"info">, z.ZodLiteral<"warning">, z.ZodLiteral<"error">]>>;
|
|
16
|
-
enableTransitions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
-
enableAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
-
hideAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
-
data: z.ZodOptional<z.ZodAny>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
22
|
-
invalidate?: boolean | undefined;
|
|
23
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
24
|
-
enableTransitions?: string[] | undefined;
|
|
25
|
-
enableAtPlaces?: string[] | undefined;
|
|
26
|
-
hideAtPlaces?: string[] | undefined;
|
|
27
|
-
data?: any;
|
|
28
|
-
}, {
|
|
29
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
30
|
-
invalidate?: boolean | undefined;
|
|
31
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
32
|
-
enableTransitions?: string[] | undefined;
|
|
33
|
-
enableAtPlaces?: string[] | undefined;
|
|
34
|
-
hideAtPlaces?: string[] | undefined;
|
|
35
|
-
data?: any;
|
|
36
|
-
}>>>;
|
|
37
|
-
}, "strip", z.ZodTypeAny, {
|
|
38
|
-
name?: string | undefined;
|
|
39
|
-
description?: string | undefined;
|
|
40
|
-
content?: any;
|
|
41
|
-
schema?: any;
|
|
42
|
-
ui?: any;
|
|
43
|
-
tags?: string[] | undefined;
|
|
44
|
-
meta?: {
|
|
45
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
46
|
-
invalidate?: boolean | undefined;
|
|
47
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
48
|
-
enableTransitions?: string[] | undefined;
|
|
49
|
-
enableAtPlaces?: string[] | undefined;
|
|
50
|
-
hideAtPlaces?: string[] | undefined;
|
|
51
|
-
data?: any;
|
|
52
|
-
} | undefined;
|
|
53
|
-
}, {
|
|
54
|
-
name?: string | undefined;
|
|
55
|
-
description?: string | undefined;
|
|
56
|
-
content?: any;
|
|
57
|
-
schema?: any;
|
|
58
|
-
ui?: any;
|
|
59
|
-
tags?: string[] | undefined;
|
|
60
|
-
meta?: {
|
|
61
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
62
|
-
invalidate?: boolean | undefined;
|
|
63
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
64
|
-
enableTransitions?: string[] | undefined;
|
|
65
|
-
enableAtPlaces?: string[] | undefined;
|
|
66
|
-
hideAtPlaces?: string[] | undefined;
|
|
67
|
-
data?: any;
|
|
68
|
-
} | undefined;
|
|
69
|
-
}>>;
|
|
70
|
-
create: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
name: z.ZodString;
|
|
72
|
-
description: z.ZodOptional<z.ZodString>;
|
|
73
|
-
content: z.ZodAny;
|
|
74
|
-
schema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
75
|
-
ui: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
76
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
77
|
-
meta: z.ZodOptional<z.ZodObject<{
|
|
78
|
-
mimeType: z.ZodOptional<z.ZodEnum<["text/plain", "text/html", "text/css", "text/xml", "text/markdown", "application/javascript", "application/typescript", "application/json", "application/xml", "application/yaml"]>>;
|
|
79
|
-
invalidate: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
-
level: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"debug">, z.ZodLiteral<"info">, z.ZodLiteral<"warning">, z.ZodLiteral<"error">]>>;
|
|
81
|
-
enableTransitions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
82
|
-
enableAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
83
|
-
hideAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
|
-
data: z.ZodOptional<z.ZodAny>;
|
|
85
|
-
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
87
|
-
invalidate?: boolean | undefined;
|
|
88
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
89
|
-
enableTransitions?: string[] | undefined;
|
|
90
|
-
enableAtPlaces?: string[] | undefined;
|
|
91
|
-
hideAtPlaces?: string[] | undefined;
|
|
92
|
-
data?: any;
|
|
93
|
-
}, {
|
|
94
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
95
|
-
invalidate?: boolean | undefined;
|
|
96
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
97
|
-
enableTransitions?: string[] | undefined;
|
|
98
|
-
enableAtPlaces?: string[] | undefined;
|
|
99
|
-
hideAtPlaces?: string[] | undefined;
|
|
100
|
-
data?: any;
|
|
101
|
-
}>>;
|
|
102
|
-
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
name: string;
|
|
104
|
-
description?: string | undefined;
|
|
105
|
-
content?: any;
|
|
106
|
-
schema?: any;
|
|
107
|
-
ui?: any;
|
|
108
|
-
tags?: string[] | undefined;
|
|
109
|
-
meta?: {
|
|
110
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
111
|
-
invalidate?: boolean | undefined;
|
|
112
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
113
|
-
enableTransitions?: string[] | undefined;
|
|
114
|
-
enableAtPlaces?: string[] | undefined;
|
|
115
|
-
hideAtPlaces?: string[] | undefined;
|
|
116
|
-
data?: any;
|
|
117
|
-
} | undefined;
|
|
118
|
-
}, {
|
|
119
|
-
name: string;
|
|
120
|
-
description?: string | undefined;
|
|
121
|
-
content?: any;
|
|
122
|
-
schema?: any;
|
|
123
|
-
ui?: any;
|
|
124
|
-
tags?: string[] | undefined;
|
|
125
|
-
meta?: {
|
|
126
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
127
|
-
invalidate?: boolean | undefined;
|
|
128
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
129
|
-
enableTransitions?: string[] | undefined;
|
|
130
|
-
enableAtPlaces?: string[] | undefined;
|
|
131
|
-
hideAtPlaces?: string[] | undefined;
|
|
132
|
-
data?: any;
|
|
133
|
-
} | undefined;
|
|
134
|
-
}>>;
|
|
135
|
-
}, "strip", z.ZodTypeAny, {
|
|
136
|
-
create?: {
|
|
137
|
-
name: string;
|
|
138
|
-
description?: string | undefined;
|
|
139
|
-
content?: any;
|
|
140
|
-
schema?: any;
|
|
141
|
-
ui?: any;
|
|
142
|
-
tags?: string[] | undefined;
|
|
143
|
-
meta?: {
|
|
144
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
145
|
-
invalidate?: boolean | undefined;
|
|
146
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
147
|
-
enableTransitions?: string[] | undefined;
|
|
148
|
-
enableAtPlaces?: string[] | undefined;
|
|
149
|
-
hideAtPlaces?: string[] | undefined;
|
|
150
|
-
data?: any;
|
|
151
|
-
} | undefined;
|
|
152
|
-
} | undefined;
|
|
153
|
-
update?: {
|
|
154
|
-
name?: string | undefined;
|
|
155
|
-
description?: string | undefined;
|
|
156
|
-
content?: any;
|
|
157
|
-
schema?: any;
|
|
158
|
-
ui?: any;
|
|
159
|
-
tags?: string[] | undefined;
|
|
160
|
-
meta?: {
|
|
161
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
162
|
-
invalidate?: boolean | undefined;
|
|
163
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
164
|
-
enableTransitions?: string[] | undefined;
|
|
165
|
-
enableAtPlaces?: string[] | undefined;
|
|
166
|
-
hideAtPlaces?: string[] | undefined;
|
|
167
|
-
data?: any;
|
|
168
|
-
} | undefined;
|
|
169
|
-
} | undefined;
|
|
170
|
-
}, {
|
|
171
|
-
create?: {
|
|
172
|
-
name: string;
|
|
173
|
-
description?: string | undefined;
|
|
174
|
-
content?: any;
|
|
175
|
-
schema?: any;
|
|
176
|
-
ui?: any;
|
|
177
|
-
tags?: string[] | undefined;
|
|
178
|
-
meta?: {
|
|
179
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
180
|
-
invalidate?: boolean | undefined;
|
|
181
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
182
|
-
enableTransitions?: string[] | undefined;
|
|
183
|
-
enableAtPlaces?: string[] | undefined;
|
|
184
|
-
hideAtPlaces?: string[] | undefined;
|
|
185
|
-
data?: any;
|
|
186
|
-
} | undefined;
|
|
187
|
-
} | undefined;
|
|
188
|
-
update?: {
|
|
189
|
-
name?: string | undefined;
|
|
190
|
-
description?: string | undefined;
|
|
191
|
-
content?: any;
|
|
192
|
-
schema?: any;
|
|
193
|
-
ui?: any;
|
|
194
|
-
tags?: string[] | undefined;
|
|
195
|
-
meta?: {
|
|
196
|
-
mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
|
|
197
|
-
invalidate?: boolean | undefined;
|
|
198
|
-
level?: "debug" | "info" | "warning" | "error" | undefined;
|
|
199
|
-
enableTransitions?: string[] | undefined;
|
|
200
|
-
enableAtPlaces?: string[] | undefined;
|
|
201
|
-
hideAtPlaces?: string[] | undefined;
|
|
202
|
-
data?: any;
|
|
203
|
-
} | undefined;
|
|
204
|
-
} | undefined;
|
|
205
|
-
}>;
|
|
206
|
-
export declare class DocumentHelperService {
|
|
207
|
-
private valueParserService;
|
|
208
|
-
constructor(valueParserService: ValueParserService);
|
|
209
|
-
prepare(options: z.infer<typeof CreateDocumentWithSchema>, template: any): any;
|
|
210
|
-
prepareAliasVariables(aliasReference: Record<string, any>, dataSource: Record<string, any>): Record<string, any>;
|
|
211
|
-
createDocumentWithSchema(options: z.infer<typeof CreateDocumentWithSchema>, template: any, context: any): DocumentType;
|
|
212
|
-
}
|
|
@@ -1,53 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DocumentHelperService = exports.CreateDocumentWithSchema = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const zod_1 = require("zod");
|
|
15
|
-
const shared_1 = require("@loopstack/shared");
|
|
16
|
-
const lodash_1 = require("lodash");
|
|
17
|
-
const value_parser_service_1 = require("./value-parser.service");
|
|
18
|
-
exports.CreateDocumentWithSchema = zod_1.z.object({
|
|
19
|
-
update: shared_1.PartialDocumentSchema?.optional(),
|
|
20
|
-
create: shared_1.DocumentSchema?.optional(),
|
|
21
|
-
});
|
|
22
|
-
let DocumentHelperService = class DocumentHelperService {
|
|
23
|
-
valueParserService;
|
|
24
|
-
constructor(valueParserService) {
|
|
25
|
-
this.valueParserService = valueParserService;
|
|
26
|
-
}
|
|
27
|
-
prepare(options, template) {
|
|
28
|
-
if (options.create) {
|
|
29
|
-
return options.create;
|
|
30
|
-
}
|
|
31
|
-
if (template) {
|
|
32
|
-
if (options.update) {
|
|
33
|
-
return (0, lodash_1.merge)({}, template, options.update);
|
|
34
|
-
}
|
|
35
|
-
return template;
|
|
36
|
-
}
|
|
37
|
-
throw new Error(`Create document requires template or create property to be defined.`);
|
|
38
|
-
}
|
|
39
|
-
prepareAliasVariables(aliasReference, dataSource) {
|
|
40
|
-
return this.valueParserService.prepareAliasVariables(aliasReference, dataSource);
|
|
41
|
-
}
|
|
42
|
-
createDocumentWithSchema(options, template, context) {
|
|
43
|
-
const prototype = this.prepare(options, template);
|
|
44
|
-
const document = this.valueParserService.evalObjectLeafs(prototype, context);
|
|
45
|
-
return document;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
exports.DocumentHelperService = DocumentHelperService;
|
|
49
|
-
exports.DocumentHelperService = DocumentHelperService = __decorate([
|
|
50
|
-
(0, common_1.Injectable)(),
|
|
51
|
-
__metadata("design:paramtypes", [value_parser_service_1.ValueParserService])
|
|
52
|
-
], DocumentHelperService);
|
|
53
|
-
//# sourceMappingURL=document-helper.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-helper.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/document-helper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,8CAI2B;AAC3B,mCAA+B;AAC/B,iEAA4D;AAE/C,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,8BAAqB,EAAE,QAAQ,EAAE;IACzC,MAAM,EAAE,uBAAc,EAAE,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IACZ;IAApB,YAAoB,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAE9D,OAAO,CAAC,OAAiD,EAAE,QAAa;QACtE,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO,OAAO,CAAC,MAAM,CAAC;QACxB,CAAC;QAED,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACnB,OAAO,IAAA,cAAK,EAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,qBAAqB,CACnB,cAAmC,EACnC,UAA+B;QAE/B,OAAO,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAClD,cAAc,EACd,UAAU,CACX,CAAC;IACJ,CAAC;IAED,wBAAwB,CACtB,OAAiD,EACjD,QAAa,EACb,OAAY;QAEZ,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,CACtD,SAAS,EACT,OAAO,CACR,CAAC;QACF,OAAO,QAAwB,CAAC;IAClC,CAAC;CACF,CAAA;AA1CY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAE6B,yCAAkB;GAD/C,qBAAqB,CA0CjC"}
|
|
@@ -1,44 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ExpressionEvaluatorService = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const ejs_1 = __importDefault(require("ejs"));
|
|
15
|
-
let ExpressionEvaluatorService = class ExpressionEvaluatorService {
|
|
16
|
-
isExpression(input) {
|
|
17
|
-
if (typeof input !== 'string') {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
const trimmed = input.trim();
|
|
21
|
-
return trimmed.startsWith('${') && trimmed.endsWith('}');
|
|
22
|
-
}
|
|
23
|
-
extractGetContents(input) {
|
|
24
|
-
return input.trim().replace(/^\${/, '').replace(/}$/, '').trim();
|
|
25
|
-
}
|
|
26
|
-
evaluate(value, variables) {
|
|
27
|
-
if (!this.isExpression(value)) {
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
const content = this.extractGetContents(value);
|
|
31
|
-
const stringify = (value) => undefined === value ? 'undefined' : JSON.stringify(value);
|
|
32
|
-
const processString = `<%- stringify(${content}) %>`;
|
|
33
|
-
let result = ejs_1.default.render(processString, {
|
|
34
|
-
...variables,
|
|
35
|
-
stringify,
|
|
36
|
-
});
|
|
37
|
-
return 'undefined' === result ? undefined : JSON.parse(result);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.ExpressionEvaluatorService = ExpressionEvaluatorService;
|
|
41
|
-
exports.ExpressionEvaluatorService = ExpressionEvaluatorService = __decorate([
|
|
42
|
-
(0, common_1.Injectable)()
|
|
43
|
-
], ExpressionEvaluatorService);
|
|
44
|
-
//# sourceMappingURL=expression-evaluator.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expression-evaluator.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/expression-evaluator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,8CAAsB;AAGf,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YAAY,CAAC,KAAU;QACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;IAED,kBAAkB,CAAC,KAAa;QAC9B,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnE,CAAC;IAED,QAAQ,CAAC,KAAU,EAAE,SAA8B;QACjD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAG/C,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE,CAC/B,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC5D,MAAM,aAAa,GAAG,iBAAiB,OAAO,MAAM,CAAC;QAErD,IAAI,MAAM,GAAW,aAAG,CAAC,MAAM,CAAC,aAAa,EAAE;YAC7C,GAAG,SAAS;YACZ,SAAS;SACV,CAAC,CAAC;QAEH,OAAO,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;CACF,CAAA;AAhCY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;GACA,0BAA0B,CAgCtC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { JSONSchemaType } from 'ajv';
|
|
2
|
-
import { DocumentEntity } from '@loopstack/shared';
|
|
3
|
-
export declare class SchemaValidatorService {
|
|
4
|
-
private readonly logger;
|
|
5
|
-
validate(data: any, schema: JSONSchemaType<any>): void;
|
|
6
|
-
validateDocument(data: Partial<DocumentEntity>): void;
|
|
7
|
-
}
|
|
@@ -1,41 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
var SchemaValidatorService_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.SchemaValidatorService = void 0;
|
|
14
|
-
const common_1 = require("@nestjs/common");
|
|
15
|
-
const ajv_1 = __importDefault(require("ajv"));
|
|
16
|
-
let SchemaValidatorService = SchemaValidatorService_1 = class SchemaValidatorService {
|
|
17
|
-
logger = new common_1.Logger(SchemaValidatorService_1.name);
|
|
18
|
-
validate(data, schema) {
|
|
19
|
-
const ajv = new ajv_1.default({
|
|
20
|
-
strict: false,
|
|
21
|
-
keywords: ['ui'],
|
|
22
|
-
});
|
|
23
|
-
const validate = ajv.compile(schema);
|
|
24
|
-
const valid = validate(data);
|
|
25
|
-
if (!valid) {
|
|
26
|
-
this.logger.error(data);
|
|
27
|
-
this.logger.error(validate.errors);
|
|
28
|
-
throw new Error(`Validating data failed.`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
validateDocument(data) {
|
|
32
|
-
if (data.schema) {
|
|
33
|
-
this.validate(data.content, data.schema);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.SchemaValidatorService = SchemaValidatorService;
|
|
38
|
-
exports.SchemaValidatorService = SchemaValidatorService = SchemaValidatorService_1 = __decorate([
|
|
39
|
-
(0, common_1.Injectable)()
|
|
40
|
-
], SchemaValidatorService);
|
|
41
|
-
//# sourceMappingURL=schema-validator.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-validator.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/schema-validator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAA0C;AAInC,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAChB,MAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAElE,QAAQ,CAAC,IAAS,EAAE,MAA2B;QAC7C,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,CAAC,IAAI,CAAC;SACjB,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gBAAgB,CAAC,IAA6B;QAC5C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF,CAAA;AAtBY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;GACA,sBAAsB,CAsBlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-engine.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/template-engine.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAGpB,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,UAAU,CAAC,KAAU;QACnB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,QAAgB,EAAE,SAA8B;QACrD,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ,CAAC,KAAU,EAAE,SAA8B;QACjD,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxE,CAAC;CACF,CAAA;AAZY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;GACA,qBAAqB,CAYjC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ExpressionEvaluatorService } from './expression-evaluator.service';
|
|
2
|
-
import { ContextInterface } from '@loopstack/shared';
|
|
3
|
-
import { TemplateEngineService } from './template-engine.service';
|
|
4
|
-
export declare class ValueParserService {
|
|
5
|
-
private expressionEvaluatorService;
|
|
6
|
-
private templateEngineService;
|
|
7
|
-
constructor(expressionEvaluatorService: ExpressionEvaluatorService, templateEngineService: TemplateEngineService);
|
|
8
|
-
evalObjectLeafs<T>(obj: T, variables: any): T;
|
|
9
|
-
prepareAliasVariables(aliasReference: Record<string, any>, dataSource: Record<string, any>): Record<string, any>;
|
|
10
|
-
evalWithContext<T>(obj: any, variables: {
|
|
11
|
-
context: ContextInterface;
|
|
12
|
-
}): T;
|
|
13
|
-
evalWithContextAndItem<T extends {}>(obj: any, variables: {
|
|
14
|
-
context: ContextInterface;
|
|
15
|
-
item: string;
|
|
16
|
-
index: number;
|
|
17
|
-
}): T;
|
|
18
|
-
evalWithContextVariables<T>(obj: any, variables: any): T;
|
|
19
|
-
}
|
|
@@ -1,68 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ValueParserService = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const expression_evaluator_service_1 = require("./expression-evaluator.service");
|
|
15
|
-
const lodash_1 = require("lodash");
|
|
16
|
-
const template_engine_service_1 = require("./template-engine.service");
|
|
17
|
-
let ValueParserService = class ValueParserService {
|
|
18
|
-
expressionEvaluatorService;
|
|
19
|
-
templateEngineService;
|
|
20
|
-
constructor(expressionEvaluatorService, templateEngineService) {
|
|
21
|
-
this.expressionEvaluatorService = expressionEvaluatorService;
|
|
22
|
-
this.templateEngineService = templateEngineService;
|
|
23
|
-
}
|
|
24
|
-
evalObjectLeafs(obj, variables) {
|
|
25
|
-
if (obj === null || obj === undefined) {
|
|
26
|
-
return obj;
|
|
27
|
-
}
|
|
28
|
-
if (typeof obj !== 'object') {
|
|
29
|
-
return this.expressionEvaluatorService.isExpression(obj)
|
|
30
|
-
? this.expressionEvaluatorService.evaluate(obj, variables)
|
|
31
|
-
: this.templateEngineService.evaluate(obj, variables);
|
|
32
|
-
}
|
|
33
|
-
if (Array.isArray(obj)) {
|
|
34
|
-
return obj.map((item) => this.evalObjectLeafs(item, variables));
|
|
35
|
-
}
|
|
36
|
-
const result = {};
|
|
37
|
-
for (const key in obj) {
|
|
38
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
39
|
-
result[key] = this.evalObjectLeafs(obj[key], variables);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
prepareAliasVariables(aliasReference, dataSource) {
|
|
45
|
-
return aliasReference
|
|
46
|
-
? (0, lodash_1.transform)(aliasReference, (result, path, key) => {
|
|
47
|
-
const document = (0, lodash_1.get)(dataSource, path);
|
|
48
|
-
result[key] = document?.content;
|
|
49
|
-
}, {})
|
|
50
|
-
: {};
|
|
51
|
-
}
|
|
52
|
-
evalWithContext(obj, variables) {
|
|
53
|
-
return obj ? this.evalObjectLeafs(obj, variables) : {};
|
|
54
|
-
}
|
|
55
|
-
evalWithContextAndItem(obj, variables) {
|
|
56
|
-
return obj ? this.evalObjectLeafs(obj, variables) : {};
|
|
57
|
-
}
|
|
58
|
-
evalWithContextVariables(obj, variables) {
|
|
59
|
-
return obj ? this.evalObjectLeafs(obj, variables) : {};
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
exports.ValueParserService = ValueParserService;
|
|
63
|
-
exports.ValueParserService = ValueParserService = __decorate([
|
|
64
|
-
(0, common_1.Injectable)(),
|
|
65
|
-
__metadata("design:paramtypes", [expression_evaluator_service_1.ExpressionEvaluatorService,
|
|
66
|
-
template_engine_service_1.TemplateEngineService])
|
|
67
|
-
], ValueParserService);
|
|
68
|
-
//# sourceMappingURL=value-parser.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"value-parser.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/value-parser.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iFAA4E;AAI5E,mCAAwC;AACxC,uEAAkE;AAG3D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEnB;IACA;IAFV,YACU,0BAAsD,EACtD,qBAA4C;QAD5C,+BAA0B,GAA1B,0BAA0B,CAA4B;QACtD,0BAAqB,GAArB,qBAAqB,CAAuB;IACnD,CAAC;IAEJ,eAAe,CAAI,GAAM,EAAE,SAAc;QACvC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,GAAG,CAAC;QACb,CAAC;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,0BAA0B,CAAC,YAAY,CAAC,GAAG,CAAC;gBACtD,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;gBAC1D,CAAC,CAAE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAkB,CAAC;QAC5E,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACtB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,CACtB,CAAC;QACpB,CAAC;QAED,MAAM,MAAM,GAAG,EAAO,CAAC;QACvB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;gBACnD,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,qBAAqB,CACnB,cAAmC,EACnC,UAA+B;QAE/B,OAAO,cAAc;YACnB,CAAC,CAAC,IAAA,kBAAS,EACP,cAAc,EACd,CAAC,MAA2B,EAAE,IAAc,EAAE,GAAW,EAAE,EAAE;gBAC3D,MAAM,QAAQ,GAAG,IAAA,YAAG,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gBACvC,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC;YAClC,CAAC,EACD,EAAE,CACH;YACH,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAED,eAAe,CAAI,GAAQ,EAAE,SAAwC;QACnE,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;IACD,sBAAsB,CACpB,GAAQ,EACR,SAAqE;QAErE,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;IAED,wBAAwB,CAAI,GAAQ,EAAE,SAAc;QAClD,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;CACF,CAAA;AA9DY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAG2B,yDAA0B;QAC/B,+CAAqB;GAH3C,kBAAkB,CA8D9B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CommandRunner } from 'nest-commander';
|
|
2
|
-
import { JsonSchemaGeneratorService } from '../services/json-schema-generator.service';
|
|
3
|
-
export declare class GenerateSchemasCommand extends CommandRunner {
|
|
4
|
-
private readonly jsonSchemaGeneratorService;
|
|
5
|
-
private readonly logger;
|
|
6
|
-
constructor(jsonSchemaGeneratorService: JsonSchemaGeneratorService);
|
|
7
|
-
run(): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,34 +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 GenerateSchemasCommand_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.GenerateSchemasCommand = void 0;
|
|
14
|
-
const nest_commander_1 = require("nest-commander");
|
|
15
|
-
const json_schema_generator_service_1 = require("../services/json-schema-generator.service");
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
let GenerateSchemasCommand = GenerateSchemasCommand_1 = class GenerateSchemasCommand extends nest_commander_1.CommandRunner {
|
|
18
|
-
jsonSchemaGeneratorService;
|
|
19
|
-
logger = new common_1.Logger(GenerateSchemasCommand_1.name);
|
|
20
|
-
constructor(jsonSchemaGeneratorService) {
|
|
21
|
-
super();
|
|
22
|
-
this.jsonSchemaGeneratorService = jsonSchemaGeneratorService;
|
|
23
|
-
}
|
|
24
|
-
async run() {
|
|
25
|
-
this.logger.log('Generating json schema...');
|
|
26
|
-
await this.jsonSchemaGeneratorService.generateSchemas();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
exports.GenerateSchemasCommand = GenerateSchemasCommand;
|
|
30
|
-
exports.GenerateSchemasCommand = GenerateSchemasCommand = GenerateSchemasCommand_1 = __decorate([
|
|
31
|
-
(0, nest_commander_1.Command)({ name: 'generate-schema', description: 'Generate json schema' }),
|
|
32
|
-
__metadata("design:paramtypes", [json_schema_generator_service_1.JsonSchemaGeneratorService])
|
|
33
|
-
], GenerateSchemasCommand);
|
|
34
|
-
//# sourceMappingURL=generate-schemas.command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-schemas.command.js","sourceRoot":"","sources":["../../../../src/modules/configuration/commands/generate-schemas.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAwD;AACxD,6FAAuF;AACvF,2CAAwC;AAGjC,IAAM,sBAAsB,8BAA5B,MAAM,sBAAuB,SAAQ,8BAAa;IAGpC;IAFF,MAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAClE,YACmB,0BAAsD;QAEvE,KAAK,EAAE,CAAC;QAFS,+BAA0B,GAA1B,0BAA0B,CAA4B;IAGzE,CAAC;IAED,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAC7C,MAAM,IAAI,CAAC,0BAA0B,CAAC,eAAe,EAAE,CAAC;IAC1D,CAAC;CACF,CAAA;AAZY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,wBAAO,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;qCAIzB,0DAA0B;GAH9D,sBAAsB,CAYlC"}
|
|
@@ -1,41 +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 ToolSchemaValidatorService_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ToolSchemaValidatorService = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const zod_1 = require("zod");
|
|
13
|
-
let ToolSchemaValidatorService = ToolSchemaValidatorService_1 = class ToolSchemaValidatorService {
|
|
14
|
-
logger = new common_1.Logger(ToolSchemaValidatorService_1.name);
|
|
15
|
-
validateProps(schema, props) {
|
|
16
|
-
if (schema) {
|
|
17
|
-
try {
|
|
18
|
-
return schema.parse(props);
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
if (error instanceof zod_1.z.ZodError) {
|
|
22
|
-
const enhancedErrors = error.errors.map((err) => {
|
|
23
|
-
const path = err.path;
|
|
24
|
-
const invalidValue = path.reduce((obj, key) => obj && typeof obj === 'object' ? obj[key] : undefined, props);
|
|
25
|
-
return {
|
|
26
|
-
...err,
|
|
27
|
-
invalidValue,
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
this.logger.error(JSON.stringify(enhancedErrors, null, 2));
|
|
31
|
-
}
|
|
32
|
-
throw error;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.ToolSchemaValidatorService = ToolSchemaValidatorService;
|
|
38
|
-
exports.ToolSchemaValidatorService = ToolSchemaValidatorService = ToolSchemaValidatorService_1 = __decorate([
|
|
39
|
-
(0, common_1.Injectable)()
|
|
40
|
-
], ToolSchemaValidatorService);
|
|
41
|
-
//# sourceMappingURL=tool-schema-validator.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-schema-validator.service.js","sourceRoot":"","sources":["../../../../src/modules/workflow-processor/services/tool-schema-validator.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAoD;AACpD,6BAAmC;AAG5B,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAC7B,MAAM,GAAG,IAAI,eAAM,CAAC,4BAA0B,CAAC,IAAI,CAAC,CAAC;IAE7D,aAAa,CAAC,MAA6B,EAAE,KAAU;QACrD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC;gBACH,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,KAAK,YAAY,OAAC,CAAC,QAAQ,EAAE,CAAC;oBAChC,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;wBAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;wBAGtB,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAC9B,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CACX,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EACvD,KAAK,CACN,CAAC;wBAEF,OAAO;4BACL,GAAG,GAAG;4BACN,YAAY;yBACb,CAAC;oBACJ,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC7D,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AA/BY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;GACA,0BAA0B,CA+BtC"}
|