@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
@@ -1,15 +1,127 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
3
  import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
4
+ import type { Invoice } from '../models/types.js';
4
5
  export declare class Invoices {
5
6
  private readonly _client;
6
7
  constructor(_client: Client);
8
+ /**
9
+ * List billing invoices
10
+ *
11
+ * List billing invoices.
12
+ *
13
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
14
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
15
+ * control ordering.
16
+ *
17
+ * GET /openmeter/billing/invoices
18
+ */
7
19
  list(request?: ListInvoicesRequest, options?: RequestOptions): Promise<ListInvoicesResponse>;
20
+ /**
21
+ * List billing invoices
22
+ *
23
+ * List billing invoices.
24
+ *
25
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
26
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
27
+ * control ordering.
28
+ *
29
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
30
+ *
31
+ * GET /openmeter/billing/invoices
32
+ */
33
+ listAll(request?: ListInvoicesRequest, options?: RequestOptions): AsyncIterable<Invoice>;
34
+ /**
35
+ * Get a billing invoice
36
+ *
37
+ * Get a billing invoice by ID.
38
+ *
39
+ * Returns the full invoice resource including line items, status details, totals,
40
+ * and workflow configuration snapshot.
41
+ *
42
+ * GET /openmeter/billing/invoices/{invoiceId}
43
+ */
8
44
  get(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponse>;
45
+ /**
46
+ * Update a billing invoice
47
+ *
48
+ * Update a billing invoice.
49
+ *
50
+ * Only the mutable fields of the invoice can be edited: description, labels,
51
+ * supplier, customer, workflow settings, and top-level lines. Top-level lines are
52
+ * matched by `id`; lines without an `id` are created, and existing lines omitted
53
+ * from `lines` are deleted. Detailed (child) lines are always computed and cannot
54
+ * be edited directly. Only invoices in draft status can be updated.
55
+ *
56
+ * PUT /openmeter/billing/invoices/{invoiceId}
57
+ */
9
58
  update(request: UpdateInvoiceRequest, options?: RequestOptions): Promise<UpdateInvoiceResponse>;
59
+ /**
60
+ * Delete a billing invoice
61
+ *
62
+ * Delete a billing invoice.
63
+ *
64
+ * Only standard invoices in draft status can be deleted. Deleting an invoice will
65
+ * also delete all associated line items and workflow configuration.
66
+ *
67
+ * DELETE /openmeter/billing/invoices/{invoiceId}
68
+ */
10
69
  delete(request: DeleteInvoiceRequest, options?: RequestOptions): Promise<DeleteInvoiceResponse>;
70
+ /**
71
+ * Advance billing invoice's next status
72
+ *
73
+ * Advance a billing invoice.
74
+ *
75
+ * Advances the invoice to the next workflow state. The next state is determined by
76
+ * the invoice's current status and workflow configuration. Only invoices in draft
77
+ * or issued status can be advanced.
78
+ *
79
+ * POST /openmeter/billing/invoices/{invoiceId}/advance
80
+ */
11
81
  advance(request: AdvanceInvoiceRequest, options?: RequestOptions): Promise<AdvanceInvoiceResponse>;
82
+ /**
83
+ * Send the invoice to the customer
84
+ *
85
+ * Approve a billing invoice.
86
+ *
87
+ * This call instantly sends the invoice to the customer using the configured
88
+ * billing profile app.
89
+ *
90
+ * This call is valid in two invoice statuses:
91
+ *
92
+ * - draft: the invoice will be sent to the customer, the invoice state becomes
93
+ * issued
94
+ * - manual_approval_needed: the invoice will be sent to the customer, the invoice
95
+ * state becomes issued
96
+ *
97
+ * POST /openmeter/billing/invoices/{invoiceId}/approve
98
+ */
12
99
  approve(request: ApproveInvoiceRequest, options?: RequestOptions): Promise<ApproveInvoiceResponse>;
100
+ /**
101
+ * Retry advancing the invoice after a failed attempt
102
+ *
103
+ * Retry sending a billing invoice.
104
+ *
105
+ * Retry advancing the invoice after a failed attempt.
106
+ *
107
+ * The action can be called when the invoice's statusDetails' actions field contain
108
+ * the "retry" action.
109
+ *
110
+ * POST /openmeter/billing/invoices/{invoiceId}/retry
111
+ */
13
112
  retry(request: RetryInvoiceRequest, options?: RequestOptions): Promise<RetryInvoiceResponse>;
113
+ /**
114
+ * Snapshot quantities for usage based line items
115
+ *
116
+ * Snapshot quantities for usage-based line items.
117
+ *
118
+ * This call will snapshot the quantities for all usage based line items in the
119
+ * invoice.
120
+ *
121
+ * This call is only valid in draft.waiting_for_collection status, where the
122
+ * collection period can be skipped using this action.
123
+ *
124
+ * POST /openmeter/billing/invoices/{invoiceId}/snapshot-quantities
125
+ */
14
126
  snapshotQuantities(request: SnapshotQuantitiesInvoiceRequest, options?: RequestOptions): Promise<SnapshotQuantitiesInvoiceResponse>;
15
127
  }
@@ -1,31 +1,146 @@
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 { listInvoices, getInvoice, updateInvoice, deleteInvoice, advanceInvoice, approveInvoice, retryInvoice, snapshotQuantitiesInvoice, } from '../funcs/invoices.js';
3
5
  export class Invoices {
4
6
  _client;
5
7
  constructor(_client) {
6
8
  this._client = _client;
7
9
  }
10
+ /**
11
+ * List billing invoices
12
+ *
13
+ * List billing invoices.
14
+ *
15
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
16
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
17
+ * control ordering.
18
+ *
19
+ * GET /openmeter/billing/invoices
20
+ */
8
21
  async list(request, options) {
9
22
  return unwrap(await listInvoices(this._client, request, options));
10
23
  }
24
+ /**
25
+ * List billing invoices
26
+ *
27
+ * List billing invoices.
28
+ *
29
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
30
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
31
+ * control ordering.
32
+ *
33
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
34
+ *
35
+ * GET /openmeter/billing/invoices
36
+ */
37
+ listAll(request, options) {
38
+ return paginatePages((req, opts) => listInvoices(this._client, req, opts), request ?? {}, options);
39
+ }
40
+ /**
41
+ * Get a billing invoice
42
+ *
43
+ * Get a billing invoice by ID.
44
+ *
45
+ * Returns the full invoice resource including line items, status details, totals,
46
+ * and workflow configuration snapshot.
47
+ *
48
+ * GET /openmeter/billing/invoices/{invoiceId}
49
+ */
11
50
  async get(request, options) {
12
51
  return unwrap(await getInvoice(this._client, request, options));
13
52
  }
53
+ /**
54
+ * Update a billing invoice
55
+ *
56
+ * Update a billing invoice.
57
+ *
58
+ * Only the mutable fields of the invoice can be edited: description, labels,
59
+ * supplier, customer, workflow settings, and top-level lines. Top-level lines are
60
+ * matched by `id`; lines without an `id` are created, and existing lines omitted
61
+ * from `lines` are deleted. Detailed (child) lines are always computed and cannot
62
+ * be edited directly. Only invoices in draft status can be updated.
63
+ *
64
+ * PUT /openmeter/billing/invoices/{invoiceId}
65
+ */
14
66
  async update(request, options) {
15
67
  return unwrap(await updateInvoice(this._client, request, options));
16
68
  }
69
+ /**
70
+ * Delete a billing invoice
71
+ *
72
+ * Delete a billing invoice.
73
+ *
74
+ * Only standard invoices in draft status can be deleted. Deleting an invoice will
75
+ * also delete all associated line items and workflow configuration.
76
+ *
77
+ * DELETE /openmeter/billing/invoices/{invoiceId}
78
+ */
17
79
  async delete(request, options) {
18
80
  return unwrap(await deleteInvoice(this._client, request, options));
19
81
  }
82
+ /**
83
+ * Advance billing invoice's next status
84
+ *
85
+ * Advance a billing invoice.
86
+ *
87
+ * Advances the invoice to the next workflow state. The next state is determined by
88
+ * the invoice's current status and workflow configuration. Only invoices in draft
89
+ * or issued status can be advanced.
90
+ *
91
+ * POST /openmeter/billing/invoices/{invoiceId}/advance
92
+ */
20
93
  async advance(request, options) {
21
94
  return unwrap(await advanceInvoice(this._client, request, options));
22
95
  }
96
+ /**
97
+ * Send the invoice to the customer
98
+ *
99
+ * Approve a billing invoice.
100
+ *
101
+ * This call instantly sends the invoice to the customer using the configured
102
+ * billing profile app.
103
+ *
104
+ * This call is valid in two invoice statuses:
105
+ *
106
+ * - draft: the invoice will be sent to the customer, the invoice state becomes
107
+ * issued
108
+ * - manual_approval_needed: the invoice will be sent to the customer, the invoice
109
+ * state becomes issued
110
+ *
111
+ * POST /openmeter/billing/invoices/{invoiceId}/approve
112
+ */
23
113
  async approve(request, options) {
24
114
  return unwrap(await approveInvoice(this._client, request, options));
25
115
  }
116
+ /**
117
+ * Retry advancing the invoice after a failed attempt
118
+ *
119
+ * Retry sending a billing invoice.
120
+ *
121
+ * Retry advancing the invoice after a failed attempt.
122
+ *
123
+ * The action can be called when the invoice's statusDetails' actions field contain
124
+ * the "retry" action.
125
+ *
126
+ * POST /openmeter/billing/invoices/{invoiceId}/retry
127
+ */
26
128
  async retry(request, options) {
27
129
  return unwrap(await retryInvoice(this._client, request, options));
28
130
  }
131
+ /**
132
+ * Snapshot quantities for usage based line items
133
+ *
134
+ * Snapshot quantities for usage-based line items.
135
+ *
136
+ * This call will snapshot the quantities for all usage based line items in the
137
+ * invoice.
138
+ *
139
+ * This call is only valid in draft.waiting_for_collection status, where the
140
+ * collection period can be skipped using this action.
141
+ *
142
+ * POST /openmeter/billing/invoices/{invoiceId}/snapshot-quantities
143
+ */
29
144
  async snapshotQuantities(request, options) {
30
145
  return unwrap(await snapshotQuantitiesInvoice(this._client, request, options));
31
146
  }
@@ -0,0 +1,58 @@
1
+ import { type Client } from '../core.js';
2
+ import { type RequestOptions } from '../lib/types.js';
3
+ import type { ListNotificationChannelsRequest, ListNotificationChannelsResponse, CreateNotificationChannelRequest, CreateNotificationChannelResponse, GetNotificationChannelRequest, GetNotificationChannelResponse, UpdateNotificationChannelRequest, UpdateNotificationChannelResponse, DeleteNotificationChannelRequest, DeleteNotificationChannelResponse } from '../models/operations/notifications.js';
4
+ import type { NotificationChannel } from '../models/types.js';
5
+ export declare class Notifications {
6
+ private readonly _client;
7
+ constructor(_client: Client);
8
+ /**
9
+ * List notification channels
10
+ *
11
+ * List all notification channels.
12
+ *
13
+ * GET /openmeter/notification/channels
14
+ */
15
+ listChannels(request?: ListNotificationChannelsRequest, options?: RequestOptions): Promise<ListNotificationChannelsResponse>;
16
+ /**
17
+ * List notification channels
18
+ *
19
+ * List all notification channels.
20
+ *
21
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
22
+ *
23
+ * GET /openmeter/notification/channels
24
+ */
25
+ listChannelsAll(request?: ListNotificationChannelsRequest, options?: RequestOptions): AsyncIterable<NotificationChannel>;
26
+ /**
27
+ * Create notification channel
28
+ *
29
+ * Create a notification channel.
30
+ *
31
+ * POST /openmeter/notification/channels
32
+ */
33
+ createChannel(request: CreateNotificationChannelRequest, options?: RequestOptions): Promise<CreateNotificationChannelResponse>;
34
+ /**
35
+ * Get notification channel
36
+ *
37
+ * Get a notification channel by id.
38
+ *
39
+ * GET /openmeter/notification/channels/{notificationChannelId}
40
+ */
41
+ getChannel(request: GetNotificationChannelRequest, options?: RequestOptions): Promise<GetNotificationChannelResponse>;
42
+ /**
43
+ * Update notification channel
44
+ *
45
+ * Update a notification channel by id.
46
+ *
47
+ * PUT /openmeter/notification/channels/{notificationChannelId}
48
+ */
49
+ updateChannel(request: UpdateNotificationChannelRequest, options?: RequestOptions): Promise<UpdateNotificationChannelResponse>;
50
+ /**
51
+ * Delete notification channel
52
+ *
53
+ * Delete a notification channel by id.
54
+ *
55
+ * DELETE /openmeter/notification/channels/{notificationChannelId}
56
+ */
57
+ deleteChannel(request: DeleteNotificationChannelRequest, options?: RequestOptions): Promise<DeleteNotificationChannelResponse>;
58
+ }
@@ -0,0 +1,72 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
2
+ import { unwrap } from '../lib/types.js';
3
+ import { paginatePages } from '../lib/paginate.js';
4
+ import { listNotificationChannels, createNotificationChannel, getNotificationChannel, updateNotificationChannel, deleteNotificationChannel, } from '../funcs/notifications.js';
5
+ export class Notifications {
6
+ _client;
7
+ constructor(_client) {
8
+ this._client = _client;
9
+ }
10
+ /**
11
+ * List notification channels
12
+ *
13
+ * List all notification channels.
14
+ *
15
+ * GET /openmeter/notification/channels
16
+ */
17
+ async listChannels(request, options) {
18
+ return unwrap(await listNotificationChannels(this._client, request, options));
19
+ }
20
+ /**
21
+ * List notification channels
22
+ *
23
+ * List all notification channels.
24
+ *
25
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
26
+ *
27
+ * GET /openmeter/notification/channels
28
+ */
29
+ listChannelsAll(request, options) {
30
+ return paginatePages((req, opts) => listNotificationChannels(this._client, req, opts), request ?? {}, options);
31
+ }
32
+ /**
33
+ * Create notification channel
34
+ *
35
+ * Create a notification channel.
36
+ *
37
+ * POST /openmeter/notification/channels
38
+ */
39
+ async createChannel(request, options) {
40
+ return unwrap(await createNotificationChannel(this._client, request, options));
41
+ }
42
+ /**
43
+ * Get notification channel
44
+ *
45
+ * Get a notification channel by id.
46
+ *
47
+ * GET /openmeter/notification/channels/{notificationChannelId}
48
+ */
49
+ async getChannel(request, options) {
50
+ return unwrap(await getNotificationChannel(this._client, request, options));
51
+ }
52
+ /**
53
+ * Update notification channel
54
+ *
55
+ * Update a notification channel by id.
56
+ *
57
+ * PUT /openmeter/notification/channels/{notificationChannelId}
58
+ */
59
+ async updateChannel(request, options) {
60
+ return unwrap(await updateNotificationChannel(this._client, request, options));
61
+ }
62
+ /**
63
+ * Delete notification channel
64
+ *
65
+ * Delete a notification channel by id.
66
+ *
67
+ * DELETE /openmeter/notification/channels/{notificationChannelId}
68
+ */
69
+ async deleteChannel(request, options) {
70
+ return unwrap(await deleteNotificationChannel(this._client, request, options));
71
+ }
72
+ }
@@ -1,28 +1,9 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { ListPlanAddonsRequest, ListPlanAddonsResponse, CreatePlanAddonRequest, CreatePlanAddonResponse, GetPlanAddonRequest, GetPlanAddonResponse, UpdatePlanAddonRequest, UpdatePlanAddonResponse, DeletePlanAddonRequest, DeletePlanAddonResponse } from '../models/operations/planAddons.js';
4
- import type { PlanAddon } from '../models/types.js';
3
+ import type { CreatePlanAddonRequest, CreatePlanAddonResponse, GetPlanAddonRequest, GetPlanAddonResponse, UpdatePlanAddonRequest, UpdatePlanAddonResponse, DeletePlanAddonRequest, DeletePlanAddonResponse } from '../models/operations/planAddons.js';
5
4
  export declare class PlanAddons {
6
5
  private readonly _client;
7
6
  constructor(_client: Client);
8
- /**
9
- * List add-ons for plan
10
- *
11
- * List add-ons associated with a plan.
12
- *
13
- * GET /openmeter/plans/{planId}/addons
14
- */
15
- list(request: ListPlanAddonsRequest, options?: RequestOptions): Promise<ListPlanAddonsResponse>;
16
- /**
17
- * List add-ons for plan
18
- *
19
- * List add-ons associated with a plan.
20
- *
21
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
22
- *
23
- * GET /openmeter/plans/{planId}/addons
24
- */
25
- listAll(request: ListPlanAddonsRequest, options?: RequestOptions): AsyncIterable<PlanAddon>;
26
7
  /**
27
8
  * Add add-on to plan
28
9
  *
@@ -1,34 +1,11 @@
1
1
  // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
2
2
  import { unwrap } from '../lib/types.js';
3
- import { paginatePages } from '../lib/paginate.js';
4
- import { listPlanAddons, createPlanAddon, getPlanAddon, updatePlanAddon, deletePlanAddon, } from '../funcs/planAddons.js';
3
+ import { createPlanAddon, getPlanAddon, updatePlanAddon, deletePlanAddon, } from '../funcs/planAddons.js';
5
4
  export class PlanAddons {
6
5
  _client;
7
6
  constructor(_client) {
8
7
  this._client = _client;
9
8
  }
10
- /**
11
- * List add-ons for plan
12
- *
13
- * List add-ons associated with a plan.
14
- *
15
- * GET /openmeter/plans/{planId}/addons
16
- */
17
- async list(request, options) {
18
- return unwrap(await listPlanAddons(this._client, request, options));
19
- }
20
- /**
21
- * List add-ons for plan
22
- *
23
- * List add-ons associated with a plan.
24
- *
25
- * Iterates every item across all pages, fetching more as the returned iterable is consumed.
26
- *
27
- * GET /openmeter/plans/{planId}/addons
28
- */
29
- listAll(request, options) {
30
- return paginatePages((req, opts) => listPlanAddons(this._client, req, opts), request, options);
31
- }
32
9
  /**
33
10
  * Add add-on to plan
34
11
  *
package/dist/sdk/sdk.d.ts CHANGED
@@ -4,6 +4,7 @@ import { Meters } from './meters.js';
4
4
  import { Customers } from './customers.js';
5
5
  import { Entitlements } from './entitlements.js';
6
6
  import { Subscriptions } from './subscriptions.js';
7
+ import { Apps } from './apps.js';
7
8
  import { Billing } from './billing.js';
8
9
  import { Tax } from './tax.js';
9
10
  import { Features } from './features.js';
@@ -24,6 +25,8 @@ export declare class OpenMeter extends Client {
24
25
  get entitlements(): Entitlements;
25
26
  private _subscriptions?;
26
27
  get subscriptions(): Subscriptions;
28
+ private _apps?;
29
+ get apps(): Apps;
27
30
  private _billing?;
28
31
  get billing(): Billing;
29
32
  private _tax?;
package/dist/sdk/sdk.js CHANGED
@@ -5,6 +5,7 @@ import { Meters } from './meters.js';
5
5
  import { Customers } from './customers.js';
6
6
  import { Entitlements } from './entitlements.js';
7
7
  import { Subscriptions } from './subscriptions.js';
8
+ import { Apps } from './apps.js';
8
9
  import { Billing } from './billing.js';
9
10
  import { Tax } from './tax.js';
10
11
  import { Features } from './features.js';
@@ -35,6 +36,10 @@ export class OpenMeter extends Client {
35
36
  get subscriptions() {
36
37
  return (this._subscriptions ??= new Subscriptions(this));
37
38
  }
39
+ _apps;
40
+ get apps() {
41
+ return (this._apps ??= new Apps(this));
42
+ }
38
43
  _billing;
39
44
  get billing() {
40
45
  return (this._billing ??= new Billing(this));
@@ -1,6 +1,6 @@
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, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
3
+ import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, EditSubscriptionRequest, EditSubscriptionResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
4
4
  import type { Subscription, SubscriptionAddon } from '../models/types.js';
5
5
  export declare class Subscriptions {
6
6
  private readonly _client;
@@ -57,6 +57,17 @@ export declare class Subscriptions {
57
57
  * POST /openmeter/subscriptions/{subscriptionId}/change
58
58
  */
59
59
  change(request: ChangeSubscriptionRequest, options?: RequestOptions): Promise<ChangeSubscriptionResponse>;
60
+ /**
61
+ * Edit subscription
62
+ *
63
+ * Edits a running subscription by applying an ordered batch of customizations
64
+ * (adding or removing items, adding, removing, or stretching phases, or
65
+ * unscheduling a pending edit). The changes may take effect immediately or at the
66
+ * next billing cycle. Subscriptions that have add-ons cannot be edited.
67
+ *
68
+ * POST /openmeter/subscriptions/{subscriptionId}/edit
69
+ */
70
+ edit(request: EditSubscriptionRequest, options?: RequestOptions): Promise<EditSubscriptionResponse>;
60
71
  /**
61
72
  * List subscription addons
62
73
  *
@@ -1,7 +1,7 @@
1
1
  // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
2
2
  import { unwrap } from '../lib/types.js';
3
3
  import { paginatePages } from '../lib/paginate.js';
4
- import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
4
+ import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, editSubscription, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
5
5
  export class Subscriptions {
6
6
  _client;
7
7
  constructor(_client) {
@@ -73,6 +73,19 @@ export class Subscriptions {
73
73
  async change(request, options) {
74
74
  return unwrap(await changeSubscription(this._client, request, options));
75
75
  }
76
+ /**
77
+ * Edit subscription
78
+ *
79
+ * Edits a running subscription by applying an ordered batch of customizations
80
+ * (adding or removing items, adding, removing, or stretching phases, or
81
+ * unscheduling a pending edit). The changes may take effect immediately or at the
82
+ * next billing cycle. Subscriptions that have add-ons cannot be edited.
83
+ *
84
+ * POST /openmeter/subscriptions/{subscriptionId}/edit
85
+ */
86
+ async edit(request, options) {
87
+ return unwrap(await editSubscription(this._client, request, options));
88
+ }
76
89
  /**
77
90
  * List subscription addons
78
91
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta.232",
3
+ "version": "1.0.0-beta.234",
4
4
  "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
5
  "keywords": [
6
6
  "openmeter",
@@ -1,9 +0,0 @@
1
- import type { AcceptDateStrings } from '../../lib/wire.js';
2
- import type { CursorPaginationQueryPage, GovernanceQueryRequestInput, GovernanceQueryResponse } from '../types.js';
3
- export interface QueryGovernanceAccessQuery {
4
- page?: CursorPaginationQueryPage;
5
- }
6
- export type QueryGovernanceAccessRequest = AcceptDateStrings<{
7
- body: GovernanceQueryRequestInput;
8
- } & QueryGovernanceAccessQuery>;
9
- export type QueryGovernanceAccessResponse = GovernanceQueryResponse;