node-opcua-convert-nodeset-to-javascript 2.51.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.
Files changed (48) hide show
  1. package/.mocharc.yml +10 -0
  2. package/LICENSE +20 -0
  3. package/dist/convert_namespace_to_typescript.d.ts +3 -0
  4. package/dist/convert_namespace_to_typescript.js +158 -0
  5. package/dist/convert_namespace_to_typescript.js.map +1 -0
  6. package/dist/convert_to_typescript.d.ts +109 -0
  7. package/dist/convert_to_typescript.js +879 -0
  8. package/dist/convert_to_typescript.js.map +1 -0
  9. package/dist/index.d.ts +3 -0
  10. package/dist/index.js +16 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/main.d.ts +1 -0
  13. package/dist/main.js +66 -0
  14. package/dist/main.js.map +1 -0
  15. package/dist/official_namespaces.d.ts +23 -0
  16. package/dist/official_namespaces.js +36 -0
  17. package/dist/official_namespaces.js.map +1 -0
  18. package/dist/options.d.ts +4 -0
  19. package/dist/options.js +3 -0
  20. package/dist/options.js.map +1 -0
  21. package/dist/private/cache.d.ts +58 -0
  22. package/dist/private/cache.js +213 -0
  23. package/dist/private/cache.js.map +1 -0
  24. package/dist/private/to_filename.d.ts +1 -0
  25. package/dist/private/to_filename.js +10 -0
  26. package/dist/private/to_filename.js.map +1 -0
  27. package/dist/private/utils.d.ts +24 -0
  28. package/dist/private/utils.js +261 -0
  29. package/dist/private/utils.js.map +1 -0
  30. package/dist/private-stuff.d.ts +4 -0
  31. package/dist/private-stuff.js +17 -0
  32. package/dist/private-stuff.js.map +1 -0
  33. package/dist/walk_through.d.ts +13 -0
  34. package/dist/walk_through.js +87 -0
  35. package/dist/walk_through.js.map +1 -0
  36. package/package.json +58 -0
  37. package/source/convert_namespace_to_typescript.ts +171 -0
  38. package/source/convert_to_typescript.ts +1095 -0
  39. package/source/index.ts +3 -0
  40. package/source/main.ts +56 -0
  41. package/source/official_namespaces.ts +35 -0
  42. package/source/options.ts +4 -0
  43. package/source/private/cache.ts +228 -0
  44. package/source/private/to_filename.ts +6 -0
  45. package/source/private/utils.ts +212 -0
  46. package/source/private-stuff.ts +6 -0
  47. package/source/walk_through.ts +73 -0
  48. package/tsconfig-generated.json +13 -0
package/.mocharc.yml ADDED
@@ -0,0 +1,10 @@
1
+ recursive: true
2
+ require:
3
+ - ../../node_modules/should
4
+ - ../../node_modules/ts-node/register
5
+ timeout: 2000000
6
+ enable-source-maps: true
7
+ spec:
8
+ - test/**/*.ts
9
+ - test/**/*.js
10
+ bail: false
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2021 Etienne Rossignon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
1
+ import { IBasicSession } from "node-opcua-pseudo-session";
2
+ import { Options } from "./options";
3
+ export declare function convertNamespaceTypeToTypescript(session: IBasicSession, namespaceIndex: number, options: Options): Promise<void>;
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.convertNamespaceTypeToTypescript = void 0;
13
+ const path = require("path");
14
+ const fs = require("fs");
15
+ const walk_through_1 = require("./walk_through");
16
+ const convert_to_typescript_1 = require("./convert_to_typescript");
17
+ const cache_1 = require("./private/cache");
18
+ function getPackageInfo(dependency) {
19
+ const d = path.join(__dirname, "../../" + dependency + "/package.json");
20
+ const p = JSON.parse(fs.readFileSync(d, "utf8"));
21
+ return p;
22
+ }
23
+ function convertNamespaceTypeToTypescript(session, namespaceIndex, options) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ if (namespaceIndex < 0) {
26
+ throw new Error("namespaceIndex cannot be negative");
27
+ }
28
+ const cache = yield (0, cache_1.constructCache)(session, options);
29
+ if (!fs.existsSync(options.baseFolder)) {
30
+ fs.mkdirSync(options.baseFolder);
31
+ }
32
+ const infos = {};
33
+ // walk through all Types:
34
+ const nodeVisitor = {
35
+ visit(reference, level) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (reference.nodeId.namespace !== namespaceIndex) {
38
+ return;
39
+ }
40
+ cache.resetRequire();
41
+ const { type, content, folder, module, filename, dependencies } = yield (0, convert_to_typescript_1.convertTypeToTypescript)(session, reference.nodeId, options, cache);
42
+ if (type === "basic") {
43
+ return;
44
+ }
45
+ const _f = path.dirname(folder);
46
+ if (!fs.existsSync(_f)) {
47
+ fs.mkdirSync(_f);
48
+ }
49
+ if (!fs.existsSync(folder)) {
50
+ fs.mkdirSync(folder);
51
+ }
52
+ const sourceFolder = path.join(folder, "source");
53
+ if (!fs.existsSync(sourceFolder)) {
54
+ fs.mkdirSync(sourceFolder);
55
+ }
56
+ fs.writeFileSync(path.join(sourceFolder, filename + ".ts"), content);
57
+ infos[module] = infos[module] || { folder, dependencies: [], module, files: [] };
58
+ infos[module].files.push(filename + ".ts");
59
+ infos[module].dependencies = [...new Set([...infos[module].dependencies, ...dependencies])];
60
+ });
61
+ }
62
+ };
63
+ yield (0, walk_through_1.walkThroughObjectTypes)(session, nodeVisitor);
64
+ yield (0, walk_through_1.walkThroughVariableTypes)(session, nodeVisitor);
65
+ yield (0, walk_through_1.walkThroughDataTypes)(session, nodeVisitor);
66
+ yield outputFiles(infos);
67
+ });
68
+ }
69
+ exports.convertNamespaceTypeToTypescript = convertNamespaceTypeToTypescript;
70
+ function _output_index_ts_file(info) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ const index = path.join(info.folder, "source/index.ts");
73
+ const content = [];
74
+ for (const file of info.files.sort()) {
75
+ if (file.match(/^ua_property/)) {
76
+ continue;
77
+ }
78
+ content.push(`export * from "./${file.replace(".ts", "")}";`);
79
+ }
80
+ fs.writeFileSync(index, content.join("\n"));
81
+ // create package.json
82
+ });
83
+ }
84
+ function _output_package_json(info) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ const packagejson = path.join(info.folder, "package.json");
87
+ const version = getPackageInfo("node-opcua-address-space-base").version;
88
+ const content2 = [];
89
+ content2.push(`{`);
90
+ content2.push(` "name": "${info.module}",`);
91
+ content2.push(` "version": "${version}",`);
92
+ content2.push(` "description": "",`);
93
+ content2.push(` "main": "dist/index.js",`);
94
+ content2.push(` "types": "dist/index.d.ts",`);
95
+ content2.push(` "scripts": {`);
96
+ content2.push(` "build": "tsc -b"`);
97
+ content2.push(` },`);
98
+ content2.push(` "author": "etienne.rossignon@sterfive.com",`);
99
+ content2.push(` "license": "MIT",`);
100
+ content2.push(` "dependencies": {`);
101
+ // find versions
102
+ const versions = {};
103
+ for (const dependency of info.dependencies) {
104
+ const p = yield getPackageInfo(dependency);
105
+ versions[dependency] = p.version;
106
+ }
107
+ content2.push(info.dependencies
108
+ .sort()
109
+ .map((d) => ` "${d}": "${versions[d]}"`)
110
+ .join(",\n"));
111
+ content2.push(` },`);
112
+ content2.push(` "devDependencies": {`);
113
+ content2.push(` }`);
114
+ content2.push(`}`);
115
+ fs.writeFileSync(packagejson, content2.join("\n"));
116
+ });
117
+ }
118
+ function _output_tsconfig_json(info) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ const tsconfig = path.join(info.folder, "tsconfig.json");
121
+ const content3 = [];
122
+ content3.push(`{`);
123
+ content3.push(` "extends": "../tsconfig.json",`);
124
+ content3.push(` "compilerOptions": {`);
125
+ content3.push(` "rootDir": "source",`);
126
+ content3.push(` "outDir": "dist",`);
127
+ content3.push(` "composite": true`);
128
+ content3.push(` },`);
129
+ content3.push(` "include": [`);
130
+ content3.push(` "source/*.ts",`);
131
+ content3.push(` ],`);
132
+ content3.push(` "references": [`);
133
+ // content3.push(` { "path": "../node-opcua-address-space-base" }`);
134
+ const l = [];
135
+ for (const dep of info.dependencies) {
136
+ l.push(` { "path": "../${dep}" }`);
137
+ }
138
+ content3.push(l.join(",\n"));
139
+ content3.push(` ],`);
140
+ content3.push(` "exclude": [`);
141
+ content3.push(` "node_modules",`);
142
+ content3.push(` "dist"`);
143
+ content3.push(` ]`);
144
+ content3.push(`}`);
145
+ fs.writeFileSync(tsconfig, content3.join("\n"));
146
+ });
147
+ }
148
+ function outputFiles(infos) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ for (const info of Object.values(infos)) {
151
+ // create indexes
152
+ yield _output_index_ts_file(info);
153
+ yield _output_package_json(info);
154
+ yield _output_tsconfig_json(info);
155
+ }
156
+ });
157
+ }
158
+ //# sourceMappingURL=convert_namespace_to_typescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert_namespace_to_typescript.js","sourceRoot":"","sources":["../source/convert_namespace_to_typescript.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA6B;AAC7B,yBAAyB;AAGzB,iDAAgI;AAChI,mEAAkE;AAClE,2CAAyD;AAGzD,SAAS,cAAc,CAAC,UAAkB;IACtC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,UAAU,GAAG,eAAe,CAAC,CAAC;IACxE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,CAAC;AACb,CAAC;AAOD,SAAsB,gCAAgC,CAClD,OAAsB,EACtB,cAAsB,EACtB,OAAgB;;QAEhB,IAAI,cAAc,GAAG,CAAC,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACxD;QACD,MAAM,KAAK,GAAG,MAAM,IAAA,sBAAc,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAErD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACpC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SACpC;QAED,MAAM,KAAK,GAA4B,EAAE,CAAC;QAC1C,0BAA0B;QAC1B,MAAM,WAAW,GAAG;YACV,KAAK,CAAC,SAAiC,EAAE,KAAa;;oBACxD,IAAI,SAAS,CAAC,MAAM,CAAC,SAAS,KAAK,cAAc,EAAE;wBAC/C,OAAO;qBACV;oBAED,KAAM,CAAC,YAAY,EAAE,CAAC;oBAEtB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,+CAAuB,EAC3F,OAAO,EACP,SAAS,CAAC,MAAM,EAChB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,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,CAAC;CAAA;AACD,SAAe,WAAW,CAAC,KAA8B;;QACrD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAW,EAAE;YAC/C,iBAAiB;YACjB,MAAM,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAElC,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAEjC,MAAM,qBAAqB,CAAC,IAAI,CAAC,CAAC;SACrC;IACL,CAAC;CAAA"}
@@ -0,0 +1,109 @@
1
+ import { LocalizedText, NodeClass, QualifiedName } from "node-opcua-data-model";
2
+ import { NodeId } from "node-opcua-nodeid";
3
+ import { IBasicSession } from "node-opcua-pseudo-session";
4
+ import { ReferenceDescription } from "node-opcua-types";
5
+ import { LineFile } from "node-opcua-utils";
6
+ import { DataType } from "node-opcua-variant";
7
+ import { ModellingRuleType } from "node-opcua-address-space-base";
8
+ import { Cache, Import } from "./private/cache";
9
+ import { Options } from "./options";
10
+ export declare function convertDataTypeToTypescript(session: IBasicSession, dataTypeId: NodeId): Promise<void>;
11
+ interface ClassDefinition {
12
+ nodeClass: NodeClass.VariableType | NodeClass.ObjectType;
13
+ browseName: QualifiedName;
14
+ isAbstract: boolean;
15
+ description: LocalizedText;
16
+ superType?: ReferenceDescription;
17
+ baseClassDef?: ClassDefinition | null;
18
+ children: ReferenceDescription[];
19
+ members: ClassMember[];
20
+ interfaceName: Import;
21
+ baseInterfaceName: Import | null;
22
+ dataTypeNodeId: NodeId | null;
23
+ dataType: DataType;
24
+ dataTypeName: string;
25
+ dataTypeImport?: Import[];
26
+ }
27
+ export declare function makeTypeName2(nodeClass: NodeClass, browseName: QualifiedName, suffix?: string): Import;
28
+ export declare function extractClassDefinition(session: IBasicSession, nodeId: NodeId, cache: Cache): Promise<ClassDefinition>;
29
+ interface ClassMemberBasic {
30
+ name: string;
31
+ childType: Import;
32
+ isOptional: boolean;
33
+ modellingRule: ModellingRuleType | null;
34
+ description: LocalizedText;
35
+ suffix?: string;
36
+ suffixInstantiate?: string;
37
+ chevrons: any;
38
+ typeToReference: Import[];
39
+ }
40
+ interface ClassMember extends ClassMemberBasic {
41
+ /**
42
+ * the OPCUA name of the class member
43
+ */
44
+ browseName: QualifiedName;
45
+ nodeClass: NodeClass.Object | NodeClass.Method | NodeClass.Variable;
46
+ /**
47
+ * the Typescript name of the class Member
48
+ */
49
+ name: string;
50
+ modellingRule: ModellingRuleType | null;
51
+ isOptional: boolean;
52
+ /**
53
+ * class Def
54
+ */
55
+ classDef: ClassDefinition | null;
56
+ description: LocalizedText;
57
+ typeDefinition: ReferenceDescription;
58
+ childType: Import;
59
+ children: ReferenceDescription[];
60
+ children2: ClassMemberBasic[];
61
+ dataTypeNodeId?: NodeId | null;
62
+ dataType?: DataType;
63
+ jtype?: string;
64
+ suffix?: string;
65
+ suffix2?: string;
66
+ suffix3?: string;
67
+ innerClass?: Import | null;
68
+ childBase?: Import | null;
69
+ }
70
+ interface Classified {
71
+ Mandatory: ReferenceDescription[];
72
+ Optional: ReferenceDescription[];
73
+ MandatoryPlaceholder: ReferenceDescription[];
74
+ OptionalPlaceholder: ReferenceDescription[];
75
+ ExposesItsArray: ReferenceDescription[];
76
+ }
77
+ export declare function findClassMember(session: IBasicSession, browseName: QualifiedName, baseParentDef: ClassDefinition, cache: Cache): Promise<ClassMember | null>;
78
+ export declare function checkIfShouldExposeInnerDefinition(main: Classified, instance: Classified): boolean;
79
+ interface ClassDefinitionB {
80
+ superType?: {
81
+ nodeId: NodeId;
82
+ };
83
+ interfaceName: Import;
84
+ }
85
+ export declare function extractClassMemberDef(session: IBasicSession, nodeId: NodeId, parentDef: ClassDefinitionB, cache: Cache): Promise<ClassMember>;
86
+ export declare function findUsedImport(namespaceIndex: number, cache: Cache): string[];
87
+ export declare type Type = "enum" | "basic" | "structure" | "ua";
88
+ export declare function _exportDataTypeToTypescript(session: IBasicSession, nodeId: NodeId, cache: Cache, f?: LineFile): Promise<{
89
+ type: Type;
90
+ content: string;
91
+ typeName: string;
92
+ }>;
93
+ /**
94
+ * nodeId : a DataType, ReferenceType,AObjectType, VariableType node
95
+ */
96
+ export declare function _convertTypeToTypescript(session: IBasicSession, nodeId: NodeId, cache: Cache, f?: LineFile): Promise<{
97
+ type: Type;
98
+ content: string;
99
+ typeName: string;
100
+ }>;
101
+ export declare function convertTypeToTypescript(session: IBasicSession, nodeId: NodeId, options: Options, cache?: Cache, f?: LineFile): Promise<{
102
+ type: Type;
103
+ content: string;
104
+ module: string;
105
+ folder: string;
106
+ filename: string;
107
+ dependencies: string[];
108
+ }>;
109
+ export {};