flowrix 1.0.1-beta.32 → 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flowrix",
3
3
  "configKey": "flowrix",
4
- "version": "1.0.1-beta.32",
4
+ "version": "1.0.1-beta.33",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,4 +1,4 @@
1
- export declare function getEnv(key: any): any;
1
+ export declare function getEnv(key: any): Promise<any>;
2
2
  export declare const flowrixApi: {
3
3
  get: (endpoint: any, options?: {}, apiversion?: string) => Promise<unknown>;
4
4
  post: (endpoint: any, options?: {}, apiversion?: string) => Promise<unknown>;
@@ -1,5 +1,5 @@
1
1
  const isServer = typeof process !== "undefined" && process.server;
2
- export function getEnv(key) {
2
+ export async function getEnv(key) {
3
3
  try {
4
4
  const isClient = typeof process !== "undefined" && process.client || typeof window !== "undefined";
5
5
  if (isClient) {
@@ -17,18 +17,20 @@ export function getEnv(key) {
17
17
  return config[key] ?? config.public?.[key];
18
18
  }
19
19
  } catch (e) {
20
+ const config = useRuntimeConfig();
21
+ console.log(config);
20
22
  console.log("Silently ignore if outside Nuxt");
21
23
  }
22
24
  return process?.env?.[key];
23
25
  }
24
26
  async function request(method, endpoint, options = {}, apiversion) {
25
27
  console.log("checkt useRuntimeConfig", typeof useRuntimeConfig === "function");
26
- const FLOWRIX_API_KEY = getEnv("FLOWRIX_API_KEY");
27
- const FLOWRIX_API_SECRET = getEnv("FLOWRIX_API_SECRET");
28
- const FLOWRIX_API_ORIGIN = getEnv("FLOWRIX_API_ORIGIN");
29
- 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");
30
32
  if (apiversion == "v2") {
31
- FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE_V2");
33
+ FLOWRIX_API_BASE = await getEnv("FLOWRIX_API_BASE_V2");
32
34
  }
33
35
  const headers = {
34
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.32",
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",