node-firebird-native-api 3.1.0 → 3.1.3
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 +8 -6
- package/dist/generate-files/index.js +2 -1
- package/dist/generate-files/index.js.map +1 -1
- package/dist/generate-files/patch.js +31 -94
- package/dist/generate-files/patch.js.map +1 -1
- package/dist/lib/cloop-gen.js +8 -4
- package/dist/lib/cloop-gen.js.map +1 -1
- package/dist/lib/index.js +3 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/test/test.js +12 -16
- package/dist/test/test.js.map +1 -1
- package/package.json +8 -7
- package/src/generate-files/firebird.cloop.json +10436 -7796
- package/src/generate-files/index.ts +5 -5
- package/src/generate-files/patch.ts +148 -221
- package/src/lib/cloop-gen.ts +1494 -925
- package/src/lib/index.ts +13 -13
- package/src/native/classes.h +6 -157
- package/src/test/test.ts +537 -542
- package/tsconfig.json +7 -13
- package/tslint.json +0 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1
2
|
require('source-map-support').install();
|
|
2
3
|
|
|
3
4
|
import { generate, load } from 'node-cloop-gen';
|
|
4
5
|
import { patch } from './patch';
|
|
5
6
|
|
|
6
|
-
|
|
7
7
|
const root = process.cwd();
|
|
8
8
|
const inputFile = `${root}/src/generate-files/firebird.cloop.json`;
|
|
9
9
|
const outputCppNapi = `${root}/src/native/cloop-gen.h`;
|
|
@@ -14,8 +14,8 @@ const library = load(inputFile);
|
|
|
14
14
|
patch(library);
|
|
15
15
|
|
|
16
16
|
generate({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
library,
|
|
18
|
+
outputCppNapi,
|
|
19
|
+
outputTs,
|
|
20
|
+
namespace: 'fb',
|
|
21
21
|
});
|
|
@@ -1,229 +1,156 @@
|
|
|
1
1
|
import { Library } from 'node-cloop-gen';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
interface InterfaceConfig
|
|
5
|
-
{
|
|
6
|
-
[intf: string]: {
|
|
7
|
-
deleteMethods?: string[]
|
|
8
|
-
};
|
|
9
|
-
}
|
|
3
|
+
type InterfaceConfig = Record<string, { deleteMethods?: string[] }>;
|
|
10
4
|
|
|
11
5
|
const interfaceConfig: InterfaceConfig = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
deleteMethods: [
|
|
62
|
-
'*'
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
ExternalContext: {
|
|
67
|
-
deleteMethods: [
|
|
68
|
-
'*'
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
ExternalFunction: {
|
|
73
|
-
deleteMethods: [
|
|
74
|
-
'*'
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
ExternalProcedure: {
|
|
79
|
-
deleteMethods: [
|
|
80
|
-
'*'
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
ExternalTrigger: {
|
|
85
|
-
deleteMethods: [
|
|
86
|
-
'*'
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
TraceTransaction: {
|
|
91
|
-
deleteMethods: [
|
|
92
|
-
'*'
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
TraceParams: {
|
|
97
|
-
deleteMethods: [
|
|
98
|
-
'*'
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
TraceStatement: {
|
|
103
|
-
deleteMethods: [
|
|
104
|
-
'*'
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
TraceSQLStatement: {
|
|
109
|
-
deleteMethods: [
|
|
110
|
-
'*'
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
TraceBLRStatement: {
|
|
115
|
-
deleteMethods: [
|
|
116
|
-
'*'
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
TraceDYNRequest: {
|
|
121
|
-
deleteMethods: [
|
|
122
|
-
'*'
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
TraceContextVariable: {
|
|
127
|
-
deleteMethods: [
|
|
128
|
-
'*'
|
|
129
|
-
]
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
TraceProcedure: {
|
|
133
|
-
deleteMethods: [
|
|
134
|
-
'*'
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
TraceFunction: {
|
|
139
|
-
deleteMethods: [
|
|
140
|
-
'*'
|
|
141
|
-
]
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
TraceTrigger: {
|
|
145
|
-
deleteMethods: [
|
|
146
|
-
'*'
|
|
147
|
-
]
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
TraceServiceConnection: {
|
|
151
|
-
deleteMethods: [
|
|
152
|
-
'*'
|
|
153
|
-
]
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
TraceStatusVector: {
|
|
157
|
-
deleteMethods: [
|
|
158
|
-
'*'
|
|
159
|
-
]
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
TraceSweepInfo: {
|
|
163
|
-
deleteMethods: [
|
|
164
|
-
'*'
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
TraceLogWriter: {
|
|
169
|
-
deleteMethods: [
|
|
170
|
-
'*'
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
TraceInitInfo: {
|
|
175
|
-
deleteMethods: [
|
|
176
|
-
'*'
|
|
177
|
-
]
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
TracePlugin: {
|
|
181
|
-
deleteMethods: [
|
|
182
|
-
'*'
|
|
183
|
-
]
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
TraceFactory: {
|
|
187
|
-
deleteMethods: [
|
|
188
|
-
'*'
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
};
|
|
6
|
+
Util: {
|
|
7
|
+
deleteMethods: ['dumpBlob', 'loadBlob', 'getPerfCounters', 'formatStatus'],
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
Statement: {},
|
|
11
|
+
|
|
12
|
+
Status: {
|
|
13
|
+
deleteMethods: ['getErrors', 'getWarnings', 'setErrors', 'setErrors2', 'setWarnings', 'setWarnings2'],
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
Attachment: {
|
|
17
|
+
deleteMethods: ['getSlice', 'putSlice'],
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
Transaction: {},
|
|
21
|
+
|
|
22
|
+
Provider: {},
|
|
23
|
+
|
|
24
|
+
CryptKey: {
|
|
25
|
+
deleteMethods: ['*'],
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
DbCryptPlugin: {
|
|
29
|
+
deleteMethods: ['*'],
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
ExternalEngine: {
|
|
33
|
+
deleteMethods: ['*'],
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
ExternalContext: {
|
|
37
|
+
deleteMethods: ['*'],
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
ExternalFunction: {
|
|
41
|
+
deleteMethods: ['*'],
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
ExternalProcedure: {
|
|
45
|
+
deleteMethods: ['*'],
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
ExternalTrigger: {
|
|
49
|
+
deleteMethods: ['*'],
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
TraceTransaction: {
|
|
53
|
+
deleteMethods: ['*'],
|
|
54
|
+
},
|
|
192
55
|
|
|
56
|
+
TraceParams: {
|
|
57
|
+
deleteMethods: ['*'],
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
TraceStatement: {
|
|
61
|
+
deleteMethods: ['*'],
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
TraceSQLStatement: {
|
|
65
|
+
deleteMethods: ['*'],
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
TraceBLRStatement: {
|
|
69
|
+
deleteMethods: ['*'],
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
TraceDYNRequest: {
|
|
73
|
+
deleteMethods: ['*'],
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
TraceContextVariable: {
|
|
77
|
+
deleteMethods: ['*'],
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
TraceProcedure: {
|
|
81
|
+
deleteMethods: ['*'],
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
TraceFunction: {
|
|
85
|
+
deleteMethods: ['*'],
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
TraceTrigger: {
|
|
89
|
+
deleteMethods: ['*'],
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
TraceServiceConnection: {
|
|
93
|
+
deleteMethods: ['*'],
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
TraceStatusVector: {
|
|
97
|
+
deleteMethods: ['*'],
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
TraceSweepInfo: {
|
|
101
|
+
deleteMethods: ['*'],
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
TraceLogWriter: {
|
|
105
|
+
deleteMethods: ['*'],
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
TraceInitInfo: {
|
|
109
|
+
deleteMethods: ['*'],
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
TracePlugin: {
|
|
113
|
+
deleteMethods: ['*'],
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
TraceFactory: {
|
|
117
|
+
deleteMethods: ['*'],
|
|
118
|
+
},
|
|
119
|
+
};
|
|
193
120
|
|
|
194
121
|
export function patch(library: Library) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
122
|
+
for (const intfName in interfaceConfig) {
|
|
123
|
+
if (!Object.prototype.hasOwnProperty.call(interfaceConfig, intfName)) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const intf = library.interfacesByName[intfName];
|
|
128
|
+
const config = interfaceConfig[intfName];
|
|
129
|
+
|
|
130
|
+
for (const deleteMethod of config.deleteMethods || []) {
|
|
131
|
+
const methods = intf.methods;
|
|
132
|
+
let found = false;
|
|
133
|
+
|
|
134
|
+
for (const [index, method] of methods.entries()) {
|
|
135
|
+
if (deleteMethod == '*') {
|
|
136
|
+
methods.splice(0);
|
|
137
|
+
found = true;
|
|
138
|
+
} else if (method.name == deleteMethod) {
|
|
139
|
+
methods.splice(index, 1);
|
|
140
|
+
found = true;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (!found) {
|
|
146
|
+
console.error(`Method '${intfName}#${deleteMethod}' not found for deletion.`);
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
library.interfacesByName.Util.methodsByName.decodeDate.parameters[0].type.name = 'int';
|
|
153
|
+
library.interfacesByName.Util.methodsByName.decodeTime.parameters[0].type.name = 'int';
|
|
154
|
+
library.interfacesByName.Util.methodsByName.encodeDate.returnType.name = 'int';
|
|
155
|
+
library.interfacesByName.Util.methodsByName.encodeTime.returnType.name = 'int';
|
|
229
156
|
}
|