@crossworks/client-types 0.234.4 → 0.234.8
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/package.json +1 -1
- package/src/dto/auth.ts +26 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
package/src/dto/auth.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-run auth on the wire: the public bootstrap state a login screen reads
|
|
3
|
+
* before anyone has signed in, and the first-run signup body.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** GET /api/auth/bootstrap-state. Public and boolean-only. */
|
|
7
|
+
export type BootstrapStateDTO = {
|
|
8
|
+
/** No account exists yet: the login screen shows "create your login". */
|
|
9
|
+
firstRun: boolean;
|
|
10
|
+
/** Signup asks for the installer's setup code (MANTLE_SETUP_CODE). Only
|
|
11
|
+
* ever true while `firstRun` is. Absent on a brain from before the field. */
|
|
12
|
+
setupCodeRequired?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** POST /api/auth/signup. Open only while no account exists. */
|
|
16
|
+
export type SignupBody = {
|
|
17
|
+
email: string;
|
|
18
|
+
password: string;
|
|
19
|
+
/** The setup code the installer printed. Required when the bootstrap
|
|
20
|
+
* state says `setupCodeRequired`; dashes, spaces and case are ignored. */
|
|
21
|
+
setupCode?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** The `reason` of a refused signup: `setup-code` for a wrong or missing
|
|
25
|
+
* code. (The other 403, "an account already exists", carries no reason.) */
|
|
26
|
+
export type SignupRefusedReason = 'setup-code';
|