@veritree/services 2.26.2 → 2.26.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/helpers/api.js +22 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.26.2",
3
+ "version": "2.26.4",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -11,23 +11,27 @@ import { getSession } from "./session";
11
11
  *
12
12
  * @returns {Object|null} - The runtime configuration object, or null if it's not available.
13
13
  */
14
- function getNuxtRuntimeConfig() {
15
- if (typeof useRuntimeConfig === "function") {
16
- return useRuntimeConfig();
17
- } else {
18
- return null;
19
- }
20
- }
21
-
22
- function getVersion() {
23
- const nuxtRuntimeConfig = getNuxtRuntimeConfig();
24
-
25
- if (nuxtRuntimeConfig) {
26
- return nuxtRuntimeConfig.public.API_VERITREE_VERSION;
27
- }
28
-
29
- return process?.env?.API_VERITREE_VERSION || "5.0.0";
30
- }
14
+ // function getNuxtRuntimeConfig() {
15
+ // if (typeof useRuntimeConfig === "function") {
16
+ // return useRuntimeConfig();
17
+ // } else {
18
+ // return null;
19
+ // }
20
+ // }
21
+
22
+ // function getVersion() {
23
+ // if (process) {
24
+ // process?.env?.API_VERITREE_VERSION;
25
+ // } else {
26
+ // const nuxtRuntimeConfig = getNuxtRuntimeConfig();
27
+
28
+ // if (nuxtRuntimeConfig) {
29
+ // return nuxtRuntimeConfig.public.API_VERITREE_VERSION;
30
+ // }
31
+ // }
32
+
33
+ // return "5.0.0";
34
+ // }
31
35
 
32
36
  /**
33
37
  * Adds a version parameter to a URL if it does not already have one.
@@ -49,7 +53,7 @@ function addVersionParam(url) {
49
53
  }
50
54
 
51
55
  // Use environment variable if available, otherwise use default version
52
- const version = getVersion();
56
+ const version = process.env.API_VERITREE_VERSION || "5.0.0";
53
57
 
54
58
  // Append version parameter to URL
55
59
  const urlVersionParam = url.includes("?")