@loomup/astro 0.1.3 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.d.ts +15 -4
- package/dist/server.js +7 -1
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Server-side Loomup client for Astro (SSR frontmatter, endpoints, middleware).
|
|
3
3
|
* Persists access/refresh tokens in httpOnly cookies.
|
|
4
4
|
*/
|
|
5
|
-
import { LoomupClient, type AuthTokens, type CreateClientOptions, type DefaultTableMap, type LoomupProject, type OAuthAuthorizeInput, type OAuthExchangeInput } from "@loomup/client";
|
|
5
|
+
import { LoomupClient, type AuthTokens, type AuthSignUpResult, type CreateClientOptions, type DefaultTableMap, type LoomupProject, type OAuthAuthorizeInput, type OAuthExchangeInput } from "@loomup/client";
|
|
6
6
|
import { type CookieOptions, type CookieStore } from "./cookies.js";
|
|
7
7
|
export type { CookieNames, CookieOptions, CookieStore, CookieWriteOptions, } from "./cookies.js";
|
|
8
8
|
export { DEFAULT_ACCESS_COOKIE, DEFAULT_REFRESH_COOKIE, clearTokens, readTokens, resolveCookieNames, writeTokens, } from "./cookies.js";
|
|
@@ -48,7 +48,7 @@ export declare class ServerLoomupClient<TMap = DefaultTableMap, TInsertMap = {
|
|
|
48
48
|
signUp(creds: {
|
|
49
49
|
email: string;
|
|
50
50
|
password: string;
|
|
51
|
-
}): Promise<
|
|
51
|
+
}): Promise<AuthSignUpResult>;
|
|
52
52
|
signIn(creds: {
|
|
53
53
|
email: string;
|
|
54
54
|
password: string;
|
|
@@ -66,11 +66,11 @@ export declare class ServerLoomupClient<TMap = DefaultTableMap, TInsertMap = {
|
|
|
66
66
|
signUp: (creds: {
|
|
67
67
|
email: string;
|
|
68
68
|
password: string;
|
|
69
|
-
}) => Promise<
|
|
69
|
+
}) => Promise<AuthSignUpResult>;
|
|
70
70
|
register: (creds: {
|
|
71
71
|
email: string;
|
|
72
72
|
password: string;
|
|
73
|
-
}) => Promise<
|
|
73
|
+
}) => Promise<AuthSignUpResult>;
|
|
74
74
|
signIn: (creds: {
|
|
75
75
|
email: string;
|
|
76
76
|
password: string;
|
|
@@ -82,6 +82,17 @@ export declare class ServerLoomupClient<TMap = DefaultTableMap, TInsertMap = {
|
|
|
82
82
|
oauthProviders: () => Promise<import("@loomup/client").OAuthProviderInfo[]>;
|
|
83
83
|
authorizeOAuth: (input: OAuthAuthorizeInput) => Promise<import("@loomup/client").OAuthAuthorization>;
|
|
84
84
|
exchangeOAuthCode: (input: OAuthExchangeInput) => Promise<AuthTokens>;
|
|
85
|
+
resendVerification: (email: string) => Promise<import("@loomup/client").AuthActionResult>;
|
|
86
|
+
confirmVerification: (token: string) => Promise<AuthTokens>;
|
|
87
|
+
requestPasswordReset: (email: string) => Promise<import("@loomup/client").AuthActionResult>;
|
|
88
|
+
confirmPasswordReset: (input: {
|
|
89
|
+
token: string;
|
|
90
|
+
password: string;
|
|
91
|
+
}) => Promise<import("@loomup/client").AuthActionResult>;
|
|
92
|
+
acceptInvitation: (input: {
|
|
93
|
+
token: string;
|
|
94
|
+
password: string;
|
|
95
|
+
}) => Promise<AuthTokens>;
|
|
85
96
|
signOut: () => Promise<void>;
|
|
86
97
|
logout: () => Promise<void>;
|
|
87
98
|
me: () => Promise<import("@loomup/client").User>;
|
package/dist/server.js
CHANGED
|
@@ -43,7 +43,8 @@ export class ServerLoomupClient extends LoomupClient {
|
|
|
43
43
|
}
|
|
44
44
|
async signUp(creds) {
|
|
45
45
|
const data = await super.signUp(creds);
|
|
46
|
-
|
|
46
|
+
if ("access_token" in data)
|
|
47
|
+
this.persistFromTokens(data);
|
|
47
48
|
return data;
|
|
48
49
|
}
|
|
49
50
|
async signIn(creds) {
|
|
@@ -95,6 +96,11 @@ export class ServerLoomupClient extends LoomupClient {
|
|
|
95
96
|
oauthProviders: () => this.oauthProviders(),
|
|
96
97
|
authorizeOAuth: (input) => this.authorizeOAuth(input),
|
|
97
98
|
exchangeOAuthCode: (input) => this.exchangeOAuthCode(input),
|
|
99
|
+
resendVerification: (email) => this.resendEmailVerification(email),
|
|
100
|
+
confirmVerification: (token) => this.confirmEmailVerification(token),
|
|
101
|
+
requestPasswordReset: (email) => this.requestPasswordReset(email),
|
|
102
|
+
confirmPasswordReset: (input) => this.confirmPasswordReset(input),
|
|
103
|
+
acceptInvitation: (input) => this.acceptInvitation(input),
|
|
98
104
|
signOut: () => this.signOut(),
|
|
99
105
|
logout: () => this.signOut(),
|
|
100
106
|
me: () => this.me(),
|