@alwith/module-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,94 @@
1
+ ALwith Developer and Redistribution License, Version 1.0
2
+ Copyright 2026 ALWITHAI PTE. LTD. All rights reserved, except as expressly granted below.
3
+
4
+ 1. Scope
5
+ This license applies only to ALWITHAI PTE. LTD.'s ("ALwith") own material in
6
+ the npm package accompanying this license (the "Software"). It is a proprietary
7
+ license, not an open-source license. Third-party material is governed by its
8
+ respective licenses, as described in THIRD_PARTY_NOTICES.md. No restriction here
9
+ reduces rights granted by those licenses or by mandatory applicable law.
10
+
11
+ 2. Permission to develop and distribute applications
12
+ Subject to this license, ALwith grants you a worldwide, non-exclusive, royalty-free
13
+ copyright license to use, reproduce, integrate and modify the supplied Software
14
+ to develop, test, host and operate your own applications, including WorkBuddy
15
+ applications, for personal, internal business or commercial use. You may brand,
16
+ sell and distribute those applications, including the Software embedded in them,
17
+ to your customers and end users. No per-application registration, approval or
18
+ royalty is required by this software license.
19
+
20
+ You may bundle, minify, transform and otherwise adapt the supplied JavaScript,
21
+ styles and declarations for those applications. You may include the supplied
22
+ Software in an application source distribution when necessary to build or use
23
+ that application, provided it remains separately identified under this license.
24
+ You may combine it with separately licensed application code, including MPL-2.0
25
+ code, while complying with both licenses. Your own independent code remains yours;
26
+ this license does not require disclosure of your application source code.
27
+
28
+ Recipients may use the embedded Software to run the application and exercise the
29
+ permissions above under this same license. You may allow your contractors and
30
+ hosting providers to use it for those purposes. You must supply this license and
31
+ all applicable third-party notices with each redistribution (for example in an
32
+ included licenses directory or an accessible legal-notices page), identify your
33
+ modifications, and not impose terms that purport to change ALwith's license.
34
+
35
+ 3. Rights reserved
36
+ No right to ALwith's unpublished source code, private repositories, trademarks,
37
+ or separately distributed Runtime binaries, modules or services is granted here.
38
+ You may not relicense the Software as your own framework or redistribute it as
39
+ a standalone SDK/package for others, except for private development/build caches
40
+ used for applications permitted by Section 2. No restriction is imposed on
41
+ independently developed competing applications or on third-party licensed code.
42
+ You must not misrepresent authorship or imply ALwith endorses your application.
43
+
44
+ 4. Accounts and services
45
+ This license does not supply platform credentials, paid entitlements, hosting,
46
+ support, updates or a service-availability guarantee. Use of ALwith accounts,
47
+ pets, relay or other hosted services is separately subject to the applicable
48
+ service terms and authorization. Do not bypass service access controls or use
49
+ another person's credentials without authorization. Choosing or replacing an
50
+ authentication provider for your own application is not prohibited by this
51
+ software license. Distributing an Auth client does not authorize its recipients
52
+ to access another user's account, data or entitlements.
53
+
54
+ 5. Lawful use and independent responsibility
55
+ You must not use the Software to commit or knowingly facilitate unlawful acts.
56
+ You are responsible for your application's operation, permissions, business
57
+ practices, data processing, content and compliance with applicable law. You must
58
+ not make warranties or commitments on ALwith's behalf. ALwith does not endorse
59
+ your application merely because it uses the Software or connects to ALwith.
60
+ These allocations do not remove either party's own mandatory legal obligations.
61
+
62
+ 6. Disclaimer and limitation of liability
63
+ TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED
64
+ "AS IS" AND "AS AVAILABLE", WITHOUT EXPRESS OR IMPLIED WARRANTIES, INCLUDING
65
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ACCURACY,
66
+ SECURITY OR UNINTERRUPTED OPERATION. AI OUTPUTS AND AUTOMATED ACTIONS MAY BE
67
+ INCORRECT OR HARMFUL; YOU MUST DETERMINE APPROPRIATE REVIEW AND SAFEGUARDS.
68
+
69
+ TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, ALWITH AND ITS CONTRIBUTORS
70
+ ARE NOT LIABLE FOR DAMAGES ARISING FROM USE, MODIFICATION OR DISTRIBUTION OF
71
+ THE SOFTWARE, INCLUDING LOST PROFITS, LOST DATA, BUSINESS INTERRUPTION AND
72
+ INDIRECT OR CONSEQUENTIAL LOSS. NOTHING EXCLUDES OR LIMITS LIABILITY THAT
73
+ CANNOT LAWFULLY BE EXCLUDED OR LIMITED, INCLUDING APPLICABLE MANDATORY CONSUMER
74
+ RIGHTS AND LIABILITY FOR FRAUD, WILLFUL MISCONDUCT OR GROSS NEGLIGENCE WHERE
75
+ SUCH EXCLUSION OR LIMITATION IS PROHIBITED. THIS LICENSE DOES NOT EXCLUDE
76
+ CRIMINAL OR REGULATORY RESPONSIBILITY IMPOSED BY LAW.
77
+
78
+ 7. Duration and termination
79
+ The grant for this version continues while you comply with this license. If
80
+ ALwith gives written notice of a material breach, your rights terminate if you
81
+ do not cure it within 30 days; no cure period authorizes continuing unlawful
82
+ conduct. On termination, cease new use and distribution of ALwith's proprietary
83
+ Software except as required by law. Independently compliant recipients retain
84
+ their own grants. Sections concerning reserved rights, notices, disclaimers and
85
+ mandatory-law exceptions survive as applicable. Third-party licenses are not
86
+ terminated by this provision.
87
+
88
+ 8. Versions and severability
89
+ This license governs the accompanying version. A later license or publication
90
+ of source code does not retroactively replace this grant or revoke rights in
91
+ earlier lawfully obtained versions. Any additional open-source license must be
92
+ expressly identified by ALwith. If a provision is unenforceable, the remaining
93
+ provisions continue to the extent permitted by law. A separate written agreement
94
+ signed by you and ALwith may expressly override these terms for its stated scope.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @alwith/module-auth
2
+
3
+ TypeScript side of the alwith-auth capability, colocated with its separately licensed Rust crate.
4
+
5
+ Owns the existing Desktop auth types, password rule, OAuth PKCE/in-flight verifier,
6
+ error-key mapping, request contracts, state lifecycle and token-storage operations. The host supplies its existing
7
+ store; authStoreName preserves the auth.<API host> namespace. Tokens remain in
8
+ the same store with the same keys. Logout preserves device_id.
9
+
10
+ This does not move credentials to Rust, replace HTTP, render a login page,
11
+ or implement cross-device account synchronization. The framework-neutral state
12
+ factory keeps Desktop's existing restoration, login, logout and window-event
13
+ semantics; the host supplies storage, HTTP, event transport and product effects.
14
+ Desktop still owns native OAuth callbacks, windows, provider loading and analytics.
15
+ U consumes the shared package; OAuth callbacks remain host-specific.
16
+
17
+ ## License and redistribution
18
+
19
+ See [LICENSE](LICENSE) and [third-party notices](THIRD_PARTY_NOTICES.md).
20
+ ALwith-owned code is proprietary, not open source. You may build, customize, host,
21
+ charge for and distribute your own WorkBuddy applications under the included
22
+ license, without per-application registration. This does not grant hosted-service
23
+ access or rights to separately distributed Rust libraries or Runtime binaries.
24
+ The npm artifact includes compiled/minified JS, declarations and necessary assets,
25
+ not the private TS/TSX implementation or source maps. Minification is not encryption.
@@ -0,0 +1,17 @@
1
+ # Third-party notices — @alwith/module-auth
2
+
3
+ ALwith's proprietary license applies only to its own material. Third-party
4
+ material retains its original license and rights; the package license does not
5
+ replace or restrict those rights. Preserve applicable notices when redistributing.
6
+
7
+ ## External direct dependencies and peers
8
+
9
+ These are external imports, not bundled dependency implementations in this npm
10
+ artifact. Versions below record the local release-preparation inventory; declared
11
+ ranges can resolve to different versions. Keep the notices from the versions
12
+ actually distributed by your application, including transitive dependencies.
13
+
14
+ | Package | Inspected version | License | Included license copy |
15
+ | --- | --- | --- | --- |
16
+
17
+ No external direct runtime dependencies or peers are declared in this package.
@@ -0,0 +1,27 @@
1
+ import type { LoginResponse, OAuthExchangeResponse, OAuthProvider, OAuthSessionResponse, SsoExchangeResponse } from "./types.js";
2
+ export type SendCodePurpose = "LOGIN" | "REGISTER";
3
+ export interface AuthClientHost {
4
+ publicPost: <T>(path: string, body?: unknown) => Promise<T>;
5
+ apiPost: <T>(path: string, body?: unknown) => Promise<T>;
6
+ platform: () => string | Promise<string>;
7
+ arch: () => string | Promise<string>;
8
+ getDeviceId: () => Promise<string>;
9
+ onLogoutError: (error: unknown) => void;
10
+ logInfo: (message: string) => void | Promise<void>;
11
+ }
12
+ export declare function createAuthClient({ publicPost, apiPost, platform, arch, getDeviceId, onLogoutError, logInfo, }: AuthClientHost): {
13
+ sendVerificationCode: (email: string, purpose?: SendCodePurpose) => Promise<void>;
14
+ loginWithCode: (email: string, code: string) => Promise<LoginResponse>;
15
+ loginWithPassword: (email: string, password: string) => Promise<LoginResponse>;
16
+ emailExists: (email: string) => Promise<{
17
+ registered: boolean;
18
+ }>;
19
+ register: (email: string, code: string, password: string) => Promise<LoginResponse>;
20
+ logoutApi: () => Promise<void>;
21
+ createOAuthSession: (provider: OAuthProvider, clientCodeChallenge: string, loopbackPort?: number) => Promise<OAuthSessionResponse>;
22
+ exchangeOAuthTicket: (ticket: string, clientCodeVerifier: string) => Promise<OAuthExchangeResponse>;
23
+ getSsoOtp: () => Promise<{
24
+ otp: string;
25
+ }>;
26
+ exchangeSsoCode: (code: string) => Promise<SsoExchangeResponse>;
27
+ };
package/dist/client.js ADDED
@@ -0,0 +1 @@
1
+ function E({publicPost:t,apiPost:d,platform:c,arch:r,getDeviceId:u,onLogoutError:h,logInfo:p}){async function _(e,n="LOGIN"){await t("/api/v1/auth/send-code",{login_type:"EMAIL",email:e,purpose:n})}async function y(e,n){let[i,a,o]=await Promise.all([c(),r(),u()]);return t("/api/v1/auth/login",{email:e,code:n,login_type:"EMAIL",client_type:"DESKTOP",client_name:`Tauri-${i}-${a}`,device_id:o})}async function v(e,n){let[i,a,o]=await Promise.all([c(),r(),u()]);return t("/api/v1/auth/login",{email:e,password:n,login_type:"PASSWORD",client_type:"DESKTOP",client_name:`Tauri-${i}-${a}`,device_id:o})}async function f(e){return t("/api/v1/auth/email-exists",{email:e})}async function g(e,n,i){let[a,o,s]=await Promise.all([c(),r(),u()]);return t("/api/v1/auth/register",{email:e,code:n,password:i,client_type:"DESKTOP",client_name:`Tauri-${a}-${o}`,device_id:s})}async function O(){try{await d("/api/v1/auth/logout")}catch(e){h(e)}}function S(e){switch(e){case"macos":return"MACOS";case"windows":return"WINDOWS";case"linux":return"LINUX";default:throw Error(`unsupported desktop platform for OAuth: ${e}`)}}async function w(e,n,i){let[a,o,s]=await Promise.all([c(),r(),u()]),l={provider:e,client_type:"DESKTOP",platform:S(a),return_target:"APP_LOGIN",client_name:`Tauri-${a}-${o}`,device_id:s,client_code_challenge:n,...i!==void 0?{loopback_port:i}:{}};return p(`[oauth] POST /api/v1/auth/oauth/sessions request: ${JSON.stringify(l)}`),t("/api/v1/auth/oauth/sessions",l)}async function T(e,n){return t("/api/v1/auth/oauth/tickets/exchange",{ticket:e,client_code_verifier:n})}async function m(){return d("/api/v1/sso/otp")}async function A(e){return t("/api/v1/sso/exchange",{otp:e,client_type:"DESKTOP"})}return{sendVerificationCode:_,loginWithCode:y,loginWithPassword:v,emailExists:f,register:g,logoutApi:O,createOAuthSession:w,exchangeOAuthTicket:T,getSsoOtp:m,exchangeSsoCode:A}}export{E as createAuthClient};
@@ -0,0 +1,6 @@
1
+ export * from "./types.js";
2
+ export * from "./password.js";
3
+ export * from "./oauth.js";
4
+ export * from "./token-storage.js";
5
+ export * from "./client.js";
6
+ export * from "./state.js";
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export*from"./types.js";export*from"./password.js";export*from"./oauth.js";export*from"./token-storage.js";export*from"./client.js";export*from"./state.js";
@@ -0,0 +1,9 @@
1
+ export declare function generateCodeVerifier(): string;
2
+ export declare function computeCodeChallenge(verifier: string): Promise<string>;
3
+ export declare function storeOAuthState(verifier: string): void;
4
+ export declare function takeOAuthState(): string | null;
5
+ export declare function clearOAuthState(): void;
6
+ declare const OAUTH_ERROR_KEYS: readonly [readonly ["OAUTH_SESSION_EXPIRED", "signIn.oauthSessionExpired"], readonly ["OAUTH_VERIFICATION_FAILED", "signIn.oauthVerificationFailed"], readonly ["OAUTH_EMAIL_REQUIRED", "signIn.oauthEmailRequired"], readonly ["OAUTH_IDENTITY_CONFLICT", "signIn.oauthIdentityConflict"], readonly ["OAUTH_RATE_LIMITED", "signIn.tooManyRequests"], readonly ["OAUTH_PROVIDER_UNAVAILABLE", "signIn.oauthProviderUnavailable"], readonly ["OAUTH_CONFIG_UNAVAILABLE", "signIn.oauthConfigUnavailable"], readonly ["ACCOUNT_DISABLED", "signIn.accountDisabled"]];
7
+ export type OAuthErrorKey = (typeof OAUTH_ERROR_KEYS)[number][1] | "signIn.signInFailed";
8
+ export declare function oauthErrorKey(raw: string): OAuthErrorKey;
9
+ export {};
package/dist/oauth.js ADDED
@@ -0,0 +1 @@
1
+ function r(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function a(){let e=new Uint8Array(32);return crypto.getRandomValues(e),r(e)}async function u(e){let n=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return r(new Uint8Array(n))}var t=null;function c(e){t=e}function s(){let e=t;return t=null,e}function I(){t=null}var i=[["OAUTH_SESSION_EXPIRED","signIn.oauthSessionExpired"],["OAUTH_VERIFICATION_FAILED","signIn.oauthVerificationFailed"],["OAUTH_EMAIL_REQUIRED","signIn.oauthEmailRequired"],["OAUTH_IDENTITY_CONFLICT","signIn.oauthIdentityConflict"],["OAUTH_RATE_LIMITED","signIn.tooManyRequests"],["OAUTH_PROVIDER_UNAVAILABLE","signIn.oauthProviderUnavailable"],["OAUTH_CONFIG_UNAVAILABLE","signIn.oauthConfigUnavailable"],["ACCOUNT_DISABLED","signIn.accountDisabled"]];function l(e){for(let[n,o]of i)if(e.includes(n))return o;return"signIn.signInFailed"}export{I as clearOAuthState,u as computeCodeChallenge,a as generateCodeVerifier,l as oauthErrorKey,c as storeOAuthState,s as takeOAuthState};
@@ -0,0 +1 @@
1
+ export declare function isValidPassword(password: string): boolean;
@@ -0,0 +1 @@
1
+ var s=/^(?=.*[A-Za-z])(?=.*\d)[\x21-\x7E]{8,26}$/;function n(t){return s.test(t)}export{n as isValidPassword};
@@ -0,0 +1,41 @@
1
+ import type { AuthUser, LoginResponse } from "./types.js";
2
+ import type { createTokenStorage } from "./token-storage.js";
3
+ export interface AuthState {
4
+ user: AuthUser | null;
5
+ isAuthenticated: boolean;
6
+ isLoading: boolean;
7
+ _initialized: boolean;
8
+ }
9
+ export interface AuthActions {
10
+ init: () => void;
11
+ login: (response: LoginResponse) => Promise<void>;
12
+ logout: () => Promise<void>;
13
+ refreshUser: () => Promise<void>;
14
+ updateUser: (partial: Partial<AuthUser>) => void;
15
+ }
16
+ export type AuthStateEvent = {
17
+ action: "login" | "logout" | "update";
18
+ user?: AuthUser;
19
+ };
20
+ export interface AuthStateHost {
21
+ storage: ReturnType<typeof createTokenStorage>;
22
+ getProfile: () => Promise<{
23
+ uuid: string;
24
+ nickname: string;
25
+ login_email: string;
26
+ avatar?: string;
27
+ }>;
28
+ logoutApi: () => Promise<void>;
29
+ onInit: () => void;
30
+ validateProfile: () => boolean;
31
+ handleUnauthenticated: () => Promise<boolean>;
32
+ loadProviders: () => void;
33
+ clearProviders: () => void;
34
+ onProfileRestored: () => void;
35
+ clearAccountConversation: (user: AuthUser | null) => Promise<void>;
36
+ onSignedIn: (user: AuthUser, source: "login" | "restore") => void | Promise<void>;
37
+ subscribeExpired: (listener: () => void) => unknown;
38
+ subscribeState: (listener: (event: AuthStateEvent) => void) => unknown;
39
+ broadcast: (event: AuthStateEvent) => Promise<void>;
40
+ }
41
+ export declare function createAuthState(host: AuthStateHost): (set: (state: Partial<AuthState>) => void, get: () => AuthState) => AuthState & AuthActions;
package/dist/state.js ADDED
@@ -0,0 +1 @@
1
+ function w(e){let{tokenStorage:l,loadUser:d,saveUser:s,clearAllAuth:f}=e.storage,n=0;return(r,c)=>({user:null,isAuthenticated:!1,isLoading:!0,_initialized:!1,init:()=>{if(c()._initialized)return;r({_initialized:!0}),e.onInit();let a=n;(async()=>{try{let i=await l.getAccess(),t=await l.getRefresh();if(a!==n)return;if(!i||!t){await e.handleUnauthenticated(),r({isLoading:!1});return}let v=e.validateProfile(),o=await d();if(a!==n)return;if(!v){if(o)r({user:o,isAuthenticated:!0}),e.loadProviders();return}if(o)r({user:o,isAuthenticated:!0,isLoading:!1}),e.onSignedIn(o,"restore");e.loadProviders();try{let u=await e.getProfile();if(a!==n)return;let g={user_uuid:u.uuid,nickname:u.nickname,login_email:u.login_email,avatar:u.avatar};r({user:g,isAuthenticated:!0}),await s(g),e.onProfileRestored()}catch{let u=await d();if(a!==n)return;if(u)r({user:u,isAuthenticated:!0});else await f(),e.clearProviders(),r({user:null,isAuthenticated:!1})}if(!o)r({isLoading:!1})}catch(i){console.error("[auth] session restore failed unexpectedly",i)}finally{if(c().isLoading)r({isLoading:!1})}})(),e.subscribeExpired(()=>{n++,e.clearAccountConversation(c().user).then(e.handleUnauthenticated).then((i)=>{if(i)return;r({user:null,isAuthenticated:!1})})}),e.subscribeState((i)=>{if(i.action==="logout")n++,e.clearAccountConversation(c().user).then(e.handleUnauthenticated).then((t)=>{if(t)return;e.clearProviders(),r({user:null,isAuthenticated:!1})});else if(i.action==="login"&&i.user)n++,r({user:i.user,isAuthenticated:!0}),e.loadProviders();else if(i.action==="update"&&i.user)r({user:i.user})})},login:async(a)=>{n++,await l.save(a.access_token,a.refresh_token);let i={user_uuid:a.user_uuid,nickname:a.nickname,login_email:a.login_email};await s(i),r({user:i,isAuthenticated:!0}),e.loadProviders(),await e.broadcast({action:"login",user:i}),e.onSignedIn(i,"login")},logout:async()=>{if(n++,e.clearProviders(),await e.logoutApi(),await e.clearAccountConversation(c().user),await f(),await e.broadcast({action:"logout"}),await e.handleUnauthenticated())return;r({user:null,isAuthenticated:!1})},refreshUser:async()=>{try{let a=await e.getProfile(),i={user_uuid:a.uuid,nickname:a.nickname,login_email:a.login_email,avatar:a.avatar};r({user:i}),await s(i)}catch(a){console.warn("[auth] refreshUser failed",a)}},updateUser:(a)=>{let i=c().user;if(!i)return;let t={...i,...a};r({user:t}),s(t),e.broadcast({action:"update",user:t})}})}export{w as createAuthState};
@@ -0,0 +1,21 @@
1
+ import type { AuthUser } from "./types.js";
2
+ export interface AuthStore {
3
+ get<T>(key: string): Promise<T | undefined>;
4
+ set(key: string, value: unknown): Promise<void>;
5
+ delete(key: string): Promise<void>;
6
+ }
7
+ export declare function authStoreName(apiBaseUrl: string): string;
8
+ export declare function createTokenStorage(store: AuthStore): {
9
+ tokenStorage: {
10
+ save(accessToken: string, refreshToken: string): Promise<void>;
11
+ getAccess(): Promise<string>;
12
+ getRefresh(): Promise<string>;
13
+ updateAccess(token: string): Promise<void>;
14
+ clear(): Promise<void>;
15
+ getDeviceId(): Promise<string>;
16
+ };
17
+ saveUser: (user: AuthUser) => Promise<void>;
18
+ loadUser: () => Promise<AuthUser | null>;
19
+ clearUser: () => Promise<void>;
20
+ clearAllAuth: () => Promise<void>;
21
+ };
@@ -0,0 +1 @@
1
+ function r(a){return`auth.${new URL(a).host}`}function u(a){let e={ACCESS:"access_token",REFRESH:"refresh_token",DEVICE_ID:"device_id",USER:"user"},n={async save(t,S){await a.set(e.ACCESS,t),await a.set(e.REFRESH,S)},async getAccess(){return await a.get(e.ACCESS)??""},async getRefresh(){return await a.get(e.REFRESH)??""},async updateAccess(t){await a.set(e.ACCESS,t)},async clear(){await a.delete(e.ACCESS),await a.delete(e.REFRESH)},async getDeviceId(){let t=await a.get(e.DEVICE_ID);if(!t)t=crypto.randomUUID(),await a.set(e.DEVICE_ID,t);return t}};async function i(t){await a.set(e.USER,t)}async function E(){return await a.get(e.USER)??null}async function c(){await a.delete(e.USER)}async function s(){await n.clear(),await c()}return{tokenStorage:n,saveUser:i,loadUser:E,clearUser:c,clearAllAuth:s}}export{r as authStoreName,u as createTokenStorage};
@@ -0,0 +1,37 @@
1
+ export interface LoginResponse {
2
+ user_uuid: string;
3
+ nickname: string;
4
+ login_email: string;
5
+ access_token: string;
6
+ refresh_token: string;
7
+ status?: "ACTIVE" | "WAITLISTED" | "DISABLED";
8
+ }
9
+ export interface TokenResponse {
10
+ access_token: string;
11
+ refresh_token: string;
12
+ }
13
+ export type OAuthProvider = "GOOGLE" | "APPLE" | "GITHUB";
14
+ export interface OAuthSessionResponse {
15
+ session_id: string;
16
+ mode: "REDIRECT";
17
+ authorization_url: string;
18
+ expires_in: number;
19
+ }
20
+ export interface OAuthExchangeResponse extends LoginResponse {
21
+ oauth_provider: OAuthProvider;
22
+ oauth_result: "LOGIN" | "LINKED" | "CREATED";
23
+ }
24
+ export interface SsoExchangeResponse {
25
+ user_uuid: string;
26
+ nickname: string;
27
+ login_email: string;
28
+ access_token: string;
29
+ refresh_token: string;
30
+ status: string;
31
+ }
32
+ export interface AuthUser {
33
+ user_uuid: string;
34
+ nickname: string;
35
+ login_email: string;
36
+ avatar?: string;
37
+ }
package/dist/types.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@alwith/module-auth",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./types": {
13
+ "types": "./dist/types.d.ts",
14
+ "import": "./dist/types.js",
15
+ "default": "./dist/types.js"
16
+ },
17
+ "./password": {
18
+ "types": "./dist/password.d.ts",
19
+ "import": "./dist/password.js",
20
+ "default": "./dist/password.js"
21
+ },
22
+ "./oauth": {
23
+ "types": "./dist/oauth.d.ts",
24
+ "import": "./dist/oauth.js",
25
+ "default": "./dist/oauth.js"
26
+ },
27
+ "./token-storage": {
28
+ "types": "./dist/token-storage.d.ts",
29
+ "import": "./dist/token-storage.js",
30
+ "default": "./dist/token-storage.js"
31
+ },
32
+ "./client": {
33
+ "types": "./dist/client.d.ts",
34
+ "import": "./dist/client.js",
35
+ "default": "./dist/client.js"
36
+ },
37
+ "./state": {
38
+ "types": "./dist/state.d.ts",
39
+ "import": "./dist/state.js",
40
+ "default": "./dist/state.js"
41
+ }
42
+ },
43
+ "files": [
44
+ "dist",
45
+ "README.md",
46
+ "LICENSE",
47
+ "THIRD_PARTY_NOTICES.md",
48
+ "licenses"
49
+ ],
50
+ "devDependencies": {
51
+ "typescript": "^7.0.2"
52
+ },
53
+ "scripts": {
54
+ "test": "bun test src",
55
+ "typecheck": "tsc --noEmit",
56
+ "build": "bun ../../../scripts/build-npm.ts",
57
+ "prepack": "bun run build"
58
+ },
59
+ "license": "SEE LICENSE IN LICENSE",
60
+ "publishConfig": {
61
+ "access": "public",
62
+ "registry": "https://registry.npmjs.org/"
63
+ },
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "git+https://github.com/ALwith-ai/alwith-modules.git",
67
+ "directory": "crates/auth/guest-js"
68
+ }
69
+ }