signway 0.0.1 → 0.0.3
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/README.md +2 -2
- package/dist/index.d.ts +53 -2
- package/dist/index.js +18 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
### Small, framework-neutral primitives for application authentication handoffs.
|
|
6
6
|
|
|
7
|
-
[](package.json) [](package.json) [](https://
|
|
7
|
+
[](package.json) [](package.json) [](https://signway.dev)
|
|
8
8
|
|
|
9
|
-
[
|
|
9
|
+
[signway.dev](https://signway.dev) · [mosa.sh](https://mosa.sh)
|
|
10
10
|
|
|
11
11
|
</div>
|
|
12
12
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export type SignInMethod = "passkey" | "magic-link" | "oauth";
|
|
2
|
+
export interface SignwayAccount {
|
|
3
|
+
id: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SignwaySession {
|
|
8
|
+
subject: string;
|
|
9
|
+
issuedAt: number;
|
|
10
|
+
expiresAt: number;
|
|
11
|
+
methods: readonly SignInMethod[];
|
|
12
|
+
}
|
|
13
|
+
export declare const SignIn: Readonly<{
|
|
14
|
+
withMagicLink: (email: string) => {
|
|
15
|
+
method: "magic-link";
|
|
16
|
+
email: string;
|
|
17
|
+
};
|
|
18
|
+
withPasskey: () => {
|
|
19
|
+
method: "passkey";
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
export declare const SignUp: Readonly<{
|
|
23
|
+
withMagicLink: (email: string) => {
|
|
24
|
+
method: "magic-link";
|
|
25
|
+
email: string;
|
|
26
|
+
};
|
|
27
|
+
withPasskey: () => {
|
|
28
|
+
method: "passkey";
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
export declare const Account: Readonly<{
|
|
32
|
+
create: (account: SignwayAccount) => Readonly<{
|
|
33
|
+
id: string;
|
|
34
|
+
email?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const Session: Readonly<{
|
|
39
|
+
create: (session: SignwaySession) => Readonly<{
|
|
40
|
+
methods: readonly SignInMethod[];
|
|
41
|
+
subject: string;
|
|
42
|
+
issuedAt: number;
|
|
43
|
+
expiresAt: number;
|
|
44
|
+
}>;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const Passkey: Readonly<{
|
|
47
|
+
signIn: () => {
|
|
48
|
+
method: "passkey";
|
|
49
|
+
};
|
|
50
|
+
register: () => {
|
|
51
|
+
method: "passkey";
|
|
52
|
+
};
|
|
53
|
+
}>;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export const SignIn = Object.freeze({
|
|
2
|
+
withMagicLink: (email) => ({ method: "magic-link", email }),
|
|
3
|
+
withPasskey: () => ({ method: "passkey" }),
|
|
4
|
+
});
|
|
5
|
+
export const SignUp = Object.freeze({
|
|
6
|
+
withMagicLink: (email) => ({ method: "magic-link", email }),
|
|
7
|
+
withPasskey: () => ({ method: "passkey" }),
|
|
8
|
+
});
|
|
9
|
+
export const Account = Object.freeze({
|
|
10
|
+
create: (account) => Object.freeze({ ...account }),
|
|
11
|
+
});
|
|
12
|
+
export const Session = Object.freeze({
|
|
13
|
+
create: (session) => Object.freeze({ ...session, methods: Object.freeze([...session.methods]) }),
|
|
14
|
+
});
|
|
15
|
+
export const Passkey = Object.freeze({
|
|
16
|
+
signIn: () => ({ method: "passkey" }),
|
|
17
|
+
register: () => ({ method: "passkey" }),
|
|
18
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signway",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Small, framework-neutral primitives for application authentication handoffs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"handoff",
|
|
28
28
|
"session"
|
|
29
29
|
],
|
|
30
|
-
"homepage": "https://
|
|
30
|
+
"homepage": "https://signway.dev",
|
|
31
31
|
"author": "Mosanic <dev@mosanic.io>",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"engines": {
|