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

@netlify/integrations

Package Overview
Dependencies
Maintainers
19
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/integrations - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

14

dist/main.d.ts
import { HandlerContext, HandlerEvent, HandlerResponse } from '@netlify/functions';
declare type FunctionHandler<Context = unknown> = (event: HandlerEvent, context: HandlerContext & Context) => Promise<HandlerResponse>;
export declare type IntegrationHandler<Context = unknown> = (handler: FunctionHandler<Context>) => FunctionHandler;
declare type ExtractContextTypes<HandlerTypes extends unknown[]> = HandlerTypes extends [infer Handler, ...infer Remaining] ? Handler extends IntegrationHandler<infer ContextType> ? ContextType & ExtractContextTypes<Remaining> : unknown : unknown;
export declare const wrap: <T extends IntegrationHandler<unknown>[]>(...handlers: T) => (functionHandler: (event: HandlerEvent, context: HandlerContext & ExtractContextTypes<T>) => Promise<HandlerResponse>) => (event: HandlerEvent, context: HandlerContext & ExtractContextTypes<T>) => Promise<HandlerResponse>;
export declare type FunctionHandler<Context = any> = (event: HandlerEvent, context: HandlerContext & Context) => Promise<HandlerResponse>;
export declare type IntegrationHandlerConfig<Config = any> = {
[key: string]: {
[key: string]: unknown;
};
} & Config;
export declare type IntegrationHandler<Context = any, Config = any> = (handler: FunctionHandler<Context>, config?: IntegrationHandlerConfig<Config>) => FunctionHandler;
declare type ExtractContextTypes<HandlerTypes extends unknown[]> = HandlerTypes extends [infer Handler, ...infer Remaining] ? Handler extends IntegrationHandler<infer ContextType, infer ConfigType> ? ContextType & ExtractContextTypes<Remaining> : unknown : unknown;
declare type ExtractConfigTypes<HandlerTypes extends unknown[]> = HandlerTypes extends [infer Handler, ...infer Remaining] ? Handler extends IntegrationHandler<infer ContextType, infer ConfigType> ? ConfigType & ExtractConfigTypes<Remaining> : unknown : unknown;
export declare const wrap: <T extends IntegrationHandler<any, any>[]>(...handlers: T) => (functionHandler: (event: HandlerEvent, context: HandlerContext & ExtractContextTypes<T>) => Promise<HandlerResponse>, config?: ExtractConfigTypes<T> | undefined) => (event: HandlerEvent, context: HandlerContext & ExtractContextTypes<T>) => Promise<HandlerResponse>;
export {};

@@ -1,3 +0,3 @@

export const wrap = (...handlers) => (functionHandler) =>
export const wrap = (...handlers) => (functionHandler, config) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
handlers.reduceRight((handler, integration) => integration(handler), functionHandler);
handlers.reduceRight((handler, integration) => integration(handler, config), functionHandler);
{
"name": "@netlify/integrations",
"version": "0.3.0",
"version": "0.4.0",
"description": "",

@@ -13,7 +13,2 @@ "type": "module",

],
"scripts": {
"build": "tsc --project tsconfig.build.json",
"test": "vitest",
"test:ci": "vitest run"
},
"config": {

@@ -47,4 +42,11 @@ "eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,.github}/**/*.{js,ts,md,html}\" \"*.{js,ts,md,html}\" \".*.{js,ts,md,html}\"",

"dependencies": {
"@netlify/functions": "^1.4.0"
"@netlify/functions": "^1.4.0",
"@types/chance": "^1.1.3",
"chance": "^1.1.9"
},
"scripts": {
"build": "tsc --project tsconfig.build.json",
"test": "vitest",
"test:ci": "vitest run"
}
}
}
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