@cosmicdrift/kumiko-server-runtime 0.212.0 → 0.214.0
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 +3 -3
- package/src/compose-features.ts +25 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-server-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.214.0",
|
|
4
4
|
"description": "Production server-boot runtime for Kumiko apps: connections, schema-drift-gate, seeds, lifecycle, graceful shutdown. Symmetric to kumiko-dev-server's runDevApp, without dev/scaffold/codegen tooling.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
84
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
83
|
+
"@cosmicdrift/kumiko-bundled-features": "0.214.0",
|
|
84
|
+
"@cosmicdrift/kumiko-framework": "0.214.0",
|
|
85
85
|
"temporal-polyfill": "^0.3.2"
|
|
86
86
|
},
|
|
87
87
|
"publishConfig": {
|
package/src/compose-features.ts
CHANGED
|
@@ -39,12 +39,12 @@ export type ComposeFeaturesOptions = {
|
|
|
39
39
|
* (+ auth-self-registration when authOptions.signup is set) before the
|
|
40
40
|
* app features. Mirror of "auth-mode" in run{Dev,Prod}App. */
|
|
41
41
|
readonly includeBundled: boolean;
|
|
42
|
-
/** Optional auth-feature
|
|
43
|
-
* createAuthEmailPasswordFeature.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* passwordReset
|
|
42
|
+
/** Optional auth-feature options passed through to
|
|
43
|
+
* createAuthEmailPasswordFeature. When passwordReset / emailVerification
|
|
44
|
+
* are set here, the feature registers the request/confirm handlers —
|
|
45
|
+
* otherwise it doesn't (500 if the routes are mounted via
|
|
46
|
+
* auth-routes.ts but no handler dispatches). Goes hand-in-hand with the
|
|
47
|
+
* passwordReset block in RunProdAppAuthOptions / RunDevAppAuthOptions. */
|
|
48
48
|
readonly authOptions?: AuthEmailPasswordOptions;
|
|
49
49
|
};
|
|
50
50
|
|
|
@@ -108,13 +108,12 @@ export function composeFeatures(
|
|
|
108
108
|
return [...bundled, ...filteredApp];
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/** Shape
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* doppelt zu bauen. */
|
|
111
|
+
/** Shape of any run{Prod,Dev}App auth block that can carry a
|
|
112
|
+
* passwordReset/emailVerification config. The wrapper API
|
|
113
|
+
* (PasswordResetSetup) extends the feature API (PasswordResetOptions), so
|
|
114
|
+
* a structural-typed lookup on the auth-only subset is enough. Lets
|
|
115
|
+
* buildComposeAuthOptions be called with both RunProd- and
|
|
116
|
+
* RunDev-AuthOptions without building the helper twice. */
|
|
118
117
|
export type AuthOptionsCarrier = {
|
|
119
118
|
readonly passwordReset?: PasswordResetOptions;
|
|
120
119
|
readonly emailVerification?: EmailVerificationOptions;
|
|
@@ -124,24 +123,26 @@ export type AuthOptionsCarrier = {
|
|
|
124
123
|
readonly accountLockout?: AccountLockoutOptions;
|
|
125
124
|
};
|
|
126
125
|
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
126
|
+
/** Builds the authOptions block for composeFeatures from a wrapper auth
|
|
127
|
+
* block. Passes through ONLY the feature-side fields (hmacSecret,
|
|
128
|
+
* tokenTtlMinutes, mode) — the mail side (sendResetEmail/appResetUrl)
|
|
129
|
+
* belongs in the auth-routes config and is wired separately by the
|
|
130
|
+
* wrapper.
|
|
132
131
|
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
|
|
132
|
+
* Returns undefined when neither passwordReset nor emailVerification is
|
|
133
|
+
* set (composeFeatures default-deny: NO handler registered in the
|
|
134
|
+
* registry, /api/auth/request-password-reset etc. stay 401/404). */
|
|
135
|
+
// All five magic-link flows (reset/verify/signup/invite/unlock) accept the
|
|
136
|
+
// same appUrl shape — a plain string, or a `(locale) => string` function for
|
|
137
|
+
// apps with language-in-path routing (see SignupRequestOptions.appUrl).
|
|
137
138
|
type MailFlowFields = {
|
|
138
|
-
readonly appUrl: string;
|
|
139
|
+
readonly appUrl: string | ((locale: string) => string);
|
|
139
140
|
readonly tokenTtlMinutes?: number;
|
|
140
141
|
readonly appName?: string;
|
|
141
142
|
readonly locale?: AuthMailLocale;
|
|
142
143
|
};
|
|
143
144
|
|
|
144
|
-
// The magic-link mail fields shared by all
|
|
145
|
+
// The magic-link mail fields shared by all five flows. Conditional spreads omit
|
|
145
146
|
// undefined keys (exactOptionalPropertyTypes) and avoid the property-write that
|
|
146
147
|
// trips noPropertyAccessFromIndexSignature on the type-aliased option shapes.
|
|
147
148
|
// reset/verify layer hmacSecret (+ mode) on top.
|