Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

app-sh

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-sh - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

4

dist/types/app-sh.d.ts

@@ -5,3 +5,3 @@ import { Logger, LogLevel } from "./logger.js";

import { Pool } from "undici";
export { Logger, LogLevel, ConfigTypes, Middleware, EndpointCallback, EndpointCallbackDetails, z, };
export { Logger, LogLevel, ConfigTypes, HttpMan, Middleware, EndpointCallback, EndpointCallbackDetails, z, };
export interface ConfigOptions {

@@ -61,2 +61,3 @@ cmdLineFlag?: string;

private _httpMan?;
private _finally?;
constructor(appShConfig: AppShConfig);

@@ -70,2 +71,3 @@ protected stop(): Promise<void>;

set level(level: LogLevel);
finally(handler: () => Promise<void>): void;
shutdownError(code?: number, testing?: boolean): Promise<void>;

@@ -72,0 +74,0 @@ exit(code: number, hard?: boolean): Promise<void>;

@@ -7,4 +7,3 @@ /// <reference types="node" />

export { z };
type MiddlewareNext = (req: http.IncomingMessage, res: http.ServerResponse, details: EndpointCallbackDetails, middlewareStack: Middleware[], callback: EndpointCallback) => Promise<void>;
export type Middleware = (req: http.IncomingMessage, res: http.ServerResponse, details: EndpointCallbackDetails, next: MiddlewareNext) => Promise<void>;
export type Middleware = (req: http.IncomingMessage, res: http.ServerResponse, details: EndpointCallbackDetails, next: () => Promise<void>) => Promise<void>;
export type HealthcheckCallback = () => Promise<boolean>;

@@ -18,6 +17,3 @@ export type EndpointCallbackDetails = {

export type EndpointCallback = (req: http.IncomingMessage, res: http.ServerResponse, details: EndpointCallbackDetails) => Promise<void>;
export type EndpointOptions = {
maxBodySize?: number;
zodInputValidator?: z.ZodTypeAny;
};
type Method = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
export interface HttpConfig {

@@ -34,7 +30,5 @@ appSh: AppSh;

}
type Method = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
export declare class HttpMan {
private _sh;
private _logger;
private _middlewareList;
private _healthcheckCallbacks;

@@ -55,10 +49,13 @@ private _methodListMap;

private handleHttpReq;
private processHttpReqBody;
private checkForJsonBody;
private callMiddleware;
private healthcheckCallback;
stop(): Promise<void>;
addMiddleware(middleware: Middleware): void;
addHealthcheck(callback: HealthcheckCallback): void;
addEndpoint(method: Method, path: string, callback: EndpointCallback, endpointOptions?: EndpointOptions): void;
healthcheck(callback: HealthcheckCallback): void;
endpoint(method: Method, path: string, callback: EndpointCallback, middlewareList?: Middleware[]): void;
static body(options?: {
maxBodySize?: number;
}): Middleware;
static json(options?: {
zodInputValidator?: z.ZodTypeAny;
}): Middleware;
}
{
"version": "1.1.1",
"version": "1.2.0",
"name": "app-sh",

@@ -4,0 +4,0 @@ "description": "App Shell",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc