@jokio/sdk 0.1.9 → 0.1.11
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 +1 -1
- package/dist/auth.service.d.ts +25 -0
- package/dist/common/playAudioFromBuffer.d.ts +1 -0
- package/dist/crypto.service.d.ts +9 -0
- package/dist/index.d.ts +18 -0
- package/dist/jokio.sdk.es.js +8534 -0
- package/dist/nats.service.d.ts +45 -0
- package/dist/tts.service.d.ts +13 -0
- package/dist/voicevoxTts.d.ts +11 -0
- package/package.json +11 -4
- package/.prettierrc +0 -12
- package/package-lock.json +0 -1062
- package/src/auth.service.ts +0 -152
- package/src/common/playAudioFromBuffer.ts +0 -15
- package/src/crypto.service.ts +0 -100
- package/src/index.ts +0 -39
- package/src/nats.service.ts +0 -348
- package/src/tts.service.ts +0 -153
- package/src/voicevoxTts.ts +0 -94
- package/tsconfig.json +0 -14
- package/vite.config.ts +0 -23
- /package/{test → dist}/index.html +0 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@jokio/sdk)
|
|
6
6
|
|
|
7
7
|
SDK for building decentralised localfirst web apps.
|
|
8
|
-
Provides tts ai model integrations, realtime
|
|
8
|
+
Provides authentication (guest, passkeys, email), tts ai model integrations, realtime communication & crypto encryptions.
|
|
9
9
|
|
|
10
10
|
# Examples
|
|
11
11
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type Config = {
|
|
2
|
+
authUrl: string;
|
|
3
|
+
};
|
|
4
|
+
export declare class AuthService {
|
|
5
|
+
private config;
|
|
6
|
+
constructor(config: Config);
|
|
7
|
+
requestEmailLogin(email: string, returnUrl?: string): Promise<boolean>;
|
|
8
|
+
completeEmailLogin(email: string, otpCode: string): Promise<IdentityUser>;
|
|
9
|
+
requestPasskeyLogin(opts?: {
|
|
10
|
+
displayName?: string;
|
|
11
|
+
isRegistration?: boolean;
|
|
12
|
+
addAsAdditionalDevice?: boolean;
|
|
13
|
+
}): Promise<IdentityUser>;
|
|
14
|
+
guestLogin(): Promise<IdentityUser>;
|
|
15
|
+
clearLoginData(): Promise<void>;
|
|
16
|
+
getLastLoginData(): any;
|
|
17
|
+
}
|
|
18
|
+
export type IdentityUser = {
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
userId: string;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
verified: boolean;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function playAudioFromBuffer(buffer: ArrayBuffer): HTMLAudioElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class CryptoService {
|
|
2
|
+
createSessionKeyPair(): Promise<CryptoKeyPair>;
|
|
3
|
+
exportPublicKey(publicKey: CryptoKey): Promise<string>;
|
|
4
|
+
deriveAESKey(privateKey: CryptoKey, publicKeyString: string): Promise<CryptoKey>;
|
|
5
|
+
exportRawKey(key: CryptoKey): Promise<string>;
|
|
6
|
+
encrypt(text: string, key: CryptoKey): Promise<string>;
|
|
7
|
+
decrypt(encryptedText: string, key: CryptoKey): Promise<string>;
|
|
8
|
+
hashString(text: string): Promise<string>;
|
|
9
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AuthService } from './auth.service';
|
|
2
|
+
import { CryptoService } from './crypto.service';
|
|
3
|
+
import { NatsService } from './nats.service';
|
|
4
|
+
import { EdgeTtsService } from './tts.service';
|
|
5
|
+
export { NatsService } from './nats.service';
|
|
6
|
+
export { VoicevoxTtsService } from './voicevoxTts';
|
|
7
|
+
type Config = {
|
|
8
|
+
debug: boolean;
|
|
9
|
+
authUrl: string;
|
|
10
|
+
natsUrl: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const jok: {
|
|
13
|
+
setup(config: Partial<Config>): void;
|
|
14
|
+
auth: AuthService;
|
|
15
|
+
tts: EdgeTtsService;
|
|
16
|
+
nats: NatsService<unknown>;
|
|
17
|
+
crypto: CryptoService;
|
|
18
|
+
};
|