shogun-core 3.3.5 → 3.3.7
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/dist/browser/shogun-core.js +81267 -192044
- package/dist/browser/shogun-core.js.map +1 -1
- package/dist/{src/core.js → core.js} +2 -2
- package/dist/{src/gundb → gundb}/db.js +44 -15
- package/dist/{src/index.js → index.js} +0 -1
- package/dist/{src/managers → managers}/AuthManager.js +4 -3
- package/dist/{src/managers → managers}/CoreInitializer.js +1 -7
- package/dist/{src/storage → storage}/storage.js +0 -16
- package/dist/types/{src/core.d.ts → core.d.ts} +1 -1
- package/dist/types/{src/gundb → gundb}/db.d.ts +15 -6
- package/dist/types/{src/index.d.ts → index.d.ts} +0 -1
- package/dist/types/{src/interfaces → interfaces}/events.d.ts +1 -1
- package/dist/types/{src/interfaces → interfaces}/shogun.d.ts +7 -1
- package/dist/types/{src/managers → managers}/AuthManager.d.ts +1 -1
- package/package.json +10 -26
- package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js +0 -4078
- package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js.map +0 -1
- package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_is-ipfs_dist_src_index_js.shogun-core.js +0 -4908
- package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_is-ipfs_dist_src_index_js.shogun-core.js.map +0 -1
- package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_uint8-varint_dist_src_index_js-node_modu-0db5ba.shogun-core.js +0 -2109
- package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_uint8-varint_dist_src_index_js-node_modu-0db5ba.shogun-core.js.map +0 -1
- package/dist/ship/examples/identity-cli.js +0 -511
- package/dist/ship/examples/messenger-cli.js +0 -745
- package/dist/ship/examples/stealth-cli.js +0 -433
- package/dist/ship/examples/storage-cli.js +0 -615
- package/dist/ship/examples/vault-cli.js +0 -444
- package/dist/ship/examples/wallet-cli.js +0 -767
- package/dist/ship/implementation/SHIP_00.js +0 -478
- package/dist/ship/implementation/SHIP_01.js +0 -433
- package/dist/ship/implementation/SHIP_02.js +0 -1366
- package/dist/ship/implementation/SHIP_03.js +0 -855
- package/dist/ship/implementation/SHIP_04.js +0 -589
- package/dist/ship/implementation/SHIP_05.js +0 -1064
- package/dist/ship/implementation/SHIP_06.js +0 -635
- package/dist/ship/index.js +0 -17
- package/dist/ship/interfaces/ISHIP_00.js +0 -135
- package/dist/ship/interfaces/ISHIP_01.js +0 -128
- package/dist/ship/interfaces/ISHIP_02.js +0 -57
- package/dist/ship/interfaces/ISHIP_03.js +0 -61
- package/dist/ship/interfaces/ISHIP_04.js +0 -62
- package/dist/ship/interfaces/ISHIP_05.js +0 -59
- package/dist/ship/interfaces/ISHIP_06.js +0 -194
- package/dist/src/types/events.js +0 -70
- package/dist/src/types/shogun.js +0 -21
- package/dist/types/ship/examples/identity-cli.d.ts +0 -40
- package/dist/types/ship/examples/messenger-cli.d.ts +0 -37
- package/dist/types/ship/examples/stealth-cli.d.ts +0 -31
- package/dist/types/ship/examples/storage-cli.d.ts +0 -48
- package/dist/types/ship/examples/vault-cli.d.ts +0 -13
- package/dist/types/ship/examples/wallet-cli.d.ts +0 -131
- package/dist/types/ship/implementation/SHIP_00.d.ts +0 -113
- package/dist/types/ship/implementation/SHIP_01.d.ts +0 -80
- package/dist/types/ship/implementation/SHIP_02.d.ts +0 -297
- package/dist/types/ship/implementation/SHIP_03.d.ts +0 -127
- package/dist/types/ship/implementation/SHIP_04.d.ts +0 -76
- package/dist/types/ship/implementation/SHIP_05.d.ts +0 -70
- package/dist/types/ship/implementation/SHIP_06.d.ts +0 -101
- package/dist/types/ship/index.d.ts +0 -14
- package/dist/types/ship/interfaces/ISHIP_00.d.ts +0 -410
- package/dist/types/ship/interfaces/ISHIP_01.d.ts +0 -343
- package/dist/types/ship/interfaces/ISHIP_02.d.ts +0 -470
- package/dist/types/ship/interfaces/ISHIP_03.d.ts +0 -295
- package/dist/types/ship/interfaces/ISHIP_04.d.ts +0 -245
- package/dist/types/ship/interfaces/ISHIP_05.d.ts +0 -234
- package/dist/types/ship/interfaces/ISHIP_06.d.ts +0 -522
- package/dist/types/src/types/events.d.ts +0 -59
- package/dist/types/src/types/shogun.d.ts +0 -188
- /package/dist/{src/config → config}/simplified-config.js +0 -0
- /package/dist/{src/examples → examples}/api-test.js +0 -0
- /package/dist/{src/examples → examples}/simple-api-test.js +0 -0
- /package/dist/{src/gundb → gundb}/api.js +0 -0
- /package/dist/{src/gundb → gundb}/crypto.js +0 -0
- /package/dist/{src/gundb → gundb}/derive.js +0 -0
- /package/dist/{src/gundb → gundb}/errors.js +0 -0
- /package/dist/{src/gundb → gundb}/index.js +0 -0
- /package/dist/{src/gundb → gundb}/rxjs.js +0 -0
- /package/dist/{src/gundb → gundb}/types.js +0 -0
- /package/dist/{src/interfaces → interfaces}/common.js +0 -0
- /package/dist/{src/interfaces → interfaces}/events.js +0 -0
- /package/dist/{src/interfaces → interfaces}/plugin.js +0 -0
- /package/dist/{src/interfaces → interfaces}/shogun.js +0 -0
- /package/dist/{src/managers → managers}/EventManager.js +0 -0
- /package/dist/{src/managers → managers}/PluginManager.js +0 -0
- /package/dist/{src/migration-test.js → migration-test.js} +0 -0
- /package/dist/{src/plugins → plugins}/base.js +0 -0
- /package/dist/{src/plugins → plugins}/index.js +0 -0
- /package/dist/{src/plugins → plugins}/nostr/index.js +0 -0
- /package/dist/{src/plugins → plugins}/nostr/nostrConnector.js +0 -0
- /package/dist/{src/plugins → plugins}/nostr/nostrConnectorPlugin.js +0 -0
- /package/dist/{src/plugins → plugins}/nostr/nostrSigner.js +0 -0
- /package/dist/{src/plugins → plugins}/nostr/types.js +0 -0
- /package/dist/{src/plugins → plugins}/oauth/index.js +0 -0
- /package/dist/{src/plugins → plugins}/oauth/oauthConnector.js +0 -0
- /package/dist/{src/plugins → plugins}/oauth/oauthPlugin.js +0 -0
- /package/dist/{src/plugins → plugins}/oauth/types.js +0 -0
- /package/dist/{src/plugins → plugins}/web3/index.js +0 -0
- /package/dist/{src/plugins → plugins}/web3/types.js +0 -0
- /package/dist/{src/plugins → plugins}/web3/web3Connector.js +0 -0
- /package/dist/{src/plugins → plugins}/web3/web3ConnectorPlugin.js +0 -0
- /package/dist/{src/plugins → plugins}/web3/web3Signer.js +0 -0
- /package/dist/{src/plugins → plugins}/webauthn/index.js +0 -0
- /package/dist/{src/plugins → plugins}/webauthn/types.js +0 -0
- /package/dist/{src/plugins → plugins}/webauthn/webauthn.js +0 -0
- /package/dist/{src/plugins → plugins}/webauthn/webauthnPlugin.js +0 -0
- /package/dist/{src/plugins → plugins}/webauthn/webauthnSigner.js +0 -0
- /package/dist/types/{src/config → config}/simplified-config.d.ts +0 -0
- /package/dist/types/{src/examples → examples}/api-test.d.ts +0 -0
- /package/dist/types/{src/examples → examples}/simple-api-test.d.ts +0 -0
- /package/dist/types/{src/gundb → gundb}/api.d.ts +0 -0
- /package/dist/types/{src/gundb → gundb}/crypto.d.ts +0 -0
- /package/dist/types/{src/gundb → gundb}/derive.d.ts +0 -0
- /package/dist/types/{src/gundb → gundb}/errors.d.ts +0 -0
- /package/dist/types/{src/gundb → gundb}/index.d.ts +0 -0
- /package/dist/types/{src/gundb → gundb}/rxjs.d.ts +0 -0
- /package/dist/types/{src/gundb → gundb}/types.d.ts +0 -0
- /package/dist/types/{src/interfaces → interfaces}/common.d.ts +0 -0
- /package/dist/types/{src/interfaces → interfaces}/plugin.d.ts +0 -0
- /package/dist/types/{src/managers → managers}/CoreInitializer.d.ts +0 -0
- /package/dist/types/{src/managers → managers}/EventManager.d.ts +0 -0
- /package/dist/types/{src/managers → managers}/PluginManager.d.ts +0 -0
- /package/dist/types/{src/migration-test.d.ts → migration-test.d.ts} +0 -0
- /package/dist/types/{src/plugins → plugins}/base.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/index.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/nostr/index.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/nostr/nostrConnector.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/nostr/nostrConnectorPlugin.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/nostr/nostrSigner.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/nostr/types.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/oauth/index.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/oauth/oauthConnector.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/oauth/oauthPlugin.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/oauth/types.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/web3/index.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/web3/types.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/web3/web3Connector.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/web3/web3ConnectorPlugin.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/web3/web3Signer.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/webauthn/index.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/webauthn/types.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/webauthn/webauthn.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/webauthn/webauthnPlugin.d.ts +0 -0
- /package/dist/types/{src/plugins → plugins}/webauthn/webauthnSigner.d.ts +0 -0
- /package/dist/types/{src/storage → storage}/storage.d.ts +0 -0
- /package/dist/types/{src/utils → utils}/errorHandler.d.ts +0 -0
- /package/dist/types/{src/utils → utils}/eventEmitter.d.ts +0 -0
- /package/dist/types/{src/utils → utils}/validation.d.ts +0 -0
- /package/dist/{src/utils → utils}/errorHandler.js +0 -0
- /package/dist/{src/utils → utils}/eventEmitter.js +0 -0
- /package/dist/{src/utils → utils}/validation.js +0 -0
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core types and interfaces for Shogun SDK
|
|
3
|
-
*/
|
|
4
|
-
export declare enum PluginCategory {
|
|
5
|
-
Authentication = "authentication",
|
|
6
|
-
Wallet = "wallet",
|
|
7
|
-
Privacy = "privacy",
|
|
8
|
-
Identity = "identity",
|
|
9
|
-
Utility = "utility"
|
|
10
|
-
}
|
|
11
|
-
export declare enum CorePlugins {
|
|
12
|
-
WebAuthn = "webauthn",
|
|
13
|
-
Web3 = "web3",
|
|
14
|
-
Nostr = "nostr",
|
|
15
|
-
OAuth = "oauth"
|
|
16
|
-
}
|
|
17
|
-
export type AuthMethod = "password" | "webauthn" | "web3" | "nostr" | "oauth" | "bitcoin" | "pair";
|
|
18
|
-
export interface ISEAPair {
|
|
19
|
-
pub: string;
|
|
20
|
-
priv: string;
|
|
21
|
-
epub: string;
|
|
22
|
-
epriv: string;
|
|
23
|
-
}
|
|
24
|
-
export interface AuthResult {
|
|
25
|
-
success: boolean;
|
|
26
|
-
userPub?: string;
|
|
27
|
-
username?: string;
|
|
28
|
-
sessionToken?: string;
|
|
29
|
-
authMethod: AuthMethod;
|
|
30
|
-
sea?: ISEAPair;
|
|
31
|
-
error?: string;
|
|
32
|
-
provider?: string;
|
|
33
|
-
redirectUrl?: string;
|
|
34
|
-
pendingAuth?: boolean;
|
|
35
|
-
message?: string;
|
|
36
|
-
isNewUser?: boolean;
|
|
37
|
-
user?: {
|
|
38
|
-
userPub: string;
|
|
39
|
-
username: string;
|
|
40
|
-
email?: string;
|
|
41
|
-
name?: string;
|
|
42
|
-
picture?: string;
|
|
43
|
-
oauth?: {
|
|
44
|
-
provider: string;
|
|
45
|
-
id: string;
|
|
46
|
-
email: string;
|
|
47
|
-
name: string;
|
|
48
|
-
picture: string;
|
|
49
|
-
lastLogin: number;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
export interface SignUpResult {
|
|
54
|
-
success: boolean;
|
|
55
|
-
userPub?: string;
|
|
56
|
-
username?: string;
|
|
57
|
-
pub?: string;
|
|
58
|
-
authMethod?: AuthMethod;
|
|
59
|
-
sessionToken?: string;
|
|
60
|
-
isNewUser?: boolean;
|
|
61
|
-
sea?: ISEAPair;
|
|
62
|
-
error?: string;
|
|
63
|
-
message?: string;
|
|
64
|
-
provider?: string;
|
|
65
|
-
redirectUrl?: string;
|
|
66
|
-
pendingAuth?: boolean;
|
|
67
|
-
user?: {
|
|
68
|
-
userPub: string;
|
|
69
|
-
username: string;
|
|
70
|
-
email?: string;
|
|
71
|
-
name?: string;
|
|
72
|
-
picture?: string;
|
|
73
|
-
oauth?: {
|
|
74
|
-
provider: string;
|
|
75
|
-
id: string;
|
|
76
|
-
email: string;
|
|
77
|
-
name: string;
|
|
78
|
-
picture: string;
|
|
79
|
-
lastLogin: number;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
export interface WebauthnConfig {
|
|
84
|
-
enabled: boolean;
|
|
85
|
-
rpName?: string;
|
|
86
|
-
rpId?: string;
|
|
87
|
-
}
|
|
88
|
-
export interface Web3Config {
|
|
89
|
-
enabled: boolean;
|
|
90
|
-
}
|
|
91
|
-
export interface NostrConfig {
|
|
92
|
-
enabled: boolean;
|
|
93
|
-
}
|
|
94
|
-
export interface OAuthProviderConfig {
|
|
95
|
-
clientId: string;
|
|
96
|
-
clientSecret?: string;
|
|
97
|
-
}
|
|
98
|
-
export interface OAuthConfig {
|
|
99
|
-
enabled: boolean;
|
|
100
|
-
usePKCE?: boolean;
|
|
101
|
-
allowUnsafeClientSecret?: boolean;
|
|
102
|
-
providers?: {
|
|
103
|
-
google?: OAuthProviderConfig;
|
|
104
|
-
github?: OAuthProviderConfig;
|
|
105
|
-
[key: string]: OAuthProviderConfig | undefined;
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
export interface TimeoutsConfig {
|
|
109
|
-
login?: number;
|
|
110
|
-
signup?: number;
|
|
111
|
-
operation?: number;
|
|
112
|
-
}
|
|
113
|
-
export interface PluginsConfig {
|
|
114
|
-
autoRegister?: string[];
|
|
115
|
-
}
|
|
116
|
-
export interface ShogunSDKConfig {
|
|
117
|
-
gunInstance?: any;
|
|
118
|
-
authToken?: string;
|
|
119
|
-
scope?: string;
|
|
120
|
-
peers?: string[];
|
|
121
|
-
webauthn?: WebauthnConfig;
|
|
122
|
-
web3?: Web3Config;
|
|
123
|
-
nostr?: NostrConfig;
|
|
124
|
-
oauth?: OAuthConfig;
|
|
125
|
-
timeouts?: TimeoutsConfig;
|
|
126
|
-
plugins?: PluginsConfig;
|
|
127
|
-
appToken?: string;
|
|
128
|
-
gunOptions?: any;
|
|
129
|
-
disableAutoRecall?: boolean;
|
|
130
|
-
silent?: boolean;
|
|
131
|
-
}
|
|
132
|
-
export interface ShogunEvents {
|
|
133
|
-
error: (data: any) => void;
|
|
134
|
-
"auth:signup": (data: any) => void;
|
|
135
|
-
"auth:login": (data: any) => void;
|
|
136
|
-
"auth:logout": () => void;
|
|
137
|
-
"auth:username_changed": (data: any) => void;
|
|
138
|
-
"wallet:created": (data: any) => void;
|
|
139
|
-
"gun:put": (data: any) => void;
|
|
140
|
-
"gun:get": (data: any) => void;
|
|
141
|
-
"gun:set": (data: any) => void;
|
|
142
|
-
"gun:remove": (data: any) => void;
|
|
143
|
-
"gun:peer:add": (data: any) => void;
|
|
144
|
-
"gun:peer:remove": (data: any) => void;
|
|
145
|
-
"gun:peer:connect": (data: any) => void;
|
|
146
|
-
"gun:peer:disconnect": (data: any) => void;
|
|
147
|
-
"plugin:registered": (data: any) => void;
|
|
148
|
-
"plugin:unregistered": (data: any) => void;
|
|
149
|
-
debug: (data: any) => void;
|
|
150
|
-
}
|
|
151
|
-
export interface Wallets {
|
|
152
|
-
secp256k1Bitcoin?: {
|
|
153
|
-
privateKey: string;
|
|
154
|
-
publicKey: string;
|
|
155
|
-
address: string;
|
|
156
|
-
};
|
|
157
|
-
secp256k1Ethereum?: {
|
|
158
|
-
privateKey: string;
|
|
159
|
-
publicKey: string;
|
|
160
|
-
address: string;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
export interface IShogunCore {
|
|
164
|
-
registerPlugin: (plugin: any) => void;
|
|
165
|
-
unregisterPlugin: (pluginName: string) => void;
|
|
166
|
-
getPlugin: (name: string) => any;
|
|
167
|
-
getPlugins: () => any[];
|
|
168
|
-
hasPlugin: (name: string) => boolean;
|
|
169
|
-
gun: any;
|
|
170
|
-
db: any;
|
|
171
|
-
rx: any;
|
|
172
|
-
storage: any;
|
|
173
|
-
config: any;
|
|
174
|
-
on: (eventName: string, listener: Function) => any;
|
|
175
|
-
off: (eventName: string, listener: Function) => any;
|
|
176
|
-
once: (eventName: string, listener: Function) => any;
|
|
177
|
-
removeAllListeners: (eventName?: string) => any;
|
|
178
|
-
emit: (eventName: string, data?: any) => boolean;
|
|
179
|
-
getRecentErrors: (count?: number) => any[];
|
|
180
|
-
login: (username: string, password: string, pair?: any) => Promise<AuthResult>;
|
|
181
|
-
signUp: (username: string, password?: string, pair?: any) => Promise<SignUpResult>;
|
|
182
|
-
getAuthenticationMethod: (type: AuthMethod) => any;
|
|
183
|
-
getCurrentUser: () => any;
|
|
184
|
-
changeUsername: (newUsername: string) => Promise<any>;
|
|
185
|
-
logout: () => void;
|
|
186
|
-
isLoggedIn: () => boolean;
|
|
187
|
-
}
|
|
188
|
-
export type ShogunCoreConfig = ShogunSDKConfig;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|