@withmarfa/core 0.0.1 → 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 CHANGED
@@ -33,13 +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>
53
+ edgesTo(id: string): Array<Edge>
54
+ edgesOfType(edgeType: string): Array<Edge>
41
55
  search(query: string, filters?: SearchFilters | undefined | null, limit?: number | undefined | null): Array<SearchHit>
42
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
43
65
  /**
44
66
  * Which handle this process holds: the one that may write, or a second
45
67
  * opener that reads and refuses every write.
@@ -49,6 +71,12 @@ export declare class MarfaCore {
49
71
  createItem(draft: Draft): QueuedWrite
50
72
  /** Changes an item in the local copy and queues the change. */
51
73
  updateItem(id: string, edit: Edit): QueuedWrite
74
+ /**
75
+ * Changes an item in the local copy and queues the change, based on a
76
+ * version read before the one the copy holds now, which the server
77
+ * merges the change against.
78
+ */
79
+ updateItemAsRead(id: string, edit: Edit): QueuedWrite
52
80
  /** Moves an item to the bin locally and queues the delete. */
53
81
  deleteItem(id: string): QueuedWrite
54
82
  /** Takes an item out of the bin locally and queues the restore. */
@@ -107,8 +135,24 @@ export declare class MarfaCore {
107
135
  release(id: string): boolean
108
136
  /** Releases every write blocked for one reason, and says how many. */
109
137
  releaseReason(reason: BlockedReason): number
110
- /** Clears the writes the server has answered, and says how many went. */
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
+ */
111
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
112
156
  }
113
157
 
114
158
  /**
@@ -154,14 +198,20 @@ export interface CatchUpReport {
154
198
  }
155
199
 
156
200
  /**
157
- * One event a held stream applied: what it was, what it was about, and the
158
- * cursor it left.
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.
159
208
  */
160
209
  export interface Change {
161
210
  event: string
162
211
  itemId?: string
163
212
  edgeId?: string
164
213
  cursor: string
214
+ reason?: string
165
215
  }
166
216
 
167
217
  /** A create, before it is queued. */
@@ -184,10 +234,36 @@ export interface Draft {
184
234
 
185
235
  /** What a drain did. */
186
236
  export interface DrainReport {
187
- sent: number
237
+ /** Writes the server answered this drain, whatever it answered. */
238
+ answered: number
188
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
189
262
  verdicts: Array<DrainVerdict>
190
- /** Why the drain stopped before the queue was empty, where it did. */
263
+ /**
264
+ * Why the drain stopped: the server refused the credential, and every
265
+ * write waits until it is replaced.
266
+ */
191
267
  stopped?: string
192
268
  /**
193
269
  * The sources the server said this credential's key does not claim,
@@ -198,11 +274,13 @@ export interface DrainReport {
198
274
  retryAfterSeconds?: number
199
275
  }
200
276
 
201
- /** What became of one write a drain sent. */
277
+ /** What became of one write a drain answered, sent or not. */
202
278
  export interface DrainVerdict {
203
279
  id: string
204
280
  kind: WriteKind
281
+ /** An edge write's source; otherwise the row written to. */
205
282
  itemId?: string
283
+ edgeId?: string
206
284
  verdict?: Verdict
207
285
  refusals: number
208
286
  /**
@@ -238,6 +316,28 @@ export interface EdgeEdit {
238
316
  baseVersion?: number
239
317
  }
240
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
+
241
341
  /** A change to an item, and the version it was read at. */
242
342
  export interface Edit {
243
343
  /** Whole field values; a device never merges inside a field. */
@@ -248,6 +348,23 @@ export interface Edit {
248
348
  sourceId?: string
249
349
  }
250
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
+
251
368
  /** Which handle this process holds on the store. */
252
369
  export declare const enum Handle {
253
370
  Writer = 'writer',
@@ -257,6 +374,7 @@ export declare const enum Handle {
257
374
  export interface HydrateReport {
258
375
  types: Array<string>
259
376
  tier: Tier
377
+ edgeTypes: Array<string>
260
378
  items: number
261
379
  edges: number
262
380
  pages: number
@@ -293,6 +411,21 @@ export declare const enum ItemState {
293
411
  Revoked = 'revoked',
294
412
  }
295
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
+
296
429
  /**
297
430
  * Narrowing for a list. Leaving `state` unset answers the active state, as
298
431
  * the server does; `allStates` lifts that, and a named state wins.
@@ -305,10 +438,36 @@ export interface ListFilters {
305
438
  tags?: Array<string>
306
439
  occurredAfter?: string
307
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
308
452
  limit?: number
309
453
  offset?: number
310
454
  }
311
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
+
312
471
  /** One queued write and what became of it. */
313
472
  export interface QueuedWrite {
314
473
  id: string
@@ -329,7 +488,18 @@ export interface QueuedWrite {
329
488
  * out after and is not refused with.
330
489
  */
331
490
  follows?: string
491
+ /** Absent while the server has not answered it. */
332
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>
333
503
  /** The server's answer, whole, as it arrived. */
334
504
  answer?: string
335
505
  refusals: number
@@ -337,15 +507,45 @@ export interface QueuedWrite {
337
507
  answeredAt?: string
338
508
  }
339
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
+
340
528
  /**
341
529
  * Narrowing for a search: the state rule a list takes, a type with its
342
- * subtree, and tags, each read as the list reads it.
530
+ * subtree, tags, a listing-grammar expression and `beneath`, each read as
531
+ * the list reads it.
343
532
  */
344
533
  export interface SearchFilters {
345
534
  state?: ItemState
346
535
  allStates?: boolean
347
536
  type?: string
348
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
349
549
  }
350
550
 
351
551
  export interface SearchHit {
@@ -373,12 +573,21 @@ export declare const enum SortField {
373
573
 
374
574
  export interface Status {
375
575
  serverOrigin?: string
576
+ /** The instance the copy was hydrated from. */
577
+ instanceId?: string
376
578
  sliceTypes: Array<string>
377
579
  sliceTier?: Tier
580
+ sliceEdgeTypes: Array<string>
581
+ pinned: Array<string>
378
582
  eventCursor?: string
379
583
  hydration: Hydration
380
584
  items: number
381
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
382
591
  }
383
592
 
384
593
  /** An item's thumbnail: the image's type and its bytes. */
@@ -392,6 +601,22 @@ export declare const enum Tier {
392
601
  Feed = 'feed',
393
602
  }
394
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
+
395
620
  /**
396
621
  * What the server made of a write: one of six, and absent while the write
397
622
  * is unanswered.
@@ -400,8 +625,8 @@ export type Verdict =
400
625
  | { verdict: 'accepted' }
401
626
  | { verdict: 'merged'; fields: Array<string> }
402
627
  | { verdict: 'conflicted'; siblingId: string; fields: Array<string> }
403
- | { verdict: 'refused'; reason: string }
404
- | { verdict: 'blocked'; reason: BlockedReason }
628
+ | { verdict: 'refused'; refusal: Refusal }
629
+ | { verdict: 'blocked'; reason: BlockedReason; refusal?: Refusal }
405
630
  | { verdict: 'dead' }
406
631
 
407
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1' && 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.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1') {
665
- throw new Error(`WASI binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.1",
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
  }