@agntcy/slim-bindings 1.4.0 → 2.0.0-alpha.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agntcy/slim-bindings",
3
- "version": "1.4.0",
3
+ "version": "2.0.0-alpha.1",
4
4
  "description": "SLIM Node.js bindings using UniFFI",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -30,20 +30,20 @@
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",
33
- "url": "https://github.com/agntcy/slim.git",
34
- "directory": "data-plane/bindings/node"
33
+ "url": "https://github.com/agntcy/slim-bindings.git",
34
+ "directory": "node"
35
35
  },
36
36
  "license": "Apache-2.0",
37
37
  "optionalDependencies": {
38
- "@agntcy/slim-bindings-darwin-arm64": "1.4.0",
39
- "@agntcy/slim-bindings-darwin-x64": "1.4.0",
40
- "@agntcy/slim-bindings-linux-arm64-gnu": "1.4.0",
41
- "@agntcy/slim-bindings-linux-arm64-musl": "1.4.0",
42
- "@agntcy/slim-bindings-linux-x64-gnu": "1.4.0",
43
- "@agntcy/slim-bindings-linux-x64-musl": "1.4.0",
44
- "@agntcy/slim-bindings-win32-arm64-msvc": "1.4.0",
45
- "@agntcy/slim-bindings-win32-x64-gnu": "1.4.0",
46
- "@agntcy/slim-bindings-win32-x64-msvc": "1.4.0"
38
+ "@agntcy/slim-bindings-darwin-arm64": "2.0.0-alpha.1",
39
+ "@agntcy/slim-bindings-darwin-x64": "2.0.0-alpha.1",
40
+ "@agntcy/slim-bindings-linux-arm64-gnu": "2.0.0-alpha.1",
41
+ "@agntcy/slim-bindings-linux-arm64-musl": "2.0.0-alpha.1",
42
+ "@agntcy/slim-bindings-linux-x64-gnu": "2.0.0-alpha.1",
43
+ "@agntcy/slim-bindings-linux-x64-musl": "2.0.0-alpha.1",
44
+ "@agntcy/slim-bindings-win32-arm64-msvc": "2.0.0-alpha.1",
45
+ "@agntcy/slim-bindings-win32-x64-gnu": "2.0.0-alpha.1",
46
+ "@agntcy/slim-bindings-win32-x64-msvc": "2.0.0-alpha.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^20.0.0",
@@ -66,14 +66,11 @@ export declare const BuildInfo: Readonly<{
66
66
  */
67
67
  export type ClientConfig = {
68
68
  /**
69
- * The target endpoint the client will connect to
69
+ * The target endpoint the client will connect to.
70
+ *
71
+ * The transport protocol is inferred from the endpoint scheme:
72
+ * `ws://`/`wss://` → WebSocket, otherwise gRPC.
70
73
  */ endpoint: string;
71
- /**
72
- * Transport protocol to use (defaults to gRPC in core config when omitted)
73
- */ transport?: TransportProtocol;
74
- /**
75
- * Optional websocket authentication query parameter key
76
- */ websocketAuthQueryParam?: string;
77
74
  /**
78
75
  * TLS client configuration
79
76
  */ tls: TlsClientConfig;
@@ -116,6 +113,9 @@ export type ClientConfig = {
116
113
  /**
117
114
  * Arbitrary user-provided metadata as JSON string
118
115
  */ metadata?: string;
116
+ /**
117
+ * When true, reject inter-node messages without a valid header MAC (strict mode).
118
+ */ requireHeaderMac?: boolean;
119
119
  };
120
120
  export declare const ClientConfig: Readonly<{
121
121
  /**
@@ -704,11 +704,11 @@ export declare const KeepaliveServerParameters: Readonly<{
704
704
  */
705
705
  export type ServerConfig = {
706
706
  /**
707
- * Endpoint address to listen on (e.g., "0.0.0.0:50051" or "[::]:50051")
707
+ * Endpoint address to listen on (e.g., "0.0.0.0:50051" or "[::]:50051").
708
+ *
709
+ * The transport protocol is inferred from the endpoint scheme:
710
+ * `ws://`/`wss://` → WebSocket, otherwise gRPC.
708
711
  */ endpoint: string;
709
- /**
710
- * Transport protocol to use (defaults to gRPC in core config when omitted)
711
- */ transport?: TransportProtocol;
712
712
  /**
713
713
  * TLS server configuration
714
714
  */ tls: TlsServerConfig;
@@ -739,6 +739,15 @@ export type ServerConfig = {
739
739
  /**
740
740
  * Arbitrary user-provided metadata as JSON string
741
741
  */ metadata?: string;
742
+ /**
743
+ * When true, reject inter-node messages without a valid header MAC (strict mode).
744
+ */ requireHeaderMac?: boolean;
745
+ /**
746
+ * Timeout (in seconds) for link negotiation to complete.
747
+ */ negotiationTimeoutSecs?: bigint;
748
+ /**
749
+ * Polling interval (in milliseconds) to wait between HMAC existence checks.
750
+ */ linkHmacPollIntervalMs?: bigint;
742
751
  };
743
752
  export declare const ServerConfig: Readonly<{
744
753
  /**
@@ -813,6 +822,27 @@ export declare const ServiceConfig: Readonly<{
813
822
  */
814
823
  defaults: () => Partial<ServiceConfig>;
815
824
  }>;
825
+ export type MlsSettings = {
826
+ /**
827
+ * 0 = disable header-integrity checks; 1–100 = percent of messages to verify after decrypt.
828
+ */ headerIntegrityValidationPercent: number;
829
+ };
830
+ export declare const MlsSettings: Readonly<{
831
+ /**
832
+ * Create a frozen instance of {@link MlsSettings}, with defaults specified
833
+ * in Rust, in the {@link slim_bindings} crate.
834
+ */
835
+ create: (partial: Partial<MlsSettings> & Required<Omit<MlsSettings, never>>) => MlsSettings;
836
+ /**
837
+ * Create a frozen instance of {@link MlsSettings}, with defaults specified
838
+ * in Rust, in the {@link slim_bindings} crate.
839
+ */
840
+ new: (partial: Partial<MlsSettings> & Required<Omit<MlsSettings, never>>) => MlsSettings;
841
+ /**
842
+ * Defaults specified in the {@link slim_bindings} crate.
843
+ */
844
+ defaults: () => Partial<MlsSettings>;
845
+ }>;
816
846
  /**
817
847
  * Session configuration
818
848
  */
@@ -820,9 +850,6 @@ export type SessionConfig = {
820
850
  /**
821
851
  * Session type (PointToPoint or Group)
822
852
  */ sessionType: SessionType;
823
- /**
824
- * Enable MLS encryption for this session
825
- */ enableMls: boolean;
826
853
  /**
827
854
  * Maximum number of retries for message transmission (None = use default)
828
855
  */ maxRetries?: number;
@@ -832,6 +859,9 @@ export type SessionConfig = {
832
859
  /**
833
860
  * Custom metadata key-value pairs for the session
834
861
  */ metadata: Map<string, string>;
862
+ /**
863
+ * MLS options (None disables MLS).
864
+ */ mlsSettings?: MlsSettings;
835
865
  };
836
866
  export declare const SessionConfig: Readonly<{
837
867
  /**
@@ -1607,8 +1637,8 @@ export type AppInterface = {
1607
1637
  signal: AbortSignal;
1608
1638
  }): Promise<CompletionHandle>;
1609
1639
  /**
1610
- * Get the app ID (derived from name)
1611
- */ id(): bigint;
1640
+ * Get the app ID in UUID format
1641
+ */ id(): string;
1612
1642
  /**
1613
1643
  * Listen for incoming sessions (blocking version for FFI)
1614
1644
  */ listenForSession(timeout: number | undefined): Session;
@@ -1771,8 +1801,8 @@ export declare class App extends UniffiAbstractObject implements AppInterface {
1771
1801
  signal: AbortSignal;
1772
1802
  }): Promise<CompletionHandle>;
1773
1803
  /**
1774
- * Get the app ID (derived from name)
1775
- */ id(): bigint;
1804
+ * Get the app ID in UUID format
1805
+ */ id(): string;
1776
1806
  /**
1777
1807
  * Listen for incoming sessions (blocking version for FFI)
1778
1808
  */ listenForSession(timeout: number | undefined): Session;
@@ -1987,8 +2017,8 @@ export type NameInterface = {
1987
2017
  * Get the name components as a vector of strings
1988
2018
  */ components(): Array<string>;
1989
2019
  /**
1990
- * Get the name ID
1991
- */ id(): bigint;
2020
+ * Get the name ID formatted as UUID string
2021
+ */ id(): string;
1992
2022
  };
1993
2023
  /**
1994
2024
  * Name type for SLIM (Secure Low-Latency Interactive Messaging)
@@ -2009,15 +2039,15 @@ export declare class Name extends UniffiAbstractObject implements NameInterface
2009
2039
  */
2010
2040
  constructor(component0: string, component1: string, component2: string);
2011
2041
  /**
2012
- * Create a new Name from components with an ID
2042
+ * Create a new Name from components with an ID expressed in UUID format
2013
2043
  */
2014
- static newWithId(component0: string, component1: string, component2: string, id: bigint): Name;
2044
+ static newWithId(component0: string, component1: string, component2: string, id: string): Name;
2015
2045
  /**
2016
2046
  * Get the name components as a vector of strings
2017
2047
  */ components(): Array<string>;
2018
2048
  /**
2019
- * Get the name ID
2020
- */ id(): bigint;
2049
+ * Get the name ID formatted as UUID string
2050
+ */ id(): string;
2021
2051
  /**
2022
2052
  * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2023
2053
  */
@@ -174,7 +174,7 @@ declare const FFI_DYNAMIC_LIB: {
174
174
  uniffi_slim_bindings_fn_method_app_delete_session_and_wait: (args: [bigint, bigint, /* RustCallStatus */ JsExternal]) => void;
175
175
  uniffi_slim_bindings_fn_method_app_delete_session_and_wait_async: (args: [bigint, bigint]) => bigint;
176
176
  uniffi_slim_bindings_fn_method_app_delete_session_async: (args: [bigint, bigint]) => bigint;
177
- uniffi_slim_bindings_fn_method_app_id: (args: [bigint, /* RustCallStatus */ JsExternal]) => bigint;
177
+ uniffi_slim_bindings_fn_method_app_id: (args: [bigint, /* RustCallStatus */ JsExternal]) => UniffiRustBufferStruct;
178
178
  uniffi_slim_bindings_fn_method_app_listen_for_session: (args: [bigint, UniffiRustBufferStruct, /* RustCallStatus */ JsExternal]) => bigint;
179
179
  uniffi_slim_bindings_fn_method_app_listen_for_session_async: (args: [bigint, UniffiRustBufferStruct]) => bigint;
180
180
  uniffi_slim_bindings_fn_method_app_name: (args: [bigint, /* RustCallStatus */ JsExternal]) => bigint;
@@ -196,9 +196,9 @@ declare const FFI_DYNAMIC_LIB: {
196
196
  uniffi_slim_bindings_fn_free_name: (args: [bigint, /* RustCallStatus */ JsExternal]) => void;
197
197
  uniffi_slim_bindings_fn_constructor_name_from_string: (args: [UniffiRustBufferStruct, /* RustCallStatus */ JsExternal]) => bigint;
198
198
  uniffi_slim_bindings_fn_constructor_name_new: (args: [UniffiRustBufferStruct, UniffiRustBufferStruct, UniffiRustBufferStruct, /* RustCallStatus */ JsExternal]) => bigint;
199
- uniffi_slim_bindings_fn_constructor_name_new_with_id: (args: [UniffiRustBufferStruct, UniffiRustBufferStruct, UniffiRustBufferStruct, bigint, /* RustCallStatus */ JsExternal]) => bigint;
199
+ uniffi_slim_bindings_fn_constructor_name_new_with_id: (args: [UniffiRustBufferStruct, UniffiRustBufferStruct, UniffiRustBufferStruct, UniffiRustBufferStruct, /* RustCallStatus */ JsExternal]) => bigint;
200
200
  uniffi_slim_bindings_fn_method_name_components: (args: [bigint, /* RustCallStatus */ JsExternal]) => UniffiRustBufferStruct;
201
- uniffi_slim_bindings_fn_method_name_id: (args: [bigint, /* RustCallStatus */ JsExternal]) => bigint;
201
+ uniffi_slim_bindings_fn_method_name_id: (args: [bigint, /* RustCallStatus */ JsExternal]) => UniffiRustBufferStruct;
202
202
  uniffi_slim_bindings_fn_method_name_uniffi_trait_debug: (args: [bigint, /* RustCallStatus */ JsExternal]) => UniffiRustBufferStruct;
203
203
  uniffi_slim_bindings_fn_method_name_uniffi_trait_display: (args: [bigint, /* RustCallStatus */ JsExternal]) => UniffiRustBufferStruct;
204
204
  uniffi_slim_bindings_fn_method_name_uniffi_trait_eq_eq: (args: [bigint, bigint, /* RustCallStatus */ JsExternal]) => number;