@openmeter/sdk 1.0.0-beta-8a1bc3f3231a → 1.0.0-beta-cd7699299ca5

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.
@@ -1527,6 +1527,8 @@ export const uninstallAppParams = zod.object({
1527
1527
  });
1528
1528
  /**
1529
1529
  * Update the Stripe API key.
1530
+
1531
+ ⚠️ __Deprecated__: Use [`PUT /api/v1/apps/{id}`](#tag/apps/put/api/v1/apps/{id}) instead.
1530
1532
  * @deprecated
1531
1533
  * @summary Update Stripe API key
1532
1534
  */
@@ -5251,6 +5253,9 @@ export const listCustomerSubscriptionsQueryParams = zod.object({
5251
5253
  * List all entitlements for all the subjects and features. This endpoint is intended for administrative purposes only.
5252
5254
  To fetch the entitlements of a specific subject please use the /api/v1/subjects/{subjectKeyOrID}/entitlements endpoint.
5253
5255
  If page is provided that takes precedence and the paginated response is returned.
5256
+
5257
+ ⚠️ __Deprecated__: Use [`GET /api/v2/entitlements`](#tag/entitlements/get/api/v2/entitlements) instead.
5258
+ * @deprecated
5254
5259
  * @summary List all entitlements
5255
5260
  */
5256
5261
  export const listEntitlementsQueryExcludeInactiveDefault = false;
@@ -5309,8 +5314,11 @@ export const listEntitlementsQueryParams = zod.object({
5309
5314
  .describe('Filtering by multiple subjects.\n\nUsage: `?subject=customer-1&subject=customer-2`'),
5310
5315
  });
5311
5316
  /**
5312
- * Get entitlement by id.
5313
- * @summary Get entitlement by id
5317
+ * Get entitlement by ID.
5318
+
5319
+ ⚠️ __Deprecated__: Use [`GET /api/v2/entitlements/{entitlementId}`](#tag/entitlements/get/api/v2/entitlements/{entitlementId}) instead.
5320
+ * @deprecated
5321
+ * @summary Get entitlement by ID
5314
5322
  */
5315
5323
  export const getEntitlementByIdPathEntitlementIdRegExp = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
5316
5324
  export const getEntitlementByIdParams = zod.object({
@@ -5599,7 +5607,7 @@ export const createFeatureBody = zod
5599
5607
  meterGroupByFilters: zod
5600
5608
  .record(zod.string(), zod.coerce.string())
5601
5609
  .optional()
5602
- .describe('Optional meter group by filters.\nUseful if the meter scope is broader than what feature tracks.\nExample scenario would be a meter tracking all token use with groupBy fields for the model,\nthen the feature could filter for model=gpt-4.'),
5610
+ .describe('Optional meter group by filters.\nUseful if the meter scope is broader than what feature tracks.\nExample scenario would be a meter tracking all token use with groupBy fields for the model,\nthen the feature could filter for model=gpt-4.\n\n⚠️ __Deprecated__: Use advancedMeterGroupByFilters instead'),
5603
5611
  meterSlug: zod.coerce
5604
5612
  .string()
5605
5613
  .min(1)
@@ -5631,6 +5639,9 @@ export const deleteFeatureParams = zod.object({
5631
5639
  * List all grants for all the subjects and entitlements. This endpoint is intended for administrative purposes only.
5632
5640
  To fetch the grants of a specific entitlement please use the /api/v1/subjects/{subjectKeyOrID}/entitlements/{entitlementOrFeatureID}/grants endpoint.
5633
5641
  If page is provided that takes precedence and the paginated response is returned.
5642
+
5643
+ ⚠️ __Deprecated__: Use [`GET /api/v2/grants`](#tag/entitlements/get/api/v2/grants) instead.
5644
+ * @deprecated
5634
5645
  * @summary List grants
5635
5646
  */
5636
5647
  export const listGrantsQueryIncludeDeletedDefault = false;
@@ -5682,6 +5693,9 @@ export const listGrantsQueryParams = zod.object({
5682
5693
  /**
5683
5694
  * Voiding a grant means it is no longer valid, it doesn't take part in further balance calculations. Voiding a grant does not retroactively take effect, meaning any usage that has already been attributed to the grant will remain, but future usage cannot be burnt down from the grant.
5684
5695
  For example, if you have a single grant for your metered entitlement with an initial amount of 100, and so far 60 usage has been metered, the grant (and the entitlement itself) would have a balance of 40. If you then void that grant, balance becomes 0, but the 60 previous usage will not be affected.
5696
+
5697
+ ⚠️ __Deprecated__: Use [`DELETE /api/v2/grants/{grantId}`](#tag/entitlements/delete/api/v2/grants/{grantId}) instead.
5698
+ * @deprecated
5685
5699
  * @summary Void grant
5686
5700
  */
5687
5701
  export const voidGrantParams = zod.object({
@@ -6019,7 +6033,7 @@ export const queryMeterQueryParams = zod.object({
6019
6033
  filterGroupBy: zod
6020
6034
  .record(zod.string(), zod.coerce.string())
6021
6035
  .optional()
6022
- .describe('Simple filter for group bys with exact match.\n\nFor example: ?filterGroupBy[vendor]=openai&filterGroupBy[model]=gpt-4-turbo'),
6036
+ .describe('Simple filter for group bys with exact match.\n\nFor example: ?filterGroupBy[vendor]=openai&filterGroupBy[model]=gpt-4-turbo\n\n⚠️ __Deprecated__: Use `advancedMeterGroupByFilters` instead'),
6023
6037
  from: zod.coerce
6024
6038
  .date()
6025
6039
  .optional()
@@ -8425,7 +8439,7 @@ export const queryPortalMeterQueryParams = zod.object({
8425
8439
  filterGroupBy: zod
8426
8440
  .record(zod.string(), zod.coerce.string())
8427
8441
  .optional()
8428
- .describe('Simple filter for group bys with exact match.\n\nFor example: ?filterGroupBy[vendor]=openai&filterGroupBy[model]=gpt-4-turbo'),
8442
+ .describe('Simple filter for group bys with exact match.\n\nFor example: ?filterGroupBy[vendor]=openai&filterGroupBy[model]=gpt-4-turbo\n\n⚠️ __Deprecated__: Use `advancedMeterGroupByFilters` instead'),
8429
8443
  from: zod.coerce
8430
8444
  .date()
8431
8445
  .optional()
@@ -8789,6 +8803,9 @@ export const createStripeCheckoutSessionBody = zod
8789
8803
 
8790
8804
  If the subject doesn't exist, it will be created.
8791
8805
  If the subject exists, it will be partially updated with the provided fields.
8806
+
8807
+ ⚠️ __Deprecated__: Subjects as managable entities are being depracated, use customers with subject key usage attribution instead.
8808
+ * @deprecated
8792
8809
  * @summary Upsert subject
8793
8810
  */
8794
8811
  export const upsertSubjectBodyItem = zod
@@ -8817,10 +8834,13 @@ export const upsertSubjectBodyItem = zod
8817
8834
  .nullish()
8818
8835
  .describe('The Stripe customer ID for the subject.'),
8819
8836
  })
8820
- .describe('A subject is a unique identifier for a user or entity.');
8837
+ .describe('A subject is a unique identifier for a user or entity.\n\n⚠️ __Deprecated__: Subjects as managable entities are being depracated, use customers with subject key usage attribution instead.');
8821
8838
  export const upsertSubjectBody = zod.array(upsertSubjectBodyItem);
8822
8839
  /**
8823
8840
  * Get subject by ID or key.
8841
+
8842
+ ⚠️ __Deprecated__: Subjects as managable entities are being depracated, use customers with subject key usage attribution instead.
8843
+ * @deprecated
8824
8844
  * @summary Get subject
8825
8845
  */
8826
8846
  export const getSubjectParams = zod.object({
@@ -8828,6 +8848,9 @@ export const getSubjectParams = zod.object({
8828
8848
  });
8829
8849
  /**
8830
8850
  * Delete subject by ID or key.
8851
+
8852
+ ⚠️ __Deprecated__: Subjects as managable entities are being depracated, use customers with subject key usage attribution instead.
8853
+ * @deprecated
8831
8854
  * @summary Delete subject
8832
8855
  */
8833
8856
  export const deleteSubjectParams = zod.object({
@@ -8843,6 +8866,9 @@ export const deleteSubjectParams = zod.object({
8843
8866
  A given subject can only have one active (non-deleted) entitlement per featureKey. If you try to create a new entitlement for a featureKey that already has an active entitlement, the request will fail with a 409 error.
8844
8867
 
8845
8868
  Once an entitlement is created you cannot modify it, only delete it.
8869
+
8870
+ ⚠️ __Deprecated__: Use [`POST /api/v2/customers/{customerIdOrKey}/entitlements`](#tag/entitlements/post/api/v2/customers/{customerIdOrKey}/entitlements) instead.
8871
+ * @deprecated
8846
8872
  * @summary Create a subject entitlement
8847
8873
  */
8848
8874
  export const createEntitlementParams = zod.object({
@@ -9038,6 +9064,9 @@ export const createEntitlementBody = zod
9038
9064
  .describe('Create inputs for entitlement');
9039
9065
  /**
9040
9066
  * List all entitlements for a subject. For checking entitlement access, use the /value endpoint instead.
9067
+
9068
+ ⚠️ __Deprecated__: Use [`GET /api/v2/customers/{customerIdOrKey}/entitlements`](#tag/entitlements/get/api/v2/customers/{customerIdOrKey}/entitlements) instead.
9069
+ * @deprecated
9041
9070
  * @summary List subject entitlements
9042
9071
  */
9043
9072
  export const listSubjectEntitlementsParams = zod.object({
@@ -9049,6 +9078,9 @@ export const listSubjectEntitlementsQueryParams = zod.object({
9049
9078
  });
9050
9079
  /**
9051
9080
  * List all grants issued for an entitlement. The entitlement can be defined either by its id or featureKey.
9081
+
9082
+ ⚠️ __Deprecated__: Use [`GET /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants`](#tag/entitlements/get/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants) instead.
9083
+ * @deprecated
9052
9084
  * @summary List subject entitlement grants
9053
9085
  */
9054
9086
  export const listEntitlementGrantsParams = zod.object({
@@ -9072,6 +9104,9 @@ Grants can have a recurrence setting intended to automate the manual reissuing o
9072
9104
  Rollover settings define what happens to the remaining balance of a grant at a reset. Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))
9073
9105
 
9074
9106
  Grants cannot be changed once created, only deleted. This is to ensure that balance is deterministic regardless of when it is queried.
9107
+
9108
+ ⚠️ __Deprecated__: Use [`POST /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants`](#tag/entitlements/post/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants) instead.
9109
+ * @deprecated
9075
9110
  * @summary Create subject entitlement grant
9076
9111
  */
9077
9112
  export const createGrantParams = zod.object({
@@ -9153,6 +9188,9 @@ export const createGrantBody = zod
9153
9188
  * Overriding an entitlement creates a new entitlement from the provided inputs and soft deletes the previous entitlement for the provided subject-feature pair. If the previous entitlement is already deleted or otherwise doesnt exist, the override will fail.
9154
9189
 
9155
9190
  This endpoint is useful for upgrades, downgrades, or other changes to entitlements that require a new entitlement to be created with zero downtime.
9191
+
9192
+ ⚠️ __Deprecated__: Use [`PUT /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/override`](#tag/entitlements/put/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/override) instead.
9193
+ * @deprecated
9156
9194
  * @summary Override subject entitlement
9157
9195
  */
9158
9196
  export const overrideEntitlementParams = zod.object({
@@ -9351,6 +9389,9 @@ export const overrideEntitlementBody = zod
9351
9389
  * This endpoint should be used for access checks and enforcement. All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type.
9352
9390
 
9353
9391
  For convenience reasons, /value works with both entitlementId and featureKey.
9392
+
9393
+ ⚠️ __Deprecated__: Use [`GET /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/value`](#tag/entitlements/get/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/value) instead.
9394
+ * @deprecated
9354
9395
  * @summary Get subject entitlement value
9355
9396
  */
9356
9397
  export const getEntitlementValueParams = zod.object({
@@ -9362,6 +9403,9 @@ export const getEntitlementValueQueryParams = zod.object({
9362
9403
  });
9363
9404
  /**
9364
9405
  * Get entitlement by id. For checking entitlement access, use the /value endpoint instead.
9406
+
9407
+ ⚠️ __Deprecated__: Use [`GET /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}`](#tag/entitlements/get/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}) instead.
9408
+ * @deprecated
9365
9409
  * @summary Get subject entitlement
9366
9410
  */
9367
9411
  export const getEntitlementParams = zod.object({
@@ -9371,6 +9415,9 @@ export const getEntitlementParams = zod.object({
9371
9415
  /**
9372
9416
  * Deleting an entitlement revokes access to the associated feature. As a single subject can only have one entitlement per featureKey, when "migrating" features you have to delete the old entitlements as well.
9373
9417
  As access and status checks can be historical queries, deleting an entitlement populates the deletedAt timestamp. When queried for a time before that, the entitlement is still considered active, you cannot have retroactive changes to access, which is important for, among other things, auditing.
9418
+
9419
+ ⚠️ __Deprecated__: Use [`DELETE /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}`](#tag/entitlements/delete/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}) instead.
9420
+ * @deprecated
9374
9421
  * @summary Delete subject entitlement
9375
9422
  */
9376
9423
  export const deleteEntitlementParams = zod.object({
@@ -9383,6 +9430,9 @@ export const deleteEntitlementParams = zod.object({
9383
9430
  BurndownHistory returns a continous history of segments, where the segments are seperated by events that changed either the grant burndown priority or the usage period.
9384
9431
 
9385
9432
  WindowedHistory returns windowed usage data for the period enriched with balance information and the list of grants that were being burnt down in that window.
9433
+
9434
+ ⚠️ __Deprecated__: Use [`GET /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/history`](#tag/entitlements/get/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/history) instead.
9435
+ * @deprecated
9386
9436
  * @summary Get subject entitlement history
9387
9437
  */
9388
9438
  export const getEntitlementHistoryParams = zod.object({
@@ -9411,6 +9461,9 @@ export const getEntitlementHistoryQueryParams = zod.object({
9411
9461
  * Reset marks the start of a new usage period for the entitlement and initiates grant rollover. At the start of a period usage is zerod out and grants are rolled over based on their rollover settings. It would typically be synced with the subjects billing period to enforce usage based on their subscription.
9412
9462
 
9413
9463
  Usage is automatically reset for metered entitlements based on their usage period, but this endpoint allows to manually reset it at any time. When doing so the period anchor of the entitlement can be changed if needed.
9464
+
9465
+ ⚠️ __Deprecated__: Use [`POST /api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/reset`](#tag/entitlements/post/api/v2/customers/{customerIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/reset) instead.
9466
+ * @deprecated
9414
9467
  * @summary Reset subject entitlement
9415
9468
  */
9416
9469
  export const resetEntitlementUsageParams = zod.object({
@@ -12915,8 +12968,8 @@ export const listEntitlementsV2QueryParams = zod.object({
12915
12968
  .describe('The maximum number of items per page.\n\nDefault is 100.'),
12916
12969
  });
12917
12970
  /**
12918
- * Get entitlement by id.
12919
- * @summary Get entitlement by id
12971
+ * Get entitlement by ID.
12972
+ * @summary Get entitlement by ID
12920
12973
  */
12921
12974
  export const getEntitlementByIdV2PathEntitlementIdRegExp = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
12922
12975
  export const getEntitlementByIdV2Params = zod.object({