@zuplo/runtime 5.1817.0 → 5.1818.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.
Files changed (2) hide show
  1. package/index.d.ts +87 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2417,11 +2417,39 @@ export declare class MemoryZoneReadThroughCache<T = unknown> {
2417
2417
 
2418
2418
  /* Excluded from this release type: MeteringPlugin */
2419
2419
 
2420
- /* Excluded from this release type: MeteringRegions */
2420
+ /**
2421
+ * @beta
2422
+ */
2423
+ declare type MeteringRegions = "us-central1" | "europe-west4";
2421
2424
 
2422
- /* Excluded from this release type: MeteringSubscription */
2425
+ /**
2426
+ * @beta
2427
+ */
2428
+ declare interface MeteringSubscription {
2429
+ status: MeteringSubscriptionStatus;
2430
+ type: "credits" | "periodic";
2431
+ region: MeteringRegions;
2432
+ renewalStrategy: "hourly" | "monthly" | "yearly";
2433
+ customerKey: string;
2434
+ /**
2435
+ * Array of Stripe product ids, they start with "prod_"
2436
+ */
2437
+ planExternalIds: string[];
2438
+ /**
2439
+ * Stripe subscription id, starts with "sub_"
2440
+ */
2441
+ subscriptionExternalId?: string;
2442
+ /**
2443
+ * Stripe customer id, starts with "cus_"
2444
+ */
2445
+ customerExternalId?: string;
2446
+ metadata?: Record<string, string>;
2447
+ }
2423
2448
 
2424
- /* Excluded from this release type: MeteringSubscriptionStatus */
2449
+ /**
2450
+ * @beta
2451
+ */
2452
+ declare type MeteringSubscriptionStatus = "active" | "inactive" | "incomplete" | "incomplete-expired" | "trialing" | "past-due" | "canceled" | "unpaid";
2425
2453
 
2426
2454
  /* Excluded from this release type: MetricsData */
2427
2455
 
@@ -2565,7 +2593,24 @@ declare type MonetizationPolicyMeters = {
2565
2593
  [Key in string]: number;
2566
2594
  };
2567
2595
 
2568
- /* Excluded from this release type: MonetizationSubscription */
2596
+ /**
2597
+ * @beta
2598
+ */
2599
+ export declare interface MonetizationSubscription extends MeteringSubscription {
2600
+ /**
2601
+ * Metering subscription id, starts with "sbsc_"
2602
+ */
2603
+ id: string;
2604
+ createdOn: string;
2605
+ updatedOn: string;
2606
+ quotaResetAnchor?: Date;
2607
+ meters: {
2608
+ [Key in string]: {
2609
+ consumed: number;
2610
+ max: number;
2611
+ };
2612
+ };
2613
+ }
2569
2614
 
2570
2615
  declare interface NotFoundOptions {
2571
2616
  routesMatchedByPathOnly: RouteConfiguration[];
@@ -3659,9 +3704,45 @@ export declare interface SleepInboundPolicyOptions {
3659
3704
 
3660
3705
  /* Excluded from this release type: StandardEnv */
3661
3706
 
3662
- /* Excluded from this release type: StripeMeteringPlugin */
3707
+ /**
3708
+ * Adds stripe metering routes and configuration
3709
+ * @beta
3710
+ */
3711
+ export declare class StripeMeteringPlugin extends MeteringPlugin {
3712
+ private options;
3713
+ constructor(options: StripeMeteringPluginOptions);
3714
+ registerRoutes(router: Router, gateway: Gateway): void;
3715
+ }
3663
3716
 
3664
- /* Excluded from this release type: StripeMeteringPluginOptions */
3717
+ /**
3718
+ * @beta
3719
+ */
3720
+ export declare interface StripeMeteringPluginOptions {
3721
+ /**
3722
+ * Stripe Webhook settings
3723
+ */
3724
+ webhooks: StripeWebhookVerificationInboundPolicyOptions & {
3725
+ /**
3726
+ * The URL path where the webhook is registered.
3727
+ * Defaults to `/_zuplo/stripe-webhook`
3728
+ */
3729
+ routePath?: string;
3730
+ };
3731
+ /**
3732
+ * The ID of the Zuplo metering bucket.
3733
+ */
3734
+ meteringBucketId?: string;
3735
+ /**
3736
+ * The region of the Zuplo metering bucket.
3737
+ */
3738
+ meteringBucketRegion?: string;
3739
+ apiKeyBucketName?: string;
3740
+ /**
3741
+ * The Stripe account's secret key
3742
+ */
3743
+ stripeSecretKey: string;
3744
+ /* Excluded from this release type: __testMode */
3745
+ }
3665
3746
 
3666
3747
  /**
3667
3748
  * The Stripe Webhook policy validates the authenticity of an incoming Stripe webhook.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
- "version": "5.1817.0",
3
+ "version": "5.1818.0",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "exports": {