@zuplo/runtime 5.2460.0 → 5.2464.0

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.
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{a as n}from"../chunk-OQPRFCK5.js";function l(i={request:new Request("https://api.example.com")}){let e=[];function o(t){e.push(Promise.resolve(t))}return n(o,"waitUntil"),{context:new r({event:{waitUntil:o},route:i.route}),invokeResponse:n(async()=>{await Promise.all(e)},"invokeResponse")}}n(l,"createMockContext");var a={path:"/",methods:["GET"],handler:{module:{},export:"default"},version:"none",raw:n(()=>({}),"raw")},r=class extends EventTarget{static{n(this,"MockZuploContext")}#e;requestId;log;route;custom;incomingRequestProperties;constructor({event:e,route:o=a}){super(),this.requestId=crypto.randomUUID(),this.log={info:console.info,log:console.log,debug:console.debug,warn:console.warn,error:console.error},this.custom={},this.route=o,this.incomingRequestProperties={asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0},this.#e=e}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,o){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addEventListener(e,o,s){let u=n(t=>{try{typeof o=="function"?o(t):o.handleEvent(t)}catch(d){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),d}},"wrapped");super.addEventListener(e,u,s)}};export{r as MockZuploContext,l as createMockContext};
25
+ import{a as n}from"../chunk-OQPRFCK5.js";function a(s={request:new Request("https://api.example.com")}){let e=[];function o(t){e.push(Promise.resolve(t))}return n(o,"waitUntil"),{context:new i({event:{waitUntil:o},route:s.route}),invokeResponse:n(async()=>{await Promise.all(e)},"invokeResponse")}}n(a,"createMockContext");var l={path:"/",methods:["GET"],handler:{module:{},export:"default"},version:"none",raw:n(()=>({}),"raw")},i=class extends EventTarget{static{n(this,"MockZuploContext")}#e;requestId;log;route;custom;incomingRequestProperties;constructor({event:e,route:o=l}){super(),this.requestId=crypto.randomUUID(),this.log={info:console.info,log:console.log,debug:console.debug,warn:console.warn,error:console.error},this.custom={},this.route=o,this.incomingRequestProperties={asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0},this.#e=e}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,o){throw new Error("Not implemented")}invokeOutboundPolicy(e,o,r){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addEventListener(e,o,r){let u=n(t=>{try{typeof o=="function"?o(t):o.handleEvent(t)}catch(d){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),d}},"wrapped");super.addEventListener(e,u,r)}};export{i as MockZuploContext,a as createMockContext};
26
26
  /*! For license information please see index.js.LEGAL.txt */
@@ -3800,7 +3800,7 @@ export declare abstract class OutboundPolicy<TOptions = any> extends PolicyBase<
3800
3800
  * @param request - The incoming Request
3801
3801
  * @param context - The current context of the Request
3802
3802
  */
3803
- abstract handler(response: Response, request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest | Response>;
3803
+ abstract handler(response: Response, request: ZuploRequest, context: ZuploContext): Promise<Response>;
3804
3804
  }
3805
3805
 
3806
3806
  /**
@@ -5526,6 +5526,7 @@ export declare interface ZuploContext extends EventTarget {
5526
5526
  readonly custom: Record<string, any>;
5527
5527
  readonly incomingRequestProperties: IncomingRequestProperties;
5528
5528
  readonly invokeInboundPolicy: (policyName: string, request: ZuploRequest) => Promise<Response | ZuploRequest>;
5529
+ readonly invokeOutboundPolicy: (policyName: string, response: Response, request: ZuploRequest) => Promise<Response>;
5529
5530
  readonly waitUntil: WaitUntilFunc;
5530
5531
  /**
5531
5532
  * Fires just before the response is sent. Response can be modified.
@@ -478,6 +478,7 @@ export declare class MockZuploContext extends EventTarget implements ZuploContex
478
478
  });
479
479
  waitUntil(promise: Promise<any>): void;
480
480
  invokeInboundPolicy(policyName: string, request: ZuploRequest): Promise<ZuploRequest | Response>;
481
+ invokeOutboundPolicy(policyName: string, response: Response, request: ZuploRequest): Promise<Response>;
481
482
  /**
482
483
  * Fires just before the response is sent. Response can be modified.
483
484
  */
@@ -1079,6 +1080,7 @@ declare interface ZuploContext extends EventTarget {
1079
1080
  readonly custom: Record<string, any>;
1080
1081
  readonly incomingRequestProperties: IncomingRequestProperties;
1081
1082
  readonly invokeInboundPolicy: (policyName: string, request: ZuploRequest) => Promise<Response | ZuploRequest>;
1083
+ readonly invokeOutboundPolicy: (policyName: string, response: Response, request: ZuploRequest) => Promise<Response>;
1082
1084
  readonly waitUntil: WaitUntilFunc;
1083
1085
  /**
1084
1086
  * Fires just before the response is sent. Response can be modified.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "5.2460.0",
4
+ "version": "5.2464.0",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {