@strands.gg/accui 2.17.56 → 2.17.58

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.
Files changed (56) hide show
  1. package/package.json +2 -2
  2. package/dist/StrandsUIPlugin-CiAAY2sN.cjs.js +0 -143
  3. package/dist/StrandsUIPlugin-Dar_Az2V.es.js +0 -20430
  4. package/dist/StrandsUIPlugin-fHS0GmiX.cjs.js +0 -143
  5. package/dist/StrandsUIPlugin-hYC1FxeG.es.js +0 -20577
  6. package/dist/accui.css +0 -1
  7. package/dist/index.cjs.js +0 -5
  8. package/dist/index.es.js +0 -12931
  9. package/dist/nuxt/module.cjs.js +0 -23
  10. package/dist/nuxt/module.es.js +0 -182
  11. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.cjs.js +0 -1
  12. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.es.js +0 -103
  13. package/dist/nuxt/runtime/composables/useStrandsAuth.cjs.js +0 -1
  14. package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts +0 -111
  15. package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +0 -100
  16. package/dist/nuxt/runtime/composables/useStrandsOAuth.d.ts +0 -8
  17. package/dist/nuxt/runtime/middleware/auth.global.cjs.js +0 -1
  18. package/dist/nuxt/runtime/middleware/auth.global.es.js +0 -35
  19. package/dist/nuxt/runtime/plugin.client.cjs.js +0 -1
  20. package/dist/nuxt/runtime/plugin.client.es.js +0 -21
  21. package/dist/nuxt/runtime/plugin.server.cjs.js +0 -1
  22. package/dist/nuxt/runtime/plugin.server.es.js +0 -15
  23. package/dist/nuxt/runtime/plugins/auth-interceptor.client.cjs.js +0 -1
  24. package/dist/nuxt/runtime/plugins/auth-interceptor.client.d.ts +0 -9
  25. package/dist/nuxt/runtime/plugins/auth-interceptor.client.es.js +0 -46
  26. package/dist/nuxt/types.d.ts +0 -51
  27. package/dist/nuxt.cjs.js +0 -1
  28. package/dist/nuxt.es.js +0 -11
  29. package/dist/robots.txt +0 -4
  30. package/dist/shared/defaults.d.ts +0 -2
  31. package/dist/sitemap.xml +0 -9
  32. package/dist/types/composables.d.ts +0 -97
  33. package/dist/types/index.d.ts +0 -263
  34. package/dist/types/oauth.d.ts +0 -420
  35. package/dist/useDarkMode-BdG1G2mj.es.js +0 -102
  36. package/dist/useDarkMode-BvBnG5kF.cjs.js +0 -1
  37. package/dist/useDarkMode-Dd0Q5Nnz.cjs.js +0 -1
  38. package/dist/useDarkMode-FTkHLBsX.es.js +0 -102
  39. package/dist/useDarkMode-OZ_A8-6H.es.js +0 -102
  40. package/dist/useStrandsAuth-CetpoBNk.cjs.js +0 -1
  41. package/dist/useStrandsAuth-DEWj1bFC.cjs.js +0 -1
  42. package/dist/useStrandsAuth-DTJ5fn33.es.js +0 -666
  43. package/dist/useStrandsAuth-Z7P9ujqQ.es.js +0 -666
  44. package/dist/useStrandsAuth-wzl2F9DE.es.js +0 -702
  45. package/dist/useStrandsConfig-B2UXxIbT.es.js +0 -213
  46. package/dist/useStrandsConfig-BGJg1LlC.es.js +0 -213
  47. package/dist/useStrandsConfig-BYOAEt9d.cjs.js +0 -1
  48. package/dist/vite.cjs.js +0 -29
  49. package/dist/vite.es.js +0 -92
  50. package/dist/vue/components/index.d.ts +0 -29
  51. package/dist/vue/composables/useAuthenticatedFetch.d.ts +0 -22
  52. package/dist/vue/composables/useDarkMode.d.ts +0 -53
  53. package/dist/vue/composables/useStrandsOAuth.d.ts +0 -10
  54. package/dist/vue/ui/UiButton/index.d.ts +0 -11
  55. package/dist/vue/ui/UiMegaMenu/index.d.ts +0 -4
  56. package/dist/vue/ui/index.d.ts +0 -62
@@ -1,23 +0,0 @@
1
- "use strict";const o=require("@nuxt/kit");var n=typeof document<"u"?document.currentScript:null;const h={baseUrl:"https://your-api.example.com",accentColor:"#EA00A8",redirectUrl:"/",onSignInUrl:"/dashboard",onSignOutUrl:"/",autoRefresh:!0,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:!1,styles:!0,supportEmail:"",oauth2RedirectUrl:"",theme:"system"},g=o.defineNuxtModule({meta:{name:"@strands.gg/accui/nuxt",configKey:"strandsAuth",compatibility:{nuxt:"^3.0.0 || ^4.0.0"}},defaults:h,async setup(a,t){const s=o.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.tagName.toUpperCase()==="SCRIPT"&&n.src||new URL("nuxt/module.cjs.js",document.baseURI).href);t.options.runtimeConfig.public=t.options.runtimeConfig.public||{};const i={...a,styles:a.styles!==!1};if(t.options.runtimeConfig.public.strandsAuth=i,t.options.appConfig&&(t.options.appConfig.strandsAuth=i),a.styles!==!1&&t.options.css.push("@strands.gg/accui/style.css"),a.accentColor&&a.accentColor!=="#EA00A8"){const e=a.accentColor,p=`
2
- :root {
3
- --strands-custom-accent: ${e};
4
- --strands-custom-50: color-mix(in srgb, ${e} 10%, white);
5
- --strands-custom-100: color-mix(in srgb, ${e} 20%, white);
6
- --strands-custom-200: color-mix(in srgb, ${e} 30%, white);
7
- --strands-custom-300: color-mix(in srgb, ${e} 40%, white);
8
- --strands-custom-400: color-mix(in srgb, ${e} 70%, white);
9
- --strands-custom-500: ${e};
10
- --strands-custom-600: color-mix(in srgb, ${e} 85%, black);
11
- --strands-custom-700: color-mix(in srgb, ${e} 70%, black);
12
- --strands-custom-800: color-mix(in srgb, ${e} 55%, black);
13
- --strands-custom-900: color-mix(in srgb, ${e} 40%, black);
14
- --strands-custom-950: color-mix(in srgb, ${e} 25%, black);
15
- }
16
- `;t.options.app.head=t.options.app.head||{},t.options.app.head.style=t.options.app.head.style||[],t.options.app.head.style.unshift({innerHTML:p,key:"strands-accent-override"})}const r="es.js",u=s.resolve(`./runtime/plugin.client.${r}`),d=s.resolve(`./runtime/plugin.server.${r}`),c=s.resolve(`./runtime/middleware/auth.global.${r}`),l=s.resolve(`./runtime/plugins/auth-interceptor.client.${r}`);o.addPlugin({src:u,mode:"client"}),o.addPlugin({src:d,mode:"server"}),o.addPlugin({src:l,mode:"client"}),o.addRouteMiddleware({name:"auth",path:c,global:!0}),t.hook("pages:extend",()=>{}),o.addImports([{name:"useStrandsAuth",as:"useStrandsAuth",from:s.resolve(`./runtime/composables/useStrandsAuth.${r}`)},{name:"useAuthUser",as:"useAuthUser",from:s.resolve(`./runtime/composables/useStrandsAuth.${r}`)},{name:"useAuthState",as:"useAuthState",from:s.resolve(`./runtime/composables/useStrandsAuth.${r}`)},{name:"useAuthenticatedFetch",as:"useAuthenticatedFetch",from:s.resolve(`./runtime/composables/useAuthenticatedFetch.${r}`)},{name:"useStrandsOAuth",as:"useStrandsOAuth",from:s.resolve(`./runtime/composables/useStrandsOAuth.${r}`)}]);const m=["StrandsAuth","StrandsSignIn","StrandsSignUp","StrandsCompleteSignUp","StrandsUserProfile","StrandsUserButton","StrandsPasswordReset","StrandsMFASetup","StrandsMfaVerification","StrandsMfaModal","StrandsBackupCodesModal","StrandsConfirmModal","StrandsEmailMfaSetupModal","StrandsHardwareKeySetupModal","StrandsSessionsModal","StrandsSettingsModal","StrandsTotpSetupModal","StrandsConfigProvider","SignedIn","StrandsLogo","StrandsSecuredFooter","StrandsNav","StrandsNavItem","StrandsOAuthButton","StrandsOAuthCallback","UiAlert","UiApp","UiAvatarEditor","UiButton","UiCard","UiCheckboxGroup","UiColorPicker","UiDateTimePicker","UiDivider","UiHero","UiInput","UiLevelProgress","UiLink","UiLoader","UiMegaMenu","UiMegaMenuItem","UiMegaMenuPanel","UiMegaMenuGroup","UiModal","UiPill","UiRadioGroup","UiSlider","UiTable","UiTabs","UiThemeToggle","UiToggle","UiTooltip","VirtualList","SvgIcon","IconGithub","IconGoogle"];for(const e of m)o.addComponent({name:e,export:e,filePath:"@strands.gg/accui"});t.hook("prepare:types",e=>{e.references.push({types:"@strands.gg/auth-nuxt"}),e.declarations&&e.declarations.push(`
17
- declare global {
18
- const useStrandsAuth: typeof import('${s.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useStrandsAuth']
19
- const useAuthUser: typeof import('${s.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthUser']
20
- const useAuthState: typeof import('${s.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthState']
21
- const useAuthenticatedFetch: typeof import('${s.resolve("./runtime/composables/useAuthenticatedFetch.d.ts")}')['useAuthenticatedFetch']
22
- }
23
- `)})}});module.exports=g;
@@ -1,182 +0,0 @@
1
- import { defineNuxtModule as p, createResolver as h, addPlugin as a, addRouteMiddleware as g, addImports as S, addComponent as f } from "@nuxt/kit";
2
- const A = {
3
- baseUrl: "https://your-api.example.com",
4
- accentColor: "#EA00A8",
5
- redirectUrl: "/",
6
- onSignInUrl: "/dashboard",
7
- onSignOutUrl: "/",
8
- autoRefresh: !0,
9
- refreshInterval: 4,
10
- protectedRoutes: [],
11
- guestOnlyRoutes: ["/auth", "/login", "/register"],
12
- devMode: !1,
13
- styles: !0,
14
- supportEmail: "",
15
- oauth2RedirectUrl: "",
16
- theme: "system"
17
- }, b = p({
18
- meta: {
19
- name: "@strands.gg/accui/nuxt",
20
- configKey: "strandsAuth",
21
- compatibility: {
22
- nuxt: "^3.0.0 || ^4.0.0"
23
- }
24
- },
25
- defaults: A,
26
- async setup(r, t) {
27
- const s = h(import.meta.url);
28
- t.options.runtimeConfig.public = t.options.runtimeConfig.public || {};
29
- const n = {
30
- ...r,
31
- styles: r.styles !== !1
32
- };
33
- if (t.options.runtimeConfig.public.strandsAuth = n, t.options.appConfig && (t.options.appConfig.strandsAuth = n), r.styles !== !1 && t.options.css.push("@strands.gg/accui/style.css"), r.accentColor && r.accentColor !== "#EA00A8") {
34
- const e = r.accentColor, m = `
35
- :root {
36
- --strands-custom-accent: ${e};
37
- --strands-custom-50: color-mix(in srgb, ${e} 10%, white);
38
- --strands-custom-100: color-mix(in srgb, ${e} 20%, white);
39
- --strands-custom-200: color-mix(in srgb, ${e} 30%, white);
40
- --strands-custom-300: color-mix(in srgb, ${e} 40%, white);
41
- --strands-custom-400: color-mix(in srgb, ${e} 70%, white);
42
- --strands-custom-500: ${e};
43
- --strands-custom-600: color-mix(in srgb, ${e} 85%, black);
44
- --strands-custom-700: color-mix(in srgb, ${e} 70%, black);
45
- --strands-custom-800: color-mix(in srgb, ${e} 55%, black);
46
- --strands-custom-900: color-mix(in srgb, ${e} 40%, black);
47
- --strands-custom-950: color-mix(in srgb, ${e} 25%, black);
48
- }
49
- `;
50
- t.options.app.head = t.options.app.head || {}, t.options.app.head.style = t.options.app.head.style || [], t.options.app.head.style.unshift({
51
- innerHTML: m,
52
- key: "strands-accent-override"
53
- });
54
- }
55
- const o = "es.js", i = s.resolve(`./runtime/plugin.client.${o}`), u = s.resolve(`./runtime/plugin.server.${o}`), d = s.resolve(`./runtime/middleware/auth.global.${o}`), l = s.resolve(`./runtime/plugins/auth-interceptor.client.${o}`);
56
- a({
57
- src: i,
58
- mode: "client"
59
- }), a({
60
- src: u,
61
- mode: "server"
62
- }), a({
63
- src: l,
64
- mode: "client"
65
- }), g({
66
- name: "auth",
67
- path: d,
68
- global: !0
69
- }), t.hook("pages:extend", () => {
70
- }), S([
71
- {
72
- name: "useStrandsAuth",
73
- as: "useStrandsAuth",
74
- from: s.resolve(`./runtime/composables/useStrandsAuth.${o}`)
75
- },
76
- {
77
- name: "useAuthUser",
78
- as: "useAuthUser",
79
- from: s.resolve(`./runtime/composables/useStrandsAuth.${o}`)
80
- },
81
- {
82
- name: "useAuthState",
83
- as: "useAuthState",
84
- from: s.resolve(`./runtime/composables/useStrandsAuth.${o}`)
85
- },
86
- {
87
- name: "useAuthenticatedFetch",
88
- as: "useAuthenticatedFetch",
89
- from: s.resolve(`./runtime/composables/useAuthenticatedFetch.${o}`)
90
- },
91
- {
92
- name: "useStrandsOAuth",
93
- as: "useStrandsOAuth",
94
- from: s.resolve(`./runtime/composables/useStrandsOAuth.${o}`)
95
- }
96
- ]);
97
- const c = [
98
- // Strands Auth Components
99
- "StrandsAuth",
100
- "StrandsSignIn",
101
- "StrandsSignUp",
102
- "StrandsCompleteSignUp",
103
- "StrandsUserProfile",
104
- "StrandsUserButton",
105
- "StrandsPasswordReset",
106
- "StrandsMFASetup",
107
- "StrandsMfaVerification",
108
- "StrandsMfaModal",
109
- "StrandsBackupCodesModal",
110
- "StrandsConfirmModal",
111
- "StrandsEmailMfaSetupModal",
112
- "StrandsHardwareKeySetupModal",
113
- "StrandsSessionsModal",
114
- "StrandsSettingsModal",
115
- "StrandsTotpSetupModal",
116
- "StrandsConfigProvider",
117
- "SignedIn",
118
- "StrandsLogo",
119
- "StrandsSecuredFooter",
120
- "StrandsNav",
121
- "StrandsNavItem",
122
- // OAuth2 Client Components
123
- "StrandsOAuthButton",
124
- "StrandsOAuthCallback",
125
- // UI Components
126
- "UiAlert",
127
- "UiApp",
128
- "UiAvatarEditor",
129
- "UiButton",
130
- "UiCard",
131
- "UiCheckboxGroup",
132
- "UiColorPicker",
133
- "UiDateTimePicker",
134
- "UiDivider",
135
- "UiHero",
136
- "UiInput",
137
- "UiLevelProgress",
138
- "UiLink",
139
- "UiLoader",
140
- "UiMegaMenu",
141
- "UiMegaMenuItem",
142
- "UiMegaMenuPanel",
143
- "UiMegaMenuGroup",
144
- "UiModal",
145
- "UiPill",
146
- "UiRadioGroup",
147
- "UiSlider",
148
- "UiTable",
149
- "UiTabs",
150
- "UiThemeToggle",
151
- "UiToggle",
152
- "UiTooltip",
153
- // Utility Components
154
- "VirtualList",
155
- "SvgIcon",
156
- // Icons
157
- "IconGithub",
158
- "IconGoogle"
159
- ];
160
- for (const e of c)
161
- f({
162
- name: e,
163
- export: e,
164
- filePath: "@strands.gg/accui"
165
- });
166
- t.hook("prepare:types", (e) => {
167
- e.references.push({
168
- types: "@strands.gg/auth-nuxt"
169
- }), e.declarations && e.declarations.push(`
170
- declare global {
171
- const useStrandsAuth: typeof import('${s.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useStrandsAuth']
172
- const useAuthUser: typeof import('${s.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthUser']
173
- const useAuthState: typeof import('${s.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthState']
174
- const useAuthenticatedFetch: typeof import('${s.resolve("./runtime/composables/useAuthenticatedFetch.d.ts")}')['useAuthenticatedFetch']
175
- }
176
- `);
177
- });
178
- }
179
- });
180
- export {
181
- b as default
182
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("nuxt/app"),m=require("./useStrandsAuth.cjs.js");function i(){const r=A.useRuntimeConfig().public.strandsAuth,{currentSession:t,refreshToken:a,getAuthHeaders:o}=m.useStrandsAuth(),u=async(s,e={})=>{const{autoRefresh:c=!0,requireAuth:n=!0,baseURL:j,...y}=e;if(n&&!t.value?.accessToken)throw new Error("User is not authenticated");let p=s;const g=j||r.baseUrl;g&&typeof s=="string"&&!s.startsWith("http")&&(p=new URL(s,g).toString());const f=new Headers(y.headers);if(t.value?.accessToken)try{const h=o();Object.entries(h).forEach(([l,T])=>{f.set(l,T)})}catch(h){if(console.warn("[Strands Auth] Failed to get auth headers:",h),n)throw h}const w={...y,headers:f};let d=await fetch(p,w);if(d.status===401&&c&&t.value?.refreshToken)try{if(await a()&&t.value?.accessToken){const l=o();Object.entries(l).forEach(([T,S])=>{f.set(T,S)}),d=await fetch(p,{...w,headers:f})}}catch(h){console.error("[Strands Auth] Token refresh failed:",h)}return d};return{authenticatedFetch:u,get:(s,e)=>u(s,{...e,method:"GET"}),post:(s,e,c)=>{const n=new Headers(c?.headers);return e&&typeof e=="object"&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),u(s,{...c,method:"POST",headers:n,body:typeof e=="object"?JSON.stringify(e):e})},put:(s,e,c)=>{const n=new Headers(c?.headers);return e&&typeof e=="object"&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),u(s,{...c,method:"PUT",headers:n,body:typeof e=="object"?JSON.stringify(e):e})},delete:(s,e)=>u(s,{...e,method:"DELETE"}),patch:(s,e,c)=>{const n=new Headers(c?.headers);return e&&typeof e=="object"&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),u(s,{...c,method:"PATCH",headers:n,body:typeof e=="object"?JSON.stringify(e):e})}}}const O={get:async(r,t)=>{const{get:a}=i();return a(r,t)},post:async(r,t,a)=>{const{post:o}=i();return o(r,t,a)},put:async(r,t,a)=>{const{put:o}=i();return o(r,t,a)},delete:async(r,t)=>{const{delete:a}=i();return a(r,t)},patch:async(r,t,a)=>{const{patch:o}=i();return o(r,t,a)}};exports.$authFetch=O;exports.useAuthenticatedFetch=i;
@@ -1,103 +0,0 @@
1
- import { useRuntimeConfig as A } from "nuxt/app";
2
- import { useStrandsAuth as S } from "./useStrandsAuth.es.js";
3
- function u() {
4
- const r = A().public.strandsAuth, { currentSession: t, refreshToken: o, getAuthHeaders: c } = S(), i = async (s, e = {}) => {
5
- const {
6
- autoRefresh: a = !0,
7
- requireAuth: n = !0,
8
- baseURL: j,
9
- ...y
10
- } = e;
11
- if (n && !t.value?.accessToken)
12
- throw new Error("User is not authenticated");
13
- let p = s;
14
- const g = j || r.baseUrl;
15
- g && typeof s == "string" && !s.startsWith("http") && (p = new URL(s, g).toString());
16
- const f = new Headers(y.headers);
17
- if (t.value?.accessToken)
18
- try {
19
- const h = c();
20
- Object.entries(h).forEach(([l, T]) => {
21
- f.set(l, T);
22
- });
23
- } catch (h) {
24
- if (console.warn("[Strands Auth] Failed to get auth headers:", h), n)
25
- throw h;
26
- }
27
- const w = {
28
- ...y,
29
- headers: f
30
- };
31
- let d = await fetch(p, w);
32
- if (d.status === 401 && a && t.value?.refreshToken)
33
- try {
34
- if (await o() && t.value?.accessToken) {
35
- const l = c();
36
- Object.entries(l).forEach(([T, m]) => {
37
- f.set(T, m);
38
- }), d = await fetch(p, { ...w, headers: f });
39
- }
40
- } catch (h) {
41
- console.error("[Strands Auth] Token refresh failed:", h);
42
- }
43
- return d;
44
- };
45
- return {
46
- authenticatedFetch: i,
47
- get: (s, e) => i(s, { ...e, method: "GET" }),
48
- post: (s, e, a) => {
49
- const n = new Headers(a?.headers);
50
- return e && typeof e == "object" && !n.has("Content-Type") && n.set("Content-Type", "application/json"), i(s, {
51
- ...a,
52
- method: "POST",
53
- headers: n,
54
- body: typeof e == "object" ? JSON.stringify(e) : e
55
- });
56
- },
57
- put: (s, e, a) => {
58
- const n = new Headers(a?.headers);
59
- return e && typeof e == "object" && !n.has("Content-Type") && n.set("Content-Type", "application/json"), i(s, {
60
- ...a,
61
- method: "PUT",
62
- headers: n,
63
- body: typeof e == "object" ? JSON.stringify(e) : e
64
- });
65
- },
66
- delete: (s, e) => i(s, { ...e, method: "DELETE" }),
67
- patch: (s, e, a) => {
68
- const n = new Headers(a?.headers);
69
- return e && typeof e == "object" && !n.has("Content-Type") && n.set("Content-Type", "application/json"), i(s, {
70
- ...a,
71
- method: "PATCH",
72
- headers: n,
73
- body: typeof e == "object" ? JSON.stringify(e) : e
74
- });
75
- }
76
- };
77
- }
78
- const R = {
79
- get: async (r, t) => {
80
- const { get: o } = u();
81
- return o(r, t);
82
- },
83
- post: async (r, t, o) => {
84
- const { post: c } = u();
85
- return c(r, t, o);
86
- },
87
- put: async (r, t, o) => {
88
- const { put: c } = u();
89
- return c(r, t, o);
90
- },
91
- delete: async (r, t) => {
92
- const { delete: o } = u();
93
- return o(r, t);
94
- },
95
- patch: async (r, t, o) => {
96
- const { patch: c } = u();
97
- return c(r, t, o);
98
- }
99
- };
100
- export {
101
- R as $authFetch,
102
- u as useAuthenticatedFetch
103
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),a=require("nuxt/app"),u=require("../../../useStrandsAuth-CetpoBNk.cjs.js");const i=()=>{let e;try{const s=a.useRuntimeConfig();s&&s.public&&(e=s.public.strandsAuth)}catch{}const n=u.useStrandsAuth();return{...n,initialize:async()=>{await n.initialize()},signIn:async s=>{const t=await n.signIn(s);return t&&e?.onSignInUrl&&await a.navigateTo(e.onSignInUrl),t},signUp:async s=>await n.signUp({email:s.email,password:"",firstName:"",lastName:""}),signOut:async()=>{await n.signOut(),e?.onSignOutUrl&&await a.navigateTo(e.onSignOutUrl)}}},l=()=>{const{user:e}=i();return{user:e}},r=()=>{const{isAuthenticated:e,isLoading:n}=i();return{isAuthenticated:e,isLoading:n}};exports.useAuthState=r;exports.useAuthUser=l;exports.useStrandsAuth=i;
@@ -1,111 +0,0 @@
1
- import type { ComputedRef } from 'vue';
2
- import type { User } from '../../../types';
3
- export declare const useStrandsAuth: () => {
4
- user: ComputedRef<User>;
5
- currentUser: ComputedRef<User>;
6
- currentSession: ComputedRef<null>;
7
- isAuthenticated: ComputedRef<boolean>;
8
- isLoading: ComputedRef<boolean>;
9
- loading: ComputedRef<boolean>;
10
- loadingMessage: ComputedRef<string>;
11
- isInitializing: ComputedRef<boolean>;
12
- isInitialized: ComputedRef<boolean>;
13
- isSigningIn: ComputedRef<boolean>;
14
- isSigningUp: ComputedRef<boolean>;
15
- isSigningOut: ComputedRef<boolean>;
16
- isRefreshingToken: ComputedRef<boolean>;
17
- isSendingMfaEmail: ComputedRef<boolean>;
18
- isVerifyingMfa: ComputedRef<boolean>;
19
- mfaRequired: ComputedRef<boolean>;
20
- mfaSessionId: ComputedRef<string>;
21
- availableMfaMethods: ComputedRef<unknown[]>;
22
- signIn: () => Promise<null>;
23
- signUp: () => Promise<null>;
24
- signOut: () => Promise<void>;
25
- refreshToken: () => Promise<boolean>;
26
- fetchProfile: () => Promise<null>;
27
- updateProfile: () => Promise<null>;
28
- updateUserSettings: () => Promise<null>;
29
- changeEmail: () => Promise<null>;
30
- changeUsername: () => Promise<null>;
31
- getUsernameCooldown: () => Promise<Record<string, unknown>>;
32
- checkUsernameAvailability: () => Promise<Record<string, unknown>>;
33
- getUserSessions: () => Promise<unknown[]>;
34
- getSessionStats: () => Promise<Record<string, unknown>>;
35
- revokeSession: () => Promise<boolean>;
36
- revokeAllOtherSessions: () => Promise<boolean>;
37
- initialize: () => Promise<void>;
38
- setAuthData: () => Promise<void>;
39
- verifyMfa: () => Promise<null>;
40
- sendMfaEmailCode: () => Promise<null>;
41
- getMfaWebAuthnChallenge: () => Promise<null>;
42
- registerHardwareKey: () => Promise<null>;
43
- completeHardwareKeyRegistration: () => Promise<null>;
44
- startTokenRefreshTimer: () => void;
45
- stopTokenRefreshTimer: () => void;
46
- getAuthHeaders: () => Record<string, string>;
47
- forceReInit: () => void;
48
- } | {
49
- initialize: () => Promise<void>;
50
- signIn: (credentials: {
51
- email: string;
52
- password: string;
53
- }) => Promise<any>;
54
- signUp: (userData: {
55
- email: string;
56
- }) => Promise<void>;
57
- signOut: () => Promise<void>;
58
- user: ComputedRef<User | null>;
59
- currentUser: ComputedRef<User | null>;
60
- currentSession: ComputedRef<import("../../..").Session | null>;
61
- isAuthenticated: ComputedRef<boolean>;
62
- isLoading: ComputedRef<boolean>;
63
- loading: ComputedRef<boolean>;
64
- loadingMessage: ComputedRef<string>;
65
- isInitializing: ComputedRef<boolean>;
66
- isInitialized: ComputedRef<boolean>;
67
- isSigningIn: ComputedRef<boolean>;
68
- isSigningUp: ComputedRef<boolean>;
69
- isSigningOut: ComputedRef<boolean>;
70
- isRefreshingToken: ComputedRef<boolean>;
71
- isSendingMfaEmail: ComputedRef<boolean>;
72
- isVerifyingMfa: ComputedRef<boolean>;
73
- mfaRequired: ComputedRef<boolean>;
74
- mfaSessionId: ComputedRef<string | null>;
75
- availableMfaMethods: ComputedRef<import("../../..").MfaDevice[]>;
76
- refreshToken: () => Promise<boolean>;
77
- fetchProfile: () => Promise<User>;
78
- updateProfile: (updates: Partial<User>) => Promise<User>;
79
- updateUserSettings: (settings: any) => Promise<User>;
80
- changeEmail: (newEmail: string, password: string) => Promise<void>;
81
- changeUsername: (newUsername: string) => Promise<void>;
82
- getUsernameCooldown: () => Promise<{
83
- canChange: boolean;
84
- cooldownEndsAt?: Date;
85
- }>;
86
- checkUsernameAvailability: (username: string) => Promise<{
87
- available: boolean;
88
- suggestion?: string;
89
- }>;
90
- getUserSessions: () => Promise<import("../../..").SessionInfo[]>;
91
- getSessionStats: () => Promise<import("../../..").SessionStats>;
92
- revokeSession: (sessionId: string) => Promise<boolean>;
93
- revokeAllOtherSessions: () => Promise<boolean>;
94
- forceReInit: () => void;
95
- setAuthData: (authData: any) => Promise<void>;
96
- verifyMfa: (code: string, method?: string) => Promise<any>;
97
- sendMfaEmailCode: (deviceId: string) => Promise<any>;
98
- getMfaWebAuthnChallenge: (deviceId: string) => Promise<any>;
99
- registerHardwareKey: (deviceName: string, accessToken: string, deviceType?: "hardware" | "passkey") => Promise<any>;
100
- completeHardwareKeyRegistration: (deviceId: string, credential: any, accessToken: string) => Promise<any>;
101
- startTokenRefreshTimer: () => void;
102
- stopTokenRefreshTimer: () => void;
103
- getAuthHeaders: () => Record<string, string>;
104
- };
105
- export declare const useAuthUser: () => {
106
- user: ComputedRef<User | null>;
107
- };
108
- export declare const useAuthState: () => {
109
- isAuthenticated: ComputedRef<boolean>;
110
- isLoading: ComputedRef<boolean>;
111
- };
@@ -1,100 +0,0 @@
1
- import { computed as n } from "vue";
2
- import { useRuntimeConfig as r, navigateTo as t } from "nuxt/app";
3
- import { u } from "../../../useStrandsAuth-wzl2F9DE.es.js";
4
- const o = () => ({
5
- user: n(() => null),
6
- currentUser: n(() => null),
7
- currentSession: n(() => null),
8
- isAuthenticated: n(() => !1),
9
- isLoading: n(() => !0),
10
- loading: n(() => !1),
11
- loadingMessage: n(() => "Loading..."),
12
- isInitializing: n(() => !0),
13
- isInitialized: n(() => !1),
14
- isSigningIn: n(() => !1),
15
- isSigningUp: n(() => !1),
16
- isSigningOut: n(() => !1),
17
- isRefreshingToken: n(() => !1),
18
- isSendingMfaEmail: n(() => !1),
19
- isVerifyingMfa: n(() => !1),
20
- mfaRequired: n(() => !1),
21
- mfaSessionId: n(() => null),
22
- availableMfaMethods: n(() => []),
23
- signIn: async () => null,
24
- signUp: async () => null,
25
- signOut: async () => {
26
- },
27
- refreshToken: async () => !1,
28
- fetchProfile: async () => null,
29
- updateProfile: async () => null,
30
- updateUserSettings: async () => null,
31
- changeEmail: async () => null,
32
- changeUsername: async () => null,
33
- getUsernameCooldown: async () => ({}),
34
- checkUsernameAvailability: async () => ({}),
35
- getUserSessions: async () => [],
36
- getSessionStats: async () => ({}),
37
- revokeSession: async () => !1,
38
- revokeAllOtherSessions: async () => !1,
39
- initialize: async () => {
40
- },
41
- setAuthData: async () => {
42
- },
43
- verifyMfa: async () => null,
44
- sendMfaEmailCode: async () => null,
45
- getMfaWebAuthnChallenge: async () => null,
46
- registerHardwareKey: async () => null,
47
- completeHardwareKeyRegistration: async () => null,
48
- startTokenRefreshTimer: () => {
49
- },
50
- stopTokenRefreshTimer: () => {
51
- },
52
- getAuthHeaders: () => ({ "Content-Type": "application/json" }),
53
- forceReInit: () => {
54
- }
55
- }), l = () => {
56
- if (import.meta.server)
57
- return o();
58
- let e;
59
- try {
60
- const i = r();
61
- i && i.public && (e = i.public.strandsAuth);
62
- } catch {
63
- }
64
- const s = u();
65
- return {
66
- // Re-export Vue composable state and methods
67
- ...s,
68
- // Add initialize function
69
- initialize: async () => {
70
- await s.initialize();
71
- },
72
- // Override methods with Nuxt-specific navigation
73
- signIn: async (i) => {
74
- const a = await s.signIn(i);
75
- return a && e?.onSignInUrl && await t(e.onSignInUrl), a;
76
- },
77
- signUp: async (i) => await s.signUp({
78
- email: i.email,
79
- password: "",
80
- // Empty password for magic link
81
- firstName: "",
82
- // Will be filled later in the magic link flow
83
- lastName: ""
84
- }),
85
- signOut: async () => {
86
- await s.signOut(), e?.onSignOutUrl && await t(e.onSignOutUrl);
87
- }
88
- };
89
- }, S = () => {
90
- const { user: e } = l();
91
- return { user: e };
92
- }, p = () => {
93
- const { isAuthenticated: e, isLoading: s } = l();
94
- return { isAuthenticated: e, isLoading: s };
95
- };
96
- export {
97
- p as useAuthState,
98
- S as useAuthUser,
99
- l as useStrandsAuth
100
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * Re-export useStrandsOAuth composable for Nuxt runtime
3
- *
4
- * This composable handles OAuth2 Authorization Code flow with PKCE
5
- * for third-party applications integrating "Sign in with Strands".
6
- */
7
- export { useStrandsOAuth } from '../../../vue/composables/useStrandsOAuth';
8
- export type { StrandsOAuthConfig, PKCEChallenge, OAuth2TokenResponse, OAuth2UserInfo, OAuth2Session, OAuth2State, OAuth2CallbackParams, OAuth2Error, UseStrandsOAuthReturn } from '../../../types';
@@ -1 +0,0 @@
1
- "use strict";const r=require("nuxt/app"),g=r.defineNuxtRouteMiddleware(c=>{const n=r.useRuntimeConfig().public.strandsAuth;return new Promise(a=>{Promise.resolve().then(()=>require("../composables/useStrandsAuth.cjs.js")).then(({useStrandsAuth:d})=>{const{isAuthenticated:i,isLoading:l}=d(),o=()=>{if(l.value){setTimeout(o,50);return}const e=c.path,h=n.protectedRoutes?.some(t=>t.endsWith("*")?e.startsWith(t.slice(0,-1)):e===t||e.startsWith(t+"/")),f=n.guestOnlyRoutes?.some(t=>t.endsWith("*")?e.startsWith(t.slice(0,-1)):e===t||e.startsWith(t+"/"));if(h&&!i.value&&n.authUrl){const t=n.authUrl,s=t.includes("?")?`${t}&redirect=${encodeURIComponent(e)}`:`${t}?redirect=${encodeURIComponent(e)}`;try{return r.navigateTo(s)}catch(u){if(console.warn("[Strands Auth] navigateTo failed, using window.location:",u),typeof window<"u"){window.location.href=s;return}throw u}}if(f&&i.value&&n.onSignInUrl)return r.navigateTo(n.onSignInUrl);a()};o()})})});module.exports=g;
@@ -1,35 +0,0 @@
1
- import { defineNuxtRouteMiddleware as m, useRuntimeConfig as g, navigateTo as u } from "nuxt/app";
2
- const w = m((a) => {
3
- const n = g().public.strandsAuth;
4
- if (!import.meta.server)
5
- return new Promise((c) => {
6
- import("../composables/useStrandsAuth.es.js").then(({ useStrandsAuth: d }) => {
7
- const { isAuthenticated: r, isLoading: l } = d(), i = () => {
8
- if (l.value) {
9
- setTimeout(i, 50);
10
- return;
11
- }
12
- const e = a.path, h = n.protectedRoutes?.some((t) => t.endsWith("*") ? e.startsWith(t.slice(0, -1)) : e === t || e.startsWith(t + "/")), f = n.guestOnlyRoutes?.some((t) => t.endsWith("*") ? e.startsWith(t.slice(0, -1)) : e === t || e.startsWith(t + "/"));
13
- if (h && !r.value && n.authUrl) {
14
- const t = n.authUrl, o = t.includes("?") ? `${t}&redirect=${encodeURIComponent(e)}` : `${t}?redirect=${encodeURIComponent(e)}`;
15
- try {
16
- return u(o);
17
- } catch (s) {
18
- if (console.warn("[Strands Auth] navigateTo failed, using window.location:", s), typeof window < "u") {
19
- window.location.href = o;
20
- return;
21
- }
22
- throw s;
23
- }
24
- }
25
- if (f && r.value && n.onSignInUrl)
26
- return u(n.onSignInUrl);
27
- c();
28
- };
29
- i();
30
- });
31
- });
32
- });
33
- export {
34
- w as default
35
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("nuxt/app"),t=require("../../useStrandsConfig-BYOAEt9d.cjs.js"),d=require("../../useDarkMode-Dd0Q5Nnz.cjs.js"),c=n.defineNuxtPlugin({name:"strands-auth-client",async setup(){const o=n.useRuntimeConfig().public.strandsAuth,e={...t.STRANDS_AUTH_DEFAULTS,...o};if(t.setStrandsConfig(e),typeof window<"u"&&(window.__STRANDS_CONFIG__=e),e?.accentColor&&typeof window<"u"&&document.documentElement.style.setProperty("--strands-accent",e.accentColor),typeof window<"u"){const r=e?.theme||"system";d.useGlobalDarkMode().setTheme(r)}const{useStrandsAuth:s}=await Promise.resolve().then(()=>require("./composables/useStrandsAuth.cjs.js")),{initialize:i}=s();await i()}});module.exports=c;
@@ -1,21 +0,0 @@
1
- import { defineNuxtPlugin as s, useRuntimeConfig as a } from "nuxt/app";
2
- import { s as d, S as c } from "../../useStrandsConfig-B2UXxIbT.es.js";
3
- import { u as r } from "../../useDarkMode-BdG1G2mj.es.js";
4
- const g = s({
5
- name: "strands-auth-client",
6
- async setup() {
7
- const e = a().public.strandsAuth, t = {
8
- ...c,
9
- ...e
10
- };
11
- if (d(t), typeof window < "u" && (window.__STRANDS_CONFIG__ = t), t?.accentColor && typeof window < "u" && document.documentElement.style.setProperty("--strands-accent", t.accentColor), typeof window < "u") {
12
- const i = t?.theme || "system";
13
- r().setTheme(i);
14
- }
15
- const { useStrandsAuth: n } = await import("./composables/useStrandsAuth.es.js"), { initialize: o } = n();
16
- await o();
17
- }
18
- });
19
- export {
20
- g as default
21
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("nuxt/app"),s=require("../../useStrandsConfig-BYOAEt9d.cjs.js"),r=n.defineNuxtPlugin({name:"strands-auth-server",setup(){const e=n.useRuntimeConfig().public.strandsAuth,t={...s.STRANDS_AUTH_DEFAULTS,...e};s.setStrandsConfig(t)}});module.exports=r;
@@ -1,15 +0,0 @@
1
- import { defineNuxtPlugin as t, useRuntimeConfig as e } from "nuxt/app";
2
- import { s as o, S as r } from "../../useStrandsConfig-B2UXxIbT.es.js";
3
- const u = t({
4
- name: "strands-auth-server",
5
- setup() {
6
- const s = e().public.strandsAuth, n = {
7
- ...r,
8
- ...s
9
- };
10
- o(n);
11
- }
12
- });
13
- export {
14
- u as default
15
- };
@@ -1 +0,0 @@
1
- "use strict";const a=require("nuxt/app"),l=a.defineNuxtPlugin({name:"strands-auth-interceptor",setup(){if(process.server)return;const t=globalThis.fetch;globalThis.fetch=async(e,o)=>{try{let s;if(typeof e=="string"?s=e:e instanceof URL?s=e.toString():s=e.url,p(s)){const c={...o,credentials:"include"};return t(e,c)}return t(e,o)}catch(s){return console.error("[Strands Auth] Error in fetch interceptor:",s),t(e,o)}}}});function p(t){if(!t.startsWith("http")||["googleapis.com","github.com/api","api.github.com","discord.com/api","graph.microsoft.com","api.stripe.com","api.twilio.com"].some(r=>t.includes(r)))return!1;const i=["/api/","/v1/","/v2/","/graphql","/trpc"].some(r=>t.includes(r)),n=[":3001",":8000",":8080",":5000",":4000"].some(r=>t.includes(r));return i||n}module.exports=l;
@@ -1,9 +0,0 @@
1
- /**
2
- * Auth interceptor plugin for Nuxt
3
- *
4
- * With HTTP-only cookies, we no longer need to inject Authorization headers.
5
- * This interceptor now only adds `credentials: 'include'` to API requests
6
- * so that cookies are sent automatically.
7
- */
8
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
9
- export default _default;