@withmarfa/core 0.0.2 → 0.0.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/index.d.ts +227 -9
- package/index.js +57 -54
- package/marfa-core.darwin-arm64.node +0 -0
- package/package.json +1 -2
package/index.d.ts
CHANGED
|
@@ -33,14 +33,35 @@ export declare class MarfaCore {
|
|
|
33
33
|
static open(path: string, url?: string | undefined | null, key?: string | undefined | null): MarfaCore
|
|
34
34
|
/** Replaces the local copy with the declared types at `tier`. */
|
|
35
35
|
hydrate(types: Array<string>, tier: Tier): Promise<HydrateReport>
|
|
36
|
+
/**
|
|
37
|
+
* A hydration that also holds every edge of `edgeTypes` the key reads,
|
|
38
|
+
* whichever ends the copy holds.
|
|
39
|
+
*/
|
|
40
|
+
hydrateWith(types: Array<string>, tier: Tier, edgeTypes: Array<string>): Promise<HydrateReport>
|
|
41
|
+
/** Holds one row by id whatever the slice says of it, read now. */
|
|
42
|
+
pin(id: string): Promise<PinReport>
|
|
43
|
+
/**
|
|
44
|
+
* Stops holding a row by id; one the slice does not take goes, unless
|
|
45
|
+
* writes to it still wait.
|
|
46
|
+
*/
|
|
47
|
+
unpin(id: string): PinReport
|
|
36
48
|
/** Applies every event since the stored cursor. */
|
|
37
49
|
catchUp(): Promise<CatchUpReport>
|
|
38
50
|
list(filters?: ListFilters | undefined | null, sort?: Sort | undefined | null): Array<Item>
|
|
39
51
|
get(id: string): Item | null
|
|
40
52
|
edgesFrom(id: string): Array<Edge>
|
|
41
53
|
edgesTo(id: string): Array<Edge>
|
|
54
|
+
edgesOfType(edgeType: string): Array<Edge>
|
|
42
55
|
search(query: string, filters?: SearchFilters | undefined | null, limit?: number | undefined | null): Array<SearchHit>
|
|
43
56
|
status(): Status
|
|
57
|
+
/** Every item type the copy holds, by id, read from the copy alone. */
|
|
58
|
+
itemTypes(): Array<ItemType>
|
|
59
|
+
/** `not_found` where the catalog holds no such type. */
|
|
60
|
+
itemType(id: string): ItemType
|
|
61
|
+
/** Every edge type the copy holds, by id, read from the copy alone. */
|
|
62
|
+
edgeTypes(): Array<EdgeType>
|
|
63
|
+
/** `not_found` where the catalog holds no such edge type. */
|
|
64
|
+
edgeType(id: string): EdgeType
|
|
44
65
|
/**
|
|
45
66
|
* Which handle this process holds: the one that may write, or a second
|
|
46
67
|
* opener that reads and refuses every write.
|
|
@@ -114,8 +135,24 @@ export declare class MarfaCore {
|
|
|
114
135
|
release(id: string): boolean
|
|
115
136
|
/** Releases every write blocked for one reason, and says how many. */
|
|
116
137
|
releaseReason(reason: BlockedReason): number
|
|
117
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* Takes a write blocked `ancestor_unavailable` or `conflict_unresolved`
|
|
140
|
+
* out of the queue, and puts the copy back to what the server holds;
|
|
141
|
+
* each write held for it is refused unsent. Answers whether the row was
|
|
142
|
+
* one a withdraw takes.
|
|
143
|
+
*/
|
|
144
|
+
withdraw(id: string): boolean
|
|
145
|
+
/**
|
|
146
|
+
* Clears the writes the server has answered, and says how many went. A
|
|
147
|
+
* refused write that carried content stays until it is discarded.
|
|
148
|
+
*/
|
|
118
149
|
forgetAnswered(): number
|
|
150
|
+
/**
|
|
151
|
+
* Takes a refused write out of the queue, with the content it carried.
|
|
152
|
+
* Answers whether the row was one a discard takes: refused, and with no
|
|
153
|
+
* write still waiting on it.
|
|
154
|
+
*/
|
|
155
|
+
discard(id: string): boolean
|
|
119
156
|
}
|
|
120
157
|
|
|
121
158
|
/**
|
|
@@ -161,14 +198,20 @@ export interface CatchUpReport {
|
|
|
161
198
|
}
|
|
162
199
|
|
|
163
200
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
201
|
+
* What a held stream changed in the copy: an event it applied, named by the
|
|
202
|
+
* event's type with the item or edge it was about, or `catalog.changed`,
|
|
203
|
+
* naming neither, where a stream it opened read a catalog that differs from
|
|
204
|
+
* the one held. Or what became of the server: `server.unreachable`, with
|
|
205
|
+
* `reason`, once when a stream cannot be had, and `server.reachable` once
|
|
206
|
+
* when one is had again, which is when to drain what waited. `cursor` is
|
|
207
|
+
* the cursor held after it.
|
|
166
208
|
*/
|
|
167
209
|
export interface Change {
|
|
168
210
|
event: string
|
|
169
211
|
itemId?: string
|
|
170
212
|
edgeId?: string
|
|
171
213
|
cursor: string
|
|
214
|
+
reason?: string
|
|
172
215
|
}
|
|
173
216
|
|
|
174
217
|
/** A create, before it is queued. */
|
|
@@ -191,10 +234,36 @@ export interface Draft {
|
|
|
191
234
|
|
|
192
235
|
/** What a drain did. */
|
|
193
236
|
export interface DrainReport {
|
|
194
|
-
|
|
237
|
+
/** Writes the server answered this drain, whatever it answered. */
|
|
238
|
+
answered: number
|
|
195
239
|
held: number
|
|
240
|
+
/**
|
|
241
|
+
* Writes it could not deliver, each still waiting, uncounted, for the
|
|
242
|
+
* next drain.
|
|
243
|
+
*/
|
|
244
|
+
undelivered: number
|
|
245
|
+
/**
|
|
246
|
+
* Writes it gave a verdict without sending them: refused for a write
|
|
247
|
+
* they waited on or for bytes no longer held, or settled by another
|
|
248
|
+
* write's answer.
|
|
249
|
+
*/
|
|
250
|
+
unsent: number
|
|
251
|
+
/**
|
|
252
|
+
* Writes whose request could not be made: each is counted against its
|
|
253
|
+
* write and waits for the next drain, or is dead at the ceiling. The
|
|
254
|
+
* writes a refused credential parks are counted in `stopped`.
|
|
255
|
+
*/
|
|
256
|
+
unmade: number
|
|
257
|
+
/**
|
|
258
|
+
* Why the drain ended before the queue was through: the server could
|
|
259
|
+
* not be reached, failed, or asked to be left alone for a while.
|
|
260
|
+
*/
|
|
261
|
+
unavailable?: string
|
|
196
262
|
verdicts: Array<DrainVerdict>
|
|
197
|
-
/**
|
|
263
|
+
/**
|
|
264
|
+
* Why the drain stopped: the server refused the credential, and every
|
|
265
|
+
* write waits until it is replaced.
|
|
266
|
+
*/
|
|
198
267
|
stopped?: string
|
|
199
268
|
/**
|
|
200
269
|
* The sources the server said this credential's key does not claim,
|
|
@@ -205,11 +274,13 @@ export interface DrainReport {
|
|
|
205
274
|
retryAfterSeconds?: number
|
|
206
275
|
}
|
|
207
276
|
|
|
208
|
-
/** What became of one write a drain sent. */
|
|
277
|
+
/** What became of one write a drain answered, sent or not. */
|
|
209
278
|
export interface DrainVerdict {
|
|
210
279
|
id: string
|
|
211
280
|
kind: WriteKind
|
|
281
|
+
/** An edge write's source; otherwise the row written to. */
|
|
212
282
|
itemId?: string
|
|
283
|
+
edgeId?: string
|
|
213
284
|
verdict?: Verdict
|
|
214
285
|
refusals: number
|
|
215
286
|
/**
|
|
@@ -245,6 +316,28 @@ export interface EdgeEdit {
|
|
|
245
316
|
baseVersion?: number
|
|
246
317
|
}
|
|
247
318
|
|
|
319
|
+
/** The end of an edge whose file writes it. */
|
|
320
|
+
export declare const enum EdgeEnd {
|
|
321
|
+
Source = 'source',
|
|
322
|
+
Target = 'target',
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/** An edge type as the copy holds it. */
|
|
326
|
+
export interface EdgeType {
|
|
327
|
+
id: string
|
|
328
|
+
label?: string
|
|
329
|
+
description?: string
|
|
330
|
+
cardinality: string
|
|
331
|
+
/** The name the edge goes by read from its target. */
|
|
332
|
+
reverseName?: string
|
|
333
|
+
writtenAt: EdgeEnd
|
|
334
|
+
sourceTypeConstraints: Array<string>
|
|
335
|
+
targetTypeConstraints: Array<string>
|
|
336
|
+
cascadeOnDelete: string
|
|
337
|
+
properties: Array<TypeField>
|
|
338
|
+
shipped: boolean
|
|
339
|
+
}
|
|
340
|
+
|
|
248
341
|
/** A change to an item, and the version it was read at. */
|
|
249
342
|
export interface Edit {
|
|
250
343
|
/** Whole field values; a device never merges inside a field. */
|
|
@@ -255,6 +348,23 @@ export interface Edit {
|
|
|
255
348
|
sourceId?: string
|
|
256
349
|
}
|
|
257
350
|
|
|
351
|
+
export interface FieldRefusal {
|
|
352
|
+
field: string
|
|
353
|
+
message: string
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** What a missing grant is on. */
|
|
357
|
+
export declare const enum GrantKind {
|
|
358
|
+
Type = 'type',
|
|
359
|
+
EdgeType = 'edge_type',
|
|
360
|
+
Extension = 'extension',
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export declare const enum GrantLevel {
|
|
364
|
+
Read = 'read',
|
|
365
|
+
Write = 'write',
|
|
366
|
+
}
|
|
367
|
+
|
|
258
368
|
/** Which handle this process holds on the store. */
|
|
259
369
|
export declare const enum Handle {
|
|
260
370
|
Writer = 'writer',
|
|
@@ -264,6 +374,7 @@ export declare const enum Handle {
|
|
|
264
374
|
export interface HydrateReport {
|
|
265
375
|
types: Array<string>
|
|
266
376
|
tier: Tier
|
|
377
|
+
edgeTypes: Array<string>
|
|
267
378
|
items: number
|
|
268
379
|
edges: number
|
|
269
380
|
pages: number
|
|
@@ -300,6 +411,21 @@ export declare const enum ItemState {
|
|
|
300
411
|
Revoked = 'revoked',
|
|
301
412
|
}
|
|
302
413
|
|
|
414
|
+
/** An item type as the copy holds it, with the fields it inherits. */
|
|
415
|
+
export interface ItemType {
|
|
416
|
+
id: string
|
|
417
|
+
label?: string
|
|
418
|
+
description?: string
|
|
419
|
+
parent?: string
|
|
420
|
+
version: number
|
|
421
|
+
fields: Array<TypeField>
|
|
422
|
+
titleField?: string
|
|
423
|
+
bodyField?: string
|
|
424
|
+
linkField?: string
|
|
425
|
+
roles: Array<string>
|
|
426
|
+
compatibleWith: Array<string>
|
|
427
|
+
}
|
|
428
|
+
|
|
303
429
|
/**
|
|
304
430
|
* Narrowing for a list. Leaving `state` unset answers the active state, as
|
|
305
431
|
* the server does; `allStates` lifts that, and a named state wins.
|
|
@@ -312,10 +438,36 @@ export interface ListFilters {
|
|
|
312
438
|
tags?: Array<string>
|
|
313
439
|
occurredAfter?: string
|
|
314
440
|
occurredBefore?: string
|
|
441
|
+
/**
|
|
442
|
+
* An expression in the server's listing grammar, answered as the server
|
|
443
|
+
* answers `filter` and refused `validation_error` where it refuses it.
|
|
444
|
+
* A `backref` condition is refused `invalid`.
|
|
445
|
+
*/
|
|
446
|
+
filter?: string
|
|
447
|
+
/**
|
|
448
|
+
* An item id: that item and every item it reaches along `parent-of`
|
|
449
|
+
* edges, as far as the copy holds them.
|
|
450
|
+
*/
|
|
451
|
+
beneath?: string
|
|
315
452
|
limit?: number
|
|
316
453
|
offset?: number
|
|
317
454
|
}
|
|
318
455
|
|
|
456
|
+
export interface MissingGrant {
|
|
457
|
+
kind: GrantKind
|
|
458
|
+
/** The type or edge type id, or the extension namespace. */
|
|
459
|
+
name: string
|
|
460
|
+
level: GrantLevel
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/** What a pin or an unpin answers. */
|
|
464
|
+
export interface PinReport {
|
|
465
|
+
/** Whether the row is pinned now. */
|
|
466
|
+
pinned: boolean
|
|
467
|
+
/** Whether it was pinned before the call. */
|
|
468
|
+
wasPinned: boolean
|
|
469
|
+
}
|
|
470
|
+
|
|
319
471
|
/** One queued write and what became of it. */
|
|
320
472
|
export interface QueuedWrite {
|
|
321
473
|
id: string
|
|
@@ -336,7 +488,18 @@ export interface QueuedWrite {
|
|
|
336
488
|
* out after and is not refused with.
|
|
337
489
|
*/
|
|
338
490
|
follows?: string
|
|
491
|
+
/** Absent while the server has not answered it. */
|
|
339
492
|
verdict?: Verdict
|
|
493
|
+
/**
|
|
494
|
+
* Held behind a write that has no answer yet: `depends_on` and
|
|
495
|
+
* `follows` say which.
|
|
496
|
+
*/
|
|
497
|
+
waiting: boolean
|
|
498
|
+
/**
|
|
499
|
+
* The body the write sends, or sent: a refused write's content stays
|
|
500
|
+
* readable here until it is discarded.
|
|
501
|
+
*/
|
|
502
|
+
body: Record<string, unknown>
|
|
340
503
|
/** The server's answer, whole, as it arrived. */
|
|
341
504
|
answer?: string
|
|
342
505
|
refusals: number
|
|
@@ -344,15 +507,45 @@ export interface QueuedWrite {
|
|
|
344
507
|
answeredAt?: string
|
|
345
508
|
}
|
|
346
509
|
|
|
510
|
+
/** Why the server, or the drain for a write it never sent, refused a write. */
|
|
511
|
+
export interface Refusal {
|
|
512
|
+
/**
|
|
513
|
+
* The server's code verbatim, or the sentence naming the write this one
|
|
514
|
+
* waited on where that write was refused.
|
|
515
|
+
*/
|
|
516
|
+
reason: string
|
|
517
|
+
/** The code in the server's envelope, where the server refused it. */
|
|
518
|
+
code?: string
|
|
519
|
+
message?: string
|
|
520
|
+
/** Each property the server would not take, and why. */
|
|
521
|
+
fields: Array<FieldRefusal>
|
|
522
|
+
/** The row the write named is in the bin, and can be restored. */
|
|
523
|
+
trashed: boolean
|
|
524
|
+
/** The permission the credential's key lacks, where the refusal names one. */
|
|
525
|
+
grant?: MissingGrant
|
|
526
|
+
}
|
|
527
|
+
|
|
347
528
|
/**
|
|
348
529
|
* Narrowing for a search: the state rule a list takes, a type with its
|
|
349
|
-
* subtree,
|
|
530
|
+
* subtree, tags, a listing-grammar expression and `beneath`, each read as
|
|
531
|
+
* the list reads it.
|
|
350
532
|
*/
|
|
351
533
|
export interface SearchFilters {
|
|
352
534
|
state?: ItemState
|
|
353
535
|
allStates?: boolean
|
|
354
536
|
type?: string
|
|
355
537
|
tags?: Array<string>
|
|
538
|
+
/**
|
|
539
|
+
* An expression in the server's listing grammar, answered as the server
|
|
540
|
+
* answers `filter` and refused `validation_error` where it refuses it.
|
|
541
|
+
* A `backref` condition is refused `invalid`.
|
|
542
|
+
*/
|
|
543
|
+
filter?: string
|
|
544
|
+
/**
|
|
545
|
+
* An item id: that item and every item it reaches along `parent-of`
|
|
546
|
+
* edges, as far as the copy holds them.
|
|
547
|
+
*/
|
|
548
|
+
beneath?: string
|
|
356
549
|
}
|
|
357
550
|
|
|
358
551
|
export interface SearchHit {
|
|
@@ -380,12 +573,21 @@ export declare const enum SortField {
|
|
|
380
573
|
|
|
381
574
|
export interface Status {
|
|
382
575
|
serverOrigin?: string
|
|
576
|
+
/** The instance the copy was hydrated from. */
|
|
577
|
+
instanceId?: string
|
|
383
578
|
sliceTypes: Array<string>
|
|
384
579
|
sliceTier?: Tier
|
|
580
|
+
sliceEdgeTypes: Array<string>
|
|
581
|
+
pinned: Array<string>
|
|
385
582
|
eventCursor?: string
|
|
386
583
|
hydration: Hydration
|
|
387
584
|
items: number
|
|
388
585
|
edges: number
|
|
586
|
+
/**
|
|
587
|
+
* Moves each time a refresh changes the catalog; absent where the copy
|
|
588
|
+
* has never held one.
|
|
589
|
+
*/
|
|
590
|
+
catalogVersion?: number
|
|
389
591
|
}
|
|
390
592
|
|
|
391
593
|
/** An item's thumbnail: the image's type and its bytes. */
|
|
@@ -399,6 +601,22 @@ export declare const enum Tier {
|
|
|
399
601
|
Feed = 'feed',
|
|
400
602
|
}
|
|
401
603
|
|
|
604
|
+
/** A field of an item type, or a property of an edge type. */
|
|
605
|
+
export interface TypeField {
|
|
606
|
+
name: string
|
|
607
|
+
/** The field's own type, such as `string` or `thumbnail`. */
|
|
608
|
+
type: string
|
|
609
|
+
required: boolean
|
|
610
|
+
description?: string
|
|
611
|
+
/**
|
|
612
|
+
* The type that declares it: the type itself, or the nearest one it
|
|
613
|
+
* inherits the field from.
|
|
614
|
+
*/
|
|
615
|
+
declaredBy: string
|
|
616
|
+
/** The definition whole, as the server answers it. */
|
|
617
|
+
definition: Record<string, unknown>
|
|
618
|
+
}
|
|
619
|
+
|
|
402
620
|
/**
|
|
403
621
|
* What the server made of a write: one of six, and absent while the write
|
|
404
622
|
* is unanswered.
|
|
@@ -407,8 +625,8 @@ export type Verdict =
|
|
|
407
625
|
| { verdict: 'accepted' }
|
|
408
626
|
| { verdict: 'merged'; fields: Array<string> }
|
|
409
627
|
| { verdict: 'conflicted'; siblingId: string; fields: Array<string> }
|
|
410
|
-
| { verdict: 'refused';
|
|
411
|
-
| { verdict: 'blocked'; reason: BlockedReason }
|
|
628
|
+
| { verdict: 'refused'; refusal: Refusal }
|
|
629
|
+
| { verdict: 'blocked'; reason: BlockedReason; refusal?: Refusal }
|
|
412
630
|
| { verdict: 'dead' }
|
|
413
631
|
|
|
414
632
|
/** The kinds of write a queue holds. */
|
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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3') {
|
|
665
|
+
throw new Error(`WASI binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
wasiBinding = require('@withmarfa/core-wasm32-wasi')
|
|
@@ -781,6 +781,9 @@ module.exports = nativeBinding
|
|
|
781
781
|
module.exports.MarfaCore = nativeBinding.MarfaCore
|
|
782
782
|
module.exports.Subscription = nativeBinding.Subscription
|
|
783
783
|
module.exports.BlockedReason = nativeBinding.BlockedReason
|
|
784
|
+
module.exports.EdgeEnd = nativeBinding.EdgeEnd
|
|
785
|
+
module.exports.GrantKind = nativeBinding.GrantKind
|
|
786
|
+
module.exports.GrantLevel = nativeBinding.GrantLevel
|
|
784
787
|
module.exports.Handle = nativeBinding.Handle
|
|
785
788
|
module.exports.Hydration = nativeBinding.Hydration
|
|
786
789
|
module.exports.ItemState = nativeBinding.ItemState
|
|
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.3",
|
|
4
4
|
"description": "marfa-core as a Node module.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "napi build --platform --release",
|
|
34
34
|
"build:debug": "napi build --platform",
|
|
35
|
-
"proof": "node scripts/proof.mjs",
|
|
36
35
|
"check": "tsc -p tsconfig.json",
|
|
37
36
|
"test": "node --expose-gc --test test/*.test.mjs"
|
|
38
37
|
}
|