node-opcua-generator 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.
- package/.mocharc.yml +8 -0
- package/LICENSE +20 -0
- package/dist/factory_code_generator.d.ts +9 -0
- package/dist/factory_code_generator.js +807 -0
- package/dist/factory_code_generator.js.map +1 -0
- package/dist/generate_extension_object_code.d.ts +1 -0
- package/dist/generate_extension_object_code.js +323 -0
- package/dist/generate_extension_object_code.js.map +1 -0
- package/dist/generator.d.ts +6 -0
- package/dist/generator.js +172 -0
- package/dist/generator.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/opcua_code_generator.d.ts +1 -0
- package/dist/opcua_code_generator.js +28 -0
- package/dist/opcua_code_generator.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/line_file.d.ts +6 -0
- package/dist/utils/line_file.js +26 -0
- package/dist/utils/line_file.js.map +1 -0
- package/dist/utils/normalize_require_file.d.ts +10 -0
- package/dist/utils/normalize_require_file.js +26 -0
- package/dist/utils/normalize_require_file.js.map +1 -0
- package/dist/utils/write_func.d.ts +7 -0
- package/dist/utils/write_func.js +15 -0
- package/dist/utils/write_func.js.map +1 -0
- package/package.json +58 -0
- package/source/factory_code_generator.ts +893 -0
- package/source/generate_extension_object_code.ts +356 -0
- package/source/generator.ts +191 -0
- package/source/index.ts +6 -0
- package/source/opcua_code_generator.ts +17 -0
- package/source/utils/index.ts +2 -0
- package/source/utils/line_file.ts +23 -0
- package/source/utils/normalize_require_file.ts +21 -0
- package/source/utils/write_func.ts +18 -0
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
/* istanbul ignore file */
|
|
13
|
+
/**
|
|
14
|
+
* @module node-opcua-generator
|
|
15
|
+
*/
|
|
16
|
+
// tslint:disable:no-console
|
|
17
|
+
const generator_1 = require("./generator");
|
|
18
|
+
console.log(process.argv);
|
|
19
|
+
function main() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const className = "LocalizedText";
|
|
22
|
+
(0, generator_1.generateTypeScriptCodeFromSchema)(className);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
main()
|
|
26
|
+
.then()
|
|
27
|
+
.catch();
|
|
28
|
+
//# sourceMappingURL=opcua_code_generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opcua_code_generator.js","sourceRoot":"","sources":["../source/opcua_code_generator.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0BAA0B;AAC1B;;GAEG;AACH,4BAA4B;AAC5B,2CAA+D;AAE/D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,SAAe,IAAI;;QACf,MAAM,SAAS,GAAG,eAAe,CAAC;QAClC,IAAA,4CAAgC,EAAC,SAAS,CAAC,CAAC;IAChD,CAAC;CAAA;AAED,IAAI,EAAE;KACD,IAAI,EAAE;KACN,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./line_file"), exports);
|
|
14
|
+
__exportStar(require("./normalize_require_file"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2DAAyC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LineFile1 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-utils
|
|
6
|
+
*/
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const node_opcua_utils_1 = require("node-opcua-utils");
|
|
9
|
+
class LineFile1 extends node_opcua_utils_1.LineFile {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.write("// --------- This code has been automatically generated !!! " + new Date().toISOString());
|
|
13
|
+
this.write("/**");
|
|
14
|
+
this.write(" * @module node-opcua-types");
|
|
15
|
+
this.write(" */");
|
|
16
|
+
}
|
|
17
|
+
save(filename) {
|
|
18
|
+
(0, fs_1.writeFileSync)(filename, this.toString(), "ascii");
|
|
19
|
+
}
|
|
20
|
+
saveFormat(filename, formatter) {
|
|
21
|
+
const code = formatter(this.toString());
|
|
22
|
+
(0, fs_1.writeFileSync)(filename, code, "ascii");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.LineFile1 = LineFile1;
|
|
26
|
+
//# sourceMappingURL=line_file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line_file.js","sourceRoot":"","sources":["../../source/utils/line_file.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,2BAAmC;AACnC,uDAA4C;AAE5C,MAAa,SAAU,SAAQ,2BAAQ;IACnC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,CAAC,8DAA8D,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QACtG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IACM,IAAI,CAAC,QAAgB;QACxB,IAAA,kBAAa,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAEM,UAAU,CAAC,QAAgB,EAAE,SAAmC;QACnE,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxC,IAAA,kBAAa,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CACJ;AAhBD,8BAgBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @method normalize_require_file
|
|
3
|
+
* @param baseFolder
|
|
4
|
+
* @param fullPathToFile
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* @example:
|
|
8
|
+
* normalize_require_file("/home/bob/folder1/","/home/bob/folder1/folder2/toto.js").should.eql("./folder2/toto");
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalize_require_file(baseFolder: string, fullPathToFile: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalize_require_file = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
6
|
+
/**
|
|
7
|
+
* @method normalize_require_file
|
|
8
|
+
* @param baseFolder
|
|
9
|
+
* @param fullPathToFile
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @example:
|
|
13
|
+
* normalize_require_file("/home/bob/folder1/","/home/bob/folder1/folder2/toto.js").should.eql("./folder2/toto");
|
|
14
|
+
*/
|
|
15
|
+
function normalize_require_file(baseFolder, fullPathToFile) {
|
|
16
|
+
let localFile = path.relative(baseFolder, fullPathToFile).replace(/\\/g, "/");
|
|
17
|
+
// append ./ if necessary
|
|
18
|
+
if (localFile.substr(0, 1) !== ".") {
|
|
19
|
+
localFile = "./" + localFile;
|
|
20
|
+
}
|
|
21
|
+
// remove extension
|
|
22
|
+
localFile = localFile.substr(0, localFile.length - path.extname(localFile).length);
|
|
23
|
+
return localFile;
|
|
24
|
+
}
|
|
25
|
+
exports.normalize_require_file = normalize_require_file;
|
|
26
|
+
//# sourceMappingURL=normalize_require_file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize_require_file.js","sourceRoot":"","sources":["../../source/utils/normalize_require_file.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wHAAwH;AACxH;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,UAAkB,EAAE,cAAsB;IAC7E,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9E,yBAAyB;IACzB,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE;QAChC,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;KAChC;IACD,mBAAmB;IACnB,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACnF,OAAO,SAAS,CAAC;AACrB,CAAC;AATD,wDASC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeWrite = void 0;
|
|
4
|
+
const makeWrite = (f) => {
|
|
5
|
+
const _f = (...args) => f.write.apply(f, args);
|
|
6
|
+
_f.indent = () => {
|
|
7
|
+
/** */
|
|
8
|
+
};
|
|
9
|
+
_f.pop = () => {
|
|
10
|
+
/** */
|
|
11
|
+
};
|
|
12
|
+
return _f;
|
|
13
|
+
};
|
|
14
|
+
exports.makeWrite = makeWrite;
|
|
15
|
+
//# sourceMappingURL=write_func.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write_func.js","sourceRoot":"","sources":["../../source/utils/write_func.ts"],"names":[],"mappings":";;;AAQO,MAAM,SAAS,GAAG,CAAC,CAAY,EAAE,EAAE;IACtC,MAAM,EAAE,GAAQ,CAAC,GAAG,IAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC9D,EAAE,CAAC,MAAM,GAAG,GAAG,EAAE;QACb,MAAM;IACV,CAAC,CAAC;IACF,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE;QACV,MAAM;IACV,CAAC,CAAC;IACF,OAAO,EAAE,CAAC;AACd,CAAC,CAAC;AATW,QAAA,SAAS,aASpB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-opcua-generator",
|
|
3
|
+
"version": "2.51.0",
|
|
4
|
+
"description": "pure nodejs OPCUA SDK - module -generator",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc -b",
|
|
9
|
+
"clean": "node -e \"require('rimraf').sync('dist');\"",
|
|
10
|
+
"test": "mocha"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"chalk": "4.1.2",
|
|
14
|
+
"node-opcua-assert": "2.51.0",
|
|
15
|
+
"node-opcua-basic-types": "2.51.0",
|
|
16
|
+
"node-opcua-buffer-utils": "2.51.0",
|
|
17
|
+
"node-opcua-constants": "2.51.0",
|
|
18
|
+
"node-opcua-data-model": "2.51.0",
|
|
19
|
+
"node-opcua-data-value": "2.51.0",
|
|
20
|
+
"node-opcua-date-time": "2.51.0",
|
|
21
|
+
"node-opcua-debug": "2.51.0",
|
|
22
|
+
"node-opcua-enum": "2.51.0",
|
|
23
|
+
"node-opcua-factory": "2.51.0",
|
|
24
|
+
"node-opcua-guid": "2.51.0",
|
|
25
|
+
"node-opcua-nodeid": "2.51.0",
|
|
26
|
+
"node-opcua-numeric-range": "2.51.0",
|
|
27
|
+
"node-opcua-schemas": "2.51.0",
|
|
28
|
+
"node-opcua-status-code": "2.51.0",
|
|
29
|
+
"node-opcua-utils": "2.51.0",
|
|
30
|
+
"node-opcua-variant": "2.51.0",
|
|
31
|
+
"node-opcua-xml2json": "2.51.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"node-opcua-binary-stream": "2.51.0",
|
|
35
|
+
"node-opcua-extension-object": "2.51.0",
|
|
36
|
+
"node-opcua-packet-analyzer": "2.51.0",
|
|
37
|
+
"prettier": "^2.3.2",
|
|
38
|
+
"should": "^13.2.3",
|
|
39
|
+
"source-map-support": "^0.5.19",
|
|
40
|
+
"typescript": "4.4.2"
|
|
41
|
+
},
|
|
42
|
+
"author": "Etienne Rossignon",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git://github.com/node-opcua/node-opcua.git"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"OPCUA",
|
|
50
|
+
"opcua",
|
|
51
|
+
"m2m",
|
|
52
|
+
"iot",
|
|
53
|
+
"opc ua",
|
|
54
|
+
"internet of things"
|
|
55
|
+
],
|
|
56
|
+
"homepage": "http://node-opcua.github.io/",
|
|
57
|
+
"gitHead": "75feb111daf7ec65fa0111e4fa5beb8987fd4945"
|
|
58
|
+
}
|