@functionalcms/svelte-components 5.7.0 → 5.8.1

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.
@@ -1,10 +1,10 @@
1
1
  import { sequence } from "@sveltejs/kit/hooks";
2
2
  import errorHandler from "./auth/errorHandle";
3
3
  import { paraglideHandler } from "./handlers/paraglideHandler";
4
- import sessionStorageHandler from "./handlers/sessionStorageHandler";
5
4
  import authorizationHandle from "./auth/authorizationHandle";
6
5
  import { userHandler } from "./handlers/userHandler";
7
6
  import { accessTokenHandler } from "./handlers/accessTokenHandler";
7
+ import handleHealthCheck from "./handlers/handleHealthCheck";
8
8
  export const hookSequence = (secret, paraglideMiddleware, getTextDirection, customHooks) => {
9
9
  return sequence(userHandler(secret), accessTokenHandler(secret), errorHandler, paraglideHandler(paraglideMiddleware, getTextDirection), authorizationHandle(), ...customHooks);
10
10
  };
@@ -0,0 +1,3 @@
1
+ import { type Handle } from '@sveltejs/kit';
2
+ declare const handleHealthCheck: () => Handle;
3
+ export default handleHealthCheck;
@@ -0,0 +1,16 @@
1
+ import {} from '@sveltejs/kit';
2
+ const handleHealthCheck = () => {
3
+ return async ({ event, resolve }) => {
4
+ const path = event.url.pathname;
5
+ if (path.startsWith('/health_check/') === true) {
6
+ return new Response(JSON.stringify({ ok: true }), {
7
+ status: 200,
8
+ headers: { 'Content-Type': 'application/json' }
9
+ });
10
+ }
11
+ else {
12
+ return resolve(event);
13
+ }
14
+ };
15
+ };
16
+ export default handleHealthCheck;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "5.7.0",
3
+ "version": "5.8.1",
4
4
  "license": "MIT",
5
5
  "watch": {
6
6
  "build": {