@aneuhold/core-ts-api-lib 3.0.0 → 3.0.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/CHANGELOG.md +27 -0
- package/lib/browser.d.ts +5 -7
- package/lib/browser.d.ts.map +1 -1
- package/lib/browser.js +1 -2
- package/lib/browser.js.map +1 -1
- package/lib/browser.ts +6 -19
- package/lib/services/APIService/APIService.d.ts +2 -2
- package/lib/services/APIService/APIService.d.ts.map +1 -1
- package/lib/services/APIService/APIService.ts +2 -2
- package/lib/services/GCloudAPIService/GCloudAPIService.d.ts +2 -2
- package/lib/services/GCloudAPIService/GCloudAPIService.d.ts.map +1 -1
- package/lib/services/GCloudAPIService/GCloudAPIService.js +9 -14
- package/lib/services/GCloudAPIService/GCloudAPIService.js.map +1 -1
- package/lib/services/GCloudAPIService/GCloudAPIService.ts +11 -16
- package/lib/types/AuthCheckPassword.d.ts +13 -0
- package/lib/types/AuthCheckPassword.d.ts.map +1 -0
- package/lib/types/AuthCheckPassword.js +2 -0
- package/lib/types/AuthCheckPassword.js.map +1 -0
- package/lib/types/AuthCheckPassword.ts +13 -0
- package/lib/types/AuthValidateUser.d.ts +34 -0
- package/lib/types/AuthValidateUser.d.ts.map +1 -0
- package/lib/types/AuthValidateUser.js +2 -0
- package/lib/types/AuthValidateUser.js.map +1 -0
- package/lib/types/AuthValidateUser.ts +35 -0
- package/lib/{services/DOFunctionService/functions/projectDashboard.d.ts → types/ProjectDashboard.d.ts} +4 -15
- package/lib/types/ProjectDashboard.d.ts.map +1 -0
- package/lib/types/ProjectDashboard.js +2 -0
- package/lib/types/ProjectDashboard.js.map +1 -0
- package/lib/{services/DOFunctionService/functions/projectDashboard.ts → types/ProjectDashboard.ts} +3 -27
- package/package.json +8 -8
- package/lib/services/DOFunctionService/DOFunction.d.ts +0 -109
- package/lib/services/DOFunctionService/DOFunction.d.ts.map +0 -1
- package/lib/services/DOFunctionService/DOFunction.js +0 -87
- package/lib/services/DOFunctionService/DOFunction.js.map +0 -1
- package/lib/services/DOFunctionService/DOFunction.ts +0 -165
- package/lib/services/DOFunctionService/DOFunctionService.d.ts +0 -54
- package/lib/services/DOFunctionService/DOFunctionService.d.ts.map +0 -1
- package/lib/services/DOFunctionService/DOFunctionService.js +0 -157
- package/lib/services/DOFunctionService/DOFunctionService.js.map +0 -1
- package/lib/services/DOFunctionService/DOFunctionService.ts +0 -191
- package/lib/services/DOFunctionService/functions/authCheckPassword.d.ts +0 -30
- package/lib/services/DOFunctionService/functions/authCheckPassword.d.ts.map +0 -1
- package/lib/services/DOFunctionService/functions/authCheckPassword.js +0 -26
- package/lib/services/DOFunctionService/functions/authCheckPassword.js.map +0 -1
- package/lib/services/DOFunctionService/functions/authCheckPassword.ts +0 -46
- package/lib/services/DOFunctionService/functions/authValidateUser.d.ts +0 -56
- package/lib/services/DOFunctionService/functions/authValidateUser.d.ts.map +0 -1
- package/lib/services/DOFunctionService/functions/authValidateUser.js +0 -32
- package/lib/services/DOFunctionService/functions/authValidateUser.js.map +0 -1
- package/lib/services/DOFunctionService/functions/authValidateUser.ts +0 -72
- package/lib/services/DOFunctionService/functions/projectDashboard.d.ts.map +0 -1
- package/lib/services/DOFunctionService/functions/projectDashboard.js +0 -19
- package/lib/services/DOFunctionService/functions/projectDashboard.js.map +0 -1
- package/lib/tests/ExampleFunction.d.ts +0 -15
- package/lib/tests/ExampleFunction.d.ts.map +0 -1
- package/lib/tests/ExampleFunction.js +0 -16
- package/lib/tests/ExampleFunction.js.map +0 -1
- package/lib/tests/ExampleFunction.ts +0 -31
- package/lib/tests/TestUtil.d.ts +0 -10
- package/lib/tests/TestUtil.d.ts.map +0 -1
- package/lib/tests/TestUtil.js +0 -17
- package/lib/tests/TestUtil.js.map +0 -1
- package/lib/tests/TestUtil.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 🔖 [3.0.2] (2025-12-03)
|
|
9
|
+
|
|
10
|
+
### ✅ Added
|
|
11
|
+
|
|
12
|
+
- New unit tests for `GCloudAPIService` covering API calls, date parsing, and error handling.
|
|
13
|
+
- Added types: `AuthCheckPasswordInput`, `AuthCheckPasswordOutput`, `AuthValidateUserInput`, `AuthValidateUserOutput`, and `ProjectDashboardInput`/`Output` to `src/types/`.
|
|
14
|
+
|
|
15
|
+
### 🏗️ Changed
|
|
16
|
+
|
|
17
|
+
- API service now uses JSON for requests/responses instead of BSON.
|
|
18
|
+
- Refactored APIService and GCloudAPIService to use new type locations and improved error handling.
|
|
19
|
+
- Updated dependencies: now requires `@aneuhold/core-ts-api-lib@^3.0.2`, `@aneuhold/core-ts-lib@^2.3.12`, and `@aneuhold/local-npm-registry@^0.2.19`.
|
|
20
|
+
- Development dependencies updated for compatibility: `@types/node`, `prettier`, `rimraf`, and `vitest`.
|
|
21
|
+
|
|
22
|
+
### 🔥 Removed
|
|
23
|
+
|
|
24
|
+
- Removed Digital Ocean function classes and related service files from `src/services/DOFunctionService/`.
|
|
25
|
+
- Removed legacy test utilities and example function files.
|
|
26
|
+
|
|
27
|
+
## 🔖 [3.0.1] (2025-11-26)
|
|
28
|
+
|
|
29
|
+
### 🏗️ Changed
|
|
30
|
+
|
|
31
|
+
- Updated dependency: now requires `@aneuhold/core-ts-db-lib@^3.0.1` and `@aneuhold/local-npm-registry@^0.2.18`.
|
|
32
|
+
|
|
8
33
|
## 🔖 [3.0.0] (2025-11-23)
|
|
9
34
|
|
|
10
35
|
### 🏗️ Changed
|
|
@@ -117,6 +142,8 @@ No direct code changes; version bump for compatibility.
|
|
|
117
142
|
|
|
118
143
|
<!-- Link References -->
|
|
119
144
|
|
|
145
|
+
[3.0.2]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v3.0.1...core-ts-api-lib-v3.0.2
|
|
146
|
+
[3.0.1]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v3.0.0...core-ts-api-lib-v3.0.1
|
|
120
147
|
[3.0.0]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.8...core-ts-api-lib-v3.0.0
|
|
121
148
|
[2.2.8]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.7...core-ts-api-lib-v2.2.8
|
|
122
149
|
[2.2.7]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.6...core-ts-api-lib-v2.2.7
|
package/lib/browser.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import APIService from './services/APIService/APIService.js';
|
|
2
|
-
import type { DOFunctionRawInput, DOFunctionRawOutput } from './services/DOFunctionService/DOFunction.js';
|
|
3
|
-
import DOFunctionService from './services/DOFunctionService/DOFunctionService.js';
|
|
4
|
-
import type { AuthCheckPasswordInput, AuthCheckPasswordOutput } from './services/DOFunctionService/functions/authCheckPassword.js';
|
|
5
|
-
import type { AuthValidateUserInput, AuthValidateUserOutput } from './services/DOFunctionService/functions/authValidateUser.js';
|
|
6
|
-
import type { ProjectDashboardInput, ProjectDashboardOptions, ProjectDashboardOutput } from './services/DOFunctionService/functions/projectDashboard.js';
|
|
7
2
|
import type { APIResponse } from './types/APIResponse.js';
|
|
3
|
+
import type { AuthCheckPasswordInput, AuthCheckPasswordOutput } from './types/AuthCheckPassword.js';
|
|
4
|
+
import type { AuthValidateUserInput, AuthValidateUserOutput } from './types/AuthValidateUser.js';
|
|
8
5
|
import type { DashboardConfig } from './types/DashboardConfig.js';
|
|
6
|
+
import type { ProjectDashboardInput, ProjectDashboardOptions, ProjectDashboardOutput } from './types/ProjectDashboard.js';
|
|
9
7
|
import type { Translation, Translations } from './types/Translations.js';
|
|
10
|
-
export { APIService
|
|
11
|
-
export type { APIResponse, AuthCheckPasswordInput, AuthCheckPasswordOutput, AuthValidateUserInput, AuthValidateUserOutput, DashboardConfig,
|
|
8
|
+
export { APIService };
|
|
9
|
+
export type { APIResponse, AuthCheckPasswordInput, AuthCheckPasswordOutput, AuthValidateUserInput, AuthValidateUserOutput, DashboardConfig, ProjectDashboardInput, ProjectDashboardOptions, ProjectDashboardOutput, Translation, Translations };
|
|
12
10
|
//# sourceMappingURL=browser.d.ts.map
|
package/lib/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAC7D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGzE,OAAO,EAAE,UAAU,EAAE,CAAC;AAGtB,YAAY,EACV,WAAW,EACX,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACb,CAAC"}
|
package/lib/browser.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import APIService from './services/APIService/APIService.js';
|
|
2
|
-
import DOFunctionService from './services/DOFunctionService/DOFunctionService.js';
|
|
3
2
|
// Export all browser-safe functions and classes from this library
|
|
4
|
-
export { APIService
|
|
3
|
+
export { APIService };
|
|
5
4
|
//# sourceMappingURL=browser.js.map
|
package/lib/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAY7D,kEAAkE;AAClE,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/lib/browser.ts
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
import APIService from './services/APIService/APIService.js';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from './
|
|
6
|
-
import DOFunctionService from './services/DOFunctionService/DOFunctionService.js';
|
|
7
|
-
import type {
|
|
8
|
-
AuthCheckPasswordInput,
|
|
9
|
-
AuthCheckPasswordOutput
|
|
10
|
-
} from './services/DOFunctionService/functions/authCheckPassword.js';
|
|
11
|
-
import type {
|
|
12
|
-
AuthValidateUserInput,
|
|
13
|
-
AuthValidateUserOutput
|
|
14
|
-
} from './services/DOFunctionService/functions/authValidateUser.js';
|
|
2
|
+
import type { APIResponse } from './types/APIResponse.js';
|
|
3
|
+
import type { AuthCheckPasswordInput, AuthCheckPasswordOutput } from './types/AuthCheckPassword.js';
|
|
4
|
+
import type { AuthValidateUserInput, AuthValidateUserOutput } from './types/AuthValidateUser.js';
|
|
5
|
+
import type { DashboardConfig } from './types/DashboardConfig.js';
|
|
15
6
|
import type {
|
|
16
7
|
ProjectDashboardInput,
|
|
17
8
|
ProjectDashboardOptions,
|
|
18
9
|
ProjectDashboardOutput
|
|
19
|
-
} from './
|
|
20
|
-
import type { APIResponse } from './types/APIResponse.js';
|
|
21
|
-
import type { DashboardConfig } from './types/DashboardConfig.js';
|
|
10
|
+
} from './types/ProjectDashboard.js';
|
|
22
11
|
import type { Translation, Translations } from './types/Translations.js';
|
|
23
12
|
|
|
24
13
|
// Export all browser-safe functions and classes from this library
|
|
25
|
-
export { APIService
|
|
14
|
+
export { APIService };
|
|
26
15
|
|
|
27
16
|
// Export TypeScript types where needed
|
|
28
17
|
export type {
|
|
@@ -32,8 +21,6 @@ export type {
|
|
|
32
21
|
AuthValidateUserInput,
|
|
33
22
|
AuthValidateUserOutput,
|
|
34
23
|
DashboardConfig,
|
|
35
|
-
DOFunctionRawInput,
|
|
36
|
-
DOFunctionRawOutput,
|
|
37
24
|
ProjectDashboardInput,
|
|
38
25
|
ProjectDashboardOptions,
|
|
39
26
|
ProjectDashboardOutput,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIResponse } from '../../types/APIResponse.js';
|
|
2
|
-
import type { AuthValidateUserInput, AuthValidateUserOutput } from '
|
|
3
|
-
import type { ProjectDashboardInput, ProjectDashboardOutput } from '
|
|
2
|
+
import type { AuthValidateUserInput, AuthValidateUserOutput } from '../../types/AuthValidateUser.js';
|
|
3
|
+
import type { ProjectDashboardInput, ProjectDashboardOutput } from '../../types/ProjectDashboard.js';
|
|
4
4
|
/**
|
|
5
5
|
* A service for making calls to the backend API for personal projects. This is
|
|
6
6
|
* abstracted so that the backend implementation can change over time.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIService.d.ts","sourceRoot":"","sources":["../../../src/services/APIService/APIService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"APIService.d.ts","sourceRoot":"","sources":["../../../src/services/APIService/APIService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AAGzC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B;;;;;;OAMG;WACU,YAAY,CACvB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAI/C;;;;;;OAMG;WACU,gBAAgB,CAC3B,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAI/C;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM;CAG7B"}
|
|
@@ -2,11 +2,11 @@ import type { APIResponse } from '../../types/APIResponse.js';
|
|
|
2
2
|
import type {
|
|
3
3
|
AuthValidateUserInput,
|
|
4
4
|
AuthValidateUserOutput
|
|
5
|
-
} from '
|
|
5
|
+
} from '../../types/AuthValidateUser.js';
|
|
6
6
|
import type {
|
|
7
7
|
ProjectDashboardInput,
|
|
8
8
|
ProjectDashboardOutput
|
|
9
|
-
} from '
|
|
9
|
+
} from '../../types/ProjectDashboard.js';
|
|
10
10
|
import GCloudAPIService from '../GCloudAPIService/GCloudAPIService.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIResponse } from '../../types/APIResponse.js';
|
|
2
|
-
import type { AuthValidateUserInput, AuthValidateUserOutput } from '
|
|
3
|
-
import type { ProjectDashboardInput, ProjectDashboardOutput } from '
|
|
2
|
+
import type { AuthValidateUserInput, AuthValidateUserOutput } from '../../types/AuthValidateUser.js';
|
|
3
|
+
import type { ProjectDashboardInput, ProjectDashboardOutput } from '../../types/ProjectDashboard.js';
|
|
4
4
|
/**
|
|
5
5
|
* A service for interacting with the Google Cloud API service for personal projects.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GCloudAPIService.d.ts","sourceRoot":"","sources":["../../../src/services/GCloudAPIService/GCloudAPIService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"GCloudAPIService.d.ts","sourceRoot":"","sources":["../../../src/services/GCloudAPIService/GCloudAPIService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;;IAOnC;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIhC;;;;OAIG;WACU,gBAAgB,CAC3B,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAI/C;;;;OAIG;WACU,gBAAgB,CAC3B,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAI/C;;;;;;OAMG;mBACkB,IAAI;IAiBzB;;;;;OAKG;mBACkB,cAAc;CAYpC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateService, ErrorUtils } from '@aneuhold/core-ts-lib';
|
|
2
2
|
/**
|
|
3
3
|
* A service for interacting with the Google Cloud API service for personal projects.
|
|
4
4
|
*/
|
|
@@ -44,10 +44,10 @@ export default class GCloudAPIService {
|
|
|
44
44
|
method: 'POST',
|
|
45
45
|
headers: {
|
|
46
46
|
Connection: 'keep-alive',
|
|
47
|
-
'Content-Type': 'application/
|
|
48
|
-
Accept: 'application/
|
|
47
|
+
'Content-Type': 'application/json',
|
|
48
|
+
Accept: 'application/json'
|
|
49
49
|
},
|
|
50
|
-
body:
|
|
50
|
+
body: JSON.stringify(input)
|
|
51
51
|
});
|
|
52
52
|
const decodedResponse = await this.decodeResponse(response);
|
|
53
53
|
return decodedResponse;
|
|
@@ -59,19 +59,14 @@ export default class GCloudAPIService {
|
|
|
59
59
|
* @returns The decoded output.
|
|
60
60
|
*/
|
|
61
61
|
static async decodeResponse(response) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const buffer = await response.arrayBuffer();
|
|
66
|
-
const uint8Array = new Uint8Array(buffer);
|
|
67
|
-
return BSON.deserialize(uint8Array);
|
|
62
|
+
try {
|
|
63
|
+
const text = await response.text();
|
|
64
|
+
return JSON.parse(text, DateService.dateReviver);
|
|
68
65
|
}
|
|
69
|
-
|
|
70
|
-
// This normally only happens if there is an error
|
|
71
|
-
const result = (await response.json());
|
|
66
|
+
catch (error) {
|
|
72
67
|
return {
|
|
73
68
|
success: false,
|
|
74
|
-
errors: [
|
|
69
|
+
errors: ['Failed to parse response', ErrorUtils.getErrorString(error)],
|
|
75
70
|
data: {}
|
|
76
71
|
};
|
|
77
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GCloudAPIService.js","sourceRoot":"","sources":["../../../src/services/GCloudAPIService/GCloudAPIService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GCloudAPIService.js","sourceRoot":"","sources":["../../../src/services/GCloudAPIService/GCloudAPIService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAWhE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC;;;OAGG;IACH,MAAM,CAAC,QAAQ,GAAW,uDAAuD,CAAC;IAElF;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,GAAW;QACvB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAC3B,KAA4B;QAE5B,OAAO,IAAI,CAAC,IAAI,CAAgD,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAC3B,KAA4B;QAE5B,OAAO,IAAI,CAAC,IAAI,CAAgD,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;OAMG;IACK,MAAM,CAAC,KAAK,CAAC,IAAI,CACvB,OAAe,EACf,KAAa;QAEb,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,UAAU,EAAE,YAAY;gBACxB,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,kBAAkB;aAC3B;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;SAC5B,CAAC,CAAC;QACH,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAU,QAAQ,CAAC,CAAC;QACrE,OAAO,eAAe,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,KAAK,CAAC,cAAc,CAAU,QAAkB;QAC7D,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,WAAW,CAAyB,CAAC;QAC3E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,CAAC,0BAA0B,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACtE,IAAI,EAAE,EAAa;aACpB,CAAC;QACJ,CAAC;IACH,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateService, ErrorUtils } from '@aneuhold/core-ts-lib';
|
|
2
2
|
import type { APIResponse } from '../../types/APIResponse.js';
|
|
3
3
|
import type {
|
|
4
4
|
AuthValidateUserInput,
|
|
5
5
|
AuthValidateUserOutput
|
|
6
|
-
} from '
|
|
6
|
+
} from '../../types/AuthValidateUser.js';
|
|
7
7
|
import type {
|
|
8
8
|
ProjectDashboardInput,
|
|
9
9
|
ProjectDashboardOutput
|
|
10
|
-
} from '
|
|
10
|
+
} from '../../types/ProjectDashboard.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* A service for interacting with the Google Cloud API service for personal projects.
|
|
@@ -65,10 +65,10 @@ export default class GCloudAPIService {
|
|
|
65
65
|
method: 'POST',
|
|
66
66
|
headers: {
|
|
67
67
|
Connection: 'keep-alive',
|
|
68
|
-
'Content-Type': 'application/
|
|
69
|
-
Accept: 'application/
|
|
68
|
+
'Content-Type': 'application/json',
|
|
69
|
+
Accept: 'application/json'
|
|
70
70
|
},
|
|
71
|
-
body:
|
|
71
|
+
body: JSON.stringify(input)
|
|
72
72
|
});
|
|
73
73
|
const decodedResponse = await this.decodeResponse<TOutput>(response);
|
|
74
74
|
return decodedResponse;
|
|
@@ -81,18 +81,13 @@ export default class GCloudAPIService {
|
|
|
81
81
|
* @returns The decoded output.
|
|
82
82
|
*/
|
|
83
83
|
private static async decodeResponse<TOutput>(response: Response): Promise<APIResponse<TOutput>> {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const uint8Array = new Uint8Array(buffer);
|
|
89
|
-
return BSON.deserialize(uint8Array) as APIResponse<TOutput>;
|
|
90
|
-
} else {
|
|
91
|
-
// This normally only happens if there is an error
|
|
92
|
-
const result = (await response.json()) as unknown;
|
|
84
|
+
try {
|
|
85
|
+
const text = await response.text();
|
|
86
|
+
return JSON.parse(text, DateService.dateReviver) as APIResponse<TOutput>;
|
|
87
|
+
} catch (error) {
|
|
93
88
|
return {
|
|
94
89
|
success: false,
|
|
95
|
-
errors: [
|
|
90
|
+
errors: ['Failed to parse response', ErrorUtils.getErrorString(error)],
|
|
96
91
|
data: {} as TOutput
|
|
97
92
|
};
|
|
98
93
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input interface for AuthCheckPassword.
|
|
3
|
+
*/
|
|
4
|
+
export interface AuthCheckPasswordInput {
|
|
5
|
+
password: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Output interface for AuthCheckPassword.
|
|
9
|
+
*/
|
|
10
|
+
export interface AuthCheckPasswordOutput {
|
|
11
|
+
passwordIsCorrect: boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=AuthCheckPassword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCheckPassword.d.ts","sourceRoot":"","sources":["../../src/types/AuthCheckPassword.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCheckPassword.js","sourceRoot":"","sources":["../../src/types/AuthCheckPassword.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input interface for AuthCheckPassword.
|
|
3
|
+
*/
|
|
4
|
+
export interface AuthCheckPasswordInput {
|
|
5
|
+
password: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Output interface for AuthCheckPassword.
|
|
10
|
+
*/
|
|
11
|
+
export interface AuthCheckPasswordOutput {
|
|
12
|
+
passwordIsCorrect: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ApiKey, User } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import type { DashboardConfig } from './DashboardConfig.js';
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing the input to the AuthValidateUser function.
|
|
5
|
+
*/
|
|
6
|
+
export interface AuthValidateUserInput {
|
|
7
|
+
/**
|
|
8
|
+
* The username of the user to be validated.
|
|
9
|
+
*/
|
|
10
|
+
userName: string;
|
|
11
|
+
/**
|
|
12
|
+
* The password of the user to be validated.
|
|
13
|
+
*/
|
|
14
|
+
password: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Interface representing the output of the AuthValidateUser function.
|
|
18
|
+
*/
|
|
19
|
+
export interface AuthValidateUserOutput {
|
|
20
|
+
/**
|
|
21
|
+
* Information about the authenticated user.
|
|
22
|
+
*/
|
|
23
|
+
userInfo?: {
|
|
24
|
+
user: User;
|
|
25
|
+
apiKey: ApiKey;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Basic configuration for the projects that the user has access to.
|
|
29
|
+
*/
|
|
30
|
+
config?: {
|
|
31
|
+
dashboard?: DashboardConfig;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=AuthValidateUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthValidateUser.d.ts","sourceRoot":"","sources":["../../src/types/AuthValidateUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,IAAI,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthValidateUser.js","sourceRoot":"","sources":["../../src/types/AuthValidateUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ApiKey, User } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import type { DashboardConfig } from './DashboardConfig.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface representing the input to the AuthValidateUser function.
|
|
6
|
+
*/
|
|
7
|
+
export interface AuthValidateUserInput {
|
|
8
|
+
/**
|
|
9
|
+
* The username of the user to be validated.
|
|
10
|
+
*/
|
|
11
|
+
userName: string;
|
|
12
|
+
/**
|
|
13
|
+
* The password of the user to be validated.
|
|
14
|
+
*/
|
|
15
|
+
password: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Interface representing the output of the AuthValidateUser function.
|
|
20
|
+
*/
|
|
21
|
+
export interface AuthValidateUserOutput {
|
|
22
|
+
/**
|
|
23
|
+
* Information about the authenticated user.
|
|
24
|
+
*/
|
|
25
|
+
userInfo?: {
|
|
26
|
+
user: User;
|
|
27
|
+
apiKey: ApiKey;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Basic configuration for the projects that the user has access to.
|
|
31
|
+
*/
|
|
32
|
+
config?: {
|
|
33
|
+
dashboard?: DashboardConfig;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { UserCTO } from '@aneuhold/core-ts-db-lib';
|
|
2
2
|
import { DashboardTask, DashboardUserConfig, NonogramKatanaItem, NonogramKatanaUpgrade } from '@aneuhold/core-ts-db-lib';
|
|
3
3
|
import type { UUID } from 'crypto';
|
|
4
|
-
import type { Translations } from '
|
|
5
|
-
import type { DOFunctionInput, DOFunctionOutput } from '../DOFunction.js';
|
|
6
|
-
import DOFunction from '../DOFunction.js';
|
|
4
|
+
import type { Translations } from './Translations.js';
|
|
7
5
|
/**
|
|
8
6
|
* Options for configuring the project dashboard.
|
|
9
7
|
*/
|
|
@@ -77,14 +75,14 @@ export interface ProjectDashboardOptions {
|
|
|
77
75
|
/**
|
|
78
76
|
* Represents the input to the project dashboard function.
|
|
79
77
|
*/
|
|
80
|
-
export interface ProjectDashboardInput
|
|
78
|
+
export interface ProjectDashboardInput {
|
|
81
79
|
apiKey: UUID;
|
|
82
80
|
options: ProjectDashboardOptions;
|
|
83
81
|
}
|
|
84
82
|
/**
|
|
85
83
|
* Represents the output of the project dashboard function.
|
|
86
84
|
*/
|
|
87
|
-
export interface ProjectDashboardOutput
|
|
85
|
+
export interface ProjectDashboardOutput {
|
|
88
86
|
translations?: Translations;
|
|
89
87
|
userConfig?: DashboardUserConfig;
|
|
90
88
|
tasks?: DashboardTask[];
|
|
@@ -93,13 +91,4 @@ export interface ProjectDashboardOutput extends DOFunctionOutput {
|
|
|
93
91
|
nonogramKatanaItems?: NonogramKatanaItem[];
|
|
94
92
|
nonogramKatanaUpgrades?: NonogramKatanaUpgrade[];
|
|
95
93
|
}
|
|
96
|
-
|
|
97
|
-
* The Digital Ocean function which handles all data requests for the
|
|
98
|
-
* dashboard project.
|
|
99
|
-
*/
|
|
100
|
-
export default class ProjectDashboard extends DOFunction<ProjectDashboardInput, ProjectDashboardOutput> {
|
|
101
|
-
private static instance;
|
|
102
|
-
private constructor();
|
|
103
|
-
static getFunction(): ProjectDashboard;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=projectDashboard.d.ts.map
|
|
94
|
+
//# sourceMappingURL=ProjectDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectDashboard.d.ts","sourceRoot":"","sources":["../../src/types/ProjectDashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE;QACJ;;WAEG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB;;;WAGG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB;;WAEG;QACH,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB;;WAEG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B;;WAEG;QACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC,CAAC;IACF,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;QACxB;;WAEG;QACH,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;QAC3C;;WAEG;QACH,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;KAClD,CAAC;IACF,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;QACjC;;WAEG;QACH,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;QACxB;;WAEG;QACH,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;QAC3C;;WAEG;QACH,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;KAClD,CAAC;IACF,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;KACzB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,IAAI,CAAC;IACb,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectDashboard.js","sourceRoot":"","sources":["../../src/types/ProjectDashboard.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC"}
|
package/lib/{services/DOFunctionService/functions/projectDashboard.ts → types/ProjectDashboard.ts}
RENAMED
|
@@ -6,9 +6,7 @@ import {
|
|
|
6
6
|
NonogramKatanaUpgrade
|
|
7
7
|
} from '@aneuhold/core-ts-db-lib';
|
|
8
8
|
import type { UUID } from 'crypto';
|
|
9
|
-
import type { Translations } from '
|
|
10
|
-
import type { DOFunctionInput, DOFunctionOutput } from '../DOFunction.js';
|
|
11
|
-
import DOFunction from '../DOFunction.js';
|
|
9
|
+
import type { Translations } from './Translations.js';
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* Options for configuring the project dashboard.
|
|
@@ -84,7 +82,7 @@ export interface ProjectDashboardOptions {
|
|
|
84
82
|
/**
|
|
85
83
|
* Represents the input to the project dashboard function.
|
|
86
84
|
*/
|
|
87
|
-
export interface ProjectDashboardInput
|
|
85
|
+
export interface ProjectDashboardInput {
|
|
88
86
|
apiKey: UUID;
|
|
89
87
|
options: ProjectDashboardOptions;
|
|
90
88
|
}
|
|
@@ -92,7 +90,7 @@ export interface ProjectDashboardInput extends DOFunctionInput {
|
|
|
92
90
|
/**
|
|
93
91
|
* Represents the output of the project dashboard function.
|
|
94
92
|
*/
|
|
95
|
-
export interface ProjectDashboardOutput
|
|
93
|
+
export interface ProjectDashboardOutput {
|
|
96
94
|
translations?: Translations;
|
|
97
95
|
userConfig?: DashboardUserConfig;
|
|
98
96
|
tasks?: DashboardTask[];
|
|
@@ -101,25 +99,3 @@ export interface ProjectDashboardOutput extends DOFunctionOutput {
|
|
|
101
99
|
nonogramKatanaItems?: NonogramKatanaItem[];
|
|
102
100
|
nonogramKatanaUpgrades?: NonogramKatanaUpgrade[];
|
|
103
101
|
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* The Digital Ocean function which handles all data requests for the
|
|
107
|
-
* dashboard project.
|
|
108
|
-
*/
|
|
109
|
-
export default class ProjectDashboard extends DOFunction<
|
|
110
|
-
ProjectDashboardInput,
|
|
111
|
-
ProjectDashboardOutput
|
|
112
|
-
> {
|
|
113
|
-
private static instance: ProjectDashboard | undefined;
|
|
114
|
-
|
|
115
|
-
private constructor() {
|
|
116
|
-
super();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
static getFunction(): ProjectDashboard {
|
|
120
|
-
if (!ProjectDashboard.instance) {
|
|
121
|
-
ProjectDashboard.instance = new ProjectDashboard();
|
|
122
|
-
}
|
|
123
|
-
return ProjectDashboard.instance;
|
|
124
|
-
}
|
|
125
|
-
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@aneuhold/core-ts-api-lib",
|
|
3
3
|
"author": "Anton G. Neuhold Jr.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.2",
|
|
6
6
|
"description": "A library for interacting with the backend and defining the backend API for personal projects.",
|
|
7
7
|
"packageManager": "pnpm@10.12.1",
|
|
8
8
|
"type": "module",
|
|
@@ -71,20 +71,20 @@
|
|
|
71
71
|
"TypeScript"
|
|
72
72
|
],
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@aneuhold/core-ts-db-lib": "^3.0.
|
|
75
|
-
"@aneuhold/core-ts-lib": "^2.3.
|
|
74
|
+
"@aneuhold/core-ts-db-lib": "^3.0.2",
|
|
75
|
+
"@aneuhold/core-ts-lib": "^2.3.12",
|
|
76
76
|
"bson": "^7.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@aneuhold/local-npm-registry": "^0.2.
|
|
79
|
+
"@aneuhold/local-npm-registry": "^0.2.19",
|
|
80
80
|
"@aneuhold/main-scripts": "^2.7.2",
|
|
81
|
-
"@types/node": "^24.10.
|
|
81
|
+
"@types/node": "^24.10.1",
|
|
82
82
|
"eslint": "^9.39.1",
|
|
83
83
|
"jsr": "^0.13.5",
|
|
84
|
-
"prettier": "^3.
|
|
85
|
-
"rimraf": "^6.1.
|
|
84
|
+
"prettier": "^3.7.2",
|
|
85
|
+
"rimraf": "^6.1.2",
|
|
86
86
|
"tsx": "^4.20.6",
|
|
87
87
|
"typescript": "^5.9.3",
|
|
88
|
-
"vitest": "^4.0.
|
|
88
|
+
"vitest": "^4.0.14"
|
|
89
89
|
}
|
|
90
90
|
}
|