corba.js 0.1.6 → 0.1.8
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/README.md +3 -1
- package/lib/idl/idl.cjs +3771 -2685
- package/lib/idl/idl.cjs.map +1 -1
- package/m13-es-transformer.cjs +190 -0
- package/package.json +33 -31
- package/lib/idl/src/idl/idl-lexer.d.ts +0 -19
- package/lib/idl/src/idl/idl-node.d.ts +0 -101
- package/lib/idl/src/idl/idl-parser.d.ts +0 -3
- package/lib/idl/src/idl/idl.d.ts +0 -1
- package/lib/idl/src/idl/util.d.ts +0 -25
- package/lib/idl/src/idl/write-interface.d.ts +0 -2
- package/lib/idl/src/idl/write-skeleton.d.ts +0 -2
- package/lib/idl/src/idl/write-stub.d.ts +0 -2
- package/lib/idl/src/idl/write-value.d.ts +0 -2
- package/lib/idl/src/idl/write-valueimpl.d.ts +0 -2
- package/lib/idl/src/idl/write-valuetype.d.ts +0 -2
- package/lib/idl/src/index.d.ts +0 -5
- package/lib/idl/src/net/browser.d.ts +0 -7
- package/lib/idl/src/net/index.d.ts +0 -3
- package/lib/idl/src/net/tcp.d.ts +0 -11
- package/lib/idl/src/net/tls.d.ts +0 -24
- package/lib/idl/src/net/ws.d.ts +0 -42
- package/lib/idl/src/orb/asn1.d.ts +0 -48
- package/lib/idl/src/orb/connection.d.ts +0 -24
- package/lib/idl/src/orb/giop.d.ts +0 -276
- package/lib/idl/src/orb/index.d.ts +0 -3
- package/lib/idl/src/orb/ior.d.ts +0 -89
- package/lib/idl/src/orb/orb.d.ts +0 -143
- package/lib/idl/src/orb/protocol.d.ts +0 -6
- package/lib/idl/src/orb/uint8map.d.ts +0 -14
- package/lib/idl/src/orb/url.d.ts +0 -55
- package/lib/idl/test/access.spec.d.ts +0 -1
- package/lib/idl/test/attribute.spec.d.ts +0 -1
- package/lib/idl/test/basics.spec.d.ts +0 -1
- package/lib/idl/test/disconnect.spec.d.ts +0 -1
- package/lib/idl/test/eventtarget.spec.d.ts +0 -1
- package/lib/idl/test/fake.d.ts +0 -31
- package/lib/idl/test/giop.spec.d.ts +0 -1
- package/lib/idl/test/idl/idl.spec.d.ts +0 -1
- package/lib/idl/test/idl_module.spec.d.ts +0 -1
- package/lib/idl/test/initialreferences.spec.d.ts +0 -1
- package/lib/idl/test/net/tls.spec.d.ts +0 -1
- package/lib/idl/test/net/ws.spec.d.ts +0 -1
- package/lib/idl/test/net/wss.spec.d.ts +0 -1
- package/lib/idl/test/object_by_reference.spec.d.ts +0 -1
- package/lib/idl/test/orb/asn1.spec.d.ts +0 -1
- package/lib/idl/test/orb/url.spec.d.ts +0 -1
- package/lib/idl/test/stub.spec.d.ts +0 -1
- package/lib/idl/test/util.d.ts +0 -5
- package/lib/idl/test/valuetype.spec.d.ts +0 -1
- package/lib/src/idl/idl-lexer.d.ts +0 -19
- package/lib/src/idl/idl-lexer.js +0 -234
- package/lib/src/idl/idl-lexer.js.map +0 -1
- package/lib/src/idl/idl-node.d.ts +0 -101
- package/lib/src/idl/idl-node.js +0 -212
- package/lib/src/idl/idl-node.js.map +0 -1
- package/lib/src/idl/idl-parser.d.ts +0 -3
- package/lib/src/idl/idl-parser.js +0 -1087
- package/lib/src/idl/idl-parser.js.map +0 -1
- package/lib/src/idl/idl.d.ts +0 -1
- package/lib/src/idl/idl.js +0 -180
- package/lib/src/idl/idl.js.map +0 -1
- package/lib/src/idl/util.d.ts +0 -25
- package/lib/src/idl/util.js +0 -239
- package/lib/src/idl/util.js.map +0 -1
- package/lib/src/idl/write-interface.d.ts +0 -2
- package/lib/src/idl/write-interface.js +0 -111
- package/lib/src/idl/write-interface.js.map +0 -1
- package/lib/src/idl/write-skeleton.d.ts +0 -2
- package/lib/src/idl/write-skeleton.js +0 -116
- package/lib/src/idl/write-skeleton.js.map +0 -1
- package/lib/src/idl/write-stub.d.ts +0 -2
- package/lib/src/idl/write-stub.js +0 -116
- package/lib/src/idl/write-stub.js.map +0 -1
- package/lib/src/idl/write-value.d.ts +0 -2
- package/lib/src/idl/write-value.js +0 -205
- package/lib/src/idl/write-value.js.map +0 -1
- package/lib/src/idl/write-valueimpl.d.ts +0 -2
- package/lib/src/idl/write-valueimpl.js +0 -158
- package/lib/src/idl/write-valueimpl.js.map +0 -1
- package/lib/src/idl/write-valuetype.d.ts +0 -2
- package/lib/src/idl/write-valuetype.js +0 -98
- package/lib/src/idl/write-valuetype.js.map +0 -1
- package/lib/src/index.d.ts +0 -5
- package/lib/src/index.js +0 -6
- package/lib/src/index.js.map +0 -1
- package/lib/src/net/browser.d.ts +0 -7
- package/lib/src/net/browser.js +0 -55
- package/lib/src/net/browser.js.map +0 -1
- package/lib/src/net/index.d.ts +0 -3
- package/lib/src/net/index.js +0 -4
- package/lib/src/net/index.js.map +0 -1
- package/lib/src/net/tcp.d.ts +0 -11
- package/lib/src/net/tcp.js +0 -66
- package/lib/src/net/tcp.js.map +0 -1
- package/lib/src/net/tls.d.ts +0 -24
- package/lib/src/net/tls.js +0 -69
- package/lib/src/net/tls.js.map +0 -1
- package/lib/src/net/ws.d.ts +0 -42
- package/lib/src/net/ws.js +0 -158
- package/lib/src/net/ws.js.map +0 -1
- package/lib/src/orb/asn1.d.ts +0 -48
- package/lib/src/orb/asn1.js +0 -60
- package/lib/src/orb/asn1.js.map +0 -1
- package/lib/src/orb/connection.d.ts +0 -24
- package/lib/src/orb/connection.js +0 -19
- package/lib/src/orb/connection.js.map +0 -1
- package/lib/src/orb/giop.d.ts +0 -276
- package/lib/src/orb/giop.js +0 -1205
- package/lib/src/orb/giop.js.map +0 -1
- package/lib/src/orb/index.d.ts +0 -3
- package/lib/src/orb/index.js +0 -4
- package/lib/src/orb/index.js.map +0 -1
- package/lib/src/orb/ior.d.ts +0 -89
- package/lib/src/orb/ior.js +0 -110
- package/lib/src/orb/ior.js.map +0 -1
- package/lib/src/orb/orb.d.ts +0 -143
- package/lib/src/orb/orb.js +0 -693
- package/lib/src/orb/orb.js.map +0 -1
- package/lib/src/orb/protocol.d.ts +0 -6
- package/lib/src/orb/protocol.js +0 -2
- package/lib/src/orb/protocol.js.map +0 -1
- package/lib/src/orb/uint8map.d.ts +0 -14
- package/lib/src/orb/uint8map.js +0 -48
- package/lib/src/orb/uint8map.js.map +0 -1
- package/lib/src/orb/url.d.ts +0 -55
- package/lib/src/orb/url.js +0 -252
- package/lib/src/orb/url.js.map +0 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
const typescript = require("typescript")
|
|
2
|
+
const path = require("path")
|
|
3
|
+
const { existsSync } = require("fs")
|
|
4
|
+
const { normalize } = require("path")
|
|
5
|
+
// import * as typescript from 'typescript'
|
|
6
|
+
// import * as path from 'path'
|
|
7
|
+
// import { existsSync } from 'fs'
|
|
8
|
+
// import { normalize } from 'path'
|
|
9
|
+
|
|
10
|
+
// this transformer applies the baseUrl & paths rules from the tsconfig.json file
|
|
11
|
+
// and appends .js to imports/exports, so that the typescript compiler's output
|
|
12
|
+
// can be used directly in ES6 module workflows without additional bundlers
|
|
13
|
+
|
|
14
|
+
// how TypeScript's rootDirs, baseUrl & paths work is documented in the TypeScript
|
|
15
|
+
// source in src/compiler/moduleNameResolver.ts as follows:
|
|
16
|
+
// * if a baseUrl is given, then absolute paths will be prefixed with the baseUrl
|
|
17
|
+
// * "paths": { PATTERN: [SUBSTITUTION, ...], ... }
|
|
18
|
+
// * PATTERN and SUBSTITUTION can have 0-1 '*' (which means that we can just split at '*')
|
|
19
|
+
// * if multiple patterns match, match with the longest prefix is choosen
|
|
20
|
+
// * the * in PATTERN is to be replaced with the * in SUBSTITUTION
|
|
21
|
+
|
|
22
|
+
const transformer = (program) => (transformationContext) => (sourceFile) => {
|
|
23
|
+
|
|
24
|
+
function transformAST(node) {
|
|
25
|
+
|
|
26
|
+
if (isImportExportDeclaration(node)) {
|
|
27
|
+
|
|
28
|
+
const compilerOptions = program.getCompilerOptions()
|
|
29
|
+
|
|
30
|
+
if (compilerOptions.baseUrl &&
|
|
31
|
+
!node.moduleSpecifier.text.startsWith('.')
|
|
32
|
+
) {
|
|
33
|
+
let newModuleName = resolveBaseUrlAndPath(program, node)
|
|
34
|
+
if (newModuleName !== undefined) {
|
|
35
|
+
if (!newModuleName.endsWith(".js")) {
|
|
36
|
+
newModuleName += ".js"
|
|
37
|
+
}
|
|
38
|
+
const newModuleSpecifier = typescript.factory.createStringLiteral(newModuleName)
|
|
39
|
+
if (typescript.isImportDeclaration(node)) {
|
|
40
|
+
return typescript.factory.updateImportDeclaration(node, node.modifiers, node.importClause, newModuleSpecifier, node.assertClause)
|
|
41
|
+
} else if (typescript.isExportDeclaration(node)) {
|
|
42
|
+
return typescript.factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, node.exportClause, newModuleSpecifier, node.assertClause)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (shouldMutateModuleSpecifier(node)) {
|
|
48
|
+
const newModuleSpecifier = typescript.factory.createStringLiteral(`${node.moduleSpecifier.text}.js`)
|
|
49
|
+
if (typescript.isImportDeclaration(node)) {
|
|
50
|
+
return typescript.factory.updateImportDeclaration(node, node.modifiers, node.importClause, newModuleSpecifier, node.assertClause)
|
|
51
|
+
} else if (typescript.isExportDeclaration(node)) {
|
|
52
|
+
return typescript.factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, node.exportClause, newModuleSpecifier, node.assertClause)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return typescript.visitEachChild(node, transformAST, transformationContext)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function isImportExportDeclaration(node) {
|
|
61
|
+
return (typescript.isImportDeclaration(node) || typescript.isExportDeclaration(node))
|
|
62
|
+
&& node.moduleSpecifier !== undefined
|
|
63
|
+
&& typescript.isStringLiteral(node.moduleSpecifier)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function shouldMutateModuleSpecifier(node) {
|
|
67
|
+
// only when path is relative
|
|
68
|
+
if (!node.moduleSpecifier.text.startsWith('./') &&
|
|
69
|
+
!node.moduleSpecifier.text.startsWith('../')) {
|
|
70
|
+
return false
|
|
71
|
+
}
|
|
72
|
+
// only when module specifier has no extension
|
|
73
|
+
if (path.extname(node.moduleSpecifier.text) !== '') {
|
|
74
|
+
return false
|
|
75
|
+
}
|
|
76
|
+
return true
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return typescript.visitNode(sourceFile, transformAST)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function resolveBaseUrlAndPath(program, node) {
|
|
83
|
+
let moduleName = node.moduleSpecifier.text
|
|
84
|
+
const compilerOptions = program.getCompilerOptions()
|
|
85
|
+
if (compilerOptions?.baseUrl == undefined) {
|
|
86
|
+
return undefined
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let filename = (node?.parent?.fileName) ?? node?.original?.parent?.fileName
|
|
90
|
+
if (filename === undefined) {
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (filename.startsWith(compilerOptions.baseUrl)) {
|
|
95
|
+
|
|
96
|
+
for (let adjustedModuleName of tsPathResolver(compilerOptions, moduleName)) {
|
|
97
|
+
let found = false
|
|
98
|
+
for (let ext of ["ts", "tsx", "js", "jsx"]) {
|
|
99
|
+
const absoluteModuleName = normalize(`${compilerOptions.baseUrl}/${adjustedModuleName}.${ext}`)
|
|
100
|
+
if (existsSync(`${absoluteModuleName}`)) {
|
|
101
|
+
found = true
|
|
102
|
+
break
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!found) {
|
|
106
|
+
continue
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const relativeModuleName = fromToFile(filename.substring(compilerOptions.baseUrl.length + 1), adjustedModuleName)
|
|
110
|
+
return relativeModuleName
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function tsPathResolver(config, moduleName) {
|
|
116
|
+
if (config.baseUrl === undefined || config.paths === undefined) {
|
|
117
|
+
return [moduleName]
|
|
118
|
+
}
|
|
119
|
+
if (moduleName.charAt(0) == ".") {
|
|
120
|
+
return [moduleName]
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// find the best pattern
|
|
124
|
+
let bestPattern
|
|
125
|
+
let bestPatternsHeadLength = 0
|
|
126
|
+
|
|
127
|
+
for (let pattern in config.paths) {
|
|
128
|
+
const asterisk = pattern.indexOf("*")
|
|
129
|
+
if (asterisk !== -1) {
|
|
130
|
+
const pathHead = pattern.substring(0, asterisk)
|
|
131
|
+
const pathTail = pattern.substring(asterisk + 1)
|
|
132
|
+
if (pathHead.length > bestPatternsHeadLength &&
|
|
133
|
+
moduleName.startsWith(pathHead) &&
|
|
134
|
+
moduleName.endsWith(pathTail)
|
|
135
|
+
) {
|
|
136
|
+
bestPatternsHeadLength = pathHead.length
|
|
137
|
+
bestPattern = pattern
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
if (pattern.length >= bestPatternsHeadLength &&
|
|
141
|
+
pattern === moduleName
|
|
142
|
+
) {
|
|
143
|
+
bestPatternsHeadLength = pattern.length
|
|
144
|
+
bestPattern = moduleName
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// apply the best pattern's substitutions
|
|
150
|
+
if (bestPattern !== undefined) {
|
|
151
|
+
const asterisk = bestPattern.indexOf("*")
|
|
152
|
+
if (asterisk !== -1) {
|
|
153
|
+
const pathTail = bestPattern.substring(asterisk + 1)
|
|
154
|
+
const middle = moduleName.substring(asterisk, moduleName.length - pathTail.length)
|
|
155
|
+
const substitutions = config.paths[bestPattern]
|
|
156
|
+
return substitutions.map(substitution => {
|
|
157
|
+
const subAsterisk = substitution.indexOf("*")
|
|
158
|
+
const subHead = substitution.substring(0, subAsterisk)
|
|
159
|
+
const subTail = substitution.substring(subAsterisk + 1)
|
|
160
|
+
return `${subHead}${middle}${subTail}`
|
|
161
|
+
})
|
|
162
|
+
} else {
|
|
163
|
+
return config.paths[bestPattern]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return [moduleName]
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function fromToFile(fromFile, toFile) {
|
|
170
|
+
const fromFileParts = fromFile.split("/")
|
|
171
|
+
const toFileParts = toFile.split("/")
|
|
172
|
+
|
|
173
|
+
const maxDepth = Math.min(fromFileParts.length, toFileParts.length)
|
|
174
|
+
let equalUntilDepth = 0
|
|
175
|
+
while (equalUntilDepth < maxDepth && fromFileParts[equalUntilDepth] == toFileParts[equalUntilDepth]) {
|
|
176
|
+
++equalUntilDepth
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
let relativeModuleName = "../".repeat(fromFileParts.length - equalUntilDepth - 1) // -1 is the file itself
|
|
180
|
+
if (relativeModuleName.length == 0) {
|
|
181
|
+
relativeModuleName = "./"
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
for (; equalUntilDepth < toFileParts.length; ++equalUntilDepth) {
|
|
185
|
+
relativeModuleName += toFileParts[equalUntilDepth] + "/"
|
|
186
|
+
}
|
|
187
|
+
return relativeModuleName = relativeModuleName.substring(0, relativeModuleName.length - 1) // strip last "/"
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
module.exports = transformer
|
package/package.json
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "corba.js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Object Request Broker (ORB) and Interface Definition Language (IDL) compiler",
|
|
5
5
|
"author": "Mark-André Hopf <mhopf@mark13.org>",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"engines"
|
|
9
|
-
"npm"
|
|
10
|
-
"node"
|
|
8
|
+
"engines": {
|
|
9
|
+
"npm": ">=10.5.0",
|
|
10
|
+
"node": ">=21.7.1"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
"import": "./lib/src/orb/index.js",
|
|
15
|
+
"types": "./lib/src/orb/index.d.ts"
|
|
16
16
|
},
|
|
17
17
|
"./net/*": {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
"import": "./lib/src/net/*.js",
|
|
19
|
+
"types": "./lib/src/net/*/*.d.ts"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"typesVersions": {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
"*": {
|
|
24
|
+
"*": [
|
|
25
|
+
"lib/src/*.d.ts"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
26
28
|
},
|
|
27
29
|
"bin": {
|
|
28
30
|
"corba-idl": "./bin/corba-idl"
|
|
@@ -34,10 +36,10 @@
|
|
|
34
36
|
"scripts": {
|
|
35
37
|
"build": "npm run build:idl:build && npm run build:idl:compile && npm run build:src:compile",
|
|
36
38
|
"build:idl:build": "rollup --config rollup.config.js",
|
|
37
|
-
"build:idl:compile": "bin/corba-idl --ts-all --output-directory test/generated test/*.idl",
|
|
38
|
-
"build:src:compile": "
|
|
39
|
+
"build:idl:compile": "bin/corba-idl --ts-all --output-directory test/generated test/*.idl test/*/*.idl",
|
|
40
|
+
"build:src:compile": "tspc",
|
|
39
41
|
"test": "npm run build && NODE_EXTRA_CA_CERTS=test/x509/root/certs/root.cert.pem node --enable-source-maps ./node_modules/.bin/mocha --exit 'lib/test/**/*.spec.js'",
|
|
40
|
-
"dev:build": "npm run build:idl:build && npm run build:idl:compile &&
|
|
42
|
+
"dev:build": "npm run build:idl:build && npm run build:idl:compile && tspc --watch",
|
|
41
43
|
"dev:test": "export NODE_EXTRA_CA_CERTS=test/x509/root/certs/root.cert.pem ; if test -z \"$npm_config_file\" ; then node --enable-source-maps ./node_modules/.bin/mocha --parallel --watch 'lib/test/**/*.spec.js' ; else node --enable-source-maps ./node_modules/.bin/mocha --parallel --watch $npm_config_file; fi",
|
|
42
44
|
"omni:runs": "npm run omni:copy && ssh 192.168.1.105 'cd test-omni && make runs'",
|
|
43
45
|
"omni:runc": "npm run omni:copy && ssh 192.168.1.105 'cd test-omni && make runc'",
|
|
@@ -45,28 +47,28 @@
|
|
|
45
47
|
"mico:runs": "npm run mico:copy && ssh 192.168.1.105 'cd test-mico && make runs'",
|
|
46
48
|
"mico:runc": "npm run mico:copy && ssh 192.168.1.105 'cd test-mico && make runc'",
|
|
47
49
|
"mico:copy": "scp test/peer/mico/* 192.168.1.105:test-mico/",
|
|
48
|
-
|
|
49
50
|
"update": "npx npm-check-updates -u && npm install"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@rollup/plugin-commonjs": "^
|
|
53
|
-
"@rollup/plugin-node-resolve": "^
|
|
54
|
-
"@types/chai": "^4.3.
|
|
55
|
-
"@types/chai-as-promised": "^7.1.
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/mocha
|
|
58
|
-
"@types/
|
|
59
|
-
"@types/
|
|
60
|
-
"@
|
|
61
|
-
"
|
|
62
|
-
"chai": "^4.3.6",
|
|
53
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
54
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
55
|
+
"@types/chai": "^4.3.14",
|
|
56
|
+
"@types/chai-as-promised": "^7.1.8",
|
|
57
|
+
"@types/memorystream": "^0.3.4",
|
|
58
|
+
"@types/mocha": "^10.0.6",
|
|
59
|
+
"@types/mocha-each": "^2.0.4",
|
|
60
|
+
"@types/node": "^20.12.2",
|
|
61
|
+
"@types/websocket": "^1.0.10",
|
|
62
|
+
"chai": "^4.4.1",
|
|
63
63
|
"chai-as-promised": "^7.1.1",
|
|
64
|
-
"
|
|
64
|
+
"memorystream": "^0.3.1",
|
|
65
|
+
"mocha": "^10.4.0",
|
|
65
66
|
"mocha-each": "^2.0.1",
|
|
66
|
-
"rollup": "^
|
|
67
|
-
"rollup-plugin-typescript2": "^0.
|
|
68
|
-
"
|
|
69
|
-
"
|
|
67
|
+
"rollup": "^4.13.2",
|
|
68
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
69
|
+
"ts-node": "^10.9.2",
|
|
70
|
+
"ts-patch": "^3.1.2",
|
|
71
|
+
"typescript": "^5.4.3",
|
|
70
72
|
"websocket": "^1.0.34"
|
|
71
73
|
}
|
|
72
74
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Node } from "./idl-node";
|
|
2
|
-
export declare class Lexer {
|
|
3
|
-
data: string;
|
|
4
|
-
line: number;
|
|
5
|
-
column: number;
|
|
6
|
-
pos: number;
|
|
7
|
-
state: number;
|
|
8
|
-
text?: string;
|
|
9
|
-
tokenStack: Array<Node>;
|
|
10
|
-
static isAlpha(c: string): boolean;
|
|
11
|
-
static isDigit(c: string): boolean;
|
|
12
|
-
static isAlphaNumeric(c: string): boolean;
|
|
13
|
-
constructor(data: string);
|
|
14
|
-
eof(): boolean;
|
|
15
|
-
getc(): string;
|
|
16
|
-
ungetc(): void;
|
|
17
|
-
unlex(token: Node | undefined): void;
|
|
18
|
-
lex(): Node | undefined;
|
|
19
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export declare enum Type {
|
|
2
|
-
NONE = 0,
|
|
3
|
-
TKN_IDENTIFIER = 1,
|
|
4
|
-
TKN_TEXT = 2,
|
|
5
|
-
TKN_COLON_COLON = 3,
|
|
6
|
-
TKN_ABSTRACT = 4,
|
|
7
|
-
TKN_ANY = 5,
|
|
8
|
-
TKN_ATTRIBUTE = 6,
|
|
9
|
-
TKN_BOOLEAN = 7,
|
|
10
|
-
TKN_CASE = 8,
|
|
11
|
-
TKN_CHAR = 9,
|
|
12
|
-
TKN_COMPONENT = 10,
|
|
13
|
-
TKN_CONST = 11,
|
|
14
|
-
TKN_CONSUMES = 12,
|
|
15
|
-
TKN_CONTEXT = 13,
|
|
16
|
-
TKN_CUSTOM = 14,
|
|
17
|
-
TKN_DEFAULT = 15,
|
|
18
|
-
TKN_DOUBLE = 16,
|
|
19
|
-
TKN_EXCEPTION = 17,
|
|
20
|
-
TKN_EMITS = 18,
|
|
21
|
-
TKN_ENUM = 19,
|
|
22
|
-
TKN_EVENTTYPE = 20,
|
|
23
|
-
TKN_FACTORY = 21,
|
|
24
|
-
TKN_FALSE = 22,
|
|
25
|
-
TKN_FINDER = 23,
|
|
26
|
-
TKN_FIXED = 24,
|
|
27
|
-
TKN_FLOAT = 25,
|
|
28
|
-
TKN_GETRAISES = 26,
|
|
29
|
-
TKN_HOME = 27,
|
|
30
|
-
TKN_IMPORT = 28,
|
|
31
|
-
TKN_IN = 29,
|
|
32
|
-
TKN_INOUT = 30,
|
|
33
|
-
TKN_INTERFACE = 31,
|
|
34
|
-
TKN_LOCAL = 32,
|
|
35
|
-
TKN_LONG = 33,
|
|
36
|
-
TKN_MODULE = 34,
|
|
37
|
-
TKN_MULTIPLE = 35,
|
|
38
|
-
TKN_NATIVE = 36,
|
|
39
|
-
TKN_OBJECT = 37,
|
|
40
|
-
TKN_OCTET = 38,
|
|
41
|
-
TKN_ONEWAY = 39,
|
|
42
|
-
TKN_OUT = 40,
|
|
43
|
-
TKN_PRIMARYKEY = 41,
|
|
44
|
-
TKN_PRIVATE = 42,
|
|
45
|
-
TKN_PROVIDES = 43,
|
|
46
|
-
TKN_PUBLIC = 44,
|
|
47
|
-
TKN_PUBLISHES = 45,
|
|
48
|
-
TKN_RAISES = 46,
|
|
49
|
-
TKN_READONLY = 47,
|
|
50
|
-
TKN_SETRAISES = 48,
|
|
51
|
-
TKN_SEQUENCE = 49,
|
|
52
|
-
TKN_SHORT = 50,
|
|
53
|
-
TKN_STRING = 51,
|
|
54
|
-
TKN_STRUCT = 52,
|
|
55
|
-
TKN_SUPPORTS = 53,
|
|
56
|
-
TKN_SWITCH = 54,
|
|
57
|
-
TKN_TRUE = 55,
|
|
58
|
-
TKN_TRUNCATABLE = 56,
|
|
59
|
-
TKN_TYPEDEF = 57,
|
|
60
|
-
TKN_TYPEID = 58,
|
|
61
|
-
TKN_TYPEPREFIX = 59,
|
|
62
|
-
TKN_UNSIGNED = 60,
|
|
63
|
-
TKN_UNION = 61,
|
|
64
|
-
TKN_USES = 62,
|
|
65
|
-
TKN_VALUEBASE = 63,
|
|
66
|
-
TKN_VALUETYPE = 64,
|
|
67
|
-
TKN_VOID = 65,
|
|
68
|
-
TKN_WCHAR = 66,
|
|
69
|
-
TKN_WSTRING = 67,
|
|
70
|
-
SYN_SPECIFICATION = 68,
|
|
71
|
-
SYN_INTERFACE = 69,
|
|
72
|
-
SYN_INTERFACE_HEADER = 70,
|
|
73
|
-
SYN_INTERFACE_BODY = 71,
|
|
74
|
-
SYN_VALUE_HEADER = 72,
|
|
75
|
-
SYN_VALUE_INHERITANCE_SPEC = 73,
|
|
76
|
-
SYN_STATE_MEMBER = 74,
|
|
77
|
-
SYN_TYPE_DECLARATOR = 75,
|
|
78
|
-
SYN_DECLARATORS = 76,
|
|
79
|
-
SYN_MEMBER_LIST = 77,
|
|
80
|
-
SYN_MEMBER = 78,
|
|
81
|
-
SYN_OPERATION_DECLARATION = 79,
|
|
82
|
-
SYN_PARAMETER_DECLARATIONS = 80,
|
|
83
|
-
SYN_PARAMETER_DECLARATION = 81,
|
|
84
|
-
SYN_TYPENAME = 82,
|
|
85
|
-
SYN_LONGLONG = 83,
|
|
86
|
-
SYN_UNSIGNED_SHORT = 84,
|
|
87
|
-
SYN_UNSIGNED_LONG = 85,
|
|
88
|
-
SYN_UNSIGNED_LONGLONG = 86,
|
|
89
|
-
SYN_LONG_DOUBLE = 87
|
|
90
|
-
}
|
|
91
|
-
export declare class Node {
|
|
92
|
-
type: Type;
|
|
93
|
-
text?: string;
|
|
94
|
-
typeParent: Node | undefined;
|
|
95
|
-
child: Array<Node | undefined>;
|
|
96
|
-
constructor(type: Type, text?: string);
|
|
97
|
-
toString(): string;
|
|
98
|
-
printTree(depth?: number): void;
|
|
99
|
-
append(node: Node | undefined): void;
|
|
100
|
-
prepend(node: Node | undefined): void;
|
|
101
|
-
}
|
package/lib/idl/src/idl/idl.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import { Node } from "./idl-node";
|
|
4
|
-
export declare let filename: string;
|
|
5
|
-
export declare let filenamePrefix: string;
|
|
6
|
-
export declare let filenameLocal: string;
|
|
7
|
-
export declare function setFilename(name: string): void;
|
|
8
|
-
export declare function setFilenamePrefix(prefix: string): void;
|
|
9
|
-
export declare function setFilenameLocal(name: string): void;
|
|
10
|
-
export declare let classAttributes: Map<string, string[]>;
|
|
11
|
-
export declare function writeIndent(out: fs.WriteStream, indent: number): void;
|
|
12
|
-
export declare enum FileType {
|
|
13
|
-
NONE = 0,
|
|
14
|
-
VALUE = 1,
|
|
15
|
-
VALUETYPE = 2,
|
|
16
|
-
VALUEIMPL = 3,
|
|
17
|
-
INTERFACE = 4,
|
|
18
|
-
SKELETON = 5,
|
|
19
|
-
STUB = 6
|
|
20
|
-
}
|
|
21
|
-
export declare function typeIDLtoTS(type: Node | undefined, filetype?: FileType): string;
|
|
22
|
-
export declare function typeIDLtoGIOP(type: Node | undefined, arg?: string | undefined): string;
|
|
23
|
-
export declare function defaultValueIDLtoTS(type: Node | undefined, filetype?: FileType): string;
|
|
24
|
-
export declare function hasValueType(specification: Node): boolean;
|
|
25
|
-
export declare function hasNative(specification: Node): boolean;
|
package/lib/idl/src/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ORB } from "corba.js";
|
|
2
|
-
import { Connection } from "../orb/connection";
|
|
3
|
-
import { Protocol } from "../orb/protocol";
|
|
4
|
-
export declare class WsProtocol implements Protocol {
|
|
5
|
-
connect(orb: ORB, host: string, port: number): Promise<Connection>;
|
|
6
|
-
close(): Promise<void>;
|
|
7
|
-
}
|
package/lib/idl/src/net/tcp.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ORB } from "corba.js";
|
|
3
|
-
import { Server } from "net";
|
|
4
|
-
import { Connection } from "../orb/connection";
|
|
5
|
-
import { Protocol } from "../orb/protocol";
|
|
6
|
-
export declare class TcpProtocol implements Protocol {
|
|
7
|
-
serverSocket?: Server;
|
|
8
|
-
connect(orb: ORB, hostname: string, port: number): Promise<Connection>;
|
|
9
|
-
listen(orb: ORB, hostname: string, port: number): void;
|
|
10
|
-
close(): Promise<void>;
|
|
11
|
-
}
|
package/lib/idl/src/net/tls.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ORB } from "corba.js";
|
|
3
|
-
import { Server, TlsOptions, TLSSocket } from "tls";
|
|
4
|
-
import { Connection } from "../orb/connection";
|
|
5
|
-
import { Protocol } from "../orb/protocol";
|
|
6
|
-
export declare class TlsProtocol implements Protocol {
|
|
7
|
-
options: TlsOptions;
|
|
8
|
-
serverSocket?: Server;
|
|
9
|
-
constructor(options?: TlsOptions);
|
|
10
|
-
connect(orb: ORB, hostname: string, port: number): Promise<Connection>;
|
|
11
|
-
listen(orb: ORB, hostname: string, port: number): Promise<void>;
|
|
12
|
-
close(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export declare class TlsConnection extends Connection {
|
|
15
|
-
socket: TLSSocket;
|
|
16
|
-
constructor(socket: TLSSocket, orb: ORB);
|
|
17
|
-
get peerCertificate(): import("tls").PeerCertificate;
|
|
18
|
-
get localAddress(): string;
|
|
19
|
-
get localPort(): number;
|
|
20
|
-
get remoteAddress(): string;
|
|
21
|
-
get remotePort(): number;
|
|
22
|
-
close(): void;
|
|
23
|
-
send(buffer: ArrayBuffer): void;
|
|
24
|
-
}
|
package/lib/idl/src/net/ws.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ORB } from "corba.js";
|
|
3
|
-
import { Connection } from "../orb/connection";
|
|
4
|
-
import { Protocol } from "../orb/protocol";
|
|
5
|
-
import * as http from "http";
|
|
6
|
-
import * as https from "https";
|
|
7
|
-
import { connection as WebSocketConnection } from "websocket";
|
|
8
|
-
export declare abstract class WsProtocolBase<S extends http.Server, O extends http.ServerOptions> implements Protocol {
|
|
9
|
-
serverSocket?: S;
|
|
10
|
-
serverOptions?: O;
|
|
11
|
-
constructor(options?: O);
|
|
12
|
-
abstract getUrl(host: string, port: number): string;
|
|
13
|
-
abstract createServer(): S;
|
|
14
|
-
abstract createConnection(orb: ORB, connection: WebSocketConnection): WsConnection;
|
|
15
|
-
connect(orb: ORB, host: string, port: number): Promise<Connection>;
|
|
16
|
-
listen(orb: ORB, port: number): void;
|
|
17
|
-
close(): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
export declare class WsProtocol extends WsProtocolBase<http.Server, http.ServerOptions> {
|
|
20
|
-
createServer(): http.Server;
|
|
21
|
-
createConnection(orb: ORB, connection: WebSocketConnection): WsConnection;
|
|
22
|
-
getUrl(host: string, port: number): string;
|
|
23
|
-
}
|
|
24
|
-
export declare class WssProtocol extends WsProtocolBase<https.Server, https.ServerOptions> {
|
|
25
|
-
createServer(): https.Server;
|
|
26
|
-
createConnection(orb: ORB, connection: WebSocketConnection): WsConnection;
|
|
27
|
-
getUrl(host: string, port: number): string;
|
|
28
|
-
}
|
|
29
|
-
export declare class WsConnection extends Connection {
|
|
30
|
-
protected wsConnection: WebSocketConnection;
|
|
31
|
-
constructor(orb: ORB, connection: WebSocketConnection);
|
|
32
|
-
get localAddress(): string;
|
|
33
|
-
get localPort(): number;
|
|
34
|
-
get remoteAddress(): string;
|
|
35
|
-
get remotePort(): number;
|
|
36
|
-
close(): void;
|
|
37
|
-
send(buffer: ArrayBuffer): void;
|
|
38
|
-
}
|
|
39
|
-
export declare class WssConnection extends WsConnection {
|
|
40
|
-
constructor(orb: ORB, connection: WebSocketConnection);
|
|
41
|
-
get peerCertificate(): import("tls").PeerCertificate;
|
|
42
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export declare class ASN1Tag extends Object {
|
|
2
|
-
tagClass: number;
|
|
3
|
-
tag: number;
|
|
4
|
-
encoding: number;
|
|
5
|
-
length: number;
|
|
6
|
-
constructor();
|
|
7
|
-
constructor(tagClass: number, tag: number, encoding: number, length: number);
|
|
8
|
-
toString(): string;
|
|
9
|
-
}
|
|
10
|
-
export declare enum ASN1Encoding {
|
|
11
|
-
PRIMITIVE = 0,
|
|
12
|
-
CONSTRUCTED = 1
|
|
13
|
-
}
|
|
14
|
-
export declare enum ASN1Class {
|
|
15
|
-
UNIVERSAL = 0,
|
|
16
|
-
APPLICATION = 1,
|
|
17
|
-
CONTEXT = 2,
|
|
18
|
-
PRIVATE = 3
|
|
19
|
-
}
|
|
20
|
-
export declare enum ASN1UniversalTag {
|
|
21
|
-
EOC = 0,
|
|
22
|
-
BOOLEAN = 1,
|
|
23
|
-
INTEGER = 2,
|
|
24
|
-
BITSTRING = 3,
|
|
25
|
-
OCTETSTRING = 4,
|
|
26
|
-
NULLTAG = 5,
|
|
27
|
-
OID = 6,
|
|
28
|
-
OBJDESCRIPTOR = 7,
|
|
29
|
-
EXTERNAL = 8,
|
|
30
|
-
REAL = 9,
|
|
31
|
-
ENUMERATED = 10,
|
|
32
|
-
EMBEDDED_PDV = 11,
|
|
33
|
-
UTF8STRING = 12,
|
|
34
|
-
SEQUENCE = 16,
|
|
35
|
-
SET = 17,
|
|
36
|
-
NUMERICSTRING = 18,
|
|
37
|
-
PRINTABLESTRING = 19,
|
|
38
|
-
T61STRING = 20,
|
|
39
|
-
VIDEOTEXSTRING = 21,
|
|
40
|
-
IA5STRING = 22,
|
|
41
|
-
UTCTIME = 23,
|
|
42
|
-
GENERALIZEDTIME = 24,
|
|
43
|
-
GRAPHICSTRING = 25,
|
|
44
|
-
VISIBLESTRING = 26,
|
|
45
|
-
GENERALSTRING = 27,
|
|
46
|
-
UNIVERSALSTRING = 28,
|
|
47
|
-
BMPSTRING = 29
|
|
48
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Uint8Map } from "./uint8map";
|
|
2
|
-
import { ORB, Stub, PromiseHandler } from "./orb";
|
|
3
|
-
export declare abstract class Connection {
|
|
4
|
-
constructor(orb: ORB);
|
|
5
|
-
orb: ORB;
|
|
6
|
-
requestId: number;
|
|
7
|
-
didSendBiDirIIOP: boolean;
|
|
8
|
-
stubsById: Uint8Map<Stub>;
|
|
9
|
-
pendingReplies: Map<number, PromiseHandler>;
|
|
10
|
-
initialContextTokens: Map<BigInt, InitialContextToken>;
|
|
11
|
-
abstract get localAddress(): string;
|
|
12
|
-
abstract get localPort(): number;
|
|
13
|
-
abstract get remoteAddress(): string;
|
|
14
|
-
abstract get remotePort(): number;
|
|
15
|
-
abstract close(): void;
|
|
16
|
-
abstract send(buffer: ArrayBuffer): void;
|
|
17
|
-
}
|
|
18
|
-
declare class InitialContextToken {
|
|
19
|
-
username: string;
|
|
20
|
-
password: string;
|
|
21
|
-
target_name: string;
|
|
22
|
-
constructor(username: string, password: string, realm: string);
|
|
23
|
-
}
|
|
24
|
-
export {};
|