@aneuhold/core-ts-api-lib 2.2.5 → 2.2.7

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 CHANGED
@@ -5,6 +5,23 @@ 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
+ ## 🔖 [2.2.7] (2025-11-08)
9
+
10
+ ### 🏗️ Changed
11
+
12
+ - Refactored `APIService.validateUser` to use `GCloudAPIService` directly (removes dependency on DOFunctionService)
13
+ - Renamed `setDashboardAPIUrl` to `setAPIUrl` for clarity and updated JSDoc
14
+ - Set default base URL for GCloud API in `GCloudAPIService`
15
+ - Moved user validation logic to `GCloudAPIService.authValidateUser`
16
+
17
+ ## 🔖 [2.2.6] (2025-11-07)
18
+
19
+ ### 🏗️ Changed
20
+
21
+ - Updated package.json: added `unpub:local` script for local unpublishing
22
+ - Changed `main` and `types` fields to use browser entry points
23
+ - Removed unused `module` field from package.json
24
+
8
25
  ## 🔖 [2.2.5] (2025-11-04)
9
26
 
10
27
  ### 🏗️ Changed
@@ -84,9 +101,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
84
101
 
85
102
  <!-- Link References -->
86
103
 
87
- [2.2.5]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.3...core-ts-api-lib-v2.2.5
88
- [2.2.3]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.2...core-ts-api-lib-v2.2.3
89
- [2.2.2]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.1...core-ts-api-lib-v2.2.2
104
+ [2.2.7]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.6...core-ts-api-lib-v2.2.7
105
+ [2.2.6]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.5...core-ts-api-lib-v2.2.6
106
+ [2.2.5]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.5...core-ts-api-lib-v2.2.5
107
+ [2.2.5]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.1...core-ts-api-lib-v2.2.5
90
108
  [2.2.1]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.2.0...core-ts-api-lib-v2.2.1
91
109
  [2.2.0]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.1.25...core-ts-api-lib-v2.2.0
92
110
  [2.1.25]: https://github.com/aneuhold/ts-libs/compare/core-ts-api-lib-v2.1.24...core-ts-api-lib-v2.1.25
@@ -14,12 +14,6 @@ export default class APIService {
14
14
  * @returns A promise that resolves to the user's information if validation is successful.
15
15
  */
16
16
  static validateUser(input: AuthValidateUserInput): Promise<APIResponse<AuthValidateUserOutput>>;
17
- /**
18
- * Sets the URL for the dashboard API.
19
- *
20
- * @param url - The URL to be set for the dashboard API. This should include a trailing slash.
21
- */
22
- static setDashboardAPIUrl(url: string): void;
23
17
  /**
24
18
  * Calls the dashboard API and returns the result. This will fail if the
25
19
  * dashboard API URL has not been set. See {@link setDashboardAPIUrl}.
@@ -28,5 +22,11 @@ export default class APIService {
28
22
  * @returns A promise that resolves to the result of the dashboard API call.
29
23
  */
30
24
  static callDashboardAPI(input: ProjectDashboardInput): Promise<APIResponse<ProjectDashboardOutput>>;
25
+ /**
26
+ * Sets the base URL for the API.
27
+ *
28
+ * @param url - The URL to be set for the API. This should include a trailing slash.
29
+ */
30
+ static setAPIUrl(url: string): void;
31
31
  }
32
32
  //# sourceMappingURL=APIService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"APIService.d.ts","sourceRoot":"","sources":["../../../src/services/APIService/APIService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,oDAAoD,CAAC;AAG5D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B;;;;;;OAMG;WACU,YAAY,CACvB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAK/C;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM;IAIrC;;;;;;OAMG;WACU,gBAAgB,CAC3B,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;CAGhD"}
1
+ {"version":3,"file":"APIService.d.ts","sourceRoot":"","sources":["../../../src/services/APIService/APIService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,oDAAoD,CAAC;AAG5D;;;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"}
@@ -1,4 +1,3 @@
1
- import DOFunctionService from '../DOFunctionService/DOFunctionService.js';
2
1
  import GCloudAPIService from '../GCloudAPIService/GCloudAPIService.js';
3
2
  /**
4
3
  * A service for making calls to the backend API for personal projects. This is
@@ -13,16 +12,7 @@ export default class APIService {
13
12
  * @returns A promise that resolves to the user's information if validation is successful.
14
13
  */
15
14
  static async validateUser(input) {
16
- const result = await DOFunctionService.authValidateUser.call(input);
17
- return result;
18
- }
19
- /**
20
- * Sets the URL for the dashboard API.
21
- *
22
- * @param url - The URL to be set for the dashboard API. This should include a trailing slash.
23
- */
24
- static setDashboardAPIUrl(url) {
25
- GCloudAPIService.setUrl(url);
15
+ return await GCloudAPIService.authValidateUser(input);
26
16
  }
27
17
  /**
28
18
  * Calls the dashboard API and returns the result. This will fail if the
@@ -34,5 +24,13 @@ export default class APIService {
34
24
  static async callDashboardAPI(input) {
35
25
  return GCloudAPIService.projectDashboard(input);
36
26
  }
27
+ /**
28
+ * Sets the base URL for the API.
29
+ *
30
+ * @param url - The URL to be set for the API. This should include a trailing slash.
31
+ */
32
+ static setAPIUrl(url) {
33
+ GCloudAPIService.setUrl(url);
34
+ }
37
35
  }
38
36
  //# sourceMappingURL=APIService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"APIService.js","sourceRoot":"","sources":["../../../src/services/APIService/APIService.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAS1E,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,KAA4B;QAE5B,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAW;QACnC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAC3B,KAA4B;QAE5B,OAAO,gBAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;CACF"}
1
+ {"version":3,"file":"APIService.js","sourceRoot":"","sources":["../../../src/services/APIService/APIService.ts"],"names":[],"mappings":"AASA,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,KAA4B;QAE5B,OAAO,MAAM,gBAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAC3B,KAA4B;QAE5B,OAAO,gBAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,GAAW;QAC1B,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACF"}
@@ -1,5 +1,4 @@
1
1
  import { APIResponse } from '../../types/APIResponse.js';
2
- import DOFunctionService from '../DOFunctionService/DOFunctionService.js';
3
2
  import {
4
3
  AuthValidateUserInput,
5
4
  AuthValidateUserOutput
@@ -25,17 +24,7 @@ export default class APIService {
25
24
  static async validateUser(
26
25
  input: AuthValidateUserInput
27
26
  ): Promise<APIResponse<AuthValidateUserOutput>> {
28
- const result = await DOFunctionService.authValidateUser.call(input);
29
- return result;
30
- }
31
-
32
- /**
33
- * Sets the URL for the dashboard API.
34
- *
35
- * @param url - The URL to be set for the dashboard API. This should include a trailing slash.
36
- */
37
- static setDashboardAPIUrl(url: string) {
38
- GCloudAPIService.setUrl(url);
27
+ return await GCloudAPIService.authValidateUser(input);
39
28
  }
40
29
 
41
30
  /**
@@ -50,4 +39,13 @@ export default class APIService {
50
39
  ): Promise<APIResponse<ProjectDashboardOutput>> {
51
40
  return GCloudAPIService.projectDashboard(input);
52
41
  }
42
+
43
+ /**
44
+ * Sets the base URL for the API.
45
+ *
46
+ * @param url - The URL to be set for the API. This should include a trailing slash.
47
+ */
48
+ static setAPIUrl(url: string) {
49
+ GCloudAPIService.setUrl(url);
50
+ }
53
51
  }
@@ -1,4 +1,5 @@
1
1
  import { APIResponse } from '../../types/APIResponse.js';
2
+ import { AuthValidateUserInput, AuthValidateUserOutput } from '../DOFunctionService/functions/authValidateUser.js';
2
3
  import { ProjectDashboardInput, ProjectDashboardOutput } from '../DOFunctionService/functions/projectDashboard.js';
3
4
  /**
4
5
  * A service for interacting with the Google Cloud API service for personal projects.
@@ -11,6 +12,12 @@ export default class GCloudAPIService {
11
12
  * @param url - The URL to set.
12
13
  */
13
14
  static setUrl(url: string): void;
15
+ /**
16
+ * Calls the project dashboard endpoint to get, insert, update, or delete dashboard data.
17
+ *
18
+ * @param input - The input for the project dashboard function.
19
+ */
20
+ static authValidateUser(input: AuthValidateUserInput): Promise<APIResponse<AuthValidateUserOutput>>;
14
21
  /**
15
22
  * Calls the project dashboard endpoint to get, insert, update, or delete dashboard data.
16
23
  *
@@ -1 +1 @@
1
- {"version":3,"file":"GCloudAPIService.d.ts","sourceRoot":"","sources":["../../../src/services/GCloudAPIService/GCloudAPIService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,oDAAoD,CAAC;AAE5D;;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;;;;;;OAMG;mBACkB,IAAI;IAqBzB;;;;;OAKG;mBACkB,cAAc;CAiBpC"}
1
+ {"version":3,"file":"GCloudAPIService.d.ts","sourceRoot":"","sources":["../../../src/services/GCloudAPIService/GCloudAPIService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,oDAAoD,CAAC;AAE5D;;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;CAiBpC"}
@@ -7,7 +7,7 @@ export default class GCloudAPIService {
7
7
  * The base URL of the Google Cloud API. For example, `something.com/api/`. It will include
8
8
  * the trailing slash.
9
9
  */
10
- static #baseUrl;
10
+ static #baseUrl = 'https://gcloud-backend-926119935605.us-west1.run.app/';
11
11
  /**
12
12
  * Sets the URL of the Google Cloud API.
13
13
  *
@@ -16,6 +16,14 @@ export default class GCloudAPIService {
16
16
  static setUrl(url) {
17
17
  this.#baseUrl = url;
18
18
  }
19
+ /**
20
+ * Calls the project dashboard endpoint to get, insert, update, or delete dashboard data.
21
+ *
22
+ * @param input - The input for the project dashboard function.
23
+ */
24
+ static async authValidateUser(input) {
25
+ return this.call('auth/validateUser', input);
26
+ }
19
27
  /**
20
28
  * Calls the project dashboard endpoint to get, insert, update, or delete dashboard data.
21
29
  *
@@ -32,9 +40,6 @@ export default class GCloudAPIService {
32
40
  * @throws {Error} Will throw an error if the URL is not set.
33
41
  */
34
42
  static async call(urlPath, input) {
35
- if (!this.#baseUrl) {
36
- throw new Error('GCloudAPI URL is not set');
37
- }
38
43
  const response = await fetch(this.#baseUrl + urlPath, {
39
44
  method: 'POST',
40
45
  headers: {
@@ -1 +1 @@
1
- {"version":3,"file":"GCloudAPIService.js","sourceRoot":"","sources":["../../../src/services/GCloudAPIService/GCloudAPIService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAO5B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAU;IAEzB;;;;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;;;;;;OAMG;IACK,MAAM,CAAC,KAAK,CAAC,IAAI,CACvB,OAAe,EACf,KAAa;QAEb,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QAED,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,0BAA0B;gBAC1C,MAAM,EAAE,0BAA0B;aACnC;YACD,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SACzC,CAAC,CAAC;QACH,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAU,QAAQ,CAAC,CAAC;QACrE,OAAO,eAAe,CAAC;IACzB,CAAC;IAED;;;;;OAK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I,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACzC,IAAI,EAAE,EAAa;aACpB,CAAC;QACJ,CAAC;IACH,CAAC"}
@@ -1,5 +1,9 @@
1
1
  import { BSON } from 'bson';
2
2
  import { APIResponse } from '../../types/APIResponse.js';
3
+ import {
4
+ AuthValidateUserInput,
5
+ AuthValidateUserOutput
6
+ } from '../DOFunctionService/functions/authValidateUser.js';
3
7
  import {
4
8
  ProjectDashboardInput,
5
9
  ProjectDashboardOutput
@@ -13,7 +17,7 @@ export default class GCloudAPIService {
13
17
  * The base URL of the Google Cloud API. For example, `something.com/api/`. It will include
14
18
  * the trailing slash.
15
19
  */
16
- static #baseUrl?: string;
20
+ static #baseUrl: string = 'https://gcloud-backend-926119935605.us-west1.run.app/';
17
21
 
18
22
  /**
19
23
  * Sets the URL of the Google Cloud API.
@@ -24,6 +28,17 @@ export default class GCloudAPIService {
24
28
  this.#baseUrl = url;
25
29
  }
26
30
 
31
+ /**
32
+ * Calls the project dashboard endpoint to get, insert, update, or delete dashboard data.
33
+ *
34
+ * @param input - The input for the project dashboard function.
35
+ */
36
+ static async authValidateUser(
37
+ input: AuthValidateUserInput
38
+ ): Promise<APIResponse<AuthValidateUserOutput>> {
39
+ return this.call<AuthValidateUserInput, AuthValidateUserOutput>('auth/validateUser', input);
40
+ }
41
+
27
42
  /**
28
43
  * Calls the project dashboard endpoint to get, insert, update, or delete dashboard data.
29
44
  *
@@ -46,10 +61,6 @@ export default class GCloudAPIService {
46
61
  urlPath: string,
47
62
  input: TInput
48
63
  ): Promise<APIResponse<TOutput>> {
49
- if (!this.#baseUrl) {
50
- throw new Error('GCloudAPI URL is not set');
51
- }
52
-
53
64
  const response = await fetch(this.#baseUrl + urlPath, {
54
65
  method: 'POST',
55
66
  headers: {
package/package.json CHANGED
@@ -2,13 +2,14 @@
2
2
  "name": "@aneuhold/core-ts-api-lib",
3
3
  "author": "Anton G. Neuhold Jr.",
4
4
  "license": "MIT",
5
- "version": "2.2.5",
5
+ "version": "2.2.7",
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",
9
9
  "scripts": {
10
10
  "build": "rimraf lib && tsc --project tsconfig.build.json && tsx ./scripts/copyTsFiles.ts",
11
11
  "watch": "nodemon --ignore lib/ -e ts --exec \"tsc --project tsconfig.build.json && tsx ./scripts/copyTsFiles.ts && local-npm publish\"",
12
+ "unpub:local": "local-npm unpublish || true",
12
13
  "lint": "eslint",
13
14
  "test": "vitest run",
14
15
  "preparePkg": "tb pkg prepare",
@@ -20,9 +21,8 @@
20
21
  "upgrade:core": "pnpm update '@aneuhold/main-scripts' --latest",
21
22
  "upgrade:all": "pnpm up"
22
23
  },
23
- "main": "lib/index.js",
24
- "module": "lib/index.js",
25
- "types": "lib/index.d.ts",
24
+ "main": "lib/browser.js",
25
+ "types": "lib/browser.d.ts",
26
26
  "files": [
27
27
  "lib",
28
28
  "CHANGELOG.md"
@@ -70,18 +70,18 @@
70
70
  "dependencies": {
71
71
  "@aneuhold/core-ts-db-lib": "*",
72
72
  "@aneuhold/core-ts-lib": "*",
73
- "bson": "^6.10.4"
73
+ "bson": "^7.0.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@aneuhold/local-npm-registry": "*",
77
- "@aneuhold/main-scripts": "^2.6.1",
78
- "@types/node": "^24.9.1",
79
- "eslint": "^9.38.0",
77
+ "@aneuhold/main-scripts": "^2.7.2",
78
+ "@types/node": "^24.10.0",
79
+ "eslint": "^9.39.1",
80
80
  "jsr": "^0.13.5",
81
81
  "prettier": "^3.6.2",
82
- "rimraf": "^6.0.1",
82
+ "rimraf": "^6.1.0",
83
83
  "tsx": "^4.20.6",
84
84
  "typescript": "^5.9.3",
85
- "vitest": "^4.0.3"
85
+ "vitest": "^4.0.8"
86
86
  }
87
87
  }