@overmap-ai/core 1.0.60-sdk-refactor.4 → 1.0.60-sdk-refactor.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.
@@ -1,13 +1,18 @@
1
1
  import request from "superagent";
2
- import { BaseState, RegistrationPayload, RegistrationReturn } from "../../typings";
2
+ import { BaseState } from "../../typings";
3
3
  import type { BaseSDK } from "../base";
4
+ import { TokenPair } from "../typings";
4
5
  import { BaseAuthService } from "./BaseAuthService";
5
6
  /**
6
7
  * Handles login, logout and renewing tokens
7
8
  */
8
9
  export declare abstract class JWTService<TState extends BaseState, TSDK extends BaseSDK<TState>> extends BaseAuthService<TState, TSDK> {
9
- private _getAccessToken;
10
- private _getRefreshToken;
10
+ protected abstract initTokensUrl: string;
11
+ protected abstract refreshTokensUrl: string;
12
+ protected abstract setTokens: (tokens: TokenPair) => void;
13
+ protected abstract clearTokens: () => void;
14
+ protected abstract getAccessToken: () => string;
15
+ protected abstract getRefreshToken: () => string;
11
16
  /**
12
17
  * Takes refresh token and gets a new token pair
13
18
  * @async
@@ -18,7 +23,7 @@ export declare abstract class JWTService<TState extends BaseState, TSDK extends
18
23
  /**
19
24
  * Logs the user out
20
25
  */
21
- logout(): Promise<void>;
26
+ clearAuth(): Promise<void>;
22
27
  /**
23
28
  * Attempts to renew tokens
24
29
  */
@@ -37,13 +42,4 @@ export declare abstract class JWTService<TState extends BaseState, TSDK extends
37
42
  * @param {string} password
38
43
  */
39
44
  initAuth(username: string, password: string): Promise<undefined>;
40
- /**
41
- * Register a new user
42
- */
43
- register(payload: RegistrationPayload): Promise<RegistrationReturn>;
44
- resetPassword(email: string): Promise<undefined>;
45
- replaceProfilePicture(file: File): Promise<undefined>;
46
- addFavouriteProjectId(projectId: number): Promise<undefined>;
47
- removeFavouriteProjectId(projectId: number): Promise<undefined>;
48
- joinApplication(projectInviteId: string, verification_code: string, username: string, password: string): Promise<undefined>;
49
45
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core functionality for Overmap",
4
4
  "author": "Wôrdn Inc.",
5
5
  "license": "UNLICENSED",
6
- "version": "1.0.60-sdk-refactor.4",
6
+ "version": "1.0.60-sdk-refactor.6",
7
7
  "type": "module",
8
8
  "main": "dist/overmap-core.umd.cjs",
9
9
  "module": "dist/overmap-core.js",