@zuplo/runtime 6.70.27 → 6.70.28

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{b as d}from"../chunk-H7UGARU6.js";import{_ as n,a as t}from"../chunk-JAEQKE5H.js";function g(u={request:new Request("https://api.example.com")}){let e=[];function o(i){e.push(Promise.resolve(i))}return t(o,"waitUntil"),{context:new s({event:{waitUntil:o},route:u.route}),invokeResponse:t(async()=>{await Promise.all(e)},"invokeResponse")}}t(g,"createMockContext");var p={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:t(()=>({}),"raw")},s=class extends EventTarget{static{t(this,"MockZuploContext")}#e;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:o=p,parentContext:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:n.console.info,log:n.console.log,debug:n.console.debug,warn:n.console.warn,error:n.console.error,setLogProperties:t(()=>{},"setLogProperties")},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,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0},this.parentContext=r,this.#e=e,this.analyticsContext=new d(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,o){throw new Error("Not implemented")}invokeOutboundPolicy(e,o,r){throw new Error("Not implemented")}invokeRoute(e,o){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addEventListener(e,o,r){let l=t(i=>{try{typeof o=="function"?o(i):o.handleEvent(i)}catch(a){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),a}},"wrapped");super.addEventListener(e,l,r)}};export{s as MockZuploContext,g as createMockContext};
25
+ import{b as d}from"../chunk-F7DJMBWH.js";import{_ as n,a as t}from"../chunk-JAEQKE5H.js";function g(u={request:new Request("https://api.example.com")}){let e=[];function o(i){e.push(Promise.resolve(i))}return t(o,"waitUntil"),{context:new s({event:{waitUntil:o},route:u.route}),invokeResponse:t(async()=>{await Promise.all(e)},"invokeResponse")}}t(g,"createMockContext");var p={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:t(()=>({}),"raw")},s=class extends EventTarget{static{t(this,"MockZuploContext")}#e;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:o=p,parentContext:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:n.console.info,log:n.console.log,debug:n.console.debug,warn:n.console.warn,error:n.console.error,setLogProperties:t(()=>{},"setLogProperties")},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,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0},this.parentContext=r,this.#e=e,this.analyticsContext=new d(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,o){throw new Error("Not implemented")}invokeOutboundPolicy(e,o,r){throw new Error("Not implemented")}invokeRoute(e,o){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addEventListener(e,o,r){let l=t(i=>{try{typeof o=="function"?o(i):o.handleEvent(i)}catch(a){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),a}},"wrapped");super.addEventListener(e,l,r)}};export{s as MockZuploContext,g as createMockContext};
26
26
  //# sourceMappingURL=index.js.map
@@ -8957,6 +8957,42 @@ export declare interface SetStatusOutboundPolicyOptions {
8957
8957
  statusText?: string;
8958
8958
  }
8959
8959
 
8960
+ /**
8961
+ * Sets a single header on the incoming request, typically used to attach an
8962
+ * API key for the upstream service. A more directed version of the
8963
+ * `SetHeadersInboundPolicy` that defaults the header name to `Authorization`
8964
+ * and is intended to be used with an `$env()` reference for the value.
8965
+ *
8966
+ * @title Set Upstream API Key
8967
+ * @product api-gateway
8968
+ * @public
8969
+ * @param request - The ZuploRequest
8970
+ * @param context - The ZuploContext
8971
+ * @param options - The policy options set in policies.json
8972
+ * @param policyName - The name of the policy as set in policies.json
8973
+ * @returns A Request or a Response
8974
+ */
8975
+ export declare const SetUpstreamApiKeyInboundPolicy: InboundPolicyHandler<SetUpstreamApiKeyInboundPolicyOptions>;
8976
+
8977
+ /**
8978
+ * The options for this policy.
8979
+ * @public
8980
+ */
8981
+ export declare interface SetUpstreamApiKeyInboundPolicyOptions {
8982
+ /**
8983
+ * The name of the header to set on the request. Defaults to `Authorization`.
8984
+ */
8985
+ header?: string;
8986
+ /**
8987
+ * The value of the header. Most commonly an environment variable reference such as `Bearer $env(UPSTREAM_API_KEY)` so the secret is sourced from your environment.
8988
+ */
8989
+ value: string;
8990
+ /**
8991
+ * Overwrite the value if the header is already present in the request.
8992
+ */
8993
+ overwrite?: boolean;
8994
+ }
8995
+
8960
8996
  /**
8961
8997
  * Function type for determining if a request should be logged
8962
8998
  * @public
@@ -973,7 +973,7 @@ export declare interface McpAuth0OAuthInboundPolicyOptions {
973
973
  /**
974
974
  * The Auth0 client_secret. Use $env(...) to source from a secret environment variable.
975
975
  */
976
- clientSecret?: string;
976
+ clientSecret: string;
977
977
  /**
978
978
  * OIDC scopes requested during browser login.
979
979
  */
@@ -1076,9 +1076,9 @@ export declare interface McpOAuthInboundPolicyOptions {
1076
1076
  */
1077
1077
  jwksUrl: string;
1078
1078
  /**
1079
- * Expected audience claim on tokens issued for the gateway.
1079
+ * Optional IdP audience value. Leave unset when browser login ID tokens use the OIDC client_id as their audience.
1080
1080
  */
1081
- audience: string;
1081
+ audience?: string;
1082
1082
  };
1083
1083
  /**
1084
1084
  * Browser-side OAuth/OIDC settings used when the gateway redirects the user to the identity provider for login.
@@ -1097,7 +1097,7 @@ export declare interface McpOAuthInboundPolicyOptions {
1097
1097
  */
1098
1098
  clientId?: string;
1099
1099
  /**
1100
- * The OIDC client_secret. Use $env(...) to source from a secret environment variable.
1100
+ * The OIDC client_secret. Required for federated browser login. Use $env(...) to source from a secret environment variable.
1101
1101
  */
1102
1102
  clientSecret?: string;
1103
1103
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.70.27",
4
+ "version": "6.70.28",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {