@subnoto/api-client 1.1.0
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/README.md +68 -0
- package/index.d.ts +3 -0
- package/index.js +4 -0
- package/oak_session_wasm_nodejs_bg.wasm +0 -0
- package/package.json +34 -0
- package/src/base-client.d.ts +4 -0
- package/src/client.d.ts +15 -0
- package/src/client.test.d.ts +1 -0
- package/src/generated/api.gen.d.ts +4227 -0
- package/src/helpers/uploadDocument.d.ts +11 -0
- package/src/middleware/signature.d.ts +3 -0
- package/src/middleware/tunnel.d.ts +3 -0
- package/src/session.d.ts +18 -0
- package/src/types.d.ts +16 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SubnotoClient } from "../client.js";
|
|
2
|
+
export interface UploadDocumentOptions {
|
|
3
|
+
workspaceUuid: string;
|
|
4
|
+
fileBuffer: Buffer;
|
|
5
|
+
envelopeTitle: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UploadDocumentResult {
|
|
8
|
+
envelopeUuid: string;
|
|
9
|
+
documentUuid: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function uploadDocument(client: SubnotoClient, options: UploadDocumentOptions): Promise<UploadDocumentResult>;
|
package/src/session.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SubnotoConfig } from "./types.js";
|
|
2
|
+
export declare class SessionManager {
|
|
3
|
+
private session;
|
|
4
|
+
private sessionId;
|
|
5
|
+
private config;
|
|
6
|
+
private handshakeInProgress;
|
|
7
|
+
private cookieJar;
|
|
8
|
+
constructor(config: SubnotoConfig);
|
|
9
|
+
ensureSession(): Promise<void>;
|
|
10
|
+
private handshake;
|
|
11
|
+
encryptRequest(plaintext: string | Buffer): Buffer;
|
|
12
|
+
decryptResponse(encrypted: Uint8Array | Buffer): Buffer;
|
|
13
|
+
getSessionId(): string | null;
|
|
14
|
+
getCookies(url: string): Promise<string>;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
getAttestationResults(): string | null;
|
|
17
|
+
getAttestationStatus(): string | null;
|
|
18
|
+
}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ApiCredentials {
|
|
2
|
+
accessKey: string;
|
|
3
|
+
secretKey: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SubnotoConfig {
|
|
6
|
+
apiBaseUrl: string;
|
|
7
|
+
accessKey: string;
|
|
8
|
+
secretKey: string;
|
|
9
|
+
unattested?: boolean;
|
|
10
|
+
attesterKey?: Buffer;
|
|
11
|
+
}
|
|
12
|
+
export declare class SubnotoError extends Error {
|
|
13
|
+
statusCode?: number | undefined;
|
|
14
|
+
code?: string | undefined;
|
|
15
|
+
constructor(message: string, statusCode?: number | undefined, code?: string | undefined);
|
|
16
|
+
}
|