@terminal3/t3n-sdk 2.9.0 → 2.10.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/dist/index.d.ts
CHANGED
|
@@ -301,12 +301,19 @@ interface OidcCredentials {
|
|
|
301
301
|
interface BaseAuthInput {
|
|
302
302
|
method: AuthMethod;
|
|
303
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Ethereum authentication options
|
|
306
|
+
*/
|
|
307
|
+
interface EthAuthOptions {
|
|
308
|
+
ethDerived?: boolean;
|
|
309
|
+
}
|
|
304
310
|
/**
|
|
305
311
|
* Ethereum authentication input
|
|
306
312
|
*/
|
|
307
313
|
interface EthAuthInput extends BaseAuthInput {
|
|
308
314
|
method: AuthMethod.Ethereum;
|
|
309
315
|
address: string;
|
|
316
|
+
ethDerived?: boolean;
|
|
310
317
|
}
|
|
311
318
|
/**
|
|
312
319
|
* OIDC authentication input
|
|
@@ -322,7 +329,7 @@ type AuthInput = EthAuthInput | OidcAuthInput;
|
|
|
322
329
|
/**
|
|
323
330
|
* Helper functions to create auth inputs
|
|
324
331
|
*/
|
|
325
|
-
declare function createEthAuthInput(address: string): EthAuthInput;
|
|
332
|
+
declare function createEthAuthInput(address: string, options?: EthAuthOptions): EthAuthInput;
|
|
326
333
|
declare function createOidcAuthInput(credentials: OidcCredentials): OidcAuthInput;
|
|
327
334
|
|
|
328
335
|
/**
|
|
@@ -882,6 +889,10 @@ interface Transport {
|
|
|
882
889
|
* @returns Promise that resolves to the JSON-RPC response
|
|
883
890
|
*/
|
|
884
891
|
send(request: JsonRpcRequest, headers: Record<string, string>): Promise<JsonRpcResponse>;
|
|
892
|
+
/**
|
|
893
|
+
* Optionally send a JSON-RPC request with an attached binary blob.
|
|
894
|
+
*/
|
|
895
|
+
sendMultipart?(request: JsonRpcRequest, headers: Record<string, string>, blob: Blob): Promise<JsonRpcResponse>;
|
|
885
896
|
/**
|
|
886
897
|
* Optional accessor for the latest Set-Cookie header value.
|
|
887
898
|
* (Useful in Node.js demos/tests; browsers block HttpOnly cookies.)
|
|
@@ -904,6 +915,7 @@ declare class HttpTransport implements Transport {
|
|
|
904
915
|
getLastSetCookie(): string | null;
|
|
905
916
|
getLastResponseHeaders(): Record<string, string>;
|
|
906
917
|
send(request: JsonRpcRequest, headers: Record<string, string>): Promise<JsonRpcResponse>;
|
|
918
|
+
sendMultipart(request: JsonRpcRequest, headers: Record<string, string>, blob: Blob): Promise<JsonRpcResponse>;
|
|
907
919
|
}
|
|
908
920
|
/**
|
|
909
921
|
* Mock transport for testing
|
|
@@ -924,6 +936,7 @@ declare class MockTransport implements Transport {
|
|
|
924
936
|
private responseHeaders;
|
|
925
937
|
private lastResponseHeaders;
|
|
926
938
|
private requests;
|
|
939
|
+
private multipartRequests;
|
|
927
940
|
/**
|
|
928
941
|
* Mock a response for a specific method
|
|
929
942
|
*/
|
|
@@ -954,10 +967,16 @@ declare class MockTransport implements Transport {
|
|
|
954
967
|
request: JsonRpcRequest;
|
|
955
968
|
headers: Record<string, string>;
|
|
956
969
|
}>;
|
|
970
|
+
getMultipartRequests(): Array<{
|
|
971
|
+
request: JsonRpcRequest;
|
|
972
|
+
headers: Record<string, string>;
|
|
973
|
+
blob: Blob;
|
|
974
|
+
}>;
|
|
957
975
|
/**
|
|
958
976
|
* Clear all recorded requests
|
|
959
977
|
*/
|
|
960
978
|
clearRequests(): void;
|
|
979
|
+
sendMultipart(request: JsonRpcRequest, headers: Record<string, string>, blob: Blob): Promise<JsonRpcResponse>;
|
|
961
980
|
send(request: JsonRpcRequest, headers: Record<string, string>): Promise<JsonRpcResponse>;
|
|
962
981
|
}
|
|
963
982
|
|
|
@@ -1287,6 +1306,10 @@ declare class T3nClient {
|
|
|
1287
1306
|
* optionally validates it with a schema.
|
|
1288
1307
|
*/
|
|
1289
1308
|
execute(payload: unknown): Promise<string>;
|
|
1309
|
+
/**
|
|
1310
|
+
* Execute an action with an attached binary blob using multipart RPC.
|
|
1311
|
+
*/
|
|
1312
|
+
executeWithBlob(payload: unknown, blob: Blob): Promise<string>;
|
|
1290
1313
|
/**
|
|
1291
1314
|
* Execute an action and JSON-decode the response.
|
|
1292
1315
|
*
|
|
@@ -1627,6 +1650,7 @@ declare class T3nClient {
|
|
|
1627
1650
|
* Send an RPC request with automatic encryption/decryption
|
|
1628
1651
|
*/
|
|
1629
1652
|
private sendRpcRequest;
|
|
1653
|
+
private sendMultipartRpcRequest;
|
|
1630
1654
|
/**
|
|
1631
1655
|
* Capture the server-minted `Session-Id` from the last handshake
|
|
1632
1656
|
* response headers (pentest M-1 / MAT-983). Validates shape so a
|