@zuplo/runtime 6.54.13 → 6.54.15

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,4 +22,4 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{b as e,c as t,e as a,f as o,g as r,h as i,i as n}from"../chunk-SEPHSKCD.js";import"../chunk-DJ47NX57.js";export{o as getIdForParameterSchema,i as getIdForRefSchema,r as getIdForRequestBodySchema,a as getRawOperationDataIdentifierName,e as isRestrictedEnvVariableName,t as isZuploReadableEnvVariableName,n as sanitizedIdentifierName};
25
+ import{b as e,c as t,e as a,f as o,g as r,h as i,i as n}from"../chunk-MURXRXQH.js";import"../chunk-EO2EJJCU.js";export{o as getIdForParameterSchema,i as getIdForRefSchema,r as getIdForRequestBodySchema,a as getRawOperationDataIdentifierName,e as isRestrictedEnvVariableName,t as isZuploReadableEnvVariableName,n as sanitizedIdentifierName};
@@ -22,4 +22,4 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{X as n,a as t}from"../chunk-DJ47NX57.js";function m(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(m,"createMockContext");var l={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;constructor({event:e,route:o=l,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},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},this.parentContext=r,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")}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 d=t(i=>{try{typeof o=="function"?o(i):o.handleEvent(i)}catch(p){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),p}},"wrapped");super.addEventListener(e,d,r)}};export{s as MockZuploContext,m as createMockContext};
25
+ import{Z as n,a as t}from"../chunk-EO2EJJCU.js";function m(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(m,"createMockContext");var l={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;constructor({event:e,route:o=l,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},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},this.parentContext=r,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")}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 d=t(i=>{try{typeof o=="function"?o(i):o.handleEvent(i)}catch(p){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),p}},"wrapped");super.addEventListener(e,d,r)}};export{s as MockZuploContext,m as createMockContext};
@@ -4421,6 +4421,64 @@ export declare interface JWTScopeValidationInboundPolicyOptions {
4421
4421
  scopes: string[];
4422
4422
  }
4423
4423
 
4424
+ export declare class JwtServicePlugin extends SystemRuntimePlugin {
4425
+ #private;
4426
+ static signJwt({
4427
+ audience,
4428
+ subject,
4429
+ ...payload
4430
+ }: JWTSignPayload): Promise<string>;
4431
+ constructor(options?: JwtServicePluginOptions);
4432
+ registerRoutes({
4433
+ runtimeSettings,
4434
+ router,
4435
+ }: {
4436
+ runtimeSettings: RuntimeSettings;
4437
+ router: Router;
4438
+ }): void;
4439
+ }
4440
+
4441
+ declare interface JwtServicePluginOptions {
4442
+ basePath?: string;
4443
+ /**
4444
+ * Sets time for the "exp" (Expiration Time) Claim in the JWT.
4445
+ *
4446
+ * - If a `number` is passed as an argument it is used as the claim directly.
4447
+ * - If a `string` is passed as an argument it is resolved to a time span, and then added to the
4448
+ * current unix timestamp and used as the claim.
4449
+ *
4450
+ * Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
4451
+ * day".
4452
+ *
4453
+ * Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
4454
+ * "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
4455
+ * "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
4456
+ * alias for a year.
4457
+ *
4458
+ * If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
4459
+ * subtracted from the current unix timestamp. A "from now" suffix can also be used for
4460
+ * readability when adding to the current unix timestamp.
4461
+ */
4462
+ tokenExpiration?: number | string;
4463
+ }
4464
+
4465
+ declare interface JWTSignPayload {
4466
+ /**
4467
+ * The subject of the JWT.
4468
+ * This is typically the user ID or a unique identifier for the entity the JWT represents.
4469
+ * It is used to identify the principal that the JWT is issued to.
4470
+ * If not provided, the JWT will not have a subject claim.
4471
+ */
4472
+ subject?: string;
4473
+ /**
4474
+ * The audience of the JWT.
4475
+ * This is typically the intended recipient of the JWT, i.e. the URL of the service.
4476
+ * If not provided, the JWT will not have an audience claim.
4477
+ */
4478
+ audience?: string;
4479
+ [key: string]: any;
4480
+ }
4481
+
4424
4482
  /**
4425
4483
  * @beta
4426
4484
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.54.13",
4
+ "version": "6.54.15",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {