flowrix 1.0.1-beta.31 → 1.0.1-beta.33
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/dist/module.json
CHANGED
|
@@ -3,8 +3,9 @@ export async function getEnv(key) {
|
|
|
3
3
|
try {
|
|
4
4
|
const isClient = typeof process !== "undefined" && process.client || typeof window !== "undefined";
|
|
5
5
|
if (isClient) {
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const config = useRuntimeConfig();
|
|
7
|
+
console.log(config.public);
|
|
8
|
+
console.log(config.public?.[key]);
|
|
8
9
|
if (config) return config.public?.[key] ?? config[key];
|
|
9
10
|
} else if (typeof useRuntimeConfig === "function") {
|
|
10
11
|
const config = useRuntimeConfig();
|
|
@@ -16,18 +17,20 @@ export async function getEnv(key) {
|
|
|
16
17
|
return config[key] ?? config.public?.[key];
|
|
17
18
|
}
|
|
18
19
|
} catch (e) {
|
|
20
|
+
const config = useRuntimeConfig();
|
|
21
|
+
console.log(config);
|
|
19
22
|
console.log("Silently ignore if outside Nuxt");
|
|
20
23
|
}
|
|
21
24
|
return process?.env?.[key];
|
|
22
25
|
}
|
|
23
26
|
async function request(method, endpoint, options = {}, apiversion) {
|
|
24
27
|
console.log("checkt useRuntimeConfig", typeof useRuntimeConfig === "function");
|
|
25
|
-
const FLOWRIX_API_KEY = getEnv("FLOWRIX_API_KEY");
|
|
26
|
-
const FLOWRIX_API_SECRET = getEnv("FLOWRIX_API_SECRET");
|
|
27
|
-
const FLOWRIX_API_ORIGIN = getEnv("FLOWRIX_API_ORIGIN");
|
|
28
|
-
let FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE");
|
|
28
|
+
const FLOWRIX_API_KEY = await getEnv("FLOWRIX_API_KEY");
|
|
29
|
+
const FLOWRIX_API_SECRET = await getEnv("FLOWRIX_API_SECRET");
|
|
30
|
+
const FLOWRIX_API_ORIGIN = await getEnv("FLOWRIX_API_ORIGIN");
|
|
31
|
+
let FLOWRIX_API_BASE = await getEnv("FLOWRIX_API_BASE");
|
|
29
32
|
if (apiversion == "v2") {
|
|
30
|
-
FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE_V2");
|
|
33
|
+
FLOWRIX_API_BASE = await getEnv("FLOWRIX_API_BASE_V2");
|
|
31
34
|
}
|
|
32
35
|
const headers = {
|
|
33
36
|
"x-api-key": FLOWRIX_API_KEY,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowrix",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.33",
|
|
4
4
|
"description": "lug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@nuxt/devtools": "2.6.5",
|
|
45
45
|
"@nuxt/eslint-config": "1.9.0",
|
|
46
|
-
"@nuxt/module-builder": "1.0.2",
|
|
46
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
47
47
|
"@nuxt/schema": "4.2.0",
|
|
48
48
|
"@nuxt/test-utils": "3.19.2",
|
|
49
49
|
"@types/node": "24.9.1",
|