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.
Files changed (149) hide show
  1. package/dist/browser/shogun-core.js +81267 -192044
  2. package/dist/browser/shogun-core.js.map +1 -1
  3. package/dist/{src/core.js → core.js} +2 -2
  4. package/dist/{src/gundb → gundb}/db.js +44 -15
  5. package/dist/{src/index.js → index.js} +0 -1
  6. package/dist/{src/managers → managers}/AuthManager.js +4 -3
  7. package/dist/{src/managers → managers}/CoreInitializer.js +1 -7
  8. package/dist/{src/storage → storage}/storage.js +0 -16
  9. package/dist/types/{src/core.d.ts → core.d.ts} +1 -1
  10. package/dist/types/{src/gundb → gundb}/db.d.ts +15 -6
  11. package/dist/types/{src/index.d.ts → index.d.ts} +0 -1
  12. package/dist/types/{src/interfaces → interfaces}/events.d.ts +1 -1
  13. package/dist/types/{src/interfaces → interfaces}/shogun.d.ts +7 -1
  14. package/dist/types/{src/managers → managers}/AuthManager.d.ts +1 -1
  15. package/package.json +10 -26
  16. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js +0 -4078
  17. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js.map +0 -1
  18. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_is-ipfs_dist_src_index_js.shogun-core.js +0 -4908
  19. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_is-ipfs_dist_src_index_js.shogun-core.js.map +0 -1
  20. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_uint8-varint_dist_src_index_js-node_modu-0db5ba.shogun-core.js +0 -2109
  21. 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
  22. package/dist/ship/examples/identity-cli.js +0 -511
  23. package/dist/ship/examples/messenger-cli.js +0 -745
  24. package/dist/ship/examples/stealth-cli.js +0 -433
  25. package/dist/ship/examples/storage-cli.js +0 -615
  26. package/dist/ship/examples/vault-cli.js +0 -444
  27. package/dist/ship/examples/wallet-cli.js +0 -767
  28. package/dist/ship/implementation/SHIP_00.js +0 -478
  29. package/dist/ship/implementation/SHIP_01.js +0 -433
  30. package/dist/ship/implementation/SHIP_02.js +0 -1366
  31. package/dist/ship/implementation/SHIP_03.js +0 -855
  32. package/dist/ship/implementation/SHIP_04.js +0 -589
  33. package/dist/ship/implementation/SHIP_05.js +0 -1064
  34. package/dist/ship/implementation/SHIP_06.js +0 -635
  35. package/dist/ship/index.js +0 -17
  36. package/dist/ship/interfaces/ISHIP_00.js +0 -135
  37. package/dist/ship/interfaces/ISHIP_01.js +0 -128
  38. package/dist/ship/interfaces/ISHIP_02.js +0 -57
  39. package/dist/ship/interfaces/ISHIP_03.js +0 -61
  40. package/dist/ship/interfaces/ISHIP_04.js +0 -62
  41. package/dist/ship/interfaces/ISHIP_05.js +0 -59
  42. package/dist/ship/interfaces/ISHIP_06.js +0 -194
  43. package/dist/src/types/events.js +0 -70
  44. package/dist/src/types/shogun.js +0 -21
  45. package/dist/types/ship/examples/identity-cli.d.ts +0 -40
  46. package/dist/types/ship/examples/messenger-cli.d.ts +0 -37
  47. package/dist/types/ship/examples/stealth-cli.d.ts +0 -31
  48. package/dist/types/ship/examples/storage-cli.d.ts +0 -48
  49. package/dist/types/ship/examples/vault-cli.d.ts +0 -13
  50. package/dist/types/ship/examples/wallet-cli.d.ts +0 -131
  51. package/dist/types/ship/implementation/SHIP_00.d.ts +0 -113
  52. package/dist/types/ship/implementation/SHIP_01.d.ts +0 -80
  53. package/dist/types/ship/implementation/SHIP_02.d.ts +0 -297
  54. package/dist/types/ship/implementation/SHIP_03.d.ts +0 -127
  55. package/dist/types/ship/implementation/SHIP_04.d.ts +0 -76
  56. package/dist/types/ship/implementation/SHIP_05.d.ts +0 -70
  57. package/dist/types/ship/implementation/SHIP_06.d.ts +0 -101
  58. package/dist/types/ship/index.d.ts +0 -14
  59. package/dist/types/ship/interfaces/ISHIP_00.d.ts +0 -410
  60. package/dist/types/ship/interfaces/ISHIP_01.d.ts +0 -343
  61. package/dist/types/ship/interfaces/ISHIP_02.d.ts +0 -470
  62. package/dist/types/ship/interfaces/ISHIP_03.d.ts +0 -295
  63. package/dist/types/ship/interfaces/ISHIP_04.d.ts +0 -245
  64. package/dist/types/ship/interfaces/ISHIP_05.d.ts +0 -234
  65. package/dist/types/ship/interfaces/ISHIP_06.d.ts +0 -522
  66. package/dist/types/src/types/events.d.ts +0 -59
  67. package/dist/types/src/types/shogun.d.ts +0 -188
  68. /package/dist/{src/config → config}/simplified-config.js +0 -0
  69. /package/dist/{src/examples → examples}/api-test.js +0 -0
  70. /package/dist/{src/examples → examples}/simple-api-test.js +0 -0
  71. /package/dist/{src/gundb → gundb}/api.js +0 -0
  72. /package/dist/{src/gundb → gundb}/crypto.js +0 -0
  73. /package/dist/{src/gundb → gundb}/derive.js +0 -0
  74. /package/dist/{src/gundb → gundb}/errors.js +0 -0
  75. /package/dist/{src/gundb → gundb}/index.js +0 -0
  76. /package/dist/{src/gundb → gundb}/rxjs.js +0 -0
  77. /package/dist/{src/gundb → gundb}/types.js +0 -0
  78. /package/dist/{src/interfaces → interfaces}/common.js +0 -0
  79. /package/dist/{src/interfaces → interfaces}/events.js +0 -0
  80. /package/dist/{src/interfaces → interfaces}/plugin.js +0 -0
  81. /package/dist/{src/interfaces → interfaces}/shogun.js +0 -0
  82. /package/dist/{src/managers → managers}/EventManager.js +0 -0
  83. /package/dist/{src/managers → managers}/PluginManager.js +0 -0
  84. /package/dist/{src/migration-test.js → migration-test.js} +0 -0
  85. /package/dist/{src/plugins → plugins}/base.js +0 -0
  86. /package/dist/{src/plugins → plugins}/index.js +0 -0
  87. /package/dist/{src/plugins → plugins}/nostr/index.js +0 -0
  88. /package/dist/{src/plugins → plugins}/nostr/nostrConnector.js +0 -0
  89. /package/dist/{src/plugins → plugins}/nostr/nostrConnectorPlugin.js +0 -0
  90. /package/dist/{src/plugins → plugins}/nostr/nostrSigner.js +0 -0
  91. /package/dist/{src/plugins → plugins}/nostr/types.js +0 -0
  92. /package/dist/{src/plugins → plugins}/oauth/index.js +0 -0
  93. /package/dist/{src/plugins → plugins}/oauth/oauthConnector.js +0 -0
  94. /package/dist/{src/plugins → plugins}/oauth/oauthPlugin.js +0 -0
  95. /package/dist/{src/plugins → plugins}/oauth/types.js +0 -0
  96. /package/dist/{src/plugins → plugins}/web3/index.js +0 -0
  97. /package/dist/{src/plugins → plugins}/web3/types.js +0 -0
  98. /package/dist/{src/plugins → plugins}/web3/web3Connector.js +0 -0
  99. /package/dist/{src/plugins → plugins}/web3/web3ConnectorPlugin.js +0 -0
  100. /package/dist/{src/plugins → plugins}/web3/web3Signer.js +0 -0
  101. /package/dist/{src/plugins → plugins}/webauthn/index.js +0 -0
  102. /package/dist/{src/plugins → plugins}/webauthn/types.js +0 -0
  103. /package/dist/{src/plugins → plugins}/webauthn/webauthn.js +0 -0
  104. /package/dist/{src/plugins → plugins}/webauthn/webauthnPlugin.js +0 -0
  105. /package/dist/{src/plugins → plugins}/webauthn/webauthnSigner.js +0 -0
  106. /package/dist/types/{src/config → config}/simplified-config.d.ts +0 -0
  107. /package/dist/types/{src/examples → examples}/api-test.d.ts +0 -0
  108. /package/dist/types/{src/examples → examples}/simple-api-test.d.ts +0 -0
  109. /package/dist/types/{src/gundb → gundb}/api.d.ts +0 -0
  110. /package/dist/types/{src/gundb → gundb}/crypto.d.ts +0 -0
  111. /package/dist/types/{src/gundb → gundb}/derive.d.ts +0 -0
  112. /package/dist/types/{src/gundb → gundb}/errors.d.ts +0 -0
  113. /package/dist/types/{src/gundb → gundb}/index.d.ts +0 -0
  114. /package/dist/types/{src/gundb → gundb}/rxjs.d.ts +0 -0
  115. /package/dist/types/{src/gundb → gundb}/types.d.ts +0 -0
  116. /package/dist/types/{src/interfaces → interfaces}/common.d.ts +0 -0
  117. /package/dist/types/{src/interfaces → interfaces}/plugin.d.ts +0 -0
  118. /package/dist/types/{src/managers → managers}/CoreInitializer.d.ts +0 -0
  119. /package/dist/types/{src/managers → managers}/EventManager.d.ts +0 -0
  120. /package/dist/types/{src/managers → managers}/PluginManager.d.ts +0 -0
  121. /package/dist/types/{src/migration-test.d.ts → migration-test.d.ts} +0 -0
  122. /package/dist/types/{src/plugins → plugins}/base.d.ts +0 -0
  123. /package/dist/types/{src/plugins → plugins}/index.d.ts +0 -0
  124. /package/dist/types/{src/plugins → plugins}/nostr/index.d.ts +0 -0
  125. /package/dist/types/{src/plugins → plugins}/nostr/nostrConnector.d.ts +0 -0
  126. /package/dist/types/{src/plugins → plugins}/nostr/nostrConnectorPlugin.d.ts +0 -0
  127. /package/dist/types/{src/plugins → plugins}/nostr/nostrSigner.d.ts +0 -0
  128. /package/dist/types/{src/plugins → plugins}/nostr/types.d.ts +0 -0
  129. /package/dist/types/{src/plugins → plugins}/oauth/index.d.ts +0 -0
  130. /package/dist/types/{src/plugins → plugins}/oauth/oauthConnector.d.ts +0 -0
  131. /package/dist/types/{src/plugins → plugins}/oauth/oauthPlugin.d.ts +0 -0
  132. /package/dist/types/{src/plugins → plugins}/oauth/types.d.ts +0 -0
  133. /package/dist/types/{src/plugins → plugins}/web3/index.d.ts +0 -0
  134. /package/dist/types/{src/plugins → plugins}/web3/types.d.ts +0 -0
  135. /package/dist/types/{src/plugins → plugins}/web3/web3Connector.d.ts +0 -0
  136. /package/dist/types/{src/plugins → plugins}/web3/web3ConnectorPlugin.d.ts +0 -0
  137. /package/dist/types/{src/plugins → plugins}/web3/web3Signer.d.ts +0 -0
  138. /package/dist/types/{src/plugins → plugins}/webauthn/index.d.ts +0 -0
  139. /package/dist/types/{src/plugins → plugins}/webauthn/types.d.ts +0 -0
  140. /package/dist/types/{src/plugins → plugins}/webauthn/webauthn.d.ts +0 -0
  141. /package/dist/types/{src/plugins → plugins}/webauthn/webauthnPlugin.d.ts +0 -0
  142. /package/dist/types/{src/plugins → plugins}/webauthn/webauthnSigner.d.ts +0 -0
  143. /package/dist/types/{src/storage → storage}/storage.d.ts +0 -0
  144. /package/dist/types/{src/utils → utils}/errorHandler.d.ts +0 -0
  145. /package/dist/types/{src/utils → utils}/eventEmitter.d.ts +0 -0
  146. /package/dist/types/{src/utils → utils}/validation.d.ts +0 -0
  147. /package/dist/{src/utils → utils}/errorHandler.js +0 -0
  148. /package/dist/{src/utils → utils}/eventEmitter.js +0 -0
  149. /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