@zuplo/runtime 6.67.21 → 6.67.23
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.
- package/out/esm/index.js +45 -45
- package/out/esm/index.js.map +1 -1
- package/out/types/index.d.ts +27 -30
- package/package.json +1 -1
package/out/types/index.d.ts
CHANGED
|
@@ -5713,6 +5713,10 @@ declare interface Meter {
|
|
|
5713
5713
|
*/
|
|
5714
5714
|
declare type Meter_2 = Partial<OpenMeterEvent> & Meter;
|
|
5715
5715
|
|
|
5716
|
+
declare interface MeterUsageMap {
|
|
5717
|
+
[meter: string]: number;
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5716
5720
|
/**
|
|
5717
5721
|
* @public
|
|
5718
5722
|
*/
|
|
@@ -5875,6 +5879,27 @@ export declare class MonetizationInboundPolicy extends InboundPolicy<Monetizatio
|
|
|
5875
5879
|
static getSubscriptionData(
|
|
5876
5880
|
context: ZuploContext
|
|
5877
5881
|
): MonetizationSubscription | undefined;
|
|
5882
|
+
/**
|
|
5883
|
+
* Set meter increments for this request.
|
|
5884
|
+
*
|
|
5885
|
+
* @param context - The ZuploContext
|
|
5886
|
+
* @param meters - The meters to set.
|
|
5887
|
+
*/
|
|
5888
|
+
static setMeters(context: ZuploContext, meters: MeterUsageMap): void;
|
|
5889
|
+
/**
|
|
5890
|
+
* Add meter increments for this request.
|
|
5891
|
+
*
|
|
5892
|
+
* @param context - The ZuploContext
|
|
5893
|
+
* @param meters - The meters to add.
|
|
5894
|
+
*/
|
|
5895
|
+
static addMeters(context: ZuploContext, meters: MeterUsageMap): void;
|
|
5896
|
+
/**
|
|
5897
|
+
* Get currently configured runtime meters for this request.
|
|
5898
|
+
*
|
|
5899
|
+
* @param context - The ZuploContext
|
|
5900
|
+
* @returns The current meter increments.
|
|
5901
|
+
*/
|
|
5902
|
+
static getMeters(context: ZuploContext): MeterUsageMap;
|
|
5878
5903
|
constructor(options: MonetizationInboundPolicyOptions, policyName: string);
|
|
5879
5904
|
handler(
|
|
5880
5905
|
request: ZuploRequest,
|
|
@@ -5886,9 +5911,7 @@ export declare class MonetizationInboundPolicy extends InboundPolicy<Monetizatio
|
|
|
5886
5911
|
* The options for this policy.
|
|
5887
5912
|
* @public
|
|
5888
5913
|
*/
|
|
5889
|
-
export declare
|
|
5890
|
-
[k: string]: unknown;
|
|
5891
|
-
} & {
|
|
5914
|
+
export declare interface MonetizationInboundPolicyOptions {
|
|
5892
5915
|
/**
|
|
5893
5916
|
* The name of the header with the key.
|
|
5894
5917
|
*/
|
|
@@ -5911,37 +5934,11 @@ export declare type MonetizationInboundPolicyOptions = {
|
|
|
5911
5934
|
*/
|
|
5912
5935
|
[k: string]: number;
|
|
5913
5936
|
};
|
|
5914
|
-
/**
|
|
5915
|
-
* The function that returns dynamic meter usage values for the request.
|
|
5916
|
-
*/
|
|
5917
|
-
metersFunction?: {
|
|
5918
|
-
/**
|
|
5919
|
-
* Specifies the export to load your custom meters function, e.g. `default`, `resolveMeters`.
|
|
5920
|
-
*/
|
|
5921
|
-
export: string;
|
|
5922
|
-
/**
|
|
5923
|
-
* Specifies the module to load your custom meters function, in the format `$import(./modules/my-module)`.
|
|
5924
|
-
*/
|
|
5925
|
-
module: string;
|
|
5926
|
-
};
|
|
5927
|
-
/**
|
|
5928
|
-
* The function that runs after a backend response is available and returns meter usage values for final metering.
|
|
5929
|
-
*/
|
|
5930
|
-
finalMetersFunction?: {
|
|
5931
|
-
/**
|
|
5932
|
-
* Specifies the export to load your custom final function, e.g. `default`, `resolveFinalMeters`.
|
|
5933
|
-
*/
|
|
5934
|
-
export: string;
|
|
5935
|
-
/**
|
|
5936
|
-
* Specifies the module to load your custom final function, in the format `$import(./modules/my-module)`.
|
|
5937
|
-
*/
|
|
5938
|
-
module: string;
|
|
5939
|
-
};
|
|
5940
5937
|
/**
|
|
5941
5938
|
* A list of successful status codes and ranges "200-299, 304" that should trigger a metering call.
|
|
5942
5939
|
*/
|
|
5943
5940
|
meterOnStatusCodes?: string | number[];
|
|
5944
|
-
}
|
|
5941
|
+
}
|
|
5945
5942
|
|
|
5946
5943
|
/**
|
|
5947
5944
|
* Subscription details returned by Zuplo monetization services.
|