@zuplo/runtime 6.66.6 → 6.66.7

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 e,c as t,e as i,f as o,g as a,h as r,i as n}from"../chunk-2ZIW362G.js";import"../chunk-TCQULLXT.js";export{o as getIdForParameterSchema,r as getIdForRefSchema,a as getIdForRequestBodySchema,i as getRawOperationDataIdentifierName,e as isRestrictedEnvVariableName,t as isZuploReadableEnvVariableName,n as sanitizedIdentifierName};
25
+ import{b as e,c as t,e as i,f as o,g as a,h as r,i as n}from"../chunk-I34NBXTA.js";import"../chunk-OVTOTSXZ.js";export{o as getIdForParameterSchema,r as getIdForRefSchema,a as getIdForRequestBodySchema,i as getRawOperationDataIdentifierName,e as isRestrictedEnvVariableName,t as isZuploReadableEnvVariableName,n as sanitizedIdentifierName};
26
26
  //# sourceMappingURL=index.js.map
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{b as l}from"../chunk-B2VZ5MPO.js";import{Z as n,a as t}from"../chunk-TCQULLXT.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 a={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=a,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},this.parentContext=r,this.#e=e,this.analyticsContext=new l(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 p=t(i=>{try{typeof o=="function"?o(i):o.handleEvent(i)}catch(d){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),d}},"wrapped");super.addEventListener(e,p,r)}};export{s as MockZuploContext,g as createMockContext};
25
+ import{b as l}from"../chunk-JBGSMWP6.js";import{X as n,a as t}from"../chunk-OVTOTSXZ.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 a={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=a,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},this.parentContext=r,this.#e=e,this.analyticsContext=new l(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 p=t(i=>{try{typeof o=="function"?o(i):o.handleEvent(i)}catch(d){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),d}},"wrapped");super.addEventListener(e,p,r)}};export{s as MockZuploContext,g as createMockContext};
26
26
  //# sourceMappingURL=index.js.map
@@ -5485,57 +5485,6 @@ declare interface Meter {
5485
5485
  */
5486
5486
  declare type Meter_2 = Partial<OpenMeterEvent> & Meter;
5487
5487
 
5488
- /**
5489
- * Base class for determining type of plugin
5490
- * @public
5491
- */
5492
- declare abstract class MeteringPlugin extends SystemRuntimePlugin {}
5493
-
5494
- /**
5495
- * @beta
5496
- */
5497
- declare type MeteringRegions = "us-central1" | "europe-west4";
5498
-
5499
- /**
5500
- * @beta
5501
- */
5502
- declare interface MeteringSubscription {
5503
- status: MeteringSubscriptionStatus;
5504
- type: "credits" | "periodic";
5505
- region: MeteringRegions;
5506
- renewalStrategy: "hourly" | "monthly" | "yearly";
5507
- customerKey: string;
5508
- /**
5509
- * Array of Stripe product ids, they start with "prod_"
5510
- */
5511
- planExternalIds: string[];
5512
- /**
5513
- * Stripe subscription id, starts with "sub_"
5514
- */
5515
- subscriptionExternalId?: string;
5516
- /**
5517
- * Stripe customer id, starts with "cus_"
5518
- */
5519
- customerExternalId?: string;
5520
- metadata?: Record<string, any>;
5521
- trialEndStatus?: "cancel" | "pause";
5522
- trialEndDate?: string;
5523
- trialStartDate?: string;
5524
- }
5525
-
5526
- /**
5527
- * @beta
5528
- */
5529
- declare type MeteringSubscriptionStatus =
5530
- | "active"
5531
- | "inactive"
5532
- | "incomplete"
5533
- | "incomplete-expired"
5534
- | "trialing"
5535
- | "past-due"
5536
- | "canceled"
5537
- | "unpaid";
5538
-
5539
5488
  /**
5540
5489
  * @public
5541
5490
  */
@@ -5666,98 +5615,6 @@ export declare interface MoesifInboundPolicyOptions {
5666
5615
  logResponseBody?: boolean;
5667
5616
  }
5668
5617
 
5669
- /**
5670
- * The Monetization policy enables you to track & monetize by your API's usage
5671
- *
5672
- * @title Monetization
5673
- * @deprecated - Zuplo monetization v1 has been deprecated and will be removed in the future.
5674
- * @param request - The ZuploRequest
5675
- * @param context - The ZuploContext
5676
- * @param options - The policy options set in policies.json
5677
- * @param policyName - The name of the policy as set in policies.json
5678
- * @returns A Request or a Response
5679
- */
5680
- export declare class MonetizationInboundPolicy extends InboundPolicy<MonetizationInboundPolicyOptions> {
5681
- static getSubscription(
5682
- context: ZuploContext
5683
- ): MonetizationSubscription | undefined;
5684
- static setMeters(
5685
- context: ZuploContext,
5686
- meters: MonetizationPolicyMeters
5687
- ): void;
5688
- constructor(options: MonetizationInboundPolicyOptions, policyName: string);
5689
- handler(
5690
- request: ZuploRequest<RequestGeneric>,
5691
- context: ZuploContext
5692
- ): Promise<ZuploRequest<RequestGeneric> | Response>;
5693
- }
5694
-
5695
- /**
5696
- * The options for this policy.
5697
- * @public
5698
- */
5699
- export declare interface MonetizationInboundPolicyOptions {
5700
- /**
5701
- * Indicates if requests without subscription should be allowed or not.
5702
- */
5703
- allowRequestsWithoutSubscription?: boolean;
5704
- /**
5705
- * Indicates which subscription statuses should be allowed.
5706
- */
5707
- allowedSubscriptionStatuses?: (
5708
- | "active"
5709
- | "inactive"
5710
- | "incomplete"
5711
- | "incomplete-expired"
5712
- | "trialing"
5713
- | "past-due"
5714
- | "canceled"
5715
- | "unpaid"
5716
- )[];
5717
- /**
5718
- * Indicates the bucket to be used, overrides the default one.
5719
- */
5720
- bucketId?: string;
5721
- /**
5722
- * Indicates if requests over quota should be allowed or not.
5723
- */
5724
- allowRequestsOverQuota?: boolean;
5725
- /**
5726
- * The meters to be used by the policy against the subscription quota.
5727
- */
5728
- meters: {
5729
- /**
5730
- * This interface was referenced by `undefined`'s JSON-Schema definition
5731
- * via the `patternProperty` "^.*$".
5732
- */
5733
- [k: string]: number;
5734
- };
5735
- /**
5736
- * A list of successful status codes and ranges "200-299, 304" that should trigger a metering call.
5737
- */
5738
- meterOnStatusCodes?: string | number[];
5739
- }
5740
-
5741
- declare interface MonetizationPolicyMeters {
5742
- [key: string]: number;
5743
- }
5744
-
5745
- /**
5746
- * @beta
5747
- */
5748
- export declare interface MonetizationSubscription extends MeteringSubscription {
5749
- /**
5750
- * Metering subscription id, starts with "sbsc_"
5751
- */
5752
- id: string;
5753
- createdOn: string;
5754
- updatedOn: string;
5755
- quotaResetAnchor?: string;
5756
- meters: SubscriptionMeters;
5757
- planIds: string[];
5758
- nextBillingCycle: string;
5759
- }
5760
-
5761
5618
  declare interface MultiRequests {
5762
5619
  RequestReference: RequestReference;
5763
5620
  }
@@ -8687,47 +8544,6 @@ export declare class StreamingZoneCache {
8687
8544
  private logDebug;
8688
8545
  }
8689
8546
 
8690
- /**
8691
- * Adds stripe monetization routes and configuration
8692
- * @deprecated - This plugin is deprecated and will be removed in the future.
8693
- */
8694
- export declare class StripeMonetizationPlugin extends MeteringPlugin {
8695
- private options;
8696
- constructor(options: StripeMonetizationPluginOptions);
8697
- /* Excluded from this release type: registerRoutes */
8698
- }
8699
-
8700
- /**
8701
- * @deprecated - This plugin is deprecated and will be removed in the future.
8702
- */
8703
- export declare interface StripeMonetizationPluginOptions {
8704
- /**
8705
- * Stripe Webhook settings
8706
- */
8707
- webhooks: StripeWebhookVerificationInboundPolicyOptions & {
8708
- /**
8709
- * The URL path where the webhook is registered.
8710
- * Defaults to `/_zuplo/stripe-webhook`
8711
- */
8712
- routePath?: string;
8713
- };
8714
- /**
8715
- * The ID of the Zuplo metering bucket.
8716
- */
8717
- meteringBucketId?: string;
8718
- /**
8719
- * The primary region where data is stored. Among other things, the choice of location impacts latency.
8720
- * Defaults to `us-central1`
8721
- */
8722
- primaryDataRegion?: string;
8723
- apiKeyBucketName?: string;
8724
- /**
8725
- * The Stripe account's secret key
8726
- */
8727
- stripeSecretKey: string;
8728
- /* Excluded from this release type: __testMode */
8729
- }
8730
-
8731
8547
  /**
8732
8548
  * The Stripe Webhook policy validates the authenticity of an incoming Stripe webhook.
8733
8549
  *
@@ -8765,16 +8581,6 @@ export declare interface StripeWebhookVerificationInboundPolicyOptions {
8765
8581
  tolerance?: number;
8766
8582
  }
8767
8583
 
8768
- /**
8769
- * @beta
8770
- */
8771
- declare type SubscriptionMeters = {
8772
- [Key in string]: {
8773
- available: number;
8774
- max: number;
8775
- };
8776
- };
8777
-
8778
8584
  declare interface SumoLogicLoggingOptions {
8779
8585
  url: string;
8780
8586
  name?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.66.6",
4
+ "version": "6.66.7",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -1,26 +0,0 @@
1
-
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Zuplo, Inc. All rights reserved.
4
- *
5
- * This software and associated documentation files (the "Software") is intended to be used
6
- * only by Zuplo customers solely to develop and test applications that will be deployed
7
- * to Zuplo hosted services. You and others in your organization may use these files on your
8
- * Development Devices solely for the above stated purpose.
9
- *
10
- * Outside of uses stated above, no license is granted for any other purpose including
11
- * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
- * sublicense, host, and/or sell copies of the Software.
13
- *
14
- * The software may include third party components with separate legal notices or governed by
15
- * other agreements, as described in licenses either embedded in or accompanying the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
- * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
- * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
- * DEALINGS IN THE SOFTWARE.
23
- *--------------------------------------------------------------------------------------------*/
24
-
25
- import{Y as o,a as i}from"./chunk-TCQULLXT.js";var p=(n=>(n.Build="build-data",n.CorsPreflight="cors-preflight",n.DeveloperPortal="developer-portal",n.ZudokuPortal="zudoku-portal",n.DeveloperPortalLegacy="developer-portal-legacy",n.StripePlugin="stripe-plugin",n.EmptyGatewayCatchall="empty-gateway-catchall",n.Ping="ping",n.UnmatchedPath="unmatched-path",n))(p||{});var g=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function l(e){return e.startsWith("__ZUPLO")||e.startsWith("ZUPLO_")?!g.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):e.startsWith("ZUDOKU_")?!e.startsWith("ZUDOKU_PUBLIC_"):!1}i(l,"isRestrictedEnvVariableName");function _(e){return!!e.startsWith("ZUPLO_")}i(_,"isZuploReadableEnvVariableName");var d=new Proxy({},{get(e,t){let r=String(t);switch(r){case"ZUPLO_ENVIRONMENT_TYPE":return o.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return o.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return o.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return o.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return o.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return o.instance.build.BUILD_ID;case"ZUPLO_COMPATIBILITY_DATE":return o.instance.build.COMPATIBILITY_DATE}if(!(l(r)&&!_(r)))return o.instance.runtime[r]}});function f(e,t,r){return`_${a(`${e}_${t}_${r}`)}`}i(f,"getRawOperationDataIdentifierName");function L(e,t,r,s){return`_${a(e.toLowerCase())}_${t.toLowerCase()}_${r.toLowerCase()}_${s.toLowerCase()}`}i(L,"getIdForParameterSchema");function E(e,t,r){return`_${a(e.toLowerCase())}_${t.toLowerCase()}_rb_${a(r.toLowerCase())}`}i(E,"getIdForRequestBodySchema");function C(e,t){return`_${a(e)}_${a(t)}`}i(C,"getIdForRefSchema");function a(e){let t=e.replace(/\[/g,"_LBRACKET_").replace(/\]/g,"_RBRACKET_").replace(/\{/g,"_LCURLY_").replace(/\}/g,"_RCURLY_").replace(/\//g,"_SLASH_").replace(/-/g,"_DASH_").replace(/\./g,"_DOT_").replace(/\+/g,"_PLUS_").replace(/:/g,"_COLON_").replace(/@/g,"_AT_").replace(/\$/g,"_DOLLAR_").replace(/[^a-zA-Z0-9_]/g,"_");return/^[a-zA-Z_]/.test(t)||(t=`_${t}`),t}i(a,"sanitizedIdentifierName");export{p as a,l as b,_ as c,d,f as e,L as f,E as g,C as h,a as i};
26
- //# sourceMappingURL=chunk-2ZIW362G.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@zuplo/runtime/router/interfaces.ts","@zuplo/runtime/environment.ts","@zuplo/runtime/utils/open-api-utils.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;+CA0CO,IAAKA,OACVA,EAAA,MAAQ,aACRA,EAAA,cAAgB,iBAChBA,EAAA,gBAAkB,mBAClBA,EAAA,aAAe,gBACfA,EAAA,sBAAwB,0BACxBA,EAAA,aAAe,gBACfA,EAAA,qBAAuB,yBACvBA,EAAA,KAAO,OACPA,EAAA,cAAgB,iBATNA,OAAA,ICxCZ,IAAMC,EAAmC,CACvC,qCACA,iCACA,kBACA,+BACF,EASO,SAASC,EAA4BC,EAAc,CAExD,OAAI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O,IAAIN,EAAwBF,EAAK,YAAY,CAAC,CAAC,IAAIC,EAAU,YAAY,CAAC,OAAOC,EAAwBM,EAAY,YAAY,CAAC,CAAC,EAC5I,CANgBL,EAAAI,EAAA,6BAeT,SAASE,EAAkBV,EAAqBW,EAAqB,CAC1E,MAAO,IAAIR,EAAwBH,CAAW,CAAC,IAAIG,EAAwBQ,CAAG,CAAC,EACjF,CAFgBP,EAAAM,EAAA,qBAUT,SAASP,EAAwBI,EAAsB,CAE5D,IAAIK,EAAcL,EAEf,QAAQ,MAAO,YAAY,EAC3B,QAAQ,MAAO,YAAY,EAC3B,QAAQ,MAAO,UAAU,EACzB,QAAQ,MAAO,UAAU,EACzB,QAAQ,MAAO,SAAS,EACxB,QAAQ,KAAM,QAAQ,EAEtB,QAAQ,MAAO,OAAO,EACtB,QAAQ,MAAO,QAAQ,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,MAAM,EACpB,QAAQ,MAAO,UAAU,EAEzB,QAAQ,iBAAkB,GAAG,EAGhC,MAAK,aAAa,KAAKK,CAAW,IAChCA,EAAc,IAAIA,CAAW,IAGxBA,CACT,CAzBgBR,EAAAD,EAAA","names":["SystemRouteName","ALLOWED_WRITABLE_ZUPLO_VARIABLES","isRestrictedEnvVariableName","name","__name","isZuploReadableEnvVariableName","environment","target","prop","envName","Environment","getRawOperationDataIdentifierName","oasFileName","path","operation","sanitizedIdentifierName","__name","getIdForParameterSchema","type","name","getIdForRequestBodySchema","contentType","getIdForRefSchema","ref","encodedName"]}