@fonderie/vue-auth 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fonderie, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # @fonderie/vue-auth
2
+
3
+ Vue 3 composables for Fonderie auth — `useLogin`, `useRegister`,
4
+ `useSession`, `useLogout`, `useForgotPassword`, `useResetPassword`, and
5
+ `useVerifyEmail`. Thin bindings over
6
+ [`@fonderie/client`](https://github.com/fonderie-js/sdk/tree/main/packages/client):
7
+ reactive `ref`s for loading/error/data state and the request itself, nothing
8
+ else. Bring your own UI.
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ npm install @fonderie/vue-auth
14
+ ```
15
+
16
+ ## Use
17
+
18
+ ```vue
19
+ <script setup>
20
+ import { FonderieClient } from '@fonderie/client';
21
+ import { useLogin, useSession } from '@fonderie/vue-auth';
22
+
23
+ const client = new FonderieClient({ baseUrl: 'https://api.example.com/v1' });
24
+ const { login, isLoading, error } = useLogin(client.auth);
25
+ const { user, isAuthenticated, logout } = useSession(client.auth);
26
+ </script>
27
+
28
+ <template>
29
+ <button :disabled="isLoading" @click="login({ email, password })">
30
+ {{ isLoading ? 'Signing in…' : 'Sign in' }}
31
+ </button>
32
+ <button v-if="isAuthenticated" @click="logout">Log out {{ user?.email }}</button>
33
+ </template>
34
+ ```
35
+
36
+ Each composable takes the same `AuthClient` instance (`client.auth`) —
37
+ construct one `FonderieClient` at the app root and pass it down (provide/inject
38
+ or a prop). The access token is persisted to `localStorage` and restored
39
+ automatically by `useSession` on setup; don't re-implement that in app code.
40
+
41
+ Want pre-built screens instead of wiring your own form?
42
+ See [`@fonderie/vue-auth-screens`](https://github.com/fonderie-js/sdk/tree/main/packages/vue-auth-screens).
43
+
44
+ ## Why this exists
45
+
46
+ You've shipped this plumbing before — auth, teams, billing, messaging —
47
+ and the next project will ask for it again. Fonderie packages it once:
48
+ plain TypeScript modules for
49
+ [`@fonderie/core`](https://github.com/fonderie-js/sdk/tree/main/packages/core),
50
+ PostgreSQL-backed, self-hosted, MIT. No external control plane, no
51
+ per-seat anything. Register the modules you need; skip the ones you don't.
52
+
53
+ **This package owns** the Vue binding for auth — reactive state management
54
+ around `@fonderie/client`, nothing more. No business logic lives here; it
55
+ lives in `@fonderie/auth` on the server.
56
+
57
+ Browse the whole set at
58
+ [fonderie-js/sdk](https://github.com/fonderie-js/sdk) · follow
59
+ [@fonderiejs](https://x.com/fonderiejs)
60
+
61
+ ## License
62
+
63
+ MIT © Fonderie, Inc.
package/dist/index.cjs ADDED
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ FonderieApiError: () => import_client7.FonderieApiError,
24
+ useForgotPassword: () => useForgotPassword,
25
+ useLogin: () => useLogin,
26
+ useLogout: () => useLogout,
27
+ useRegister: () => useRegister,
28
+ useResetPassword: () => useResetPassword,
29
+ useSession: () => useSession,
30
+ useVerifyEmail: () => useVerifyEmail
31
+ });
32
+ module.exports = __toCommonJS(index_exports);
33
+ var import_client7 = require("@fonderie/client");
34
+
35
+ // src/composables/useForgotPassword.ts
36
+ var import_client = require("@fonderie/client");
37
+ var import_vue = require("vue");
38
+ function useForgotPassword(client) {
39
+ const isLoading = (0, import_vue.ref)(false);
40
+ const error = (0, import_vue.ref)(null);
41
+ const sent = (0, import_vue.ref)(false);
42
+ async function forgotPassword(email) {
43
+ isLoading.value = true;
44
+ error.value = null;
45
+ try {
46
+ await client.forgotPassword(email);
47
+ sent.value = true;
48
+ } catch (err) {
49
+ const apiError = err instanceof import_client.FonderieApiError ? err : new import_client.FonderieApiError("unknown", String(err), 0);
50
+ error.value = apiError;
51
+ throw apiError;
52
+ } finally {
53
+ isLoading.value = false;
54
+ }
55
+ }
56
+ return { forgotPassword, isLoading, error, sent };
57
+ }
58
+
59
+ // src/composables/useLogin.ts
60
+ var import_client2 = require("@fonderie/client");
61
+ var import_vue2 = require("vue");
62
+
63
+ // src/storage.ts
64
+ var TOKEN_KEY = "fonderie_access_token";
65
+ function persistToken(token) {
66
+ localStorage.setItem(TOKEN_KEY, token);
67
+ }
68
+ function clearToken() {
69
+ localStorage.removeItem(TOKEN_KEY);
70
+ }
71
+ function readToken() {
72
+ return localStorage.getItem(TOKEN_KEY);
73
+ }
74
+
75
+ // src/composables/useLogin.ts
76
+ function useLogin(client) {
77
+ const isLoading = (0, import_vue2.ref)(false);
78
+ const error = (0, import_vue2.ref)(null);
79
+ const data = (0, import_vue2.ref)(null);
80
+ async function login(input) {
81
+ isLoading.value = true;
82
+ error.value = null;
83
+ try {
84
+ const { result } = await client.login(input);
85
+ client.setAccessToken(result.tokens.access);
86
+ persistToken(result.tokens.access);
87
+ data.value = result;
88
+ return result;
89
+ } catch (err) {
90
+ const apiError = err instanceof import_client2.FonderieApiError ? err : new import_client2.FonderieApiError("unknown", String(err), 0);
91
+ error.value = apiError;
92
+ throw apiError;
93
+ } finally {
94
+ isLoading.value = false;
95
+ }
96
+ }
97
+ return { login, isLoading, error, data };
98
+ }
99
+
100
+ // src/composables/useLogout.ts
101
+ var import_client3 = require("@fonderie/client");
102
+ var import_vue3 = require("vue");
103
+ function useLogout(client) {
104
+ const isLoading = (0, import_vue3.ref)(false);
105
+ const error = (0, import_vue3.ref)(null);
106
+ async function logout() {
107
+ isLoading.value = true;
108
+ error.value = null;
109
+ try {
110
+ await client.logout();
111
+ } catch (err) {
112
+ const apiError = err instanceof import_client3.FonderieApiError ? err : new import_client3.FonderieApiError("unknown", String(err), 0);
113
+ error.value = apiError;
114
+ } finally {
115
+ client.setAccessToken(void 0);
116
+ clearToken();
117
+ isLoading.value = false;
118
+ }
119
+ }
120
+ return { logout, isLoading, error };
121
+ }
122
+
123
+ // src/composables/useRegister.ts
124
+ var import_client4 = require("@fonderie/client");
125
+ var import_vue4 = require("vue");
126
+ function useRegister(client) {
127
+ const isLoading = (0, import_vue4.ref)(false);
128
+ const error = (0, import_vue4.ref)(null);
129
+ const data = (0, import_vue4.ref)(null);
130
+ async function register(input) {
131
+ isLoading.value = true;
132
+ error.value = null;
133
+ try {
134
+ const { result } = await client.register(input);
135
+ client.setAccessToken(result.tokens.access);
136
+ persistToken(result.tokens.access);
137
+ data.value = result;
138
+ return result;
139
+ } catch (err) {
140
+ const apiError = err instanceof import_client4.FonderieApiError ? err : new import_client4.FonderieApiError("unknown", String(err), 0);
141
+ error.value = apiError;
142
+ throw apiError;
143
+ } finally {
144
+ isLoading.value = false;
145
+ }
146
+ }
147
+ return { register, isLoading, error, data };
148
+ }
149
+
150
+ // src/composables/useResetPassword.ts
151
+ var import_client5 = require("@fonderie/client");
152
+ var import_vue5 = require("vue");
153
+ function useResetPassword(client) {
154
+ const isLoading = (0, import_vue5.ref)(false);
155
+ const error = (0, import_vue5.ref)(null);
156
+ const done = (0, import_vue5.ref)(false);
157
+ async function resetPassword(input) {
158
+ isLoading.value = true;
159
+ error.value = null;
160
+ try {
161
+ await client.resetPassword(input);
162
+ done.value = true;
163
+ } catch (err) {
164
+ const apiError = err instanceof import_client5.FonderieApiError ? err : new import_client5.FonderieApiError("unknown", String(err), 0);
165
+ error.value = apiError;
166
+ throw apiError;
167
+ } finally {
168
+ isLoading.value = false;
169
+ }
170
+ }
171
+ return { resetPassword, isLoading, error, done };
172
+ }
173
+
174
+ // src/composables/useSession.ts
175
+ var import_vue6 = require("vue");
176
+ function useSession(client) {
177
+ const user = (0, import_vue6.ref)(null);
178
+ const isLoading = (0, import_vue6.ref)(true);
179
+ const isAuthenticated = (0, import_vue6.ref)(false);
180
+ async function refresh() {
181
+ isLoading.value = true;
182
+ try {
183
+ const { result } = await client.getUser();
184
+ user.value = result.user;
185
+ isAuthenticated.value = true;
186
+ } catch {
187
+ user.value = null;
188
+ isAuthenticated.value = false;
189
+ client.setAccessToken(void 0);
190
+ clearToken();
191
+ } finally {
192
+ isLoading.value = false;
193
+ }
194
+ }
195
+ async function logout() {
196
+ try {
197
+ await client.logout();
198
+ } catch {
199
+ }
200
+ client.setAccessToken(void 0);
201
+ clearToken();
202
+ user.value = null;
203
+ isAuthenticated.value = false;
204
+ }
205
+ const token = readToken();
206
+ if (token) client.setAccessToken(token);
207
+ void refresh();
208
+ return { user, isLoading, isAuthenticated, refresh, logout };
209
+ }
210
+
211
+ // src/composables/useVerifyEmail.ts
212
+ var import_client6 = require("@fonderie/client");
213
+ var import_vue7 = require("vue");
214
+ function useVerifyEmail(client) {
215
+ const isLoading = (0, import_vue7.ref)(false);
216
+ const error = (0, import_vue7.ref)(null);
217
+ const data = (0, import_vue7.ref)(null);
218
+ async function verifyEmail(pin) {
219
+ isLoading.value = true;
220
+ error.value = null;
221
+ try {
222
+ const { result } = await client.verifyEmail(pin);
223
+ data.value = result;
224
+ return result;
225
+ } catch (err) {
226
+ const apiError = err instanceof import_client6.FonderieApiError ? err : new import_client6.FonderieApiError("unknown", String(err), 0);
227
+ error.value = apiError;
228
+ throw apiError;
229
+ } finally {
230
+ isLoading.value = false;
231
+ }
232
+ }
233
+ return { verifyEmail, isLoading, error, data };
234
+ }
235
+ // Annotate the CommonJS export names for ESM import in node:
236
+ 0 && (module.exports = {
237
+ FonderieApiError,
238
+ useForgotPassword,
239
+ useLogin,
240
+ useLogout,
241
+ useRegister,
242
+ useResetPassword,
243
+ useSession,
244
+ useVerifyEmail
245
+ });
246
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/composables/useForgotPassword.ts","../src/composables/useLogin.ts","../src/storage.ts","../src/composables/useLogout.ts","../src/composables/useRegister.ts","../src/composables/useResetPassword.ts","../src/composables/useSession.ts","../src/composables/useVerifyEmail.ts"],"sourcesContent":["export type {\n\tAuthClient,\n\tILoginInput,\n\tILoginResult,\n\tIRegisterInput,\n\tIRegisterResult,\n\tIResetPasswordInput,\n\tITokens,\n\tIUserDTO,\n\tIVerifyEmailResult,\n} from '@fonderie/client';\n\nexport { FonderieApiError } from '@fonderie/client';\n\nexport {\n\tuseForgotPassword,\n\tuseLogin,\n\tuseLogout,\n\tuseRegister,\n\tuseResetPassword,\n\tuseSession,\n\tuseVerifyEmail,\n} from './composables';\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\n\nexport function useForgotPassword(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst sent = ref(false);\n\n\tasync function forgotPassword(email: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait client.forgotPassword(email);\n\t\t\tsent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { forgotPassword, isLoading, error, sent };\n}\n","import type { AuthClient, ILoginInput, ILoginResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useLogin(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\n\tasync function login(input: ILoginInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await client.login(input);\n\t\t\tclient.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { login, isLoading, error, data };\n}\n","export const TOKEN_KEY = 'fonderie_access_token';\n\nexport function persistToken(token: string) {\n\tlocalStorage.setItem(TOKEN_KEY, token);\n}\n\nexport function clearToken() {\n\tlocalStorage.removeItem(TOKEN_KEY);\n}\n\nexport function readToken(): string | null {\n\treturn localStorage.getItem(TOKEN_KEY);\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport function useLogout(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function logout() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait client.logout();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tclient.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { logout, isLoading, error };\n}\n","import type { AuthClient, IRegisterInput, IRegisterResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useRegister(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IRegisterResult | null>(null);\n\n\tasync function register(input: IRegisterInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await client.register(input);\n\t\t\tclient.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { register, isLoading, error, data };\n}\n","import type { AuthClient, IResetPasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\n\nexport function useResetPassword(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function resetPassword(input: IResetPasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait client.resetPassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { resetPassword, isLoading, error, done };\n}\n","import type { AuthClient, IUserDTO } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { clearToken, readToken } from '../storage';\n\nexport function useSession(client: AuthClient) {\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst isAuthenticated = ref(false);\n\n\tasync function refresh() {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await client.getUser();\n\t\t\tuser.value = result.user;\n\t\t\tisAuthenticated.value = true;\n\t\t} catch {\n\t\t\tuser.value = null;\n\t\t\tisAuthenticated.value = false;\n\t\t\tclient.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function logout() {\n\t\ttry {\n\t\t\tawait client.logout();\n\t\t} catch {\n\t\t\t// Session is being torn down regardless of server response.\n\t\t}\n\t\tclient.setAccessToken(undefined);\n\t\tclearToken();\n\t\tuser.value = null;\n\t\tisAuthenticated.value = false;\n\t}\n\n\tconst token = readToken();\n\tif (token) client.setAccessToken(token);\n\tvoid refresh();\n\n\treturn { user, isLoading, isAuthenticated, refresh, logout };\n}\n","import type { AuthClient, IVerifyEmailResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\n\nexport function useVerifyEmail(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IVerifyEmailResult | null>(null);\n\n\tasync function verifyEmail(pin: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await client.verifyEmail(pin);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyEmail, isLoading, error, data };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,IAAAA,iBAAiC;;;ACXjC,oBAAiC;AACjC,iBAAoB;AAEb,SAAS,kBAAkB,QAAoB;AACrD,QAAM,gBAAY,gBAAI,KAAK;AAC3B,QAAM,YAAQ,gBAA6B,IAAI;AAC/C,QAAM,WAAO,gBAAI,KAAK;AAEtB,iBAAe,eAAe,OAAe;AAC5C,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,OAAO,eAAe,KAAK;AACjC,WAAK,QAAQ;AAAA,IACd,SAAS,KAAK;AACb,YAAM,WACL,eAAe,iCAAmB,MAAM,IAAI,+BAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,gBAAgB,WAAW,OAAO,KAAK;AACjD;;;ACzBA,IAAAC,iBAAiC;AACjC,IAAAC,cAAoB;;;ACFb,IAAM,YAAY;AAElB,SAAS,aAAa,OAAe;AAC3C,eAAa,QAAQ,WAAW,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AO,EAAE,aAAa,WAAW,OAAO,KAAK;AAC9C;","names":["import_client","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_vue","import_client","import_vue"]}
@@ -0,0 +1,282 @@
1
+ import { AuthClient, FonderieApiError, ILoginInput, ILoginResult, IRegisterInput, IRegisterResult, IResetPasswordInput, IUserDTO, IVerifyEmailResult } from '@fonderie/client';
2
+ export { AuthClient, FonderieApiError, ILoginInput, ILoginResult, IRegisterInput, IRegisterResult, IResetPasswordInput, ITokens, IUserDTO, IVerifyEmailResult } from '@fonderie/client';
3
+ import * as vue from 'vue';
4
+
5
+ declare function useForgotPassword(client: AuthClient): {
6
+ forgotPassword: (email: string) => Promise<void>;
7
+ isLoading: vue.Ref<boolean, boolean>;
8
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
9
+ sent: vue.Ref<boolean, boolean>;
10
+ };
11
+
12
+ declare function useLogin(client: AuthClient): {
13
+ login: (input: ILoginInput) => Promise<ILoginResult>;
14
+ isLoading: vue.Ref<boolean, boolean>;
15
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
16
+ data: vue.Ref<{
17
+ tokens: {
18
+ access: string;
19
+ refresh: string;
20
+ };
21
+ user: {
22
+ id: string;
23
+ email: string;
24
+ firstName: string;
25
+ lastName: string;
26
+ phone: string;
27
+ profileImageUrl: string;
28
+ isActive: boolean;
29
+ lastLogin: string;
30
+ skills: {
31
+ name: string;
32
+ level: string;
33
+ }[];
34
+ preferences: {
35
+ locale: string;
36
+ timezone: string;
37
+ notifications: {
38
+ email: boolean;
39
+ inApp: boolean;
40
+ sms: boolean;
41
+ push: boolean;
42
+ };
43
+ emailDigest: string;
44
+ dateFormat: string;
45
+ timeFormat: string;
46
+ };
47
+ isEmailVerified: boolean;
48
+ mfaEnabled: boolean;
49
+ suspended: boolean;
50
+ whitelist: boolean;
51
+ ipWhitelist: string[];
52
+ createdAt: string;
53
+ updatedAt: string;
54
+ };
55
+ } | null, ILoginResult | {
56
+ tokens: {
57
+ access: string;
58
+ refresh: string;
59
+ };
60
+ user: {
61
+ id: string;
62
+ email: string;
63
+ firstName: string;
64
+ lastName: string;
65
+ phone: string;
66
+ profileImageUrl: string;
67
+ isActive: boolean;
68
+ lastLogin: string;
69
+ skills: {
70
+ name: string;
71
+ level: string;
72
+ }[];
73
+ preferences: {
74
+ locale: string;
75
+ timezone: string;
76
+ notifications: {
77
+ email: boolean;
78
+ inApp: boolean;
79
+ sms: boolean;
80
+ push: boolean;
81
+ };
82
+ emailDigest: string;
83
+ dateFormat: string;
84
+ timeFormat: string;
85
+ };
86
+ isEmailVerified: boolean;
87
+ mfaEnabled: boolean;
88
+ suspended: boolean;
89
+ whitelist: boolean;
90
+ ipWhitelist: string[];
91
+ createdAt: string;
92
+ updatedAt: string;
93
+ };
94
+ } | null>;
95
+ };
96
+
97
+ declare function useLogout(client: AuthClient): {
98
+ logout: () => Promise<void>;
99
+ isLoading: vue.Ref<boolean, boolean>;
100
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
101
+ };
102
+
103
+ declare function useRegister(client: AuthClient): {
104
+ register: (input: IRegisterInput) => Promise<IRegisterResult>;
105
+ isLoading: vue.Ref<boolean, boolean>;
106
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
107
+ data: vue.Ref<{
108
+ tokens: {
109
+ access: string;
110
+ refresh: string;
111
+ };
112
+ user: {
113
+ id: string;
114
+ email: string;
115
+ firstName: string;
116
+ lastName: string;
117
+ phone: string;
118
+ profileImageUrl: string;
119
+ isActive: boolean;
120
+ lastLogin: string;
121
+ skills: {
122
+ name: string;
123
+ level: string;
124
+ }[];
125
+ preferences: {
126
+ locale: string;
127
+ timezone: string;
128
+ notifications: {
129
+ email: boolean;
130
+ inApp: boolean;
131
+ sms: boolean;
132
+ push: boolean;
133
+ };
134
+ emailDigest: string;
135
+ dateFormat: string;
136
+ timeFormat: string;
137
+ };
138
+ isEmailVerified: boolean;
139
+ mfaEnabled: boolean;
140
+ suspended: boolean;
141
+ whitelist: boolean;
142
+ ipWhitelist: string[];
143
+ createdAt: string;
144
+ updatedAt: string;
145
+ };
146
+ } | null, IRegisterResult | {
147
+ tokens: {
148
+ access: string;
149
+ refresh: string;
150
+ };
151
+ user: {
152
+ id: string;
153
+ email: string;
154
+ firstName: string;
155
+ lastName: string;
156
+ phone: string;
157
+ profileImageUrl: string;
158
+ isActive: boolean;
159
+ lastLogin: string;
160
+ skills: {
161
+ name: string;
162
+ level: string;
163
+ }[];
164
+ preferences: {
165
+ locale: string;
166
+ timezone: string;
167
+ notifications: {
168
+ email: boolean;
169
+ inApp: boolean;
170
+ sms: boolean;
171
+ push: boolean;
172
+ };
173
+ emailDigest: string;
174
+ dateFormat: string;
175
+ timeFormat: string;
176
+ };
177
+ isEmailVerified: boolean;
178
+ mfaEnabled: boolean;
179
+ suspended: boolean;
180
+ whitelist: boolean;
181
+ ipWhitelist: string[];
182
+ createdAt: string;
183
+ updatedAt: string;
184
+ };
185
+ } | null>;
186
+ };
187
+
188
+ declare function useResetPassword(client: AuthClient): {
189
+ resetPassword: (input: IResetPasswordInput) => Promise<void>;
190
+ isLoading: vue.Ref<boolean, boolean>;
191
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
192
+ done: vue.Ref<boolean, boolean>;
193
+ };
194
+
195
+ declare function useSession(client: AuthClient): {
196
+ user: vue.Ref<{
197
+ id: string;
198
+ email: string;
199
+ firstName: string;
200
+ lastName: string;
201
+ phone: string;
202
+ profileImageUrl: string;
203
+ isActive: boolean;
204
+ lastLogin: string;
205
+ skills: {
206
+ name: string;
207
+ level: string;
208
+ }[];
209
+ preferences: {
210
+ locale: string;
211
+ timezone: string;
212
+ notifications: {
213
+ email: boolean;
214
+ inApp: boolean;
215
+ sms: boolean;
216
+ push: boolean;
217
+ };
218
+ emailDigest: string;
219
+ dateFormat: string;
220
+ timeFormat: string;
221
+ };
222
+ isEmailVerified: boolean;
223
+ mfaEnabled: boolean;
224
+ suspended: boolean;
225
+ whitelist: boolean;
226
+ ipWhitelist: string[];
227
+ createdAt: string;
228
+ updatedAt: string;
229
+ } | null, IUserDTO | {
230
+ id: string;
231
+ email: string;
232
+ firstName: string;
233
+ lastName: string;
234
+ phone: string;
235
+ profileImageUrl: string;
236
+ isActive: boolean;
237
+ lastLogin: string;
238
+ skills: {
239
+ name: string;
240
+ level: string;
241
+ }[];
242
+ preferences: {
243
+ locale: string;
244
+ timezone: string;
245
+ notifications: {
246
+ email: boolean;
247
+ inApp: boolean;
248
+ sms: boolean;
249
+ push: boolean;
250
+ };
251
+ emailDigest: string;
252
+ dateFormat: string;
253
+ timeFormat: string;
254
+ };
255
+ isEmailVerified: boolean;
256
+ mfaEnabled: boolean;
257
+ suspended: boolean;
258
+ whitelist: boolean;
259
+ ipWhitelist: string[];
260
+ createdAt: string;
261
+ updatedAt: string;
262
+ } | null>;
263
+ isLoading: vue.Ref<boolean, boolean>;
264
+ isAuthenticated: vue.Ref<boolean, boolean>;
265
+ refresh: () => Promise<void>;
266
+ logout: () => Promise<void>;
267
+ };
268
+
269
+ declare function useVerifyEmail(client: AuthClient): {
270
+ verifyEmail: (pin: string) => Promise<IVerifyEmailResult>;
271
+ isLoading: vue.Ref<boolean, boolean>;
272
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
273
+ data: vue.Ref<{
274
+ verified: boolean;
275
+ email: string;
276
+ } | null, IVerifyEmailResult | {
277
+ verified: boolean;
278
+ email: string;
279
+ } | null>;
280
+ };
281
+
282
+ export { useForgotPassword, useLogin, useLogout, useRegister, useResetPassword, useSession, useVerifyEmail };
@@ -0,0 +1,282 @@
1
+ import { AuthClient, FonderieApiError, ILoginInput, ILoginResult, IRegisterInput, IRegisterResult, IResetPasswordInput, IUserDTO, IVerifyEmailResult } from '@fonderie/client';
2
+ export { AuthClient, FonderieApiError, ILoginInput, ILoginResult, IRegisterInput, IRegisterResult, IResetPasswordInput, ITokens, IUserDTO, IVerifyEmailResult } from '@fonderie/client';
3
+ import * as vue from 'vue';
4
+
5
+ declare function useForgotPassword(client: AuthClient): {
6
+ forgotPassword: (email: string) => Promise<void>;
7
+ isLoading: vue.Ref<boolean, boolean>;
8
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
9
+ sent: vue.Ref<boolean, boolean>;
10
+ };
11
+
12
+ declare function useLogin(client: AuthClient): {
13
+ login: (input: ILoginInput) => Promise<ILoginResult>;
14
+ isLoading: vue.Ref<boolean, boolean>;
15
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
16
+ data: vue.Ref<{
17
+ tokens: {
18
+ access: string;
19
+ refresh: string;
20
+ };
21
+ user: {
22
+ id: string;
23
+ email: string;
24
+ firstName: string;
25
+ lastName: string;
26
+ phone: string;
27
+ profileImageUrl: string;
28
+ isActive: boolean;
29
+ lastLogin: string;
30
+ skills: {
31
+ name: string;
32
+ level: string;
33
+ }[];
34
+ preferences: {
35
+ locale: string;
36
+ timezone: string;
37
+ notifications: {
38
+ email: boolean;
39
+ inApp: boolean;
40
+ sms: boolean;
41
+ push: boolean;
42
+ };
43
+ emailDigest: string;
44
+ dateFormat: string;
45
+ timeFormat: string;
46
+ };
47
+ isEmailVerified: boolean;
48
+ mfaEnabled: boolean;
49
+ suspended: boolean;
50
+ whitelist: boolean;
51
+ ipWhitelist: string[];
52
+ createdAt: string;
53
+ updatedAt: string;
54
+ };
55
+ } | null, ILoginResult | {
56
+ tokens: {
57
+ access: string;
58
+ refresh: string;
59
+ };
60
+ user: {
61
+ id: string;
62
+ email: string;
63
+ firstName: string;
64
+ lastName: string;
65
+ phone: string;
66
+ profileImageUrl: string;
67
+ isActive: boolean;
68
+ lastLogin: string;
69
+ skills: {
70
+ name: string;
71
+ level: string;
72
+ }[];
73
+ preferences: {
74
+ locale: string;
75
+ timezone: string;
76
+ notifications: {
77
+ email: boolean;
78
+ inApp: boolean;
79
+ sms: boolean;
80
+ push: boolean;
81
+ };
82
+ emailDigest: string;
83
+ dateFormat: string;
84
+ timeFormat: string;
85
+ };
86
+ isEmailVerified: boolean;
87
+ mfaEnabled: boolean;
88
+ suspended: boolean;
89
+ whitelist: boolean;
90
+ ipWhitelist: string[];
91
+ createdAt: string;
92
+ updatedAt: string;
93
+ };
94
+ } | null>;
95
+ };
96
+
97
+ declare function useLogout(client: AuthClient): {
98
+ logout: () => Promise<void>;
99
+ isLoading: vue.Ref<boolean, boolean>;
100
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
101
+ };
102
+
103
+ declare function useRegister(client: AuthClient): {
104
+ register: (input: IRegisterInput) => Promise<IRegisterResult>;
105
+ isLoading: vue.Ref<boolean, boolean>;
106
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
107
+ data: vue.Ref<{
108
+ tokens: {
109
+ access: string;
110
+ refresh: string;
111
+ };
112
+ user: {
113
+ id: string;
114
+ email: string;
115
+ firstName: string;
116
+ lastName: string;
117
+ phone: string;
118
+ profileImageUrl: string;
119
+ isActive: boolean;
120
+ lastLogin: string;
121
+ skills: {
122
+ name: string;
123
+ level: string;
124
+ }[];
125
+ preferences: {
126
+ locale: string;
127
+ timezone: string;
128
+ notifications: {
129
+ email: boolean;
130
+ inApp: boolean;
131
+ sms: boolean;
132
+ push: boolean;
133
+ };
134
+ emailDigest: string;
135
+ dateFormat: string;
136
+ timeFormat: string;
137
+ };
138
+ isEmailVerified: boolean;
139
+ mfaEnabled: boolean;
140
+ suspended: boolean;
141
+ whitelist: boolean;
142
+ ipWhitelist: string[];
143
+ createdAt: string;
144
+ updatedAt: string;
145
+ };
146
+ } | null, IRegisterResult | {
147
+ tokens: {
148
+ access: string;
149
+ refresh: string;
150
+ };
151
+ user: {
152
+ id: string;
153
+ email: string;
154
+ firstName: string;
155
+ lastName: string;
156
+ phone: string;
157
+ profileImageUrl: string;
158
+ isActive: boolean;
159
+ lastLogin: string;
160
+ skills: {
161
+ name: string;
162
+ level: string;
163
+ }[];
164
+ preferences: {
165
+ locale: string;
166
+ timezone: string;
167
+ notifications: {
168
+ email: boolean;
169
+ inApp: boolean;
170
+ sms: boolean;
171
+ push: boolean;
172
+ };
173
+ emailDigest: string;
174
+ dateFormat: string;
175
+ timeFormat: string;
176
+ };
177
+ isEmailVerified: boolean;
178
+ mfaEnabled: boolean;
179
+ suspended: boolean;
180
+ whitelist: boolean;
181
+ ipWhitelist: string[];
182
+ createdAt: string;
183
+ updatedAt: string;
184
+ };
185
+ } | null>;
186
+ };
187
+
188
+ declare function useResetPassword(client: AuthClient): {
189
+ resetPassword: (input: IResetPasswordInput) => Promise<void>;
190
+ isLoading: vue.Ref<boolean, boolean>;
191
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
192
+ done: vue.Ref<boolean, boolean>;
193
+ };
194
+
195
+ declare function useSession(client: AuthClient): {
196
+ user: vue.Ref<{
197
+ id: string;
198
+ email: string;
199
+ firstName: string;
200
+ lastName: string;
201
+ phone: string;
202
+ profileImageUrl: string;
203
+ isActive: boolean;
204
+ lastLogin: string;
205
+ skills: {
206
+ name: string;
207
+ level: string;
208
+ }[];
209
+ preferences: {
210
+ locale: string;
211
+ timezone: string;
212
+ notifications: {
213
+ email: boolean;
214
+ inApp: boolean;
215
+ sms: boolean;
216
+ push: boolean;
217
+ };
218
+ emailDigest: string;
219
+ dateFormat: string;
220
+ timeFormat: string;
221
+ };
222
+ isEmailVerified: boolean;
223
+ mfaEnabled: boolean;
224
+ suspended: boolean;
225
+ whitelist: boolean;
226
+ ipWhitelist: string[];
227
+ createdAt: string;
228
+ updatedAt: string;
229
+ } | null, IUserDTO | {
230
+ id: string;
231
+ email: string;
232
+ firstName: string;
233
+ lastName: string;
234
+ phone: string;
235
+ profileImageUrl: string;
236
+ isActive: boolean;
237
+ lastLogin: string;
238
+ skills: {
239
+ name: string;
240
+ level: string;
241
+ }[];
242
+ preferences: {
243
+ locale: string;
244
+ timezone: string;
245
+ notifications: {
246
+ email: boolean;
247
+ inApp: boolean;
248
+ sms: boolean;
249
+ push: boolean;
250
+ };
251
+ emailDigest: string;
252
+ dateFormat: string;
253
+ timeFormat: string;
254
+ };
255
+ isEmailVerified: boolean;
256
+ mfaEnabled: boolean;
257
+ suspended: boolean;
258
+ whitelist: boolean;
259
+ ipWhitelist: string[];
260
+ createdAt: string;
261
+ updatedAt: string;
262
+ } | null>;
263
+ isLoading: vue.Ref<boolean, boolean>;
264
+ isAuthenticated: vue.Ref<boolean, boolean>;
265
+ refresh: () => Promise<void>;
266
+ logout: () => Promise<void>;
267
+ };
268
+
269
+ declare function useVerifyEmail(client: AuthClient): {
270
+ verifyEmail: (pin: string) => Promise<IVerifyEmailResult>;
271
+ isLoading: vue.Ref<boolean, boolean>;
272
+ error: vue.Ref<FonderieApiError | null, FonderieApiError | null>;
273
+ data: vue.Ref<{
274
+ verified: boolean;
275
+ email: string;
276
+ } | null, IVerifyEmailResult | {
277
+ verified: boolean;
278
+ email: string;
279
+ } | null>;
280
+ };
281
+
282
+ export { useForgotPassword, useLogin, useLogout, useRegister, useResetPassword, useSession, useVerifyEmail };
package/dist/index.js ADDED
@@ -0,0 +1,214 @@
1
+ // src/index.ts
2
+ import { FonderieApiError as FonderieApiError7 } from "@fonderie/client";
3
+
4
+ // src/composables/useForgotPassword.ts
5
+ import { FonderieApiError } from "@fonderie/client";
6
+ import { ref } from "vue";
7
+ function useForgotPassword(client) {
8
+ const isLoading = ref(false);
9
+ const error = ref(null);
10
+ const sent = ref(false);
11
+ async function forgotPassword(email) {
12
+ isLoading.value = true;
13
+ error.value = null;
14
+ try {
15
+ await client.forgotPassword(email);
16
+ sent.value = true;
17
+ } catch (err) {
18
+ const apiError = err instanceof FonderieApiError ? err : new FonderieApiError("unknown", String(err), 0);
19
+ error.value = apiError;
20
+ throw apiError;
21
+ } finally {
22
+ isLoading.value = false;
23
+ }
24
+ }
25
+ return { forgotPassword, isLoading, error, sent };
26
+ }
27
+
28
+ // src/composables/useLogin.ts
29
+ import { FonderieApiError as FonderieApiError2 } from "@fonderie/client";
30
+ import { ref as ref2 } from "vue";
31
+
32
+ // src/storage.ts
33
+ var TOKEN_KEY = "fonderie_access_token";
34
+ function persistToken(token) {
35
+ localStorage.setItem(TOKEN_KEY, token);
36
+ }
37
+ function clearToken() {
38
+ localStorage.removeItem(TOKEN_KEY);
39
+ }
40
+ function readToken() {
41
+ return localStorage.getItem(TOKEN_KEY);
42
+ }
43
+
44
+ // src/composables/useLogin.ts
45
+ function useLogin(client) {
46
+ const isLoading = ref2(false);
47
+ const error = ref2(null);
48
+ const data = ref2(null);
49
+ async function login(input) {
50
+ isLoading.value = true;
51
+ error.value = null;
52
+ try {
53
+ const { result } = await client.login(input);
54
+ client.setAccessToken(result.tokens.access);
55
+ persistToken(result.tokens.access);
56
+ data.value = result;
57
+ return result;
58
+ } catch (err) {
59
+ const apiError = err instanceof FonderieApiError2 ? err : new FonderieApiError2("unknown", String(err), 0);
60
+ error.value = apiError;
61
+ throw apiError;
62
+ } finally {
63
+ isLoading.value = false;
64
+ }
65
+ }
66
+ return { login, isLoading, error, data };
67
+ }
68
+
69
+ // src/composables/useLogout.ts
70
+ import { FonderieApiError as FonderieApiError3 } from "@fonderie/client";
71
+ import { ref as ref3 } from "vue";
72
+ function useLogout(client) {
73
+ const isLoading = ref3(false);
74
+ const error = ref3(null);
75
+ async function logout() {
76
+ isLoading.value = true;
77
+ error.value = null;
78
+ try {
79
+ await client.logout();
80
+ } catch (err) {
81
+ const apiError = err instanceof FonderieApiError3 ? err : new FonderieApiError3("unknown", String(err), 0);
82
+ error.value = apiError;
83
+ } finally {
84
+ client.setAccessToken(void 0);
85
+ clearToken();
86
+ isLoading.value = false;
87
+ }
88
+ }
89
+ return { logout, isLoading, error };
90
+ }
91
+
92
+ // src/composables/useRegister.ts
93
+ import { FonderieApiError as FonderieApiError4 } from "@fonderie/client";
94
+ import { ref as ref4 } from "vue";
95
+ function useRegister(client) {
96
+ const isLoading = ref4(false);
97
+ const error = ref4(null);
98
+ const data = ref4(null);
99
+ async function register(input) {
100
+ isLoading.value = true;
101
+ error.value = null;
102
+ try {
103
+ const { result } = await client.register(input);
104
+ client.setAccessToken(result.tokens.access);
105
+ persistToken(result.tokens.access);
106
+ data.value = result;
107
+ return result;
108
+ } catch (err) {
109
+ const apiError = err instanceof FonderieApiError4 ? err : new FonderieApiError4("unknown", String(err), 0);
110
+ error.value = apiError;
111
+ throw apiError;
112
+ } finally {
113
+ isLoading.value = false;
114
+ }
115
+ }
116
+ return { register, isLoading, error, data };
117
+ }
118
+
119
+ // src/composables/useResetPassword.ts
120
+ import { FonderieApiError as FonderieApiError5 } from "@fonderie/client";
121
+ import { ref as ref5 } from "vue";
122
+ function useResetPassword(client) {
123
+ const isLoading = ref5(false);
124
+ const error = ref5(null);
125
+ const done = ref5(false);
126
+ async function resetPassword(input) {
127
+ isLoading.value = true;
128
+ error.value = null;
129
+ try {
130
+ await client.resetPassword(input);
131
+ done.value = true;
132
+ } catch (err) {
133
+ const apiError = err instanceof FonderieApiError5 ? err : new FonderieApiError5("unknown", String(err), 0);
134
+ error.value = apiError;
135
+ throw apiError;
136
+ } finally {
137
+ isLoading.value = false;
138
+ }
139
+ }
140
+ return { resetPassword, isLoading, error, done };
141
+ }
142
+
143
+ // src/composables/useSession.ts
144
+ import { ref as ref6 } from "vue";
145
+ function useSession(client) {
146
+ const user = ref6(null);
147
+ const isLoading = ref6(true);
148
+ const isAuthenticated = ref6(false);
149
+ async function refresh() {
150
+ isLoading.value = true;
151
+ try {
152
+ const { result } = await client.getUser();
153
+ user.value = result.user;
154
+ isAuthenticated.value = true;
155
+ } catch {
156
+ user.value = null;
157
+ isAuthenticated.value = false;
158
+ client.setAccessToken(void 0);
159
+ clearToken();
160
+ } finally {
161
+ isLoading.value = false;
162
+ }
163
+ }
164
+ async function logout() {
165
+ try {
166
+ await client.logout();
167
+ } catch {
168
+ }
169
+ client.setAccessToken(void 0);
170
+ clearToken();
171
+ user.value = null;
172
+ isAuthenticated.value = false;
173
+ }
174
+ const token = readToken();
175
+ if (token) client.setAccessToken(token);
176
+ void refresh();
177
+ return { user, isLoading, isAuthenticated, refresh, logout };
178
+ }
179
+
180
+ // src/composables/useVerifyEmail.ts
181
+ import { FonderieApiError as FonderieApiError6 } from "@fonderie/client";
182
+ import { ref as ref7 } from "vue";
183
+ function useVerifyEmail(client) {
184
+ const isLoading = ref7(false);
185
+ const error = ref7(null);
186
+ const data = ref7(null);
187
+ async function verifyEmail(pin) {
188
+ isLoading.value = true;
189
+ error.value = null;
190
+ try {
191
+ const { result } = await client.verifyEmail(pin);
192
+ data.value = result;
193
+ return result;
194
+ } catch (err) {
195
+ const apiError = err instanceof FonderieApiError6 ? err : new FonderieApiError6("unknown", String(err), 0);
196
+ error.value = apiError;
197
+ throw apiError;
198
+ } finally {
199
+ isLoading.value = false;
200
+ }
201
+ }
202
+ return { verifyEmail, isLoading, error, data };
203
+ }
204
+ export {
205
+ FonderieApiError7 as FonderieApiError,
206
+ useForgotPassword,
207
+ useLogin,
208
+ useLogout,
209
+ useRegister,
210
+ useResetPassword,
211
+ useSession,
212
+ useVerifyEmail
213
+ };
214
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/composables/useForgotPassword.ts","../src/composables/useLogin.ts","../src/storage.ts","../src/composables/useLogout.ts","../src/composables/useRegister.ts","../src/composables/useResetPassword.ts","../src/composables/useSession.ts","../src/composables/useVerifyEmail.ts"],"sourcesContent":["export type {\n\tAuthClient,\n\tILoginInput,\n\tILoginResult,\n\tIRegisterInput,\n\tIRegisterResult,\n\tIResetPasswordInput,\n\tITokens,\n\tIUserDTO,\n\tIVerifyEmailResult,\n} from '@fonderie/client';\n\nexport { FonderieApiError } from '@fonderie/client';\n\nexport {\n\tuseForgotPassword,\n\tuseLogin,\n\tuseLogout,\n\tuseRegister,\n\tuseResetPassword,\n\tuseSession,\n\tuseVerifyEmail,\n} from './composables';\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\n\nexport function useForgotPassword(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst sent = ref(false);\n\n\tasync function forgotPassword(email: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait client.forgotPassword(email);\n\t\t\tsent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { forgotPassword, isLoading, error, sent };\n}\n","import type { AuthClient, ILoginInput, ILoginResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useLogin(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\n\tasync function login(input: ILoginInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await client.login(input);\n\t\t\tclient.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { login, isLoading, error, data };\n}\n","export const TOKEN_KEY = 'fonderie_access_token';\n\nexport function persistToken(token: string) {\n\tlocalStorage.setItem(TOKEN_KEY, token);\n}\n\nexport function clearToken() {\n\tlocalStorage.removeItem(TOKEN_KEY);\n}\n\nexport function readToken(): string | null {\n\treturn localStorage.getItem(TOKEN_KEY);\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport function useLogout(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function logout() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait client.logout();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tclient.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { logout, isLoading, error };\n}\n","import type { AuthClient, IRegisterInput, IRegisterResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useRegister(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IRegisterResult | null>(null);\n\n\tasync function register(input: IRegisterInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await client.register(input);\n\t\t\tclient.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { register, isLoading, error, data };\n}\n","import type { AuthClient, IResetPasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\n\nexport function useResetPassword(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function resetPassword(input: IResetPasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait client.resetPassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { resetPassword, isLoading, error, done };\n}\n","import type { AuthClient, IUserDTO } from '@fonderie/client';\nimport { ref } from 'vue';\nimport { clearToken, readToken } from '../storage';\n\nexport function useSession(client: AuthClient) {\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst isAuthenticated = ref(false);\n\n\tasync function refresh() {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await client.getUser();\n\t\t\tuser.value = result.user;\n\t\t\tisAuthenticated.value = true;\n\t\t} catch {\n\t\t\tuser.value = null;\n\t\t\tisAuthenticated.value = false;\n\t\t\tclient.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function logout() {\n\t\ttry {\n\t\t\tawait client.logout();\n\t\t} catch {\n\t\t\t// Session is being torn down regardless of server response.\n\t\t}\n\t\tclient.setAccessToken(undefined);\n\t\tclearToken();\n\t\tuser.value = null;\n\t\tisAuthenticated.value = false;\n\t}\n\n\tconst token = readToken();\n\tif (token) client.setAccessToken(token);\n\tvoid refresh();\n\n\treturn { user, isLoading, isAuthenticated, refresh, logout };\n}\n","import type { AuthClient, IVerifyEmailResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { ref } from 'vue';\n\nexport function useVerifyEmail(client: AuthClient) {\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IVerifyEmailResult | null>(null);\n\n\tasync function verifyEmail(pin: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await client.verifyEmail(pin);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyEmail, isLoading, error, data };\n}\n"],"mappings":";AAYA,SAAS,oBAAAA,yBAAwB;;;ACXjC,SAAS,wBAAwB;AACjC,SAAS,WAAW;AAEb,SAAS,kBAAkB,QAAoB;AACrD,QAAM,YAAY,IAAI,KAAK;AAC3B,QAAM,QAAQ,IAA6B,IAAI;AAC/C,QAAM,OAAO,IAAI,KAAK;AAEtB,iBAAe,eAAe,OAAe;AAC5C,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,OAAO,eAAe,KAAK;AACjC,WAAK,QAAQ;AAAA,IACd,SAAS,KAAK;AACb,YAAM,WACL,eAAe,mBAAmB,MAAM,IAAI,iBAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,gBAAgB,WAAW,OAAO,KAAK;AACjD;;;ACzBA,SAAS,oBAAAC,yBAAwB;AACjC,SAAS,OAAAC,YAAW;;;ACFb,IAAM,YAAY;AAElB,SAAS,aAAa,OAAe;AAC3C,eAAa,QAAQ,WAAW,KAAK;AACtC;AAEO,SAAS,aAAa;AAC5B,eAAa,WAAW,SAAS;AAClC;AAEO,SAAS,YAA2B;AAC1C,SAAO,aAAa,QAAQ,SAAS;AACtC;;;ADPO,SAAS,SAAS,QAAoB;AAC5C,QAAM,YAAYC,KAAI,KAAK;AAC3B,QAAM,QAAQA,KAA6B,IAAI;AAC/C,QAAM,OAAOA,KAAyB,IAAI;AAE1C,iBAAe,MAA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,QAAQ;AAAA,IACzB,QAAQ;AACP,WAAK,QAAQ;AACb,sBAAgB,QAAQ;AACxB,aAAO,eAAe,MAAS;AAC/B,iBAAW;AAAA,IACZ,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,iBAAe,SAAS;AACvB,QAAI;AACH,YAAM,OAAO,OAAO;AAAA,IACrB,QAAQ;AAAA,IAER;AACA,WAAO,eAAe,MAAS;AAC/B,eAAW;AACX,SAAK,QAAQ;AACb,oBAAgB,QAAQ;AAAA,EACzB;AAEA,QAAM,QAAQ,UAAU;AACxB,MAAI,MAAO,QAAO,eAAe,KAAK;AACtC,OAAK,QAAQ;AAEb,SAAO,EAAE,MAAM,WAAW,iBAAiB,SAAS,OAAO;AAC5D;;;ACzCA,SAAS,oBAAAC,yBAAwB;AACjC,SAAS,OAAAC,YAAW;AAEb,SAAS,eAAe,QAAoB;AAClD,QAAM,YAAYA,KAAI,KAAK;AAC3B,QAAM,QAAQA,KAA6B,IAAI;AAC/C,QAAM,OAAOA,KAA+B,IAAI;AAEhD,iBAAe,YAAY,KAAa;AACvC,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,EAAE,OAAO,IAAI,MAAM,OAAO,YAAY,GAAG;AAC/C,WAAK,QAAQ;AACb,aAAO;AAAA,IACR,SAAS,KAAK;AACb,YAAM,WACL,eAAeD,oBAAmB,MAAM,IAAIA,kBAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,aAAa,WAAW,OAAO,KAAK;AAC9C;","names":["FonderieApiError","FonderieApiError","ref","ref","FonderieApiError","FonderieApiError","ref","ref","FonderieApiError","FonderieApiError","ref","ref","FonderieApiError","FonderieApiError","ref","ref","ref","FonderieApiError","ref"]}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@fonderie/vue-auth",
3
+ "version": "0.1.0",
4
+ "description": "Vue composables for Fonderie auth — thin bindings over @fonderie/client.",
5
+ "keywords": [
6
+ "fonderie-js",
7
+ "vue",
8
+ "auth",
9
+ "composables",
10
+ "typescript"
11
+ ],
12
+ "license": "MIT",
13
+ "type": "module",
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.cjs"
22
+ }
23
+ },
24
+ "main": "./dist/index.cjs",
25
+ "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "dev": "tsup --watch",
30
+ "typecheck": "tsc --noEmit",
31
+ "lint": "biome lint src",
32
+ "format": "biome format --write src",
33
+ "check": "biome check --write src"
34
+ },
35
+ "dependencies": {
36
+ "@fonderie/client": "*"
37
+ },
38
+ "peerDependencies": {
39
+ "vue": ">=3.0.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^25.6.0",
43
+ "tsup": "^8.5.1",
44
+ "typescript": "^6.0.3",
45
+ "vue": "^3.5.0"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "files": [
51
+ "dist",
52
+ "LICENSE",
53
+ "README.md"
54
+ ],
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/fonderiejs/fonderie.git",
58
+ "directory": "packages/vue-auth"
59
+ },
60
+ "homepage": "https://github.com/fonderiejs/fonderie/tree/main/packages/vue-auth#readme",
61
+ "bugs": {
62
+ "url": "https://github.com/fonderiejs/fonderie/issues"
63
+ }
64
+ }