@flexprice/sdk 2.1.24 → 2.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/docs/sdk/models/billing-period-behaviour.md +17 -0
  2. package/docs/sdk/models/billing-period-config.md +18 -0
  3. package/docs/sdk/models/create-entitlement-request.md +22 -21
  4. package/docs/sdk/models/create-entity-integration-mapping-request.md +1 -1
  5. package/docs/sdk/models/credit-grant-application-response.md +1 -1
  6. package/docs/sdk/models/entitlement-grant-allocation-behavior.md +17 -0
  7. package/docs/sdk/models/entitlement-grant-duration-unit.md +1 -1
  8. package/docs/sdk/models/entitlement-response.md +34 -33
  9. package/docs/sdk/models/entity-change-behaviour.md +2 -2
  10. package/docs/sdk/models/entity-change-policy.md +4 -4
  11. package/docs/sdk/models/entity-change-result.md +6 -6
  12. package/docs/sdk/models/integration-entity-type.md +2 -2
  13. package/docs/sdk/models/invoice-sync-settings.md +6 -3
  14. package/docs/sdk/models/link-integration-mapping-request.md +1 -1
  15. package/docs/sdk/models/list-usage-records-response.md +16 -0
  16. package/docs/sdk/models/metadata-custom-field-source.md +17 -0
  17. package/docs/sdk/models/metadata-custom-field.md +17 -0
  18. package/docs/sdk/models/on-pending-schedule-policy.md +15 -0
  19. package/docs/sdk/models/plan-price-sync-status-response.md +17 -0
  20. package/docs/sdk/models/plan-response.md +1 -0
  21. package/docs/sdk/models/price-feature-response.md +15 -0
  22. package/docs/sdk/models/price-response.md +1 -0
  23. package/docs/sdk/models/service-period-custom-fields.md +16 -0
  24. package/docs/sdk/models/subscription-change-billing-period-result.md +18 -0
  25. package/docs/sdk/models/subscription-change-conflict-policies.md +15 -0
  26. package/docs/sdk/models/subscription-change-entity-type.md +17 -0
  27. package/docs/sdk/models/subscription-change-v2-request.md +11 -7
  28. package/docs/sdk/models/subscription-change-v2-response.md +16 -11
  29. package/docs/sdk/models/update-entitlement-request.md +1 -0
  30. package/docs/sdk/models/usage-record-filter-order.md +15 -0
  31. package/docs/sdk/models/usage-record-filter.md +31 -0
  32. package/docs/sdk/models/usage-record-response.md +33 -0
  33. package/docs/sdk/models/usage-record-sync-entry.md +20 -0
  34. package/docs/sdks/costs/README.md +0 -72
  35. package/docs/sdks/integrations/README.md +4 -4
  36. package/docs/sdks/prices/README.md +1 -1
  37. package/docs/sdks/subscriptions/README.md +8 -0
  38. package/docs/sdks/usagerecords/README.md +78 -0
  39. package/esm/funcs/prices-get-price-by-lookup-key.js +1 -1
  40. package/esm/funcs/prices-get-price-by-lookup-key.js.map +1 -1
  41. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.d.ts +8 -0
  42. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.d.ts.map +1 -1
  43. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.js +8 -0
  44. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.js.map +1 -1
  45. package/esm/funcs/usage-records-post-usage-records-search.d.ts +17 -0
  46. package/esm/funcs/usage-records-post-usage-records-search.d.ts.map +1 -0
  47. package/esm/funcs/{costs-get-detailed-cost-analytics-v2.js → usage-records-post-usage-records-search.js} +8 -8
  48. package/esm/funcs/usage-records-post-usage-records-search.js.map +1 -0
  49. package/esm/lib/config.d.ts +3 -3
  50. package/esm/lib/config.js +3 -3
  51. package/esm/sdk/costs.d.ts +0 -7
  52. package/esm/sdk/costs.d.ts.map +1 -1
  53. package/esm/sdk/costs.js +0 -10
  54. package/esm/sdk/costs.js.map +1 -1
  55. package/esm/sdk/models/billing-period-behaviour.d.ts +13 -0
  56. package/esm/sdk/models/billing-period-behaviour.d.ts.map +1 -0
  57. package/esm/sdk/models/billing-period-behaviour.js +14 -0
  58. package/esm/sdk/models/billing-period-behaviour.js.map +1 -0
  59. package/esm/sdk/models/billing-period-config.d.ts +20 -0
  60. package/esm/sdk/models/billing-period-config.d.ts.map +1 -0
  61. package/esm/sdk/models/billing-period-config.js +25 -0
  62. package/esm/sdk/models/billing-period-config.js.map +1 -0
  63. package/esm/sdk/models/create-entitlement-request.d.ts +3 -0
  64. package/esm/sdk/models/create-entitlement-request.d.ts.map +1 -1
  65. package/esm/sdk/models/create-entitlement-request.js +3 -0
  66. package/esm/sdk/models/create-entitlement-request.js.map +1 -1
  67. package/esm/sdk/models/credit-grant-application-response.d.ts +1 -1
  68. package/esm/sdk/models/credit-grant-application-response.js +1 -1
  69. package/esm/sdk/models/entitlement-grant-allocation-behavior.d.ts +12 -0
  70. package/esm/sdk/models/entitlement-grant-allocation-behavior.d.ts.map +1 -0
  71. package/esm/sdk/models/entitlement-grant-allocation-behavior.js +13 -0
  72. package/esm/sdk/models/entitlement-grant-allocation-behavior.js.map +1 -0
  73. package/esm/sdk/models/entitlement-grant-duration-unit.d.ts +1 -0
  74. package/esm/sdk/models/entitlement-grant-duration-unit.d.ts.map +1 -1
  75. package/esm/sdk/models/entitlement-grant-duration-unit.js +1 -0
  76. package/esm/sdk/models/entitlement-grant-duration-unit.js.map +1 -1
  77. package/esm/sdk/models/entitlement-response.d.ts +3 -1
  78. package/esm/sdk/models/entitlement-response.d.ts.map +1 -1
  79. package/esm/sdk/models/entitlement-response.js +4 -1
  80. package/esm/sdk/models/entitlement-response.js.map +1 -1
  81. package/esm/sdk/models/entity-change-behaviour.d.ts +1 -0
  82. package/esm/sdk/models/entity-change-behaviour.d.ts.map +1 -1
  83. package/esm/sdk/models/entity-change-behaviour.js +1 -0
  84. package/esm/sdk/models/entity-change-behaviour.js.map +1 -1
  85. package/esm/sdk/models/entity-change-policy.d.ts +3 -0
  86. package/esm/sdk/models/entity-change-policy.d.ts.map +1 -1
  87. package/esm/sdk/models/entity-change-policy.js.map +1 -1
  88. package/esm/sdk/models/entity-change-result.d.ts +2 -2
  89. package/esm/sdk/models/entity-change-result.d.ts.map +1 -1
  90. package/esm/sdk/models/entity-change-result.js +2 -2
  91. package/esm/sdk/models/entity-change-result.js.map +1 -1
  92. package/esm/sdk/models/index.d.ts +16 -0
  93. package/esm/sdk/models/index.d.ts.map +1 -1
  94. package/esm/sdk/models/index.js +16 -0
  95. package/esm/sdk/models/index.js.map +1 -1
  96. package/esm/sdk/models/integration-entity-type.d.ts +1 -0
  97. package/esm/sdk/models/integration-entity-type.d.ts.map +1 -1
  98. package/esm/sdk/models/integration-entity-type.js +1 -0
  99. package/esm/sdk/models/integration-entity-type.js.map +1 -1
  100. package/esm/sdk/models/invoice-sync-settings.d.ts +19 -0
  101. package/esm/sdk/models/invoice-sync-settings.d.ts.map +1 -1
  102. package/esm/sdk/models/invoice-sync-settings.js +8 -0
  103. package/esm/sdk/models/invoice-sync-settings.js.map +1 -1
  104. package/esm/sdk/models/list-usage-records-response.d.ts +13 -0
  105. package/esm/sdk/models/list-usage-records-response.d.ts.map +1 -0
  106. package/esm/sdk/models/list-usage-records-response.js +17 -0
  107. package/esm/sdk/models/list-usage-records-response.js.map +1 -0
  108. package/esm/sdk/models/metadata-custom-field-source.d.ts +10 -0
  109. package/esm/sdk/models/metadata-custom-field-source.d.ts.map +1 -0
  110. package/esm/sdk/models/metadata-custom-field-source.js +11 -0
  111. package/esm/sdk/models/metadata-custom-field-source.js.map +1 -0
  112. package/esm/sdk/models/metadata-custom-field.d.ts +13 -0
  113. package/esm/sdk/models/metadata-custom-field.d.ts.map +1 -0
  114. package/esm/sdk/models/metadata-custom-field.js +22 -0
  115. package/esm/sdk/models/metadata-custom-field.js.map +1 -0
  116. package/esm/sdk/models/on-pending-schedule-policy.d.ts +10 -0
  117. package/esm/sdk/models/on-pending-schedule-policy.d.ts.map +1 -0
  118. package/esm/sdk/models/on-pending-schedule-policy.js +11 -0
  119. package/esm/sdk/models/on-pending-schedule-policy.js.map +1 -0
  120. package/esm/sdk/models/plan-price-sync-status-response.d.ts +12 -0
  121. package/esm/sdk/models/plan-price-sync-status-response.d.ts.map +1 -0
  122. package/esm/sdk/models/plan-price-sync-status-response.js +22 -0
  123. package/esm/sdk/models/plan-price-sync-status-response.js.map +1 -0
  124. package/esm/sdk/models/plan-response.d.ts +2 -0
  125. package/esm/sdk/models/plan-response.d.ts.map +1 -1
  126. package/esm/sdk/models/plan-response.js +3 -0
  127. package/esm/sdk/models/plan-response.js.map +1 -1
  128. package/esm/sdk/models/price-feature-response.d.ts +11 -0
  129. package/esm/sdk/models/price-feature-response.d.ts.map +1 -0
  130. package/esm/sdk/models/price-feature-response.js +20 -0
  131. package/esm/sdk/models/price-feature-response.js.map +1 -0
  132. package/esm/sdk/models/price-response.d.ts +2 -0
  133. package/esm/sdk/models/price-response.d.ts.map +1 -1
  134. package/esm/sdk/models/price-response.js +2 -0
  135. package/esm/sdk/models/price-response.js.map +1 -1
  136. package/esm/sdk/models/service-period-custom-fields.d.ts +11 -0
  137. package/esm/sdk/models/service-period-custom-fields.d.ts.map +1 -0
  138. package/esm/sdk/models/service-period-custom-fields.js +21 -0
  139. package/esm/sdk/models/service-period-custom-fields.js.map +1 -0
  140. package/esm/sdk/models/subscription-change-billing-period-result.d.ts +14 -0
  141. package/esm/sdk/models/subscription-change-billing-period-result.d.ts.map +1 -0
  142. package/esm/sdk/models/subscription-change-billing-period-result.js +25 -0
  143. package/esm/sdk/models/subscription-change-billing-period-result.js.map +1 -0
  144. package/esm/sdk/models/subscription-change-conflict-policies.d.ts +13 -0
  145. package/esm/sdk/models/subscription-change-conflict-policies.d.ts.map +1 -0
  146. package/esm/sdk/models/subscription-change-conflict-policies.js +18 -0
  147. package/esm/sdk/models/subscription-change-conflict-policies.js.map +1 -0
  148. package/esm/sdk/models/subscription-change-entity-type.d.ts +13 -0
  149. package/esm/sdk/models/subscription-change-entity-type.d.ts.map +1 -0
  150. package/esm/sdk/models/subscription-change-entity-type.js +14 -0
  151. package/esm/sdk/models/subscription-change-entity-type.js.map +1 -0
  152. package/esm/sdk/models/subscription-change-v2-request.d.ts +12 -0
  153. package/esm/sdk/models/subscription-change-v2-request.d.ts.map +1 -1
  154. package/esm/sdk/models/subscription-change-v2-request.js +12 -0
  155. package/esm/sdk/models/subscription-change-v2-request.js.map +1 -1
  156. package/esm/sdk/models/subscription-change-v2-response.d.ts +18 -0
  157. package/esm/sdk/models/subscription-change-v2-response.d.ts.map +1 -1
  158. package/esm/sdk/models/subscription-change-v2-response.js +11 -0
  159. package/esm/sdk/models/subscription-change-v2-response.js.map +1 -1
  160. package/esm/sdk/models/update-entitlement-request.d.ts +3 -0
  161. package/esm/sdk/models/update-entitlement-request.d.ts.map +1 -1
  162. package/esm/sdk/models/update-entitlement-request.js +3 -0
  163. package/esm/sdk/models/update-entitlement-request.js.map +1 -1
  164. package/esm/sdk/models/usage-record-filter.d.ts +67 -0
  165. package/esm/sdk/models/usage-record-filter.d.ts.map +1 -0
  166. package/esm/sdk/models/usage-record-filter.js +49 -0
  167. package/esm/sdk/models/usage-record-filter.js.map +1 -0
  168. package/esm/sdk/models/usage-record-response.d.ts +32 -0
  169. package/esm/sdk/models/usage-record-response.d.ts.map +1 -0
  170. package/esm/sdk/models/usage-record-response.js +50 -0
  171. package/esm/sdk/models/usage-record-response.js.map +1 -0
  172. package/esm/sdk/models/usage-record-sync-entry.d.ts +32 -0
  173. package/esm/sdk/models/usage-record-sync-entry.d.ts.map +1 -0
  174. package/esm/sdk/models/usage-record-sync-entry.js +28 -0
  175. package/esm/sdk/models/usage-record-sync-entry.js.map +1 -0
  176. package/esm/sdk/sdk.d.ts +3 -0
  177. package/esm/sdk/sdk.d.ts.map +1 -1
  178. package/esm/sdk/sdk.js +5 -0
  179. package/esm/sdk/sdk.js.map +1 -1
  180. package/esm/sdk/subscriptions.d.ts +8 -0
  181. package/esm/sdk/subscriptions.d.ts.map +1 -1
  182. package/esm/sdk/subscriptions.js +8 -0
  183. package/esm/sdk/subscriptions.js.map +1 -1
  184. package/esm/sdk/usage-records.d.ts +12 -0
  185. package/esm/sdk/usage-records.d.ts.map +1 -0
  186. package/esm/sdk/usage-records.js +18 -0
  187. package/esm/sdk/usage-records.js.map +1 -0
  188. package/jsr.json +1 -1
  189. package/package.json +1 -1
  190. package/src/funcs/prices-get-price-by-lookup-key.ts +1 -1
  191. package/src/funcs/subscriptions-execute-subscription-plan-change-v2.ts +8 -0
  192. package/src/funcs/{costs-get-detailed-cost-analytics-v2.ts → usage-records-post-usage-records-search.ts} +12 -12
  193. package/src/lib/config.ts +3 -3
  194. package/src/sdk/costs.ts +0 -18
  195. package/src/sdk/models/billing-period-behaviour.ts +25 -0
  196. package/src/sdk/models/billing-period-config.ts +57 -0
  197. package/src/sdk/models/create-entitlement-request.ts +10 -0
  198. package/src/sdk/models/credit-grant-application-response.ts +2 -2
  199. package/src/sdk/models/entitlement-grant-allocation-behavior.ts +26 -0
  200. package/src/sdk/models/entitlement-grant-duration-unit.ts +1 -0
  201. package/src/sdk/models/entitlement-response.ts +11 -2
  202. package/src/sdk/models/entity-change-behaviour.ts +1 -0
  203. package/src/sdk/models/entity-change-policy.ts +3 -0
  204. package/src/sdk/models/entity-change-result.ts +5 -5
  205. package/src/sdk/models/index.ts +16 -0
  206. package/src/sdk/models/integration-entity-type.ts +1 -0
  207. package/src/sdk/models/invoice-sync-settings.ts +35 -0
  208. package/src/sdk/models/list-usage-records-response.ts +41 -0
  209. package/src/sdk/models/metadata-custom-field-source.ts +21 -0
  210. package/src/sdk/models/metadata-custom-field.ts +47 -0
  211. package/src/sdk/models/on-pending-schedule-policy.ts +19 -0
  212. package/src/sdk/models/plan-price-sync-status-response.ts +44 -0
  213. package/src/sdk/models/plan-response.ts +9 -0
  214. package/src/sdk/models/price-feature-response.ts +43 -0
  215. package/src/sdk/models/price-response.ts +6 -0
  216. package/src/sdk/models/service-period-custom-fields.ts +42 -0
  217. package/src/sdk/models/subscription-change-billing-period-result.ts +52 -0
  218. package/src/sdk/models/subscription-change-conflict-policies.ts +44 -0
  219. package/src/sdk/models/subscription-change-entity-type.ts +24 -0
  220. package/src/sdk/models/subscription-change-v2-request.ts +35 -0
  221. package/src/sdk/models/subscription-change-v2-response.ts +33 -0
  222. package/src/sdk/models/update-entitlement-request.ts +10 -0
  223. package/src/sdk/models/usage-record-filter.ts +130 -0
  224. package/src/sdk/models/usage-record-response.ts +93 -0
  225. package/src/sdk/models/usage-record-sync-entry.ts +70 -0
  226. package/src/sdk/sdk.ts +6 -0
  227. package/src/sdk/subscriptions.ts +8 -0
  228. package/src/sdk/usage-records.ts +27 -0
  229. package/esm/funcs/costs-get-detailed-cost-analytics-v2.d.ts +0 -17
  230. package/esm/funcs/costs-get-detailed-cost-analytics-v2.d.ts.map +0 -1
  231. package/esm/funcs/costs-get-detailed-cost-analytics-v2.js.map +0 -1
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import {
10
+ PaginationResponse,
11
+ PaginationResponse$inboundSchema,
12
+ } from "./pagination-response.js";
13
+ import { SDKValidationError } from "./sdk-validation-error.js";
14
+ import {
15
+ UsageRecordResponse,
16
+ UsageRecordResponse$inboundSchema,
17
+ } from "./usage-record-response.js";
18
+
19
+ export type ListUsageRecordsResponse = {
20
+ items?: Array<UsageRecordResponse> | undefined;
21
+ pagination?: PaginationResponse | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const ListUsageRecordsResponse$inboundSchema: z.ZodMiniType<
26
+ ListUsageRecordsResponse,
27
+ unknown
28
+ > = z.object({
29
+ items: types.optional(z.array(UsageRecordResponse$inboundSchema)),
30
+ pagination: types.optional(PaginationResponse$inboundSchema),
31
+ });
32
+
33
+ export function listUsageRecordsResponseFromJSON(
34
+ jsonString: string,
35
+ ): SafeParseResult<ListUsageRecordsResponse, SDKValidationError> {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) => ListUsageRecordsResponse$inboundSchema.parse(JSON.parse(x)),
39
+ `Failed to parse 'ListUsageRecordsResponse' from JSON`,
40
+ );
41
+ }
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import * as openEnums from "../../types/enums.js";
7
+ import { OpenEnum } from "../../types/enums.js";
8
+
9
+ export const MetadataCustomFieldSource = {
10
+ Customer: "customer",
11
+ Invoice: "invoice",
12
+ } as const;
13
+ export type MetadataCustomFieldSource = OpenEnum<
14
+ typeof MetadataCustomFieldSource
15
+ >;
16
+
17
+ /** @internal */
18
+ export const MetadataCustomFieldSource$inboundSchema: z.ZodMiniType<
19
+ MetadataCustomFieldSource,
20
+ unknown
21
+ > = openEnums.inboundSchema(MetadataCustomFieldSource);
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import {
11
+ MetadataCustomFieldSource,
12
+ MetadataCustomFieldSource$inboundSchema,
13
+ } from "./metadata-custom-field-source.js";
14
+ import { SDKValidationError } from "./sdk-validation-error.js";
15
+
16
+ export type MetadataCustomField = {
17
+ field?: string | undefined;
18
+ metadataKey?: string | undefined;
19
+ source?: MetadataCustomFieldSource | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const MetadataCustomField$inboundSchema: z.ZodMiniType<
24
+ MetadataCustomField,
25
+ unknown
26
+ > = z.pipe(
27
+ z.object({
28
+ field: types.optional(types.string()),
29
+ metadata_key: types.optional(types.string()),
30
+ source: types.optional(MetadataCustomFieldSource$inboundSchema),
31
+ }),
32
+ z.transform((v) => {
33
+ return remap$(v, {
34
+ "metadata_key": "metadataKey",
35
+ });
36
+ }),
37
+ );
38
+
39
+ export function metadataCustomFieldFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<MetadataCustomField, SDKValidationError> {
42
+ return safeParse(
43
+ jsonString,
44
+ (x) => MetadataCustomField$inboundSchema.parse(JSON.parse(x)),
45
+ `Failed to parse 'MetadataCustomField' from JSON`,
46
+ );
47
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const OnPendingSchedulePolicy = {
9
+ Reject: "reject",
10
+ Supersede: "supersede",
11
+ } as const;
12
+ export type OnPendingSchedulePolicy = ClosedEnum<
13
+ typeof OnPendingSchedulePolicy
14
+ >;
15
+
16
+ /** @internal */
17
+ export const OnPendingSchedulePolicy$outboundSchema: z.ZodMiniEnum<
18
+ typeof OnPendingSchedulePolicy
19
+ > = z.enum(OnPendingSchedulePolicy);
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "./sdk-validation-error.js";
11
+
12
+ export type PlanPriceSyncStatusResponse = {
13
+ currentSequence?: number | undefined;
14
+ synced?: boolean | undefined;
15
+ unsyncedSubscriptionCount?: number | undefined;
16
+ };
17
+
18
+ /** @internal */
19
+ export const PlanPriceSyncStatusResponse$inboundSchema: z.ZodMiniType<
20
+ PlanPriceSyncStatusResponse,
21
+ unknown
22
+ > = z.pipe(
23
+ z.object({
24
+ current_sequence: types.optional(types.number()),
25
+ synced: types.optional(types.boolean()),
26
+ unsynced_subscription_count: types.optional(types.number()),
27
+ }),
28
+ z.transform((v) => {
29
+ return remap$(v, {
30
+ "current_sequence": "currentSequence",
31
+ "unsynced_subscription_count": "unsyncedSubscriptionCount",
32
+ });
33
+ }),
34
+ );
35
+
36
+ export function planPriceSyncStatusResponseFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<PlanPriceSyncStatusResponse, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) => PlanPriceSyncStatusResponse$inboundSchema.parse(JSON.parse(x)),
42
+ `Failed to parse 'PlanPriceSyncStatusResponse' from JSON`,
43
+ );
44
+ }
@@ -15,6 +15,10 @@ import {
15
15
  EntitlementResponse,
16
16
  EntitlementResponse$inboundSchema,
17
17
  } from "./entitlement-response.js";
18
+ import {
19
+ PlanPriceSyncStatusResponse,
20
+ PlanPriceSyncStatusResponse$inboundSchema,
21
+ } from "./plan-price-sync-status-response.js";
18
22
  import {
19
23
  PriceResponse,
20
24
  PriceResponse$inboundSchema,
@@ -34,6 +38,7 @@ export type PlanResponse = {
34
38
  lookupKey?: string | undefined;
35
39
  metadata?: { [k: string]: string } | undefined;
36
40
  name?: string | undefined;
41
+ priceSyncStatus?: PlanPriceSyncStatusResponse | undefined;
37
42
  /**
38
43
  * TODO: Add inline addons
39
44
  */
@@ -61,6 +66,9 @@ export const PlanResponse$inboundSchema: z.ZodMiniType<PlanResponse, unknown> =
61
66
  lookup_key: types.optional(types.string()),
62
67
  metadata: types.optional(z.record(z.string(), types.string())),
63
68
  name: types.optional(types.string()),
69
+ price_sync_status: types.optional(
70
+ PlanPriceSyncStatusResponse$inboundSchema,
71
+ ),
64
72
  prices: types.optional(
65
73
  z.array(z.lazy(() => PriceResponse$inboundSchema)),
66
74
  ),
@@ -77,6 +85,7 @@ export const PlanResponse$inboundSchema: z.ZodMiniType<PlanResponse, unknown> =
77
85
  "display_order": "displayOrder",
78
86
  "environment_id": "environmentId",
79
87
  "lookup_key": "lookupKey",
88
+ "price_sync_status": "priceSyncStatus",
80
89
  "tenant_id": "tenantId",
81
90
  "updated_at": "updatedAt",
82
91
  "updated_by": "updatedBy",
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import {
11
+ ReportingUnit,
12
+ ReportingUnit$inboundSchema,
13
+ } from "./reporting-unit.js";
14
+ import { SDKValidationError } from "./sdk-validation-error.js";
15
+
16
+ export type PriceFeatureResponse = {
17
+ reportingUnit?: ReportingUnit | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const PriceFeatureResponse$inboundSchema: z.ZodMiniType<
22
+ PriceFeatureResponse,
23
+ unknown
24
+ > = z.pipe(
25
+ z.object({
26
+ reporting_unit: types.optional(ReportingUnit$inboundSchema),
27
+ }),
28
+ z.transform((v) => {
29
+ return remap$(v, {
30
+ "reporting_unit": "reportingUnit",
31
+ });
32
+ }),
33
+ );
34
+
35
+ export function priceFeatureResponseFromJSON(
36
+ jsonString: string,
37
+ ): SafeParseResult<PriceFeatureResponse, SDKValidationError> {
38
+ return safeParse(
39
+ jsonString,
40
+ (x) => PriceFeatureResponse$inboundSchema.parse(JSON.parse(x)),
41
+ `Failed to parse 'PriceFeatureResponse' from JSON`,
42
+ );
43
+ }
@@ -38,6 +38,10 @@ import {
38
38
  PriceEntityType,
39
39
  PriceEntityType$inboundSchema,
40
40
  } from "./price-entity-type.js";
41
+ import {
42
+ PriceFeatureResponse,
43
+ PriceFeatureResponse$inboundSchema,
44
+ } from "./price-feature-response.js";
41
45
  import {
42
46
  PriceJSONBTransformQuantity,
43
47
  PriceJSONBTransformQuantity$inboundSchema,
@@ -116,6 +120,7 @@ export type PriceResponse = {
116
120
  * EnvironmentID is the environment identifier for the price
117
121
  */
118
122
  environmentId?: string | undefined;
123
+ feature?: PriceFeatureResponse | undefined;
119
124
  group?: GroupResponse | undefined;
120
125
  /**
121
126
  * GroupID references the group this price belongs to
@@ -217,6 +222,7 @@ export const PriceResponse$inboundSchema: z.ZodMiniType<
217
222
  entity_id: types.optional(types.string()),
218
223
  entity_type: types.optional(PriceEntityType$inboundSchema),
219
224
  environment_id: types.optional(types.string()),
225
+ feature: types.optional(PriceFeatureResponse$inboundSchema),
220
226
  group: types.optional(GroupResponse$inboundSchema),
221
227
  group_id: types.optional(types.string()),
222
228
  id: types.optional(types.string()),
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "./sdk-validation-error.js";
11
+
12
+ export type ServicePeriodCustomFields = {
13
+ endFieldId?: string | undefined;
14
+ startFieldId?: string | undefined;
15
+ };
16
+
17
+ /** @internal */
18
+ export const ServicePeriodCustomFields$inboundSchema: z.ZodMiniType<
19
+ ServicePeriodCustomFields,
20
+ unknown
21
+ > = z.pipe(
22
+ z.object({
23
+ end_field_id: types.optional(types.string()),
24
+ start_field_id: types.optional(types.string()),
25
+ }),
26
+ z.transform((v) => {
27
+ return remap$(v, {
28
+ "end_field_id": "endFieldId",
29
+ "start_field_id": "startFieldId",
30
+ });
31
+ }),
32
+ );
33
+
34
+ export function servicePeriodCustomFieldsFromJSON(
35
+ jsonString: string,
36
+ ): SafeParseResult<ServicePeriodCustomFields, SDKValidationError> {
37
+ return safeParse(
38
+ jsonString,
39
+ (x) => ServicePeriodCustomFields$inboundSchema.parse(JSON.parse(x)),
40
+ `Failed to parse 'ServicePeriodCustomFields' from JSON`,
41
+ );
42
+ }
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import {
11
+ BillingPeriodBehaviour,
12
+ BillingPeriodBehaviour$inboundSchema,
13
+ } from "./billing-period-behaviour.js";
14
+ import { SDKValidationError } from "./sdk-validation-error.js";
15
+
16
+ export type SubscriptionChangeBillingPeriodResult = {
17
+ behaviour?: BillingPeriodBehaviour | undefined;
18
+ billingAnchor?: Date | undefined;
19
+ currentPeriodEnd?: Date | undefined;
20
+ currentPeriodStart?: Date | undefined;
21
+ };
22
+
23
+ /** @internal */
24
+ export const SubscriptionChangeBillingPeriodResult$inboundSchema: z.ZodMiniType<
25
+ SubscriptionChangeBillingPeriodResult,
26
+ unknown
27
+ > = z.pipe(
28
+ z.object({
29
+ behaviour: types.optional(BillingPeriodBehaviour$inboundSchema),
30
+ billing_anchor: types.optional(types.date()),
31
+ current_period_end: types.optional(types.date()),
32
+ current_period_start: types.optional(types.date()),
33
+ }),
34
+ z.transform((v) => {
35
+ return remap$(v, {
36
+ "billing_anchor": "billingAnchor",
37
+ "current_period_end": "currentPeriodEnd",
38
+ "current_period_start": "currentPeriodStart",
39
+ });
40
+ }),
41
+ );
42
+
43
+ export function subscriptionChangeBillingPeriodResultFromJSON(
44
+ jsonString: string,
45
+ ): SafeParseResult<SubscriptionChangeBillingPeriodResult, SDKValidationError> {
46
+ return safeParse(
47
+ jsonString,
48
+ (x) =>
49
+ SubscriptionChangeBillingPeriodResult$inboundSchema.parse(JSON.parse(x)),
50
+ `Failed to parse 'SubscriptionChangeBillingPeriodResult' from JSON`,
51
+ );
52
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ OnPendingSchedulePolicy,
9
+ OnPendingSchedulePolicy$outboundSchema,
10
+ } from "./on-pending-schedule-policy.js";
11
+
12
+ export type SubscriptionChangeConflictPolicies = {
13
+ onPendingSchedule?: OnPendingSchedulePolicy | undefined;
14
+ };
15
+
16
+ /** @internal */
17
+ export type SubscriptionChangeConflictPolicies$Outbound = {
18
+ on_pending_schedule?: string | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export const SubscriptionChangeConflictPolicies$outboundSchema: z.ZodMiniType<
23
+ SubscriptionChangeConflictPolicies$Outbound,
24
+ SubscriptionChangeConflictPolicies
25
+ > = z.pipe(
26
+ z.object({
27
+ onPendingSchedule: z.optional(OnPendingSchedulePolicy$outboundSchema),
28
+ }),
29
+ z.transform((v) => {
30
+ return remap$(v, {
31
+ onPendingSchedule: "on_pending_schedule",
32
+ });
33
+ }),
34
+ );
35
+
36
+ export function subscriptionChangeConflictPoliciesToJSON(
37
+ subscriptionChangeConflictPolicies: SubscriptionChangeConflictPolicies,
38
+ ): string {
39
+ return JSON.stringify(
40
+ SubscriptionChangeConflictPolicies$outboundSchema.parse(
41
+ subscriptionChangeConflictPolicies,
42
+ ),
43
+ );
44
+ }
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import * as openEnums from "../../types/enums.js";
7
+ import { OpenEnum } from "../../types/enums.js";
8
+
9
+ export const SubscriptionChangeEntityType = {
10
+ Plan: "plan",
11
+ Addon: "addon",
12
+ CreditGrant: "credit_grant",
13
+ Entitlement: "entitlement",
14
+ EntitlementGrant: "entitlement_grant",
15
+ } as const;
16
+ export type SubscriptionChangeEntityType = OpenEnum<
17
+ typeof SubscriptionChangeEntityType
18
+ >;
19
+
20
+ /** @internal */
21
+ export const SubscriptionChangeEntityType$inboundSchema: z.ZodMiniType<
22
+ SubscriptionChangeEntityType,
23
+ unknown
24
+ > = openEnums.inboundSchema(SubscriptionChangeEntityType);
@@ -4,10 +4,25 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ BillingPeriodBehaviour,
9
+ BillingPeriodBehaviour$outboundSchema,
10
+ } from "./billing-period-behaviour.js";
11
+ import {
12
+ BillingPeriodConfig,
13
+ BillingPeriodConfig$Outbound,
14
+ BillingPeriodConfig$outboundSchema,
15
+ } from "./billing-period-config.js";
7
16
  import {
8
17
  ProrationBehavior,
9
18
  ProrationBehavior$outboundSchema,
10
19
  } from "./proration-behavior.js";
20
+ import { ScheduleType, ScheduleType$outboundSchema } from "./schedule-type.js";
21
+ import {
22
+ SubscriptionChangeConflictPolicies,
23
+ SubscriptionChangeConflictPolicies$Outbound,
24
+ SubscriptionChangeConflictPolicies$outboundSchema,
25
+ } from "./subscription-change-conflict-policies.js";
11
26
  import {
12
27
  SubscriptionChangeEntityPolicies,
13
28
  SubscriptionChangeEntityPolicies$Outbound,
@@ -15,18 +30,28 @@ import {
15
30
  } from "./subscription-change-entity-policies.js";
16
31
 
17
32
  export type SubscriptionChangeV2Request = {
33
+ billingPeriodBehaviour?: BillingPeriodBehaviour | undefined;
34
+ billingPeriodConfig?: BillingPeriodConfig | undefined;
35
+ changeAt?: ScheduleType | undefined;
18
36
  entityPolicies?: SubscriptionChangeEntityPolicies | undefined;
19
37
  idempotencyKey?: string | undefined;
20
38
  metadata?: { [k: string]: string } | undefined;
39
+ onConflictPolicies?: SubscriptionChangeConflictPolicies | undefined;
21
40
  prorationBehavior: ProrationBehavior;
22
41
  targetPlanId: string;
23
42
  };
24
43
 
25
44
  /** @internal */
26
45
  export type SubscriptionChangeV2Request$Outbound = {
46
+ billing_period_behaviour?: string | undefined;
47
+ billing_period_config?: BillingPeriodConfig$Outbound | undefined;
48
+ change_at?: string | undefined;
27
49
  entity_policies?: SubscriptionChangeEntityPolicies$Outbound | undefined;
28
50
  idempotency_key?: string | undefined;
29
51
  metadata?: { [k: string]: string } | undefined;
52
+ on_conflict_policies?:
53
+ | SubscriptionChangeConflictPolicies$Outbound
54
+ | undefined;
30
55
  proration_behavior: string;
31
56
  target_plan_id: string;
32
57
  };
@@ -37,16 +62,26 @@ export const SubscriptionChangeV2Request$outboundSchema: z.ZodMiniType<
37
62
  SubscriptionChangeV2Request
38
63
  > = z.pipe(
39
64
  z.object({
65
+ billingPeriodBehaviour: z.optional(BillingPeriodBehaviour$outboundSchema),
66
+ billingPeriodConfig: z.optional(BillingPeriodConfig$outboundSchema),
67
+ changeAt: z.optional(ScheduleType$outboundSchema),
40
68
  entityPolicies: z.optional(SubscriptionChangeEntityPolicies$outboundSchema),
41
69
  idempotencyKey: z.optional(z.string()),
42
70
  metadata: z.optional(z.record(z.string(), z.string())),
71
+ onConflictPolicies: z.optional(
72
+ SubscriptionChangeConflictPolicies$outboundSchema,
73
+ ),
43
74
  prorationBehavior: ProrationBehavior$outboundSchema,
44
75
  targetPlanId: z.string(),
45
76
  }),
46
77
  z.transform((v) => {
47
78
  return remap$(v, {
79
+ billingPeriodBehaviour: "billing_period_behaviour",
80
+ billingPeriodConfig: "billing_period_config",
81
+ changeAt: "change_at",
48
82
  entityPolicies: "entity_policies",
49
83
  idempotencyKey: "idempotency_key",
84
+ onConflictPolicies: "on_conflict_policies",
50
85
  prorationBehavior: "proration_behavior",
51
86
  targetPlanId: "target_plan_id",
52
87
  });
@@ -17,6 +17,10 @@ import {
17
17
  } from "./entity-change-result.js";
18
18
  import { PlanSummary, PlanSummary$inboundSchema } from "./plan-summary.js";
19
19
  import { SDKValidationError } from "./sdk-validation-error.js";
20
+ import {
21
+ SubscriptionChangeBillingPeriodResult,
22
+ SubscriptionChangeBillingPeriodResult$inboundSchema,
23
+ } from "./subscription-change-billing-period-result.js";
20
24
  import {
21
25
  SubscriptionChangeType,
22
26
  SubscriptionChangeType$inboundSchema,
@@ -27,13 +31,30 @@ import {
27
31
  } from "./subscription-response.js";
28
32
 
29
33
  export type SubscriptionChangeV2Response = {
34
+ billingPeriod?: SubscriptionChangeBillingPeriodResult | undefined;
30
35
  changeType?: SubscriptionChangeType | undefined;
31
36
  changedResources?: ChangedResources | undefined;
32
37
  effectiveAt?: Date | undefined;
33
38
  entityChanges?: Array<EntityChangeResult> | undefined;
34
39
  fromPlan?: PlanSummary | undefined;
40
+ /**
41
+ * IsScheduled is true when the change was deferred to the period end instead
42
+ *
43
+ * @remarks
44
+ * of being applied immediately.
45
+ */
46
+ isScheduled?: boolean | undefined;
35
47
  metadata?: { [k: string]: string } | undefined;
48
+ scheduleId?: string | undefined;
49
+ scheduledAt?: Date | undefined;
36
50
  subscription?: SubscriptionResponse | undefined;
51
+ /**
52
+ * SupersededSchedules lists the plan-change schedules this request cancelled under
53
+ *
54
+ * @remarks
55
+ * on_conflict_policies.on_pending_schedule. Preview reports what execute would cancel.
56
+ */
57
+ supersededSchedules?: Array<string> | undefined;
37
58
  toPlan?: PlanSummary | undefined;
38
59
  warnings?: Array<string> | undefined;
39
60
  };
@@ -44,23 +65,35 @@ export const SubscriptionChangeV2Response$inboundSchema: z.ZodMiniType<
44
65
  unknown
45
66
  > = z.pipe(
46
67
  z.object({
68
+ billing_period: types.optional(
69
+ SubscriptionChangeBillingPeriodResult$inboundSchema,
70
+ ),
47
71
  change_type: types.optional(SubscriptionChangeType$inboundSchema),
48
72
  changed_resources: types.optional(ChangedResources$inboundSchema),
49
73
  effective_at: types.optional(types.date()),
50
74
  entity_changes: types.optional(z.array(EntityChangeResult$inboundSchema)),
51
75
  from_plan: types.optional(PlanSummary$inboundSchema),
76
+ is_scheduled: types.optional(types.boolean()),
52
77
  metadata: types.optional(z.record(z.string(), types.string())),
78
+ schedule_id: types.optional(types.string()),
79
+ scheduled_at: types.optional(types.date()),
53
80
  subscription: types.optional(SubscriptionResponse$inboundSchema),
81
+ superseded_schedules: types.optional(z.array(types.string())),
54
82
  to_plan: types.optional(PlanSummary$inboundSchema),
55
83
  warnings: types.optional(z.array(types.string())),
56
84
  }),
57
85
  z.transform((v) => {
58
86
  return remap$(v, {
87
+ "billing_period": "billingPeriod",
59
88
  "change_type": "changeType",
60
89
  "changed_resources": "changedResources",
61
90
  "effective_at": "effectiveAt",
62
91
  "entity_changes": "entityChanges",
63
92
  "from_plan": "fromPlan",
93
+ "is_scheduled": "isScheduled",
94
+ "schedule_id": "scheduleId",
95
+ "scheduled_at": "scheduledAt",
96
+ "superseded_schedules": "supersededSchedules",
64
97
  "to_plan": "toPlan",
65
98
  });
66
99
  }),
@@ -8,6 +8,10 @@ import {
8
8
  EntitlementAggregationMode,
9
9
  EntitlementAggregationMode$outboundSchema,
10
10
  } from "./entitlement-aggregation-mode.js";
11
+ import {
12
+ EntitlementGrantAllocationBehavior,
13
+ EntitlementGrantAllocationBehavior$outboundSchema,
14
+ } from "./entitlement-grant-allocation-behavior.js";
11
15
  import {
12
16
  EntitlementGrantDurationUnit,
13
17
  EntitlementGrantDurationUnit$outboundSchema,
@@ -31,6 +35,7 @@ export type UpdateEntitlementRequest = {
31
35
  */
32
36
  clearGrantConfig?: boolean | undefined;
33
37
  configValue?: { [k: string]: any } | undefined;
38
+ grantAllocationBehavior?: EntitlementGrantAllocationBehavior | undefined;
34
39
  grantDurationUnit?: EntitlementGrantDurationUnit | undefined;
35
40
  grantDurationValue?: number | undefined;
36
41
  grantMeasure?: EntitlementGrantMeasure | undefined;
@@ -47,6 +52,7 @@ export type UpdateEntitlementRequest$Outbound = {
47
52
  aggregation_mode?: string | undefined;
48
53
  clear_grant_config?: boolean | undefined;
49
54
  config_value?: { [k: string]: any } | undefined;
55
+ grant_allocation_behavior?: string | undefined;
50
56
  grant_duration_unit?: string | undefined;
51
57
  grant_duration_value?: number | undefined;
52
58
  grant_measure?: string | undefined;
@@ -67,6 +73,9 @@ export const UpdateEntitlementRequest$outboundSchema: z.ZodMiniType<
67
73
  aggregationMode: z.optional(EntitlementAggregationMode$outboundSchema),
68
74
  clearGrantConfig: z.optional(z.boolean()),
69
75
  configValue: z.optional(z.record(z.string(), z.any())),
76
+ grantAllocationBehavior: z.optional(
77
+ EntitlementGrantAllocationBehavior$outboundSchema,
78
+ ),
70
79
  grantDurationUnit: z.optional(EntitlementGrantDurationUnit$outboundSchema),
71
80
  grantDurationValue: z.optional(z.int()),
72
81
  grantMeasure: z.optional(EntitlementGrantMeasure$outboundSchema),
@@ -82,6 +91,7 @@ export const UpdateEntitlementRequest$outboundSchema: z.ZodMiniType<
82
91
  aggregationMode: "aggregation_mode",
83
92
  clearGrantConfig: "clear_grant_config",
84
93
  configValue: "config_value",
94
+ grantAllocationBehavior: "grant_allocation_behavior",
85
95
  grantDurationUnit: "grant_duration_unit",
86
96
  grantDurationValue: "grant_duration_value",
87
97
  grantMeasure: "grant_measure",