@netlify/functions
Advanced tools
Comparing version 0.11.0 to 0.11.1
@@ -8,5 +8,5 @@ import type { Context } from './context'; | ||
export interface BaseHandler<ResponseType extends Response = Response, C extends Context = Context> { | ||
(event: Event, context: C, callback: HandlerCallback<ResponseType>): void | ResponseType | Promise<ResponseType>; | ||
(event: Event, context: C, callback?: HandlerCallback<ResponseType>): void | Promise<ResponseType>; | ||
} | ||
export declare type Handler = BaseHandler<Response, Context>; | ||
export declare type BuilderHandler = BaseHandler<BuilderResponse, Context>; |
@@ -40,3 +40,3 @@ "use strict"; | ||
// eslint-disable-next-line promise/prefer-await-to-callbacks | ||
var wrappedCallback = function (error, response) { return callback(error, augmentResponse(response)); }; | ||
var wrappedCallback = function (error, response) { return callback === null || callback === void 0 ? void 0 : callback(error, augmentResponse(response)); }; | ||
var execution = handler(modifiedEvent, context, wrappedCallback); | ||
@@ -43,0 +43,0 @@ if ((0, is_promise_1.default)(execution)) { |
@@ -37,6 +37,4 @@ import { Event as HandlerEvent } from '../function/event'; | ||
}; | ||
export declare type HandlerEventWithOneGraph = HandlerEvent & { | ||
_oneGraph: OneGraphPayload; | ||
}; | ||
export declare type HandlerEventWithOneGraph = HandlerEvent & OneGraphPayload; | ||
export declare const getSecrets: (event?: HandlerEventWithOneGraph | HandlerEvent | undefined) => Promise<NetlifySecrets>; | ||
export {}; |
@@ -129,7 +129,7 @@ "use strict"; | ||
var eventToken, secretToken, doc, body, result, newSecrets; | ||
var _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
var _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
eventToken = (_b = (_a = event) === null || _a === void 0 ? void 0 : _a._oneGraph) === null || _b === void 0 ? void 0 : _b.authlifyToken; | ||
eventToken = (_a = event) === null || _a === void 0 ? void 0 : _a.authlifyToken; | ||
secretToken = eventToken || process_1.env.ONEGRAPH_AUTHLIFY_TOKEN; | ||
@@ -143,3 +143,3 @@ if (!secretToken) { | ||
case 1: | ||
result = _c.sent(); | ||
result = _b.sent(); | ||
newSecrets = formatSecrets(result); | ||
@@ -146,0 +146,0 @@ return [2 /*return*/, newSecrets]; |
@@ -5,3 +5,3 @@ { | ||
"types": "./dist/main.d.ts", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"description": "JavaScript utilities for Netlify Functions", | ||
@@ -8,0 +8,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28171
496