jazz-napi 2.0.0-alpha.17 → 2.0.0-alpha.19

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.
Files changed (3) hide show
  1. package/index.d.ts +6 -0
  2. package/index.js +105 -110
  3. package/package.json +7 -6
package/index.d.ts CHANGED
@@ -6,8 +6,11 @@ export declare class NapiRuntime {
6
6
  /** Create a new NapiRuntime with in-memory storage (no local persistence). */
7
7
  static inMemory(schemaJson: string, appId: string, jazzEnv: string, userBranch: string, tier?: string | undefined | null): NapiRuntime
8
8
  insert(table: string, values: any): any
9
+ insertWithSession(table: string, values: any, sessionJson?: string | undefined | null): any
9
10
  update(objectId: string, values: any): void
11
+ updateWithSession(objectId: string, values: any, sessionJson?: string | undefined | null): void
10
12
  delete(objectId: string): void
13
+ deleteWithSession(objectId: string, sessionJson?: string | undefined | null): void
11
14
  query(queryJson: string, sessionJson?: string | undefined | null, tier?: string | undefined | null, optionsJson?: string | undefined | null): Promise<any>
12
15
  subscribe(queryJson: string, onUpdate: (...args: any[]) => any, sessionJson?: string | undefined | null, tier?: string | undefined | null, optionsJson?: string | undefined | null): number
13
16
  unsubscribe(handle: number): void
@@ -16,8 +19,11 @@ export declare class NapiRuntime {
16
19
  /** Phase 2 of 2-phase subscribe: compile, register, sync, attach callback, tick. */
17
20
  executeSubscription(handle: number, onUpdate: (...args: any[]) => any): void
18
21
  insertDurable(table: string, values: any, tier: string): Promise<any>
22
+ insertDurableWithSession(table: string, values: any, sessionJson: string | undefined | null, tier: string): Promise<any>
19
23
  updateDurable(objectId: string, values: any, tier: string): Promise<void>
24
+ updateDurableWithSession(objectId: string, values: any, sessionJson: string | undefined | null, tier: string): Promise<void>
20
25
  deleteDurable(objectId: string, tier: string): Promise<void>
26
+ deleteDurableWithSession(objectId: string, sessionJson: string | undefined | null, tier: string): Promise<void>
21
27
  onSyncMessageReceived(messageJson: string): void
22
28
  /** Called by JS when a sync message arrives from a client (not a server). */
23
29
  onSyncMessageReceivedFromClient(clientId: string, messageJson: string): void
package/index.js CHANGED
@@ -6,11 +6,6 @@
6
6
  const { readFileSync } = require('node:fs')
7
7
  let nativeBinding = null
8
8
  const loadErrors = []
9
- const NATIVE_BINDING_PACKAGE_SCOPE = '@garden-co'
10
- const resolveNativeBindingPackage = (name) => `${NATIVE_BINDING_PACKAGE_SCOPE}/${name}`
11
- const requireNativeBindingPackage = (name) => require(resolveNativeBindingPackage(name))
12
- const getNativeBindingPackageVersion = (name) =>
13
- require(`${resolveNativeBindingPackage(name)}/package.json`).version
14
9
 
15
10
  const isMusl = () => {
16
11
  let musl = false
@@ -80,10 +75,10 @@ function requireNative() {
80
75
  loadErrors.push(e)
81
76
  }
82
77
  try {
83
- const binding = requireNativeBindingPackage('jazz-napi-android-arm64')
84
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-android-arm64')
85
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
86
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
78
+ const binding = require('@garden-co/jazz-napi-android-arm64')
79
+ const bindingPackageVersion = require('@garden-co/jazz-napi-android-arm64/package.json').version
80
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
87
82
  }
88
83
  return binding
89
84
  } catch (e) {
@@ -96,10 +91,10 @@ function requireNative() {
96
91
  loadErrors.push(e)
97
92
  }
98
93
  try {
99
- const binding = requireNativeBindingPackage('jazz-napi-android-arm-eabi')
100
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-android-arm-eabi')
101
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
102
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
94
+ const binding = require('@garden-co/jazz-napi-android-arm-eabi')
95
+ const bindingPackageVersion = require('@garden-co/jazz-napi-android-arm-eabi/package.json').version
96
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
103
98
  }
104
99
  return binding
105
100
  } catch (e) {
@@ -117,10 +112,10 @@ function requireNative() {
117
112
  loadErrors.push(e)
118
113
  }
119
114
  try {
120
- const binding = requireNativeBindingPackage('jazz-napi-win32-x64-gnu')
121
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-win32-x64-gnu')
122
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
123
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
115
+ const binding = require('@garden-co/jazz-napi-win32-x64-gnu')
116
+ const bindingPackageVersion = require('@garden-co/jazz-napi-win32-x64-gnu/package.json').version
117
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
124
119
  }
125
120
  return binding
126
121
  } catch (e) {
@@ -133,10 +128,10 @@ function requireNative() {
133
128
  loadErrors.push(e)
134
129
  }
135
130
  try {
136
- const binding = requireNativeBindingPackage('jazz-napi-win32-x64-msvc')
137
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-win32-x64-msvc')
138
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
139
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
131
+ const binding = require('@garden-co/jazz-napi-win32-x64-msvc')
132
+ const bindingPackageVersion = require('@garden-co/jazz-napi-win32-x64-msvc/package.json').version
133
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
140
135
  }
141
136
  return binding
142
137
  } catch (e) {
@@ -150,10 +145,10 @@ function requireNative() {
150
145
  loadErrors.push(e)
151
146
  }
152
147
  try {
153
- const binding = requireNativeBindingPackage('jazz-napi-win32-ia32-msvc')
154
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-win32-ia32-msvc')
155
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
156
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
148
+ const binding = require('@garden-co/jazz-napi-win32-ia32-msvc')
149
+ const bindingPackageVersion = require('@garden-co/jazz-napi-win32-ia32-msvc/package.json').version
150
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
157
152
  }
158
153
  return binding
159
154
  } catch (e) {
@@ -166,10 +161,10 @@ function requireNative() {
166
161
  loadErrors.push(e)
167
162
  }
168
163
  try {
169
- const binding = requireNativeBindingPackage('jazz-napi-win32-arm64-msvc')
170
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-win32-arm64-msvc')
171
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
172
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
164
+ const binding = require('@garden-co/jazz-napi-win32-arm64-msvc')
165
+ const bindingPackageVersion = require('@garden-co/jazz-napi-win32-arm64-msvc/package.json').version
166
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
173
168
  }
174
169
  return binding
175
170
  } catch (e) {
@@ -185,10 +180,10 @@ function requireNative() {
185
180
  loadErrors.push(e)
186
181
  }
187
182
  try {
188
- const binding = requireNativeBindingPackage('jazz-napi-darwin-universal')
189
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-darwin-universal')
190
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
191
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
183
+ const binding = require('@garden-co/jazz-napi-darwin-universal')
184
+ const bindingPackageVersion = require('@garden-co/jazz-napi-darwin-universal/package.json').version
185
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
192
187
  }
193
188
  return binding
194
189
  } catch (e) {
@@ -201,10 +196,10 @@ function requireNative() {
201
196
  loadErrors.push(e)
202
197
  }
203
198
  try {
204
- const binding = requireNativeBindingPackage('jazz-napi-darwin-x64')
205
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-darwin-x64')
206
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
207
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
199
+ const binding = require('@garden-co/jazz-napi-darwin-x64')
200
+ const bindingPackageVersion = require('@garden-co/jazz-napi-darwin-x64/package.json').version
201
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
208
203
  }
209
204
  return binding
210
205
  } catch (e) {
@@ -217,10 +212,10 @@ function requireNative() {
217
212
  loadErrors.push(e)
218
213
  }
219
214
  try {
220
- const binding = requireNativeBindingPackage('jazz-napi-darwin-arm64')
221
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-darwin-arm64')
222
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
215
+ const binding = require('@garden-co/jazz-napi-darwin-arm64')
216
+ const bindingPackageVersion = require('@garden-co/jazz-napi-darwin-arm64/package.json').version
217
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
224
219
  }
225
220
  return binding
226
221
  } catch (e) {
@@ -237,10 +232,10 @@ function requireNative() {
237
232
  loadErrors.push(e)
238
233
  }
239
234
  try {
240
- const binding = requireNativeBindingPackage('jazz-napi-freebsd-x64')
241
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-freebsd-x64')
242
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
243
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
235
+ const binding = require('@garden-co/jazz-napi-freebsd-x64')
236
+ const bindingPackageVersion = require('@garden-co/jazz-napi-freebsd-x64/package.json').version
237
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
244
239
  }
245
240
  return binding
246
241
  } catch (e) {
@@ -253,10 +248,10 @@ function requireNative() {
253
248
  loadErrors.push(e)
254
249
  }
255
250
  try {
256
- const binding = requireNativeBindingPackage('jazz-napi-freebsd-arm64')
257
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-freebsd-arm64')
258
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
259
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
251
+ const binding = require('@garden-co/jazz-napi-freebsd-arm64')
252
+ const bindingPackageVersion = require('@garden-co/jazz-napi-freebsd-arm64/package.json').version
253
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
260
255
  }
261
256
  return binding
262
257
  } catch (e) {
@@ -274,10 +269,10 @@ function requireNative() {
274
269
  loadErrors.push(e)
275
270
  }
276
271
  try {
277
- const binding = requireNativeBindingPackage('jazz-napi-linux-x64-musl')
278
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-x64-musl')
279
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
280
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
272
+ const binding = require('@garden-co/jazz-napi-linux-x64-musl')
273
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-x64-musl/package.json').version
274
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
281
276
  }
282
277
  return binding
283
278
  } catch (e) {
@@ -290,10 +285,10 @@ function requireNative() {
290
285
  loadErrors.push(e)
291
286
  }
292
287
  try {
293
- const binding = requireNativeBindingPackage('jazz-napi-linux-x64-gnu')
294
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-x64-gnu')
295
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
296
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
288
+ const binding = require('@garden-co/jazz-napi-linux-x64-gnu')
289
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-x64-gnu/package.json').version
290
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
297
292
  }
298
293
  return binding
299
294
  } catch (e) {
@@ -308,10 +303,10 @@ function requireNative() {
308
303
  loadErrors.push(e)
309
304
  }
310
305
  try {
311
- const binding = requireNativeBindingPackage('jazz-napi-linux-arm64-musl')
312
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-arm64-musl')
313
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
314
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
306
+ const binding = require('@garden-co/jazz-napi-linux-arm64-musl')
307
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-arm64-musl/package.json').version
308
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
315
310
  }
316
311
  return binding
317
312
  } catch (e) {
@@ -324,10 +319,10 @@ function requireNative() {
324
319
  loadErrors.push(e)
325
320
  }
326
321
  try {
327
- const binding = requireNativeBindingPackage('jazz-napi-linux-arm64-gnu')
328
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-arm64-gnu')
329
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
330
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
322
+ const binding = require('@garden-co/jazz-napi-linux-arm64-gnu')
323
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-arm64-gnu/package.json').version
324
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
331
326
  }
332
327
  return binding
333
328
  } catch (e) {
@@ -342,10 +337,10 @@ function requireNative() {
342
337
  loadErrors.push(e)
343
338
  }
344
339
  try {
345
- const binding = requireNativeBindingPackage('jazz-napi-linux-arm-musleabihf')
346
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-arm-musleabihf')
347
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
348
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
340
+ const binding = require('@garden-co/jazz-napi-linux-arm-musleabihf')
341
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-arm-musleabihf/package.json').version
342
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
349
344
  }
350
345
  return binding
351
346
  } catch (e) {
@@ -358,10 +353,10 @@ function requireNative() {
358
353
  loadErrors.push(e)
359
354
  }
360
355
  try {
361
- const binding = requireNativeBindingPackage('jazz-napi-linux-arm-gnueabihf')
362
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-arm-gnueabihf')
363
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
364
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
356
+ const binding = require('@garden-co/jazz-napi-linux-arm-gnueabihf')
357
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-arm-gnueabihf/package.json').version
358
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
365
360
  }
366
361
  return binding
367
362
  } catch (e) {
@@ -376,10 +371,10 @@ function requireNative() {
376
371
  loadErrors.push(e)
377
372
  }
378
373
  try {
379
- const binding = requireNativeBindingPackage('jazz-napi-linux-loong64-musl')
380
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-loong64-musl')
381
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
382
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
374
+ const binding = require('@garden-co/jazz-napi-linux-loong64-musl')
375
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-loong64-musl/package.json').version
376
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
383
378
  }
384
379
  return binding
385
380
  } catch (e) {
@@ -392,10 +387,10 @@ function requireNative() {
392
387
  loadErrors.push(e)
393
388
  }
394
389
  try {
395
- const binding = requireNativeBindingPackage('jazz-napi-linux-loong64-gnu')
396
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-loong64-gnu')
397
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
398
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
390
+ const binding = require('@garden-co/jazz-napi-linux-loong64-gnu')
391
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-loong64-gnu/package.json').version
392
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
399
394
  }
400
395
  return binding
401
396
  } catch (e) {
@@ -410,10 +405,10 @@ function requireNative() {
410
405
  loadErrors.push(e)
411
406
  }
412
407
  try {
413
- const binding = requireNativeBindingPackage('jazz-napi-linux-riscv64-musl')
414
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-riscv64-musl')
415
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
416
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
408
+ const binding = require('@garden-co/jazz-napi-linux-riscv64-musl')
409
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-riscv64-musl/package.json').version
410
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
417
412
  }
418
413
  return binding
419
414
  } catch (e) {
@@ -426,10 +421,10 @@ function requireNative() {
426
421
  loadErrors.push(e)
427
422
  }
428
423
  try {
429
- const binding = requireNativeBindingPackage('jazz-napi-linux-riscv64-gnu')
430
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-riscv64-gnu')
431
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
432
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
424
+ const binding = require('@garden-co/jazz-napi-linux-riscv64-gnu')
425
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-riscv64-gnu/package.json').version
426
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
433
428
  }
434
429
  return binding
435
430
  } catch (e) {
@@ -443,10 +438,10 @@ function requireNative() {
443
438
  loadErrors.push(e)
444
439
  }
445
440
  try {
446
- const binding = requireNativeBindingPackage('jazz-napi-linux-ppc64-gnu')
447
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-ppc64-gnu')
448
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
449
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
441
+ const binding = require('@garden-co/jazz-napi-linux-ppc64-gnu')
442
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-ppc64-gnu/package.json').version
443
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
450
445
  }
451
446
  return binding
452
447
  } catch (e) {
@@ -459,10 +454,10 @@ function requireNative() {
459
454
  loadErrors.push(e)
460
455
  }
461
456
  try {
462
- const binding = requireNativeBindingPackage('jazz-napi-linux-s390x-gnu')
463
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-linux-s390x-gnu')
464
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
465
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
457
+ const binding = require('@garden-co/jazz-napi-linux-s390x-gnu')
458
+ const bindingPackageVersion = require('@garden-co/jazz-napi-linux-s390x-gnu/package.json').version
459
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
466
461
  }
467
462
  return binding
468
463
  } catch (e) {
@@ -479,10 +474,10 @@ function requireNative() {
479
474
  loadErrors.push(e)
480
475
  }
481
476
  try {
482
- const binding = requireNativeBindingPackage('jazz-napi-openharmony-arm64')
483
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-openharmony-arm64')
484
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
485
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
477
+ const binding = require('@garden-co/jazz-napi-openharmony-arm64')
478
+ const bindingPackageVersion = require('@garden-co/jazz-napi-openharmony-arm64/package.json').version
479
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
486
481
  }
487
482
  return binding
488
483
  } catch (e) {
@@ -495,10 +490,10 @@ function requireNative() {
495
490
  loadErrors.push(e)
496
491
  }
497
492
  try {
498
- const binding = requireNativeBindingPackage('jazz-napi-openharmony-x64')
499
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-openharmony-x64')
500
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
501
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
493
+ const binding = require('@garden-co/jazz-napi-openharmony-x64')
494
+ const bindingPackageVersion = require('@garden-co/jazz-napi-openharmony-x64/package.json').version
495
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
502
497
  }
503
498
  return binding
504
499
  } catch (e) {
@@ -511,10 +506,10 @@ function requireNative() {
511
506
  loadErrors.push(e)
512
507
  }
513
508
  try {
514
- const binding = requireNativeBindingPackage('jazz-napi-openharmony-arm')
515
- const bindingPackageVersion = getNativeBindingPackageVersion('jazz-napi-openharmony-arm')
516
- if (bindingPackageVersion !== '2.0.0-alpha.16' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
517
- throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.16 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
509
+ const binding = require('@garden-co/jazz-napi-openharmony-arm')
510
+ const bindingPackageVersion = require('@garden-co/jazz-napi-openharmony-arm/package.json').version
511
+ if (bindingPackageVersion !== '2.0.0-alpha.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
518
513
  }
519
514
  return binding
520
515
  } catch (e) {
@@ -543,7 +538,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
543
538
  }
544
539
  if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
545
540
  try {
546
- wasiBinding = requireNativeBindingPackage('jazz-napi-wasm32-wasi')
541
+ wasiBinding = require('@garden-co/jazz-napi-wasm32-wasi')
547
542
  nativeBinding = wasiBinding
548
543
  } catch (err) {
549
544
  if (process.env.NAPI_RS_FORCE_WASI) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jazz-napi",
3
- "version": "2.0.0-alpha.17",
3
+ "version": "2.0.0-alpha.19",
4
4
  "description": "Native Node.js bindings for Jazz runtime",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,6 +22,7 @@
22
22
  },
23
23
  "napi": {
24
24
  "binaryName": "jazz-napi",
25
+ "packageName": "@garden-co/jazz-napi",
25
26
  "targets": [
26
27
  "x86_64-unknown-linux-gnu",
27
28
  "x86_64-pc-windows-msvc",
@@ -30,13 +31,13 @@
30
31
  ]
31
32
  },
32
33
  "optionalDependencies": {
33
- "@garden-co/jazz-napi-darwin-arm64": "2.0.0-alpha.17",
34
- "@garden-co/jazz-napi-darwin-x64": "2.0.0-alpha.17",
35
- "@garden-co/jazz-napi-linux-x64-gnu": "2.0.0-alpha.17",
36
- "@garden-co/jazz-napi-win32-x64-msvc": "2.0.0-alpha.17"
34
+ "@garden-co/jazz-napi-darwin-arm64": "2.0.0-alpha.19",
35
+ "@garden-co/jazz-napi-darwin-x64": "2.0.0-alpha.19",
36
+ "@garden-co/jazz-napi-linux-x64-gnu": "2.0.0-alpha.19",
37
+ "@garden-co/jazz-napi-win32-x64-msvc": "2.0.0-alpha.19"
37
38
  },
38
39
  "scripts": {
39
40
  "build": "node scripts/build.js",
40
- "build:debug": "napi build --platform"
41
+ "build:debug": "node scripts/build.js --debug"
41
42
  }
42
43
  }