shogun-core 3.3.5 → 3.3.6
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 +79919 -190726
- package/dist/browser/shogun-core.js.map +1 -1
- package/dist/{src/index.js → index.js} +0 -1
- package/dist/{src/managers → managers}/CoreInitializer.js +0 -6
- package/dist/{src/storage → storage}/storage.js +0 -16
- package/dist/types/{src/index.d.ts → index.d.ts} +0 -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/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/{src/config → config}/simplified-config.js +0 -0
- /package/dist/{src/core.js → core.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}/db.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}/AuthManager.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/core.d.ts → core.d.ts} +0 -0
- /package/dist/{src/types → types}/events.js +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}/db.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}/events.d.ts +0 -0
- /package/dist/types/{src/interfaces → interfaces}/plugin.d.ts +0 -0
- /package/dist/types/{src/interfaces → interfaces}/shogun.d.ts +0 -0
- /package/dist/types/{src/managers → managers}/AuthManager.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/{src/types → types}/shogun.js +0 -0
- /package/dist/types/{src/storage → storage}/storage.d.ts +0 -0
- /package/dist/types/{src/types → types}/events.d.ts +0 -0
- /package/dist/types/{src/types → types}/shogun.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
|
@@ -42,4 +42,3 @@ __exportStar(require("./utils/errorHandler"), exports);
|
|
|
42
42
|
__exportStar(require("./plugins"), exports);
|
|
43
43
|
__exportStar(require("./interfaces/shogun"), exports);
|
|
44
44
|
__exportStar(require("./config/simplified-config"), exports);
|
|
45
|
-
__exportStar(require("../ship"), exports);
|
|
@@ -62,9 +62,6 @@ class CoreInitializer {
|
|
|
62
62
|
* Initialize Gun instance
|
|
63
63
|
*/
|
|
64
64
|
async initializeGun(config) {
|
|
65
|
-
if (!config.silent) {
|
|
66
|
-
console.log("Initialize Gun instance", config);
|
|
67
|
-
}
|
|
68
65
|
try {
|
|
69
66
|
if (config.gunInstance && config.gunOptions === undefined) {
|
|
70
67
|
if (!config.silent) {
|
|
@@ -100,9 +97,6 @@ class CoreInitializer {
|
|
|
100
97
|
throw new Error(`Failed to create Gun instance: ${error}`);
|
|
101
98
|
}
|
|
102
99
|
try {
|
|
103
|
-
if (!config.silent) {
|
|
104
|
-
console.log("Initialize Gun instance", this.core.gun);
|
|
105
|
-
}
|
|
106
100
|
this.core.db = new gundb_1.DataBase(this.core._gun, config.gunOptions?.scope || "", { disableAutoRecall: config.disableAutoRecall, silent: config.silent });
|
|
107
101
|
// Note: user is a getter that returns _user, so we don't need to assign it
|
|
108
102
|
}
|
|
@@ -15,23 +15,12 @@ class ShogunStorage {
|
|
|
15
15
|
this.silent = silent;
|
|
16
16
|
this.isTestMode = process.env.NODE_ENV === "test";
|
|
17
17
|
this.useLocalStorage = false;
|
|
18
|
-
// Debug: log the environment (only if not silent)
|
|
19
|
-
if (!this.silent) {
|
|
20
|
-
console.log("ShogunStorage: NODE_ENV =", process.env.NODE_ENV);
|
|
21
|
-
console.log("ShogunStorage: isTestMode =", this.isTestMode);
|
|
22
|
-
}
|
|
23
18
|
// In test mode, don't use localStorage to avoid test pollution
|
|
24
19
|
if (this.isTestMode) {
|
|
25
20
|
this.useLocalStorage = false;
|
|
26
|
-
if (!this.silent) {
|
|
27
|
-
console.log("ShogunStorage: Test mode detected, localStorage disabled");
|
|
28
|
-
}
|
|
29
21
|
return;
|
|
30
22
|
}
|
|
31
23
|
if (typeof localStorage !== "undefined") {
|
|
32
|
-
if (!this.silent) {
|
|
33
|
-
console.log("ShogunStorage: localStorage is defined");
|
|
34
|
-
}
|
|
35
24
|
try {
|
|
36
25
|
// Probe localStorage without polluting expectations in tests
|
|
37
26
|
const testKey = "_shogun_test";
|
|
@@ -54,11 +43,6 @@ class ShogunStorage {
|
|
|
54
43
|
}
|
|
55
44
|
}
|
|
56
45
|
}
|
|
57
|
-
else {
|
|
58
|
-
if (!this.silent) {
|
|
59
|
-
console.log("ShogunStorage: localStorage is undefined");
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
46
|
}
|
|
63
47
|
/**
|
|
64
48
|
* Gets the stored keypair asynchronously
|
|
@@ -8,7 +8,6 @@ export * from "./utils/errorHandler";
|
|
|
8
8
|
export * from "./plugins";
|
|
9
9
|
export * from "./interfaces/shogun";
|
|
10
10
|
export * from "./config/simplified-config";
|
|
11
|
-
export * from "../ship";
|
|
12
11
|
export type * from "./interfaces/plugin";
|
|
13
12
|
export type { IGunUserInstance, IGunInstance, GunDataEventData, GunPeerEventData, DeriveOptions, TypedGunOperationResult, TypedAuthResult, };
|
|
14
13
|
export { Gun, ShogunCore, SEA, RxJS, crypto, derive, GunErrors, DataBase, SimpleGunAPI, QuickStart, quickStart, createSimpleAPI, AutoQuickStart, autoQuickStart, };
|
package/package.json
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shogun-core",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.6",
|
|
4
4
|
"description": "SHOGUN CORE - Core library for Shogun Ecosystem",
|
|
5
|
-
"main": "./dist/
|
|
6
|
-
"module": "./dist/
|
|
7
|
-
"types": "./dist/types/
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/types/
|
|
11
|
-
"import": "./dist/
|
|
12
|
-
"require": "./dist/
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.js",
|
|
13
13
|
"browser": "./dist/browser/shogun-core.js",
|
|
14
|
-
"default": "./dist/
|
|
15
|
-
"node": "./dist/
|
|
16
|
-
},
|
|
17
|
-
"./ship": {
|
|
18
|
-
"types": "./dist/types/ship/index.d.ts",
|
|
19
|
-
"import": "./dist/ship/index.js",
|
|
20
|
-
"require": "./dist/ship/index.js",
|
|
21
|
-
"default": "./dist/ship/index.js"
|
|
22
|
-
},
|
|
23
|
-
"./ship/interfaces/*": {
|
|
24
|
-
"types": "./dist/types/ship/interfaces/*.d.ts",
|
|
25
|
-
"import": "./dist/ship/interfaces/*.js",
|
|
26
|
-
"require": "./dist/ship/interfaces/*.js",
|
|
27
|
-
"default": "./dist/ship/interfaces/*.js"
|
|
14
|
+
"default": "./dist/index.js",
|
|
15
|
+
"node": "./dist/index.js"
|
|
28
16
|
}
|
|
29
17
|
},
|
|
30
18
|
"files": [
|
|
@@ -71,19 +59,15 @@
|
|
|
71
59
|
"constants-browserify": "^1.0.0",
|
|
72
60
|
"crypto-browserify": "^3.12.0",
|
|
73
61
|
"ethers": "^6.13.5",
|
|
74
|
-
"figlet": "^1.9.3",
|
|
75
|
-
"form-data": "^4.0.4",
|
|
76
62
|
"gun": "git+https://github.com/amark/gun.git",
|
|
77
63
|
"keccak256": "^1.0.6",
|
|
78
64
|
"nostr-tools": "^2.15.0",
|
|
79
65
|
"qs": "^6.14.0",
|
|
80
66
|
"rxjs": "^7.8.2",
|
|
81
|
-
"shogun-ipfs": "file:../shogun-ipfs",
|
|
82
67
|
"ts-node": "^10.9.2",
|
|
83
68
|
"url": "^0.11.4",
|
|
84
69
|
"uuid": "^11.1.0",
|
|
85
|
-
"vm-browserify": "^1.1.2"
|
|
86
|
-
"ws": "^8.18.3"
|
|
70
|
+
"vm-browserify": "^1.1.2"
|
|
87
71
|
},
|
|
88
72
|
"devDependencies": {
|
|
89
73
|
"@babel/core": "^7.24.3",
|