jazz-napi 2.0.0-alpha.7 → 2.0.0-alpha.9

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 +40 -24
  2. package/index.js +4 -4
  3. package/package.json +5 -5
package/index.d.ts CHANGED
@@ -3,33 +3,49 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export declare function generateId(): string
7
- export declare function currentTimestamp(): number
8
- export declare function parseSchema(json: string): any
6
+ export declare function generateId(): string;
7
+ export declare function currentTimestamp(): number;
8
+ export declare function parseSchema(json: string): any;
9
9
  export declare class NapiRuntime {
10
10
  /** Create a new NapiRuntime with SurrealKV-backed persistent storage. */
11
- constructor(schemaJson: string, appId: string, jazzEnv: string, userBranch: string, dataPath: string, tier?: string | undefined | null)
12
- insert(table: string, values: any): string
13
- update(objectId: string, values: any): void
14
- delete(objectId: string): void
15
- query(queryJson: string, sessionJson?: string | undefined | null, settledTier?: string | undefined | null): Promise<any>
16
- subscribe(queryJson: string, onUpdate: (...args: any[]) => any, sessionJson?: string | undefined | null, settledTier?: string | undefined | null): number
17
- unsubscribe(handle: number): void
18
- insertWithAck(table: string, values: any, tier: string): Promise<string>
19
- updateWithAck(objectId: string, values: any, tier: string): Promise<void>
20
- deleteWithAck(objectId: string, tier: string): Promise<void>
21
- onSyncMessageReceived(messageJson: string): void
11
+ constructor(
12
+ schemaJson: string,
13
+ appId: string,
14
+ jazzEnv: string,
15
+ userBranch: string,
16
+ dataPath: string,
17
+ tier?: string | undefined | null,
18
+ );
19
+ insert(table: string, values: any): string;
20
+ update(objectId: string, values: any): void;
21
+ delete(objectId: string): void;
22
+ query(
23
+ queryJson: string,
24
+ sessionJson?: string | undefined | null,
25
+ settledTier?: string | undefined | null,
26
+ ): Promise<any>;
27
+ subscribe(
28
+ queryJson: string,
29
+ onUpdate: (...args: any[]) => any,
30
+ sessionJson?: string | undefined | null,
31
+ settledTier?: string | undefined | null,
32
+ ): number;
33
+ unsubscribe(handle: number): void;
34
+ insertWithAck(table: string, values: any, tier: string): Promise<string>;
35
+ updateWithAck(objectId: string, values: any, tier: string): Promise<void>;
36
+ deleteWithAck(objectId: string, tier: string): Promise<void>;
37
+ onSyncMessageReceived(messageJson: string): void;
22
38
  /** Called by JS when a sync message arrives from a client (not a server). */
23
- onSyncMessageReceivedFromClient(clientId: string, messageJson: string): void
24
- onSyncMessageToSend(callback: (...args: any[]) => any): void
25
- addServer(): void
26
- removeServer(): void
27
- addClient(): string
39
+ onSyncMessageReceivedFromClient(clientId: string, messageJson: string): void;
40
+ onSyncMessageToSend(callback: (...args: any[]) => any): void;
41
+ addServer(): void;
42
+ removeServer(): void;
43
+ addClient(): string;
28
44
  /** Set a client's role ("user", "admin", or "peer"). */
29
- setClientRole(clientId: string, role: string): void
30
- getSchema(): any
31
- getSchemaHash(): string
32
- flush(): void
45
+ setClientRole(clientId: string, role: string): void;
46
+ getSchema(): any;
47
+ getSchemaHash(): string;
48
+ flush(): void;
33
49
  /** Flush and close the underlying storage, releasing filesystem locks. */
34
- close(): void
50
+ close(): void;
35
51
  }
package/index.js CHANGED
@@ -67,7 +67,7 @@ switch (platform) {
67
67
  if (localFileExisted) {
68
68
  nativeBinding = require("./jazz-napi.win32-x64-msvc.node");
69
69
  } else {
70
- nativeBinding = require("@garden-co/jazz-napi-win32-x64-msvc");
70
+ nativeBinding = require("jazz-napi-win32-x64-msvc");
71
71
  }
72
72
  } catch (e) {
73
73
  loadError = e;
@@ -118,7 +118,7 @@ switch (platform) {
118
118
  if (localFileExisted) {
119
119
  nativeBinding = require("./jazz-napi.darwin-x64.node");
120
120
  } else {
121
- nativeBinding = require("@garden-co/jazz-napi-darwin-x64");
121
+ nativeBinding = require("jazz-napi-darwin-x64");
122
122
  }
123
123
  } catch (e) {
124
124
  loadError = e;
@@ -130,7 +130,7 @@ switch (platform) {
130
130
  if (localFileExisted) {
131
131
  nativeBinding = require("./jazz-napi.darwin-arm64.node");
132
132
  } else {
133
- nativeBinding = require("@garden-co/jazz-napi-darwin-arm64");
133
+ nativeBinding = require("jazz-napi-darwin-arm64");
134
134
  }
135
135
  } catch (e) {
136
136
  loadError = e;
@@ -175,7 +175,7 @@ switch (platform) {
175
175
  if (localFileExisted) {
176
176
  nativeBinding = require("./jazz-napi.linux-x64-gnu.node");
177
177
  } else {
178
- nativeBinding = require("@garden-co/jazz-napi-linux-x64-gnu");
178
+ nativeBinding = require("jazz-napi-linux-x64-gnu");
179
179
  }
180
180
  } catch (e) {
181
181
  loadError = e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jazz-napi",
3
- "version": "2.0.0-alpha.7",
3
+ "version": "2.0.0-alpha.9",
4
4
  "description": "Native Node.js bindings for Jazz runtime",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,10 +33,10 @@
33
33
  }
34
34
  },
35
35
  "optionalDependencies": {
36
- "@garden-co/jazz-napi-darwin-arm64": "2.0.0-alpha.7",
37
- "@garden-co/jazz-napi-darwin-x64": "2.0.0-alpha.7",
38
- "@garden-co/jazz-napi-linux-x64-gnu": "2.0.0-alpha.7",
39
- "@garden-co/jazz-napi-win32-x64-msvc": "2.0.0-alpha.7"
36
+ "@garden-co/jazz-napi-darwin-arm64": "2.0.0-alpha.9",
37
+ "@garden-co/jazz-napi-darwin-x64": "2.0.0-alpha.9",
38
+ "@garden-co/jazz-napi-linux-x64-gnu": "2.0.0-alpha.9",
39
+ "@garden-co/jazz-napi-win32-x64-msvc": "2.0.0-alpha.9"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "node scripts/build.js",