@midsummer-ai/sdk 0.1.0-staging.3781 → 0.1.0-staging.3784
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/auth/contract.mjs +1 -1
- package/auth/index.mjs +1 -1
- package/auth/password.mjs +1 -1
- package/auth/react.d.mts +50 -27
- package/auth/react.mjs +1046 -531
- package/{auth-DUEJfZvB.mjs → auth-BtqjgQ-V.mjs} +410 -121
- package/{engine-o-3LFoL3.mjs → engine-9WBvqNSV.mjs} +15 -21
- package/package.json +1 -1
- package/{qr-Br1sOBmT.mjs → qr-BySxqLW6.mjs} +86 -271
- package/style-CCFT-5rG.mjs +684 -0
package/auth/contract.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as LIMITS, l as LIMIT_WINDOW_MS, r as AuthError, u as SETTINGS_TTL_MS } from "../auth-
|
|
1
|
+
import { c as LIMITS, l as LIMIT_WINDOW_MS, r as AuthError, u as SETTINGS_TTL_MS } from "../auth-BtqjgQ-V.mjs";
|
|
2
2
|
import { IMPERSONATION_TOKEN_MS, startImpersonation } from "./impersonate.mjs";
|
|
3
3
|
//#region src/auth/contract.ts
|
|
4
4
|
/**
|
package/auth/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SESSION_CACHE_S, d as databaseStore, i as IMPERSONATION_S, n as AUTH_ROUTES, o as auth, r as AuthError, s as createAuth, t as AUTH_PATH } from "../auth-
|
|
1
|
+
import { a as SESSION_CACHE_S, d as databaseStore, i as IMPERSONATION_S, n as AUTH_ROUTES, o as auth, r as AuthError, s as createAuth, t as AUTH_PATH } from "../auth-BtqjgQ-V.mjs";
|
|
2
2
|
import { checkSignInMail, signInWords } from "./mail.mjs";
|
|
3
3
|
import { n as authFiles } from "../files-DhPeWwcT.mjs";
|
|
4
4
|
export { AUTH_PATH, AUTH_ROUTES, AuthError, IMPERSONATION_S, SESSION_CACHE_S, auth, authFiles, checkSignInMail, createAuth, databaseStore, signInWords };
|
package/auth/password.mjs
CHANGED
package/auth/react.d.mts
CHANGED
|
@@ -13,41 +13,75 @@ interface AuthState {
|
|
|
13
13
|
refresh(): Promise<void>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* How the screens look in the app, over Midsummer's defaults. Unset, the theme follows a `dark` or `light` class or
|
|
17
|
+
* `data-theme` on a parent, else the person's system; the brand is the colour in the app's settings, else Midsummer's
|
|
18
|
+
* near-black buttons and blue accent; the corners are 10px; the font is Geist.
|
|
19
|
+
*/
|
|
20
|
+
interface Appearance {
|
|
21
|
+
/** `light`, `dark`, or `auto` for the person's system. */
|
|
22
|
+
readonly theme?: "light" | "dark" | "auto";
|
|
23
|
+
/** The app's colour as `#rrggbb`: the primary button, focus rings and links. Its text is worked out to read on it. */
|
|
24
|
+
readonly brand?: string;
|
|
25
|
+
/** The corner of buttons and fields, such as `6px`; cards and small controls follow it. */
|
|
26
|
+
readonly radius?: string;
|
|
27
|
+
/** A CSS font family, such as `"Inter", sans-serif`. */
|
|
28
|
+
readonly font?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gives the screens inside it the client and who is signed in; `baseURL` when the app's server is on another address,
|
|
32
|
+
* and `appearance` to match the app's look. With `database`, the hooks of `@midsummer-ai/sdk/react` inside it
|
|
33
|
+
* (`useQuery`, `useMutation`) reach the app's database as whoever is signed in (`signedInDatabase`), and connect again
|
|
34
|
+
* as someone signs in or out.
|
|
19
35
|
*/
|
|
20
36
|
declare function AuthProvider(props: {
|
|
21
37
|
readonly children?: ReactNode;
|
|
22
38
|
readonly client?: AuthClient;
|
|
23
39
|
readonly baseURL?: string;
|
|
24
40
|
readonly database?: boolean;
|
|
41
|
+
readonly appearance?: Appearance;
|
|
25
42
|
}): import("react").FunctionComponentElement<import("react").ProviderProps<AuthState | null>>;
|
|
26
43
|
/** Who is signed in, the client and the app's settings: inside an `AuthProvider`. */
|
|
27
44
|
declare function useAuth(): AuthState;
|
|
28
|
-
/**
|
|
45
|
+
/** Where a sign-in can start or carry on from: the form, a code mailed, a link mailed, an email to confirm, or a second step. */
|
|
46
|
+
type SignInStep = "start" | "code" | "link" | "confirm" | "two-factor";
|
|
47
|
+
/**
|
|
48
|
+
* Sign-in: a password, a code or a link by mail, a passkey, Google or GitHub, as the app's settings turn them on, with
|
|
49
|
+
* one way leading and the rest quiet. `initialStep` and `initialEmail` open it part way, such as on the code step.
|
|
50
|
+
*/
|
|
29
51
|
declare function SignIn(props: {
|
|
30
52
|
readonly redirectTo?: string;
|
|
31
53
|
readonly signUpUrl?: string;
|
|
32
54
|
readonly resetUrl?: string;
|
|
55
|
+
readonly initialStep?: SignInStep;
|
|
56
|
+
readonly initialEmail?: string;
|
|
33
57
|
}): import("react").FunctionComponentElement<{
|
|
34
58
|
readonly title: string;
|
|
35
|
-
readonly lead?:
|
|
36
|
-
readonly
|
|
59
|
+
readonly lead?: ReactNode;
|
|
60
|
+
readonly stage?: string;
|
|
37
61
|
readonly appear?: boolean;
|
|
38
62
|
readonly children?: ReactNode;
|
|
39
|
-
}> | import("react").FunctionComponentElement<{
|
|
63
|
+
}> | import("react").FunctionComponentElement<{
|
|
64
|
+
readonly label: string;
|
|
65
|
+
readonly fields: number;
|
|
66
|
+
readonly title: string;
|
|
67
|
+
readonly foot: string;
|
|
68
|
+
}>;
|
|
40
69
|
/** Sign-up with a name, an email and a password; under a waitlist, joining it; when the app wants emails confirmed, asking for that. */
|
|
41
70
|
declare function SignUp(props: {
|
|
42
71
|
readonly redirectTo?: string;
|
|
43
72
|
readonly signInUrl?: string;
|
|
44
73
|
}): import("react").FunctionComponentElement<{
|
|
45
74
|
readonly title: string;
|
|
46
|
-
readonly lead?:
|
|
47
|
-
readonly
|
|
75
|
+
readonly lead?: ReactNode;
|
|
76
|
+
readonly stage?: string;
|
|
48
77
|
readonly appear?: boolean;
|
|
49
78
|
readonly children?: ReactNode;
|
|
50
|
-
}> | import("react").FunctionComponentElement<{
|
|
79
|
+
}> | import("react").FunctionComponentElement<{
|
|
80
|
+
readonly label: string;
|
|
81
|
+
readonly fields: number;
|
|
82
|
+
readonly title: string;
|
|
83
|
+
readonly foot: string;
|
|
84
|
+
}>;
|
|
51
85
|
/** The signed-in person's picture or initial, opening a menu: their account, and signing out. */
|
|
52
86
|
declare function UserButton(props: {
|
|
53
87
|
readonly accountUrl?: string;
|
|
@@ -57,6 +91,7 @@ declare function UserButton(props: {
|
|
|
57
91
|
onKeyDown: (event: {
|
|
58
92
|
key: string;
|
|
59
93
|
preventDefault(): void;
|
|
94
|
+
currentTarget: HTMLElement;
|
|
60
95
|
}) => void;
|
|
61
96
|
onBlur: (event: {
|
|
62
97
|
relatedTarget: unknown;
|
|
@@ -66,30 +101,18 @@ declare function UserButton(props: {
|
|
|
66
101
|
}) => void;
|
|
67
102
|
}, HTMLElement> | null;
|
|
68
103
|
/** The signed-in person's account: profile, password, two-step sign-in, passkeys, sessions, keys and apps. */
|
|
69
|
-
declare function UserProfile(): import("react").FunctionComponentElement<{
|
|
70
|
-
readonly
|
|
71
|
-
readonly lead?: string;
|
|
72
|
-
readonly wide?: boolean;
|
|
73
|
-
readonly appear?: boolean;
|
|
74
|
-
readonly children?: ReactNode;
|
|
104
|
+
declare function UserProfile(): import("react").DetailedReactHTMLElement<Record<string, unknown>, HTMLElement> | import("react").FunctionComponentElement<{
|
|
105
|
+
readonly label: string;
|
|
75
106
|
}> | null;
|
|
76
107
|
/** Which organization the person works in, or their personal account; and making a new one. */
|
|
77
108
|
declare function OrganizationSwitcher(): import("react").DetailedReactHTMLElement<{
|
|
78
109
|
className: string;
|
|
79
|
-
style: {
|
|
80
|
-
display: "grid";
|
|
81
|
-
gap: number;
|
|
82
|
-
};
|
|
83
110
|
}, HTMLElement> | null;
|
|
84
111
|
/** One organization: its name, its members and their roles, and its invitations. The active one unless `organizationId` names another. */
|
|
85
112
|
declare function OrganizationProfile(props: {
|
|
86
113
|
readonly organizationId?: string;
|
|
87
|
-
}): import("react").FunctionComponentElement<{
|
|
88
|
-
readonly
|
|
89
|
-
readonly lead?: string;
|
|
90
|
-
readonly wide?: boolean;
|
|
91
|
-
readonly appear?: boolean;
|
|
92
|
-
readonly children?: ReactNode;
|
|
114
|
+
}): import("react").DetailedReactHTMLElement<Record<string, unknown>, HTMLElement> | import("react").FunctionComponentElement<{
|
|
115
|
+
readonly label: string;
|
|
93
116
|
}> | null;
|
|
94
117
|
//#endregion
|
|
95
|
-
export { AuthProvider, AuthState, OrganizationProfile, OrganizationSwitcher, SignIn, SignUp, UserButton, UserProfile, useAuth };
|
|
118
|
+
export { Appearance, AuthProvider, AuthState, OrganizationProfile, OrganizationSwitcher, SignIn, SignInStep, SignUp, UserButton, UserProfile, useAuth };
|