@reservation-studio/electron-types 0.0.7 → 0.0.8
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.
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare enum IpcActions {
|
|
2
|
-
FETCH_CERTIFICATES = "
|
|
3
|
-
CHECK_CERTIFICATE_PIN = "
|
|
4
|
-
XML_SIGN = "xml
|
|
5
|
-
GET_VERSION = "get-version"
|
|
2
|
+
FETCH_CERTIFICATES = "certificates:list",
|
|
3
|
+
CHECK_CERTIFICATE_PIN = "certificates:is-valid-pin",
|
|
4
|
+
XML_SIGN = "xml:sign",
|
|
5
|
+
GET_VERSION = "get-version",
|
|
6
|
+
RELOAD_WINDOW = "reload-window",
|
|
7
|
+
HTTP_GET = "http:get",
|
|
8
|
+
HTTP_POST = "http:post"
|
|
6
9
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CertificateInfo } from './certificate-info.interface';
|
|
2
|
+
import { HttpOptions, HttpResponse } from './http.interface';
|
|
2
3
|
export interface ApiInterface {
|
|
3
4
|
/**
|
|
4
5
|
* Represents the certificates functionality for managing and retrieving certificate information.
|
|
@@ -22,10 +23,29 @@ export interface ApiInterface {
|
|
|
22
23
|
xml: {
|
|
23
24
|
sign(xml: string, certificateId: string, pin?: string): Promise<string>;
|
|
24
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* An HTTP utility object that provides methods to make HTTP requests.
|
|
28
|
+
* This object can be used to send HTTP POST and GET requests.
|
|
29
|
+
*
|
|
30
|
+
* @property {function} post - Sends an HTTP POST request to the specified URL with the provided data and optional configurations.
|
|
31
|
+
* @property {function} get - Sends an HTTP GET request to the specified URL with optional configurations.
|
|
32
|
+
*/
|
|
33
|
+
http: {
|
|
34
|
+
post(url: string, data: any, options?: HttpOptions): Promise<HttpResponse>;
|
|
35
|
+
get(url: string, options?: HttpOptions): Promise<HttpResponse>;
|
|
36
|
+
};
|
|
25
37
|
/**
|
|
26
38
|
* Retrieves the current version of the application.
|
|
27
39
|
*
|
|
28
40
|
* @return {Promise<string>} A promise that resolves to a string representing the version.
|
|
29
41
|
*/
|
|
30
42
|
version(): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Triggers a reload operation. This method is generally used to refresh or reset
|
|
45
|
+
* the state of a system, component, or application. The specific behavior of the
|
|
46
|
+
* reload operation may vary based on the implementation.
|
|
47
|
+
*
|
|
48
|
+
* @return {Promise<void>} A promise that resolves when the reload operation is complete.
|
|
49
|
+
*/
|
|
50
|
+
reload(): Promise<void>;
|
|
31
51
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface HttpResponse {
|
|
2
|
+
status: number;
|
|
3
|
+
statusText: string;
|
|
4
|
+
headers: Record<string, string>;
|
|
5
|
+
data: any;
|
|
6
|
+
ok: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface HttpOptions {
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
responseType?: 'json' | 'text' | 'arraybuffer' | 'blob';
|
|
12
|
+
withCredentials?: boolean;
|
|
13
|
+
params?: Record<string, string>;
|
|
14
|
+
}
|