@reservation-studio/electron-types 0.0.8 → 0.0.10

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 ADDED
@@ -0,0 +1 @@
1
+ # @reservation-studio/electron-types
@@ -9,19 +9,19 @@ export interface ApiInterface {
9
9
  */
10
10
  certificates: {
11
11
  list(): Promise<CertificateInfo[]>;
12
- isValidPin(certificateId: string, pin: string): Promise<boolean>;
12
+ isValidPin(slot: number, pin: string): Promise<boolean>;
13
13
  };
14
14
  /**
15
- * Provides functionality to handle XML signing operations.
15
+ * An object containing functionality related to XML operations.
16
16
  *
17
- * @property {Function} sign - Signs an XML string with a specified digital certificate.
18
- * @param {string} xml - The XML content to be signed.
19
- * @param {string} certificateId - The identifier of the certificate to use for signing.
20
- * @param {string} [pin] - Optional PIN code associated with the digital certificate.
21
- * @returns {Promise<string>} A promise that resolves with the signed XML content as a string.
17
+ * @property {function} sign - A function to sign an XML string using a specified slot and PIN.
18
+ * @param {string} xml - The XML string to be signed.
19
+ * @param {number} slot - The slot number to be used for signing.
20
+ * @param {string} pin - The PIN associated with the slot for authentication.
21
+ * @returns {Promise<string>} A promise that resolves to the signed XML string.
22
22
  */
23
23
  xml: {
24
- sign(xml: string, certificateId: string, pin?: string): Promise<string>;
24
+ sign(xml: string, slot: number, pin: string): Promise<string>;
25
25
  };
26
26
  /**
27
27
  * An HTTP utility object that provides methods to make HTTP requests.
@@ -1,8 +1,21 @@
1
+ /**
2
+ * Represents information about a certificate that includes the slot number and name.
3
+ */
1
4
  export interface CertificateInfo {
2
- id: string;
3
- commonName?: string;
4
- organization?: string;
5
- country?: string;
6
- email?: string;
5
+ /**
6
+ * The slot number associated with the certificate.
7
+ * This is typically used to identify the location or index of the certificate
8
+ * in a storage or hardware module.
9
+ */
10
+ slot: number;
11
+ /**
12
+ * The name of the certificate.
13
+ * This is often used for identification or descriptive purposes.
14
+ */
7
15
  name: string;
16
+ /**
17
+ * The serial number of the certificate.
18
+ * This is used to uniquely identify the certificate.
19
+ */
20
+ serialNumber: string;
8
21
  }
@@ -1,14 +1,38 @@
1
+ /**
2
+ * Interface representing an HTTP response.
3
+ */
1
4
  export interface HttpResponse {
5
+ /**
6
+ * The HTTP status code of the response.
7
+ */
2
8
  status: number;
3
- statusText: string;
9
+ /**
10
+ * The headers returned in the HTTP response as key-value pairs.
11
+ */
4
12
  headers: Record<string, string>;
13
+ /**
14
+ * The response data, which can be any type depending on the request.
15
+ */
5
16
  data: any;
6
- ok: boolean;
17
+ /**
18
+ * Flag indicating whether an error occurred during the HTTP request.
19
+ */
20
+ error: boolean;
7
21
  }
22
+ /**
23
+ * Interface representing options for an HTTP request.
24
+ */
8
25
  export interface HttpOptions {
26
+ /**
27
+ * Optional headers to include in the HTTP request, represented as key-value pairs.
28
+ */
9
29
  headers?: Record<string, string>;
30
+ /**
31
+ * Optional timeout for the HTTP request, specified in milliseconds.
32
+ */
10
33
  timeout?: number;
11
- responseType?: 'json' | 'text' | 'arraybuffer' | 'blob';
12
- withCredentials?: boolean;
34
+ /**
35
+ * Optional query parameters to include in the HTTP request, represented as key-value pairs.
36
+ */
13
37
  params?: Record<string, string>;
14
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reservation-studio/electron-types",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "TypeScript типове за ReservationStudioElectron",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -17,7 +17,7 @@
17
17
  "license": "Proprietary - Reservation.Studio",
18
18
  "devDependencies": {
19
19
  "typescript": "^4.5.4",
20
- "@types/node": "^20"
20
+ "@types/node": "^22"
21
21
  },
22
22
  "files": [
23
23
  "dist"
package/README.md DELETED
@@ -1 +0,0 @@
1
- # @reservation-studio/electron-types