yggio 0.0.6 → 0.0.15
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/benchmarks/fix.js +27 -31
- package/benchmarks/types.js +3 -3
- package/binding.d.ts +177 -80
- package/binding.js +131 -79
- package/index.d.ts +2074 -510
- package/index.js +35 -8
- package/package.json +8 -4
- package/records.js +30 -0
package/index.js
CHANGED
|
@@ -125,12 +125,32 @@ function requireNative() {
|
|
|
125
125
|
} catch (e) {
|
|
126
126
|
loadErrors.push(e)
|
|
127
127
|
}
|
|
128
|
+
try {
|
|
129
|
+
const binding = require('yggio-darwin-x64')
|
|
130
|
+
const bindingPackageVersion = require('yggio-darwin-x64/package.json').version
|
|
131
|
+
if (bindingPackageVersion !== '0.0.15' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
132
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.15 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
133
|
+
}
|
|
134
|
+
return binding
|
|
135
|
+
} catch (e) {
|
|
136
|
+
loadErrors.push(e)
|
|
137
|
+
}
|
|
128
138
|
} else if (process.arch === 'arm64') {
|
|
129
139
|
try {
|
|
130
140
|
return require('./yggio.darwin-arm64.node')
|
|
131
141
|
} catch (e) {
|
|
132
142
|
loadErrors.push(e)
|
|
133
143
|
}
|
|
144
|
+
try {
|
|
145
|
+
const binding = require('yggio-darwin-arm64')
|
|
146
|
+
const bindingPackageVersion = require('yggio-darwin-arm64/package.json').version
|
|
147
|
+
if (bindingPackageVersion !== '0.0.15' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
148
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.15 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
149
|
+
}
|
|
150
|
+
return binding
|
|
151
|
+
} catch (e) {
|
|
152
|
+
loadErrors.push(e)
|
|
153
|
+
}
|
|
134
154
|
} else {
|
|
135
155
|
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
|
136
156
|
}
|
|
@@ -167,8 +187,8 @@ function requireNative() {
|
|
|
167
187
|
try {
|
|
168
188
|
const binding = require('yggio-linux-x64-gnu')
|
|
169
189
|
const bindingPackageVersion = require('yggio-linux-x64-gnu/package.json').version
|
|
170
|
-
if (bindingPackageVersion !== '0.0.
|
|
171
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
190
|
+
if (bindingPackageVersion !== '0.0.15' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
191
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.15 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
192
|
}
|
|
173
193
|
return binding
|
|
174
194
|
} catch (e) {
|
|
@@ -191,8 +211,8 @@ function requireNative() {
|
|
|
191
211
|
try {
|
|
192
212
|
const binding = require('yggio-linux-arm64-gnu')
|
|
193
213
|
const bindingPackageVersion = require('yggio-linux-arm64-gnu/package.json').version
|
|
194
|
-
if (bindingPackageVersion !== '0.0.
|
|
195
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
214
|
+
if (bindingPackageVersion !== '0.0.15' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
215
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.15 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
196
216
|
}
|
|
197
217
|
return binding
|
|
198
218
|
} catch (e) {
|
|
@@ -490,12 +510,8 @@ module.exports.FileHandler = nativeBinding.FileHandler
|
|
|
490
510
|
module.exports.JsFileHandler = nativeBinding.JsFileHandler
|
|
491
511
|
module.exports.Filter = nativeBinding.Filter
|
|
492
512
|
module.exports.JsFilter = nativeBinding.JsFilter
|
|
493
|
-
module.exports.FixCodec = nativeBinding.FixCodec
|
|
494
|
-
module.exports.JsFixCodec = nativeBinding.JsFixCodec
|
|
495
513
|
module.exports.FixFieldIterator = nativeBinding.FixFieldIterator
|
|
496
514
|
module.exports.JsFixFieldIterator = nativeBinding.JsFixFieldIterator
|
|
497
|
-
module.exports.FixMessages = nativeBinding.FixMessages
|
|
498
|
-
module.exports.JsFixMessages = nativeBinding.JsFixMessages
|
|
499
515
|
module.exports.FixRegistry = nativeBinding.FixRegistry
|
|
500
516
|
module.exports.JsFixRegistry = nativeBinding.JsFixRegistry
|
|
501
517
|
module.exports.Formatter = nativeBinding.Formatter
|
|
@@ -532,6 +548,10 @@ module.exports.ManifestFile = nativeBinding.ManifestFile
|
|
|
532
548
|
module.exports.JsManifestFile = nativeBinding.JsManifestFile
|
|
533
549
|
module.exports.MarketMessage = nativeBinding.MarketMessage
|
|
534
550
|
module.exports.JsMarketMessage = nativeBinding.JsMarketMessage
|
|
551
|
+
module.exports.MarketMessages = nativeBinding.MarketMessages
|
|
552
|
+
module.exports.JsMarketMessages = nativeBinding.JsMarketMessages
|
|
553
|
+
module.exports.MarketMessagesOptions = nativeBinding.MarketMessagesOptions
|
|
554
|
+
module.exports.JsMarketMessagesOptions = nativeBinding.JsMarketMessagesOptions
|
|
535
555
|
module.exports.MediaType = nativeBinding.MediaType
|
|
536
556
|
module.exports.JsMediaType = nativeBinding.JsMediaType
|
|
537
557
|
module.exports.Mic = nativeBinding.Mic
|
|
@@ -630,6 +650,8 @@ module.exports.TxHash = nativeBinding.TxHash
|
|
|
630
650
|
module.exports.JsTxHash = nativeBinding.JsTxHash
|
|
631
651
|
module.exports.TxHasher = nativeBinding.TxHasher
|
|
632
652
|
module.exports.JsTxHasher = nativeBinding.JsTxHasher
|
|
653
|
+
module.exports.Underlyings = nativeBinding.Underlyings
|
|
654
|
+
module.exports.JsUnderlyings = nativeBinding.JsUnderlyings
|
|
633
655
|
module.exports.Uri = nativeBinding.Uri
|
|
634
656
|
module.exports.JsUri = nativeBinding.JsUri
|
|
635
657
|
module.exports.Url = nativeBinding.Url
|
|
@@ -662,8 +684,13 @@ module.exports.fixLegalEntityField = nativeBinding.fixLegalEntityField
|
|
|
662
684
|
module.exports.fixMicEntryField = nativeBinding.fixMicEntryField
|
|
663
685
|
module.exports.fixPluginField = nativeBinding.fixPluginField
|
|
664
686
|
module.exports.fixPluginSide = nativeBinding.fixPluginSide
|
|
687
|
+
module.exports.fixRegistryField = nativeBinding.fixRegistryField
|
|
688
|
+
module.exports.fixReports = nativeBinding.fixReports
|
|
689
|
+
module.exports.fixRules = nativeBinding.fixRules
|
|
665
690
|
module.exports.fixUnderlyingField = nativeBinding.fixUnderlyingField
|
|
666
691
|
module.exports.marketDataTypeFixCode = nativeBinding.marketDataTypeFixCode
|
|
667
692
|
module.exports.marketDataTypeFromFix = nativeBinding.marketDataTypeFromFix
|
|
668
693
|
module.exports.timeInForceFixCode = nativeBinding.timeInForceFixCode
|
|
669
694
|
module.exports.timeInForceFromFix = nativeBinding.timeInForceFromFix
|
|
695
|
+
module.exports.ai = nativeBinding.ai
|
|
696
|
+
module.exports.distance = nativeBinding.distance
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yggio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Native Yggio schemas, fields, Arrow interop, URIs, and structured codecs for Node.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -64,7 +64,9 @@
|
|
|
64
64
|
"binaryName": "yggio",
|
|
65
65
|
"targets": [
|
|
66
66
|
"x86_64-unknown-linux-gnu",
|
|
67
|
-
"aarch64-unknown-linux-gnu"
|
|
67
|
+
"aarch64-unknown-linux-gnu",
|
|
68
|
+
"x86_64-apple-darwin",
|
|
69
|
+
"aarch64-apple-darwin"
|
|
68
70
|
]
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
@@ -73,7 +75,9 @@
|
|
|
73
75
|
"typescript": "^5.9.2"
|
|
74
76
|
},
|
|
75
77
|
"optionalDependencies": {
|
|
76
|
-
"yggio-
|
|
77
|
-
"yggio-
|
|
78
|
+
"yggio-darwin-arm64": "0.0.15",
|
|
79
|
+
"yggio-darwin-x64": "0.0.15",
|
|
80
|
+
"yggio-linux-arm64-gnu": "0.0.15",
|
|
81
|
+
"yggio-linux-x64-gnu": "0.0.15"
|
|
78
82
|
}
|
|
79
83
|
}
|
package/records.js
CHANGED
|
@@ -103,6 +103,11 @@ function installRecords({
|
|
|
103
103
|
throw new TypeError('native binding is missing BatchReader._nextIpcNative')
|
|
104
104
|
}
|
|
105
105
|
delete BatchReader.prototype._nextIpcNative
|
|
106
|
+
const nextIpcAsync = BatchReader.prototype._nextIpcAsyncNative
|
|
107
|
+
if (typeof nextIpcAsync !== 'function') {
|
|
108
|
+
throw new TypeError('native binding is missing BatchReader._nextIpcAsyncNative')
|
|
109
|
+
}
|
|
110
|
+
delete BatchReader.prototype._nextIpcAsyncNative
|
|
106
111
|
const chainIpcPull = BatchReader.prototype._chainIpcPullNative
|
|
107
112
|
if (typeof chainIpcPull !== 'function') {
|
|
108
113
|
throw new TypeError('native binding is missing BatchReader._chainIpcPullNative')
|
|
@@ -845,6 +850,10 @@ function installRecords({
|
|
|
845
850
|
return value === undefined || value === null ? value : intoField(value)
|
|
846
851
|
}
|
|
847
852
|
|
|
853
|
+
// One native pull, two doors: `_nextIpcNative` pulls on this thread and
|
|
854
|
+
// `_nextIpcAsyncNative` the same pull on the libuv pool. Both read one
|
|
855
|
+
// shared reader slot, so the sync and async iterators are the same stream
|
|
856
|
+
// and a pull in flight refuses the other door rather than racing it.
|
|
848
857
|
Object.defineProperties(BatchReader.prototype, {
|
|
849
858
|
// Iterating a reader is what consuming a stream means everywhere else.
|
|
850
859
|
[Symbol.iterator]: {
|
|
@@ -857,6 +866,27 @@ function installRecords({
|
|
|
857
866
|
}
|
|
858
867
|
},
|
|
859
868
|
},
|
|
869
|
+
// `for await` pulls each batch off the event loop and decodes it here.
|
|
870
|
+
[Symbol.asyncIterator]: {
|
|
871
|
+
configurable: true,
|
|
872
|
+
value: async function* batches() {
|
|
873
|
+
for await (const encoded of this.ipcBatches()) {
|
|
874
|
+
yield recordBatchFromIPC(encoded)
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
},
|
|
878
|
+
// Each batch as the Arrow IPC stream the core encoded it to - schema,
|
|
879
|
+
// batch, end of stream - for a server to forward undecoded.
|
|
880
|
+
ipcBatches: {
|
|
881
|
+
configurable: true,
|
|
882
|
+
value: async function* ipcBatches() {
|
|
883
|
+
for (;;) {
|
|
884
|
+
const encoded = await Reflect.apply(nextIpcAsync, this, [])
|
|
885
|
+
if (encoded === null) return
|
|
886
|
+
yield encoded
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
},
|
|
860
890
|
intoTable: {
|
|
861
891
|
configurable: true,
|
|
862
892
|
value() {
|