industrial-model 0.11.1 → 0.11.2
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/dist/cli/index.cjs +4 -47
- package/dist/cli/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -216733,46 +216733,6 @@ var typeMappings = {
|
|
|
216733
216733
|
direct: "NodeId",
|
|
216734
216734
|
enum: "string"
|
|
216735
216735
|
};
|
|
216736
|
-
var reservedWords = /* @__PURE__ */ new Set([
|
|
216737
|
-
"break",
|
|
216738
|
-
"case",
|
|
216739
|
-
"catch",
|
|
216740
|
-
"class",
|
|
216741
|
-
"const",
|
|
216742
|
-
"continue",
|
|
216743
|
-
"debugger",
|
|
216744
|
-
"default",
|
|
216745
|
-
"delete",
|
|
216746
|
-
"do",
|
|
216747
|
-
"else",
|
|
216748
|
-
"enum",
|
|
216749
|
-
"export",
|
|
216750
|
-
"extends",
|
|
216751
|
-
"false",
|
|
216752
|
-
"finally",
|
|
216753
|
-
"for",
|
|
216754
|
-
"function",
|
|
216755
|
-
"if",
|
|
216756
|
-
"import",
|
|
216757
|
-
"in",
|
|
216758
|
-
"instanceof",
|
|
216759
|
-
"new",
|
|
216760
|
-
"null",
|
|
216761
|
-
"return",
|
|
216762
|
-
"super",
|
|
216763
|
-
"switch",
|
|
216764
|
-
"this",
|
|
216765
|
-
"throw",
|
|
216766
|
-
"true",
|
|
216767
|
-
"try",
|
|
216768
|
-
"typeof",
|
|
216769
|
-
"undefined",
|
|
216770
|
-
"var",
|
|
216771
|
-
"void",
|
|
216772
|
-
"while",
|
|
216773
|
-
"with",
|
|
216774
|
-
"yield"
|
|
216775
|
-
]);
|
|
216776
216736
|
|
|
216777
216737
|
// src/cli/generator/parser.ts
|
|
216778
216738
|
function parseViews(views) {
|
|
@@ -216781,10 +216741,7 @@ function parseViews(views) {
|
|
|
216781
216741
|
function parseView(view) {
|
|
216782
216742
|
const fields = [];
|
|
216783
216743
|
for (const [propertyName, prop] of Object.entries(view.properties)) {
|
|
216784
|
-
|
|
216785
|
-
if (reservedWords.has(fieldName)) {
|
|
216786
|
-
fieldName = `${fieldName}_`;
|
|
216787
|
-
}
|
|
216744
|
+
const fieldName = toCamel(propertyName);
|
|
216788
216745
|
if (isViewPropertyDefinition(prop)) {
|
|
216789
216746
|
fields.push(processMappedProperty(propertyName, fieldName, prop));
|
|
216790
216747
|
} else if (isEdgeConnection(prop)) {
|
|
@@ -216889,7 +216846,7 @@ function getInterfaceType(field, viewName) {
|
|
|
216889
216846
|
}
|
|
216890
216847
|
function getEnumTypeName(viewName, field) {
|
|
216891
216848
|
const capitalized = field.fieldName.charAt(0).toUpperCase() + field.fieldName.slice(1);
|
|
216892
|
-
return `${viewName}${capitalized}`;
|
|
216849
|
+
return `${viewName}_${capitalized}`;
|
|
216893
216850
|
}
|
|
216894
216851
|
function getRelationResolvedType(field) {
|
|
216895
216852
|
const target = field.relationTarget ?? "unknown";
|
|
@@ -217664,7 +217621,7 @@ var generateCommand = new Command("generate").description("Generate TypeScript t
|
|
|
217664
217621
|
dataModelVersion: dataModel.version,
|
|
217665
217622
|
clientName: options.clientName,
|
|
217666
217623
|
outputPath: options.outputPath,
|
|
217667
|
-
packageVersion: "0.11.
|
|
217624
|
+
packageVersion: "0.11.2"
|
|
217668
217625
|
});
|
|
217669
217626
|
console.log(
|
|
217670
217627
|
`
|
|
@@ -217705,7 +217662,7 @@ Error loading JSON types file: ${error instanceof Error ? error.message : error}
|
|
|
217705
217662
|
});
|
|
217706
217663
|
|
|
217707
217664
|
// src/cli/index.ts
|
|
217708
|
-
var program2 = new Command().name("industrial-model").description("Code generator for Cognite Data Fusion data models").version("0.11.
|
|
217665
|
+
var program2 = new Command().name("industrial-model").description("Code generator for Cognite Data Fusion data models").version("0.11.2");
|
|
217709
217666
|
program2.addCommand(generateCommand);
|
|
217710
217667
|
program2.parse();
|
|
217711
217668
|
/*! Bundled license information:
|