@openmeter/client 1.0.0-beta-4d26c6d3c7fe → 1.0.0-beta-e7a04be10ed8

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 (137) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +316 -55
  3. package/dist/core.d.ts +0 -1
  4. package/dist/core.js +8 -1
  5. package/dist/funcs/addons.d.ts +49 -1
  6. package/dist/funcs/addons.js +50 -1
  7. package/dist/funcs/apps.d.ts +14 -1
  8. package/dist/funcs/apps.js +15 -1
  9. package/dist/funcs/billing.d.ts +46 -1
  10. package/dist/funcs/billing.js +47 -1
  11. package/dist/funcs/currencies.d.ts +30 -1
  12. package/dist/funcs/currencies.js +31 -1
  13. package/dist/funcs/customers.d.ts +148 -1
  14. package/dist/funcs/customers.js +149 -1
  15. package/dist/funcs/defaults.d.ts +10 -1
  16. package/dist/funcs/defaults.js +11 -1
  17. package/dist/funcs/entitlements.d.ts +5 -1
  18. package/dist/funcs/entitlements.js +6 -1
  19. package/dist/funcs/events.d.ts +14 -1
  20. package/dist/funcs/events.js +15 -1
  21. package/dist/funcs/features.d.ts +42 -1
  22. package/dist/funcs/features.js +43 -1
  23. package/dist/funcs/index.d.ts +0 -3
  24. package/dist/funcs/index.js +1 -3
  25. package/dist/funcs/llmCost.d.ts +36 -1
  26. package/dist/funcs/llmCost.js +37 -1
  27. package/dist/funcs/meters.d.ts +53 -1
  28. package/dist/funcs/meters.js +54 -1
  29. package/dist/funcs/planAddons.d.ts +35 -1
  30. package/dist/funcs/planAddons.js +36 -1
  31. package/dist/funcs/plans.d.ts +49 -1
  32. package/dist/funcs/plans.js +50 -1
  33. package/dist/funcs/subscriptions.d.ts +59 -1
  34. package/dist/funcs/subscriptions.js +60 -1
  35. package/dist/funcs/tax.d.ts +25 -1
  36. package/dist/funcs/tax.js +26 -1
  37. package/dist/index.d.ts +4 -8
  38. package/dist/index.js +4 -5
  39. package/dist/lib/config.d.ts +0 -1
  40. package/dist/lib/config.js +1 -1
  41. package/dist/lib/encodings.d.ts +0 -1
  42. package/dist/lib/encodings.js +1 -1
  43. package/dist/lib/paginate.d.ts +56 -0
  44. package/dist/lib/paginate.js +60 -0
  45. package/dist/lib/request.d.ts +0 -1
  46. package/dist/lib/request.js +1 -1
  47. package/dist/lib/to-error.d.ts +0 -1
  48. package/dist/lib/to-error.js +1 -1
  49. package/dist/lib/types.d.ts +0 -1
  50. package/dist/lib/types.js +1 -1
  51. package/dist/lib/version.d.ts +1 -0
  52. package/dist/lib/version.js +5 -0
  53. package/dist/lib/wire.d.ts +3 -1
  54. package/dist/lib/wire.js +93 -4
  55. package/dist/models/errors.d.ts +13 -2
  56. package/dist/models/errors.js +31 -4
  57. package/dist/models/operations/addons.d.ts +0 -1
  58. package/dist/models/operations/addons.js +1 -1
  59. package/dist/models/operations/apps.d.ts +2 -5
  60. package/dist/models/operations/apps.js +1 -1
  61. package/dist/models/operations/billing.d.ts +0 -1
  62. package/dist/models/operations/billing.js +1 -1
  63. package/dist/models/operations/currencies.d.ts +0 -1
  64. package/dist/models/operations/currencies.js +1 -1
  65. package/dist/models/operations/customers.d.ts +3 -6
  66. package/dist/models/operations/customers.js +1 -1
  67. package/dist/models/operations/defaults.d.ts +0 -1
  68. package/dist/models/operations/defaults.js +1 -1
  69. package/dist/models/operations/entitlements.d.ts +0 -1
  70. package/dist/models/operations/entitlements.js +1 -1
  71. package/dist/models/operations/events.d.ts +0 -1
  72. package/dist/models/operations/events.js +1 -1
  73. package/dist/models/operations/features.d.ts +0 -1
  74. package/dist/models/operations/features.js +1 -1
  75. package/dist/models/operations/llmCost.d.ts +0 -1
  76. package/dist/models/operations/llmCost.js +1 -1
  77. package/dist/models/operations/meters.d.ts +0 -1
  78. package/dist/models/operations/meters.js +1 -1
  79. package/dist/models/operations/planAddons.d.ts +0 -1
  80. package/dist/models/operations/planAddons.js +1 -1
  81. package/dist/models/operations/plans.d.ts +0 -1
  82. package/dist/models/operations/plans.js +1 -1
  83. package/dist/models/operations/subscriptions.d.ts +0 -1
  84. package/dist/models/operations/subscriptions.js +1 -1
  85. package/dist/models/operations/tax.d.ts +0 -1
  86. package/dist/models/operations/tax.js +1 -1
  87. package/dist/models/schemas.d.ts +4453 -6950
  88. package/dist/models/schemas.js +1 -73
  89. package/dist/models/types.d.ts +381 -566
  90. package/dist/models/types.js +1 -1
  91. package/dist/sdk/addons.d.ts +60 -1
  92. package/dist/sdk/addons.js +63 -1
  93. package/dist/sdk/apps.d.ts +25 -1
  94. package/dist/sdk/apps.js +28 -1
  95. package/dist/sdk/billing.d.ts +57 -1
  96. package/dist/sdk/billing.js +60 -1
  97. package/dist/sdk/customers.d.ts +194 -1
  98. package/dist/sdk/customers.js +203 -1
  99. package/dist/sdk/defaults.d.ts +10 -1
  100. package/dist/sdk/defaults.js +11 -1
  101. package/dist/sdk/entitlements.d.ts +5 -1
  102. package/dist/sdk/entitlements.js +6 -1
  103. package/dist/sdk/events.d.ts +25 -1
  104. package/dist/sdk/events.js +28 -1
  105. package/dist/sdk/features.d.ts +53 -1
  106. package/dist/sdk/features.js +56 -1
  107. package/dist/sdk/internal.d.ts +89 -0
  108. package/dist/sdk/internal.js +113 -0
  109. package/dist/sdk/llmCost.d.ts +57 -1
  110. package/dist/sdk/llmCost.js +62 -1
  111. package/dist/sdk/meters.d.ts +64 -1
  112. package/dist/sdk/meters.js +67 -1
  113. package/dist/sdk/planAddons.d.ts +46 -1
  114. package/dist/sdk/planAddons.js +49 -1
  115. package/dist/sdk/plans.d.ts +60 -1
  116. package/dist/sdk/plans.js +63 -1
  117. package/dist/sdk/sdk.d.ts +9 -10
  118. package/dist/sdk/sdk.js +11 -15
  119. package/dist/sdk/subscriptions.d.ts +72 -3
  120. package/dist/sdk/subscriptions.js +77 -5
  121. package/dist/sdk/tax.d.ts +34 -1
  122. package/dist/sdk/tax.js +37 -1
  123. package/package.json +28 -4
  124. package/dist/funcs/governance.d.ts +0 -5
  125. package/dist/funcs/governance.js +0 -34
  126. package/dist/funcs/invoices.d.ts +0 -8
  127. package/dist/funcs/invoices.js +0 -81
  128. package/dist/models/operations/governance.d.ts +0 -10
  129. package/dist/models/operations/governance.js +0 -2
  130. package/dist/models/operations/invoices.d.ts +0 -48
  131. package/dist/models/operations/invoices.js +0 -2
  132. package/dist/sdk/currencies.d.ts +0 -12
  133. package/dist/sdk/currencies.js +0 -21
  134. package/dist/sdk/governance.d.ts +0 -9
  135. package/dist/sdk/governance.js +0 -12
  136. package/dist/sdk/invoices.d.ts +0 -12
  137. package/dist/sdk/invoices.js +0 -21
package/dist/sdk/plans.js CHANGED
@@ -1,30 +1,92 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { unwrap } from '../lib/types.js';
3
+ import { paginatePages } from '../lib/paginate.js';
2
4
  import { listPlans, createPlan, updatePlan, getPlan, deletePlan, archivePlan, publishPlan, } from '../funcs/plans.js';
3
5
  export class Plans {
4
6
  _client;
5
7
  constructor(_client) {
6
8
  this._client = _client;
7
9
  }
10
+ /**
11
+ * List plans
12
+ *
13
+ * List all plans.
14
+ *
15
+ * GET /openmeter/plans
16
+ */
8
17
  async list(request, options) {
9
18
  return unwrap(await listPlans(this._client, request, options));
10
19
  }
20
+ /**
21
+ * List plans
22
+ *
23
+ * List all plans.
24
+ *
25
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
26
+ *
27
+ * GET /openmeter/plans
28
+ */
29
+ listAll(request, options) {
30
+ return paginatePages((req, opts) => listPlans(this._client, req, opts), request ?? {}, options);
31
+ }
32
+ /**
33
+ * Create plan
34
+ *
35
+ * Create a new plan.
36
+ *
37
+ * POST /openmeter/plans
38
+ */
11
39
  async create(request, options) {
12
40
  return unwrap(await createPlan(this._client, request, options));
13
41
  }
42
+ /**
43
+ * Update plan
44
+ *
45
+ * Update a plan by id.
46
+ *
47
+ * PUT /openmeter/plans/{planId}
48
+ */
14
49
  async update(request, options) {
15
50
  return unwrap(await updatePlan(this._client, request, options));
16
51
  }
52
+ /**
53
+ * Get plan
54
+ *
55
+ * Get a plan by id.
56
+ *
57
+ * GET /openmeter/plans/{planId}
58
+ */
17
59
  async get(request, options) {
18
60
  return unwrap(await getPlan(this._client, request, options));
19
61
  }
62
+ /**
63
+ * Delete plan
64
+ *
65
+ * Delete a plan by id.
66
+ *
67
+ * DELETE /openmeter/plans/{planId}
68
+ */
20
69
  async delete(request, options) {
21
70
  return unwrap(await deletePlan(this._client, request, options));
22
71
  }
72
+ /**
73
+ * Archive plan version
74
+ *
75
+ * Archive a plan version.
76
+ *
77
+ * POST /openmeter/plans/{planId}/archive
78
+ */
23
79
  async archive(request, options) {
24
80
  return unwrap(await archivePlan(this._client, request, options));
25
81
  }
82
+ /**
83
+ * Publish plan version
84
+ *
85
+ * Publish a plan version.
86
+ *
87
+ * POST /openmeter/plans/{planId}/publish
88
+ */
26
89
  async publish(request, options) {
27
90
  return unwrap(await publishPlan(this._client, request, options));
28
91
  }
29
92
  }
30
- //# sourceMappingURL=plans.js.map
package/dist/sdk/sdk.d.ts CHANGED
@@ -6,16 +6,14 @@ import { Entitlements } from './entitlements.js';
6
6
  import { Subscriptions } from './subscriptions.js';
7
7
  import { Apps } from './apps.js';
8
8
  import { Billing } from './billing.js';
9
- import { Invoices } from './invoices.js';
10
9
  import { Tax } from './tax.js';
11
- import { Currencies } from './currencies.js';
12
10
  import { Features } from './features.js';
13
11
  import { LLMCost } from './llmCost.js';
14
12
  import { Plans } from './plans.js';
15
13
  import { Addons } from './addons.js';
16
14
  import { PlanAddons } from './planAddons.js';
17
15
  import { Defaults } from './defaults.js';
18
- import { Governance } from './governance.js';
16
+ import { Internal } from './internal.js';
19
17
  export declare class OpenMeter extends Client {
20
18
  private _events?;
21
19
  get events(): Events;
@@ -31,12 +29,8 @@ export declare class OpenMeter extends Client {
31
29
  get apps(): Apps;
32
30
  private _billing?;
33
31
  get billing(): Billing;
34
- private _invoices?;
35
- get invoices(): Invoices;
36
32
  private _tax?;
37
33
  get tax(): Tax;
38
- private _currencies?;
39
- get currencies(): Currencies;
40
34
  private _features?;
41
35
  get features(): Features;
42
36
  private _llmCost?;
@@ -49,7 +43,12 @@ export declare class OpenMeter extends Client {
49
43
  get planAddons(): PlanAddons;
50
44
  private _defaults?;
51
45
  get defaults(): Defaults;
52
- private _governance?;
53
- get governance(): Governance;
46
+ private _internal?;
47
+ /**
48
+ * Operations marked internal in the API definition. They are not part
49
+ * of the customer surface: they may require additional permissions,
50
+ * and they can change or be removed without notice or semver
51
+ * consideration.
52
+ */
53
+ get internal(): Internal;
54
54
  }
55
- //# sourceMappingURL=sdk.d.ts.map
package/dist/sdk/sdk.js CHANGED
@@ -1,3 +1,4 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { Client } from '../core.js';
2
3
  import { Events } from './events.js';
3
4
  import { Meters } from './meters.js';
@@ -6,16 +7,14 @@ import { Entitlements } from './entitlements.js';
6
7
  import { Subscriptions } from './subscriptions.js';
7
8
  import { Apps } from './apps.js';
8
9
  import { Billing } from './billing.js';
9
- import { Invoices } from './invoices.js';
10
10
  import { Tax } from './tax.js';
11
- import { Currencies } from './currencies.js';
12
11
  import { Features } from './features.js';
13
12
  import { LLMCost } from './llmCost.js';
14
13
  import { Plans } from './plans.js';
15
14
  import { Addons } from './addons.js';
16
15
  import { PlanAddons } from './planAddons.js';
17
16
  import { Defaults } from './defaults.js';
18
- import { Governance } from './governance.js';
17
+ import { Internal } from './internal.js';
19
18
  export class OpenMeter extends Client {
20
19
  _events;
21
20
  get events() {
@@ -45,18 +44,10 @@ export class OpenMeter extends Client {
45
44
  get billing() {
46
45
  return (this._billing ??= new Billing(this));
47
46
  }
48
- _invoices;
49
- get invoices() {
50
- return (this._invoices ??= new Invoices(this));
51
- }
52
47
  _tax;
53
48
  get tax() {
54
49
  return (this._tax ??= new Tax(this));
55
50
  }
56
- _currencies;
57
- get currencies() {
58
- return (this._currencies ??= new Currencies(this));
59
- }
60
51
  _features;
61
52
  get features() {
62
53
  return (this._features ??= new Features(this));
@@ -81,9 +72,14 @@ export class OpenMeter extends Client {
81
72
  get defaults() {
82
73
  return (this._defaults ??= new Defaults(this));
83
74
  }
84
- _governance;
85
- get governance() {
86
- return (this._governance ??= new Governance(this));
75
+ _internal;
76
+ /**
77
+ * Operations marked internal in the API definition. They are not part
78
+ * of the customer surface: they may require additional permissions,
79
+ * and they can change or be removed without notice or semver
80
+ * consideration.
81
+ */
82
+ get internal() {
83
+ return (this._internal ??= new Internal(this));
87
84
  }
88
85
  }
89
- //# sourceMappingURL=sdk.js.map
@@ -1,17 +1,86 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
3
+ import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
4
+ import type { Subscription, SubscriptionAddon } from '../models/types.js';
4
5
  export declare class Subscriptions {
5
6
  private readonly _client;
6
7
  constructor(_client: Client);
8
+ /**
9
+ * Create subscription
10
+ *
11
+ * POST /openmeter/subscriptions
12
+ */
7
13
  create(request: CreateSubscriptionRequest, options?: RequestOptions): Promise<CreateSubscriptionResponse>;
14
+ /**
15
+ * List subscriptions
16
+ *
17
+ * GET /openmeter/subscriptions
18
+ */
8
19
  list(request?: ListSubscriptionsRequest, options?: RequestOptions): Promise<ListSubscriptionsResponse>;
20
+ /**
21
+ * List subscriptions
22
+ *
23
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
24
+ *
25
+ * GET /openmeter/subscriptions
26
+ */
27
+ listAll(request?: ListSubscriptionsRequest, options?: RequestOptions): AsyncIterable<Subscription>;
28
+ /**
29
+ * Get subscription
30
+ *
31
+ * GET /openmeter/subscriptions/{subscriptionId}
32
+ */
9
33
  get(request: GetSubscriptionRequest, options?: RequestOptions): Promise<GetSubscriptionResponse>;
34
+ /**
35
+ * Cancel subscription
36
+ *
37
+ * Cancels the subscription. Will result in a scheduling conflict if there are
38
+ * other subscriptions scheduled to start after the cancelation time.
39
+ *
40
+ * POST /openmeter/subscriptions/{subscriptionId}/cancel
41
+ */
10
42
  cancel(request: CancelSubscriptionRequest, options?: RequestOptions): Promise<CancelSubscriptionResponse>;
43
+ /**
44
+ * Unschedule subscription cancelation
45
+ *
46
+ * Unschedules the subscription cancelation.
47
+ *
48
+ * POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
49
+ */
11
50
  unscheduleCancelation(request: UnscheduleCancelationRequest, options?: RequestOptions): Promise<UnscheduleCancelationResponse>;
51
+ /**
52
+ * Change subscription
53
+ *
54
+ * Closes a running subscription and starts a new one according to the
55
+ * specification. Can be used for upgrades, downgrades, and plan changes.
56
+ *
57
+ * POST /openmeter/subscriptions/{subscriptionId}/change
58
+ */
12
59
  change(request: ChangeSubscriptionRequest, options?: RequestOptions): Promise<ChangeSubscriptionResponse>;
13
- createAddon(request: CreateSubscriptionAddonRequest, options?: RequestOptions): Promise<CreateSubscriptionAddonResponse>;
60
+ /**
61
+ * List subscription addons
62
+ *
63
+ * List the add-ons of a subscription.
64
+ *
65
+ * GET /openmeter/subscriptions/{subscriptionId}/addons
66
+ */
14
67
  listAddons(request: ListSubscriptionAddonsRequest, options?: RequestOptions): Promise<ListSubscriptionAddonsResponse>;
68
+ /**
69
+ * List subscription addons
70
+ *
71
+ * List the add-ons of a subscription.
72
+ *
73
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
74
+ *
75
+ * GET /openmeter/subscriptions/{subscriptionId}/addons
76
+ */
77
+ listAddonsAll(request: ListSubscriptionAddonsRequest, options?: RequestOptions): AsyncIterable<SubscriptionAddon>;
78
+ /**
79
+ * Get add-on association for subscription
80
+ *
81
+ * Get an add-on association for a subscription.
82
+ *
83
+ * GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
84
+ */
15
85
  getAddon(request: GetSubscriptionAddonRequest, options?: RequestOptions): Promise<GetSubscriptionAddonResponse>;
16
86
  }
17
- //# sourceMappingURL=subscriptions.d.ts.map
@@ -1,36 +1,108 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { unwrap } from '../lib/types.js';
2
- import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, createSubscriptionAddon, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
3
+ import { paginatePages } from '../lib/paginate.js';
4
+ import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
3
5
  export class Subscriptions {
4
6
  _client;
5
7
  constructor(_client) {
6
8
  this._client = _client;
7
9
  }
10
+ /**
11
+ * Create subscription
12
+ *
13
+ * POST /openmeter/subscriptions
14
+ */
8
15
  async create(request, options) {
9
16
  return unwrap(await createSubscription(this._client, request, options));
10
17
  }
18
+ /**
19
+ * List subscriptions
20
+ *
21
+ * GET /openmeter/subscriptions
22
+ */
11
23
  async list(request, options) {
12
24
  return unwrap(await listSubscriptions(this._client, request, options));
13
25
  }
26
+ /**
27
+ * List subscriptions
28
+ *
29
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
30
+ *
31
+ * GET /openmeter/subscriptions
32
+ */
33
+ listAll(request, options) {
34
+ return paginatePages((req, opts) => listSubscriptions(this._client, req, opts), request ?? {}, options);
35
+ }
36
+ /**
37
+ * Get subscription
38
+ *
39
+ * GET /openmeter/subscriptions/{subscriptionId}
40
+ */
14
41
  async get(request, options) {
15
42
  return unwrap(await getSubscription(this._client, request, options));
16
43
  }
44
+ /**
45
+ * Cancel subscription
46
+ *
47
+ * Cancels the subscription. Will result in a scheduling conflict if there are
48
+ * other subscriptions scheduled to start after the cancelation time.
49
+ *
50
+ * POST /openmeter/subscriptions/{subscriptionId}/cancel
51
+ */
17
52
  async cancel(request, options) {
18
53
  return unwrap(await cancelSubscription(this._client, request, options));
19
54
  }
55
+ /**
56
+ * Unschedule subscription cancelation
57
+ *
58
+ * Unschedules the subscription cancelation.
59
+ *
60
+ * POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
61
+ */
20
62
  async unscheduleCancelation(request, options) {
21
63
  return unwrap(await unscheduleCancelation(this._client, request, options));
22
64
  }
65
+ /**
66
+ * Change subscription
67
+ *
68
+ * Closes a running subscription and starts a new one according to the
69
+ * specification. Can be used for upgrades, downgrades, and plan changes.
70
+ *
71
+ * POST /openmeter/subscriptions/{subscriptionId}/change
72
+ */
23
73
  async change(request, options) {
24
74
  return unwrap(await changeSubscription(this._client, request, options));
25
75
  }
26
- async createAddon(request, options) {
27
- return unwrap(await createSubscriptionAddon(this._client, request, options));
28
- }
76
+ /**
77
+ * List subscription addons
78
+ *
79
+ * List the add-ons of a subscription.
80
+ *
81
+ * GET /openmeter/subscriptions/{subscriptionId}/addons
82
+ */
29
83
  async listAddons(request, options) {
30
84
  return unwrap(await listSubscriptionAddons(this._client, request, options));
31
85
  }
86
+ /**
87
+ * List subscription addons
88
+ *
89
+ * List the add-ons of a subscription.
90
+ *
91
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
92
+ *
93
+ * GET /openmeter/subscriptions/{subscriptionId}/addons
94
+ */
95
+ listAddonsAll(request, options) {
96
+ return paginatePages((req, opts) => listSubscriptionAddons(this._client, req, opts), request, options);
97
+ }
98
+ /**
99
+ * Get add-on association for subscription
100
+ *
101
+ * Get an add-on association for a subscription.
102
+ *
103
+ * GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
104
+ */
32
105
  async getAddon(request, options) {
33
106
  return unwrap(await getSubscriptionAddon(this._client, request, options));
34
107
  }
35
108
  }
36
- //# sourceMappingURL=subscriptions.js.map
package/dist/sdk/tax.d.ts CHANGED
@@ -1,13 +1,46 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
3
  import type { CreateTaxCodeRequest, CreateTaxCodeResponse, GetTaxCodeRequest, GetTaxCodeResponse, ListTaxCodesRequest, ListTaxCodesResponse, UpsertTaxCodeRequest, UpsertTaxCodeResponse, DeleteTaxCodeRequest, DeleteTaxCodeResponse } from '../models/operations/tax.js';
4
+ import type { TaxCode } from '../models/types.js';
4
5
  export declare class Tax {
5
6
  private readonly _client;
6
7
  constructor(_client: Client);
8
+ /**
9
+ * Create tax code
10
+ *
11
+ * POST /openmeter/tax-codes
12
+ */
7
13
  createCode(request: CreateTaxCodeRequest, options?: RequestOptions): Promise<CreateTaxCodeResponse>;
14
+ /**
15
+ * Get tax code
16
+ *
17
+ * GET /openmeter/tax-codes/{taxCodeId}
18
+ */
8
19
  getCode(request: GetTaxCodeRequest, options?: RequestOptions): Promise<GetTaxCodeResponse>;
20
+ /**
21
+ * List tax codes
22
+ *
23
+ * GET /openmeter/tax-codes
24
+ */
9
25
  listCodes(request?: ListTaxCodesRequest, options?: RequestOptions): Promise<ListTaxCodesResponse>;
26
+ /**
27
+ * List tax codes
28
+ *
29
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
30
+ *
31
+ * GET /openmeter/tax-codes
32
+ */
33
+ listCodesAll(request?: ListTaxCodesRequest, options?: RequestOptions): AsyncIterable<TaxCode>;
34
+ /**
35
+ * Upsert tax code
36
+ *
37
+ * PUT /openmeter/tax-codes/{taxCodeId}
38
+ */
10
39
  upsertCode(request: UpsertTaxCodeRequest, options?: RequestOptions): Promise<UpsertTaxCodeResponse>;
40
+ /**
41
+ * Delete tax code
42
+ *
43
+ * DELETE /openmeter/tax-codes/{taxCodeId}
44
+ */
11
45
  deleteCode(request: DeleteTaxCodeRequest, options?: RequestOptions): Promise<DeleteTaxCodeResponse>;
12
46
  }
13
- //# sourceMappingURL=tax.d.ts.map
package/dist/sdk/tax.js CHANGED
@@ -1,24 +1,60 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { unwrap } from '../lib/types.js';
3
+ import { paginatePages } from '../lib/paginate.js';
2
4
  import { createTaxCode, getTaxCode, listTaxCodes, upsertTaxCode, deleteTaxCode, } from '../funcs/tax.js';
3
5
  export class Tax {
4
6
  _client;
5
7
  constructor(_client) {
6
8
  this._client = _client;
7
9
  }
10
+ /**
11
+ * Create tax code
12
+ *
13
+ * POST /openmeter/tax-codes
14
+ */
8
15
  async createCode(request, options) {
9
16
  return unwrap(await createTaxCode(this._client, request, options));
10
17
  }
18
+ /**
19
+ * Get tax code
20
+ *
21
+ * GET /openmeter/tax-codes/{taxCodeId}
22
+ */
11
23
  async getCode(request, options) {
12
24
  return unwrap(await getTaxCode(this._client, request, options));
13
25
  }
26
+ /**
27
+ * List tax codes
28
+ *
29
+ * GET /openmeter/tax-codes
30
+ */
14
31
  async listCodes(request, options) {
15
32
  return unwrap(await listTaxCodes(this._client, request, options));
16
33
  }
34
+ /**
35
+ * List tax codes
36
+ *
37
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
38
+ *
39
+ * GET /openmeter/tax-codes
40
+ */
41
+ listCodesAll(request, options) {
42
+ return paginatePages((req, opts) => listTaxCodes(this._client, req, opts), request ?? {}, options);
43
+ }
44
+ /**
45
+ * Upsert tax code
46
+ *
47
+ * PUT /openmeter/tax-codes/{taxCodeId}
48
+ */
17
49
  async upsertCode(request, options) {
18
50
  return unwrap(await upsertTaxCode(this._client, request, options));
19
51
  }
52
+ /**
53
+ * Delete tax code
54
+ *
55
+ * DELETE /openmeter/tax-codes/{taxCodeId}
56
+ */
20
57
  async deleteCode(request, options) {
21
58
  return unwrap(await deleteTaxCode(this._client, request, options));
22
59
  }
23
60
  }
24
- //# sourceMappingURL=tax.js.map
package/package.json CHANGED
@@ -1,6 +1,16 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-4d26c6d3c7fe",
3
+ "version": "1.0.0-beta-e7a04be10ed8",
4
+ "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
+ "keywords": [
6
+ "openmeter",
7
+ "metering",
8
+ "billing",
9
+ "usage-based-billing",
10
+ "entitlements",
11
+ "sdk",
12
+ "api-client"
13
+ ],
4
14
  "license": "Apache-2.0",
5
15
  "homepage": "https://openmeter.io",
6
16
  "repository": {
@@ -8,15 +18,28 @@
8
18
  "url": "git+https://github.com/openmeterio/openmeter.git",
9
19
  "directory": "api/spec/packages/aip-client-javascript"
10
20
  },
21
+ "bugs": "https://github.com/openmeterio/openmeter/issues",
11
22
  "type": "module",
23
+ "engines": {
24
+ "node": ">=22"
25
+ },
26
+ "sideEffects": false,
12
27
  "dependencies": {
13
- "ky": "2.0.2",
14
- "zod": "4.4.3"
28
+ "ky": "^2.0.2",
29
+ "zod": "^4.4.3"
15
30
  },
16
31
  "devDependencies": {
17
32
  "@types/node": "25.9.2",
18
33
  "typescript": "5.5.2"
19
34
  },
35
+ "files": [
36
+ "dist",
37
+ "!dist/**/*.assert.*",
38
+ "!dist/**/*.map",
39
+ "!dist/**/*.tsbuildinfo"
40
+ ],
41
+ "main": "./dist/index.js",
42
+ "types": "./dist/index.d.ts",
20
43
  "exports": {
21
44
  "./zod": {
22
45
  "types": "./dist/models/schemas.d.ts",
@@ -25,7 +48,8 @@
25
48
  ".": {
26
49
  "types": "./dist/index.d.ts",
27
50
  "default": "./dist/index.js"
28
- }
51
+ },
52
+ "./package.json": "./package.json"
29
53
  },
30
54
  "scripts": {
31
55
  "build": "tsc",
@@ -1,5 +0,0 @@
1
- import { type Client } from '../core.js';
2
- import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
4
- export declare function queryGovernanceAccess(client: Client, req: QueryGovernanceAccessRequest, options?: RequestOptions): Promise<Result<QueryGovernanceAccessResponse>>;
5
- //# sourceMappingURL=governance.d.ts.map
@@ -1,34 +0,0 @@
1
- import { http } from '../core.js';
2
- import { request } from '../lib/request.js';
3
- import { toURLSearchParams } from '../lib/encodings.js';
4
- import { toWire, fromWire, assertValid } from '../lib/wire.js';
5
- import * as schemas from '../models/schemas.js';
6
- export function queryGovernanceAccess(client, req, options) {
7
- return request(() => {
8
- const body = toWire(req.body, schemas.queryGovernanceAccessBody);
9
- if (client._options.validate) {
10
- assertValid(schemas.queryGovernanceAccessBodyWire, body);
11
- }
12
- const query = toWire({
13
- page: req.page,
14
- }, schemas.queryGovernanceAccessQueryParams);
15
- if (client._options.validate) {
16
- assertValid(schemas.queryGovernanceAccessQueryParamsWire, query);
17
- }
18
- const searchParams = toURLSearchParams(query);
19
- return http(client)
20
- .post('openmeter/governance/query', {
21
- ...options,
22
- searchParams,
23
- json: body,
24
- })
25
- .json()
26
- .then((data) => {
27
- if (client._options.validate) {
28
- assertValid(schemas.queryGovernanceAccessResponseWire, data);
29
- }
30
- return fromWire(data, schemas.queryGovernanceAccessResponse);
31
- });
32
- });
33
- }
34
- //# sourceMappingURL=governance.js.map
@@ -1,8 +0,0 @@
1
- import { type Client } from '../core.js';
2
- import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
4
- export declare function listInvoices(client: Client, req?: ListInvoicesRequest, options?: RequestOptions): Promise<Result<ListInvoicesResponse>>;
5
- export declare function getInvoice(client: Client, req: GetInvoiceRequest, options?: RequestOptions): Promise<Result<GetInvoiceResponse>>;
6
- export declare function updateInvoice(client: Client, req: UpdateInvoiceRequest, options?: RequestOptions): Promise<Result<UpdateInvoiceResponse>>;
7
- export declare function deleteInvoice(client: Client, req: DeleteInvoiceRequest, options?: RequestOptions): Promise<Result<DeleteInvoiceResponse>>;
8
- //# sourceMappingURL=invoices.d.ts.map