@devite/nuxt-sanity 2.10.0 → 2.10.1

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/nuxt-sanity",
3
- "version": "2.10.0",
3
+ "version": "2.10.1",
4
4
  "configKey": "sanity",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import { defineNuxtModule, createResolver, addPlugin, addServerHandler, addImpor
3
3
  import defu from 'defu';
4
4
 
5
5
  const name = "@devite/nuxt-sanity";
6
- const version = "2.10.0";
6
+ const version = "2.10.1";
7
7
 
8
8
  const CONFIG_KEY = "sanity";
9
9
  const module = defineNuxtModule({
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -8,12 +8,16 @@ export default defineEventHandler(async (event) => {
8
8
  statusMessage: "This route is only available in preview mode"
9
9
  });
10
10
  }
11
- const { query, params = {} } = await readBody(event);
11
+ const { query, params = {}, options } = await readBody(event);
12
12
  if (!query) {
13
13
  return createError({
14
14
  statusCode: 400,
15
15
  statusMessage: `Field "query" is required`
16
16
  });
17
17
  }
18
- return await useSanityClient("default").fetch(query, params);
18
+ return (await useSanityClient("default")).fetch(
19
+ query,
20
+ params,
21
+ options ?? void 0
22
+ );
19
23
  });
@@ -1,4 +1,4 @@
1
- import { type Reactive } from 'vue';
1
+ import type { Reactive } from 'vue';
2
2
  import type { ContentSourceMap, QueryParams } from '@sanity/client';
3
3
  import type { EncodeDataAttributeFunction } from '@sanity/core-loader/encode-data-attribute';
4
4
  import type { SanityClient } from '#imports';
@@ -1,11 +1,10 @@
1
- import { toRaw } from "vue";
2
1
  import { defineEncodeDataAttribute } from "@sanity/core-loader/encode-data-attribute";
3
2
  export const subscribeToChanges = (query, params, client, updateData) => {
4
3
  let unsubscribe = () => {
5
4
  };
6
5
  function setupFetcher(cb) {
7
6
  unsubscribe();
8
- const deepClonedParams = params ? JSON.parse(JSON.stringify(toRaw(params))) : void 0;
7
+ const deepClonedParams = params ? JSON.parse(JSON.stringify(params)) : void 0;
9
8
  const fetcher = client.queryStore.createFetcherStore(query, deepClonedParams, void 0);
10
9
  unsubscribe = fetcher.subscribe((newSnapshot) => {
11
10
  if (newSnapshot.data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/nuxt-sanity",
3
- "version": "2.10.0",
3
+ "version": "2.10.1",
4
4
  "description": "Advanced Sanity integration for Nuxt.js.",
5
5
  "repository": "devite-io/nuxt-sanity",
6
6
  "license": "MIT",