@flexprice/mcp-server 2.1.17 → 2.1.18
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/bin/mcp-server.js +544 -210
- package/bin/mcp-server.js.map +54 -43
- package/bun.lock +19 -17
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.js +1 -1
- package/esm/lib/encodings.js.map +1 -1
- package/esm/lib/primitives.d.ts +1 -0
- package/esm/lib/primitives.d.ts.map +1 -1
- package/esm/lib/primitives.js +17 -0
- package/esm/lib/primitives.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -1
- package/esm/models/attributedtocustomerresult.d.ts +11 -0
- package/esm/models/attributedtocustomerresult.d.ts.map +1 -0
- package/esm/models/attributedtocustomerresult.js +13 -0
- package/esm/models/attributedtocustomerresult.js.map +1 -0
- package/esm/models/bucket.d.ts +7 -0
- package/esm/models/bucket.d.ts.map +1 -0
- package/esm/models/bucket.js +9 -0
- package/esm/models/bucket.js.map +1 -0
- package/esm/models/bucketsummary.d.ts +18 -0
- package/esm/models/bucketsummary.d.ts.map +1 -0
- package/esm/models/bucketsummary.js +20 -0
- package/esm/models/bucketsummary.js.map +1 -0
- package/esm/models/cancelsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/cancelsubscriptionrequest.js +1 -1
- package/esm/models/cancelsubscriptionrequest.js.map +1 -1
- package/esm/models/commitmentbucketrequest.d.ts +16 -0
- package/esm/models/commitmentbucketrequest.d.ts.map +1 -0
- package/esm/models/commitmentbucketrequest.js +18 -0
- package/esm/models/commitmentbucketrequest.js.map +1 -0
- package/esm/models/coupon.d.ts +1 -0
- package/esm/models/coupon.d.ts.map +1 -1
- package/esm/models/coupon.js +1 -0
- package/esm/models/coupon.js.map +1 -1
- package/esm/models/createsubscriptionlineitemrequest.d.ts +2 -0
- package/esm/models/createsubscriptionlineitemrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionlineitemrequest.js +3 -0
- package/esm/models/createsubscriptionlineitemrequest.js.map +1 -1
- package/esm/models/createsubscriptionrequest.d.ts +2 -0
- package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionrequest.js +6 -2
- package/esm/models/createsubscriptionrequest.js.map +1 -1
- package/esm/models/creditgrantexpirydurationunit.d.ts +1 -1
- package/esm/models/debugtracker.d.ts +2 -0
- package/esm/models/debugtracker.d.ts.map +1 -1
- package/esm/models/debugtracker.js +2 -0
- package/esm/models/debugtracker.js.map +1 -1
- package/esm/models/debugtrackerstatus.d.ts +4 -0
- package/esm/models/debugtrackerstatus.d.ts.map +1 -1
- package/esm/models/debugtrackerstatus.js +4 -0
- package/esm/models/debugtrackerstatus.js.map +1 -1
- package/esm/models/eventprocessingstatustype.d.ts +1 -1
- package/esm/models/executesubscriptionmodifyrequest.d.ts +4 -0
- package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.js +4 -0
- package/esm/models/executesubscriptionmodifyrequest.js.map +1 -1
- package/esm/models/failurepointtype.d.ts +2 -0
- package/esm/models/failurepointtype.d.ts.map +1 -1
- package/esm/models/failurepointtype.js +2 -0
- package/esm/models/failurepointtype.js.map +1 -1
- package/esm/models/getusageanalyticsrequest.d.ts +1 -0
- package/esm/models/getusageanalyticsrequest.d.ts.map +1 -1
- package/esm/models/getusageanalyticsrequest.js +1 -0
- package/esm/models/getusageanalyticsrequest.js.map +1 -1
- package/esm/models/inheritanceaction.d.ts +12 -0
- package/esm/models/inheritanceaction.d.ts.map +1 -0
- package/esm/models/inheritanceaction.js +13 -0
- package/esm/models/inheritanceaction.js.map +1 -0
- package/esm/models/lineitemcommitmentconfig.d.ts +2 -0
- package/esm/models/lineitemcommitmentconfig.d.ts.map +1 -1
- package/esm/models/lineitemcommitmentconfig.js +3 -0
- package/esm/models/lineitemcommitmentconfig.js.map +1 -1
- package/esm/models/meterusageattribution.d.ts +8 -0
- package/esm/models/meterusageattribution.d.ts.map +1 -0
- package/esm/models/meterusageattribution.js +10 -0
- package/esm/models/meterusageattribution.js.map +1 -0
- package/esm/models/pricefilter.d.ts +2 -0
- package/esm/models/pricefilter.d.ts.map +1 -1
- package/esm/models/pricefilter.js +2 -0
- package/esm/models/pricefilter.js.map +1 -1
- package/esm/models/submodifycouponaction.d.ts +12 -0
- package/esm/models/submodifycouponaction.d.ts.map +1 -0
- package/esm/models/submodifycouponaction.js +13 -0
- package/esm/models/submodifycouponaction.js.map +1 -0
- package/esm/models/submodifycouponparams.d.ts +14 -0
- package/esm/models/submodifycouponparams.d.ts.map +1 -0
- package/esm/models/submodifycouponparams.js +16 -0
- package/esm/models/submodifycouponparams.js.map +1 -0
- package/esm/models/submodifyinheritancerequest.d.ts +3 -0
- package/esm/models/submodifyinheritancerequest.d.ts.map +1 -1
- package/esm/models/submodifyinheritancerequest.js +5 -1
- package/esm/models/submodifyinheritancerequest.js.map +1 -1
- package/esm/models/submodifytaxaction.d.ts +12 -0
- package/esm/models/submodifytaxaction.d.ts.map +1 -0
- package/esm/models/submodifytaxaction.js +13 -0
- package/esm/models/submodifytaxaction.js.map +1 -0
- package/esm/models/submodifytaxparams.d.ts +10 -0
- package/esm/models/submodifytaxparams.d.ts.map +1 -0
- package/esm/models/submodifytaxparams.js +13 -0
- package/esm/models/submodifytaxparams.js.map +1 -0
- package/esm/models/subscriptioncouponinput.d.ts +9 -0
- package/esm/models/subscriptioncouponinput.d.ts.map +1 -0
- package/esm/models/subscriptioncouponinput.js +11 -0
- package/esm/models/subscriptioncouponinput.js.map +1 -0
- package/esm/models/subscriptionlineitemresponse.d.ts +2 -0
- package/esm/models/subscriptionlineitemresponse.d.ts.map +1 -1
- package/esm/models/subscriptionlineitemresponse.js +2 -0
- package/esm/models/subscriptionlineitemresponse.js.map +1 -1
- package/esm/models/subscriptionmodifytype.d.ts +4 -0
- package/esm/models/subscriptionmodifytype.d.ts.map +1 -1
- package/esm/models/subscriptionmodifytype.js +4 -0
- package/esm/models/subscriptionmodifytype.js.map +1 -1
- package/esm/models/subscriptionphasecreaterequest.d.ts +2 -0
- package/esm/models/subscriptionphasecreaterequest.d.ts.map +1 -1
- package/esm/models/subscriptionphasecreaterequest.js +5 -2
- package/esm/models/subscriptionphasecreaterequest.js.map +1 -1
- package/esm/models/subscriptionsubscriptionlineitem.d.ts +2 -0
- package/esm/models/subscriptionsubscriptionlineitem.d.ts.map +1 -1
- package/esm/models/subscriptionsubscriptionlineitem.js +2 -0
- package/esm/models/subscriptionsubscriptionlineitem.js.map +1 -1
- package/esm/models/timeofdaybucket.d.ts +15 -0
- package/esm/models/timeofdaybucket.d.ts.map +1 -0
- package/esm/models/timeofdaybucket.js +17 -0
- package/esm/models/timeofdaybucket.js.map +1 -0
- package/esm/models/updatesubscriptionlineitemrequest.d.ts +2 -0
- package/esm/models/updatesubscriptionlineitemrequest.d.ts.map +1 -1
- package/esm/models/updatesubscriptionlineitemrequest.js +3 -0
- package/esm/models/updatesubscriptionlineitemrequest.js.map +1 -1
- package/esm/models/usageanalyticitem.d.ts +2 -0
- package/esm/models/usageanalyticitem.d.ts.map +1 -1
- package/esm/models/usageanalyticitem.js +2 -0
- package/esm/models/usageanalyticitem.js.map +1 -1
- package/esm/models/usageanalyticpoint.d.ts +2 -0
- package/esm/models/usageanalyticpoint.d.ts.map +1 -1
- package/esm/models/usageanalyticpoint.js +2 -0
- package/esm/models/usageanalyticpoint.js.map +1 -1
- package/esm/models/userresponse.d.ts +1 -0
- package/esm/models/userresponse.d.ts.map +1 -1
- package/esm/models/userresponse.js +1 -0
- package/esm/models/userresponse.js.map +1 -1
- package/esm/models/windowsize.d.ts +2 -2
- package/esm/models/windowsize.js +2 -2
- package/esm/models/windowsize.js.map +1 -1
- package/esm/tool-names.js +2 -2
- package/esm/tool-names.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types/async.d.ts.map +1 -1
- package/esm/types/async.js +6 -6
- package/esm/types/async.js.map +1 -1
- package/manifest.json +3 -3
- package/package.json +1 -1
- package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +1 -1
- package/src/lib/primitives.ts +16 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/models/attributedtocustomerresult.ts +28 -0
- package/src/models/bucket.ts +12 -0
- package/src/models/bucketsummary.ts +40 -0
- package/src/models/cancelsubscriptionrequest.ts +3 -1
- package/src/models/commitmentbucketrequest.ts +35 -0
- package/src/models/coupon.ts +2 -0
- package/src/models/createsubscriptionlineitemrequest.ts +7 -0
- package/src/models/createsubscriptionrequest.ts +14 -2
- package/src/models/debugtracker.ts +6 -0
- package/src/models/debugtrackerstatus.ts +4 -0
- package/src/models/executesubscriptionmodifyrequest.ts +12 -0
- package/src/models/failurepointtype.ts +2 -0
- package/src/models/getusageanalyticsrequest.ts +4 -0
- package/src/models/inheritanceaction.ts +17 -0
- package/src/models/lineitemcommitmentconfig.ts +9 -0
- package/src/models/meterusageattribution.ts +18 -0
- package/src/models/pricefilter.ts +3 -0
- package/src/models/submodifycouponaction.ts +17 -0
- package/src/models/submodifycouponparams.ts +46 -0
- package/src/models/submodifyinheritancerequest.ts +14 -1
- package/src/models/submodifytaxaction.ts +17 -0
- package/src/models/submodifytaxparams.ts +30 -0
- package/src/models/subscriptioncouponinput.ts +29 -0
- package/src/models/subscriptionlineitemresponse.ts +6 -0
- package/src/models/subscriptionmodifytype.ts +4 -0
- package/src/models/subscriptionphasecreaterequest.ts +11 -4
- package/src/models/subscriptionsubscriptionlineitem.ts +6 -0
- package/src/models/timeofdaybucket.ts +33 -0
- package/src/models/updatesubscriptionlineitemrequest.ts +9 -0
- package/src/models/usageanalyticitem.ts +5 -0
- package/src/models/usageanalyticpoint.ts +6 -0
- package/src/models/userresponse.ts +2 -0
- package/src/models/windowsize.ts +2 -2
- package/src/tool-names.ts +2 -2
- package/src/types/async.ts +8 -7
- package/esm/lib/dlv.d.ts +0 -14
- package/esm/lib/dlv.d.ts.map +0 -1
- package/esm/lib/dlv.js +0 -46
- package/esm/lib/dlv.js.map +0 -1
- package/esm/lib/is-plain-object.d.ts +0 -2
- package/esm/lib/is-plain-object.d.ts.map +0 -1
- package/esm/lib/is-plain-object.js +0 -38
- package/esm/lib/is-plain-object.js.map +0 -1
- package/src/lib/dlv.ts +0 -53
- package/src/lib/is-plain-object.ts +0 -43
package/esm/types/async.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/types/async.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GACf;IACE,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEN,qBAAa,UAAU,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;;IAI9C,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB;gBAEjC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/types/async.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GACf;IACE,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEN,qBAAa,UAAU,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;;IAI9C,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB;gBAEjC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IASnD,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EACjC,WAAW,CAAC,EACR,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAChD,IAAI,GACJ,SAAS,EACb,UAAU,CAAC,EACP,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GACnD,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAO/B,KAAK,CAAC,OAAO,GAAG,KAAK,EACnB,UAAU,CAAC,EACP,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GACjD,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC;IAIvB,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhE,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;CAGlC"}
|
package/esm/types/async.js
CHANGED
|
@@ -7,19 +7,19 @@ export class APIPromise {
|
|
|
7
7
|
[Symbol.toStringTag] = "APIPromise";
|
|
8
8
|
constructor(p) {
|
|
9
9
|
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
10
|
-
this.#unwrapped =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]);
|
|
11
|
+
}
|
|
12
|
+
#getUnwrapped() {
|
|
13
|
+
return (this.#unwrapped ??= this.#promise.then(([value]) => value));
|
|
14
14
|
}
|
|
15
15
|
then(onfulfilled, onrejected) {
|
|
16
16
|
return this.#promise.then(onfulfilled ? ([value]) => onfulfilled(value) : void 0, onrejected);
|
|
17
17
|
}
|
|
18
18
|
catch(onrejected) {
|
|
19
|
-
return this.#
|
|
19
|
+
return this.#getUnwrapped().catch(onrejected);
|
|
20
20
|
}
|
|
21
21
|
finally(onfinally) {
|
|
22
|
-
return this.#
|
|
22
|
+
return this.#getUnwrapped().finally(onfinally);
|
|
23
23
|
}
|
|
24
24
|
$inspect() {
|
|
25
25
|
return this.#promise;
|
package/esm/types/async.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/types/async.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmBH,MAAM,OAAO,UAAU;IACZ,QAAQ,CAAwB;
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/types/async.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmBH,MAAM,OAAO,UAAU;IACZ,QAAQ,CAAwB;IACzC,UAAU,CAAoB;IAErB,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,YAAY,CAAC;IAE7C,YAAY,CAAuC;QACjD,IAAI,CAAC,QAAQ,GAAG,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,UAAU,GAAG,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,aAAa;QACX,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,IAAI,CACF,WAGa,EACb,UAGa;QAEb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CACvB,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EACtD,UAAU,CACX,CAAC;IACJ,CAAC;IAED,KAAK,CACH,UAGa;QAEb,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,CAAC,SAA2C;QACjD,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
|
package/manifest.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"sensitive": true
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
"version": "2.1.
|
|
51
|
+
"version": "2.1.18",
|
|
52
52
|
"tools": [
|
|
53
53
|
{
|
|
54
54
|
"name": "update-customer",
|
|
@@ -304,11 +304,11 @@
|
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
"name": "execute-subscription-modify",
|
|
307
|
-
"description": "Execute subscription modification\n\nExecute a mid-cycle subscription modification (inheritance
|
|
307
|
+
"description": "Execute subscription modification\n\nExecute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax)."
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
310
|
"name": "preview-subscription-modify",
|
|
311
|
-
"description": "Preview subscription modification\n\nPreview the impact of a mid-cycle subscription modification without committing changes."
|
|
311
|
+
"description": "Preview subscription modification\n\nPreview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax) without committing changes."
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
314
|
"name": "get-subscription-v2",
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Execute subscription modification
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Execute a mid-cycle subscription modification (inheritance
|
|
32
|
+
* Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax).
|
|
33
33
|
*/
|
|
34
34
|
export function subscriptionsExecuteSubscriptionModify(
|
|
35
35
|
client$: FlexpriceCore,
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Preview subscription modification
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Preview the impact of a mid-cycle subscription modification without committing changes.
|
|
32
|
+
* Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax) without committing changes.
|
|
33
33
|
*/
|
|
34
34
|
export function subscriptionsPreviewSubscriptionModify(
|
|
35
35
|
client$: FlexpriceCore,
|
package/src/lib/config.ts
CHANGED
|
@@ -69,8 +69,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
69
69
|
export const SDK_METADATA = {
|
|
70
70
|
language: "typescript",
|
|
71
71
|
openapiDocVersion: "1.0",
|
|
72
|
-
sdkVersion: "2.1.
|
|
73
|
-
genVersion: "2.
|
|
72
|
+
sdkVersion: "2.1.18",
|
|
73
|
+
genVersion: "2.904.2",
|
|
74
74
|
userAgent:
|
|
75
|
-
"speakeasy-sdk/mcp-typescript 2.1.
|
|
75
|
+
"speakeasy-sdk/mcp-typescript 2.1.18 2.904.2 1.0 @flexprice/mcp-server",
|
|
76
76
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
package/src/lib/primitives.ts
CHANGED
|
@@ -111,3 +111,19 @@ export function invariant(
|
|
|
111
111
|
throw new InvariantError(message);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
export function isPlainObject(
|
|
116
|
+
value: unknown,
|
|
117
|
+
): value is Record<string, unknown> {
|
|
118
|
+
if (value === null || typeof value !== "object") return false;
|
|
119
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
120
|
+
const proto = Object.getPrototypeOf(value);
|
|
121
|
+
if (proto === null || proto === Object.prototype) return true;
|
|
122
|
+
// cross-realm plain objects (vm contexts, iframes) inherit from a
|
|
123
|
+
// different realm's Object.prototype, which itself has a null prototype
|
|
124
|
+
try {
|
|
125
|
+
return Object.getPrototypeOf(proto) === null;
|
|
126
|
+
} catch {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -16,7 +16,7 @@ export const tool$subscriptionsExecuteSubscriptionModify: ToolDefinition<
|
|
|
16
16
|
name: "execute-subscription-modify",
|
|
17
17
|
description: `Execute subscription modification
|
|
18
18
|
|
|
19
|
-
Execute a mid-cycle subscription modification (inheritance
|
|
19
|
+
Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax).`,
|
|
20
20
|
scopes: ["write"],
|
|
21
21
|
annotations: {
|
|
22
22
|
"title": "",
|
|
@@ -16,7 +16,7 @@ export const tool$subscriptionsPreviewSubscriptionModify: ToolDefinition<
|
|
|
16
16
|
name: "preview-subscription-modify",
|
|
17
17
|
description: `Preview subscription modification
|
|
18
18
|
|
|
19
|
-
Preview the impact of a mid-cycle subscription modification without committing changes.`,
|
|
19
|
+
Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax) without committing changes.`,
|
|
20
20
|
scopes: ["read"],
|
|
21
21
|
annotations: {
|
|
22
22
|
"title": "",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
DebugTrackerStatus,
|
|
8
|
+
DebugTrackerStatus$zodSchema,
|
|
9
|
+
} from "./debugtrackerstatus.js";
|
|
10
|
+
import { ErrorResponse, ErrorResponse$zodSchema } from "./errorresponse.js";
|
|
11
|
+
import {
|
|
12
|
+
MeterUsageAttribution,
|
|
13
|
+
MeterUsageAttribution$zodSchema,
|
|
14
|
+
} from "./meterusageattribution.js";
|
|
15
|
+
|
|
16
|
+
export type AttributedToCustomerResult = {
|
|
17
|
+
error?: ErrorResponse | undefined;
|
|
18
|
+
meter_usage?: MeterUsageAttribution | undefined;
|
|
19
|
+
status?: DebugTrackerStatus | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const AttributedToCustomerResult$zodSchema: z.ZodType<
|
|
23
|
+
AttributedToCustomerResult
|
|
24
|
+
> = z.object({
|
|
25
|
+
error: ErrorResponse$zodSchema.optional(),
|
|
26
|
+
meter_usage: MeterUsageAttribution$zodSchema.optional(),
|
|
27
|
+
status: DebugTrackerStatus$zodSchema.optional(),
|
|
28
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type Bucket = { hour?: number | undefined; minute?: number | undefined };
|
|
8
|
+
|
|
9
|
+
export const Bucket$zodSchema: z.ZodType<Bucket> = z.object({
|
|
10
|
+
hour: z.int().optional(),
|
|
11
|
+
minute: z.int().optional(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { Bucket, Bucket$zodSchema } from "./bucket.js";
|
|
7
|
+
|
|
8
|
+
export type BucketSummary = {
|
|
9
|
+
base_charge?: string | undefined;
|
|
10
|
+
bucket_id?: string | undefined;
|
|
11
|
+
commitment_type?: string | undefined;
|
|
12
|
+
commitment_value?: string | undefined;
|
|
13
|
+
computed_overage?: string | undefined;
|
|
14
|
+
computed_true_up?: string | undefined;
|
|
15
|
+
computed_utilized?: string | undefined;
|
|
16
|
+
end?: Bucket | undefined;
|
|
17
|
+
price_id?: string | undefined;
|
|
18
|
+
start?: Bucket | undefined;
|
|
19
|
+
subscription_line_item_id?: string | undefined;
|
|
20
|
+
total_usage?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const BucketSummary$zodSchema: z.ZodType<BucketSummary> = z.object({
|
|
24
|
+
base_charge: z.string().optional(),
|
|
25
|
+
bucket_id: z.string().optional(),
|
|
26
|
+
commitment_type: z.string().optional(),
|
|
27
|
+
commitment_value: z.string().optional(),
|
|
28
|
+
computed_overage: z.string().optional(),
|
|
29
|
+
computed_true_up: z.string().optional(),
|
|
30
|
+
computed_utilized: z.string().optional(),
|
|
31
|
+
end: Bucket$zodSchema.optional(),
|
|
32
|
+
price_id: z.string().optional().describe(
|
|
33
|
+
"PriceID is the bucket's own price (the line item's price for the\nout-of-bucket row).",
|
|
34
|
+
),
|
|
35
|
+
start: Bucket$zodSchema.optional(),
|
|
36
|
+
subscription_line_item_id: z.string().optional().describe(
|
|
37
|
+
"SubscriptionLineItemID is the line item this bucket is configured on.",
|
|
38
|
+
),
|
|
39
|
+
total_usage: z.string().optional(),
|
|
40
|
+
});
|
|
@@ -29,7 +29,9 @@ export type CancelSubscriptionRequest = {
|
|
|
29
29
|
export const CancelSubscriptionRequest$zodSchema: z.ZodType<
|
|
30
30
|
CancelSubscriptionRequest
|
|
31
31
|
> = z.object({
|
|
32
|
-
cancel_at: z.iso.datetime({ offset: true }).optional()
|
|
32
|
+
cancel_at: z.iso.datetime({ offset: true }).optional().describe(
|
|
33
|
+
"CancelAt is the exact date/time when the subscription should be cancelled.\nRequired for cancellation_type \"scheduled_date\"; optional for \"immediate\" (past dates only — backdated cancellation).\nFor \"scheduled_date\", accepts both future dates (deferred cancellation) and past dates (backdated cancellation).\nFor \"immediate\", accepts past/current dates only; use \"scheduled_date\" for future dates.",
|
|
34
|
+
),
|
|
33
35
|
cancel_immediately_inovice_policy: CancelImmediatelyInvoicePolicy$zodSchema
|
|
34
36
|
.optional(),
|
|
35
37
|
cancellation_type: CancellationType$zodSchema,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { Bucket, Bucket$zodSchema } from "./bucket.js";
|
|
7
|
+
import { CommitmentType, CommitmentType$zodSchema } from "./commitmenttype.js";
|
|
8
|
+
import {
|
|
9
|
+
CreatePriceRequest,
|
|
10
|
+
CreatePriceRequest$zodSchema,
|
|
11
|
+
} from "./createpricerequest.js";
|
|
12
|
+
|
|
13
|
+
export type CommitmentBucketRequest = {
|
|
14
|
+
commitment_type?: CommitmentType | undefined;
|
|
15
|
+
commitment_value?: string | undefined;
|
|
16
|
+
end?: Bucket | undefined;
|
|
17
|
+
id?: string | undefined;
|
|
18
|
+
overage_factor?: string | undefined;
|
|
19
|
+
price?: CreatePriceRequest | undefined;
|
|
20
|
+
start?: Bucket | undefined;
|
|
21
|
+
true_up_enabled?: boolean | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const CommitmentBucketRequest$zodSchema: z.ZodType<
|
|
25
|
+
CommitmentBucketRequest
|
|
26
|
+
> = z.object({
|
|
27
|
+
commitment_type: CommitmentType$zodSchema.optional(),
|
|
28
|
+
commitment_value: z.string().optional(),
|
|
29
|
+
end: Bucket$zodSchema.optional(),
|
|
30
|
+
id: z.string().optional(),
|
|
31
|
+
overage_factor: z.string().optional(),
|
|
32
|
+
price: CreatePriceRequest$zodSchema.optional(),
|
|
33
|
+
start: Bucket$zodSchema.optional(),
|
|
34
|
+
true_up_enabled: z.boolean().optional(),
|
|
35
|
+
});
|
package/src/models/coupon.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Status, Status$zodSchema } from "./status.js";
|
|
|
10
10
|
export type Coupon = {
|
|
11
11
|
amount_off?: string | undefined;
|
|
12
12
|
cadence?: CouponCadence | undefined;
|
|
13
|
+
coupon_code?: string | undefined;
|
|
13
14
|
created_at?: string | undefined;
|
|
14
15
|
created_by?: string | undefined;
|
|
15
16
|
currency?: string | undefined;
|
|
@@ -34,6 +35,7 @@ export type Coupon = {
|
|
|
34
35
|
export const Coupon$zodSchema: z.ZodType<Coupon> = z.object({
|
|
35
36
|
amount_off: z.string().optional(),
|
|
36
37
|
cadence: CouponCadence$zodSchema.optional(),
|
|
38
|
+
coupon_code: z.string().optional(),
|
|
37
39
|
created_at: z.iso.datetime({ offset: true }).optional(),
|
|
38
40
|
created_by: z.string().optional(),
|
|
39
41
|
currency: z.string().optional(),
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
7
|
+
import {
|
|
8
|
+
CommitmentBucketRequest,
|
|
9
|
+
CommitmentBucketRequest$zodSchema,
|
|
10
|
+
} from "./commitmentbucketrequest.js";
|
|
7
11
|
import { CommitmentType, CommitmentType$zodSchema } from "./commitmenttype.js";
|
|
8
12
|
import {
|
|
9
13
|
ProrationBehavior,
|
|
@@ -19,6 +23,7 @@ export type CreateSubscriptionLineItemRequest = {
|
|
|
19
23
|
commitment_duration?: BillingPeriod | undefined;
|
|
20
24
|
commitment_overage_factor?: number | undefined;
|
|
21
25
|
commitment_quantity?: number | undefined;
|
|
26
|
+
commitment_time_buckets?: Array<CommitmentBucketRequest> | undefined;
|
|
22
27
|
commitment_true_up_enabled?: boolean | undefined;
|
|
23
28
|
commitment_type?: CommitmentType | undefined;
|
|
24
29
|
commitment_windowed?: boolean | undefined;
|
|
@@ -40,6 +45,8 @@ export const CreateSubscriptionLineItemRequest$zodSchema: z.ZodType<
|
|
|
40
45
|
commitment_duration: BillingPeriod$zodSchema.optional(),
|
|
41
46
|
commitment_overage_factor: z.number().optional(),
|
|
42
47
|
commitment_quantity: z.number().optional(),
|
|
48
|
+
commitment_time_buckets: z.array(CommitmentBucketRequest$zodSchema)
|
|
49
|
+
.optional(),
|
|
43
50
|
commitment_true_up_enabled: z.boolean().optional(),
|
|
44
51
|
commitment_type: CommitmentType$zodSchema.optional(),
|
|
45
52
|
commitment_windowed: z.boolean().optional(),
|
|
@@ -42,6 +42,10 @@ import {
|
|
|
42
42
|
ProrationBehavior,
|
|
43
43
|
ProrationBehavior$zodSchema,
|
|
44
44
|
} from "./prorationbehavior.js";
|
|
45
|
+
import {
|
|
46
|
+
SubscriptionCouponInput,
|
|
47
|
+
SubscriptionCouponInput$zodSchema,
|
|
48
|
+
} from "./subscriptioncouponinput.js";
|
|
45
49
|
import {
|
|
46
50
|
SubscriptionInheritanceConfig,
|
|
47
51
|
SubscriptionInheritanceConfig$zodSchema,
|
|
@@ -93,6 +97,7 @@ export type CreateSubscriptionRequest = {
|
|
|
93
97
|
plan_id: string;
|
|
94
98
|
proration_behavior?: ProrationBehavior | undefined;
|
|
95
99
|
start_date?: string | undefined;
|
|
100
|
+
subscription_coupons?: Array<SubscriptionCouponInput> | undefined;
|
|
96
101
|
subscription_status?: SubscriptionStatus | undefined;
|
|
97
102
|
tax_rate_overrides?: Array<TaxRateOverride> | undefined;
|
|
98
103
|
trial_period_days?: number | undefined;
|
|
@@ -118,7 +123,9 @@ export const CreateSubscriptionRequest$zodSchema: z.ZodType<
|
|
|
118
123
|
"CommitmentAmount is the minimum amount a customer commits to paying for a billing period",
|
|
119
124
|
),
|
|
120
125
|
commitment_duration: BillingPeriod$zodSchema.optional(),
|
|
121
|
-
coupons: z.array(z.string()).optional()
|
|
126
|
+
coupons: z.array(z.string()).optional().describe(
|
|
127
|
+
"Deprecated: use SubscriptionCoupons instead.",
|
|
128
|
+
),
|
|
122
129
|
credit_grants: z.array(CreateCreditGrantRequest$zodSchema).optional()
|
|
123
130
|
.describe("Credit grants to be applied when subscription is created"),
|
|
124
131
|
currency: z.string(),
|
|
@@ -143,7 +150,8 @@ export const CreateSubscriptionRequest$zodSchema: z.ZodType<
|
|
|
143
150
|
).optional().describe(
|
|
144
151
|
"LineItemCommitments allows setting commitment configuration per line item (keyed by price_id)",
|
|
145
152
|
),
|
|
146
|
-
line_item_coupons: z.record(z.string(), z.array(z.string())).optional()
|
|
153
|
+
line_item_coupons: z.record(z.string(), z.array(z.string())).optional()
|
|
154
|
+
.describe("Deprecated: use SubscriptionCoupons instead."),
|
|
147
155
|
line_items: z.array(CreateSubscriptionLineItemRequest$zodSchema).optional()
|
|
148
156
|
.describe(
|
|
149
157
|
"LineItems are extra line items to add at creation (each with price_id or price), in addition to plan prices",
|
|
@@ -169,6 +177,10 @@ export const CreateSubscriptionRequest$zodSchema: z.ZodType<
|
|
|
169
177
|
plan_id: z.string(),
|
|
170
178
|
proration_behavior: ProrationBehavior$zodSchema.optional(),
|
|
171
179
|
start_date: z.iso.datetime({ offset: true }).optional(),
|
|
180
|
+
subscription_coupons: z.array(SubscriptionCouponInput$zodSchema).optional()
|
|
181
|
+
.describe(
|
|
182
|
+
"SubscriptionCoupons is the preferred way to attach coupons at creation.\nAccepts coupon_code; optionally targets a line item via price_id.",
|
|
183
|
+
),
|
|
172
184
|
subscription_status: SubscriptionStatus$zodSchema.optional(),
|
|
173
185
|
tax_rate_overrides: z.array(TaxRateOverride$zodSchema).optional().describe(
|
|
174
186
|
"tax_rate_overrides is the tax rate overrides\tto be applied to the subscription",
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
AttributedToCustomerResult,
|
|
8
|
+
AttributedToCustomerResult$zodSchema,
|
|
9
|
+
} from "./attributedtocustomerresult.js";
|
|
6
10
|
import {
|
|
7
11
|
CustomerLookupResult,
|
|
8
12
|
CustomerLookupResult$zodSchema,
|
|
@@ -22,6 +26,7 @@ import {
|
|
|
22
26
|
} from "./subscriptionlineitemlookupresult.js";
|
|
23
27
|
|
|
24
28
|
export type DebugTracker = {
|
|
29
|
+
attributed_to_customer?: AttributedToCustomerResult | undefined;
|
|
25
30
|
customer_lookup?: CustomerLookupResult | undefined;
|
|
26
31
|
failure_point?: FailurePoint | undefined;
|
|
27
32
|
meter_matching?: MeterMatchingResult | undefined;
|
|
@@ -30,6 +35,7 @@ export type DebugTracker = {
|
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
export const DebugTracker$zodSchema: z.ZodType<DebugTracker> = z.object({
|
|
38
|
+
attributed_to_customer: AttributedToCustomerResult$zodSchema.optional(),
|
|
33
39
|
customer_lookup: CustomerLookupResult$zodSchema.optional(),
|
|
34
40
|
failure_point: FailurePoint$zodSchema.optional(),
|
|
35
41
|
meter_matching: MeterMatchingResult$zodSchema.optional(),
|
|
@@ -10,6 +10,8 @@ export const DebugTrackerStatus = {
|
|
|
10
10
|
NotFound: "not_found",
|
|
11
11
|
Found: "found",
|
|
12
12
|
Error: "error",
|
|
13
|
+
Processing: "processing",
|
|
14
|
+
Attributed: "attributed",
|
|
13
15
|
} as const;
|
|
14
16
|
export type DebugTrackerStatus = ClosedEnum<typeof DebugTrackerStatus>;
|
|
15
17
|
|
|
@@ -18,4 +20,6 @@ export const DebugTrackerStatus$zodSchema = z.enum([
|
|
|
18
20
|
"not_found",
|
|
19
21
|
"found",
|
|
20
22
|
"error",
|
|
23
|
+
"processing",
|
|
24
|
+
"attributed",
|
|
21
25
|
]);
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
SubModifyCouponParams,
|
|
8
|
+
SubModifyCouponParams$zodSchema,
|
|
9
|
+
} from "./submodifycouponparams.js";
|
|
6
10
|
import {
|
|
7
11
|
SubModifyGroupedInvoicingParams,
|
|
8
12
|
SubModifyGroupedInvoicingParams$zodSchema,
|
|
@@ -15,6 +19,10 @@ import {
|
|
|
15
19
|
SubModifyQuantityChangeRequest,
|
|
16
20
|
SubModifyQuantityChangeRequest$zodSchema,
|
|
17
21
|
} from "./submodifyquantitychangerequest.js";
|
|
22
|
+
import {
|
|
23
|
+
SubModifyTaxParams,
|
|
24
|
+
SubModifyTaxParams$zodSchema,
|
|
25
|
+
} from "./submodifytaxparams.js";
|
|
18
26
|
import {
|
|
19
27
|
SubModifyTrialEndRequest,
|
|
20
28
|
SubModifyTrialEndRequest$zodSchema,
|
|
@@ -25,9 +33,11 @@ import {
|
|
|
25
33
|
} from "./subscriptionmodifytype.js";
|
|
26
34
|
|
|
27
35
|
export type ExecuteSubscriptionModifyRequest = {
|
|
36
|
+
coupon_params?: SubModifyCouponParams | undefined;
|
|
28
37
|
grouped_invoicing_params?: SubModifyGroupedInvoicingParams | undefined;
|
|
29
38
|
inheritance_params?: SubModifyInheritanceRequest | undefined;
|
|
30
39
|
quantity_change_params?: SubModifyQuantityChangeRequest | undefined;
|
|
40
|
+
tax_params?: SubModifyTaxParams | undefined;
|
|
31
41
|
trial_end_params?: SubModifyTrialEndRequest | undefined;
|
|
32
42
|
type: SubscriptionModifyType;
|
|
33
43
|
};
|
|
@@ -35,10 +45,12 @@ export type ExecuteSubscriptionModifyRequest = {
|
|
|
35
45
|
export const ExecuteSubscriptionModifyRequest$zodSchema: z.ZodType<
|
|
36
46
|
ExecuteSubscriptionModifyRequest
|
|
37
47
|
> = z.object({
|
|
48
|
+
coupon_params: SubModifyCouponParams$zodSchema.optional(),
|
|
38
49
|
grouped_invoicing_params: SubModifyGroupedInvoicingParams$zodSchema
|
|
39
50
|
.optional(),
|
|
40
51
|
inheritance_params: SubModifyInheritanceRequest$zodSchema.optional(),
|
|
41
52
|
quantity_change_params: SubModifyQuantityChangeRequest$zodSchema.optional(),
|
|
53
|
+
tax_params: SubModifyTaxParams$zodSchema.optional(),
|
|
42
54
|
trial_end_params: SubModifyTrialEndRequest$zodSchema.optional(),
|
|
43
55
|
type: SubscriptionModifyType$zodSchema,
|
|
44
56
|
});
|
|
@@ -10,6 +10,7 @@ export const FailurePointType = {
|
|
|
10
10
|
MeterLookup: "meter_lookup",
|
|
11
11
|
PriceLookup: "price_lookup",
|
|
12
12
|
SubscriptionLineItemLookup: "subscription_line_item_lookup",
|
|
13
|
+
AttributedToCustomer: "attributed_to_customer",
|
|
13
14
|
} as const;
|
|
14
15
|
export type FailurePointType = ClosedEnum<typeof FailurePointType>;
|
|
15
16
|
|
|
@@ -18,4 +19,5 @@ export const FailurePointType$zodSchema = z.enum([
|
|
|
18
19
|
"meter_lookup",
|
|
19
20
|
"price_lookup",
|
|
20
21
|
"subscription_line_item_lookup",
|
|
22
|
+
"attributed_to_customer",
|
|
21
23
|
]);
|
|
@@ -6,6 +6,7 @@ import * as z from "zod";
|
|
|
6
6
|
import { WindowSize, WindowSize$zodSchema } from "./windowsize.js";
|
|
7
7
|
|
|
8
8
|
export type GetUsageAnalyticsRequest = {
|
|
9
|
+
breakdown_bucket?: boolean | undefined;
|
|
9
10
|
end_time?: string | undefined;
|
|
10
11
|
expand?: Array<string> | undefined;
|
|
11
12
|
external_customer_id?: string | undefined;
|
|
@@ -21,6 +22,9 @@ export type GetUsageAnalyticsRequest = {
|
|
|
21
22
|
export const GetUsageAnalyticsRequest$zodSchema: z.ZodType<
|
|
22
23
|
GetUsageAnalyticsRequest
|
|
23
24
|
> = z.object({
|
|
25
|
+
breakdown_bucket: z.boolean().optional().describe(
|
|
26
|
+
"BreakdownBucket when true augments each time-series point with BucketID/PriceID\nand appends a BucketSummaries rollup to each item. Requires WindowSize to be set\nand the item to be linked to a subscription line item that has CommitmentTimeBuckets.\nDefault: false (opt-in, backward compatible).",
|
|
27
|
+
),
|
|
24
28
|
end_time: z.iso.datetime({ offset: true }).optional(),
|
|
25
29
|
expand: z.array(z.string()).optional().describe(
|
|
26
30
|
"allowed values: \"price\", \"meter\", \"feature\", \"subscription_line_item\",\"plan\",\"addon\"",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const InheritanceAction = {
|
|
9
|
+
Add: "add",
|
|
10
|
+
Remove: "remove",
|
|
11
|
+
} as const;
|
|
12
|
+
export type InheritanceAction = ClosedEnum<typeof InheritanceAction>;
|
|
13
|
+
|
|
14
|
+
export const InheritanceAction$zodSchema = z.enum([
|
|
15
|
+
"add",
|
|
16
|
+
"remove",
|
|
17
|
+
]);
|
|
@@ -4,12 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
7
|
+
import {
|
|
8
|
+
CommitmentBucketRequest,
|
|
9
|
+
CommitmentBucketRequest$zodSchema,
|
|
10
|
+
} from "./commitmentbucketrequest.js";
|
|
7
11
|
import { CommitmentType, CommitmentType$zodSchema } from "./commitmenttype.js";
|
|
8
12
|
|
|
9
13
|
export type LineItemCommitmentConfig = {
|
|
10
14
|
commitment_amount?: number | undefined;
|
|
11
15
|
commitment_duration?: BillingPeriod | undefined;
|
|
12
16
|
commitment_quantity?: number | undefined;
|
|
17
|
+
commitment_time_buckets?: Array<CommitmentBucketRequest> | undefined;
|
|
13
18
|
commitment_type?: CommitmentType | undefined;
|
|
14
19
|
enable_true_up?: boolean | undefined;
|
|
15
20
|
is_window_commitment?: boolean | undefined;
|
|
@@ -26,6 +31,10 @@ export const LineItemCommitmentConfig$zodSchema: z.ZodType<
|
|
|
26
31
|
commitment_quantity: z.number().optional().describe(
|
|
27
32
|
"CommitmentQuantity is the minimum quantity committed for this line item",
|
|
28
33
|
),
|
|
34
|
+
commitment_time_buckets: z.array(CommitmentBucketRequest$zodSchema).optional()
|
|
35
|
+
.describe(
|
|
36
|
+
"CommitmentTimeBuckets defines per-bucket commitment + inline price for\nwindows whose start UTC hour falls within each configured bucket. Each\nbucket carries its own price (materialized by the service). Requires\nIsWindowCommitment=true.",
|
|
37
|
+
),
|
|
29
38
|
commitment_type: CommitmentType$zodSchema.optional(),
|
|
30
39
|
enable_true_up: z.boolean().optional().describe(
|
|
31
40
|
"EnableTrueUp determines if true-up fee should be applied when usage is below commitment",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type MeterUsageAttribution = {
|
|
8
|
+
external_customer_id?: string | undefined;
|
|
9
|
+
meter_id?: string | undefined;
|
|
10
|
+
qty_total?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const MeterUsageAttribution$zodSchema: z.ZodType<MeterUsageAttribution> =
|
|
14
|
+
z.object({
|
|
15
|
+
external_customer_id: z.string().optional(),
|
|
16
|
+
meter_id: z.string().optional(),
|
|
17
|
+
qty_total: z.string().optional(),
|
|
18
|
+
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
7
8
|
import {
|
|
8
9
|
FilterCondition,
|
|
9
10
|
FilterCondition$zodSchema,
|
|
@@ -27,6 +28,7 @@ export const PriceFilterOrder$zodSchema = z.enum([
|
|
|
27
28
|
|
|
28
29
|
export type PriceFilter = {
|
|
29
30
|
allow_expired_prices?: boolean | undefined;
|
|
31
|
+
billing_periods?: Array<BillingPeriod> | undefined;
|
|
30
32
|
end_time?: string | undefined;
|
|
31
33
|
entity_ids?: Array<string> | undefined;
|
|
32
34
|
entity_type?: PriceEntityType | undefined;
|
|
@@ -48,6 +50,7 @@ export type PriceFilter = {
|
|
|
48
50
|
|
|
49
51
|
export const PriceFilter$zodSchema: z.ZodType<PriceFilter> = z.object({
|
|
50
52
|
allow_expired_prices: z.boolean().default(false),
|
|
53
|
+
billing_periods: z.array(BillingPeriod$zodSchema).optional(),
|
|
51
54
|
end_time: z.iso.datetime({ offset: true }).optional(),
|
|
52
55
|
entity_ids: z.array(z.string()).optional(),
|
|
53
56
|
entity_type: PriceEntityType$zodSchema.optional(),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const SubModifyCouponAction = {
|
|
9
|
+
Add: "add",
|
|
10
|
+
Remove: "remove",
|
|
11
|
+
} as const;
|
|
12
|
+
export type SubModifyCouponAction = ClosedEnum<typeof SubModifyCouponAction>;
|
|
13
|
+
|
|
14
|
+
export const SubModifyCouponAction$zodSchema = z.enum([
|
|
15
|
+
"add",
|
|
16
|
+
"remove",
|
|
17
|
+
]);
|