@toothpic.eu/react-native-toothpic-sdk 1.0.2 → 1.0.3

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": "@toothpic.eu/react-native-toothpic-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "ToothPic SDK for React Native",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -9,6 +9,9 @@
9
9
  "exports": {
10
10
  ".": "./dist/index.js"
11
11
  },
12
+ "files": [
13
+ "dist"
14
+ ],
12
15
  "scripts": {
13
16
  "build": "tsc",
14
17
  "test": "echo \"Error: no test specified\" && exit 1"
package/index.ts DELETED
@@ -1,63 +0,0 @@
1
- import { ErrorCodes, GenerationData, KeyType, SignatureData, State, ToothPicError } from './types';
2
-
3
-
4
- async function generateCredential(premiumService: boolean, premiumUser: boolean, verifyGeneration: boolean, listener: (event: State) => void): Promise<GenerationData> {
5
-
6
- return parseGenerationData()
7
- }
8
- async function signWithCredential(keyID: string, messageToSign: Uint8Array, listener: (event: State) => void): Promise<SignatureData> {
9
-
10
- return parseSignatureData()
11
- }
12
-
13
- function getVersion(): Promise<string> {
14
- return Promise.resolve("");
15
- }
16
-
17
-
18
- async function getKeyType(keyID: string): Promise<KeyType> {
19
- return Promise.resolve(KeyType.TOOTHPIC);
20
- }
21
-
22
- function getPublicKey(keyID: string): Promise<string> {
23
- return Promise.resolve("");
24
- }
25
-
26
- function getKeys(): Promise<Array<string>> {
27
- return Promise.resolve([]);
28
- }
29
-
30
- function isPremiumSupported(): Promise<boolean> {
31
- return Promise.resolve(true);
32
- }
33
-
34
- function deleteKey(keyID: string): Promise<boolean> {
35
- return Promise.resolve(true);
36
- }
37
-
38
- function deleteAllKeys(): void {
39
-
40
- }
41
-
42
- function parseGenerationData(): GenerationData {
43
- return {
44
- keyID: "",
45
- publicKey: new Uint8Array(),
46
- certificate: new Uint8Array(),
47
- exportedCredential: undefined,
48
- shootParameters: "",
49
- };
50
- }
51
-
52
- function parseSignatureData(): SignatureData {
53
- return {
54
- signature: new Uint8Array(),
55
- shootParameters: ""
56
- };
57
- }
58
-
59
- export const ToothPicSDK = {
60
- generateCredential, signWithCredential, getVersion, getKeyType, getPublicKey, getKeys, deleteKey, deleteAllKeys, isPremiumSupported
61
- }
62
- export type { GenerationData, SignatureData };
63
- export { ToothPicError, ErrorCodes, State, KeyType };
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2019",
4
- "module": "CommonJS",
5
- "declaration": true,
6
- "outDir": "dist",
7
- "strict": true
8
- },
9
- "include": ["src/**/*", "index.ts"]
10
- }
package/types.ts DELETED
@@ -1,39 +0,0 @@
1
- export interface GenerationData {
2
- keyID: string;
3
- publicKey: Uint8Array;
4
- certificate: Uint8Array;
5
- exportedCredential?: Uint8Array;
6
- shootParameters: string;
7
- }
8
-
9
- export interface SignatureData {
10
- signature: Uint8Array;
11
- shootParameters: string
12
- }
13
-
14
-
15
- export enum ErrorCodes {
16
-
17
- }
18
-
19
- export enum State {
20
- }
21
-
22
-
23
- export enum KeyType {
24
- TOOTHPIC = "TOOTHPIC"
25
- }
26
-
27
- export class ToothPicError extends Error {
28
- code: number
29
-
30
- constructor(error: any) {
31
- super(error.message)
32
- this.code = error.code
33
- }
34
-
35
- toString(): string {
36
- return "ToothPicError: { message: " + this.message + ", code: " + this.code + "}";
37
- }
38
- }
39
-