shogun-core 1.3.0 → 1.3.2

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/core.js CHANGED
@@ -110,6 +110,15 @@ class ShogunCore {
110
110
  (0, logger_1.logError)("Error initializing Gun user:", error);
111
111
  throw new Error(`Failed to initialize Gun user: ${error}`);
112
112
  }
113
+ this._gun.on("auth", (user) => {
114
+ (0, logger_1.log)("Gun auth event received", user);
115
+ this._user = this._gun.user();
116
+ this.eventEmitter.emit("auth:login", {
117
+ pub: user.pub,
118
+ alias: user.alias,
119
+ method: "recall",
120
+ });
121
+ });
113
122
  this.rx = new rxjs_integration_1.GunRxJS(this._gun);
114
123
  this.registerBuiltinPlugins(config);
115
124
  if (config.plugins?.autoRegister &&
@@ -592,34 +601,5 @@ class ShogunCore {
592
601
  getAuthMethod() {
593
602
  return this.currentAuthMethod;
594
603
  }
595
- // *********************************************************************************************************
596
- // 🔐 CRYPTO CONVENIENCE METHODS 🔐
597
- // *********************************************************************************************************
598
- /**
599
- * Encrypts data using Gun.SEA (convenience method)
600
- * @param data Data to encrypt
601
- * @param key Encryption key
602
- * @returns Promise that resolves with the encrypted data
603
- */
604
- async encrypt(data, key) {
605
- return this.gundb.encrypt(data, key);
606
- }
607
- /**
608
- * Decrypts data using Gun.SEA (convenience method)
609
- * @param encryptedData Encrypted data
610
- * @param key Decryption key
611
- * @returns Promise that resolves with the decrypted data
612
- */
613
- async decrypt(encryptedData, key) {
614
- return this.gundb.decrypt(encryptedData, key);
615
- }
616
- /**
617
- * Hashes text using Gun.SEA (convenience method)
618
- * @param text Text to hash
619
- * @returns Promise that resolves with the hashed text
620
- */
621
- async hashText(text) {
622
- return this.gundb.hashText(text);
623
- }
624
604
  }
625
605
  exports.ShogunCore = ShogunCore;
@@ -1026,7 +1026,7 @@ class GunInstance {
1026
1026
  }
1027
1027
  // Save security questions and encrypted hint
1028
1028
  await this.saveUserData("security", {
1029
- questions: securityQuestions,
1029
+ questions: JSON.stringify(securityQuestions),
1030
1030
  hint: encryptedHint,
1031
1031
  });
1032
1032
  return { success: true };
@@ -11,7 +11,6 @@ export * from "./gundb";
11
11
  export * from "./gundb/rxjs-integration";
12
12
  export * from "./plugins";
13
13
  export type * from "./types/plugin";
14
- export type * from "./utils/errorHandler";
15
14
  export type { IGunUserInstance, IGunInstance } from "./gundb/gun-es/gun-es";
16
15
  export { SEA, Gun };
17
16
  export * from "./types/shogun";
@@ -197,24 +196,4 @@ export declare class ShogunCore implements IShogunCore {
197
196
  * @returns The current authentication method or undefined if not set
198
197
  */
199
198
  getAuthMethod(): AuthMethod | undefined;
200
- /**
201
- * Encrypts data using Gun.SEA (convenience method)
202
- * @param data Data to encrypt
203
- * @param key Encryption key
204
- * @returns Promise that resolves with the encrypted data
205
- */
206
- encrypt(data: any, key: string): Promise<string>;
207
- /**
208
- * Decrypts data using Gun.SEA (convenience method)
209
- * @param encryptedData Encrypted data
210
- * @param key Decryption key
211
- * @returns Promise that resolves with the decrypted data
212
- */
213
- decrypt(encryptedData: string, key: string): Promise<string | any>;
214
- /**
215
- * Hashes text using Gun.SEA (convenience method)
216
- * @param text Text to hash
217
- * @returns Promise that resolves with the hashed text
218
- */
219
- hashText(text: string): Promise<string | any>;
220
199
  }
@@ -5,3 +5,4 @@ export * from "./errors";
5
5
  export * from "./utils";
6
6
  export * from "./crypto";
7
7
  export { default as derive } from "./derive";
8
+ export type { DeriveOptions } from "./derive";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shogun-core",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "SHOGUN SDK - Core library for Shogun SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",