@flexprice/sdk 2.1.49-dev.26 → 2.1.49-dev.28

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 (43) hide show
  1. package/docs/sdk/models/add-addon-request.md +13 -13
  2. package/docs/sdk/models/add-addon-to-subscription-request.md +11 -11
  3. package/docs/sdk/models/commitment-info.md +15 -12
  4. package/docs/sdk/models/create-subscription-line-item-request.md +6 -6
  5. package/docs/sdk/models/create-subscription-request.md +4 -4
  6. package/docs/sdk/models/grouped-invoicing-child-request.md +4 -4
  7. package/docs/sdk/models/update-subscription-line-item-request.md +20 -20
  8. package/docs/sdk/models/usage-analytic-point.md +3 -0
  9. package/esm/lib/config.d.ts +2 -2
  10. package/esm/lib/config.js +2 -2
  11. package/esm/sdk/models/add-addon-request.d.ts +1 -1
  12. package/esm/sdk/models/add-addon-to-subscription-request.d.ts +1 -1
  13. package/esm/sdk/models/commitment-info.d.ts +15 -0
  14. package/esm/sdk/models/commitment-info.d.ts.map +1 -1
  15. package/esm/sdk/models/commitment-info.js +12 -0
  16. package/esm/sdk/models/commitment-info.js.map +1 -1
  17. package/esm/sdk/models/create-subscription-line-item-request.d.ts +16 -1
  18. package/esm/sdk/models/create-subscription-line-item-request.d.ts.map +1 -1
  19. package/esm/sdk/models/create-subscription-line-item-request.js.map +1 -1
  20. package/esm/sdk/models/create-subscription-request.d.ts +10 -1
  21. package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
  22. package/esm/sdk/models/create-subscription-request.js.map +1 -1
  23. package/esm/sdk/models/grouped-invoicing-child-request.d.ts +10 -1
  24. package/esm/sdk/models/grouped-invoicing-child-request.d.ts.map +1 -1
  25. package/esm/sdk/models/grouped-invoicing-child-request.js.map +1 -1
  26. package/esm/sdk/models/update-subscription-line-item-request.d.ts +17 -1
  27. package/esm/sdk/models/update-subscription-line-item-request.d.ts.map +1 -1
  28. package/esm/sdk/models/update-subscription-line-item-request.js.map +1 -1
  29. package/esm/sdk/models/usage-analytic-point.d.ts +6 -0
  30. package/esm/sdk/models/usage-analytic-point.d.ts.map +1 -1
  31. package/esm/sdk/models/usage-analytic-point.js +6 -0
  32. package/esm/sdk/models/usage-analytic-point.js.map +1 -1
  33. package/jsr.json +1 -1
  34. package/package.json +2 -2
  35. package/src/lib/config.ts +2 -2
  36. package/src/sdk/models/add-addon-request.ts +1 -1
  37. package/src/sdk/models/add-addon-to-subscription-request.ts +1 -1
  38. package/src/sdk/models/commitment-info.ts +29 -0
  39. package/src/sdk/models/create-subscription-line-item-request.ts +16 -1
  40. package/src/sdk/models/create-subscription-request.ts +10 -1
  41. package/src/sdk/models/grouped-invoicing-child-request.ts +10 -1
  42. package/src/sdk/models/update-subscription-line-item-request.ts +17 -1
  43. package/src/sdk/models/usage-analytic-point.ts +13 -0
package/src/lib/config.ts CHANGED
@@ -77,8 +77,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
77
77
  export const SDK_METADATA = {
78
78
  language: "typescript",
79
79
  openapiDocVersion: "1.0",
80
- sdkVersion: "2.1.49-dev.26",
80
+ sdkVersion: "2.1.49-dev.28",
81
81
  genVersion: "2.948.4",
82
82
  userAgent:
83
- "speakeasy-sdk/typescript 2.1.49-dev.26 2.948.4 1.0 @flexprice/sdk",
83
+ "speakeasy-sdk/typescript 2.1.49-dev.28 2.948.4 1.0 @flexprice/sdk",
84
84
  } as const;
@@ -41,7 +41,7 @@ export type AddAddonRequest = {
41
41
  */
42
42
  coupons?: Array<SubscriptionCouponInput> | undefined;
43
43
  /**
44
- * LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)
44
+ * Deprecated: use POST /commitments instead.
45
45
  */
46
46
  lineItemCommitments?: { [k: string]: LineItemCommitmentConfig } | undefined;
47
47
  metadata?: { [k: string]: any } | undefined;
@@ -35,7 +35,7 @@ export type AddAddonToSubscriptionRequest = {
35
35
  */
36
36
  coupons?: Array<SubscriptionCouponInput> | undefined;
37
37
  /**
38
- * LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)
38
+ * Deprecated: use POST /commitments instead.
39
39
  */
40
40
  lineItemCommitments?: { [k: string]: LineItemCommitmentConfig } | undefined;
41
41
  metadata?: { [k: string]: any } | undefined;
@@ -20,13 +20,25 @@ import {
20
20
  import { SDKValidationError } from "./sdk-validation-error.js";
21
21
 
22
22
  export type CommitmentInfo = {
23
+ /**
24
+ * Amount is the commitment amount (v1), or computed_commitment_utilized_amount + computed_true_up_amount (v2).
25
+ */
23
26
  amount?: string | undefined;
24
27
  computedCommitmentUtilizedAmount?: string | undefined;
28
+ /**
29
+ * Usage units behind the computed amounts: usage a billing-terms commitment covers counts as utilized at no
30
+ *
31
+ * @remarks
32
+ * charge, and a quantity commitment's true-up counts its unused units.
33
+ */
34
+ computedCommitmentUtilizedQuantity?: string | undefined;
25
35
  computedOverageAmount?: string | undefined;
36
+ computedOverageQuantity?: string | undefined;
26
37
  /**
27
38
  * total_cost = computed_commitment_utilized_amount + computed_overage_amount + computed_true_up_amount
28
39
  */
29
40
  computedTrueUpAmount?: string | undefined;
41
+ computedTrueUpQuantity?: string | undefined;
30
42
  duration?: BillingPeriod | undefined;
31
43
  isWindowed?: boolean | undefined;
32
44
  overageFactor?: string | undefined;
@@ -46,8 +58,11 @@ export const CommitmentInfo$inboundSchema: z.ZodMiniType<
46
58
  z.object({
47
59
  amount: types.optional(types.string()),
48
60
  computed_commitment_utilized_amount: types.optional(types.string()),
61
+ computed_commitment_utilized_quantity: types.optional(types.string()),
49
62
  computed_overage_amount: types.optional(types.string()),
63
+ computed_overage_quantity: types.optional(types.string()),
50
64
  computed_true_up_amount: types.optional(types.string()),
65
+ computed_true_up_quantity: types.optional(types.string()),
51
66
  duration: types.optional(BillingPeriod$inboundSchema),
52
67
  is_windowed: types.optional(types.boolean()),
53
68
  overage_factor: types.optional(types.string()),
@@ -58,8 +73,12 @@ export const CommitmentInfo$inboundSchema: z.ZodMiniType<
58
73
  z.transform((v) => {
59
74
  return remap$(v, {
60
75
  "computed_commitment_utilized_amount": "computedCommitmentUtilizedAmount",
76
+ "computed_commitment_utilized_quantity":
77
+ "computedCommitmentUtilizedQuantity",
61
78
  "computed_overage_amount": "computedOverageAmount",
79
+ "computed_overage_quantity": "computedOverageQuantity",
62
80
  "computed_true_up_amount": "computedTrueUpAmount",
81
+ "computed_true_up_quantity": "computedTrueUpQuantity",
63
82
  "is_windowed": "isWindowed",
64
83
  "overage_factor": "overageFactor",
65
84
  "true_up_enabled": "trueUpEnabled",
@@ -70,8 +89,11 @@ export const CommitmentInfo$inboundSchema: z.ZodMiniType<
70
89
  export type CommitmentInfo$Outbound = {
71
90
  amount?: string | undefined;
72
91
  computed_commitment_utilized_amount?: string | undefined;
92
+ computed_commitment_utilized_quantity?: string | undefined;
73
93
  computed_overage_amount?: string | undefined;
94
+ computed_overage_quantity?: string | undefined;
74
95
  computed_true_up_amount?: string | undefined;
96
+ computed_true_up_quantity?: string | undefined;
75
97
  duration?: string | undefined;
76
98
  is_windowed?: boolean | undefined;
77
99
  overage_factor?: string | undefined;
@@ -88,8 +110,11 @@ export const CommitmentInfo$outboundSchema: z.ZodMiniType<
88
110
  z.object({
89
111
  amount: z.optional(z.string()),
90
112
  computedCommitmentUtilizedAmount: z.optional(z.string()),
113
+ computedCommitmentUtilizedQuantity: z.optional(z.string()),
91
114
  computedOverageAmount: z.optional(z.string()),
115
+ computedOverageQuantity: z.optional(z.string()),
92
116
  computedTrueUpAmount: z.optional(z.string()),
117
+ computedTrueUpQuantity: z.optional(z.string()),
93
118
  duration: z.optional(BillingPeriod$outboundSchema),
94
119
  isWindowed: z.optional(z.boolean()),
95
120
  overageFactor: z.optional(z.string()),
@@ -100,8 +125,12 @@ export const CommitmentInfo$outboundSchema: z.ZodMiniType<
100
125
  z.transform((v) => {
101
126
  return remap$(v, {
102
127
  computedCommitmentUtilizedAmount: "computed_commitment_utilized_amount",
128
+ computedCommitmentUtilizedQuantity:
129
+ "computed_commitment_utilized_quantity",
103
130
  computedOverageAmount: "computed_overage_amount",
131
+ computedOverageQuantity: "computed_overage_quantity",
104
132
  computedTrueUpAmount: "computed_true_up_amount",
133
+ computedTrueUpQuantity: "computed_true_up_quantity",
105
134
  isWindowed: "is_windowed",
106
135
  overageFactor: "overage_factor",
107
136
  trueUpEnabled: "true_up_enabled",
@@ -29,15 +29,30 @@ import {
29
29
 
30
30
  export type CreateSubscriptionLineItemRequest = {
31
31
  /**
32
- * Commitment fields
32
+ * Deprecated: use POST /commitments instead.
33
33
  */
34
34
  commitmentAmount?: number | undefined;
35
35
  commitmentDuration?: BillingPeriod | undefined;
36
+ /**
37
+ * Deprecated: use POST /commitments instead.
38
+ */
36
39
  commitmentOverageFactor?: number | undefined;
40
+ /**
41
+ * Deprecated: use POST /commitments instead.
42
+ */
37
43
  commitmentQuantity?: number | undefined;
44
+ /**
45
+ * Deprecated: use POST /commitments instead.
46
+ */
38
47
  commitmentTimeBuckets?: Array<CommitmentBucketRequest> | undefined;
48
+ /**
49
+ * Deprecated: use POST /commitments instead.
50
+ */
39
51
  commitmentTrueUpEnabled?: boolean | undefined;
40
52
  commitmentType?: CommitmentType | undefined;
53
+ /**
54
+ * Deprecated: use POST /commitments instead.
55
+ */
41
56
  commitmentWindowed?: boolean | undefined;
42
57
  displayName?: string | undefined;
43
58
  endDate?: Date | undefined;
@@ -122,6 +122,9 @@ export type CreateSubscriptionRequest = {
122
122
  billingPeriodCount?: number | undefined;
123
123
  checkout?: CheckoutParams | undefined;
124
124
  collectionMethod?: CollectionMethod | undefined;
125
+ /**
126
+ * Deprecated: use POST /commitments instead.
127
+ */
125
128
  commitmentAmount?: string | undefined;
126
129
  commitmentDuration?: BillingPeriod | undefined;
127
130
  /**
@@ -141,6 +144,9 @@ export type CreateSubscriptionRequest = {
141
144
  * CustomerID takes priority over ExternalCustomerID when both are provided.
142
145
  */
143
146
  customerId?: string | undefined;
147
+ /**
148
+ * Deprecated: use POST /commitments instead.
149
+ */
144
150
  enableTrueUp?: boolean | undefined;
145
151
  endDate?: Date | undefined;
146
152
  externalCustomerId?: string | undefined;
@@ -168,7 +174,7 @@ export type CreateSubscriptionRequest = {
168
174
  includePriceIds?: Array<string> | undefined;
169
175
  inheritance?: SubscriptionInheritanceConfig | undefined;
170
176
  /**
171
- * LineItemCommitments sets per-line-item commitment config, keyed by price_id.
177
+ * Deprecated: use POST /commitments instead.
172
178
  */
173
179
  lineItemCommitments?: { [k: string]: LineItemCommitmentConfig } | undefined;
174
180
  /**
@@ -182,6 +188,9 @@ export type CreateSubscriptionRequest = {
182
188
  lineItems?: Array<CreateSubscriptionLineItemRequest> | undefined;
183
189
  lookupKey?: string | undefined;
184
190
  metadata?: { [k: string]: string } | undefined;
191
+ /**
192
+ * Deprecated: use POST /commitments instead.
193
+ */
185
194
  overageFactor?: string | undefined;
186
195
  overrideEntitlements?: Array<OverrideEntitlementRequest> | undefined;
187
196
  /**
@@ -65,6 +65,9 @@ import {
65
65
 
66
66
  export type GroupedInvoicingChildRequest = {
67
67
  addons?: Array<AddAddonToSubscriptionRequest> | undefined;
68
+ /**
69
+ * Deprecated: use POST /commitments instead.
70
+ */
68
71
  commitmentAmount?: string | undefined;
69
72
  commitmentDuration?: BillingPeriod | undefined;
70
73
  /**
@@ -72,10 +75,13 @@ export type GroupedInvoicingChildRequest = {
72
75
  */
73
76
  coupons?: Array<string> | undefined;
74
77
  creditGrants?: Array<CreateCreditGrantRequest> | undefined;
78
+ /**
79
+ * Deprecated: use POST /commitments instead.
80
+ */
75
81
  enableTrueUp?: boolean | undefined;
76
82
  externalCustomerId: string;
77
83
  /**
78
- * LineItemCommitments sets per-line-item commitment config, keyed by price_id.
84
+ * Deprecated: use POST /commitments instead.
79
85
  */
80
86
  lineItemCommitments?: { [k: string]: LineItemCommitmentConfig } | undefined;
81
87
  /**
@@ -86,6 +92,9 @@ export type GroupedInvoicingChildRequest = {
86
92
  * LineItems are extra (non-plan) line items added at creation.
87
93
  */
88
94
  lineItems?: Array<CreateSubscriptionLineItemRequest> | undefined;
95
+ /**
96
+ * Deprecated: use POST /commitments instead.
97
+ */
89
98
  overageFactor?: string | undefined;
90
99
  overrideEntitlements?: Array<OverrideEntitlementRequest> | undefined;
91
100
  /**
@@ -39,18 +39,34 @@ export type UpdateSubscriptionLineItemRequest = {
39
39
  billingModel?: BillingModel | undefined;
40
40
  bucketSize?: WindowSize | undefined;
41
41
  /**
42
- * Commitment fields
42
+ * Deprecated: use POST /commitments instead.
43
43
  */
44
44
  commitmentAmount?: number | undefined;
45
45
  commitmentDuration?: BillingPeriod | undefined;
46
+ /**
47
+ * Deprecated: use POST /commitments instead.
48
+ */
46
49
  commitmentOverageFactor?: number | undefined;
50
+ /**
51
+ * Deprecated: use POST /commitments instead.
52
+ */
47
53
  commitmentQuantity?: number | undefined;
48
54
  /**
49
55
  * Pointer so an explicit empty array can clear existing buckets (omission keeps them).
56
+ *
57
+ * @remarks
58
+ *
59
+ * Deprecated: use POST /commitments instead.
50
60
  */
51
61
  commitmentTimeBuckets?: Array<CommitmentBucketRequest> | undefined;
62
+ /**
63
+ * Deprecated: use POST /commitments instead.
64
+ */
52
65
  commitmentTrueUpEnabled?: boolean | undefined;
53
66
  commitmentType?: CommitmentType | undefined;
67
+ /**
68
+ * Deprecated: use POST /commitments instead.
69
+ */
54
70
  commitmentWindowed?: boolean | undefined;
55
71
  /**
56
72
  * EffectiveFrom for the existing line item (if not provided, defaults to now)
@@ -27,8 +27,14 @@ export type UsageAnalyticPoint = {
27
27
  * Commitment breakdown (only populated for windowed commitments)
28
28
  */
29
29
  computedCommitmentUtilizedAmount?: string | undefined;
30
+ /**
31
+ * Usage units behind the commitment breakdown, for v2 commitments
32
+ */
33
+ computedCommitmentUtilizedQuantity?: string | undefined;
30
34
  computedOverageAmount?: string | undefined;
35
+ computedOverageQuantity?: string | undefined;
31
36
  computedTrueUpAmount?: string | undefined;
37
+ computedTrueUpQuantity?: string | undefined;
32
38
  /**
33
39
  * Cost is the final cost after discount (Subtotal - Discount)
34
40
  */
@@ -51,8 +57,11 @@ export const UsageAnalyticPoint$inboundSchema: z.ZodMiniType<
51
57
  z.object({
52
58
  buckets: types.optional(z.array(PointBucket$inboundSchema)),
53
59
  computed_commitment_utilized_amount: types.optional(types.string()),
60
+ computed_commitment_utilized_quantity: types.optional(types.string()),
54
61
  computed_overage_amount: types.optional(types.string()),
62
+ computed_overage_quantity: types.optional(types.string()),
55
63
  computed_true_up_amount: types.optional(types.string()),
64
+ computed_true_up_quantity: types.optional(types.string()),
56
65
  cost: types.optional(types.string()),
57
66
  discount: types.optional(types.string()),
58
67
  event_count: types.optional(types.number()),
@@ -63,8 +72,12 @@ export const UsageAnalyticPoint$inboundSchema: z.ZodMiniType<
63
72
  z.transform((v) => {
64
73
  return remap$(v, {
65
74
  "computed_commitment_utilized_amount": "computedCommitmentUtilizedAmount",
75
+ "computed_commitment_utilized_quantity":
76
+ "computedCommitmentUtilizedQuantity",
66
77
  "computed_overage_amount": "computedOverageAmount",
78
+ "computed_overage_quantity": "computedOverageQuantity",
67
79
  "computed_true_up_amount": "computedTrueUpAmount",
80
+ "computed_true_up_quantity": "computedTrueUpQuantity",
68
81
  "event_count": "eventCount",
69
82
  });
70
83
  }),