@openmeter/client 1.0.0-beta.229 → 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 (135) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +364 -66
  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 +161 -29
  7. package/dist/funcs/apps.d.ts +14 -1
  8. package/dist/funcs/apps.js +52 -9
  9. package/dist/funcs/billing.d.ts +46 -1
  10. package/dist/funcs/billing.js +126 -17
  11. package/dist/funcs/currencies.d.ts +30 -1
  12. package/dist/funcs/currencies.js +113 -23
  13. package/dist/funcs/customers.d.ts +167 -2
  14. package/dist/funcs/customers.js +580 -90
  15. package/dist/funcs/defaults.d.ts +10 -1
  16. package/dist/funcs/defaults.js +35 -5
  17. package/dist/funcs/entitlements.d.ts +5 -1
  18. package/dist/funcs/entitlements.js +25 -6
  19. package/dist/funcs/events.d.ts +14 -1
  20. package/dist/funcs/events.js +41 -9
  21. package/dist/funcs/features.d.ts +42 -1
  22. package/dist/funcs/features.js +142 -28
  23. package/dist/funcs/governance.d.ts +14 -1
  24. package/dist/funcs/governance.js +42 -10
  25. package/dist/funcs/index.d.ts +1 -1
  26. package/dist/funcs/index.js +2 -1
  27. package/dist/funcs/invoices.d.ts +51 -0
  28. package/dist/funcs/invoices.js +125 -0
  29. package/dist/funcs/llmCost.d.ts +36 -1
  30. package/dist/funcs/llmCost.js +114 -24
  31. package/dist/funcs/meters.d.ts +55 -2
  32. package/dist/funcs/meters.js +172 -28
  33. package/dist/funcs/planAddons.d.ts +35 -1
  34. package/dist/funcs/planAddons.js +139 -29
  35. package/dist/funcs/plans.d.ts +49 -1
  36. package/dist/funcs/plans.js +163 -25
  37. package/dist/funcs/subscriptions.d.ts +61 -2
  38. package/dist/funcs/subscriptions.js +238 -40
  39. package/dist/funcs/tax.d.ts +25 -1
  40. package/dist/funcs/tax.js +104 -22
  41. package/dist/index.d.ts +6 -4
  42. package/dist/index.js +4 -3
  43. package/dist/lib/config.d.ts +9 -1
  44. package/dist/lib/config.js +1 -1
  45. package/dist/lib/encodings.d.ts +1 -2
  46. package/dist/lib/encodings.js +6 -5
  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 +20 -0
  58. package/dist/lib/wire.js +401 -0
  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 +17 -6
  62. package/dist/models/operations/addons.js +1 -1
  63. package/dist/models/operations/apps.d.ts +4 -6
  64. package/dist/models/operations/apps.js +1 -1
  65. package/dist/models/operations/billing.d.ts +5 -5
  66. package/dist/models/operations/billing.js +1 -1
  67. package/dist/models/operations/currencies.d.ts +27 -10
  68. package/dist/models/operations/currencies.js +1 -1
  69. package/dist/models/operations/customers.d.ts +87 -33
  70. package/dist/models/operations/customers.js +1 -1
  71. package/dist/models/operations/defaults.d.ts +2 -2
  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 +20 -5
  76. package/dist/models/operations/events.js +1 -1
  77. package/dist/models/operations/features.d.ts +24 -9
  78. package/dist/models/operations/features.js +1 -1
  79. package/dist/models/operations/governance.d.ts +3 -3
  80. package/dist/models/operations/governance.js +1 -1
  81. package/dist/models/operations/invoices.d.ts +45 -0
  82. package/dist/models/operations/invoices.js +2 -0
  83. package/dist/models/operations/llmCost.d.ts +16 -5
  84. package/dist/models/operations/llmCost.js +1 -1
  85. package/dist/models/operations/meters.d.ts +29 -9
  86. package/dist/models/operations/meters.js +1 -1
  87. package/dist/models/operations/planAddons.d.ts +7 -7
  88. package/dist/models/operations/planAddons.js +1 -1
  89. package/dist/models/operations/plans.d.ts +14 -6
  90. package/dist/models/operations/plans.js +1 -1
  91. package/dist/models/operations/subscriptions.d.ts +36 -11
  92. package/dist/models/operations/subscriptions.js +1 -1
  93. package/dist/models/operations/tax.d.ts +6 -6
  94. package/dist/models/operations/tax.js +1 -1
  95. package/dist/models/schemas.d.ts +27484 -3125
  96. package/dist/models/schemas.js +6247 -495
  97. package/dist/models/types.d.ts +4548 -1398
  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 +213 -2
  106. package/dist/sdk/customers.js +228 -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 +66 -2
  120. package/dist/sdk/meters.js +71 -2
  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 -7
  126. package/dist/sdk/sdk.js +11 -10
  127. package/dist/sdk/subscriptions.d.ts +71 -1
  128. package/dist/sdk/subscriptions.js +76 -1
  129. package/dist/sdk/tax.d.ts +34 -1
  130. package/dist/sdk/tax.js +37 -1
  131. package/package.json +31 -6
  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
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.229",
3
+ "version": "1.0.0-beta.231",
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
- "@types/node": "25.9.1",
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,9 +48,11 @@
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
- "build": "tsc"
55
+ "build": "tsc",
56
+ "typecheck": "tsc --noEmit && tsc -p tsconfig.tests.json"
32
57
  }
33
58
  }
@@ -1,12 +0,0 @@
1
- import { type Client } from '../core.js';
2
- import { type RequestOptions } from '../lib/types.js';
3
- import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
4
- export declare class Currencies {
5
- private readonly _client;
6
- constructor(_client: Client);
7
- list(request?: ListCurrenciesRequest, options?: RequestOptions): Promise<ListCurrenciesResponse>;
8
- createCustomCurrency(request: CreateCustomCurrencyRequest, options?: RequestOptions): Promise<CreateCustomCurrencyResponse>;
9
- listCostBases(request: ListCostBasesRequest, options?: RequestOptions): Promise<ListCostBasesResponse>;
10
- createCostBasis(request: CreateCostBasisRequest, options?: RequestOptions): Promise<CreateCostBasisResponse>;
11
- }
12
- //# sourceMappingURL=currencies.d.ts.map
@@ -1,21 +0,0 @@
1
- import { unwrap } from '../lib/types.js';
2
- import { listCurrencies, createCustomCurrency, listCostBases, createCostBasis, } from '../funcs/currencies.js';
3
- export class Currencies {
4
- _client;
5
- constructor(_client) {
6
- this._client = _client;
7
- }
8
- async list(request, options) {
9
- return unwrap(await listCurrencies(this._client, request, options));
10
- }
11
- async createCustomCurrency(request, options) {
12
- return unwrap(await createCustomCurrency(this._client, request, options));
13
- }
14
- async listCostBases(request, options) {
15
- return unwrap(await listCostBases(this._client, request, options));
16
- }
17
- async createCostBasis(request, options) {
18
- return unwrap(await createCostBasis(this._client, request, options));
19
- }
20
- }
21
- //# sourceMappingURL=currencies.js.map
@@ -1,9 +0,0 @@
1
- import { type Client } from '../core.js';
2
- import { type RequestOptions } from '../lib/types.js';
3
- import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
4
- export declare class Governance {
5
- private readonly _client;
6
- constructor(_client: Client);
7
- queryAccess(request: QueryGovernanceAccessRequest, options?: RequestOptions): Promise<QueryGovernanceAccessResponse>;
8
- }
9
- //# sourceMappingURL=governance.d.ts.map
@@ -1,12 +0,0 @@
1
- import { unwrap } from '../lib/types.js';
2
- import { queryGovernanceAccess } from '../funcs/governance.js';
3
- export class Governance {
4
- _client;
5
- constructor(_client) {
6
- this._client = _client;
7
- }
8
- async queryAccess(request, options) {
9
- return unwrap(await queryGovernanceAccess(this._client, request, options));
10
- }
11
- }
12
- //# sourceMappingURL=governance.js.map