@zauru-sdk/services 2.0.189 → 2.0.190

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.
@@ -10,4 +10,18 @@ const sessionCookie = createCookie("_rj_session", {
10
10
  secure: process.env.NODE_ENV === "production",
11
11
  });
12
12
  const { getSession, commitSession, destroySession } = createUpstashSessionStorage({ cookie: sessionCookie });
13
- export { getSession, commitSession, destroySession };
13
+ const getRefreshSession = async (request, session) => {
14
+ const cookie = request.headers.get("Cookie");
15
+ const currentSession = await getSession(cookie);
16
+ if (!currentSession) {
17
+ return null;
18
+ }
19
+ return await commitSession(session, {
20
+ maxAge: 60 * 60 * 24,
21
+ path: "/",
22
+ sameSite: process.env.NODE_ENV === "production" ? "none" : "lax",
23
+ httpOnly: true,
24
+ secure: process.env.NODE_ENV === "production",
25
+ });
26
+ };
27
+ export { getSession, commitSession, destroySession, getRefreshSession };
@@ -1,2 +1,4 @@
1
- declare const getSession: (cookieHeader?: string | null, options?: import("cookie").CookieParseOptions) => Promise<import("@remix-run/node").Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>>, commitSession: (session: import("@remix-run/node").Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>, options?: import("cookie").CookieSerializeOptions) => Promise<string>, destroySession: (session: import("@remix-run/node").Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>, options?: import("cookie").CookieSerializeOptions) => Promise<string>;
2
- export { getSession, commitSession, destroySession };
1
+ import { Session } from "@remix-run/node";
2
+ declare const getSession: (cookieHeader?: string | null, options?: import("cookie").CookieParseOptions) => Promise<Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>>, commitSession: (session: Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>, options?: import("cookie").CookieSerializeOptions) => Promise<string>, destroySession: (session: Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>, options?: import("cookie").CookieSerializeOptions) => Promise<string>;
3
+ declare const getRefreshSession: (request: Request, session: Session) => Promise<string | null>;
4
+ export { getSession, commitSession, destroySession, getRefreshSession };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.0.189",
3
+ "version": "2.0.190",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -31,5 +31,5 @@
31
31
  "axios": "^1.6.7",
32
32
  "chalk": "5.3.0"
33
33
  },
34
- "gitHead": "b708b00848274bc8e119cd831da5e03ed9c74615"
34
+ "gitHead": "536427d6fdb904a2306132e2d7bc6d4d0eca93f0"
35
35
  }