modifywithai 1.8.1 → 1.9.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as ModifyWithAIOptions, a as DisableResponseSchema, c as EnableResponseSchema, d as ModificationSchema, f as ModificationToggleOptions, g as ModifyWithAIArgs, h as ModifyResponseSchema, i as DisableResponse, l as ListModificationsArgs, m as ModifyResponse, n as ApiErrorSchema, o as EnableModificationArgs, p as ModificationsListSchema, r as DisableModificationArgs, s as EnableResponse, t as ApiError, u as Modification } from "./types-DP2zKGqL.js";
1
+ import { _ as ModifyWithAIOptions, a as DisableResponseSchema, c as EnableResponseSchema, d as ModificationSchema, f as ModificationToggleOptions, g as ModifyWithAIArgs, h as ModifyResponseSchema, i as DisableResponse, l as ListModificationsArgs, m as ModifyResponse, n as ApiErrorSchema, o as EnableModificationArgs, p as ModificationsListSchema, r as DisableModificationArgs, s as EnableResponse, t as ApiError, u as Modification } from "./types-DjksF7DU.js";
2
2
 
3
3
  //#region src/core.d.ts
4
4
 
@@ -29,7 +29,7 @@ declare function modifyWithAI({
29
29
  id,
30
30
  prompt
31
31
  }: ModifyWithAIArgs, options?: ModifyWithAIOptions): Promise<{
32
- success: boolean;
32
+ modificationId?: string;
33
33
  error?: Error;
34
34
  }>;
35
35
  /**
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as e,i as t,n,o as r,r as i,t as a}from"./types-B-V0OtIq.js";async function o({id:t}){let n=await fetch(`/api/mwai/api/list`);if(!n.ok)throw Error(`Failed to fetch modifications`);let r=await n.json();return e.parse(r)}async function s({id:e,prompt:t},n){let i=t.trim();if(!i){let e=Error(`Prompt cannot be empty`);return n?.onError?.(e),{success:!1,error:e}}try{let e=await fetch(`/api/mwai/api/modify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:i})});if(!e.ok){let t=await e.json().catch(()=>({})),n=a.safeParse(t),r=n.success&&(n.data.message||n.data.error)||`Failed to submit modification`;throw Error(r)}let t=await e.json(),o=r.parse(t);return n?.onSuccess?.(),typeof window<`u`&&window.location.reload(),{success:o.success}}catch(e){let t=e instanceof Error?e:Error(`Unknown error`);return n?.onError?.(t),{success:!1,error:t}}}async function c({modificationId:e},t){try{let n=await fetch(`/api/mwai/api/enable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!n.ok){let e=await n.json().catch(()=>({})),t=a.safeParse(e),r=t.success&&(t.data.message||t.data.error)||`Failed to enable modification`;throw Error(r)}let r=await n.json(),o=i.parse(r);return t?.onSuccess?.(),typeof window<`u`&&window.location.reload(),{success:!0,data:o}}catch(e){let n=e instanceof Error?e:Error(`Unknown error`);return t?.onError?.(n),{success:!1,error:n}}}async function l({modificationId:e},t){try{let r=await fetch(`/api/mwai/api/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!r.ok){let e=await r.json().catch(()=>({})),t=a.safeParse(e),n=t.success&&(t.data.message||t.data.error)||`Failed to disable modification`;throw Error(n)}let i=await r.json(),o=n.parse(i);return t?.onSuccess?.(),typeof window<`u`&&window.location.reload(),{success:!0,data:o}}catch(e){let n=e instanceof Error?e:Error(`Unknown error`);return t?.onError?.(n),{success:!1,error:n}}}export{a as ApiErrorSchema,n as DisableResponseSchema,i as EnableResponseSchema,t as ModificationSchema,e as ModificationsListSchema,r as ModifyResponseSchema,l as disableModification,c as enableModification,o as listModifications,s as modifyWithAI};
1
+ import{a as e,i as t,n,o as r,r as i,t as a}from"./types-BgiWGYKC.js";async function o({id:t}){let n=await fetch(`/api/mwai/api/list`);if(!n.ok)throw Error(`Failed to fetch modifications`);let r=await n.json();return e.parse(r)}async function s({id:e,prompt:t},n){let i=t.trim();if(!i){let e=Error(`Prompt cannot be empty`);return n?.onError?.(e),{error:e}}try{let e=await fetch(`/api/mwai/api/modify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:i})});if(!e.ok){let t=await e.json().catch(()=>({})),n=a.safeParse(t),r=n.success&&(n.data.message||n.data.error)||`Failed to submit modification`;throw Error(r)}let t=await e.json(),o=r.parse(t);return n?.onSuccess?.(),{modificationId:o.modificationId}}catch(e){let t=e instanceof Error?e:Error(`Unknown error`);return n?.onError?.(t),{error:t}}}async function c({modificationId:e},t){try{let n=await fetch(`/api/mwai/api/enable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!n.ok){let e=await n.json().catch(()=>({})),t=a.safeParse(e),r=t.success&&(t.data.message||t.data.error)||`Failed to enable modification`;throw Error(r)}let r=await n.json(),o=i.parse(r);return t?.onSuccess?.(),{success:!0,data:o}}catch(e){let n=e instanceof Error?e:Error(`Unknown error`);return t?.onError?.(n),{success:!1,error:n}}}async function l({modificationId:e},t){try{let r=await fetch(`/api/mwai/api/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!r.ok){let e=await r.json().catch(()=>({})),t=a.safeParse(e),n=t.success&&(t.data.message||t.data.error)||`Failed to disable modification`;throw Error(n)}let i=await r.json(),o=n.parse(i);return t?.onSuccess?.(),{success:!0,data:o}}catch(e){let n=e instanceof Error?e:Error(`Unknown error`);return t?.onError?.(n),{success:!1,error:n}}}export{a as ApiErrorSchema,n as DisableResponseSchema,i as EnableResponseSchema,t as ModificationSchema,e as ModificationsListSchema,r as ModifyResponseSchema,l as disableModification,c as enableModification,o as listModifications,s as modifyWithAI};
@@ -1,34 +1,25 @@
1
- import { _ as ModifyWithAIOptions, a as DisableResponseSchema, c as EnableResponseSchema, d as ModificationSchema, f as ModificationToggleOptions, h as ModifyResponseSchema, i as DisableResponse, m as ModifyResponse, n as ApiErrorSchema, p as ModificationsListSchema, s as EnableResponse, t as ApiError, u as Modification } from "../types-DP2zKGqL.js";
1
+ import { _ as ModifyWithAIOptions, a as DisableResponseSchema, c as EnableResponseSchema, d as ModificationSchema, f as ModificationToggleOptions, h as ModifyResponseSchema, i as DisableResponse, m as ModifyResponse, n as ApiErrorSchema, p as ModificationsListSchema, s as EnableResponse, t as ApiError, u as Modification } from "../types-DjksF7DU.js";
2
2
  import * as react0 from "react";
3
3
  import { ReactNode } from "react";
4
+ import * as jsxRuntime from "react/jsx-runtime";
4
5
  import * as _tanstack_react_query0 from "@tanstack/react-query";
5
- import * as react_jsx_runtime0 from "react/jsx-runtime";
6
6
 
7
- //#region src/react/provider.d.ts
8
- declare const MWAIContext: react0.Context<string | null>;
9
- declare const MWAIProvider: ({
10
- appId,
11
- children
12
- }: {
13
- appId: string;
14
- children: ReactNode;
15
- }) => react_jsx_runtime0.JSX.Element;
7
+ //#region src/react/components.d.ts
8
+ declare const useComponents: () => jsxRuntime.JSX.Element | null;
9
+ declare const MWAIComponents: () => jsxRuntime.JSX.Element | null;
16
10
  //#endregion
17
11
  //#region src/react/head.d.ts
18
12
  declare const MWAIHead: ({
19
13
  basePath
20
14
  }?: {
21
15
  basePath?: string;
22
- }) => react_jsx_runtime0.JSX.Element;
23
- //#endregion
24
- //#region src/react/components.d.ts
25
- declare const useComponents: () => react_jsx_runtime0.JSX.Element | null;
26
- declare const MWAIComponents: () => react_jsx_runtime0.JSX.Element | null;
16
+ }) => jsxRuntime.JSX.Element;
27
17
  //#endregion
28
18
  //#region src/react/hooks.d.ts
29
19
  /**
30
20
  * React hook for fetching the list of modifications
31
21
  * Polls every 10 seconds for updates
22
+ * Automatically reloads the page when enabled modifications change
32
23
  *
33
24
  * @example
34
25
  * ```tsx
@@ -76,10 +67,10 @@ declare function useModify(options?: ModifyWithAIOptions): {
76
67
  isPaused: boolean;
77
68
  submittedAt: number;
78
69
  mutateAsync: _tanstack_react_query0.UseMutateAsyncFunction<{
79
- success: boolean;
70
+ modificationId: string;
80
71
  }, Error, string, unknown>;
81
72
  modify: _tanstack_react_query0.UseMutateFunction<{
82
- success: boolean;
73
+ modificationId: string;
83
74
  }, Error, string, unknown>;
84
75
  } | {
85
76
  data: undefined;
@@ -97,10 +88,10 @@ declare function useModify(options?: ModifyWithAIOptions): {
97
88
  isPaused: boolean;
98
89
  submittedAt: number;
99
90
  mutateAsync: _tanstack_react_query0.UseMutateAsyncFunction<{
100
- success: boolean;
91
+ modificationId: string;
101
92
  }, Error, string, unknown>;
102
93
  modify: _tanstack_react_query0.UseMutateFunction<{
103
- success: boolean;
94
+ modificationId: string;
104
95
  }, Error, string, unknown>;
105
96
  } | {
106
97
  data: undefined;
@@ -118,14 +109,14 @@ declare function useModify(options?: ModifyWithAIOptions): {
118
109
  isPaused: boolean;
119
110
  submittedAt: number;
120
111
  mutateAsync: _tanstack_react_query0.UseMutateAsyncFunction<{
121
- success: boolean;
112
+ modificationId: string;
122
113
  }, Error, string, unknown>;
123
114
  modify: _tanstack_react_query0.UseMutateFunction<{
124
- success: boolean;
115
+ modificationId: string;
125
116
  }, Error, string, unknown>;
126
117
  } | {
127
118
  data: {
128
- success: boolean;
119
+ modificationId: string;
129
120
  };
130
121
  error: null;
131
122
  variables: string;
@@ -141,10 +132,10 @@ declare function useModify(options?: ModifyWithAIOptions): {
141
132
  isPaused: boolean;
142
133
  submittedAt: number;
143
134
  mutateAsync: _tanstack_react_query0.UseMutateAsyncFunction<{
144
- success: boolean;
135
+ modificationId: string;
145
136
  }, Error, string, unknown>;
146
137
  modify: _tanstack_react_query0.UseMutateFunction<{
147
- success: boolean;
138
+ modificationId: string;
148
139
  }, Error, string, unknown>;
149
140
  };
150
141
  /**
@@ -390,6 +381,16 @@ declare function useDisable(options?: ModificationToggleOptions): {
390
381
  }, Error, string, unknown>;
391
382
  };
392
383
  //#endregion
384
+ //#region src/react/provider.d.ts
385
+ declare const MWAIContext: react0.Context<string | null>;
386
+ declare const MWAIProvider: ({
387
+ appId,
388
+ children
389
+ }: {
390
+ appId: string;
391
+ children: ReactNode;
392
+ }) => jsxRuntime.JSX.Element;
393
+ //#endregion
393
394
  //#region src/react/query-keys.d.ts
394
395
  /**
395
396
  * Centralized query key factory for type-safe, consistent cache management
@@ -1 +1 @@
1
- "use client";import{a as e,i as t,n,o as r,r as i,t as a}from"../types-B-V0OtIq.js";import*as o from"react";import{createContext as s,useContext as c,useLayoutEffect as l,useRef as u,useState as d}from"react";import{QueryClient as f,QueryClientProvider as p,useMutation as m,useQuery as h,useQueryClient as g}from"@tanstack/react-query";import*as _ from"react/jsx-runtime";import{Fragment as v,jsx as y}from"react/jsx-runtime";import*as b from"react-dom";import*as x from"react-dom/client";import S from"next/link";import C from"next/image";import*as w from"next/navigation";const T=s(null);function E(){return new f({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}})}const D=({appId:e,children:t})=>{let[n]=d(E);return y(p,{client:n,children:y(T.Provider,{value:e,children:t})})},O=({basePath:e=`/api/mwai`}={})=>y(`script`,{type:`importmap`,dangerouslySetInnerHTML:{__html:JSON.stringify({imports:{react:`${e}/shims/react-shim.js`,"react/jsx-runtime":`${e}/shims/react-jsx-shim.js`,"react-dom":`${e}/shims/react-dom-shim.js`,"react-dom/client":`${e}/shims/react-dom-client-shim.js`,"next/link":`${e}/shims/next-link-shim.js`,"next/image":`${e}/shims/next-image-shim.js`,"next/navigation":`${e}/shims/next-navigation-shim.js`}})}}),k={all:[`mwai`],modifications:()=>[...k.all,`modifications`]};function A(){return h({queryKey:k.modifications(),queryFn:async()=>{let t=await fetch(`/api/mwai/api/list`);if(!t.ok)throw Error(`Failed to fetch modifications`);let n=await t.json();return e.parse(n)},refetchInterval:1e4})}function j(e){let t=g(),{mutate:n,...i}=m({mutationFn:async e=>{let t=e.trim();if(!t)throw Error(`Prompt cannot be empty`);let n=await fetch(`/api/mwai/api/modify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:t})});if(!n.ok){let e=await n.json().catch(()=>({})),t=a.safeParse(e),r=t.success&&(t.data.message||t.data.error)||`Failed to submit modification`;throw Error(r)}let i=await n.json();return r.parse(i)},onSuccess:()=>{t.invalidateQueries({queryKey:k.modifications()}),e?.onSuccess?.(),typeof window<`u`&&window.location.reload()},onError:t=>{let n=t instanceof Error?t:Error(`Unknown error`);e?.onError?.(n)}});return{modify:n,...i}}function M(e){let t=g(),{mutate:n,...r}=m({mutationFn:async e=>{let t=await fetch(`/api/mwai/api/enable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!t.ok){let e=await t.json().catch(()=>({})),n=a.safeParse(e),r=n.success&&(n.data.message||n.data.error)||`Failed to enable modification`;throw Error(r)}let n=await t.json();return i.parse(n)},onSuccess:()=>{t.invalidateQueries({queryKey:k.modifications()}),e?.onSuccess?.(),typeof window<`u`&&window.location.reload()},onError:t=>{let n=t instanceof Error?t:Error(`Unknown error`);e?.onError?.(n)}});return{enable:n,...r}}function N(e){let t=g(),{mutate:r,...i}=m({mutationFn:async e=>{let t=await fetch(`/api/mwai/api/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!t.ok){let e=await t.json().catch(()=>({})),n=a.safeParse(e),r=n.success&&(n.data.message||n.data.error)||`Failed to disable modification`;throw Error(r)}let r=await t.json();return n.parse(r)},onSuccess:()=>{t.invalidateQueries({queryKey:k.modifications()}),e?.onSuccess?.(),typeof window<`u`&&window.location.reload()},onError:t=>{let n=t instanceof Error?t:Error(`Unknown error`);e?.onError?.(n)}});return{disable:r,...i}}const P=()=>{let e=c(T),[t,n]=d(null),{data:r}=A(),i=u(null);return l(()=>{if(!e){console.error(`ModifyWithAI: No appId provided. Wrap your app with <MWAIProvider appId='your-app-id'>`);return}typeof window<`u`&&(window.__REACT__=o,window.__REACT_JSX_RUNTIME__=_,window.__REACT_DOM__=b,window.__REACT_DOM_CLIENT__=x,window.__NEXT_LINK__=S,window.__NEXT_IMAGE__=C,window.__NEXT_NAVIGATION__=w)},[e]),l(()=>{if(!e||!r)return;let t=Function(`url`,`return import(url)`),a=r.filter(e=>e.enabled&&e.status===`success`).map(e=>e.id),o=i.current;if(o!==null){let e=new Set(o),t=new Set(a);if(o.length!==a.length||a.some(t=>!e.has(t))||o.some(e=>!t.has(e))){typeof window<`u`&&window.location.reload();return}}i.current=a,n([]),a.forEach(r=>{t(`https://bucket.modifywithai.com/${e}/${r}.js`).then(e=>n(t=>[...t||[],e.default])).catch(e=>console.error(`Failed to load external module:`,e))})},[e,r]),t?y(v,{children:t.map(e=>y(e,{},e.name))}):null},F=()=>P();export{a as ApiErrorSchema,n as DisableResponseSchema,i as EnableResponseSchema,F as MWAIComponents,T as MWAIContext,O as MWAIHead,D as MWAIProvider,t as ModificationSchema,e as ModificationsListSchema,r as ModifyResponseSchema,k as mwaiQueryKeys,P as useComponents,N as useDisable,M as useEnable,A as useList,j as useModify};
1
+ "use client";import{a as e,i as t,n,o as r,r as i,t as a}from"../types-BgiWGYKC.js";import o from"next/image";import s from"next/link";import*as c from"next/navigation";import*as l from"react";import{createContext as u,useContext as d,useLayoutEffect as f,useRef as p,useState as m}from"react";import*as h from"react/jsx-runtime";import{Fragment as g,jsx as _}from"react/jsx-runtime";import*as v from"react-dom";import*as y from"react-dom/client";import{QueryClient as b,QueryClientProvider as x,useMutation as S,useQuery as C,useQueryClient as w}from"@tanstack/react-query";const T={all:[`mwai`],modifications:()=>[...T.all,`modifications`]};function E(){let t=p(null);return C({queryKey:T.modifications(),queryFn:async()=>{let n=await fetch(`/api/mwai/api/list`);if(!n.ok)throw Error(`Failed to fetch modifications`);let r=await n.json(),i=e.parse(r),a=i.filter(e=>e.enabled&&e.status===`success`).map(e=>e.id),o=t.current;if(o!==null){let e=new Set(o),t=new Set(a);(o.length!==a.length||a.some(t=>!e.has(t))||o.some(e=>!t.has(e)))&&typeof window<`u`&&window.location.reload()}return t.current=a,i},refetchInterval:1e4})}function D(e){let t=w(),{mutate:n,...i}=S({mutationFn:async e=>{let t=e.trim();if(!t)throw Error(`Prompt cannot be empty`);let n=await fetch(`/api/mwai/api/modify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:t})});if(!n.ok){let e=await n.json().catch(()=>({})),t=a.safeParse(e),r=t.success&&(t.data.message||t.data.error)||`Failed to submit modification`;throw Error(r)}let i=await n.json();return r.parse(i)},onSuccess:()=>{t.invalidateQueries({queryKey:T.modifications()}),e?.onSuccess?.()},onError:t=>{let n=t instanceof Error?t:Error(`Unknown error`);e?.onError?.(n)}});return{modify:n,...i}}function O(e){let t=w(),{mutate:n,...r}=S({mutationFn:async e=>{let t=await fetch(`/api/mwai/api/enable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!t.ok){let e=await t.json().catch(()=>({})),n=a.safeParse(e),r=n.success&&(n.data.message||n.data.error)||`Failed to enable modification`;throw Error(r)}let n=await t.json();return i.parse(n)},onSuccess:()=>{t.invalidateQueries({queryKey:T.modifications()}),e?.onSuccess?.()},onError:t=>{let n=t instanceof Error?t:Error(`Unknown error`);e?.onError?.(n)}});return{enable:n,...r}}function k(e){let t=w(),{mutate:r,...i}=S({mutationFn:async e=>{let t=await fetch(`/api/mwai/api/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({modificationId:e})});if(!t.ok){let e=await t.json().catch(()=>({})),n=a.safeParse(e),r=n.success&&(n.data.message||n.data.error)||`Failed to disable modification`;throw Error(r)}let r=await t.json();return n.parse(r)},onSuccess:()=>{t.invalidateQueries({queryKey:T.modifications()}),e?.onSuccess?.()},onError:t=>{let n=t instanceof Error?t:Error(`Unknown error`);e?.onError?.(n)}});return{disable:r,...i}}const A=u(null);function j(){return new b({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}})}const M=({appId:e,children:t})=>{let[n]=m(j);return _(x,{client:n,children:_(A.Provider,{value:e,children:t})})},N=()=>{let e=d(A),[t,n]=m(null),{data:r}=E();return f(()=>{if(!e){console.error(`ModifyWithAI: No appId provided. Wrap your app with <MWAIProvider appId='your-app-id'>`);return}typeof window<`u`&&(window.__REACT__=l,window.__REACT_JSX_RUNTIME__=h,window.__REACT_DOM__=v,window.__REACT_DOM_CLIENT__=y,window.__NEXT_LINK__=s,window.__NEXT_IMAGE__=o,window.__NEXT_NAVIGATION__=c)},[e]),f(()=>{if(!e||!r)return;let t=Function(`url`,`return import(url)`),i=r.filter(e=>e.enabled&&e.status===`success`).map(e=>e.id);n([]),i.forEach(r=>{t(`https://bucket.modifywithai.com/${e}/${r}.js`).then(e=>n(t=>[...t||[],e.default])).catch(e=>console.error(`Failed to load external module:`,e))})},[e,r]),t?_(g,{children:t.map(e=>_(e,{},e.name))}):null},P=()=>N(),F=({basePath:e=`/api/mwai`}={})=>_(`script`,{type:`importmap`,dangerouslySetInnerHTML:{__html:JSON.stringify({imports:{react:`${e}/shims/react-shim.js`,"react/jsx-runtime":`${e}/shims/react-jsx-shim.js`,"react-dom":`${e}/shims/react-dom-shim.js`,"react-dom/client":`${e}/shims/react-dom-client-shim.js`,"next/link":`${e}/shims/next-link-shim.js`,"next/image":`${e}/shims/next-image-shim.js`,"next/navigation":`${e}/shims/next-navigation-shim.js`}})}});export{a as ApiErrorSchema,n as DisableResponseSchema,i as EnableResponseSchema,P as MWAIComponents,A as MWAIContext,F as MWAIHead,M as MWAIProvider,t as ModificationSchema,e as ModificationsListSchema,r as ModifyResponseSchema,T as mwaiQueryKeys,N as useComponents,k as useDisable,O as useEnable,E as useList,D as useModify};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";const t=e.object({id:e.string(),title:e.string().nullable(),description:e.string().nullable(),status:e.enum([`pending`,`success`,`error`]),createdAt:e.number(),updatedAt:e.number(),enabled:e.boolean().nullable()}),n=e.array(t),r=e.object({modificationId:e.string()}),i=e.object({message:e.string(),modificationId:e.string(),endUserId:e.string()}),a=e.object({message:e.string(),modificationId:e.string(),endUserId:e.string()}),o=e.object({message:e.string().optional(),error:e.string().optional()});export{n as a,t as i,a as n,r as o,i as r,o as t};
@@ -38,7 +38,7 @@ declare const ModificationsListSchema: z.ZodArray<z.ZodObject<{
38
38
  * Schema for the modify API response
39
39
  */
40
40
  declare const ModifyResponseSchema: z.ZodObject<{
41
- success: z.ZodBoolean;
41
+ modificationId: z.ZodString;
42
42
  }, z.core.$strip>;
43
43
  /**
44
44
  * Schema for the enable API response
package/package.json CHANGED
@@ -1,39 +1,37 @@
1
1
  {
2
- "name": "modifywithai",
3
- "version": "1.8.1",
4
- "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": "./dist/index.js",
10
- "./nextjs/api": "./dist/nextjs/api.js",
11
- "./nextjs/shims": "./dist/nextjs/shims.js",
12
- "./react": "./dist/react/index.js",
13
- "./package.json": "./package.json"
14
- },
15
- "files": [
16
- "dist",
17
- "AGENTS.md"
18
- ],
19
- "scripts": {
20
- "build": "tsdown"
21
- },
22
- "private": false,
23
- "devDependencies": {
24
- "@total-typescript/tsconfig": "^1.0.4",
25
- "@types/bun": "latest",
26
- "@types/react": "^19.2.7",
27
- "@types/react-dom": "^19.2.3",
28
- "tsdown": "^0.18.0",
29
- "typescript": "^5.9.3"
30
- },
31
- "peerDependencies": {
32
- "react": "^19.2.1",
33
- "next": "^16.0.8"
34
- },
35
- "dependencies": {
36
- "@tanstack/react-query": "^5.0.0",
37
- "zod": "^4.2.0"
38
- }
2
+ "name": "modifywithai",
3
+ "version": "1.9.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": "./dist/index.js",
10
+ "./nextjs/api": "./dist/nextjs/api.js",
11
+ "./nextjs/shims": "./dist/nextjs/shims.js",
12
+ "./react": "./dist/react/index.js",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "AGENTS.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "bun run --bun tsdown",
21
+ "typecheck": "bun run --bun tsc --noEmit"
22
+ },
23
+ "devDependencies": {
24
+ "@types/bun": "latest",
25
+ "@types/react": "^19.2.7",
26
+ "@types/react-dom": "^19.2.3",
27
+ "tsdown": "^0.18.2"
28
+ },
29
+ "peerDependencies": {
30
+ "react": "^19.2.1",
31
+ "next": "^16.1.1"
32
+ },
33
+ "dependencies": {
34
+ "@tanstack/react-query": "^5.0.0",
35
+ "zod": "^4.2.0"
36
+ }
39
37
  }
@@ -1 +0,0 @@
1
- import{z as e}from"zod";const t=e.object({id:e.string(),title:e.string().nullable(),description:e.string().nullable(),status:e.enum([`pending`,`success`,`error`]),createdAt:e.number(),updatedAt:e.number(),enabled:e.boolean().nullable()}),n=e.array(t),r=e.object({success:e.boolean()}),i=e.object({message:e.string(),modificationId:e.string(),endUserId:e.string()}),a=e.object({message:e.string(),modificationId:e.string(),endUserId:e.string()}),o=e.object({message:e.string().optional(),error:e.string().optional()});export{n as a,t as i,a as n,r as o,i as r,o as t};