ondc-code-generator 0.3.5 → 0.3.6

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.
@@ -1,6 +1,5 @@
1
1
  import { loadAndDereferenceYaml } from "../utils/config-utils/yaml.js";
2
2
  import { SchemaExtactionService as SchemaExtractionService } from "../services/schema-service.js";
3
- import logger from "../utils/logger.js";
4
3
  import { SupportedLanguages } from "../types/compiler-types.js";
5
4
  import { TypescriptGenerator } from "./generators/typescript/ts-generator.js";
6
5
  import { ConfigValidator } from "./validators/config-validator.js";
@@ -30,33 +29,31 @@ export class ConfigCompiler {
30
29
  this.errorDefinitions = errors.code;
31
30
  };
32
31
  this.performValidations = async (valConfig) => {
33
- try {
34
- if (!this.buildData)
35
- throw new Error("Build data not initialized");
36
- if (!this.jsonSchemas)
37
- throw new Error("Schemas not initialized");
38
- if (!this.possibleJsonPaths)
39
- throw new Error("Possible paths not initialized");
40
- if (!this.errorDefinitions)
41
- throw new Error("Error definitions not initialized");
42
- await new ConfigValidator("", valConfig, this.possibleJsonPaths, this.errorDefinitions).validate();
43
- }
44
- catch (e) {
45
- logger.error(e);
46
- throw new Error("Validation failed");
47
- }
32
+ // try {
33
+ if (!this.buildData)
34
+ throw new Error("Build data not initialized");
35
+ if (!this.jsonSchemas)
36
+ throw new Error("Schemas not initialized");
37
+ if (!this.possibleJsonPaths)
38
+ throw new Error("Possible paths not initialized");
39
+ if (!this.errorDefinitions)
40
+ throw new Error("Error definitions not initialized");
41
+ await new ConfigValidator("", valConfig, this.possibleJsonPaths, this.errorDefinitions).validate();
42
+ // } catch (e) {
43
+ // logger.error(e);
44
+ // throw new Error(e as any);
45
+ // }
48
46
  };
49
47
  this.withMinimalValidations = async (valConfig) => {
50
- try {
51
- await new ConfigValidator("", valConfig, {}, [], {
52
- minimal: true,
53
- }).validate();
54
- }
55
- catch (e) {
56
- logger.error(e);
57
- throw new Error("validation failed");
58
- }
48
+ // try {
49
+ await new ConfigValidator("", valConfig, {}, [], {
50
+ minimal: true,
51
+ }).validate();
52
+ // } catch (e) {
53
+ // logger.error(e);
54
+ // throw new Error("validation failed");
59
55
  };
56
+ // };
60
57
  this.generateCode = async (valConfig, codeName = "L1-Validations", minimal = false, outputPath = "./") => {
61
58
  valConfig = JSON.parse(JSON.stringify(valConfig));
62
59
  if (this.generatorConfig?.duplicateVariablesInChildren) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ondc-code-generator",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "generate code from build.yaml ",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",