@openmeter/sdk 1.0.0-beta-7cf71f2fbc46 → 1.0.0-beta-4a759fce7326

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.
@@ -11496,11 +11496,17 @@ export const createCustomerEntitlementV2BodyFeatureKeyMax = 64;
11496
11496
  export const createCustomerEntitlementV2BodyFeatureKeyRegExp = new RegExp('^[a-z0-9]+(?:_[a-z0-9]+)*$');
11497
11497
  export const createCustomerEntitlementV2BodyFeatureIdRegExp = new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$');
11498
11498
  export const createCustomerEntitlementV2BodyIsSoftLimitDefault = false;
11499
- export const createCustomerEntitlementV2BodyIsUnlimitedDefault = false;
11499
+ export const createCustomerEntitlementV2BodyPreserveOverageAtResetDefault = false;
11500
11500
  export const createCustomerEntitlementV2BodyIssueAfterResetMin = 0;
11501
11501
  export const createCustomerEntitlementV2BodyIssueAfterResetPriorityDefault = 1;
11502
11502
  export const createCustomerEntitlementV2BodyIssueAfterResetPriorityMax = 255;
11503
- export const createCustomerEntitlementV2BodyPreserveOverageAtResetDefault = false;
11503
+ export const createCustomerEntitlementV2BodyIssueAmountMin = 0;
11504
+ export const createCustomerEntitlementV2BodyIssuePriorityDefault = 1;
11505
+ export const createCustomerEntitlementV2BodyIssuePriorityMax = 255;
11506
+ export const createCustomerEntitlementV2BodyGrantsItemAmountMin = 0;
11507
+ export const createCustomerEntitlementV2BodyGrantsItemPriorityMax = 255;
11508
+ export const createCustomerEntitlementV2BodyGrantsItemMinRolloverAmountDefault = 0;
11509
+ export const createCustomerEntitlementV2BodyGrantsItemExpirationCountMax = 1000;
11504
11510
  export const createCustomerEntitlementV2BodyFeatureKeyMaxOne = 64;
11505
11511
  export const createCustomerEntitlementV2BodyFeatureKeyRegExpOne = new RegExp('^[a-z0-9]+(?:_[a-z0-9]+)*$');
11506
11512
  export const createCustomerEntitlementV2BodyFeatureIdRegExpOne = new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$');
@@ -11523,10 +11529,100 @@ export const createCustomerEntitlementV2Body = zod
11523
11529
  .regex(createCustomerEntitlementV2BodyFeatureKeyRegExp)
11524
11530
  .optional()
11525
11531
  .describe('The feature the subject is entitled to use.\nEither featureKey or featureId is required.'),
11532
+ grants: zod
11533
+ .array(zod
11534
+ .object({
11535
+ amount: zod.coerce
11536
+ .number()
11537
+ .min(createCustomerEntitlementV2BodyGrantsItemAmountMin)
11538
+ .describe('The amount to grant. Should be a positive number.'),
11539
+ annotations: zod
11540
+ .record(zod.string(), zod.any())
11541
+ .describe('Set of key-value pairs managed by the system. Cannot be modified by user.')
11542
+ .optional()
11543
+ .describe('The grant metadata.'),
11544
+ effectiveAt: zod.coerce
11545
+ .date()
11546
+ .describe('Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute).'),
11547
+ expiration: zod
11548
+ .object({
11549
+ count: zod.coerce
11550
+ .number()
11551
+ .min(1)
11552
+ .max(createCustomerEntitlementV2BodyGrantsItemExpirationCountMax)
11553
+ .describe('The number of time units in the expiration period.'),
11554
+ duration: zod
11555
+ .enum(['HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR'])
11556
+ .describe('The expiration duration enum')
11557
+ .describe('The unit of time for the expiration period.'),
11558
+ })
11559
+ .describe('The grant expiration definition')
11560
+ .optional()
11561
+ .describe('The grant expiration definition. If no expiration is provided, the grant can be active indefinitely.'),
11562
+ maxRolloverAmount: zod.coerce
11563
+ .number()
11564
+ .optional()
11565
+ .describe('Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. The default value equals grant amount.\nBalance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))'),
11566
+ metadata: zod
11567
+ .record(zod.string(), zod.coerce.string())
11568
+ .describe('Set of key-value pairs.\nMetadata can be used to store additional information about a resource.')
11569
+ .optional()
11570
+ .describe('The grant metadata.'),
11571
+ minRolloverAmount: zod.coerce
11572
+ .number()
11573
+ .optional()
11574
+ .describe('Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset.\nBalance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))'),
11575
+ priority: zod.coerce
11576
+ .number()
11577
+ .min(1)
11578
+ .max(createCustomerEntitlementV2BodyGrantsItemPriorityMax)
11579
+ .optional()
11580
+ .describe('The priority of the grant. Grants with higher priority are applied first.\nPriority is a positive decimal numbers. With lower numbers indicating higher importance.\nFor example, a priority of 1 is more urgent than a priority of 2.\nWhen there are several grants available for the same subject, the system selects the grant with the highest priority.\nIn cases where grants share the same priority level, the grant closest to its expiration will be used first.\nIn the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first.'),
11581
+ recurrence: zod
11582
+ .object({
11583
+ anchor: zod.coerce
11584
+ .date()
11585
+ .optional()
11586
+ .describe('A date-time anchor to base the recurring period on.'),
11587
+ interval: zod
11588
+ .union([
11589
+ zod.coerce
11590
+ .string()
11591
+ .regex(createCustomerEntitlementV2BodyGrantsItemRecurrenceIntervalRegExpTwo),
11592
+ zod
11593
+ .enum(['DAY', 'WEEK', 'MONTH', 'YEAR'])
11594
+ .describe('The unit of time for the interval.\nOne of: `day`, `week`, `month`, or `year`.'),
11595
+ ])
11596
+ .describe('Period duration for the recurrence')
11597
+ .describe('The unit of time for the interval.'),
11598
+ })
11599
+ .describe('Recurring period with an interval and an anchor.')
11600
+ .optional()
11601
+ .describe('The subject of the grant.'),
11602
+ })
11603
+ .describe('The grant creation input.'))
11604
+ .optional()
11605
+ .describe('Grants'),
11526
11606
  isSoftLimit: zod.coerce
11527
11607
  .boolean()
11528
11608
  .optional()
11529
11609
  .describe('If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true.'),
11610
+ issue: zod
11611
+ .object({
11612
+ amount: zod.coerce
11613
+ .number()
11614
+ .min(createCustomerEntitlementV2BodyIssueAmountMin)
11615
+ .describe('The initial grant amount'),
11616
+ priority: zod.coerce
11617
+ .number()
11618
+ .min(1)
11619
+ .max(createCustomerEntitlementV2BodyIssuePriorityMax)
11620
+ .default(createCustomerEntitlementV2BodyIssuePriorityDefault)
11621
+ .describe('The priority of the issue after reset'),
11622
+ })
11623
+ .describe('Issue after reset')
11624
+ .optional()
11625
+ .describe('Issue after reset'),
11530
11626
  issueAfterReset: zod.coerce
11531
11627
  .number()
11532
11628
  .min(createCustomerEntitlementV2BodyIssueAfterResetMin)
@@ -11538,10 +11634,6 @@ export const createCustomerEntitlementV2Body = zod
11538
11634
  .max(createCustomerEntitlementV2BodyIssueAfterResetPriorityMax)
11539
11635
  .default(createCustomerEntitlementV2BodyIssueAfterResetPriorityDefault)
11540
11636
  .describe('Defines the grant priority for the default grant.'),
11541
- isUnlimited: zod.coerce
11542
- .boolean()
11543
- .optional()
11544
- .describe('Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future.'),
11545
11637
  measureUsageFrom: zod
11546
11638
  .union([
11547
11639
  zod
@@ -11585,7 +11677,7 @@ export const createCustomerEntitlementV2Body = zod
11585
11677
  .describe('Recurring period with an interval and an anchor.')
11586
11678
  .describe('The usage period associated with the entitlement.'),
11587
11679
  })
11588
- .describe('Create inpurs for metered entitlement'),
11680
+ .describe('Create inputs for metered entitlement'),
11589
11681
  zod
11590
11682
  .object({
11591
11683
  config: zod.coerce
@@ -11865,15 +11957,19 @@ export const createCustomerEntitlementGrantV2Params = zod.object({
11865
11957
  });
11866
11958
  export const createCustomerEntitlementGrantV2BodyAmountMin = 0;
11867
11959
  export const createCustomerEntitlementGrantV2BodyPriorityMax = 255;
11868
- export const createCustomerEntitlementGrantV2BodyExpirationCountMax = 1000;
11869
- export const createCustomerEntitlementGrantV2BodyMaxRolloverAmountDefault = 0;
11870
11960
  export const createCustomerEntitlementGrantV2BodyMinRolloverAmountDefault = 0;
11961
+ export const createCustomerEntitlementGrantV2BodyExpirationCountMax = 1000;
11871
11962
  export const createCustomerEntitlementGrantV2Body = zod
11872
11963
  .object({
11873
11964
  amount: zod.coerce
11874
11965
  .number()
11875
11966
  .min(createCustomerEntitlementGrantV2BodyAmountMin)
11876
11967
  .describe('The amount to grant. Should be a positive number.'),
11968
+ annotations: zod
11969
+ .record(zod.string(), zod.any())
11970
+ .describe('Set of key-value pairs managed by the system. Cannot be modified by user.')
11971
+ .optional()
11972
+ .describe('The grant metadata.'),
11877
11973
  effectiveAt: zod.coerce
11878
11974
  .date()
11879
11975
  .describe('Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute).'),
@@ -11890,11 +11986,12 @@ export const createCustomerEntitlementGrantV2Body = zod
11890
11986
  .describe('The unit of time for the expiration period.'),
11891
11987
  })
11892
11988
  .describe('The grant expiration definition')
11893
- .describe('The grant expiration definition'),
11989
+ .optional()
11990
+ .describe('The grant expiration definition. If no expiration is provided, the grant can be active indefinitely.'),
11894
11991
  maxRolloverAmount: zod.coerce
11895
11992
  .number()
11896
11993
  .optional()
11897
- .describe('Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset.\nBalance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))'),
11994
+ .describe('Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. The default value equals grant amount.\nBalance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))'),
11898
11995
  metadata: zod
11899
11996
  .record(zod.string(), zod.coerce.string())
11900
11997
  .describe('Set of key-value pairs.\nMetadata can be used to store additional information about a resource.')
@@ -12013,11 +12110,17 @@ export const overrideCustomerEntitlementV2BodyFeatureKeyMax = 64;
12013
12110
  export const overrideCustomerEntitlementV2BodyFeatureKeyRegExp = new RegExp('^[a-z0-9]+(?:_[a-z0-9]+)*$');
12014
12111
  export const overrideCustomerEntitlementV2BodyFeatureIdRegExp = new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$');
12015
12112
  export const overrideCustomerEntitlementV2BodyIsSoftLimitDefault = false;
12016
- export const overrideCustomerEntitlementV2BodyIsUnlimitedDefault = false;
12113
+ export const overrideCustomerEntitlementV2BodyPreserveOverageAtResetDefault = false;
12017
12114
  export const overrideCustomerEntitlementV2BodyIssueAfterResetMin = 0;
12018
12115
  export const overrideCustomerEntitlementV2BodyIssueAfterResetPriorityDefault = 1;
12019
12116
  export const overrideCustomerEntitlementV2BodyIssueAfterResetPriorityMax = 255;
12020
- export const overrideCustomerEntitlementV2BodyPreserveOverageAtResetDefault = false;
12117
+ export const overrideCustomerEntitlementV2BodyIssueAmountMin = 0;
12118
+ export const overrideCustomerEntitlementV2BodyIssuePriorityDefault = 1;
12119
+ export const overrideCustomerEntitlementV2BodyIssuePriorityMax = 255;
12120
+ export const overrideCustomerEntitlementV2BodyGrantsItemAmountMin = 0;
12121
+ export const overrideCustomerEntitlementV2BodyGrantsItemPriorityMax = 255;
12122
+ export const overrideCustomerEntitlementV2BodyGrantsItemMinRolloverAmountDefault = 0;
12123
+ export const overrideCustomerEntitlementV2BodyGrantsItemExpirationCountMax = 1000;
12021
12124
  export const overrideCustomerEntitlementV2BodyFeatureKeyMaxOne = 64;
12022
12125
  export const overrideCustomerEntitlementV2BodyFeatureKeyRegExpOne = new RegExp('^[a-z0-9]+(?:_[a-z0-9]+)*$');
12023
12126
  export const overrideCustomerEntitlementV2BodyFeatureIdRegExpOne = new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$');
@@ -12040,10 +12143,100 @@ export const overrideCustomerEntitlementV2Body = zod
12040
12143
  .regex(overrideCustomerEntitlementV2BodyFeatureKeyRegExp)
12041
12144
  .optional()
12042
12145
  .describe('The feature the subject is entitled to use.\nEither featureKey or featureId is required.'),
12146
+ grants: zod
12147
+ .array(zod
12148
+ .object({
12149
+ amount: zod.coerce
12150
+ .number()
12151
+ .min(overrideCustomerEntitlementV2BodyGrantsItemAmountMin)
12152
+ .describe('The amount to grant. Should be a positive number.'),
12153
+ annotations: zod
12154
+ .record(zod.string(), zod.any())
12155
+ .describe('Set of key-value pairs managed by the system. Cannot be modified by user.')
12156
+ .optional()
12157
+ .describe('The grant metadata.'),
12158
+ effectiveAt: zod.coerce
12159
+ .date()
12160
+ .describe('Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute).'),
12161
+ expiration: zod
12162
+ .object({
12163
+ count: zod.coerce
12164
+ .number()
12165
+ .min(1)
12166
+ .max(overrideCustomerEntitlementV2BodyGrantsItemExpirationCountMax)
12167
+ .describe('The number of time units in the expiration period.'),
12168
+ duration: zod
12169
+ .enum(['HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR'])
12170
+ .describe('The expiration duration enum')
12171
+ .describe('The unit of time for the expiration period.'),
12172
+ })
12173
+ .describe('The grant expiration definition')
12174
+ .optional()
12175
+ .describe('The grant expiration definition. If no expiration is provided, the grant can be active indefinitely.'),
12176
+ maxRolloverAmount: zod.coerce
12177
+ .number()
12178
+ .optional()
12179
+ .describe('Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. The default value equals grant amount.\nBalance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))'),
12180
+ metadata: zod
12181
+ .record(zod.string(), zod.coerce.string())
12182
+ .describe('Set of key-value pairs.\nMetadata can be used to store additional information about a resource.')
12183
+ .optional()
12184
+ .describe('The grant metadata.'),
12185
+ minRolloverAmount: zod.coerce
12186
+ .number()
12187
+ .optional()
12188
+ .describe('Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset.\nBalance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))'),
12189
+ priority: zod.coerce
12190
+ .number()
12191
+ .min(1)
12192
+ .max(overrideCustomerEntitlementV2BodyGrantsItemPriorityMax)
12193
+ .optional()
12194
+ .describe('The priority of the grant. Grants with higher priority are applied first.\nPriority is a positive decimal numbers. With lower numbers indicating higher importance.\nFor example, a priority of 1 is more urgent than a priority of 2.\nWhen there are several grants available for the same subject, the system selects the grant with the highest priority.\nIn cases where grants share the same priority level, the grant closest to its expiration will be used first.\nIn the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first.'),
12195
+ recurrence: zod
12196
+ .object({
12197
+ anchor: zod.coerce
12198
+ .date()
12199
+ .optional()
12200
+ .describe('A date-time anchor to base the recurring period on.'),
12201
+ interval: zod
12202
+ .union([
12203
+ zod.coerce
12204
+ .string()
12205
+ .regex(overrideCustomerEntitlementV2BodyGrantsItemRecurrenceIntervalRegExpTwo),
12206
+ zod
12207
+ .enum(['DAY', 'WEEK', 'MONTH', 'YEAR'])
12208
+ .describe('The unit of time for the interval.\nOne of: `day`, `week`, `month`, or `year`.'),
12209
+ ])
12210
+ .describe('Period duration for the recurrence')
12211
+ .describe('The unit of time for the interval.'),
12212
+ })
12213
+ .describe('Recurring period with an interval and an anchor.')
12214
+ .optional()
12215
+ .describe('The subject of the grant.'),
12216
+ })
12217
+ .describe('The grant creation input.'))
12218
+ .optional()
12219
+ .describe('Grants'),
12043
12220
  isSoftLimit: zod.coerce
12044
12221
  .boolean()
12045
12222
  .optional()
12046
12223
  .describe('If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true.'),
12224
+ issue: zod
12225
+ .object({
12226
+ amount: zod.coerce
12227
+ .number()
12228
+ .min(overrideCustomerEntitlementV2BodyIssueAmountMin)
12229
+ .describe('The initial grant amount'),
12230
+ priority: zod.coerce
12231
+ .number()
12232
+ .min(1)
12233
+ .max(overrideCustomerEntitlementV2BodyIssuePriorityMax)
12234
+ .default(overrideCustomerEntitlementV2BodyIssuePriorityDefault)
12235
+ .describe('The priority of the issue after reset'),
12236
+ })
12237
+ .describe('Issue after reset')
12238
+ .optional()
12239
+ .describe('Issue after reset'),
12047
12240
  issueAfterReset: zod.coerce
12048
12241
  .number()
12049
12242
  .min(overrideCustomerEntitlementV2BodyIssueAfterResetMin)
@@ -12055,10 +12248,6 @@ export const overrideCustomerEntitlementV2Body = zod
12055
12248
  .max(overrideCustomerEntitlementV2BodyIssueAfterResetPriorityMax)
12056
12249
  .default(overrideCustomerEntitlementV2BodyIssueAfterResetPriorityDefault)
12057
12250
  .describe('Defines the grant priority for the default grant.'),
12058
- isUnlimited: zod.coerce
12059
- .boolean()
12060
- .optional()
12061
- .describe('Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future.'),
12062
12251
  measureUsageFrom: zod
12063
12252
  .union([
12064
12253
  zod
@@ -12102,7 +12291,7 @@ export const overrideCustomerEntitlementV2Body = zod
12102
12291
  .describe('Recurring period with an interval and an anchor.')
12103
12292
  .describe('The usage period associated with the entitlement.'),
12104
12293
  })
12105
- .describe('Create inpurs for metered entitlement'),
12294
+ .describe('Create inputs for metered entitlement'),
12106
12295
  zod
12107
12296
  .object({
12108
12297
  config: zod.coerce