@rpcbase/server 0.607.0 → 0.609.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/dist/applyRouteLoaders.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/initServer.d.ts +19 -3
- package/dist/initServer.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyRouteLoaders.d.ts","sourceRoot":"","sources":["../src/applyRouteLoaders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAChF,OAAO,EACL,oBAAoB,EAMrB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"applyRouteLoaders.d.ts","sourceRoot":"","sources":["../src/applyRouteLoaders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAChF,OAAO,EACL,oBAAoB,EAMrB,MAAM,iBAAiB,CAAA;AAkHxB,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,GAAG;IAC7D,gBAAgB,CAAC,EAAE,QAAQ,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC,CAAA;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,eAAe,EACpB,UAAU,EAAE,GAAG,EAAE,GAChB,OAAO,CAAC,yBAAyB,CAAC,CA8MpC"}
|
package/dist/index.js
CHANGED
|
@@ -4354,7 +4354,7 @@ var createRedisSessionStore = async (redisUrl) => {
|
|
|
4354
4354
|
ttl: SESSION_MAX_AGE_S
|
|
4355
4355
|
});
|
|
4356
4356
|
};
|
|
4357
|
-
|
|
4357
|
+
async function initServer(app, serverEnv, options = {}) {
|
|
4358
4358
|
bindShutdownSignals();
|
|
4359
4359
|
await initApiClient({ app });
|
|
4360
4360
|
const replicaSetInitPromise = checkInitReplicaSet(serverEnv).catch((error) => {
|
|
@@ -4379,6 +4379,8 @@ var initServer = async (app, serverEnv) => {
|
|
|
4379
4379
|
bindExpressErrorHandler(app, posthog);
|
|
4380
4380
|
ensurePosthogShutdown();
|
|
4381
4381
|
}
|
|
4382
|
+
if (!isProduction$1) registerDevCoverageEndpoints(app);
|
|
4383
|
+
if (options.sessions === false) return { sessionMiddleware: void 0 };
|
|
4382
4384
|
if (!serverEnv.MASTER_KEY) throw new Error("MASTER_KEY must be defined to derive the session secret");
|
|
4383
4385
|
if (!serverEnv.RB_PROXY_SHARED_SECRET?.trim()) throw new Error("RB_PROXY_SHARED_SECRET must be defined");
|
|
4384
4386
|
const sessionSecret = getDerivedKey(serverEnv.MASTER_KEY, "express_session_key");
|
|
@@ -4400,11 +4402,10 @@ var initServer = async (app, serverEnv) => {
|
|
|
4400
4402
|
};
|
|
4401
4403
|
if (isProduction$1) sessionConfig.cookie.secure = "auto";
|
|
4402
4404
|
const sessionMiddleware = session(sessionConfig);
|
|
4403
|
-
if (!isProduction$1) registerDevCoverageEndpoints(app);
|
|
4404
4405
|
app.use(isProduction$1 ? sessionMiddleware : developmentSessionMiddleware(sessionMiddleware));
|
|
4405
4406
|
app.use(syncAuthenticatedSessionMiddleware);
|
|
4406
4407
|
return { sessionMiddleware };
|
|
4407
|
-
}
|
|
4408
|
+
}
|
|
4408
4409
|
//#endregion
|
|
4409
4410
|
//#region src/hashPassword.ts
|
|
4410
4411
|
async function hashPassword(password, salt) {
|
|
@@ -4650,7 +4651,6 @@ function createLocation(current, to, state = null, key) {
|
|
|
4650
4651
|
pathname: typeof current === "string" ? current : current.pathname,
|
|
4651
4652
|
search: "",
|
|
4652
4653
|
hash: "",
|
|
4653
|
-
unstable_mask: void 0,
|
|
4654
4654
|
...typeof to === "string" ? parsePath(to) : to,
|
|
4655
4655
|
state,
|
|
4656
4656
|
key: to && to.key || key || createKey()
|