@overmap-ai/core 1.0.78-procedure-steps.6 → 1.0.78-session-auth.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.
@@ -6,7 +6,8 @@ import { BaseApiService } from './BaseApiService';
6
6
  export declare abstract class AssetService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
7
7
  add(payload: Payload<Asset>): OptimisticModelResult<Asset>;
8
8
  update(payload: UUID<Partial<Payload<Asset>>>): OptimisticModelResult<Asset>;
9
- remove(uuid: Asset["uuid"]): Promise<undefined>;
9
+ delete(uuid: Asset["uuid"]): Promise<undefined>;
10
10
  bulkAdd(payloads: Omit<Payload<Asset>, "asset_type" | "project">[], assetTypeUuid: AssetType["uuid"], projectUuid: Project["uuid"], batchSize: number): Promise<Created<Asset>[]>[];
11
+ bulkDelete(assetUuids: Asset["uuid"][]): Promise<void>;
11
12
  refreshStore(projectUuid: Project["uuid"]): Promise<void>;
12
13
  }
@@ -3,10 +3,9 @@ import { BaseState } from '../../store';
3
3
  import { BaseSDK } from '../base';
4
4
  import { BaseService } from './BaseService';
5
5
  export declare abstract class BaseAuthService<TStore extends BaseState, TSDK extends BaseSDK<TStore>> extends BaseService<TStore, TSDK> {
6
- protected constructor(sdk: TSDK);
7
- abstract initAuth(payload: object): Promise<void>;
8
- abstract clearAuth(): void;
9
- abstract prepareAuth(): Promise<void>;
10
- abstract getAuthHeader(): string;
6
+ clearAuth(): void;
7
+ protected initAuth(payload: object): Promise<void>;
8
+ prepareAuth(): Promise<void>;
9
+ abstract prepareRequest(request: SuperAgentRequest): SuperAgentRequest;
11
10
  abstract handleUnauthorized(request: SuperAgentRequest, response: Response): Promise<void>;
12
11
  }
@@ -1,4 +1,4 @@
1
- import { default as request } from 'superagent';
1
+ import { default as request, SuperAgentRequest } from 'superagent';
2
2
  import { BaseState } from '../../store';
3
3
  import { BaseSDK } from '../base';
4
4
  import { TokenPair } from '../typings';
@@ -6,7 +6,7 @@ import { BaseAuthService } from './BaseAuthService';
6
6
  /**
7
7
  * Handles login, logout and renewing tokens
8
8
  */
9
- export declare abstract class JWTService<TState extends BaseState, TSDK extends BaseSDK<TState>> extends BaseAuthService<TState, TSDK> {
9
+ export declare abstract class JWTAuthService<TState extends BaseState, TSDK extends BaseSDK<TState>> extends BaseAuthService<TState, TSDK> {
10
10
  protected abstract initTokensUrl: string;
11
11
  protected abstract refreshTokensUrl: string;
12
12
  protected abstract setTokens: (tokens: TokenPair) => void;
@@ -29,8 +29,9 @@ export declare abstract class JWTService<TState extends BaseState, TSDK extends
29
29
  */
30
30
  renewTokens(): Promise<undefined>;
31
31
  tokenIsExpiringSoon(): boolean;
32
- getAuthHeader(): string;
33
32
  prepareAuth(): Promise<undefined>;
33
+ private getAuthHeader;
34
+ prepareRequest(request: SuperAgentRequest): SuperAgentRequest;
34
35
  handleUnauthorized(request: request.SuperAgentRequest, response: request.Response): Promise<void>;
35
- initAuth(payload: object): Promise<void>;
36
+ protected initAuth(payload: object): Promise<void>;
36
37
  }
@@ -0,0 +1,13 @@
1
+ import { default as request, SuperAgentRequest } from 'superagent';
2
+ import { BaseState } from '../../store';
3
+ import { BaseSDK } from '../base';
4
+ import { BaseAuthService } from './BaseAuthService';
5
+ /**
6
+ * Provides session-based authentication, which does not allow or require accessing tokens using JavaScript.
7
+ */
8
+ export declare abstract class SessionAuthService<TState extends BaseState, TSDK extends BaseSDK<TState>> extends BaseAuthService<TState, TSDK> {
9
+ protected abstract loginUrl: string;
10
+ clearAuth(): void;
11
+ handleUnauthorized(_request: request.SuperAgentRequest, _response: request.Response): Promise<void>;
12
+ prepareRequest(request: SuperAgentRequest): SuperAgentRequest;
13
+ }
@@ -54,5 +54,6 @@ export * from './ProjectAccessService';
54
54
  export * from './ProjectAttachmentService';
55
55
  export * from './ProjectFileService';
56
56
  export * from './ProjectService';
57
+ export * from './SessionAuthService';
57
58
  export * from './TeamService';
58
59
  export * from './UserService';
@@ -1,4 +1,3 @@
1
- import { IconType } from '@overmap-ai/blocks';
2
1
  import { MultiPoint, Point } from 'geojson';
3
2
  import { COMMON_AUTO_FIELDS } from '../../utils';
4
3
  import { CSSColor } from '../colors';
@@ -64,7 +63,7 @@ export interface OwnedByOrganization {
64
63
  organization_owner: string;
65
64
  }
66
65
  export interface IconModel {
67
- icon: IconType;
66
+ icon: string;
68
67
  }
69
68
  export interface ColorModel {
70
69
  color: CSSColor;
package/package.json CHANGED
@@ -1,118 +1,115 @@
1
- {
2
- "name": "@overmap-ai/core",
3
- "description": "Core functionality for Overmap",
4
- "author": "Wôrdn Inc.",
5
- "license": "UNLICENSED",
6
- "version": "1.0.78-procedure-steps.6",
7
- "type": "module",
8
- "main": "dist/overmap-core.umd.cjs",
9
- "module": "dist/overmap-core.js",
10
- "types": "dist/index.d.ts",
11
- "scripts": {
12
- "dev": "vite",
13
- "build": "tsc --noEmit && vite build",
14
- "lint": "tsc --noEmit && eslint --report-unused-disable-directives --max-warnings 0",
15
- "lint:fix": "eslint --report-unused-disable-directives --max-warnings 0 --fix",
16
- "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,html,sass,yaml}\"",
17
- "preview": "vite preview",
18
- "prepare": "husky",
19
- "test": "npx vitest"
20
- },
21
- "dependencies": {
22
- "@redux-offline/redux-offline": "^2.6.0",
23
- "@reduxjs/toolkit": "^2.8.2",
24
- "color": "^4.2.3",
25
- "dependency-graph": "^1.0.0",
26
- "file-saver": "^2.0.5",
27
- "idb": "^7.1.1",
28
- "jwt-decode": "^3.1.2",
29
- "localforage": "^1.10.0",
30
- "redux": "^5.0.1",
31
- "redux-persist": "^4.0.0",
32
- "redux-persist-migrate": "^5.0.0",
33
- "superagent": "^8.1.2",
34
- "uuid": "^11.1.0",
35
- "yarn": "^1.22.22"
36
- },
37
- "devDependencies": {
38
- "@overmap-ai/blocks": "1.0.40-alpha.1",
39
- "@overmap-ai/forms": "1.0.32-condition-manager.1",
40
- "@rollup/plugin-commonjs": "^28.0.6",
41
- "@tiptap/core": "^3.0.7",
42
- "@types/add": "^2",
43
- "@types/color": "^3.0.4",
44
- "@types/file-saver": "^2.0.7",
45
- "@types/geojson": "^7946.0.16",
46
- "@types/jwt-decode": "^3.1.0",
47
- "@types/node": "^20.12.11",
48
- "@types/react": "^19.1.8",
49
- "@types/react-dom": "^19.0.3",
50
- "@types/superagent": "^4.1.18",
51
- "@types/uuid": "^9.0.3",
52
- "@vitejs/plugin-react-swc": "^3.11.0",
53
- "@vitest/coverage-v8": "^3.2.4",
54
- "@vitest/eslint-plugin": "^1.3.4",
55
- "eslint": "^9.32.0",
56
- "eslint-config-prettier": "^10.1.8",
57
- "eslint-import-resolver-typescript": "^4.4.4",
58
- "eslint-plugin-import-x": "^4.16.1",
59
- "eslint-plugin-prettier": "^5.5.3",
60
- "eslint-plugin-simple-import-sort": "^12.1.1",
61
- "globals": "^16.3.0",
62
- "happy-dom": "^15.10.2",
63
- "husky": "^9.1.7",
64
- "jiti": "^2.5.1",
65
- "jsdom": "^23.2.0",
66
- "lint-staged": "^15.1.0",
67
- "prettier": "^3.6.2",
68
- "react": "^19.1.0",
69
- "react-dom": "^19.0.0",
70
- "rollup": "^4.45.3",
71
- "rollup-plugin-polyfill-node": "^0.13.0",
72
- "typescript": "^5.2.2",
73
- "typescript-eslint": "^8.38.0",
74
- "vite": "^6.3.4",
75
- "vite-plugin-dts": "^4.5.4",
76
- "vite-plugin-externalize-deps": "^0.9.0",
77
- "vitest": "3.2.4"
78
- },
79
- "peerDependencies": {
80
- "@overmap-ai/blocks": "1.0.40-alpha.1",
81
- "@overmap-ai/forms": "1.0.32-condition-manager.1",
82
- "@tiptap/core": "^2.4.0",
83
- "react": ">=18.2.0 <20.0.0",
84
- "react-dom": ">=18.2.0 <20.0.0"
85
- },
86
- "resolutions": {
87
- "strip-ansi": "6.0.1",
88
- "string-width": "4.2.2",
89
- "wrap-ansi": "7.0.0"
90
- },
91
- "lint-staged": {
92
- "src/**/*.{js,jsx,ts,tsx}": [
93
- "yarn lint",
94
- "yarn format"
95
- ]
96
- },
97
- "files": [
98
- "dist"
99
- ],
100
- "keywords": [
101
- "react",
102
- "geospacial",
103
- "map",
104
- "components"
105
- ],
106
- "homepage": "https://overmap.ai",
107
- "repository": {
108
- "type": "git",
109
- "url": "git+https://github.com/hemora-app/overmap-core.git"
110
- },
111
- "bugs": {
112
- "url": "https://github.com/hemora-app/overmap-core/issues"
113
- },
114
- "volta": {
115
- "node": "22.17.0",
116
- "yarn": "4.9.2"
117
- }
118
- }
1
+ {
2
+ "name": "@overmap-ai/core",
3
+ "description": "Core functionality for Overmap",
4
+ "author": "Wôrdn Inc.",
5
+ "license": "UNLICENSED",
6
+ "version": "1.0.78-session-auth.2",
7
+ "type": "module",
8
+ "main": "dist/overmap-core.umd.cjs",
9
+ "module": "dist/overmap-core.js",
10
+ "types": "dist/index.d.ts",
11
+ "scripts": {
12
+ "dev": "vite",
13
+ "build": "tsc --noEmit && vite build",
14
+ "lint": "tsc --noEmit && eslint --report-unused-disable-directives --max-warnings 0",
15
+ "lint:fix": "eslint --report-unused-disable-directives --max-warnings 0 --fix",
16
+ "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,html,sass,yaml}\"",
17
+ "preview": "vite preview",
18
+ "prepare": "husky",
19
+ "test": "npx vitest"
20
+ },
21
+ "dependencies": {
22
+ "@redux-offline/redux-offline": "^2.6.0",
23
+ "@reduxjs/toolkit": "^2.8.2",
24
+ "color": "^4.2.3",
25
+ "dependency-graph": "^1.0.0",
26
+ "file-saver": "^2.0.5",
27
+ "idb": "^7.1.1",
28
+ "jwt-decode": "^3.1.2",
29
+ "localforage": "^1.10.0",
30
+ "redux": "^5.0.1",
31
+ "redux-persist": "^4.0.0",
32
+ "redux-persist-migrate": "^5.0.0",
33
+ "superagent": "^8.1.2",
34
+ "uuid": "^11.1.0"
35
+ },
36
+ "devDependencies": {
37
+ "@overmap-ai/forms": "1.0.32-condition-manager.1",
38
+ "@rollup/plugin-commonjs": "^28.0.6",
39
+ "@tiptap/core": "^3.0.7",
40
+ "@types/add": "^2",
41
+ "@types/color": "^3.0.4",
42
+ "@types/file-saver": "^2.0.7",
43
+ "@types/geojson": "^7946.0.16",
44
+ "@types/jwt-decode": "^3.1.0",
45
+ "@types/node": "^20.12.11",
46
+ "@types/react": "^19.1.8",
47
+ "@types/react-dom": "^19.0.3",
48
+ "@types/superagent": "^4.1.18",
49
+ "@types/uuid": "^9.0.3",
50
+ "@vitejs/plugin-react-swc": "^3.11.0",
51
+ "@vitest/coverage-v8": "^3.2.4",
52
+ "@vitest/eslint-plugin": "^1.3.4",
53
+ "eslint": "^9.32.0",
54
+ "eslint-config-prettier": "^10.1.8",
55
+ "eslint-import-resolver-typescript": "^4.4.4",
56
+ "eslint-plugin-import-x": "^4.16.1",
57
+ "eslint-plugin-prettier": "^5.5.3",
58
+ "eslint-plugin-simple-import-sort": "^12.1.1",
59
+ "globals": "^16.3.0",
60
+ "happy-dom": "^15.10.2",
61
+ "husky": "^9.1.7",
62
+ "jiti": "^2.5.1",
63
+ "jsdom": "^23.2.0",
64
+ "lint-staged": "^15.1.0",
65
+ "prettier": "^3.6.2",
66
+ "react": "^19.1.0",
67
+ "react-dom": "^19.0.0",
68
+ "rollup": "^4.45.3",
69
+ "rollup-plugin-polyfill-node": "^0.13.0",
70
+ "typescript": "^5.2.2",
71
+ "typescript-eslint": "^8.38.0",
72
+ "vite": "^6.4.1",
73
+ "vite-plugin-dts": "^4.5.4",
74
+ "vite-plugin-externalize-deps": "^0.9.0",
75
+ "vitest": "3.2.4"
76
+ },
77
+ "peerDependencies": {
78
+ "@overmap-ai/forms": "1.0.32-condition-manager.1",
79
+ "@tiptap/core": "^2.4.0",
80
+ "react": ">=18.2.0 <20.0.0",
81
+ "react-dom": ">=18.2.0 <20.0.0"
82
+ },
83
+ "resolutions": {
84
+ "strip-ansi": "6.0.1",
85
+ "string-width": "4.2.2",
86
+ "wrap-ansi": "7.0.0"
87
+ },
88
+ "lint-staged": {
89
+ "src/**/*.{js,jsx,ts,tsx}": [
90
+ "yarn lint",
91
+ "yarn format"
92
+ ]
93
+ },
94
+ "files": [
95
+ "dist"
96
+ ],
97
+ "keywords": [
98
+ "react",
99
+ "geospacial",
100
+ "map",
101
+ "components"
102
+ ],
103
+ "homepage": "https://overmap.ai",
104
+ "repository": {
105
+ "type": "git",
106
+ "url": "git+https://github.com/hemora-app/overmap-core.git"
107
+ },
108
+ "bugs": {
109
+ "url": "https://github.com/hemora-app/overmap-core/issues"
110
+ },
111
+ "volta": {
112
+ "node": "22.17.0",
113
+ "yarn": "4.9.2"
114
+ }
115
+ }