@polar-sh/sdk 0.33.2 → 0.34.1
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/README.md +9 -8
- package/bin/mcp-server.js +104 -94
- package/bin/mcp-server.js.map +17 -17
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/security.d.ts +2 -2
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/components/benefitgrant.d.ts +4 -4
- package/dist/commonjs/models/components/benefitgrant.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitgrant.js +12 -12
- package/dist/commonjs/models/components/benefitgrant.js.map +1 -1
- package/dist/commonjs/models/components/benefitgrantwebhook.d.ts +8 -8
- package/dist/commonjs/models/components/benefitgrantwebhook.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitgrantwebhook.js +24 -24
- package/dist/commonjs/models/components/benefitgrantwebhook.js.map +1 -1
- package/dist/commonjs/models/components/checkout.d.ts +11 -6
- package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkout.js +16 -12
- package/dist/commonjs/models/components/checkout.js.map +1 -1
- package/dist/commonjs/models/components/checkoutcreate.d.ts +2 -2
- package/dist/commonjs/models/components/checkoutcreate.js +4 -4
- package/dist/commonjs/models/components/checkoutlink.d.ts +4 -4
- package/dist/commonjs/models/components/checkoutlink.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutlink.js +8 -8
- package/dist/commonjs/models/components/checkoutlink.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.d.ts +6 -6
- package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.js +12 -12
- package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +6 -6
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js +12 -12
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/commonjs/models/components/customerbenefitgrantupdate.d.ts +10 -10
- package/dist/commonjs/models/components/customerbenefitgrantupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerbenefitgrantupdate.js +8 -8
- package/dist/commonjs/models/components/customerbenefitgrantupdate.js.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.d.ts +2 -2
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.js +4 -4
- package/dist/commonjs/models/components/customerstatebenefitgrant.d.ts +34 -4
- package/dist/commonjs/models/components/customerstatebenefitgrant.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerstatebenefitgrant.js +40 -13
- package/dist/commonjs/models/components/customerstatebenefitgrant.js.map +1 -1
- package/dist/commonjs/models/components/discount.d.ts +2 -2
- package/dist/commonjs/models/components/discount.d.ts.map +1 -1
- package/dist/commonjs/models/components/discount.js +4 -4
- package/dist/commonjs/models/components/discount.js.map +1 -1
- package/dist/commonjs/models/components/discountcreate.d.ts +2 -2
- package/dist/commonjs/models/components/discountcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/discountcreate.js +6 -6
- package/dist/commonjs/models/components/discountcreate.js.map +1 -1
- package/dist/commonjs/models/components/filter.d.ts +4 -4
- package/dist/commonjs/models/components/filter.d.ts.map +1 -1
- package/dist/commonjs/models/components/filter.js +4 -4
- package/dist/commonjs/models/components/filter.js.map +1 -1
- package/dist/commonjs/models/components/legacyrecurringproductprice.d.ts +8 -8
- package/dist/commonjs/models/components/legacyrecurringproductprice.d.ts.map +1 -1
- package/dist/commonjs/models/components/legacyrecurringproductprice.js +4 -4
- package/dist/commonjs/models/components/legacyrecurringproductprice.js.map +1 -1
- package/dist/commonjs/models/components/listresourcefileread.d.ts +12 -12
- package/dist/commonjs/models/components/listresourcefileread.d.ts.map +1 -1
- package/dist/commonjs/models/components/listresourcefileread.js +12 -12
- package/dist/commonjs/models/components/listresourcefileread.js.map +1 -1
- package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts +4 -4
- package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts.map +1 -1
- package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js +4 -4
- package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js.map +1 -1
- package/dist/commonjs/models/components/meter.d.ts +24 -24
- package/dist/commonjs/models/components/meter.d.ts.map +1 -1
- package/dist/commonjs/models/components/meter.js +16 -16
- package/dist/commonjs/models/components/meter.js.map +1 -1
- package/dist/commonjs/models/components/metercreate.d.ts +24 -24
- package/dist/commonjs/models/components/metercreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/metercreate.js +16 -16
- package/dist/commonjs/models/components/metercreate.js.map +1 -1
- package/dist/commonjs/models/components/meterupdate.d.ts +24 -24
- package/dist/commonjs/models/components/meterupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/meterupdate.js +16 -16
- package/dist/commonjs/models/components/meterupdate.js.map +1 -1
- package/dist/commonjs/models/components/order.d.ts +4 -4
- package/dist/commonjs/models/components/order.d.ts.map +1 -1
- package/dist/commonjs/models/components/order.js +8 -8
- package/dist/commonjs/models/components/order.js.map +1 -1
- package/dist/commonjs/models/components/payment.d.ts +2 -2
- package/dist/commonjs/models/components/payment.d.ts.map +1 -1
- package/dist/commonjs/models/components/payment.js +2 -2
- package/dist/commonjs/models/components/payment.js.map +1 -1
- package/dist/commonjs/models/components/productcreate.d.ts +4 -4
- package/dist/commonjs/models/components/productcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreate.js +8 -8
- package/dist/commonjs/models/components/productcreate.js.map +1 -1
- package/dist/commonjs/models/components/productprice.d.ts +12 -12
- package/dist/commonjs/models/components/productprice.d.ts.map +1 -1
- package/dist/commonjs/models/components/productprice.js +8 -8
- package/dist/commonjs/models/components/productprice.js.map +1 -1
- package/dist/commonjs/models/components/productupdate.d.ts +4 -4
- package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/productupdate.js +12 -12
- package/dist/commonjs/models/components/productupdate.js.map +1 -1
- package/dist/commonjs/models/components/subscription.d.ts +4 -4
- package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscription.js +8 -8
- package/dist/commonjs/models/components/subscription.js.map +1 -1
- package/dist/commonjs/models/components/subscriptionupdate.d.ts +2 -2
- package/dist/commonjs/models/components/subscriptionupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscriptionupdate.js +2 -2
- package/dist/commonjs/models/components/subscriptionupdate.js.map +1 -1
- package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.d.ts +2 -2
- package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.d.ts.map +1 -1
- package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.js +2 -2
- package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.js.map +1 -1
- package/dist/commonjs/models/operations/filesupdate.d.ts +6 -6
- package/dist/commonjs/models/operations/filesupdate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/filesupdate.js +6 -6
- package/dist/commonjs/models/operations/filesupdate.js.map +1 -1
- package/dist/commonjs/models/operations/filesuploaded.d.ts +6 -6
- package/dist/commonjs/models/operations/filesuploaded.d.ts.map +1 -1
- package/dist/commonjs/models/operations/filesuploaded.js +6 -6
- package/dist/commonjs/models/operations/filesuploaded.js.map +1 -1
- package/dist/commonjs/models/operations/oauth2authorize.d.ts +6 -6
- package/dist/commonjs/models/operations/oauth2authorize.d.ts.map +1 -1
- package/dist/commonjs/models/operations/oauth2authorize.js +4 -4
- package/dist/commonjs/models/operations/oauth2authorize.js.map +1 -1
- package/dist/commonjs/models/operations/oauth2requesttoken.d.ts +2 -2
- package/dist/commonjs/models/operations/oauth2requesttoken.d.ts.map +1 -1
- package/dist/commonjs/models/operations/oauth2requesttoken.js +2 -2
- package/dist/commonjs/models/operations/oauth2requesttoken.js.map +1 -1
- package/dist/commonjs/models/operations/oauth2userinfo.d.ts +2 -2
- package/dist/commonjs/models/operations/oauth2userinfo.d.ts.map +1 -1
- package/dist/commonjs/models/operations/oauth2userinfo.js +2 -2
- package/dist/commonjs/models/operations/oauth2userinfo.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/security.d.ts +2 -2
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/components/benefitgrant.d.ts +4 -4
- package/dist/esm/models/components/benefitgrant.d.ts.map +1 -1
- package/dist/esm/models/components/benefitgrant.js +12 -12
- package/dist/esm/models/components/benefitgrant.js.map +1 -1
- package/dist/esm/models/components/benefitgrantwebhook.d.ts +8 -8
- package/dist/esm/models/components/benefitgrantwebhook.d.ts.map +1 -1
- package/dist/esm/models/components/benefitgrantwebhook.js +24 -24
- package/dist/esm/models/components/benefitgrantwebhook.js.map +1 -1
- package/dist/esm/models/components/checkout.d.ts +11 -6
- package/dist/esm/models/components/checkout.d.ts.map +1 -1
- package/dist/esm/models/components/checkout.js +16 -12
- package/dist/esm/models/components/checkout.js.map +1 -1
- package/dist/esm/models/components/checkoutcreate.d.ts +2 -2
- package/dist/esm/models/components/checkoutcreate.js +4 -4
- package/dist/esm/models/components/checkoutlink.d.ts +4 -4
- package/dist/esm/models/components/checkoutlink.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutlink.js +8 -8
- package/dist/esm/models/components/checkoutlink.js.map +1 -1
- package/dist/esm/models/components/checkoutpublic.d.ts +6 -6
- package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublic.js +12 -12
- package/dist/esm/models/components/checkoutpublic.js.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +6 -6
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.js +12 -12
- package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/esm/models/components/customerbenefitgrantupdate.d.ts +10 -10
- package/dist/esm/models/components/customerbenefitgrantupdate.d.ts.map +1 -1
- package/dist/esm/models/components/customerbenefitgrantupdate.js +8 -8
- package/dist/esm/models/components/customerbenefitgrantupdate.js.map +1 -1
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.d.ts +2 -2
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.js +4 -4
- package/dist/esm/models/components/customerstatebenefitgrant.d.ts +34 -4
- package/dist/esm/models/components/customerstatebenefitgrant.d.ts.map +1 -1
- package/dist/esm/models/components/customerstatebenefitgrant.js +37 -12
- package/dist/esm/models/components/customerstatebenefitgrant.js.map +1 -1
- package/dist/esm/models/components/discount.d.ts +2 -2
- package/dist/esm/models/components/discount.d.ts.map +1 -1
- package/dist/esm/models/components/discount.js +4 -4
- package/dist/esm/models/components/discount.js.map +1 -1
- package/dist/esm/models/components/discountcreate.d.ts +2 -2
- package/dist/esm/models/components/discountcreate.d.ts.map +1 -1
- package/dist/esm/models/components/discountcreate.js +6 -6
- package/dist/esm/models/components/discountcreate.js.map +1 -1
- package/dist/esm/models/components/filter.d.ts +4 -4
- package/dist/esm/models/components/filter.d.ts.map +1 -1
- package/dist/esm/models/components/filter.js +4 -4
- package/dist/esm/models/components/filter.js.map +1 -1
- package/dist/esm/models/components/legacyrecurringproductprice.d.ts +8 -8
- package/dist/esm/models/components/legacyrecurringproductprice.d.ts.map +1 -1
- package/dist/esm/models/components/legacyrecurringproductprice.js +4 -4
- package/dist/esm/models/components/legacyrecurringproductprice.js.map +1 -1
- package/dist/esm/models/components/listresourcefileread.d.ts +12 -12
- package/dist/esm/models/components/listresourcefileread.d.ts.map +1 -1
- package/dist/esm/models/components/listresourcefileread.js +12 -12
- package/dist/esm/models/components/listresourcefileread.js.map +1 -1
- package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts +4 -4
- package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts.map +1 -1
- package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js +4 -4
- package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js.map +1 -1
- package/dist/esm/models/components/meter.d.ts +24 -24
- package/dist/esm/models/components/meter.d.ts.map +1 -1
- package/dist/esm/models/components/meter.js +16 -16
- package/dist/esm/models/components/meter.js.map +1 -1
- package/dist/esm/models/components/metercreate.d.ts +24 -24
- package/dist/esm/models/components/metercreate.d.ts.map +1 -1
- package/dist/esm/models/components/metercreate.js +16 -16
- package/dist/esm/models/components/metercreate.js.map +1 -1
- package/dist/esm/models/components/meterupdate.d.ts +24 -24
- package/dist/esm/models/components/meterupdate.d.ts.map +1 -1
- package/dist/esm/models/components/meterupdate.js +16 -16
- package/dist/esm/models/components/meterupdate.js.map +1 -1
- package/dist/esm/models/components/order.d.ts +4 -4
- package/dist/esm/models/components/order.d.ts.map +1 -1
- package/dist/esm/models/components/order.js +8 -8
- package/dist/esm/models/components/order.js.map +1 -1
- package/dist/esm/models/components/payment.d.ts +2 -2
- package/dist/esm/models/components/payment.d.ts.map +1 -1
- package/dist/esm/models/components/payment.js +2 -2
- package/dist/esm/models/components/payment.js.map +1 -1
- package/dist/esm/models/components/productcreate.d.ts +4 -4
- package/dist/esm/models/components/productcreate.d.ts.map +1 -1
- package/dist/esm/models/components/productcreate.js +8 -8
- package/dist/esm/models/components/productcreate.js.map +1 -1
- package/dist/esm/models/components/productprice.d.ts +12 -12
- package/dist/esm/models/components/productprice.d.ts.map +1 -1
- package/dist/esm/models/components/productprice.js +8 -8
- package/dist/esm/models/components/productprice.js.map +1 -1
- package/dist/esm/models/components/productupdate.d.ts +4 -4
- package/dist/esm/models/components/productupdate.d.ts.map +1 -1
- package/dist/esm/models/components/productupdate.js +12 -12
- package/dist/esm/models/components/productupdate.js.map +1 -1
- package/dist/esm/models/components/subscription.d.ts +4 -4
- package/dist/esm/models/components/subscription.d.ts.map +1 -1
- package/dist/esm/models/components/subscription.js +8 -8
- package/dist/esm/models/components/subscription.js.map +1 -1
- package/dist/esm/models/components/subscriptionupdate.d.ts +2 -2
- package/dist/esm/models/components/subscriptionupdate.d.ts.map +1 -1
- package/dist/esm/models/components/subscriptionupdate.js +2 -2
- package/dist/esm/models/components/subscriptionupdate.js.map +1 -1
- package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.d.ts +2 -2
- package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.d.ts.map +1 -1
- package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.js +2 -2
- package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.js.map +1 -1
- package/dist/esm/models/operations/filesupdate.d.ts +6 -6
- package/dist/esm/models/operations/filesupdate.d.ts.map +1 -1
- package/dist/esm/models/operations/filesupdate.js +6 -6
- package/dist/esm/models/operations/filesupdate.js.map +1 -1
- package/dist/esm/models/operations/filesuploaded.d.ts +6 -6
- package/dist/esm/models/operations/filesuploaded.d.ts.map +1 -1
- package/dist/esm/models/operations/filesuploaded.js +6 -6
- package/dist/esm/models/operations/filesuploaded.js.map +1 -1
- package/dist/esm/models/operations/oauth2authorize.d.ts +6 -6
- package/dist/esm/models/operations/oauth2authorize.d.ts.map +1 -1
- package/dist/esm/models/operations/oauth2authorize.js +4 -4
- package/dist/esm/models/operations/oauth2authorize.js.map +1 -1
- package/dist/esm/models/operations/oauth2requesttoken.d.ts +2 -2
- package/dist/esm/models/operations/oauth2requesttoken.d.ts.map +1 -1
- package/dist/esm/models/operations/oauth2requesttoken.js +2 -2
- package/dist/esm/models/operations/oauth2requesttoken.js.map +1 -1
- package/dist/esm/models/operations/oauth2userinfo.d.ts +2 -2
- package/dist/esm/models/operations/oauth2userinfo.d.ts.map +1 -1
- package/dist/esm/models/operations/oauth2userinfo.js +2 -2
- package/dist/esm/models/operations/oauth2userinfo.js.map +1 -1
- package/docs/sdks/customersessions/README.md +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/benefitgrant.ts +24 -24
- package/src/models/components/benefitgrantwebhook.ts +48 -48
- package/src/models/components/checkout.ts +34 -25
- package/src/models/components/checkoutcreate.ts +6 -6
- package/src/models/components/checkoutlink.ts +16 -16
- package/src/models/components/checkoutpublic.ts +25 -25
- package/src/models/components/checkoutpublicconfirmed.ts +25 -25
- package/src/models/components/customerbenefitgrantupdate.ts +29 -29
- package/src/models/components/customersessioncustomerexternalidcreate.ts +6 -6
- package/src/models/components/customerstatebenefitgrant.ts +85 -24
- package/src/models/components/discount.ts +8 -8
- package/src/models/components/discountcreate.ts +12 -12
- package/src/models/components/filter.ts +8 -8
- package/src/models/components/legacyrecurringproductprice.ts +12 -12
- package/src/models/components/listresourcefileread.ts +26 -26
- package/src/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.ts +9 -9
- package/src/models/components/meter.ts +42 -42
- package/src/models/components/metercreate.ts +44 -44
- package/src/models/components/meterupdate.ts +40 -40
- package/src/models/components/order.ts +16 -16
- package/src/models/components/payment.ts +4 -4
- package/src/models/components/productcreate.ts +16 -16
- package/src/models/components/productprice.ts +22 -22
- package/src/models/components/productupdate.ts +24 -24
- package/src/models/components/subscription.ts +16 -16
- package/src/models/components/subscriptionupdate.ts +4 -4
- package/src/models/operations/customerportalcustomersaddpaymentmethod.ts +6 -6
- package/src/models/operations/filesupdate.ts +14 -14
- package/src/models/operations/filesuploaded.ts +14 -14
- package/src/models/operations/oauth2authorize.ts +12 -12
- package/src/models/operations/oauth2requesttoken.ts +6 -6
- package/src/models/operations/oauth2userinfo.ts +6 -6
|
@@ -32,11 +32,11 @@ export type MeterMetadata = string | number | number | boolean;
|
|
|
32
32
|
* The aggregation to apply on the filtered events to calculate the meter.
|
|
33
33
|
*/
|
|
34
34
|
export type MeterAggregation =
|
|
35
|
+
| (CountAggregation & { func: "count" })
|
|
35
36
|
| (PropertyAggregation & { func: "avg" })
|
|
36
|
-
| (PropertyAggregation & { func: "
|
|
37
|
-
| (PropertyAggregation & { func: "
|
|
38
|
-
| (PropertyAggregation & { func: "
|
|
39
|
-
| (CountAggregation & { func: "count" });
|
|
37
|
+
| (PropertyAggregation & { func: "max" })
|
|
38
|
+
| (PropertyAggregation & { func: "min" })
|
|
39
|
+
| (PropertyAggregation & { func: "sum" });
|
|
40
40
|
|
|
41
41
|
export type Meter = {
|
|
42
42
|
metadata: { [k: string]: string | number | number | boolean };
|
|
@@ -61,11 +61,11 @@ export type Meter = {
|
|
|
61
61
|
* The aggregation to apply on the filtered events to calculate the meter.
|
|
62
62
|
*/
|
|
63
63
|
aggregation:
|
|
64
|
+
| (CountAggregation & { func: "count" })
|
|
64
65
|
| (PropertyAggregation & { func: "avg" })
|
|
65
|
-
| (PropertyAggregation & { func: "
|
|
66
|
-
| (PropertyAggregation & { func: "
|
|
67
|
-
| (PropertyAggregation & { func: "
|
|
68
|
-
| (CountAggregation & { func: "count" });
|
|
66
|
+
| (PropertyAggregation & { func: "max" })
|
|
67
|
+
| (PropertyAggregation & { func: "min" })
|
|
68
|
+
| (PropertyAggregation & { func: "sum" });
|
|
69
69
|
/**
|
|
70
70
|
* The ID of the organization owning the meter.
|
|
71
71
|
*/
|
|
@@ -122,30 +122,30 @@ export const MeterAggregation$inboundSchema: z.ZodType<
|
|
|
122
122
|
z.ZodTypeDef,
|
|
123
123
|
unknown
|
|
124
124
|
> = z.union([
|
|
125
|
-
|
|
126
|
-
z.object({ func: z.literal("
|
|
125
|
+
CountAggregation$inboundSchema.and(
|
|
126
|
+
z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
|
|
127
127
|
),
|
|
128
128
|
PropertyAggregation$inboundSchema.and(
|
|
129
129
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
130
130
|
),
|
|
131
131
|
PropertyAggregation$inboundSchema.and(
|
|
132
|
-
z.object({ func: z.literal("
|
|
132
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
133
133
|
),
|
|
134
134
|
PropertyAggregation$inboundSchema.and(
|
|
135
|
-
z.object({ func: z.literal("
|
|
135
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
136
136
|
),
|
|
137
|
-
|
|
138
|
-
z.object({ func: z.literal("
|
|
137
|
+
PropertyAggregation$inboundSchema.and(
|
|
138
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
139
139
|
),
|
|
140
140
|
]);
|
|
141
141
|
|
|
142
142
|
/** @internal */
|
|
143
143
|
export type MeterAggregation$Outbound =
|
|
144
|
+
| (CountAggregation$Outbound & { func: "count" })
|
|
144
145
|
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
145
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
146
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
147
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
148
|
-
| (CountAggregation$Outbound & { func: "count" });
|
|
146
|
+
| (PropertyAggregation$Outbound & { func: "max" })
|
|
147
|
+
| (PropertyAggregation$Outbound & { func: "min" })
|
|
148
|
+
| (PropertyAggregation$Outbound & { func: "sum" });
|
|
149
149
|
|
|
150
150
|
/** @internal */
|
|
151
151
|
export const MeterAggregation$outboundSchema: z.ZodType<
|
|
@@ -153,20 +153,20 @@ export const MeterAggregation$outboundSchema: z.ZodType<
|
|
|
153
153
|
z.ZodTypeDef,
|
|
154
154
|
MeterAggregation
|
|
155
155
|
> = z.union([
|
|
156
|
-
|
|
157
|
-
z.object({ func: z.literal("
|
|
156
|
+
CountAggregation$outboundSchema.and(
|
|
157
|
+
z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
|
|
158
158
|
),
|
|
159
159
|
PropertyAggregation$outboundSchema.and(
|
|
160
160
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
161
161
|
),
|
|
162
162
|
PropertyAggregation$outboundSchema.and(
|
|
163
|
-
z.object({ func: z.literal("
|
|
163
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
164
164
|
),
|
|
165
165
|
PropertyAggregation$outboundSchema.and(
|
|
166
|
-
z.object({ func: z.literal("
|
|
166
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
167
167
|
),
|
|
168
|
-
|
|
169
|
-
z.object({ func: z.literal("
|
|
168
|
+
PropertyAggregation$outboundSchema.and(
|
|
169
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
170
170
|
),
|
|
171
171
|
]);
|
|
172
172
|
|
|
@@ -217,8 +217,8 @@ export const Meter$inboundSchema: z.ZodType<Meter, z.ZodTypeDef, unknown> = z
|
|
|
217
217
|
name: z.string(),
|
|
218
218
|
filter: Filter$inboundSchema,
|
|
219
219
|
aggregation: z.union([
|
|
220
|
-
|
|
221
|
-
z.object({ func: z.literal("
|
|
220
|
+
CountAggregation$inboundSchema.and(
|
|
221
|
+
z.object({ func: z.literal("count") }).transform((v) => ({
|
|
222
222
|
func: v.func,
|
|
223
223
|
})),
|
|
224
224
|
),
|
|
@@ -228,17 +228,17 @@ export const Meter$inboundSchema: z.ZodType<Meter, z.ZodTypeDef, unknown> = z
|
|
|
228
228
|
})),
|
|
229
229
|
),
|
|
230
230
|
PropertyAggregation$inboundSchema.and(
|
|
231
|
-
z.object({ func: z.literal("
|
|
231
|
+
z.object({ func: z.literal("max") }).transform((v) => ({
|
|
232
232
|
func: v.func,
|
|
233
233
|
})),
|
|
234
234
|
),
|
|
235
235
|
PropertyAggregation$inboundSchema.and(
|
|
236
|
-
z.object({ func: z.literal("
|
|
236
|
+
z.object({ func: z.literal("min") }).transform((v) => ({
|
|
237
237
|
func: v.func,
|
|
238
238
|
})),
|
|
239
239
|
),
|
|
240
|
-
|
|
241
|
-
z.object({ func: z.literal("
|
|
240
|
+
PropertyAggregation$inboundSchema.and(
|
|
241
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({
|
|
242
242
|
func: v.func,
|
|
243
243
|
})),
|
|
244
244
|
),
|
|
@@ -261,11 +261,11 @@ export type Meter$Outbound = {
|
|
|
261
261
|
name: string;
|
|
262
262
|
filter: Filter$Outbound;
|
|
263
263
|
aggregation:
|
|
264
|
+
| (CountAggregation$Outbound & { func: "count" })
|
|
264
265
|
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
265
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
266
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
267
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
268
|
-
| (CountAggregation$Outbound & { func: "count" });
|
|
266
|
+
| (PropertyAggregation$Outbound & { func: "max" })
|
|
267
|
+
| (PropertyAggregation$Outbound & { func: "min" })
|
|
268
|
+
| (PropertyAggregation$Outbound & { func: "sum" });
|
|
269
269
|
organization_id: string;
|
|
270
270
|
};
|
|
271
271
|
|
|
@@ -284,22 +284,22 @@ export const Meter$outboundSchema: z.ZodType<
|
|
|
284
284
|
name: z.string(),
|
|
285
285
|
filter: Filter$outboundSchema,
|
|
286
286
|
aggregation: z.union([
|
|
287
|
-
|
|
288
|
-
z.object({ func: z.literal("
|
|
287
|
+
CountAggregation$outboundSchema.and(
|
|
288
|
+
z.object({ func: z.literal("count") }).transform((v) => ({
|
|
289
|
+
func: v.func,
|
|
290
|
+
})),
|
|
289
291
|
),
|
|
290
292
|
PropertyAggregation$outboundSchema.and(
|
|
291
293
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
292
294
|
),
|
|
293
295
|
PropertyAggregation$outboundSchema.and(
|
|
294
|
-
z.object({ func: z.literal("
|
|
296
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
295
297
|
),
|
|
296
298
|
PropertyAggregation$outboundSchema.and(
|
|
297
|
-
z.object({ func: z.literal("
|
|
299
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
298
300
|
),
|
|
299
|
-
|
|
300
|
-
z.object({ func: z.literal("
|
|
301
|
-
func: v.func,
|
|
302
|
-
})),
|
|
301
|
+
PropertyAggregation$outboundSchema.and(
|
|
302
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
303
303
|
),
|
|
304
304
|
]),
|
|
305
305
|
organizationId: z.string(),
|
|
@@ -32,11 +32,11 @@ export type MeterCreateMetadata = string | number | number | boolean;
|
|
|
32
32
|
* The aggregation to apply on the filtered events to calculate the meter.
|
|
33
33
|
*/
|
|
34
34
|
export type MeterCreateAggregation =
|
|
35
|
+
| (CountAggregation & { func: "count" })
|
|
35
36
|
| (PropertyAggregation & { func: "avg" })
|
|
36
|
-
| (PropertyAggregation & { func: "
|
|
37
|
-
| (PropertyAggregation & { func: "
|
|
38
|
-
| (PropertyAggregation & { func: "
|
|
39
|
-
| (CountAggregation & { func: "count" });
|
|
37
|
+
| (PropertyAggregation & { func: "max" })
|
|
38
|
+
| (PropertyAggregation & { func: "min" })
|
|
39
|
+
| (PropertyAggregation & { func: "sum" });
|
|
40
40
|
|
|
41
41
|
export type MeterCreate = {
|
|
42
42
|
/**
|
|
@@ -64,11 +64,11 @@ export type MeterCreate = {
|
|
|
64
64
|
* The aggregation to apply on the filtered events to calculate the meter.
|
|
65
65
|
*/
|
|
66
66
|
aggregation:
|
|
67
|
+
| (CountAggregation & { func: "count" })
|
|
67
68
|
| (PropertyAggregation & { func: "avg" })
|
|
68
|
-
| (PropertyAggregation & { func: "
|
|
69
|
-
| (PropertyAggregation & { func: "
|
|
70
|
-
| (PropertyAggregation & { func: "
|
|
71
|
-
| (CountAggregation & { func: "count" });
|
|
69
|
+
| (PropertyAggregation & { func: "max" })
|
|
70
|
+
| (PropertyAggregation & { func: "min" })
|
|
71
|
+
| (PropertyAggregation & { func: "sum" });
|
|
72
72
|
/**
|
|
73
73
|
* The ID of the organization owning the meter. **Required unless you use an organization token.**
|
|
74
74
|
*/
|
|
@@ -129,30 +129,30 @@ export const MeterCreateAggregation$inboundSchema: z.ZodType<
|
|
|
129
129
|
z.ZodTypeDef,
|
|
130
130
|
unknown
|
|
131
131
|
> = z.union([
|
|
132
|
-
|
|
133
|
-
z.object({ func: z.literal("
|
|
132
|
+
CountAggregation$inboundSchema.and(
|
|
133
|
+
z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
|
|
134
134
|
),
|
|
135
135
|
PropertyAggregation$inboundSchema.and(
|
|
136
136
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
137
137
|
),
|
|
138
138
|
PropertyAggregation$inboundSchema.and(
|
|
139
|
-
z.object({ func: z.literal("
|
|
139
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
140
140
|
),
|
|
141
141
|
PropertyAggregation$inboundSchema.and(
|
|
142
|
-
z.object({ func: z.literal("
|
|
142
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
143
143
|
),
|
|
144
|
-
|
|
145
|
-
z.object({ func: z.literal("
|
|
144
|
+
PropertyAggregation$inboundSchema.and(
|
|
145
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
146
146
|
),
|
|
147
147
|
]);
|
|
148
148
|
|
|
149
149
|
/** @internal */
|
|
150
150
|
export type MeterCreateAggregation$Outbound =
|
|
151
|
+
| (CountAggregation$Outbound & { func: "count" })
|
|
151
152
|
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
152
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
153
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
154
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
155
|
-
| (CountAggregation$Outbound & { func: "count" });
|
|
153
|
+
| (PropertyAggregation$Outbound & { func: "max" })
|
|
154
|
+
| (PropertyAggregation$Outbound & { func: "min" })
|
|
155
|
+
| (PropertyAggregation$Outbound & { func: "sum" });
|
|
156
156
|
|
|
157
157
|
/** @internal */
|
|
158
158
|
export const MeterCreateAggregation$outboundSchema: z.ZodType<
|
|
@@ -160,20 +160,20 @@ export const MeterCreateAggregation$outboundSchema: z.ZodType<
|
|
|
160
160
|
z.ZodTypeDef,
|
|
161
161
|
MeterCreateAggregation
|
|
162
162
|
> = z.union([
|
|
163
|
-
|
|
164
|
-
z.object({ func: z.literal("
|
|
163
|
+
CountAggregation$outboundSchema.and(
|
|
164
|
+
z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
|
|
165
165
|
),
|
|
166
166
|
PropertyAggregation$outboundSchema.and(
|
|
167
167
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
168
168
|
),
|
|
169
169
|
PropertyAggregation$outboundSchema.and(
|
|
170
|
-
z.object({ func: z.literal("
|
|
170
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
171
171
|
),
|
|
172
172
|
PropertyAggregation$outboundSchema.and(
|
|
173
|
-
z.object({ func: z.literal("
|
|
173
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
174
174
|
),
|
|
175
|
-
|
|
176
|
-
z.object({ func: z.literal("
|
|
175
|
+
PropertyAggregation$outboundSchema.and(
|
|
176
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
177
177
|
),
|
|
178
178
|
]);
|
|
179
179
|
|
|
@@ -220,22 +220,22 @@ export const MeterCreate$inboundSchema: z.ZodType<
|
|
|
220
220
|
name: z.string(),
|
|
221
221
|
filter: Filter$inboundSchema,
|
|
222
222
|
aggregation: z.union([
|
|
223
|
-
|
|
224
|
-
z.object({ func: z.literal("
|
|
223
|
+
CountAggregation$inboundSchema.and(
|
|
224
|
+
z.object({ func: z.literal("count") }).transform((v) => ({
|
|
225
|
+
func: v.func,
|
|
226
|
+
})),
|
|
225
227
|
),
|
|
226
228
|
PropertyAggregation$inboundSchema.and(
|
|
227
229
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
228
230
|
),
|
|
229
231
|
PropertyAggregation$inboundSchema.and(
|
|
230
|
-
z.object({ func: z.literal("
|
|
232
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
231
233
|
),
|
|
232
234
|
PropertyAggregation$inboundSchema.and(
|
|
233
|
-
z.object({ func: z.literal("
|
|
235
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
234
236
|
),
|
|
235
|
-
|
|
236
|
-
z.object({ func: z.literal("
|
|
237
|
-
func: v.func,
|
|
238
|
-
})),
|
|
237
|
+
PropertyAggregation$inboundSchema.and(
|
|
238
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
239
239
|
),
|
|
240
240
|
]),
|
|
241
241
|
organization_id: z.nullable(z.string()).optional(),
|
|
@@ -251,11 +251,11 @@ export type MeterCreate$Outbound = {
|
|
|
251
251
|
name: string;
|
|
252
252
|
filter: Filter$Outbound;
|
|
253
253
|
aggregation:
|
|
254
|
+
| (CountAggregation$Outbound & { func: "count" })
|
|
254
255
|
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
255
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
256
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
257
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
258
|
-
| (CountAggregation$Outbound & { func: "count" });
|
|
256
|
+
| (PropertyAggregation$Outbound & { func: "max" })
|
|
257
|
+
| (PropertyAggregation$Outbound & { func: "min" })
|
|
258
|
+
| (PropertyAggregation$Outbound & { func: "sum" });
|
|
259
259
|
organization_id?: string | null | undefined;
|
|
260
260
|
};
|
|
261
261
|
|
|
@@ -271,22 +271,22 @@ export const MeterCreate$outboundSchema: z.ZodType<
|
|
|
271
271
|
name: z.string(),
|
|
272
272
|
filter: Filter$outboundSchema,
|
|
273
273
|
aggregation: z.union([
|
|
274
|
-
|
|
275
|
-
z.object({ func: z.literal("
|
|
274
|
+
CountAggregation$outboundSchema.and(
|
|
275
|
+
z.object({ func: z.literal("count") }).transform((v) => ({
|
|
276
|
+
func: v.func,
|
|
277
|
+
})),
|
|
276
278
|
),
|
|
277
279
|
PropertyAggregation$outboundSchema.and(
|
|
278
280
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
279
281
|
),
|
|
280
282
|
PropertyAggregation$outboundSchema.and(
|
|
281
|
-
z.object({ func: z.literal("
|
|
283
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
282
284
|
),
|
|
283
285
|
PropertyAggregation$outboundSchema.and(
|
|
284
|
-
z.object({ func: z.literal("
|
|
286
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
285
287
|
),
|
|
286
|
-
|
|
287
|
-
z.object({ func: z.literal("
|
|
288
|
-
func: v.func,
|
|
289
|
-
})),
|
|
288
|
+
PropertyAggregation$outboundSchema.and(
|
|
289
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
290
290
|
),
|
|
291
291
|
]),
|
|
292
292
|
organizationId: z.nullable(z.string()).optional(),
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
export type MeterUpdateMetadata = string | number | number | boolean;
|
|
29
29
|
|
|
30
30
|
export type Aggregation =
|
|
31
|
+
| (CountAggregation & { func: "count" })
|
|
31
32
|
| (PropertyAggregation & { func: "avg" })
|
|
32
|
-
| (PropertyAggregation & { func: "
|
|
33
|
-
| (PropertyAggregation & { func: "
|
|
34
|
-
| (PropertyAggregation & { func: "
|
|
35
|
-
| (CountAggregation & { func: "count" });
|
|
33
|
+
| (PropertyAggregation & { func: "max" })
|
|
34
|
+
| (PropertyAggregation & { func: "min" })
|
|
35
|
+
| (PropertyAggregation & { func: "sum" });
|
|
36
36
|
|
|
37
37
|
export type MeterUpdate = {
|
|
38
38
|
/**
|
|
@@ -63,11 +63,11 @@ export type MeterUpdate = {
|
|
|
63
63
|
* The aggregation to apply on the filtered events to calculate the meter.
|
|
64
64
|
*/
|
|
65
65
|
aggregation?:
|
|
66
|
-
| (PropertyAggregation & { func: "avg" })
|
|
67
|
-
| (PropertyAggregation & { func: "avg" })
|
|
68
|
-
| (PropertyAggregation & { func: "avg" })
|
|
69
|
-
| (PropertyAggregation & { func: "avg" })
|
|
70
66
|
| (CountAggregation & { func: "count" })
|
|
67
|
+
| (PropertyAggregation & { func: "avg" })
|
|
68
|
+
| (PropertyAggregation & { func: "max" })
|
|
69
|
+
| (PropertyAggregation & { func: "min" })
|
|
70
|
+
| (PropertyAggregation & { func: "sum" })
|
|
71
71
|
| null
|
|
72
72
|
| undefined;
|
|
73
73
|
};
|
|
@@ -126,30 +126,30 @@ export const Aggregation$inboundSchema: z.ZodType<
|
|
|
126
126
|
z.ZodTypeDef,
|
|
127
127
|
unknown
|
|
128
128
|
> = z.union([
|
|
129
|
-
|
|
130
|
-
z.object({ func: z.literal("
|
|
129
|
+
CountAggregation$inboundSchema.and(
|
|
130
|
+
z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
|
|
131
131
|
),
|
|
132
132
|
PropertyAggregation$inboundSchema.and(
|
|
133
133
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
134
134
|
),
|
|
135
135
|
PropertyAggregation$inboundSchema.and(
|
|
136
|
-
z.object({ func: z.literal("
|
|
136
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
137
137
|
),
|
|
138
138
|
PropertyAggregation$inboundSchema.and(
|
|
139
|
-
z.object({ func: z.literal("
|
|
139
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
140
140
|
),
|
|
141
|
-
|
|
142
|
-
z.object({ func: z.literal("
|
|
141
|
+
PropertyAggregation$inboundSchema.and(
|
|
142
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
143
143
|
),
|
|
144
144
|
]);
|
|
145
145
|
|
|
146
146
|
/** @internal */
|
|
147
147
|
export type Aggregation$Outbound =
|
|
148
|
+
| (CountAggregation$Outbound & { func: "count" })
|
|
148
149
|
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
149
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
150
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
151
|
-
| (PropertyAggregation$Outbound & { func: "
|
|
152
|
-
| (CountAggregation$Outbound & { func: "count" });
|
|
150
|
+
| (PropertyAggregation$Outbound & { func: "max" })
|
|
151
|
+
| (PropertyAggregation$Outbound & { func: "min" })
|
|
152
|
+
| (PropertyAggregation$Outbound & { func: "sum" });
|
|
153
153
|
|
|
154
154
|
/** @internal */
|
|
155
155
|
export const Aggregation$outboundSchema: z.ZodType<
|
|
@@ -157,20 +157,20 @@ export const Aggregation$outboundSchema: z.ZodType<
|
|
|
157
157
|
z.ZodTypeDef,
|
|
158
158
|
Aggregation
|
|
159
159
|
> = z.union([
|
|
160
|
-
|
|
161
|
-
z.object({ func: z.literal("
|
|
160
|
+
CountAggregation$outboundSchema.and(
|
|
161
|
+
z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
|
|
162
162
|
),
|
|
163
163
|
PropertyAggregation$outboundSchema.and(
|
|
164
164
|
z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
|
|
165
165
|
),
|
|
166
166
|
PropertyAggregation$outboundSchema.and(
|
|
167
|
-
z.object({ func: z.literal("
|
|
167
|
+
z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
|
|
168
168
|
),
|
|
169
169
|
PropertyAggregation$outboundSchema.and(
|
|
170
|
-
z.object({ func: z.literal("
|
|
170
|
+
z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
|
|
171
171
|
),
|
|
172
|
-
|
|
173
|
-
z.object({ func: z.literal("
|
|
172
|
+
PropertyAggregation$outboundSchema.and(
|
|
173
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
|
|
174
174
|
),
|
|
175
175
|
]);
|
|
176
176
|
|
|
@@ -214,8 +214,8 @@ export const MeterUpdate$inboundSchema: z.ZodType<
|
|
|
214
214
|
filter: z.nullable(Filter$inboundSchema).optional(),
|
|
215
215
|
aggregation: z.nullable(
|
|
216
216
|
z.union([
|
|
217
|
-
|
|
218
|
-
z.object({ func: z.literal("
|
|
217
|
+
CountAggregation$inboundSchema.and(
|
|
218
|
+
z.object({ func: z.literal("count") }).transform((v) => ({
|
|
219
219
|
func: v.func,
|
|
220
220
|
})),
|
|
221
221
|
),
|
|
@@ -225,17 +225,17 @@ export const MeterUpdate$inboundSchema: z.ZodType<
|
|
|
225
225
|
})),
|
|
226
226
|
),
|
|
227
227
|
PropertyAggregation$inboundSchema.and(
|
|
228
|
-
z.object({ func: z.literal("
|
|
228
|
+
z.object({ func: z.literal("max") }).transform((v) => ({
|
|
229
229
|
func: v.func,
|
|
230
230
|
})),
|
|
231
231
|
),
|
|
232
232
|
PropertyAggregation$inboundSchema.and(
|
|
233
|
-
z.object({ func: z.literal("
|
|
233
|
+
z.object({ func: z.literal("min") }).transform((v) => ({
|
|
234
234
|
func: v.func,
|
|
235
235
|
})),
|
|
236
236
|
),
|
|
237
|
-
|
|
238
|
-
z.object({ func: z.literal("
|
|
237
|
+
PropertyAggregation$inboundSchema.and(
|
|
238
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({
|
|
239
239
|
func: v.func,
|
|
240
240
|
})),
|
|
241
241
|
),
|
|
@@ -249,11 +249,11 @@ export type MeterUpdate$Outbound = {
|
|
|
249
249
|
name?: string | null | undefined;
|
|
250
250
|
filter?: Filter$Outbound | null | undefined;
|
|
251
251
|
aggregation?:
|
|
252
|
-
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
253
|
-
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
254
|
-
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
255
|
-
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
256
252
|
| (CountAggregation$Outbound & { func: "count" })
|
|
253
|
+
| (PropertyAggregation$Outbound & { func: "avg" })
|
|
254
|
+
| (PropertyAggregation$Outbound & { func: "max" })
|
|
255
|
+
| (PropertyAggregation$Outbound & { func: "min" })
|
|
256
|
+
| (PropertyAggregation$Outbound & { func: "sum" })
|
|
257
257
|
| null
|
|
258
258
|
| undefined;
|
|
259
259
|
};
|
|
@@ -271,8 +271,8 @@ export const MeterUpdate$outboundSchema: z.ZodType<
|
|
|
271
271
|
filter: z.nullable(Filter$outboundSchema).optional(),
|
|
272
272
|
aggregation: z.nullable(
|
|
273
273
|
z.union([
|
|
274
|
-
|
|
275
|
-
z.object({ func: z.literal("
|
|
274
|
+
CountAggregation$outboundSchema.and(
|
|
275
|
+
z.object({ func: z.literal("count") }).transform((v) => ({
|
|
276
276
|
func: v.func,
|
|
277
277
|
})),
|
|
278
278
|
),
|
|
@@ -282,17 +282,17 @@ export const MeterUpdate$outboundSchema: z.ZodType<
|
|
|
282
282
|
})),
|
|
283
283
|
),
|
|
284
284
|
PropertyAggregation$outboundSchema.and(
|
|
285
|
-
z.object({ func: z.literal("
|
|
285
|
+
z.object({ func: z.literal("max") }).transform((v) => ({
|
|
286
286
|
func: v.func,
|
|
287
287
|
})),
|
|
288
288
|
),
|
|
289
289
|
PropertyAggregation$outboundSchema.and(
|
|
290
|
-
z.object({ func: z.literal("
|
|
290
|
+
z.object({ func: z.literal("min") }).transform((v) => ({
|
|
291
291
|
func: v.func,
|
|
292
292
|
})),
|
|
293
293
|
),
|
|
294
|
-
|
|
295
|
-
z.object({ func: z.literal("
|
|
294
|
+
PropertyAggregation$outboundSchema.and(
|
|
295
|
+
z.object({ func: z.literal("sum") }).transform((v) => ({
|
|
296
296
|
func: v.func,
|
|
297
297
|
})),
|
|
298
298
|
),
|
|
@@ -77,10 +77,10 @@ export type OrderMetadata = string | number | number | boolean;
|
|
|
77
77
|
export type OrderCustomFieldData = string | number | boolean | Date;
|
|
78
78
|
|
|
79
79
|
export type OrderDiscount =
|
|
80
|
-
|
|
|
80
|
+
| DiscountPercentageOnceForeverDurationBase
|
|
81
81
|
| DiscountFixedOnceForeverDurationBase
|
|
82
82
|
| DiscountPercentageRepeatDurationBase
|
|
83
|
-
|
|
|
83
|
+
| DiscountFixedRepeatDurationBase;
|
|
84
84
|
|
|
85
85
|
export type Order = {
|
|
86
86
|
/**
|
|
@@ -164,10 +164,10 @@ export type Order = {
|
|
|
164
164
|
userId: string;
|
|
165
165
|
product: OrderProduct;
|
|
166
166
|
discount:
|
|
167
|
-
|
|
|
167
|
+
| DiscountPercentageOnceForeverDurationBase
|
|
168
168
|
| DiscountFixedOnceForeverDurationBase
|
|
169
169
|
| DiscountPercentageRepeatDurationBase
|
|
170
|
-
|
|
|
170
|
+
| DiscountFixedRepeatDurationBase
|
|
171
171
|
| null;
|
|
172
172
|
subscription: OrderSubscription | null;
|
|
173
173
|
/**
|
|
@@ -284,18 +284,18 @@ export const OrderDiscount$inboundSchema: z.ZodType<
|
|
|
284
284
|
z.ZodTypeDef,
|
|
285
285
|
unknown
|
|
286
286
|
> = z.union([
|
|
287
|
-
|
|
287
|
+
DiscountPercentageOnceForeverDurationBase$inboundSchema,
|
|
288
288
|
DiscountFixedOnceForeverDurationBase$inboundSchema,
|
|
289
289
|
DiscountPercentageRepeatDurationBase$inboundSchema,
|
|
290
|
-
|
|
290
|
+
DiscountFixedRepeatDurationBase$inboundSchema,
|
|
291
291
|
]);
|
|
292
292
|
|
|
293
293
|
/** @internal */
|
|
294
294
|
export type OrderDiscount$Outbound =
|
|
295
|
-
|
|
|
295
|
+
| DiscountPercentageOnceForeverDurationBase$Outbound
|
|
296
296
|
| DiscountFixedOnceForeverDurationBase$Outbound
|
|
297
297
|
| DiscountPercentageRepeatDurationBase$Outbound
|
|
298
|
-
|
|
|
298
|
+
| DiscountFixedRepeatDurationBase$Outbound;
|
|
299
299
|
|
|
300
300
|
/** @internal */
|
|
301
301
|
export const OrderDiscount$outboundSchema: z.ZodType<
|
|
@@ -303,10 +303,10 @@ export const OrderDiscount$outboundSchema: z.ZodType<
|
|
|
303
303
|
z.ZodTypeDef,
|
|
304
304
|
OrderDiscount
|
|
305
305
|
> = z.union([
|
|
306
|
-
|
|
306
|
+
DiscountPercentageOnceForeverDurationBase$outboundSchema,
|
|
307
307
|
DiscountFixedOnceForeverDurationBase$outboundSchema,
|
|
308
308
|
DiscountPercentageRepeatDurationBase$outboundSchema,
|
|
309
|
-
|
|
309
|
+
DiscountFixedRepeatDurationBase$outboundSchema,
|
|
310
310
|
]);
|
|
311
311
|
|
|
312
312
|
/**
|
|
@@ -384,10 +384,10 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
|
|
|
384
384
|
product: OrderProduct$inboundSchema,
|
|
385
385
|
discount: z.nullable(
|
|
386
386
|
z.union([
|
|
387
|
-
|
|
387
|
+
DiscountPercentageOnceForeverDurationBase$inboundSchema,
|
|
388
388
|
DiscountFixedOnceForeverDurationBase$inboundSchema,
|
|
389
389
|
DiscountPercentageRepeatDurationBase$inboundSchema,
|
|
390
|
-
|
|
390
|
+
DiscountFixedRepeatDurationBase$inboundSchema,
|
|
391
391
|
]),
|
|
392
392
|
),
|
|
393
393
|
subscription: z.nullable(OrderSubscription$inboundSchema),
|
|
@@ -450,10 +450,10 @@ export type Order$Outbound = {
|
|
|
450
450
|
user_id: string;
|
|
451
451
|
product: OrderProduct$Outbound;
|
|
452
452
|
discount:
|
|
453
|
-
|
|
|
453
|
+
| DiscountPercentageOnceForeverDurationBase$Outbound
|
|
454
454
|
| DiscountFixedOnceForeverDurationBase$Outbound
|
|
455
455
|
| DiscountPercentageRepeatDurationBase$Outbound
|
|
456
|
-
|
|
|
456
|
+
| DiscountFixedRepeatDurationBase$Outbound
|
|
457
457
|
| null;
|
|
458
458
|
subscription: OrderSubscription$Outbound | null;
|
|
459
459
|
items: Array<OrderItemSchema$Outbound>;
|
|
@@ -506,10 +506,10 @@ export const Order$outboundSchema: z.ZodType<
|
|
|
506
506
|
product: OrderProduct$outboundSchema,
|
|
507
507
|
discount: z.nullable(
|
|
508
508
|
z.union([
|
|
509
|
-
|
|
509
|
+
DiscountPercentageOnceForeverDurationBase$outboundSchema,
|
|
510
510
|
DiscountFixedOnceForeverDurationBase$outboundSchema,
|
|
511
511
|
DiscountPercentageRepeatDurationBase$outboundSchema,
|
|
512
|
-
|
|
512
|
+
DiscountFixedRepeatDurationBase$outboundSchema,
|
|
513
513
|
]),
|
|
514
514
|
),
|
|
515
515
|
subscription: z.nullable(OrderSubscription$outboundSchema),
|
|
@@ -19,21 +19,21 @@ import {
|
|
|
19
19
|
GenericPayment$outboundSchema,
|
|
20
20
|
} from "./genericpayment.js";
|
|
21
21
|
|
|
22
|
-
export type Payment =
|
|
22
|
+
export type Payment = GenericPayment | CardPayment;
|
|
23
23
|
|
|
24
24
|
/** @internal */
|
|
25
25
|
export const Payment$inboundSchema: z.ZodType<Payment, z.ZodTypeDef, unknown> =
|
|
26
|
-
z.union([
|
|
26
|
+
z.union([GenericPayment$inboundSchema, CardPayment$inboundSchema]);
|
|
27
27
|
|
|
28
28
|
/** @internal */
|
|
29
|
-
export type Payment$Outbound =
|
|
29
|
+
export type Payment$Outbound = GenericPayment$Outbound | CardPayment$Outbound;
|
|
30
30
|
|
|
31
31
|
/** @internal */
|
|
32
32
|
export const Payment$outboundSchema: z.ZodType<
|
|
33
33
|
Payment$Outbound,
|
|
34
34
|
z.ZodTypeDef,
|
|
35
35
|
Payment
|
|
36
|
-
> = z.union([
|
|
36
|
+
> = z.union([GenericPayment$outboundSchema, CardPayment$outboundSchema]);
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* @internal
|