@quoll/client-lib
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [0.8.0](https://github.com/mzogheib/quoll/compare/@quoll/client-lib@0.7.0...@quoll/client-lib@0.8.0) (2024-08-04) | ||
### Features | ||
- **client-web:** create a user if they do not exist ([d92a2a4](https://github.com/mzogheib/quoll/commit/d92a2a4dc4e2f8aabef2c257f3d799645c257f9d)) | ||
# [0.7.0](https://github.com/mzogheib/quoll/compare/@quoll/client-lib@0.6.0...@quoll/client-lib@0.7.0) (2024-08-04) | ||
@@ -8,0 +14,0 @@ |
@@ -10,2 +10,3 @@ import { User } from "@quoll/lib"; | ||
getMe: () => Promise<User | null>; | ||
createMe: () => Promise<User>; | ||
reset: () => void; | ||
@@ -12,0 +13,0 @@ }; |
@@ -26,2 +26,16 @@ "use strict"; | ||
}; | ||
const createMe = async () => { | ||
try { | ||
setProperty("isLoading", true); | ||
const user = await service.createMe(); | ||
setProperty("user", user); | ||
return user; | ||
} | ||
catch (error) { | ||
throw error; | ||
} | ||
finally { | ||
setProperty("isLoading", false); | ||
} | ||
}; | ||
return { | ||
@@ -31,2 +45,3 @@ user, | ||
getMe, | ||
createMe, | ||
reset, | ||
@@ -33,0 +48,0 @@ }; |
import { AuthenticatedHttpService, User } from "@quoll/lib"; | ||
export declare class AuthUserService extends AuthenticatedHttpService { | ||
getMe(): Promise<User>; | ||
createMe(): Promise<User>; | ||
} |
@@ -12,3 +12,9 @@ "use strict"; | ||
} | ||
async createMe() { | ||
return this.request({ | ||
method: "POST", | ||
endpoint: "/user/me", | ||
}); | ||
} | ||
} | ||
exports.AuthUserService = AuthUserService; |
{ | ||
"name": "@quoll/client-lib", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Shared code for client side packages", | ||
@@ -32,3 +32,3 @@ "repository": "https://github.com/mzogheib/quoll", | ||
}, | ||
"gitHead": "06628c005f6bd51200d3ea58801ac4af0c4be2b9" | ||
"gitHead": "eb7f32ed5262438b62ae506438b0d2e5168fb8f9" | ||
} |
@@ -13,2 +13,3 @@ import { User } from "@quoll/lib"; | ||
getMe: () => Promise<User | null>; | ||
createMe: () => Promise<User>; | ||
reset: () => void; | ||
@@ -44,2 +45,15 @@ }; | ||
const createMe = async () => { | ||
try { | ||
setProperty("isLoading", true); | ||
const user = await service.createMe(); | ||
setProperty("user", user); | ||
return user; | ||
} catch (error) { | ||
throw error; | ||
} finally { | ||
setProperty("isLoading", false); | ||
} | ||
}; | ||
return { | ||
@@ -49,4 +63,5 @@ user, | ||
getMe, | ||
createMe, | ||
reset, | ||
}; | ||
}; |
@@ -10,2 +10,9 @@ import { AuthenticatedHttpService, User } from "@quoll/lib"; | ||
} | ||
async createMe() { | ||
return this.request<User>({ | ||
method: "POST", | ||
endpoint: "/user/me", | ||
}); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88255
1405