@openmeter/client 1.0.0-beta.230 → 1.0.0-beta.231

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 +347 -68
  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 +165 -2
  14. package/dist/funcs/customers.js +192 -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/governance.d.ts +14 -1
  24. package/dist/funcs/governance.js +15 -1
  25. package/dist/funcs/index.d.ts +0 -1
  26. package/dist/funcs/index.js +1 -1
  27. package/dist/funcs/invoices.d.ts +44 -1
  28. package/dist/funcs/invoices.js +45 -1
  29. package/dist/funcs/llmCost.d.ts +36 -1
  30. package/dist/funcs/llmCost.js +37 -1
  31. package/dist/funcs/meters.d.ts +53 -1
  32. package/dist/funcs/meters.js +54 -1
  33. package/dist/funcs/planAddons.d.ts +35 -1
  34. package/dist/funcs/planAddons.js +36 -1
  35. package/dist/funcs/plans.d.ts +49 -1
  36. package/dist/funcs/plans.js +50 -1
  37. package/dist/funcs/subscriptions.d.ts +59 -1
  38. package/dist/funcs/subscriptions.js +60 -1
  39. package/dist/funcs/tax.d.ts +25 -1
  40. package/dist/funcs/tax.js +26 -1
  41. package/dist/index.d.ts +4 -6
  42. package/dist/index.js +4 -5
  43. package/dist/lib/config.d.ts +0 -1
  44. package/dist/lib/config.js +1 -1
  45. package/dist/lib/encodings.d.ts +0 -1
  46. package/dist/lib/encodings.js +1 -1
  47. package/dist/lib/paginate.d.ts +56 -0
  48. package/dist/lib/paginate.js +60 -0
  49. package/dist/lib/request.d.ts +0 -1
  50. package/dist/lib/request.js +1 -1
  51. package/dist/lib/to-error.d.ts +0 -1
  52. package/dist/lib/to-error.js +1 -1
  53. package/dist/lib/types.d.ts +0 -1
  54. package/dist/lib/types.js +1 -1
  55. package/dist/lib/version.d.ts +1 -0
  56. package/dist/lib/version.js +5 -0
  57. package/dist/lib/wire.d.ts +3 -1
  58. package/dist/lib/wire.js +93 -4
  59. package/dist/models/errors.d.ts +13 -2
  60. package/dist/models/errors.js +31 -4
  61. package/dist/models/operations/addons.d.ts +0 -1
  62. package/dist/models/operations/addons.js +1 -1
  63. package/dist/models/operations/apps.d.ts +2 -5
  64. package/dist/models/operations/apps.js +1 -1
  65. package/dist/models/operations/billing.d.ts +0 -1
  66. package/dist/models/operations/billing.js +1 -1
  67. package/dist/models/operations/currencies.d.ts +0 -1
  68. package/dist/models/operations/currencies.js +1 -1
  69. package/dist/models/operations/customers.d.ts +9 -6
  70. package/dist/models/operations/customers.js +1 -1
  71. package/dist/models/operations/defaults.d.ts +0 -1
  72. package/dist/models/operations/defaults.js +1 -1
  73. package/dist/models/operations/entitlements.d.ts +0 -1
  74. package/dist/models/operations/entitlements.js +1 -1
  75. package/dist/models/operations/events.d.ts +0 -1
  76. package/dist/models/operations/events.js +1 -1
  77. package/dist/models/operations/features.d.ts +0 -1
  78. package/dist/models/operations/features.js +1 -1
  79. package/dist/models/operations/governance.d.ts +0 -1
  80. package/dist/models/operations/governance.js +1 -1
  81. package/dist/models/operations/invoices.d.ts +4 -7
  82. package/dist/models/operations/invoices.js +1 -1
  83. package/dist/models/operations/llmCost.d.ts +0 -1
  84. package/dist/models/operations/llmCost.js +1 -1
  85. package/dist/models/operations/meters.d.ts +0 -1
  86. package/dist/models/operations/meters.js +1 -1
  87. package/dist/models/operations/planAddons.d.ts +0 -1
  88. package/dist/models/operations/planAddons.js +1 -1
  89. package/dist/models/operations/plans.d.ts +0 -1
  90. package/dist/models/operations/plans.js +1 -1
  91. package/dist/models/operations/subscriptions.d.ts +0 -1
  92. package/dist/models/operations/subscriptions.js +1 -1
  93. package/dist/models/operations/tax.d.ts +0 -1
  94. package/dist/models/operations/tax.js +1 -1
  95. package/dist/models/schemas.d.ts +162 -1
  96. package/dist/models/schemas.js +37 -5
  97. package/dist/models/types.d.ts +464 -577
  98. package/dist/models/types.js +1 -1
  99. package/dist/sdk/addons.d.ts +60 -1
  100. package/dist/sdk/addons.js +63 -1
  101. package/dist/sdk/apps.d.ts +25 -1
  102. package/dist/sdk/apps.js +28 -1
  103. package/dist/sdk/billing.d.ts +57 -1
  104. package/dist/sdk/billing.js +60 -1
  105. package/dist/sdk/customers.d.ts +211 -2
  106. package/dist/sdk/customers.js +222 -2
  107. package/dist/sdk/defaults.d.ts +10 -1
  108. package/dist/sdk/defaults.js +11 -1
  109. package/dist/sdk/entitlements.d.ts +5 -1
  110. package/dist/sdk/entitlements.js +6 -1
  111. package/dist/sdk/events.d.ts +25 -1
  112. package/dist/sdk/events.js +28 -1
  113. package/dist/sdk/features.d.ts +53 -1
  114. package/dist/sdk/features.js +56 -1
  115. package/dist/sdk/internal.d.ts +180 -0
  116. package/dist/sdk/internal.js +224 -0
  117. package/dist/sdk/llmCost.d.ts +57 -1
  118. package/dist/sdk/llmCost.js +62 -1
  119. package/dist/sdk/meters.d.ts +64 -1
  120. package/dist/sdk/meters.js +67 -1
  121. package/dist/sdk/planAddons.d.ts +46 -1
  122. package/dist/sdk/planAddons.js +49 -1
  123. package/dist/sdk/plans.d.ts +60 -1
  124. package/dist/sdk/plans.js +63 -1
  125. package/dist/sdk/sdk.d.ts +9 -10
  126. package/dist/sdk/sdk.js +11 -15
  127. package/dist/sdk/subscriptions.d.ts +72 -3
  128. package/dist/sdk/subscriptions.js +77 -5
  129. package/dist/sdk/tax.d.ts +34 -1
  130. package/dist/sdk/tax.js +37 -1
  131. package/package.json +28 -4
  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
@@ -1,8 +1,51 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
3
  import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
4
+ /**
5
+ * List billing invoices
6
+ *
7
+ * List billing invoices.
8
+ *
9
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
10
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
11
+ * control ordering.
12
+ *
13
+ * GET /openmeter/billing/invoices
14
+ */
4
15
  export declare function listInvoices(client: Client, req?: ListInvoicesRequest, options?: RequestOptions): Promise<Result<ListInvoicesResponse>>;
16
+ /**
17
+ * Get a billing invoice
18
+ *
19
+ * Get a billing invoice by ID.
20
+ *
21
+ * Returns the full invoice resource including line items, status details, totals,
22
+ * and workflow configuration snapshot.
23
+ *
24
+ * GET /openmeter/billing/invoices/{invoiceId}
25
+ */
5
26
  export declare function getInvoice(client: Client, req: GetInvoiceRequest, options?: RequestOptions): Promise<Result<GetInvoiceResponse>>;
27
+ /**
28
+ * Update a billing invoice
29
+ *
30
+ * Update a billing invoice.
31
+ *
32
+ * Only the mutable fields of the invoice can be edited: description, labels,
33
+ * supplier, customer, workflow settings, and top-level lines. Top-level lines are
34
+ * matched by `id`; lines without an `id` are created, and existing lines omitted
35
+ * from `lines` are deleted. Detailed (child) lines are always computed and cannot
36
+ * be edited directly. Only invoices in draft status can be updated.
37
+ *
38
+ * PUT /openmeter/billing/invoices/{invoiceId}
39
+ */
6
40
  export declare function updateInvoice(client: Client, req: UpdateInvoiceRequest, options?: RequestOptions): Promise<Result<UpdateInvoiceResponse>>;
41
+ /**
42
+ * Delete a billing invoice
43
+ *
44
+ * Delete a billing invoice.
45
+ *
46
+ * Only standard invoices in draft status can be deleted. Deleting an invoice will
47
+ * also delete all associated line items and workflow configuration.
48
+ *
49
+ * DELETE /openmeter/billing/invoices/{invoiceId}
50
+ */
7
51
  export declare function deleteInvoice(client: Client, req: DeleteInvoiceRequest, options?: RequestOptions): Promise<Result<DeleteInvoiceResponse>>;
8
- //# sourceMappingURL=invoices.d.ts.map
@@ -1,8 +1,20 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { http } from '../core.js';
2
3
  import { request } from '../lib/request.js';
3
4
  import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
4
5
  import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
5
6
  import * as schemas from '../models/schemas.js';
7
+ /**
8
+ * List billing invoices
9
+ *
10
+ * List billing invoices.
11
+ *
12
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
13
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
14
+ * control ordering.
15
+ *
16
+ * GET /openmeter/billing/invoices
17
+ */
6
18
  export function listInvoices(client, req = {}, options) {
7
19
  return request(() => {
8
20
  const query = toWire({
@@ -25,6 +37,16 @@ export function listInvoices(client, req = {}, options) {
25
37
  });
26
38
  });
27
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
+ */
28
50
  export function getInvoice(client, req, options) {
29
51
  return request(() => {
30
52
  const path = `openmeter/billing/invoices/${(() => {
@@ -44,6 +66,19 @@ export function getInvoice(client, req, options) {
44
66
  });
45
67
  });
46
68
  }
69
+ /**
70
+ * Update a billing invoice
71
+ *
72
+ * Update a billing invoice.
73
+ *
74
+ * Only the mutable fields of the invoice can be edited: description, labels,
75
+ * supplier, customer, workflow settings, and top-level lines. Top-level lines are
76
+ * matched by `id`; lines without an `id` are created, and existing lines omitted
77
+ * from `lines` are deleted. Detailed (child) lines are always computed and cannot
78
+ * be edited directly. Only invoices in draft status can be updated.
79
+ *
80
+ * PUT /openmeter/billing/invoices/{invoiceId}
81
+ */
47
82
  export function updateInvoice(client, req, options) {
48
83
  return request(() => {
49
84
  const path = `openmeter/billing/invoices/${(() => {
@@ -67,6 +102,16 @@ export function updateInvoice(client, req, options) {
67
102
  });
68
103
  });
69
104
  }
105
+ /**
106
+ * Delete a billing invoice
107
+ *
108
+ * Delete a billing invoice.
109
+ *
110
+ * Only standard invoices in draft status can be deleted. Deleting an invoice will
111
+ * also delete all associated line items and workflow configuration.
112
+ *
113
+ * DELETE /openmeter/billing/invoices/{invoiceId}
114
+ */
70
115
  export function deleteInvoice(client, req, options) {
71
116
  return request(async () => {
72
117
  const path = `openmeter/billing/invoices/${(() => {
@@ -78,4 +123,3 @@ export function deleteInvoice(client, req, options) {
78
123
  await http(client).delete(path, options);
79
124
  });
80
125
  }
81
- //# sourceMappingURL=invoices.js.map
@@ -1,9 +1,44 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
3
  import type { ListLlmCostPricesRequest, ListLlmCostPricesResponse, GetLlmCostPriceRequest, GetLlmCostPriceResponse, ListLlmCostOverridesRequest, ListLlmCostOverridesResponse, CreateLlmCostOverrideRequest, CreateLlmCostOverrideResponse, DeleteLlmCostOverrideRequest, DeleteLlmCostOverrideResponse } from '../models/operations/llmCost.js';
4
+ /**
5
+ * List LLM cost prices
6
+ *
7
+ * List global LLM cost prices. Returns prices with overrides applied if any.
8
+ *
9
+ * GET /openmeter/llm-cost/prices
10
+ */
4
11
  export declare function listLlmCostPrices(client: Client, req?: ListLlmCostPricesRequest, options?: RequestOptions): Promise<Result<ListLlmCostPricesResponse>>;
12
+ /**
13
+ * Get LLM cost price
14
+ *
15
+ * Get a specific LLM cost price by ID. Returns the price with overrides applied if
16
+ * any.
17
+ *
18
+ * GET /openmeter/llm-cost/prices/{priceId}
19
+ */
5
20
  export declare function getLlmCostPrice(client: Client, req: GetLlmCostPriceRequest, options?: RequestOptions): Promise<Result<GetLlmCostPriceResponse>>;
21
+ /**
22
+ * List LLM cost overrides
23
+ *
24
+ * List per-namespace price overrides.
25
+ *
26
+ * GET /openmeter/llm-cost/overrides
27
+ */
6
28
  export declare function listLlmCostOverrides(client: Client, req?: ListLlmCostOverridesRequest, options?: RequestOptions): Promise<Result<ListLlmCostOverridesResponse>>;
29
+ /**
30
+ * Create LLM cost override
31
+ *
32
+ * Create a per-namespace price override.
33
+ *
34
+ * POST /openmeter/llm-cost/overrides
35
+ */
7
36
  export declare function createLlmCostOverride(client: Client, req: CreateLlmCostOverrideRequest, options?: RequestOptions): Promise<Result<CreateLlmCostOverrideResponse>>;
37
+ /**
38
+ * Delete LLM cost override
39
+ *
40
+ * Delete a per-namespace price override.
41
+ *
42
+ * DELETE /openmeter/llm-cost/overrides/{priceId}
43
+ */
8
44
  export declare function deleteLlmCostOverride(client: Client, req: DeleteLlmCostOverrideRequest, options?: RequestOptions): Promise<Result<DeleteLlmCostOverrideResponse>>;
9
- //# sourceMappingURL=llmCost.d.ts.map
@@ -1,8 +1,16 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { http } from '../core.js';
2
3
  import { request } from '../lib/request.js';
3
4
  import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
4
5
  import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
5
6
  import * as schemas from '../models/schemas.js';
7
+ /**
8
+ * List LLM cost prices
9
+ *
10
+ * List global LLM cost prices. Returns prices with overrides applied if any.
11
+ *
12
+ * GET /openmeter/llm-cost/prices
13
+ */
6
14
  export function listLlmCostPrices(client, req = {}, options) {
7
15
  return request(() => {
8
16
  const query = toWire({
@@ -25,6 +33,14 @@ export function listLlmCostPrices(client, req = {}, options) {
25
33
  });
26
34
  });
27
35
  }
36
+ /**
37
+ * Get LLM cost price
38
+ *
39
+ * Get a specific LLM cost price by ID. Returns the price with overrides applied if
40
+ * any.
41
+ *
42
+ * GET /openmeter/llm-cost/prices/{priceId}
43
+ */
28
44
  export function getLlmCostPrice(client, req, options) {
29
45
  return request(() => {
30
46
  const path = `openmeter/llm-cost/prices/${(() => {
@@ -44,6 +60,13 @@ export function getLlmCostPrice(client, req, options) {
44
60
  });
45
61
  });
46
62
  }
63
+ /**
64
+ * List LLM cost overrides
65
+ *
66
+ * List per-namespace price overrides.
67
+ *
68
+ * GET /openmeter/llm-cost/overrides
69
+ */
47
70
  export function listLlmCostOverrides(client, req = {}, options) {
48
71
  return request(() => {
49
72
  const query = toWire({
@@ -65,6 +88,13 @@ export function listLlmCostOverrides(client, req = {}, options) {
65
88
  });
66
89
  });
67
90
  }
91
+ /**
92
+ * Create LLM cost override
93
+ *
94
+ * Create a per-namespace price override.
95
+ *
96
+ * POST /openmeter/llm-cost/overrides
97
+ */
68
98
  export function createLlmCostOverride(client, req, options) {
69
99
  return request(() => {
70
100
  const body = toWire(req, schemas.createLlmCostOverrideBody);
@@ -82,6 +112,13 @@ export function createLlmCostOverride(client, req, options) {
82
112
  });
83
113
  });
84
114
  }
115
+ /**
116
+ * Delete LLM cost override
117
+ *
118
+ * Delete a per-namespace price override.
119
+ *
120
+ * DELETE /openmeter/llm-cost/overrides/{priceId}
121
+ */
85
122
  export function deleteLlmCostOverride(client, req, options) {
86
123
  return request(async () => {
87
124
  const path = `openmeter/llm-cost/overrides/${(() => {
@@ -93,4 +130,3 @@ export function deleteLlmCostOverride(client, req, options) {
93
130
  await http(client).delete(path, options);
94
131
  });
95
132
  }
96
- //# sourceMappingURL=llmCost.js.map
@@ -1,11 +1,63 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
3
  import type { CreateMeterRequest, CreateMeterResponse, GetMeterRequest, GetMeterResponse, ListMetersRequest, ListMetersResponse, UpdateMeterRequest, UpdateMeterResponse, DeleteMeterRequest, DeleteMeterResponse, QueryMeterRequest, QueryMeterResponse, QueryMeterCsvRequest, QueryMeterCsvResponse } from '../models/operations/meters.js';
4
+ /**
5
+ * Create meter
6
+ *
7
+ * Create a meter.
8
+ *
9
+ * POST /openmeter/meters
10
+ */
4
11
  export declare function createMeter(client: Client, req: CreateMeterRequest, options?: RequestOptions): Promise<Result<CreateMeterResponse>>;
12
+ /**
13
+ * Get meter
14
+ *
15
+ * Get a meter by ID.
16
+ *
17
+ * GET /openmeter/meters/{meterId}
18
+ */
5
19
  export declare function getMeter(client: Client, req: GetMeterRequest, options?: RequestOptions): Promise<Result<GetMeterResponse>>;
20
+ /**
21
+ * List meters
22
+ *
23
+ * List meters.
24
+ *
25
+ * GET /openmeter/meters
26
+ */
6
27
  export declare function listMeters(client: Client, req?: ListMetersRequest, options?: RequestOptions): Promise<Result<ListMetersResponse>>;
28
+ /**
29
+ * Update meter
30
+ *
31
+ * Update a meter.
32
+ *
33
+ * PUT /openmeter/meters/{meterId}
34
+ */
7
35
  export declare function updateMeter(client: Client, req: UpdateMeterRequest, options?: RequestOptions): Promise<Result<UpdateMeterResponse>>;
36
+ /**
37
+ * Delete meter
38
+ *
39
+ * Delete a meter.
40
+ *
41
+ * DELETE /openmeter/meters/{meterId}
42
+ */
8
43
  export declare function deleteMeter(client: Client, req: DeleteMeterRequest, options?: RequestOptions): Promise<Result<DeleteMeterResponse>>;
44
+ /**
45
+ * Query meter
46
+ *
47
+ * Query a meter for usage.
48
+ *
49
+ * Set `Accept: application/json` (the default) to get a structured JSON response.
50
+ * Set `Accept: text/csv` to download the same data as a CSV file suitable for
51
+ * spreadsheets. The CSV columns, in order, are:
52
+ *
53
+ * `from, to, [subject,] [customer_id, customer_key, customer_name,] <dimensions...>, value`
54
+ *
55
+ * The `subject` column is emitted only when `subject` is in the query's
56
+ * `group_by_dimensions`. The three `customer_*` columns are emitted together only
57
+ * when `customer_id` is in the query's `group_by_dimensions`.
58
+ *
59
+ * POST /openmeter/meters/{meterId}/query
60
+ */
9
61
  export declare function queryMeter(client: Client, req: QueryMeterRequest, options?: RequestOptions): Promise<Result<QueryMeterResponse>>;
62
+ /** POST /openmeter/meters/{meterId}/query */
10
63
  export declare function queryMeterCsv(client: Client, req: QueryMeterCsvRequest, options?: RequestOptions): Promise<Result<QueryMeterCsvResponse>>;
11
- //# sourceMappingURL=meters.d.ts.map
@@ -1,8 +1,16 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { http } from '../core.js';
2
3
  import { request } from '../lib/request.js';
3
4
  import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
4
5
  import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
5
6
  import * as schemas from '../models/schemas.js';
7
+ /**
8
+ * Create meter
9
+ *
10
+ * Create a meter.
11
+ *
12
+ * POST /openmeter/meters
13
+ */
6
14
  export function createMeter(client, req, options) {
7
15
  return request(() => {
8
16
  const body = toWire(req, schemas.createMeterBody);
@@ -20,6 +28,13 @@ export function createMeter(client, req, options) {
20
28
  });
21
29
  });
22
30
  }
31
+ /**
32
+ * Get meter
33
+ *
34
+ * Get a meter by ID.
35
+ *
36
+ * GET /openmeter/meters/{meterId}
37
+ */
23
38
  export function getMeter(client, req, options) {
24
39
  return request(() => {
25
40
  const path = `openmeter/meters/${(() => {
@@ -39,6 +54,13 @@ export function getMeter(client, req, options) {
39
54
  });
40
55
  });
41
56
  }
57
+ /**
58
+ * List meters
59
+ *
60
+ * List meters.
61
+ *
62
+ * GET /openmeter/meters
63
+ */
42
64
  export function listMeters(client, req = {}, options) {
43
65
  return request(() => {
44
66
  const query = toWire({
@@ -61,6 +83,13 @@ export function listMeters(client, req = {}, options) {
61
83
  });
62
84
  });
63
85
  }
86
+ /**
87
+ * Update meter
88
+ *
89
+ * Update a meter.
90
+ *
91
+ * PUT /openmeter/meters/{meterId}
92
+ */
64
93
  export function updateMeter(client, req, options) {
65
94
  return request(() => {
66
95
  const path = `openmeter/meters/${(() => {
@@ -84,6 +113,13 @@ export function updateMeter(client, req, options) {
84
113
  });
85
114
  });
86
115
  }
116
+ /**
117
+ * Delete meter
118
+ *
119
+ * Delete a meter.
120
+ *
121
+ * DELETE /openmeter/meters/{meterId}
122
+ */
87
123
  export function deleteMeter(client, req, options) {
88
124
  return request(async () => {
89
125
  const path = `openmeter/meters/${(() => {
@@ -95,6 +131,23 @@ export function deleteMeter(client, req, options) {
95
131
  await http(client).delete(path, options);
96
132
  });
97
133
  }
134
+ /**
135
+ * Query meter
136
+ *
137
+ * Query a meter for usage.
138
+ *
139
+ * Set `Accept: application/json` (the default) to get a structured JSON response.
140
+ * Set `Accept: text/csv` to download the same data as a CSV file suitable for
141
+ * spreadsheets. The CSV columns, in order, are:
142
+ *
143
+ * `from, to, [subject,] [customer_id, customer_key, customer_name,] <dimensions...>, value`
144
+ *
145
+ * The `subject` column is emitted only when `subject` is in the query's
146
+ * `group_by_dimensions`. The three `customer_*` columns are emitted together only
147
+ * when `customer_id` is in the query's `group_by_dimensions`.
148
+ *
149
+ * POST /openmeter/meters/{meterId}/query
150
+ */
98
151
  export function queryMeter(client, req, options) {
99
152
  return request(() => {
100
153
  const path = `openmeter/meters/${(() => {
@@ -118,6 +171,7 @@ export function queryMeter(client, req, options) {
118
171
  });
119
172
  });
120
173
  }
174
+ /** POST /openmeter/meters/{meterId}/query */
121
175
  export function queryMeterCsv(client, req, options) {
122
176
  const headers = new Headers(options?.headers);
123
177
  headers.set('accept', 'text/csv');
@@ -137,4 +191,3 @@ export function queryMeterCsv(client, req, options) {
137
191
  .text();
138
192
  });
139
193
  }
140
- //# sourceMappingURL=meters.js.map
@@ -1,9 +1,43 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
3
  import type { ListPlanAddonsRequest, ListPlanAddonsResponse, CreatePlanAddonRequest, CreatePlanAddonResponse, GetPlanAddonRequest, GetPlanAddonResponse, UpdatePlanAddonRequest, UpdatePlanAddonResponse, DeletePlanAddonRequest, DeletePlanAddonResponse } from '../models/operations/planAddons.js';
4
+ /**
5
+ * List add-ons for plan
6
+ *
7
+ * List add-ons associated with a plan.
8
+ *
9
+ * GET /openmeter/plans/{planId}/addons
10
+ */
4
11
  export declare function listPlanAddons(client: Client, req: ListPlanAddonsRequest, options?: RequestOptions): Promise<Result<ListPlanAddonsResponse>>;
12
+ /**
13
+ * Add add-on to plan
14
+ *
15
+ * Add an add-on to a plan.
16
+ *
17
+ * POST /openmeter/plans/{planId}/addons
18
+ */
5
19
  export declare function createPlanAddon(client: Client, req: CreatePlanAddonRequest, options?: RequestOptions): Promise<Result<CreatePlanAddonResponse>>;
20
+ /**
21
+ * Get add-on association for plan
22
+ *
23
+ * Get an add-on association for a plan.
24
+ *
25
+ * GET /openmeter/plans/{planId}/addons/{planAddonId}
26
+ */
6
27
  export declare function getPlanAddon(client: Client, req: GetPlanAddonRequest, options?: RequestOptions): Promise<Result<GetPlanAddonResponse>>;
28
+ /**
29
+ * Update add-on association for plan
30
+ *
31
+ * Update an add-on association for a plan.
32
+ *
33
+ * PUT /openmeter/plans/{planId}/addons/{planAddonId}
34
+ */
7
35
  export declare function updatePlanAddon(client: Client, req: UpdatePlanAddonRequest, options?: RequestOptions): Promise<Result<UpdatePlanAddonResponse>>;
36
+ /**
37
+ * Remove add-on from plan
38
+ *
39
+ * Remove an add-on from a plan.
40
+ *
41
+ * DELETE /openmeter/plans/{planId}/addons/{planAddonId}
42
+ */
8
43
  export declare function deletePlanAddon(client: Client, req: DeletePlanAddonRequest, options?: RequestOptions): Promise<Result<DeletePlanAddonResponse>>;
9
- //# sourceMappingURL=planAddons.d.ts.map
@@ -1,8 +1,16 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { http } from '../core.js';
2
3
  import { request } from '../lib/request.js';
3
4
  import { toURLSearchParams } from '../lib/encodings.js';
4
5
  import { toWire, fromWire, assertValid } from '../lib/wire.js';
5
6
  import * as schemas from '../models/schemas.js';
7
+ /**
8
+ * List add-ons for plan
9
+ *
10
+ * List add-ons associated with a plan.
11
+ *
12
+ * GET /openmeter/plans/{planId}/addons
13
+ */
6
14
  export function listPlanAddons(client, req, options) {
7
15
  return request(() => {
8
16
  const path = `openmeter/plans/${(() => {
@@ -29,6 +37,13 @@ export function listPlanAddons(client, req, options) {
29
37
  });
30
38
  });
31
39
  }
40
+ /**
41
+ * Add add-on to plan
42
+ *
43
+ * Add an add-on to a plan.
44
+ *
45
+ * POST /openmeter/plans/{planId}/addons
46
+ */
32
47
  export function createPlanAddon(client, req, options) {
33
48
  return request(() => {
34
49
  const path = `openmeter/plans/${(() => {
@@ -52,6 +67,13 @@ export function createPlanAddon(client, req, options) {
52
67
  });
53
68
  });
54
69
  }
70
+ /**
71
+ * Get add-on association for plan
72
+ *
73
+ * Get an add-on association for a plan.
74
+ *
75
+ * GET /openmeter/plans/{planId}/addons/{planAddonId}
76
+ */
55
77
  export function getPlanAddon(client, req, options) {
56
78
  return request(() => {
57
79
  const path = `openmeter/plans/${(() => {
@@ -76,6 +98,13 @@ export function getPlanAddon(client, req, options) {
76
98
  });
77
99
  });
78
100
  }
101
+ /**
102
+ * Update add-on association for plan
103
+ *
104
+ * Update an add-on association for a plan.
105
+ *
106
+ * PUT /openmeter/plans/{planId}/addons/{planAddonId}
107
+ */
79
108
  export function updatePlanAddon(client, req, options) {
80
109
  return request(() => {
81
110
  const path = `openmeter/plans/${(() => {
@@ -104,6 +133,13 @@ export function updatePlanAddon(client, req, options) {
104
133
  });
105
134
  });
106
135
  }
136
+ /**
137
+ * Remove add-on from plan
138
+ *
139
+ * Remove an add-on from a plan.
140
+ *
141
+ * DELETE /openmeter/plans/{planId}/addons/{planAddonId}
142
+ */
107
143
  export function deletePlanAddon(client, req, options) {
108
144
  return request(async () => {
109
145
  const path = `openmeter/plans/${(() => {
@@ -120,4 +156,3 @@ export function deletePlanAddon(client, req, options) {
120
156
  await http(client).delete(path, options);
121
157
  });
122
158
  }
123
- //# sourceMappingURL=planAddons.js.map
@@ -1,11 +1,59 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
3
  import type { ListPlansRequest, ListPlansResponse, CreatePlanRequest, CreatePlanResponse, UpdatePlanRequest, UpdatePlanResponse, GetPlanRequest, GetPlanResponse, DeletePlanRequest, DeletePlanResponse, ArchivePlanRequest, ArchivePlanResponse, PublishPlanRequest, PublishPlanResponse } from '../models/operations/plans.js';
4
+ /**
5
+ * List plans
6
+ *
7
+ * List all plans.
8
+ *
9
+ * GET /openmeter/plans
10
+ */
4
11
  export declare function listPlans(client: Client, req?: ListPlansRequest, options?: RequestOptions): Promise<Result<ListPlansResponse>>;
12
+ /**
13
+ * Create plan
14
+ *
15
+ * Create a new plan.
16
+ *
17
+ * POST /openmeter/plans
18
+ */
5
19
  export declare function createPlan(client: Client, req: CreatePlanRequest, options?: RequestOptions): Promise<Result<CreatePlanResponse>>;
20
+ /**
21
+ * Update plan
22
+ *
23
+ * Update a plan by id.
24
+ *
25
+ * PUT /openmeter/plans/{planId}
26
+ */
6
27
  export declare function updatePlan(client: Client, req: UpdatePlanRequest, options?: RequestOptions): Promise<Result<UpdatePlanResponse>>;
28
+ /**
29
+ * Get plan
30
+ *
31
+ * Get a plan by id.
32
+ *
33
+ * GET /openmeter/plans/{planId}
34
+ */
7
35
  export declare function getPlan(client: Client, req: GetPlanRequest, options?: RequestOptions): Promise<Result<GetPlanResponse>>;
36
+ /**
37
+ * Delete plan
38
+ *
39
+ * Delete a plan by id.
40
+ *
41
+ * DELETE /openmeter/plans/{planId}
42
+ */
8
43
  export declare function deletePlan(client: Client, req: DeletePlanRequest, options?: RequestOptions): Promise<Result<DeletePlanResponse>>;
44
+ /**
45
+ * Archive plan version
46
+ *
47
+ * Archive a plan version.
48
+ *
49
+ * POST /openmeter/plans/{planId}/archive
50
+ */
9
51
  export declare function archivePlan(client: Client, req: ArchivePlanRequest, options?: RequestOptions): Promise<Result<ArchivePlanResponse>>;
52
+ /**
53
+ * Publish plan version
54
+ *
55
+ * Publish a plan version.
56
+ *
57
+ * POST /openmeter/plans/{planId}/publish
58
+ */
10
59
  export declare function publishPlan(client: Client, req: PublishPlanRequest, options?: RequestOptions): Promise<Result<PublishPlanResponse>>;
11
- //# sourceMappingURL=plans.d.ts.map