@withmarfa/core 0.0.3 → 0.0.4
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/index.d.ts +48 -8
- package/index.js +55 -54
- package/marfa-core.darwin-arm64.node +0 -0
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -21,23 +21,24 @@ export declare class MarfaCore {
|
|
|
21
21
|
/**
|
|
22
22
|
* Holds the event stream open on a thread of its own and applies each
|
|
23
23
|
* event as it arrives: `onChange` for each change, then `onEnd` once,
|
|
24
|
-
* with the error that ended it
|
|
25
|
-
* callback keeps the process alive. An
|
|
26
|
-
* follow, and `onEnd` is
|
|
24
|
+
* with the error that ended it, the same error as any call throws, or
|
|
25
|
+
* null where it was stopped. Neither callback keeps the process alive. An
|
|
26
|
+
* `onChange` that throws ends the follow, and `onEnd` is given an error
|
|
27
|
+
* whose `code` is `listener_threw` and whose message says what it threw.
|
|
27
28
|
*/
|
|
28
|
-
follow(onChange: (
|
|
29
|
+
follow(onChange: (change: Change) => void, onEnd: (error: (Error & { code: string }) | null) => void): Subscription
|
|
29
30
|
/**
|
|
30
31
|
* Opens the file at `path`, creating it when absent. `url` and `key` go
|
|
31
32
|
* together; without them only local reads work.
|
|
32
33
|
*/
|
|
33
34
|
static open(path: string, url?: string | undefined | null, key?: string | undefined | null): MarfaCore
|
|
34
35
|
/** Replaces the local copy with the declared types at `tier`. */
|
|
35
|
-
hydrate(types: Array<string>, tier: Tier): Promise<HydrateReport>
|
|
36
|
+
hydrate(types: Array<string>, tier: Tier, stop?: Stop | undefined | null): Promise<HydrateReport>
|
|
36
37
|
/**
|
|
37
38
|
* A hydration that also holds every edge of `edgeTypes` the key reads,
|
|
38
39
|
* whichever ends the copy holds.
|
|
39
40
|
*/
|
|
40
|
-
hydrateWith(types: Array<string>, tier: Tier, edgeTypes: Array<string
|
|
41
|
+
hydrateWith(types: Array<string>, tier: Tier, edgeTypes: Array<string>, stop?: Stop | undefined | null): Promise<HydrateReport>
|
|
41
42
|
/** Holds one row by id whatever the slice says of it, read now. */
|
|
42
43
|
pin(id: string): Promise<PinReport>
|
|
43
44
|
/**
|
|
@@ -46,7 +47,7 @@ export declare class MarfaCore {
|
|
|
46
47
|
*/
|
|
47
48
|
unpin(id: string): PinReport
|
|
48
49
|
/** Applies every event since the stored cursor. */
|
|
49
|
-
catchUp(): Promise<CatchUpReport>
|
|
50
|
+
catchUp(stop?: Stop | undefined | null): Promise<CatchUpReport>
|
|
50
51
|
list(filters?: ListFilters | undefined | null, sort?: Sort | undefined | null): Array<Item>
|
|
51
52
|
get(id: string): Item | null
|
|
52
53
|
edgesFrom(id: string): Array<Edge>
|
|
@@ -54,6 +55,20 @@ export declare class MarfaCore {
|
|
|
54
55
|
edgesOfType(edgeType: string): Array<Edge>
|
|
55
56
|
search(query: string, filters?: SearchFilters | undefined | null, limit?: number | undefined | null): Array<SearchHit>
|
|
56
57
|
status(): Status
|
|
58
|
+
/**
|
|
59
|
+
* Declares the types this app saves, each an object with its `id`, its
|
|
60
|
+
* `fields` and whatever else a type carries. A copy that has never
|
|
61
|
+
* reached a server checks what it queues against them and the types
|
|
62
|
+
* Marfa ships, and a hydration registers the ones the instance
|
|
63
|
+
* lacks, where the key may. The call is the app's whole set and replaces every earlier declaration.
|
|
64
|
+
*/
|
|
65
|
+
declareTypes(types: Record<string, unknown>[]): void
|
|
66
|
+
/**
|
|
67
|
+
* The declarations this copy holds, by id, with the empty `fields` and
|
|
68
|
+
* the `version` a registration needs filled in where the app left them
|
|
69
|
+
* out.
|
|
70
|
+
*/
|
|
71
|
+
declaredTypes(): Record<string, unknown>[]
|
|
57
72
|
/** Every item type the copy holds, by id, read from the copy alone. */
|
|
58
73
|
itemTypes(): Array<ItemType>
|
|
59
74
|
/** `not_found` where the catalog holds no such type. */
|
|
@@ -100,7 +115,7 @@ export declare class MarfaCore {
|
|
|
100
115
|
/** Every queued write and what became of it. */
|
|
101
116
|
queue(): Array<QueuedWrite>
|
|
102
117
|
/** Sends what the queue holds and records what came back. One pass. */
|
|
103
|
-
drain(): Promise<DrainReport>
|
|
118
|
+
drain(stop?: Stop | undefined | null): Promise<DrainReport>
|
|
104
119
|
/**
|
|
105
120
|
* Holds a file's bytes beside the working copy and queues their upload.
|
|
106
121
|
* Off the JavaScript thread, because the whole file is copied and
|
|
@@ -155,6 +170,18 @@ export declare class MarfaCore {
|
|
|
155
170
|
discard(id: string): boolean
|
|
156
171
|
}
|
|
157
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Raised to end a `hydrate`, `catchUp` or `drain` it was given to, soon
|
|
175
|
+
* after, with an error coded `canceled`. What the call had taken is
|
|
176
|
+
* consistent: a hydration left unfinished refuses reads, a catch-up keeps
|
|
177
|
+
* the cursor it reached, and a drain leaves what it had not sent queued. A
|
|
178
|
+
* raised `Stop` stays raised, so a call given one afterwards ends at once.
|
|
179
|
+
*/
|
|
180
|
+
export declare class Stop {
|
|
181
|
+
constructor()
|
|
182
|
+
raise(): void
|
|
183
|
+
}
|
|
184
|
+
|
|
158
185
|
/**
|
|
159
186
|
* A held stream, stopped by `stop` or by being collected. The follow ends
|
|
160
187
|
* within a quarter second of either, and `onEnd` is called once it has.
|
|
@@ -379,6 +406,10 @@ export interface HydrateReport {
|
|
|
379
406
|
edges: number
|
|
380
407
|
pages: number
|
|
381
408
|
cursor: string
|
|
409
|
+
/** Types the app declared that the instance did not hold and now does. */
|
|
410
|
+
registeredTypes: Array<string>
|
|
411
|
+
/** Declared types the instance did not hold and would not take. */
|
|
412
|
+
unregisteredTypes: Array<UnregisteredType>
|
|
382
413
|
}
|
|
383
414
|
|
|
384
415
|
export declare const enum Hydration {
|
|
@@ -552,6 +583,7 @@ export interface SearchHit {
|
|
|
552
583
|
item: Item
|
|
553
584
|
/** Higher is a better match. */
|
|
554
585
|
score: number
|
|
586
|
+
/** An excerpt as HTML: the text escaped and each match in `<mark>` tags. */
|
|
555
587
|
snippet: string
|
|
556
588
|
}
|
|
557
589
|
|
|
@@ -617,6 +649,14 @@ export interface TypeField {
|
|
|
617
649
|
definition: Record<string, unknown>
|
|
618
650
|
}
|
|
619
651
|
|
|
652
|
+
/** A declared type the instance refused to register, and why. */
|
|
653
|
+
export interface UnregisteredType {
|
|
654
|
+
id: string
|
|
655
|
+
/** The server's code for the refusal. */
|
|
656
|
+
code: string
|
|
657
|
+
message: string
|
|
658
|
+
}
|
|
659
|
+
|
|
620
660
|
/**
|
|
621
661
|
* What the server made of a write: one of six, and absent while the write
|
|
622
662
|
* is unanswered.
|
package/index.js
CHANGED
|
@@ -89,8 +89,8 @@ function requireNative() {
|
|
|
89
89
|
try {
|
|
90
90
|
const binding = require('@withmarfa/core-android-arm64')
|
|
91
91
|
const bindingPackageVersion = require('@withmarfa/core-android-arm64/package.json').version
|
|
92
|
-
if (bindingPackageVersion !== '0.0.
|
|
93
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
92
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
93
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
94
94
|
}
|
|
95
95
|
return binding
|
|
96
96
|
} catch (e) {
|
|
@@ -105,8 +105,8 @@ function requireNative() {
|
|
|
105
105
|
try {
|
|
106
106
|
const binding = require('@withmarfa/core-android-arm-eabi')
|
|
107
107
|
const bindingPackageVersion = require('@withmarfa/core-android-arm-eabi/package.json').version
|
|
108
|
-
if (bindingPackageVersion !== '0.0.
|
|
109
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
108
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
109
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
110
110
|
}
|
|
111
111
|
return binding
|
|
112
112
|
} catch (e) {
|
|
@@ -126,8 +126,8 @@ function requireNative() {
|
|
|
126
126
|
try {
|
|
127
127
|
const binding = require('@withmarfa/core-win32-x64-gnu')
|
|
128
128
|
const bindingPackageVersion = require('@withmarfa/core-win32-x64-gnu/package.json').version
|
|
129
|
-
if (bindingPackageVersion !== '0.0.
|
|
130
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
129
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
130
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
131
131
|
}
|
|
132
132
|
return binding
|
|
133
133
|
} catch (e) {
|
|
@@ -142,8 +142,8 @@ function requireNative() {
|
|
|
142
142
|
try {
|
|
143
143
|
const binding = require('@withmarfa/core-win32-x64-msvc')
|
|
144
144
|
const bindingPackageVersion = require('@withmarfa/core-win32-x64-msvc/package.json').version
|
|
145
|
-
if (bindingPackageVersion !== '0.0.
|
|
146
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
145
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
146
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
147
147
|
}
|
|
148
148
|
return binding
|
|
149
149
|
} catch (e) {
|
|
@@ -159,8 +159,8 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require('@withmarfa/core-win32-ia32-msvc')
|
|
161
161
|
const bindingPackageVersion = require('@withmarfa/core-win32-ia32-msvc/package.json').version
|
|
162
|
-
if (bindingPackageVersion !== '0.0.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
162
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
163
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
164
164
|
}
|
|
165
165
|
return binding
|
|
166
166
|
} catch (e) {
|
|
@@ -175,8 +175,8 @@ function requireNative() {
|
|
|
175
175
|
try {
|
|
176
176
|
const binding = require('@withmarfa/core-win32-arm64-msvc')
|
|
177
177
|
const bindingPackageVersion = require('@withmarfa/core-win32-arm64-msvc/package.json').version
|
|
178
|
-
if (bindingPackageVersion !== '0.0.
|
|
179
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
178
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
179
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
180
180
|
}
|
|
181
181
|
return binding
|
|
182
182
|
} catch (e) {
|
|
@@ -194,8 +194,8 @@ function requireNative() {
|
|
|
194
194
|
try {
|
|
195
195
|
const binding = require('@withmarfa/core-darwin-universal')
|
|
196
196
|
const bindingPackageVersion = require('@withmarfa/core-darwin-universal/package.json').version
|
|
197
|
-
if (bindingPackageVersion !== '0.0.
|
|
198
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
197
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
198
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
199
199
|
}
|
|
200
200
|
return binding
|
|
201
201
|
} catch (e) {
|
|
@@ -210,8 +210,8 @@ function requireNative() {
|
|
|
210
210
|
try {
|
|
211
211
|
const binding = require('@withmarfa/core-darwin-x64')
|
|
212
212
|
const bindingPackageVersion = require('@withmarfa/core-darwin-x64/package.json').version
|
|
213
|
-
if (bindingPackageVersion !== '0.0.
|
|
214
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
213
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
214
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
215
215
|
}
|
|
216
216
|
return binding
|
|
217
217
|
} catch (e) {
|
|
@@ -226,8 +226,8 @@ function requireNative() {
|
|
|
226
226
|
try {
|
|
227
227
|
const binding = require('@withmarfa/core-darwin-arm64')
|
|
228
228
|
const bindingPackageVersion = require('@withmarfa/core-darwin-arm64/package.json').version
|
|
229
|
-
if (bindingPackageVersion !== '0.0.
|
|
230
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
229
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
230
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
231
231
|
}
|
|
232
232
|
return binding
|
|
233
233
|
} catch (e) {
|
|
@@ -246,8 +246,8 @@ function requireNative() {
|
|
|
246
246
|
try {
|
|
247
247
|
const binding = require('@withmarfa/core-freebsd-x64')
|
|
248
248
|
const bindingPackageVersion = require('@withmarfa/core-freebsd-x64/package.json').version
|
|
249
|
-
if (bindingPackageVersion !== '0.0.
|
|
250
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
249
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
250
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
251
251
|
}
|
|
252
252
|
return binding
|
|
253
253
|
} catch (e) {
|
|
@@ -262,8 +262,8 @@ function requireNative() {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = require('@withmarfa/core-freebsd-arm64')
|
|
264
264
|
const bindingPackageVersion = require('@withmarfa/core-freebsd-arm64/package.json').version
|
|
265
|
-
if (bindingPackageVersion !== '0.0.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
265
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
266
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
267
267
|
}
|
|
268
268
|
return binding
|
|
269
269
|
} catch (e) {
|
|
@@ -283,8 +283,8 @@ function requireNative() {
|
|
|
283
283
|
try {
|
|
284
284
|
const binding = require('@withmarfa/core-linux-x64-musl')
|
|
285
285
|
const bindingPackageVersion = require('@withmarfa/core-linux-x64-musl/package.json').version
|
|
286
|
-
if (bindingPackageVersion !== '0.0.
|
|
287
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
286
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
287
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
288
288
|
}
|
|
289
289
|
return binding
|
|
290
290
|
} catch (e) {
|
|
@@ -299,8 +299,8 @@ function requireNative() {
|
|
|
299
299
|
try {
|
|
300
300
|
const binding = require('@withmarfa/core-linux-x64-gnu')
|
|
301
301
|
const bindingPackageVersion = require('@withmarfa/core-linux-x64-gnu/package.json').version
|
|
302
|
-
if (bindingPackageVersion !== '0.0.
|
|
303
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
302
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
303
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
304
304
|
}
|
|
305
305
|
return binding
|
|
306
306
|
} catch (e) {
|
|
@@ -317,8 +317,8 @@ function requireNative() {
|
|
|
317
317
|
try {
|
|
318
318
|
const binding = require('@withmarfa/core-linux-arm64-musl')
|
|
319
319
|
const bindingPackageVersion = require('@withmarfa/core-linux-arm64-musl/package.json').version
|
|
320
|
-
if (bindingPackageVersion !== '0.0.
|
|
321
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
320
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
321
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
322
322
|
}
|
|
323
323
|
return binding
|
|
324
324
|
} catch (e) {
|
|
@@ -333,8 +333,8 @@ function requireNative() {
|
|
|
333
333
|
try {
|
|
334
334
|
const binding = require('@withmarfa/core-linux-arm64-gnu')
|
|
335
335
|
const bindingPackageVersion = require('@withmarfa/core-linux-arm64-gnu/package.json').version
|
|
336
|
-
if (bindingPackageVersion !== '0.0.
|
|
337
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
336
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
337
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
338
338
|
}
|
|
339
339
|
return binding
|
|
340
340
|
} catch (e) {
|
|
@@ -351,8 +351,8 @@ function requireNative() {
|
|
|
351
351
|
try {
|
|
352
352
|
const binding = require('@withmarfa/core-linux-arm-musleabihf')
|
|
353
353
|
const bindingPackageVersion = require('@withmarfa/core-linux-arm-musleabihf/package.json').version
|
|
354
|
-
if (bindingPackageVersion !== '0.0.
|
|
355
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
354
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
355
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
356
356
|
}
|
|
357
357
|
return binding
|
|
358
358
|
} catch (e) {
|
|
@@ -367,8 +367,8 @@ function requireNative() {
|
|
|
367
367
|
try {
|
|
368
368
|
const binding = require('@withmarfa/core-linux-arm-gnueabihf')
|
|
369
369
|
const bindingPackageVersion = require('@withmarfa/core-linux-arm-gnueabihf/package.json').version
|
|
370
|
-
if (bindingPackageVersion !== '0.0.
|
|
371
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
370
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
371
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
372
372
|
}
|
|
373
373
|
return binding
|
|
374
374
|
} catch (e) {
|
|
@@ -385,8 +385,8 @@ function requireNative() {
|
|
|
385
385
|
try {
|
|
386
386
|
const binding = require('@withmarfa/core-linux-loong64-musl')
|
|
387
387
|
const bindingPackageVersion = require('@withmarfa/core-linux-loong64-musl/package.json').version
|
|
388
|
-
if (bindingPackageVersion !== '0.0.
|
|
389
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
388
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
389
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
390
390
|
}
|
|
391
391
|
return binding
|
|
392
392
|
} catch (e) {
|
|
@@ -401,8 +401,8 @@ function requireNative() {
|
|
|
401
401
|
try {
|
|
402
402
|
const binding = require('@withmarfa/core-linux-loong64-gnu')
|
|
403
403
|
const bindingPackageVersion = require('@withmarfa/core-linux-loong64-gnu/package.json').version
|
|
404
|
-
if (bindingPackageVersion !== '0.0.
|
|
405
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
404
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
405
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
406
406
|
}
|
|
407
407
|
return binding
|
|
408
408
|
} catch (e) {
|
|
@@ -419,8 +419,8 @@ function requireNative() {
|
|
|
419
419
|
try {
|
|
420
420
|
const binding = require('@withmarfa/core-linux-riscv64-musl')
|
|
421
421
|
const bindingPackageVersion = require('@withmarfa/core-linux-riscv64-musl/package.json').version
|
|
422
|
-
if (bindingPackageVersion !== '0.0.
|
|
423
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
422
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
423
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
424
424
|
}
|
|
425
425
|
return binding
|
|
426
426
|
} catch (e) {
|
|
@@ -435,8 +435,8 @@ function requireNative() {
|
|
|
435
435
|
try {
|
|
436
436
|
const binding = require('@withmarfa/core-linux-riscv64-gnu')
|
|
437
437
|
const bindingPackageVersion = require('@withmarfa/core-linux-riscv64-gnu/package.json').version
|
|
438
|
-
if (bindingPackageVersion !== '0.0.
|
|
439
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
438
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
439
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
440
440
|
}
|
|
441
441
|
return binding
|
|
442
442
|
} catch (e) {
|
|
@@ -452,8 +452,8 @@ function requireNative() {
|
|
|
452
452
|
try {
|
|
453
453
|
const binding = require('@withmarfa/core-linux-ppc64-gnu')
|
|
454
454
|
const bindingPackageVersion = require('@withmarfa/core-linux-ppc64-gnu/package.json').version
|
|
455
|
-
if (bindingPackageVersion !== '0.0.
|
|
456
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
455
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
456
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
457
457
|
}
|
|
458
458
|
return binding
|
|
459
459
|
} catch (e) {
|
|
@@ -468,8 +468,8 @@ function requireNative() {
|
|
|
468
468
|
try {
|
|
469
469
|
const binding = require('@withmarfa/core-linux-s390x-gnu')
|
|
470
470
|
const bindingPackageVersion = require('@withmarfa/core-linux-s390x-gnu/package.json').version
|
|
471
|
-
if (bindingPackageVersion !== '0.0.
|
|
472
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
471
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
472
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
473
473
|
}
|
|
474
474
|
return binding
|
|
475
475
|
} catch (e) {
|
|
@@ -488,8 +488,8 @@ function requireNative() {
|
|
|
488
488
|
try {
|
|
489
489
|
const binding = require('@withmarfa/core-openharmony-arm64')
|
|
490
490
|
const bindingPackageVersion = require('@withmarfa/core-openharmony-arm64/package.json').version
|
|
491
|
-
if (bindingPackageVersion !== '0.0.
|
|
492
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
491
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
492
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
493
493
|
}
|
|
494
494
|
return binding
|
|
495
495
|
} catch (e) {
|
|
@@ -504,8 +504,8 @@ function requireNative() {
|
|
|
504
504
|
try {
|
|
505
505
|
const binding = require('@withmarfa/core-openharmony-x64')
|
|
506
506
|
const bindingPackageVersion = require('@withmarfa/core-openharmony-x64/package.json').version
|
|
507
|
-
if (bindingPackageVersion !== '0.0.
|
|
508
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
507
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
508
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
509
509
|
}
|
|
510
510
|
return binding
|
|
511
511
|
} catch (e) {
|
|
@@ -520,8 +520,8 @@ function requireNative() {
|
|
|
520
520
|
try {
|
|
521
521
|
const binding = require('@withmarfa/core-openharmony-arm')
|
|
522
522
|
const bindingPackageVersion = require('@withmarfa/core-openharmony-arm/package.json').version
|
|
523
|
-
if (bindingPackageVersion !== '0.0.
|
|
524
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
523
|
+
if (bindingPackageVersion !== '0.0.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
524
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
525
525
|
}
|
|
526
526
|
return binding
|
|
527
527
|
} catch (e) {
|
|
@@ -661,8 +661,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
661
661
|
if (!candidateFailed) {
|
|
662
662
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
663
663
|
const bindingPackageVersion = require('@withmarfa/core-wasm32-wasi/package.json').version
|
|
664
|
-
if (bindingPackageVersion !== '0.0.
|
|
665
|
-
throw new Error(`WASI binding package version mismatch, expected 0.0.
|
|
664
|
+
if (bindingPackageVersion !== '0.0.4') {
|
|
665
|
+
throw new Error(`WASI binding package version mismatch, expected 0.0.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
wasiBinding = require('@withmarfa/core-wasm32-wasi')
|
|
@@ -779,6 +779,7 @@ function __napiStampBindingTarget(exportsObject, target) {
|
|
|
779
779
|
module.exports.__napiBindingTarget = __napiStampBindingTarget(nativeBinding, __napiLoadedBindingTarget)
|
|
780
780
|
module.exports = nativeBinding
|
|
781
781
|
module.exports.MarfaCore = nativeBinding.MarfaCore
|
|
782
|
+
module.exports.Stop = nativeBinding.Stop
|
|
782
783
|
module.exports.Subscription = nativeBinding.Subscription
|
|
783
784
|
module.exports.BlockedReason = nativeBinding.BlockedReason
|
|
784
785
|
module.exports.EdgeEnd = nativeBinding.EdgeEnd
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withmarfa/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "marfa-core as a Node module.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@napi-rs/cli": "^3",
|
|
21
|
-
"@types/node": "^
|
|
22
|
-
"typescript": "^
|
|
21
|
+
"@types/node": "^26.6.4",
|
|
22
|
+
"typescript": "^7.0.2"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"index.js",
|