signway 0.0.2 → 0.0.4
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/index.d.ts +53 -2
- package/dist/index.js +1 -2
- package/package.json +3 -1
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 @@
|
|
|
1
|
-
|
|
2
|
-
export const signway = "0.0.1";
|
|
1
|
+
const t=Object.freeze({withMagicLink:e=>({method:"magic-link",email:e}),withPasskey:()=>({method:"passkey"})}),s=Object.freeze({withMagicLink:e=>({method:"magic-link",email:e}),withPasskey:()=>({method:"passkey"})}),c=Object.freeze({create:e=>Object.freeze({...e})}),o=Object.freeze({create:e=>Object.freeze({...e,methods:Object.freeze([...e.methods])})}),r=Object.freeze({signIn:()=>({method:"passkey"}),register:()=>({method:"passkey"})});export{c as Account,r as Passkey,o as Session,t as SignIn,s as SignUp};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signway",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Small, framework-neutral primitives for application authentication handoffs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsc --project tsconfig.json",
|
|
22
|
+
"postbuild": "npm run dist --prefix \"$npm_config_local_prefix\" -- \"$PWD\"",
|
|
23
|
+
"prepack": "npm run build",
|
|
22
24
|
"prepublishOnly": "npm run build"
|
|
23
25
|
},
|
|
24
26
|
"keywords": [
|