@b10cks/nuxt 0.9.6 → 0.10.0

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": "@b10cks/nuxt",
3
3
  "configKey": "b10cks",
4
- "version": "0.9.6",
4
+ "version": "0.10.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -33,7 +33,7 @@ export const useB10cksApi = () => {
33
33
  };
34
34
  }
35
35
  function useApiCollection(endpoint, options = {}) {
36
- const { immediate = false, params = {}, transform } = options;
36
+ const { immediate = false, params = {} } = options;
37
37
  const pending = ref(false);
38
38
  const data = ref(null);
39
39
  const error = ref(null);
@@ -42,7 +42,7 @@ export const useB10cksApi = () => {
42
42
  error.value = null;
43
43
  try {
44
44
  const results = await $b10cksClient.getAll(endpoint, params);
45
- data.value = transform ? transform(results) : results;
45
+ data.value = results;
46
46
  return data.value;
47
47
  } catch (err) {
48
48
  error.value = err instanceof Error ? err : new Error(String(err));
@@ -1,6 +1,7 @@
1
1
  import { ApiClient } from "@b10cks/client";
2
2
  import { previewBridge, B10cksVue } from "@b10cks/vue";
3
3
  import { defineNuxtPlugin, useRequestURL, useRuntimeConfig } from "nuxt/app";
4
+ import { useState } from "#app";
4
5
  export default defineNuxtPlugin((nuxtApp) => {
5
6
  const config = useRuntimeConfig();
6
7
  const url = useRequestURL();
@@ -10,10 +11,15 @@ export default defineNuxtPlugin((nuxtApp) => {
10
11
  previewBridge.init();
11
12
  }
12
13
  }
14
+ const rvState = useState("b10cks_rv", () => 0);
13
15
  const b10cksClient = new ApiClient({
14
16
  baseUrl: config.public.b10cks.apiUrl || "https://api.b10cks.com/api",
15
17
  token: config.public.b10cks.accessToken,
16
- fetchClient: $fetch
18
+ fetchClient: $fetch,
19
+ getRv: () => rvState.value,
20
+ setRv: (value) => {
21
+ rvState.value = value;
22
+ }
17
23
  }, url);
18
24
  return {
19
25
  provide: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@b10cks/nuxt",
3
3
  "license": "MIT",
4
- "version": "0.9.6",
4
+ "version": "0.10.0",
5
5
  "author": "Michael Wallner @ Coder's Cantina",
6
6
  "description": "b10cks Nuxt module",
7
7
  "type": "module",
@@ -37,8 +37,8 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@b10cks/client": "^0.9.6",
41
- "@b10cks/vue": "^0.9.6"
40
+ "@b10cks/client": "^0.10.0",
41
+ "@b10cks/vue": "^0.10.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "nuxt-module-build prepare && nuxt-module-build build",