@openmeter/client 1.0.0-beta.232 → 1.0.0-beta.234

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 (60) hide show
  1. package/README.md +112 -43
  2. package/dist/funcs/apps.js +7 -2
  3. package/dist/funcs/billing.js +7 -2
  4. package/dist/funcs/charges.d.ts +14 -0
  5. package/dist/funcs/charges.js +42 -0
  6. package/dist/funcs/customers.d.ts +112 -1
  7. package/dist/funcs/customers.js +430 -0
  8. package/dist/funcs/{governance.d.ts → entitlementAccess.d.ts} +4 -4
  9. package/dist/funcs/{governance.js → entitlementAccess.js} +10 -10
  10. package/dist/funcs/entitlements.d.ts +46 -1
  11. package/dist/funcs/entitlements.js +213 -1
  12. package/dist/funcs/grants.d.ts +24 -0
  13. package/dist/funcs/grants.js +78 -0
  14. package/dist/funcs/index.d.ts +4 -1
  15. package/dist/funcs/index.js +4 -1
  16. package/dist/funcs/notifications.d.ts +43 -0
  17. package/dist/funcs/notifications.js +163 -0
  18. package/dist/funcs/planAddons.js +7 -2
  19. package/dist/funcs/subscriptions.d.ts +60 -1
  20. package/dist/funcs/subscriptions.js +204 -0
  21. package/dist/index.d.ts +6 -2
  22. package/dist/index.js +1 -0
  23. package/dist/lib/version.d.ts +1 -1
  24. package/dist/lib/version.js +1 -1
  25. package/dist/lib/wire.js +62 -6
  26. package/dist/models/operations/apps.d.ts +17 -1
  27. package/dist/models/operations/billing.d.ts +19 -1
  28. package/dist/models/operations/charges.d.ts +54 -0
  29. package/dist/models/operations/customers.d.ts +127 -5
  30. package/dist/models/operations/entitlementAccess.d.ts +9 -0
  31. package/dist/models/operations/entitlementAccess.js +2 -0
  32. package/dist/models/operations/entitlements.d.ts +73 -1
  33. package/dist/models/operations/grants.d.ts +43 -0
  34. package/dist/models/operations/grants.js +2 -0
  35. package/dist/models/operations/notifications.d.ts +46 -0
  36. package/dist/models/operations/notifications.js +2 -0
  37. package/dist/models/operations/planAddons.d.ts +14 -1
  38. package/dist/models/operations/subscriptions.d.ts +27 -3
  39. package/dist/models/schemas.d.ts +51330 -23237
  40. package/dist/models/schemas.js +4837 -1735
  41. package/dist/models/types.d.ts +4758 -1592
  42. package/dist/sdk/apps.d.ts +2 -44
  43. package/dist/sdk/apps.js +1 -53
  44. package/dist/sdk/customers.d.ts +2 -56
  45. package/dist/sdk/customers.js +1 -67
  46. package/dist/sdk/internal.d.ts +491 -28
  47. package/dist/sdk/internal.js +607 -30
  48. package/dist/sdk/invoices.d.ts +112 -0
  49. package/dist/sdk/invoices.js +115 -0
  50. package/dist/sdk/notifications.d.ts +58 -0
  51. package/dist/sdk/notifications.js +72 -0
  52. package/dist/sdk/planAddons.d.ts +1 -20
  53. package/dist/sdk/planAddons.js +1 -24
  54. package/dist/sdk/sdk.d.ts +3 -0
  55. package/dist/sdk/sdk.js +5 -0
  56. package/dist/sdk/subscriptions.d.ts +12 -1
  57. package/dist/sdk/subscriptions.js +14 -1
  58. package/package.json +1 -1
  59. package/dist/models/operations/governance.d.ts +0 -9
  60. /package/dist/models/operations/{governance.js → charges.js} +0 -0
@@ -351,6 +351,436 @@ export function createCustomerStripePortalSession(client, req, options) {
351
351
  });
352
352
  });
353
353
  }
354
+ /**
355
+ * Create customer entitlement
356
+ *
357
+ * Create an entitlement for the customer.
358
+ *
359
+ * A customer can have only one active entitlement per feature. The feature must be
360
+ * compatible with the entitlement type. Entitlements cannot be modified after
361
+ * creation, only deleted.
362
+ *
363
+ * POST /openmeter/customers/{customerId}/entitlements
364
+ */
365
+ export function createCustomerEntitlement(client, req, options) {
366
+ return request(() => {
367
+ const pathParamsInput = {
368
+ customerId: req.customerId,
369
+ };
370
+ const pathParams = client._options.validate
371
+ ? toPathWire(pathParamsInput, schemas.createCustomerEntitlementPathParams)
372
+ : pathParamsInput;
373
+ if (client._options.validate) {
374
+ assertValid(schemas.createCustomerEntitlementPathParamsWire, pathParams);
375
+ }
376
+ const path = `openmeter/customers/${(() => {
377
+ if (pathParams.customerId === undefined) {
378
+ throw new Error('missing path parameter: customerId');
379
+ }
380
+ return encodeURIComponent(String(pathParams.customerId));
381
+ })()}/entitlements`;
382
+ const body = toWire(req.body, schemas.createCustomerEntitlementBody);
383
+ if (client._options.validate) {
384
+ assertValid(schemas.createCustomerEntitlementBodyWire, body);
385
+ }
386
+ return http(client)
387
+ .post(path, { ...options, json: body })
388
+ .json()
389
+ .then((data) => {
390
+ if (client._options.validate) {
391
+ assertValid(schemas.createCustomerEntitlementResponseWire, data);
392
+ }
393
+ return fromWire(data, schemas.createCustomerEntitlementResponse);
394
+ });
395
+ });
396
+ }
397
+ /**
398
+ * Override customer entitlement
399
+ *
400
+ * Override an entitlement of the customer with a new one.
401
+ *
402
+ * The referenced entitlement ends and the new one starts at the same instant, so
403
+ * access continues without a gap. Both must belong to the same feature. Use this
404
+ * for upgrades and downgrades.
405
+ *
406
+ * Fails if the referenced entitlement does not exist, is deleted, or is no longer
407
+ * active.
408
+ *
409
+ * PUT /openmeter/customers/{customerId}/entitlements/{entitlementId}/override
410
+ */
411
+ export function overrideCustomerEntitlement(client, req, options) {
412
+ return request(() => {
413
+ const pathParamsInput = {
414
+ customerId: req.customerId,
415
+ entitlementId: req.entitlementId,
416
+ };
417
+ const pathParams = client._options.validate
418
+ ? toPathWire(pathParamsInput, schemas.overrideCustomerEntitlementPathParams)
419
+ : pathParamsInput;
420
+ if (client._options.validate) {
421
+ assertValid(schemas.overrideCustomerEntitlementPathParamsWire, pathParams);
422
+ }
423
+ const path = `openmeter/customers/${(() => {
424
+ if (pathParams.customerId === undefined) {
425
+ throw new Error('missing path parameter: customerId');
426
+ }
427
+ return encodeURIComponent(String(pathParams.customerId));
428
+ })()}/entitlements/${(() => {
429
+ if (pathParams.entitlementId === undefined) {
430
+ throw new Error('missing path parameter: entitlementId');
431
+ }
432
+ return encodeURIComponent(String(pathParams.entitlementId));
433
+ })()}/override`;
434
+ const body = toWire(req.body, schemas.overrideCustomerEntitlementBody);
435
+ if (client._options.validate) {
436
+ assertValid(schemas.overrideCustomerEntitlementBodyWire, body);
437
+ }
438
+ return http(client)
439
+ .put(path, { ...options, json: body })
440
+ .json()
441
+ .then((data) => {
442
+ if (client._options.validate) {
443
+ assertValid(schemas.overrideCustomerEntitlementResponseWire, data);
444
+ }
445
+ return fromWire(data, schemas.overrideCustomerEntitlementResponse);
446
+ });
447
+ });
448
+ }
449
+ /**
450
+ * Get customer entitlement history
451
+ *
452
+ * Get the balance and usage history of a metered entitlement. The queried range
453
+ * may span multiple usage periods.
454
+ *
455
+ * `windowed_history` groups usage into windows of the requested size and reports
456
+ * the balance at the start of each window. `burndown_history` lists the periods in
457
+ * which grants were consumed in a fixed order, together with the usage taken from
458
+ * each grant.
459
+ *
460
+ * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
461
+ */
462
+ export function getCustomerEntitlementHistory(client, req, options) {
463
+ return request(() => {
464
+ const pathParamsInput = {
465
+ customerId: req.customerId,
466
+ entitlementId: req.entitlementId,
467
+ };
468
+ const pathParams = client._options.validate
469
+ ? toPathWire(pathParamsInput, schemas.getCustomerEntitlementHistoryPathParams)
470
+ : pathParamsInput;
471
+ if (client._options.validate) {
472
+ assertValid(schemas.getCustomerEntitlementHistoryPathParamsWire, pathParams);
473
+ }
474
+ const path = `openmeter/customers/${(() => {
475
+ if (pathParams.customerId === undefined) {
476
+ throw new Error('missing path parameter: customerId');
477
+ }
478
+ return encodeURIComponent(String(pathParams.customerId));
479
+ })()}/entitlements/${(() => {
480
+ if (pathParams.entitlementId === undefined) {
481
+ throw new Error('missing path parameter: entitlementId');
482
+ }
483
+ return encodeURIComponent(String(pathParams.entitlementId));
484
+ })()}/history`;
485
+ const query = toWire({
486
+ from: req.from,
487
+ to: req.to,
488
+ windowSize: req.windowSize,
489
+ timeZone: req.timeZone,
490
+ }, schemas.getCustomerEntitlementHistoryQueryParams);
491
+ if (client._options.validate) {
492
+ assertValid(schemas.getCustomerEntitlementHistoryQueryParamsWire, query);
493
+ }
494
+ const searchParams = toURLSearchParams(query);
495
+ return http(client)
496
+ .get(path, { ...options, searchParams })
497
+ .json()
498
+ .then((data) => {
499
+ if (client._options.validate) {
500
+ assertValid(schemas.getCustomerEntitlementHistoryResponseWire, data);
501
+ }
502
+ return fromWire(data, schemas.getCustomerEntitlementHistoryResponse);
503
+ });
504
+ });
505
+ }
506
+ /**
507
+ * Get customer entitlement
508
+ *
509
+ * Get an entitlement of the customer by ID. For checking entitlement access, use
510
+ * the entitlement access endpoints instead.
511
+ *
512
+ * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}
513
+ */
514
+ export function getCustomerEntitlement(client, req, options) {
515
+ return request(() => {
516
+ const pathParamsInput = {
517
+ customerId: req.customerId,
518
+ entitlementId: req.entitlementId,
519
+ };
520
+ const pathParams = client._options.validate
521
+ ? toPathWire(pathParamsInput, schemas.getCustomerEntitlementPathParams)
522
+ : pathParamsInput;
523
+ if (client._options.validate) {
524
+ assertValid(schemas.getCustomerEntitlementPathParamsWire, pathParams);
525
+ }
526
+ const path = `openmeter/customers/${(() => {
527
+ if (pathParams.customerId === undefined) {
528
+ throw new Error('missing path parameter: customerId');
529
+ }
530
+ return encodeURIComponent(String(pathParams.customerId));
531
+ })()}/entitlements/${(() => {
532
+ if (pathParams.entitlementId === undefined) {
533
+ throw new Error('missing path parameter: entitlementId');
534
+ }
535
+ return encodeURIComponent(String(pathParams.entitlementId));
536
+ })()}`;
537
+ return http(client)
538
+ .get(path, options)
539
+ .json()
540
+ .then((data) => {
541
+ if (client._options.validate) {
542
+ assertValid(schemas.getCustomerEntitlementResponseWire, data);
543
+ }
544
+ return fromWire(data, schemas.getCustomerEntitlementResponse);
545
+ });
546
+ });
547
+ }
548
+ /**
549
+ * List customer entitlements
550
+ *
551
+ * List the entitlements of the customer that are active at the time of the
552
+ * request. For checking entitlement access, use the entitlement access endpoints
553
+ * instead.
554
+ *
555
+ * GET /openmeter/customers/{customerId}/entitlements
556
+ */
557
+ export function listCustomerEntitlements(client, req, options) {
558
+ return request(() => {
559
+ const pathParamsInput = {
560
+ customerId: req.customerId,
561
+ };
562
+ const pathParams = client._options.validate
563
+ ? toPathWire(pathParamsInput, schemas.listCustomerEntitlementsPathParams)
564
+ : pathParamsInput;
565
+ if (client._options.validate) {
566
+ assertValid(schemas.listCustomerEntitlementsPathParamsWire, pathParams);
567
+ }
568
+ const path = `openmeter/customers/${(() => {
569
+ if (pathParams.customerId === undefined) {
570
+ throw new Error('missing path parameter: customerId');
571
+ }
572
+ return encodeURIComponent(String(pathParams.customerId));
573
+ })()}/entitlements`;
574
+ if (client._options.validate && req.sort !== undefined) {
575
+ assertValid(schemas.listCustomerEntitlementsQueryParams.shape.sort, req.sort);
576
+ }
577
+ const query = toWire({
578
+ page: req.page,
579
+ sort: encodeSort(req.sort, toSnakeCase),
580
+ filter: req.filter,
581
+ }, schemas.listCustomerEntitlementsQueryParams);
582
+ if (client._options.validate) {
583
+ assertValid(schemas.listCustomerEntitlementsQueryParamsWire, query);
584
+ }
585
+ const searchParams = toURLSearchParams(query);
586
+ return http(client)
587
+ .get(path, { ...options, searchParams })
588
+ .json()
589
+ .then((data) => {
590
+ if (client._options.validate) {
591
+ assertValid(schemas.listCustomerEntitlementsResponseWire, data);
592
+ }
593
+ return fromWire(data, schemas.listCustomerEntitlementsResponse);
594
+ });
595
+ });
596
+ }
597
+ /**
598
+ * Reset customer entitlement usage
599
+ *
600
+ * Reset the usage of a metered entitlement. The reset starts a new usage period:
601
+ * usage is zeroed and grants roll over according to their rollover settings.
602
+ *
603
+ * Usage is reset automatically at the end of each usage period. Use this operation
604
+ * to reset it earlier, for example to align the entitlement with the customer's
605
+ * billing period. The usage period anchor can be moved at the same time.
606
+ *
607
+ * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset
608
+ */
609
+ export function resetCustomerEntitlementUsage(client, req, options) {
610
+ return request(async () => {
611
+ const pathParamsInput = {
612
+ customerId: req.customerId,
613
+ entitlementId: req.entitlementId,
614
+ };
615
+ const pathParams = client._options.validate
616
+ ? toPathWire(pathParamsInput, schemas.resetCustomerEntitlementUsagePathParams)
617
+ : pathParamsInput;
618
+ if (client._options.validate) {
619
+ assertValid(schemas.resetCustomerEntitlementUsagePathParamsWire, pathParams);
620
+ }
621
+ const path = `openmeter/customers/${(() => {
622
+ if (pathParams.customerId === undefined) {
623
+ throw new Error('missing path parameter: customerId');
624
+ }
625
+ return encodeURIComponent(String(pathParams.customerId));
626
+ })()}/entitlements/${(() => {
627
+ if (pathParams.entitlementId === undefined) {
628
+ throw new Error('missing path parameter: entitlementId');
629
+ }
630
+ return encodeURIComponent(String(pathParams.entitlementId));
631
+ })()}/reset`;
632
+ const body = toWire(req.body, schemas.resetCustomerEntitlementUsageBody);
633
+ if (client._options.validate) {
634
+ assertValid(schemas.resetCustomerEntitlementUsageBodyWire, body);
635
+ }
636
+ await http(client).post(path, { ...options, json: body });
637
+ });
638
+ }
639
+ /**
640
+ * Delete customer entitlement
641
+ *
642
+ * Deletes the entitlement and revokes access to its feature. A customer can hold
643
+ * only one active entitlement per feature, so migrating a feature requires
644
+ * deleting the previous entitlement first.
645
+ *
646
+ * Deletion sets the `deleted_at` timestamp instead of removing history. Access and
647
+ * status queries for earlier points in time still treat the entitlement as active,
648
+ * so access changes are never retroactive.
649
+ *
650
+ * DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}
651
+ */
652
+ export function deleteCustomerEntitlement(client, req, options) {
653
+ return request(async () => {
654
+ const pathParamsInput = {
655
+ customerId: req.customerId,
656
+ entitlementId: req.entitlementId,
657
+ };
658
+ const pathParams = client._options.validate
659
+ ? toPathWire(pathParamsInput, schemas.deleteCustomerEntitlementPathParams)
660
+ : pathParamsInput;
661
+ if (client._options.validate) {
662
+ assertValid(schemas.deleteCustomerEntitlementPathParamsWire, pathParams);
663
+ }
664
+ const path = `openmeter/customers/${(() => {
665
+ if (pathParams.customerId === undefined) {
666
+ throw new Error('missing path parameter: customerId');
667
+ }
668
+ return encodeURIComponent(String(pathParams.customerId));
669
+ })()}/entitlements/${(() => {
670
+ if (pathParams.entitlementId === undefined) {
671
+ throw new Error('missing path parameter: entitlementId');
672
+ }
673
+ return encodeURIComponent(String(pathParams.entitlementId));
674
+ })()}`;
675
+ await http(client).delete(path, options);
676
+ });
677
+ }
678
+ /**
679
+ * Create customer entitlement grant
680
+ *
681
+ * Issue a grant for a metered entitlement of the customer. Boolean and static
682
+ * entitlements cannot have grants, so the request is rejected for them.
683
+ *
684
+ * Grants are immutable. The amount is added to the balance from `effective_at`,
685
+ * which cannot be earlier than the start of the current usage period.
686
+ *
687
+ * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
688
+ */
689
+ export function createCustomerEntitlementGrant(client, req, options) {
690
+ return request(() => {
691
+ const pathParamsInput = {
692
+ customerId: req.customerId,
693
+ entitlementId: req.entitlementId,
694
+ };
695
+ const pathParams = client._options.validate
696
+ ? toPathWire(pathParamsInput, schemas.createCustomerEntitlementGrantPathParams)
697
+ : pathParamsInput;
698
+ if (client._options.validate) {
699
+ assertValid(schemas.createCustomerEntitlementGrantPathParamsWire, pathParams);
700
+ }
701
+ const path = `openmeter/customers/${(() => {
702
+ if (pathParams.customerId === undefined) {
703
+ throw new Error('missing path parameter: customerId');
704
+ }
705
+ return encodeURIComponent(String(pathParams.customerId));
706
+ })()}/entitlements/${(() => {
707
+ if (pathParams.entitlementId === undefined) {
708
+ throw new Error('missing path parameter: entitlementId');
709
+ }
710
+ return encodeURIComponent(String(pathParams.entitlementId));
711
+ })()}/grants`;
712
+ const body = toWire(req.body, schemas.createCustomerEntitlementGrantBody);
713
+ if (client._options.validate) {
714
+ assertValid(schemas.createCustomerEntitlementGrantBodyWire, body);
715
+ }
716
+ return http(client)
717
+ .post(path, { ...options, json: body })
718
+ .json()
719
+ .then((data) => {
720
+ if (client._options.validate) {
721
+ assertValid(schemas.createCustomerEntitlementGrantResponseWire, data);
722
+ }
723
+ return fromWire(data, schemas.createCustomerEntitlementGrantResponse);
724
+ });
725
+ });
726
+ }
727
+ /**
728
+ * List customer entitlement grants
729
+ *
730
+ * List the grants issued for an entitlement of the customer. Grants only exist for
731
+ * metered entitlements, so the list is empty for boolean and static entitlements.
732
+ *
733
+ * Deleted grants are excluded unless `include_deleted` is set. Voided and expired
734
+ * grants are always included, as they are part of the balance history.
735
+ *
736
+ * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
737
+ */
738
+ export function listCustomerEntitlementGrants(client, req, options) {
739
+ return request(() => {
740
+ const pathParamsInput = {
741
+ customerId: req.customerId,
742
+ entitlementId: req.entitlementId,
743
+ };
744
+ const pathParams = client._options.validate
745
+ ? toPathWire(pathParamsInput, schemas.listCustomerEntitlementGrantsPathParams)
746
+ : pathParamsInput;
747
+ if (client._options.validate) {
748
+ assertValid(schemas.listCustomerEntitlementGrantsPathParamsWire, pathParams);
749
+ }
750
+ const path = `openmeter/customers/${(() => {
751
+ if (pathParams.customerId === undefined) {
752
+ throw new Error('missing path parameter: customerId');
753
+ }
754
+ return encodeURIComponent(String(pathParams.customerId));
755
+ })()}/entitlements/${(() => {
756
+ if (pathParams.entitlementId === undefined) {
757
+ throw new Error('missing path parameter: entitlementId');
758
+ }
759
+ return encodeURIComponent(String(pathParams.entitlementId));
760
+ })()}/grants`;
761
+ if (client._options.validate && req.sort !== undefined) {
762
+ assertValid(schemas.listCustomerEntitlementGrantsQueryParams.shape.sort, req.sort);
763
+ }
764
+ const query = toWire({
765
+ page: req.page,
766
+ sort: encodeSort(req.sort, toSnakeCase),
767
+ includeDeleted: req.includeDeleted,
768
+ }, schemas.listCustomerEntitlementGrantsQueryParams);
769
+ if (client._options.validate) {
770
+ assertValid(schemas.listCustomerEntitlementGrantsQueryParamsWire, query);
771
+ }
772
+ const searchParams = toURLSearchParams(query);
773
+ return http(client)
774
+ .get(path, { ...options, searchParams })
775
+ .json()
776
+ .then((data) => {
777
+ if (client._options.validate) {
778
+ assertValid(schemas.listCustomerEntitlementGrantsResponseWire, data);
779
+ }
780
+ return fromWire(data, schemas.listCustomerEntitlementGrantsResponse);
781
+ });
782
+ });
783
+ }
354
784
  /**
355
785
  * Create a new credit grant
356
786
  *
@@ -1,8 +1,8 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
3
+ import type { QueryEntitlementAccessRequest, QueryEntitlementAccessResponse } from '../models/operations/entitlementAccess.js';
4
4
  /**
5
- * Query governance access
5
+ * Query entitlement access
6
6
  *
7
7
  * Query feature access for a list of customers.
8
8
  *
@@ -13,6 +13,6 @@ import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from
13
13
  * _Designed to be called on a fixed refresh interval and the query response is
14
14
  * intended to be cached._
15
15
  *
16
- * POST /openmeter/governance/query
16
+ * POST /openmeter/entitlement-access/query
17
17
  */
18
- export declare function queryGovernanceAccess(client: Client, req: QueryGovernanceAccessRequest, options?: RequestOptions): Promise<Result<QueryGovernanceAccessResponse>>;
18
+ export declare function queryEntitlementAccess(client: Client, req: QueryEntitlementAccessRequest, options?: RequestOptions): Promise<Result<QueryEntitlementAccessResponse>>;
@@ -5,7 +5,7 @@ import { toURLSearchParams } from '../lib/encodings.js';
5
5
  import { toWire, fromWire, assertValid } from '../lib/wire.js';
6
6
  import * as schemas from '../models/schemas.js';
7
7
  /**
8
- * Query governance access
8
+ * Query entitlement access
9
9
  *
10
10
  * Query feature access for a list of customers.
11
11
  *
@@ -16,23 +16,23 @@ import * as schemas from '../models/schemas.js';
16
16
  * _Designed to be called on a fixed refresh interval and the query response is
17
17
  * intended to be cached._
18
18
  *
19
- * POST /openmeter/governance/query
19
+ * POST /openmeter/entitlement-access/query
20
20
  */
21
- export function queryGovernanceAccess(client, req, options) {
21
+ export function queryEntitlementAccess(client, req, options) {
22
22
  return request(() => {
23
- const body = toWire(req.body, schemas.queryGovernanceAccessBody);
23
+ const body = toWire(req.body, schemas.queryEntitlementAccessBody);
24
24
  if (client._options.validate) {
25
- assertValid(schemas.queryGovernanceAccessBodyWire, body);
25
+ assertValid(schemas.queryEntitlementAccessBodyWire, body);
26
26
  }
27
27
  const query = toWire({
28
28
  page: req.page,
29
- }, schemas.queryGovernanceAccessQueryParams);
29
+ }, schemas.queryEntitlementAccessQueryParams);
30
30
  if (client._options.validate) {
31
- assertValid(schemas.queryGovernanceAccessQueryParamsWire, query);
31
+ assertValid(schemas.queryEntitlementAccessQueryParamsWire, query);
32
32
  }
33
33
  const searchParams = toURLSearchParams(query);
34
34
  return http(client)
35
- .post('openmeter/governance/query', {
35
+ .post('openmeter/entitlement-access/query', {
36
36
  ...options,
37
37
  searchParams,
38
38
  json: body,
@@ -40,9 +40,9 @@ export function queryGovernanceAccess(client, req, options) {
40
40
  .json()
41
41
  .then((data) => {
42
42
  if (client._options.validate) {
43
- assertValid(schemas.queryGovernanceAccessResponseWire, data);
43
+ assertValid(schemas.queryEntitlementAccessResponseWire, data);
44
44
  }
45
- return fromWire(data, schemas.queryGovernanceAccessResponse);
45
+ return fromWire(data, schemas.queryEntitlementAccessResponse);
46
46
  });
47
47
  });
48
48
  }
@@ -1,9 +1,54 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
3
+ import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse, GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse, GetCustomerEntitlementValueByFeatureKeyRequest, GetCustomerEntitlementValueByFeatureKeyResponse, ListEntitlementsRequest, ListEntitlementsResponse, GetEntitlementRequest, GetEntitlementResponse, GetCustomerEntitlementValueRequest, GetCustomerEntitlementValueResponse } from '../models/operations/entitlements.js';
4
4
  /**
5
5
  * List customer entitlement access
6
6
  *
7
7
  * GET /openmeter/customers/{customerId}/entitlement-access
8
8
  */
9
9
  export declare function listCustomerEntitlementAccess(client: Client, req: ListCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<Result<ListCustomerEntitlementAccessResponse>>;
10
+ /**
11
+ * Get customer entitlement access
12
+ *
13
+ * Get the customer's access to a single feature.
14
+ *
15
+ * GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
16
+ */
17
+ export declare function getCustomerEntitlementAccess(client: Client, req: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementAccessResponse>>;
18
+ /**
19
+ * Get customer entitlement value by feature key
20
+ *
21
+ * Get the customer's entitlement value for a feature at a point in time. Without
22
+ * an active entitlement, the result denies access and omits the type.
23
+ *
24
+ * GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value
25
+ */
26
+ export declare function getCustomerEntitlementValueByFeatureKey(client: Client, req: GetCustomerEntitlementValueByFeatureKeyRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementValueByFeatureKeyResponse>>;
27
+ /**
28
+ * List entitlements
29
+ *
30
+ * List the active entitlements of all customers. Intended for administrative use.
31
+ * To list the entitlements of a single customer, use the customer entitlements
32
+ * endpoints; to check entitlement access, use the entitlement access endpoints.
33
+ *
34
+ * GET /openmeter/entitlements
35
+ */
36
+ export declare function listEntitlements(client: Client, req?: ListEntitlementsRequest, options?: RequestOptions): Promise<Result<ListEntitlementsResponse>>;
37
+ /**
38
+ * Get entitlement
39
+ *
40
+ * Get an entitlement by ID. To check entitlement access, use the entitlement
41
+ * access endpoints instead.
42
+ *
43
+ * GET /openmeter/entitlements/{entitlementId}
44
+ */
45
+ export declare function getEntitlement(client: Client, req: GetEntitlementRequest, options?: RequestOptions): Promise<Result<GetEntitlementResponse>>;
46
+ /**
47
+ * Get customer entitlement value
48
+ *
49
+ * Get the customer's access through a single entitlement, optionally evaluated at
50
+ * a point in time.
51
+ *
52
+ * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/value
53
+ */
54
+ export declare function getCustomerEntitlementValue(client: Client, req: GetCustomerEntitlementValueRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementValueResponse>>;