@uninspired/auth-client 0.0.8 → 0.0.10

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/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var{defineProperty:u,getOwnPropertyNames:l,getOwnPropertyDescriptor:s}=Object,C=Object.prototype.hasOwnProperty;var p=new WeakMap,a=(t)=>{var e=p.get(t),i;if(e)return e;if(e=u({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function")l(t).map((n)=>!C.call(e,n)&&u(e,n,{get:()=>t[n],enumerable:!(i=s(t,n))||i.enumerable}));return p.set(t,e),e};var h=(t,e)=>{for(var i in e)u(t,i,{get:e[i],enumerable:!0,configurable:!0,set:(n)=>e[i]=()=>n})};var k={};h(k,{makeUsBetterAuthClient:()=>y,makePublicClient:()=>m,makeCheckoutClient:()=>f,makeAppClient:()=>R});module.exports=a(k);var r=require("better-auth/client/plugins"),c=require("better-auth/react"),o=require("hono/client");function y(t){return c.createAuthClient({baseURL:t,plugins:[r.customSessionClient(),r.magicLinkClient(),r.emailOTPClient(),r.passkeyClient()]})}function f(t,e){return o.hc(t,{...e,fetch:(i,n)=>(e?.fetch??fetch)(i,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})}function R(t,e){return o.hc(t,{...e,fetch:(i,n)=>(e?.fetch??fetch)(i,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})}function m(t,e){return o.hc(t,e)}
1
+ var{defineProperty:p,getOwnPropertyNames:l,getOwnPropertyDescriptor:s}=Object,C=Object.prototype.hasOwnProperty;var u=new WeakMap,a=(t)=>{var e=u.get(t),r;if(e)return e;if(e=p({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function")l(t).map((n)=>!C.call(e,n)&&p(e,n,{get:()=>t[n],enumerable:!(r=s(t,n))||r.enumerable}));return u.set(t,e),e};var h=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0,configurable:!0,set:(n)=>e[r]=()=>n})};var k={};h(k,{makeUsBetterAuthClient:()=>y,makePublicClient:()=>f,makeCheckoutClient:()=>R,makeAppClient:()=>m});module.exports=a(k);var o=require("better-auth/client/plugins"),c=require("better-auth/react"),i=require("hono/client"),y=(t)=>{return c.createAuthClient({baseURL:t,plugins:[o.customSessionClient(),o.magicLinkClient(),o.emailOTPClient(),o.passkeyClient()]})},R=(t,e)=>{return i.hc(t,{...e,fetch:(r,n)=>(e?.fetch??fetch)(r,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})},m=(t,e)=>{return i.hc(t,{...e,fetch:(r,n)=>(e?.fetch??fetch)(r,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})},f=(t,e)=>{return i.hc(t,e)};
2
2
 
3
- //# debugId=582231C68204C27664756E2164756E21
3
+ //# debugId=4ECA85DFA07CF91E64756E2164756E21
4
4
  //# sourceMappingURL=index.js.map
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": [
5
- "import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type {\n AppRouter,\n Auth,\n CheckoutRouter,\n PublicRouter,\n} from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport function makeUsBetterAuthClient(baseURL: string) {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n}\n\nexport type CheckoutClient = ReturnType<typeof hc<CheckoutRouter>>;\n\nexport function makeCheckoutClient(\n baseURL: string,\n options?: ClientRequestOptions,\n): CheckoutClient {\n return hc<CheckoutRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n}\n\nexport type AppClient = ReturnType<typeof hc<AppRouter>>;\n\nexport function makeAppClient(\n baseURL: string,\n options?: ClientRequestOptions,\n): AppClient {\n return hc<AppRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n}\n\nexport type PublicClient = ReturnType<typeof hc<PublicRouter>>;\n\nexport function makePublicClient(\n baseURL: string,\n options?: ClientRequestOptions,\n): PublicClient {\n return hc<PublicRouter>(baseURL, options);\n}\n"
5
+ "import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type {\n AppRouter,\n Auth,\n CheckoutRouter,\n PublicRouter,\n} from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport const makeUsBetterAuthClient = (baseURL: string) => {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n};\n\nexport type CheckoutClient = ReturnType<typeof hc<CheckoutRouter>>;\n\nexport const makeCheckoutClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): CheckoutClient => {\n return hc<CheckoutRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n\nexport type AppClient = ReturnType<typeof hc<AppRouter>>;\n\nexport const makeAppClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): AppClient => {\n return hc<AppRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n\nexport type PublicClient = ReturnType<typeof hc<PublicRouter>>;\n\nexport const makePublicClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): PublicClient => {\n return hc<PublicRouter>(baseURL, options);\n};\n"
6
6
  ],
7
- "mappings": "8kBAKO,IALP,wCAMA,+BAOA,yBAEO,SAAS,CAAsB,CAAC,EAAiB,CACtD,OAAO,mBAAiB,CACtB,UACA,QAAS,CACP,sBAA0B,EAC1B,kBAAgB,EAChB,iBAAe,EACf,gBAAc,CAChB,CACF,CAAC,EAKI,SAAS,CAAkB,CAChC,EACA,EACgB,CAChB,OAAO,KAAmB,EAAS,IAC9B,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,EAKI,SAAS,CAAa,CAC3B,EACA,EACW,CACX,OAAO,KAAc,EAAS,IACzB,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,EAKI,SAAS,CAAgB,CAC9B,EACA,EACc,CACd,OAAO,KAAiB,EAAS,CAAO",
8
- "debugId": "582231C68204C27664756E2164756E21",
7
+ "mappings": "8kBAKO,IALP,wCAMA,+BAOA,yBAEa,EAAyB,CAAC,IAAoB,CACzD,OAAO,mBAAiB,CACtB,UACA,QAAS,CACP,sBAA0B,EAC1B,kBAAgB,EAChB,iBAAe,EACf,gBAAc,CAChB,CACF,CAAC,GAKU,EAAqB,CAChC,EACA,IACmB,CACnB,OAAO,KAAmB,EAAS,IAC9B,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,GAKU,EAAgB,CAC3B,EACA,IACc,CACd,OAAO,KAAc,EAAS,IACzB,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,GAKU,EAAmB,CAC9B,EACA,IACiB,CACjB,OAAO,KAAiB,EAAS,CAAO",
8
+ "debugId": "4ECA85DFA07CF91E64756E2164756E21",
9
9
  "names": []
10
10
  }
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{customSessionClient as o,magicLinkClient as u,emailOTPClient as p,passkeyClient as c}from"better-auth/client/plugins";import{createAuthClient as l}from"better-auth/react";import{hc as r}from"hono/client";function h(e){return l({baseURL:e,plugins:[o(),u(),p(),c()]})}function y(e,t){return r(e,{...t,fetch:(i,n)=>(t?.fetch??fetch)(i,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})}function f(e,t){return r(e,{...t,fetch:(i,n)=>(t?.fetch??fetch)(i,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})}function R(e,t){return r(e,t)}export{h as makeUsBetterAuthClient,R as makePublicClient,y as makeCheckoutClient,f as makeAppClient};
1
+ import{customSessionClient as i,magicLinkClient as p,emailOTPClient as u,passkeyClient as c}from"better-auth/client/plugins";import{createAuthClient as l}from"better-auth/react";import{hc as o}from"hono/client";var h=(e)=>{return l({baseURL:e,plugins:[i(),p(),u(),c()]})},y=(e,t)=>{return o(e,{...t,fetch:(r,n)=>(t?.fetch??fetch)(r,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})},R=(e,t)=>{return o(e,{...t,fetch:(r,n)=>(t?.fetch??fetch)(r,{...n,credentials:"include",headers:{...n.headers,"Content-Type":"application/json"}})})},m=(e,t)=>{return o(e,t)};export{h as makeUsBetterAuthClient,m as makePublicClient,y as makeCheckoutClient,R as makeAppClient};
2
2
 
3
- //# debugId=E7984EC094A8F05464756E2164756E21
3
+ //# debugId=842F612FDD58662A64756E2164756E21
4
4
  //# sourceMappingURL=index.js.map
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": [
5
- "import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type {\n AppRouter,\n Auth,\n CheckoutRouter,\n PublicRouter,\n} from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport function makeUsBetterAuthClient(baseURL: string) {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n}\n\nexport type CheckoutClient = ReturnType<typeof hc<CheckoutRouter>>;\n\nexport function makeCheckoutClient(\n baseURL: string,\n options?: ClientRequestOptions,\n): CheckoutClient {\n return hc<CheckoutRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n}\n\nexport type AppClient = ReturnType<typeof hc<AppRouter>>;\n\nexport function makeAppClient(\n baseURL: string,\n options?: ClientRequestOptions,\n): AppClient {\n return hc<AppRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n}\n\nexport type PublicClient = ReturnType<typeof hc<PublicRouter>>;\n\nexport function makePublicClient(\n baseURL: string,\n options?: ClientRequestOptions,\n): PublicClient {\n return hc<PublicRouter>(baseURL, options);\n}\n"
5
+ "import {\n customSessionClient,\n magicLinkClient,\n emailOTPClient,\n passkeyClient,\n} from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/react\";\nimport type {\n AppRouter,\n Auth,\n CheckoutRouter,\n PublicRouter,\n} from \"@us-accounts/api\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport const makeUsBetterAuthClient = (baseURL: string) => {\n return createAuthClient({\n baseURL,\n plugins: [\n customSessionClient<Auth>(),\n magicLinkClient(),\n emailOTPClient(),\n passkeyClient(),\n ],\n });\n};\n\nexport type CheckoutClient = ReturnType<typeof hc<CheckoutRouter>>;\n\nexport const makeCheckoutClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): CheckoutClient => {\n return hc<CheckoutRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n\nexport type AppClient = ReturnType<typeof hc<AppRouter>>;\n\nexport const makeAppClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): AppClient => {\n return hc<AppRouter>(baseURL, {\n ...options,\n fetch: (url: any, init: any) =>\n (options?.fetch ?? fetch)(url, {\n ...init,\n credentials: \"include\",\n headers: {\n ...init.headers,\n \"Content-Type\": \"application/json\",\n },\n }),\n });\n};\n\nexport type PublicClient = ReturnType<typeof hc<PublicRouter>>;\n\nexport const makePublicClient = (\n baseURL: string,\n options?: ClientRequestOptions,\n): PublicClient => {\n return hc<PublicRouter>(baseURL, options);\n};\n"
6
6
  ],
7
- "mappings": "AAAA,8BACE,qBACA,oBACA,mBACA,mCAEF,2BAAS,0BAOT,aAAS,oBAEF,SAAS,CAAsB,CAAC,EAAiB,CACtD,OAAO,EAAiB,CACtB,UACA,QAAS,CACP,EAA0B,EAC1B,EAAgB,EAChB,EAAe,EACf,EAAc,CAChB,CACF,CAAC,EAKI,SAAS,CAAkB,CAChC,EACA,EACgB,CAChB,OAAO,EAAmB,EAAS,IAC9B,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,EAKI,SAAS,CAAa,CAC3B,EACA,EACW,CACX,OAAO,EAAc,EAAS,IACzB,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,EAKI,SAAS,CAAgB,CAC9B,EACA,EACc,CACd,OAAO,EAAiB,EAAS,CAAO",
8
- "debugId": "E7984EC094A8F05464756E2164756E21",
7
+ "mappings": "AAAA,8BACE,qBACA,oBACA,mBACA,mCAEF,2BAAS,0BAOT,aAAS,oBAEF,IAAM,EAAyB,CAAC,IAAoB,CACzD,OAAO,EAAiB,CACtB,UACA,QAAS,CACP,EAA0B,EAC1B,EAAgB,EAChB,EAAe,EACf,EAAc,CAChB,CACF,CAAC,GAKU,EAAqB,CAChC,EACA,IACmB,CACnB,OAAO,EAAmB,EAAS,IAC9B,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,GAKU,EAAgB,CAC3B,EACA,IACc,CACd,OAAO,EAAc,EAAS,IACzB,EACH,MAAO,CAAC,EAAU,KACf,GAAS,OAAS,OAAO,EAAK,IAC1B,EACH,YAAa,UACb,QAAS,IACJ,EAAK,QACR,eAAgB,kBAClB,CACF,CAAC,CACL,CAAC,GAKU,EAAmB,CAC9B,EACA,IACiB,CACjB,OAAO,EAAiB,EAAS,CAAO",
8
+ "debugId": "842F612FDD58662A64756E2164756E21",
9
9
  "names": []
10
10
  }