shogun-core 2.0.3 → 3.0.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 +150 -19
- package/dist/browser/shogun-core.js +3241 -1286
- package/dist/browser/shogun-core.js.map +1 -1
- package/dist/config/simplified-config.js +230 -0
- package/dist/core.js +49 -571
- package/dist/gundb/db.js +466 -237
- package/dist/gundb/improved-types.js +4 -0
- package/dist/gundb/index.js +4 -0
- package/dist/gundb/simple-api.js +438 -0
- package/dist/index.js +8 -2
- package/dist/managers/AuthManager.js +225 -0
- package/dist/managers/CoreInitializer.js +227 -0
- package/dist/managers/EventManager.js +67 -0
- package/dist/managers/PluginManager.js +296 -0
- package/dist/migration-test.js +91 -0
- package/dist/plugins/nostr/nostrConnectorPlugin.js +1 -1
- package/dist/plugins/oauth/oauthPlugin.js +1 -1
- package/dist/plugins/webauthn/webauthnPlugin.js +1 -1
- package/dist/types/config/simplified-config.d.ts +114 -0
- package/dist/types/core.d.ts +13 -46
- package/dist/types/gundb/db.d.ts +92 -14
- package/dist/types/gundb/improved-types.d.ts +123 -0
- package/dist/types/gundb/index.d.ts +2 -0
- package/dist/types/gundb/rxjs.d.ts +3 -3
- package/dist/types/gundb/simple-api.d.ts +90 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/types/{types → interfaces}/shogun.d.ts +8 -10
- package/dist/types/managers/AuthManager.d.ts +69 -0
- package/dist/types/managers/CoreInitializer.d.ts +40 -0
- package/dist/types/managers/EventManager.d.ts +49 -0
- package/dist/types/managers/PluginManager.d.ts +145 -0
- package/dist/types/migration-test.d.ts +16 -0
- package/dist/types/plugins/base.d.ts +2 -2
- package/dist/types/plugins/index.d.ts +1 -1
- package/dist/types/plugins/nostr/nostrConnectorPlugin.d.ts +1 -1
- package/dist/types/plugins/nostr/types.d.ts +2 -2
- package/dist/types/plugins/oauth/oauthPlugin.d.ts +1 -1
- package/dist/types/plugins/oauth/types.d.ts +2 -2
- package/dist/types/plugins/web3/types.d.ts +2 -2
- package/dist/types/plugins/web3/web3ConnectorPlugin.d.ts +1 -1
- package/dist/types/plugins/webauthn/types.d.ts +2 -2
- package/dist/types/plugins/webauthn/webauthnPlugin.d.ts +1 -1
- package/dist/types/utils/errorHandler.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/{types → interfaces}/common.js +0 -0
- /package/dist/{types → interfaces}/events.js +0 -0
- /package/dist/{types → interfaces}/plugin.js +0 -0
- /package/dist/{types → interfaces}/shogun.js +0 -0
- /package/dist/types/{types → interfaces}/common.d.ts +0 -0
- /package/dist/types/{types → interfaces}/events.d.ts +0 -0
- /package/dist/types/{types → interfaces}/plugin.d.ts +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GunInstance, GunUserInstance } from "../gundb/improved-types";
|
|
2
|
+
import { ISEAPair } from "gun";
|
|
2
3
|
import { ethers } from "ethers";
|
|
3
4
|
import { ShogunError } from "../utils/errorHandler";
|
|
4
5
|
import { DataBase } from "../gundb/db";
|
|
@@ -37,7 +38,7 @@ export declare enum CorePlugins {
|
|
|
37
38
|
/** OAuth plugin */
|
|
38
39
|
OAuth = "oauth"
|
|
39
40
|
}
|
|
40
|
-
export type AuthMethod = "password" | "webauthn" | "web3" | "nostr" | "oauth" | "
|
|
41
|
+
export type AuthMethod = "password" | "webauthn" | "web3" | "nostr" | "oauth" | "pair";
|
|
41
42
|
export interface AuthResult {
|
|
42
43
|
success: boolean;
|
|
43
44
|
error?: string;
|
|
@@ -112,7 +113,8 @@ export interface SignUpResult {
|
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
115
|
export interface IShogunCore extends PluginManager {
|
|
115
|
-
gun:
|
|
116
|
+
gun: GunInstance;
|
|
117
|
+
user: GunUserInstance | null;
|
|
116
118
|
db: DataBase;
|
|
117
119
|
rx: RxJS;
|
|
118
120
|
storage: ShogunStorage;
|
|
@@ -126,7 +128,7 @@ export interface IShogunCore extends PluginManager {
|
|
|
126
128
|
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
127
129
|
getRecentErrors(count?: number): ShogunError[];
|
|
128
130
|
login(username: string, password: string): Promise<AuthResult>;
|
|
129
|
-
signUp(username: string, password
|
|
131
|
+
signUp(username: string, password?: string, pair?: ISEAPair | null): Promise<SignUpResult>;
|
|
130
132
|
getAuthenticationMethod(type: AuthMethod): any;
|
|
131
133
|
getCurrentUser(): {
|
|
132
134
|
pub: string;
|
|
@@ -150,12 +152,8 @@ export interface WebauthnConfig {
|
|
|
150
152
|
* Shogun SDK configuration
|
|
151
153
|
*/
|
|
152
154
|
export interface ShogunCoreConfig {
|
|
153
|
-
gunInstance?:
|
|
154
|
-
|
|
155
|
-
scope?: string;
|
|
156
|
-
peers?: string[];
|
|
157
|
-
localStorage?: boolean;
|
|
158
|
-
radisk?: boolean;
|
|
155
|
+
gunInstance?: GunInstance;
|
|
156
|
+
gunOptions?: any;
|
|
159
157
|
webauthn?: WebauthnConfig;
|
|
160
158
|
web3?: {
|
|
161
159
|
enabled?: boolean;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IShogunCore, AuthResult, SignUpResult, AuthMethod } from "../interfaces/shogun";
|
|
2
|
+
import { ISEAPair } from "gun";
|
|
3
|
+
/**
|
|
4
|
+
* Manages authentication operations for ShogunCore
|
|
5
|
+
*/
|
|
6
|
+
export declare class AuthManager {
|
|
7
|
+
private core;
|
|
8
|
+
private currentAuthMethod?;
|
|
9
|
+
constructor(core: IShogunCore);
|
|
10
|
+
/**
|
|
11
|
+
* Check if user is logged in
|
|
12
|
+
* @returns {boolean} True if user is logged in, false otherwise
|
|
13
|
+
* @description Verifies authentication status by checking GunInstance login state
|
|
14
|
+
* and presence of authentication credentials in storage
|
|
15
|
+
*/
|
|
16
|
+
isLoggedIn(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Perform user logout
|
|
19
|
+
* @description Logs out the current user from GunInstance and emits logout event.
|
|
20
|
+
* If user is not authenticated, the logout operation is ignored.
|
|
21
|
+
*/
|
|
22
|
+
logout(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Authenticate user with username and password
|
|
25
|
+
* @param username - Username
|
|
26
|
+
* @param password - User password
|
|
27
|
+
* @returns {Promise<AuthResult>} Promise with authentication result
|
|
28
|
+
* @description Attempts to log in user with provided credentials.
|
|
29
|
+
* Emits login event on success.
|
|
30
|
+
*/
|
|
31
|
+
login(username: string, password: string, pair?: ISEAPair | null): Promise<AuthResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Login with GunDB pair directly
|
|
34
|
+
* @param pair - GunDB SEA pair for authentication
|
|
35
|
+
* @returns {Promise<AuthResult>} Promise with authentication result
|
|
36
|
+
* @description Authenticates user using a GunDB pair directly.
|
|
37
|
+
* Emits login event on success.
|
|
38
|
+
*/
|
|
39
|
+
loginWithPair(pair: ISEAPair): Promise<AuthResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Register a new user with provided credentials
|
|
42
|
+
* @param username - Username
|
|
43
|
+
* @param password - Password
|
|
44
|
+
* @param email - Email (optional)
|
|
45
|
+
* @param pair - Pair of keys
|
|
46
|
+
* @returns {Promise<SignUpResult>} Registration result
|
|
47
|
+
* @description Creates a new user account with the provided credentials.
|
|
48
|
+
* Validates password requirements and emits signup event on success.
|
|
49
|
+
*/
|
|
50
|
+
signUp(username: string, password?: string, pair?: ISEAPair | null): Promise<SignUpResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Set the current authentication method
|
|
53
|
+
* This is used by plugins to indicate which authentication method was used
|
|
54
|
+
* @param method The authentication method used
|
|
55
|
+
*/
|
|
56
|
+
setAuthMethod(method: AuthMethod): void;
|
|
57
|
+
/**
|
|
58
|
+
* Get the current authentication method
|
|
59
|
+
* @returns The current authentication method or undefined if not set
|
|
60
|
+
*/
|
|
61
|
+
getAuthMethod(): AuthMethod | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Get an authentication method plugin by type
|
|
64
|
+
* @param type The type of authentication method
|
|
65
|
+
* @returns The authentication plugin or undefined if not available
|
|
66
|
+
* This is a more modern approach to accessing authentication methods
|
|
67
|
+
*/
|
|
68
|
+
getAuthenticationMethod(type: AuthMethod): unknown;
|
|
69
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IShogunCore, ShogunCoreConfig } from "../interfaces/shogun";
|
|
2
|
+
/**
|
|
3
|
+
* Handles initialization of ShogunCore components
|
|
4
|
+
*/
|
|
5
|
+
export declare class CoreInitializer {
|
|
6
|
+
private core;
|
|
7
|
+
constructor(core: IShogunCore);
|
|
8
|
+
/**
|
|
9
|
+
* Initialize the Shogun SDK
|
|
10
|
+
* @param config - SDK Configuration object
|
|
11
|
+
* @description Creates a new instance of ShogunCore with the provided configuration.
|
|
12
|
+
* Initializes all required components including storage, event emitter, GunInstance connection,
|
|
13
|
+
* and plugin system.
|
|
14
|
+
*/
|
|
15
|
+
initialize(config: ShogunCoreConfig): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Initialize Gun instance
|
|
18
|
+
*/
|
|
19
|
+
private initializeGun;
|
|
20
|
+
/**
|
|
21
|
+
* Initialize Gun user
|
|
22
|
+
*/
|
|
23
|
+
private initializeGunUser;
|
|
24
|
+
/**
|
|
25
|
+
* Setup Gun event forwarding
|
|
26
|
+
*/
|
|
27
|
+
private setupGunEventForwarding;
|
|
28
|
+
/**
|
|
29
|
+
* Setup wallet derivation
|
|
30
|
+
*/
|
|
31
|
+
private setupWalletDerivation;
|
|
32
|
+
/**
|
|
33
|
+
* Register built-in plugins based on configuration
|
|
34
|
+
*/
|
|
35
|
+
private registerBuiltinPlugins;
|
|
36
|
+
/**
|
|
37
|
+
* Initialize async components
|
|
38
|
+
*/
|
|
39
|
+
private initializeAsync;
|
|
40
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ShogunEventEmitter, ShogunEventMap } from "../interfaces/events";
|
|
2
|
+
/**
|
|
3
|
+
* Manages event operations for ShogunCore
|
|
4
|
+
*/
|
|
5
|
+
export declare class EventManager {
|
|
6
|
+
private eventEmitter;
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Emits an event through the core's event emitter.
|
|
10
|
+
* Plugins should use this method to emit events instead of accessing the private eventEmitter directly.
|
|
11
|
+
* @param eventName The name of the event to emit.
|
|
12
|
+
* @param data The data to pass with the event.
|
|
13
|
+
* @returns {boolean} Indicates if the event had listeners.
|
|
14
|
+
*/
|
|
15
|
+
emit<K extends keyof ShogunEventMap>(eventName: K, data?: ShogunEventMap[K] extends void ? never : ShogunEventMap[K]): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Add an event listener
|
|
18
|
+
* @param eventName The name of the event to listen for
|
|
19
|
+
* @param listener The callback function to execute when the event is emitted
|
|
20
|
+
* @returns {this} Returns this instance for method chaining
|
|
21
|
+
*/
|
|
22
|
+
on<K extends keyof ShogunEventMap>(eventName: K, listener: ShogunEventMap[K] extends void ? () => void : (data: ShogunEventMap[K]) => void): this;
|
|
23
|
+
/**
|
|
24
|
+
* Add a one-time event listener
|
|
25
|
+
* @param eventName The name of the event to listen for
|
|
26
|
+
* @param listener The callback function to execute when the event is emitted
|
|
27
|
+
* @returns {this} Returns this instance for method chaining
|
|
28
|
+
*/
|
|
29
|
+
once<K extends keyof ShogunEventMap>(eventName: K, listener: ShogunEventMap[K] extends void ? () => void : (data: ShogunEventMap[K]) => void): this;
|
|
30
|
+
/**
|
|
31
|
+
* Remove an event listener
|
|
32
|
+
* @param eventName The name of the event to stop listening for
|
|
33
|
+
* @param listener The callback function to remove
|
|
34
|
+
* @returns {this} Returns this instance for method chaining
|
|
35
|
+
*/
|
|
36
|
+
off<K extends keyof ShogunEventMap>(eventName: K, listener: ShogunEventMap[K] extends void ? () => void : (data: ShogunEventMap[K]) => void): this;
|
|
37
|
+
/**
|
|
38
|
+
* Remove all listeners for a specific event or all events
|
|
39
|
+
* @param eventName Optional. The name of the event to remove listeners for.
|
|
40
|
+
* If not provided, all listeners for all events are removed.
|
|
41
|
+
* @returns {this} Returns this instance for method chaining
|
|
42
|
+
*/
|
|
43
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
44
|
+
/**
|
|
45
|
+
* Get the underlying event emitter instance
|
|
46
|
+
* @returns The ShogunEventEmitter instance
|
|
47
|
+
*/
|
|
48
|
+
getEventEmitter(): ShogunEventEmitter;
|
|
49
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { ShogunPlugin } from "../interfaces/plugin";
|
|
2
|
+
import { PluginCategory } from "../interfaces/shogun";
|
|
3
|
+
import { IShogunCore } from "../interfaces/shogun";
|
|
4
|
+
/**
|
|
5
|
+
* Manages plugin registration, validation, and lifecycle
|
|
6
|
+
*/
|
|
7
|
+
export declare class PluginManager {
|
|
8
|
+
private plugins;
|
|
9
|
+
private core;
|
|
10
|
+
constructor(core: IShogunCore);
|
|
11
|
+
/**
|
|
12
|
+
* Register a plugin with the Shogun SDK
|
|
13
|
+
* @param plugin Plugin instance to register
|
|
14
|
+
* @throws Error if a plugin with the same name is already registered
|
|
15
|
+
*/
|
|
16
|
+
register(plugin: ShogunPlugin): void;
|
|
17
|
+
/**
|
|
18
|
+
* Unregister a plugin from the Shogun SDK
|
|
19
|
+
* @param name Name of the plugin to unregister
|
|
20
|
+
*/
|
|
21
|
+
unregister(name: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a registered plugin by name
|
|
24
|
+
* @param name Name of the plugin
|
|
25
|
+
* @returns The requested plugin or undefined if not found
|
|
26
|
+
* @template T Type of the plugin or its public interface
|
|
27
|
+
*/
|
|
28
|
+
getPlugin<T = ShogunPlugin>(name: string): T | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Get information about all registered plugins
|
|
31
|
+
* @returns Array of plugin information objects
|
|
32
|
+
*/
|
|
33
|
+
getPluginsInfo(): Array<{
|
|
34
|
+
name: string;
|
|
35
|
+
version: string;
|
|
36
|
+
category?: PluginCategory;
|
|
37
|
+
description?: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Get the total number of registered plugins
|
|
41
|
+
* @returns Number of registered plugins
|
|
42
|
+
*/
|
|
43
|
+
getPluginCount(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Check if all plugins are properly initialized
|
|
46
|
+
* @returns Object with initialization status for each plugin
|
|
47
|
+
*/
|
|
48
|
+
getPluginsInitializationStatus(): Record<string, {
|
|
49
|
+
initialized: boolean;
|
|
50
|
+
error?: string;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Validate plugin system integrity
|
|
54
|
+
* @returns Object with validation results
|
|
55
|
+
*/
|
|
56
|
+
validatePluginSystem(): {
|
|
57
|
+
totalPlugins: number;
|
|
58
|
+
initializedPlugins: number;
|
|
59
|
+
failedPlugins: string[];
|
|
60
|
+
warnings: string[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Attempt to reinitialize failed plugins
|
|
64
|
+
* @returns Object with reinitialization results
|
|
65
|
+
*/
|
|
66
|
+
reinitializeFailedPlugins(): {
|
|
67
|
+
success: string[];
|
|
68
|
+
failed: Array<{
|
|
69
|
+
name: string;
|
|
70
|
+
error: string;
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Check plugin compatibility with current ShogunCore version
|
|
75
|
+
* @returns Object with compatibility information
|
|
76
|
+
*/
|
|
77
|
+
checkPluginCompatibility(): {
|
|
78
|
+
compatible: Array<{
|
|
79
|
+
name: string;
|
|
80
|
+
version: string;
|
|
81
|
+
}>;
|
|
82
|
+
incompatible: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
version: string;
|
|
85
|
+
reason: string;
|
|
86
|
+
}>;
|
|
87
|
+
unknown: Array<{
|
|
88
|
+
name: string;
|
|
89
|
+
version: string;
|
|
90
|
+
}>;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Get comprehensive debug information about the plugin system
|
|
94
|
+
* @returns Complete plugin system debug information
|
|
95
|
+
*/
|
|
96
|
+
getPluginSystemDebugInfo(): {
|
|
97
|
+
shogunCoreVersion: string;
|
|
98
|
+
totalPlugins: number;
|
|
99
|
+
plugins: Array<{
|
|
100
|
+
name: string;
|
|
101
|
+
version: string;
|
|
102
|
+
category?: PluginCategory;
|
|
103
|
+
description?: string;
|
|
104
|
+
initialized: boolean;
|
|
105
|
+
error?: string;
|
|
106
|
+
}>;
|
|
107
|
+
initializationStatus: Record<string, {
|
|
108
|
+
initialized: boolean;
|
|
109
|
+
error?: string;
|
|
110
|
+
}>;
|
|
111
|
+
validation: {
|
|
112
|
+
totalPlugins: number;
|
|
113
|
+
initializedPlugins: number;
|
|
114
|
+
failedPlugins: string[];
|
|
115
|
+
warnings: string[];
|
|
116
|
+
};
|
|
117
|
+
compatibility: {
|
|
118
|
+
compatible: Array<{
|
|
119
|
+
name: string;
|
|
120
|
+
version: string;
|
|
121
|
+
}>;
|
|
122
|
+
incompatible: Array<{
|
|
123
|
+
name: string;
|
|
124
|
+
version: string;
|
|
125
|
+
reason: string;
|
|
126
|
+
}>;
|
|
127
|
+
unknown: Array<{
|
|
128
|
+
name: string;
|
|
129
|
+
version: string;
|
|
130
|
+
}>;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Check if a plugin is registered
|
|
135
|
+
* @param name Name of the plugin to check
|
|
136
|
+
* @returns true if the plugin is registered, false otherwise
|
|
137
|
+
*/
|
|
138
|
+
hasPlugin(name: string): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Get all plugins of a specific category
|
|
141
|
+
* @param category Category of plugins to filter
|
|
142
|
+
* @returns Array of plugins in the specified category
|
|
143
|
+
*/
|
|
144
|
+
getPluginsByCategory(category: PluginCategory): ShogunPlugin[];
|
|
145
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration test file to verify that the refactored ShogunCore
|
|
3
|
+
* maintains the same public API as the original implementation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Test function to verify API compatibility
|
|
7
|
+
*/
|
|
8
|
+
export declare function testApiCompatibility(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Test that the refactored implementation maintains the same static properties
|
|
11
|
+
*/
|
|
12
|
+
export declare function testStaticProperties(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Run all compatibility tests
|
|
15
|
+
*/
|
|
16
|
+
export declare function runCompatibilityTests(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ShogunCore } from "../core";
|
|
2
|
-
import { ShogunPlugin } from "../
|
|
3
|
-
import { PluginCategory } from "../
|
|
2
|
+
import { ShogunPlugin } from "../interfaces/plugin";
|
|
3
|
+
import { PluginCategory } from "../interfaces/shogun";
|
|
4
4
|
import { EventEmitter } from "../utils/eventEmitter";
|
|
5
5
|
/**
|
|
6
6
|
* Classe base per tutti i plugin di ShogunCore
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BasePlugin } from "./base";
|
|
2
|
-
export type { ShogunPlugin, PluginManager } from "../
|
|
2
|
+
export type { ShogunPlugin, PluginManager } from "../interfaces/plugin";
|
|
3
3
|
export { Webauthn } from "./webauthn/webauthn";
|
|
4
4
|
export { WebauthnPlugin } from "./webauthn/webauthnPlugin";
|
|
5
5
|
export type { WebauthnPluginInterface } from "./webauthn/types";
|
|
@@ -2,7 +2,7 @@ import { BasePlugin } from "../base";
|
|
|
2
2
|
import { ShogunCore } from "../../core";
|
|
3
3
|
import { NostrSigningCredential } from "./nostrSigner";
|
|
4
4
|
import { NostrConnectorCredentials, ConnectionResult, NostrConnectorPluginInterface } from "./types";
|
|
5
|
-
import { AuthResult, SignUpResult } from "../../
|
|
5
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
6
6
|
/**
|
|
7
7
|
* Plugin for managing Bitcoin wallet functionality in ShogunCore
|
|
8
8
|
* Supports Alby, Nostr extensions, or direct key management
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseConfig, BaseResult, BaseCacheEntry } from "../../
|
|
2
|
-
import { AuthResult, SignUpResult } from "../../
|
|
1
|
+
import { BaseConfig, BaseResult, BaseCacheEntry } from "../../interfaces/common";
|
|
2
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
3
3
|
/**
|
|
4
4
|
* Result of connection attempt
|
|
5
5
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BasePlugin } from "../base";
|
|
2
2
|
import { ShogunCore } from "../../core";
|
|
3
3
|
import { OAuthPluginInterface, OAuthConfig, OAuthProvider, OAuthConnectionResult, OAuthCredentials, OAuthUserInfo } from "./types";
|
|
4
|
-
import { AuthResult, SignUpResult } from "../../
|
|
4
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
5
5
|
/**
|
|
6
6
|
* OAuth Plugin for ShogunCore
|
|
7
7
|
* Provides authentication with external OAuth providers
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseConfig, BaseResult, BaseCacheEntry } from "../../
|
|
2
|
-
import { AuthResult, SignUpResult } from "../../
|
|
1
|
+
import { BaseConfig, BaseResult, BaseCacheEntry } from "../../interfaces/common";
|
|
2
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
3
3
|
/**
|
|
4
4
|
* Supported OAuth providers
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISEAPair } from "gun";
|
|
2
|
-
import { BaseConfig, BaseResult, BaseCacheEntry } from "../../
|
|
3
|
-
import { AuthResult, SignUpResult } from "../../
|
|
2
|
+
import { BaseConfig, BaseResult, BaseCacheEntry } from "../../interfaces/common";
|
|
3
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
4
4
|
/**
|
|
5
5
|
* Result of connection attempt
|
|
6
6
|
*/
|
|
@@ -3,7 +3,7 @@ import { ShogunCore } from "../../core";
|
|
|
3
3
|
import { Web3SigningCredential } from "./web3Signer";
|
|
4
4
|
import { ConnectionResult, Web3ConnectorPluginInterface } from "./types";
|
|
5
5
|
import { ethers } from "ethers";
|
|
6
|
-
import { AuthResult, SignUpResult } from "../../
|
|
6
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
7
7
|
import { ISEAPair } from "gun";
|
|
8
8
|
/**
|
|
9
9
|
* Plugin per la gestione delle funzionalità Web3 in ShogunCore
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthResult, SignUpResult } from "../../
|
|
2
|
-
import { BaseEvent, BaseConfig, BaseDeviceInfo, BaseResult, BaseAuthResult } from "../../
|
|
1
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
2
|
+
import { BaseEvent, BaseConfig, BaseDeviceInfo, BaseResult, BaseAuthResult } from "../../interfaces/common";
|
|
3
3
|
/**
|
|
4
4
|
* WebAuthn types definitions
|
|
5
5
|
*/
|
|
@@ -2,7 +2,7 @@ import { BasePlugin } from "../base";
|
|
|
2
2
|
import { ShogunCore } from "../../core";
|
|
3
3
|
import { WebAuthnSigningCredential } from "./webauthnSigner";
|
|
4
4
|
import { WebAuthnCredentials, CredentialResult, WebauthnPluginInterface, WebAuthnUniformCredentials } from "./types";
|
|
5
|
-
import { AuthResult, SignUpResult } from "../../
|
|
5
|
+
import { AuthResult, SignUpResult } from "../../interfaces/shogun";
|
|
6
6
|
/**
|
|
7
7
|
* Plugin per la gestione delle funzionalità WebAuthn in ShogunCore
|
|
8
8
|
*/
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|