@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
@@ -1,28 +1,55 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
2
+ // Retry-After is either delta-seconds (an integer) or an HTTP-date. Only the
3
+ // delta-seconds form is parsed; HTTP-date values yield undefined rather than
4
+ // a parsed Date, keeping the public type a plain number.
5
+ function parseRetryAfter(header) {
6
+ if (header === null) {
7
+ return undefined;
8
+ }
9
+ const trimmed = header.trim();
10
+ return /^\d+$/.test(trimmed) ? Number(trimmed) : undefined;
11
+ }
1
12
  export class HTTPError extends Error {
2
13
  type;
3
14
  title;
4
15
  status;
5
16
  url;
17
+ retryAfter;
6
18
  __raw;
7
- constructor(message, type, title, status, url, __raw) {
19
+ constructor(message, type, title, status, url, retryAfter, __raw) {
8
20
  super(message);
9
21
  this.type = type;
10
22
  this.title = title;
11
23
  this.status = status;
12
24
  this.url = url;
25
+ this.retryAfter = retryAfter;
13
26
  this.__raw = __raw;
27
+ this.name = 'HTTPError';
14
28
  }
15
29
  static fromResponse(resp) {
30
+ const retryAfter = parseRetryAfter(resp.response.headers.get('Retry-After'));
16
31
  if (resp.response.headers
17
32
  .get('Content-Type')
18
33
  ?.includes('application/problem+json') &&
19
34
  resp.error) {
20
- return new HTTPError(resp.error.detail, resp.error.type ?? resp.error.title, resp.error.title, resp.error.status ?? resp.response.status, resp.response.url, resp.error);
35
+ return new HTTPError(resp.error.detail, resp.error.type ?? resp.error.title, resp.error.title, resp.error.status ?? resp.response.status, resp.response.url, retryAfter, resp.error);
21
36
  }
22
- return new HTTPError(`Request failed: ${resp.response.statusText}`, resp.response.statusText, resp.response.statusText, resp.response.status, resp.response.url);
37
+ return new HTTPError(`Request failed: ${resp.response.statusText}`, resp.response.statusText, resp.response.statusText, resp.response.status, resp.response.url, retryAfter);
38
+ }
39
+ /**
40
+ * The `invalid_parameters` problem-detail extension member, present on Bad
41
+ * Request (400) responses. Typed from the schema, not runtime-validated
42
+ * (like the rest of the SDK, this trusts the server rather than rejecting
43
+ * additive fields) — `undefined` when the response didn't carry one.
44
+ */
45
+ get invalidParameters() {
46
+ return this.__raw?.invalid_parameters;
23
47
  }
48
+ /**
49
+ * Escape hatch for problem-detail extension members without a typed
50
+ * accessor above.
51
+ */
24
52
  getField(key) {
25
53
  return this.__raw?.[key];
26
54
  }
27
55
  }
28
- //# sourceMappingURL=errors.js.map
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { Addon, AddonPagePaginatedResponse, CreateAddonRequestInput, ListAddonsParamsFilter, SortQueryInput, UpsertAddonRequestInput } from '../types.js';
2
3
  export interface ListAddonsQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -5,19 +6,30 @@ export interface ListAddonsQuery {
5
6
  size?: number;
6
7
  number?: number;
7
8
  };
8
- /** Sort add-ons returned in the response. Supported sort attributes are: - `id` - `key` - `name` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order. */
9
+ /**
10
+ * Sort add-ons returned in the response. Supported sort attributes are:
11
+ *
12
+ * - `id`
13
+ * - `key`
14
+ * - `name`
15
+ * - `created_at` (default)
16
+ * - `updated_at`
17
+ *
18
+ * The `asc` suffix is optional as the default sort order is ascending. The `desc`
19
+ * suffix is used to specify a descending order.
20
+ */
9
21
  sort?: SortQueryInput;
10
22
  /** Filter add-ons returned in the response. */
11
23
  filter?: ListAddonsParamsFilter;
12
24
  }
13
- export type ListAddonsRequest = ListAddonsQuery;
25
+ export type ListAddonsRequest = AcceptDateStrings<ListAddonsQuery>;
14
26
  export type ListAddonsResponse = AddonPagePaginatedResponse;
15
- export type CreateAddonRequest = CreateAddonRequestInput;
27
+ export type CreateAddonRequest = AcceptDateStrings<CreateAddonRequestInput>;
16
28
  export type CreateAddonResponse = Addon;
17
- export type UpdateAddonRequest = {
29
+ export type UpdateAddonRequest = AcceptDateStrings<{
18
30
  addonId: string;
19
31
  body: UpsertAddonRequestInput;
20
- };
32
+ }>;
21
33
  export type UpdateAddonResponse = Addon;
22
34
  export type GetAddonRequest = {
23
35
  addonId: string;
@@ -35,4 +47,3 @@ export type PublishAddonRequest = {
35
47
  addonId: string;
36
48
  };
37
49
  export type PublishAddonResponse = Addon;
38
- //# sourceMappingURL=addons.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=addons.js.map
@@ -1,6 +1,5 @@
1
- import { z } from 'zod';
2
- import * as schemas from '../schemas.js';
3
- import type { AppPagePaginatedResponse } from '../types.js';
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
2
+ import type { App, AppPagePaginatedResponse } from '../types.js';
4
3
  export interface ListAppsQuery {
5
4
  /** Determines which page of the collection to retrieve. */
6
5
  page?: {
@@ -8,10 +7,9 @@ export interface ListAppsQuery {
8
7
  number?: number;
9
8
  };
10
9
  }
11
- export type ListAppsRequest = ListAppsQuery;
10
+ export type ListAppsRequest = AcceptDateStrings<ListAppsQuery>;
12
11
  export type ListAppsResponse = AppPagePaginatedResponse;
13
12
  export type GetAppRequest = {
14
13
  appId: string;
15
14
  };
16
- export type GetAppResponse = z.output<typeof schemas.getAppResponse>;
17
- //# sourceMappingURL=apps.d.ts.map
15
+ export type GetAppResponse = App;
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=apps.js.map
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CreateBillingProfileRequestInput, Profile, ProfilePagePaginatedResponse, UpsertBillingProfileRequestInput } from '../types.js';
2
3
  export interface ListBillingProfilesQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -6,21 +7,20 @@ export interface ListBillingProfilesQuery {
6
7
  number?: number;
7
8
  };
8
9
  }
9
- export type ListBillingProfilesRequest = ListBillingProfilesQuery;
10
+ export type ListBillingProfilesRequest = AcceptDateStrings<ListBillingProfilesQuery>;
10
11
  export type ListBillingProfilesResponse = ProfilePagePaginatedResponse;
11
- export type CreateBillingProfileRequest = CreateBillingProfileRequestInput;
12
+ export type CreateBillingProfileRequest = AcceptDateStrings<CreateBillingProfileRequestInput>;
12
13
  export type CreateBillingProfileResponse = Profile;
13
14
  export type GetBillingProfileRequest = {
14
15
  id: string;
15
16
  };
16
17
  export type GetBillingProfileResponse = Profile;
17
- export type UpdateBillingProfileRequest = {
18
+ export type UpdateBillingProfileRequest = AcceptDateStrings<{
18
19
  id: string;
19
20
  body: UpsertBillingProfileRequestInput;
20
- };
21
+ }>;
21
22
  export type UpdateBillingProfileResponse = Profile;
22
23
  export type DeleteBillingProfileRequest = {
23
24
  id: string;
24
25
  };
25
26
  export type DeleteBillingProfileResponse = void;
26
- //# sourceMappingURL=billing.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=billing.js.map
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CostBasis, CostBasisPagePaginatedResponse, CreateCostBasisRequest as CreateCostBasisRequestBody, CreateCurrencyCustomRequest, CurrencyCustom, CurrencyPagePaginatedResponse, ListCostBasesParamsFilter, ListCurrenciesParamsFilter, SortQueryInput } from '../types.js';
2
3
  export interface ListCurrenciesQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -5,17 +6,34 @@ export interface ListCurrenciesQuery {
5
6
  size?: number;
6
7
  number?: number;
7
8
  };
8
- /** Sort currencies returned in the response. Supported sort attributes are: - `code` (default) - `name` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order. */
9
+ /**
10
+ * Sort currencies returned in the response. Supported sort attributes are:
11
+ *
12
+ * - `code` (default)
13
+ * - `name`
14
+ *
15
+ * The `asc` suffix is optional as the default sort order is ascending. The `desc`
16
+ * suffix is used to specify a descending order.
17
+ */
9
18
  sort?: SortQueryInput;
10
- /** Filter currencies returned in the response. To filter currencies by type add the following query param: filter[type]=custom */
19
+ /**
20
+ * Filter currencies returned in the response.
21
+ *
22
+ * To filter currencies by type add the following query param: filter[type]=custom
23
+ */
11
24
  filter?: ListCurrenciesParamsFilter;
12
25
  }
13
- export type ListCurrenciesRequest = ListCurrenciesQuery;
26
+ export type ListCurrenciesRequest = AcceptDateStrings<ListCurrenciesQuery>;
14
27
  export type ListCurrenciesResponse = CurrencyPagePaginatedResponse;
15
- export type CreateCustomCurrencyRequest = CreateCurrencyCustomRequest;
28
+ export type CreateCustomCurrencyRequest = AcceptDateStrings<CreateCurrencyCustomRequest>;
16
29
  export type CreateCustomCurrencyResponse = CurrencyCustom;
17
30
  export interface ListCostBasesQuery {
18
- /** Filter cost bases returned in the response. To filter cost bases by fiat currency code add the following query param: filter[fiat_code]=USD */
31
+ /**
32
+ * Filter cost bases returned in the response.
33
+ *
34
+ * To filter cost bases by fiat currency code add the following query param:
35
+ * filter[fiat_code]=USD
36
+ */
19
37
  filter?: ListCostBasesParamsFilter;
20
38
  /** Determines which page of the collection to retrieve. */
21
39
  page?: {
@@ -23,13 +41,12 @@ export interface ListCostBasesQuery {
23
41
  number?: number;
24
42
  };
25
43
  }
26
- export type ListCostBasesRequest = ListCostBasesQuery & {
44
+ export type ListCostBasesRequest = AcceptDateStrings<ListCostBasesQuery & {
27
45
  currencyId: string;
28
- };
46
+ }>;
29
47
  export type ListCostBasesResponse = CostBasisPagePaginatedResponse;
30
- export type CreateCostBasisRequest = {
48
+ export type CreateCostBasisRequest = AcceptDateStrings<{
31
49
  currencyId: string;
32
50
  body: CreateCostBasisRequestBody;
33
- };
51
+ }>;
34
52
  export type CreateCostBasisResponse = CostBasis;
35
- //# sourceMappingURL=currencies.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=currencies.js.map
@@ -1,5 +1,6 @@
1
- import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, ChargePagePaginatedResponse, CreateCreditAdjustmentRequest as CreateCreditAdjustmentRequestBody, CreateCreditGrantRequestInput, CreateCustomerRequest as CreateCustomerRequestBody, CreditAdjustment, CreditBalances, CreditGrant, CreditGrantPagePaginatedResponse, CreditTransactionPaginatedResponse, CursorPaginationQueryPage, Customer, CustomerData, CustomerPagePaginatedResponse, CustomerStripeCreateCheckoutSessionRequestInput, CustomerStripeCreateCustomerPortalSessionRequest, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListCreditGrantsParamsFilter, ListCreditTransactionsParamsFilter, ListCustomersParamsFilter, SortQueryInput, UpsertAppCustomerDataRequest, UpsertCustomerBillingDataRequest, UpsertCustomerRequest as UpsertCustomerRequestBody } from '../types.js';
2
- export type CreateCustomerRequest = CreateCustomerRequestBody;
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
2
+ import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, Charge, ChargePagePaginatedResponse, CreateChargeRequest, CreateCreditAdjustmentRequest as CreateCreditAdjustmentRequestBody, CreateCreditGrantRequestInput, CreateCustomerRequest as CreateCustomerRequestBody, CreditAdjustment, CreditBalances, CreditGrant, CreditGrantPagePaginatedResponse, CreditTransactionPaginatedResponse, CursorPaginationQueryPage, Customer, CustomerData, CustomerPagePaginatedResponse, CustomerStripeCreateCheckoutSessionRequestInput, CustomerStripeCreateCustomerPortalSessionRequest, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListCreditGrantsParamsFilter, ListCreditTransactionsParamsFilter, ListCustomersParamsFilter, SortQueryInput, UpdateCreditGrantExternalSettlementRequest as UpdateCreditGrantExternalSettlementRequestBody, UpsertAppCustomerDataRequest, UpsertCustomerBillingDataRequest, UpsertCustomerRequest as UpsertCustomerRequestBody, VoidCreditGrantRequestInput } from '../types.js';
3
+ export type CreateCustomerRequest = AcceptDateStrings<CreateCustomerRequestBody>;
3
4
  export type CreateCustomerResponse = Customer;
4
5
  export type GetCustomerRequest = {
5
6
  customerId: string;
@@ -11,17 +12,30 @@ export interface ListCustomersQuery {
11
12
  size?: number;
12
13
  number?: number;
13
14
  };
14
- /** Sort customers returned in the response. Supported sort attributes are: - `id` - `name` (default) - `created_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order. */
15
+ /**
16
+ * Sort customers returned in the response. Supported sort attributes are:
17
+ *
18
+ * - `id`
19
+ * - `name` (default)
20
+ * - `created_at`
21
+ *
22
+ * The `asc` suffix is optional as the default sort order is ascending. The `desc`
23
+ * suffix is used to specify a descending order.
24
+ */
15
25
  sort?: SortQueryInput;
16
- /** Filter customers returned in the response. To filter customers by key add the following query param: filter[key]=my-db-id */
26
+ /**
27
+ * Filter customers returned in the response.
28
+ *
29
+ * To filter customers by key add the following query param: filter[key]=my-db-id
30
+ */
17
31
  filter?: ListCustomersParamsFilter;
18
32
  }
19
- export type ListCustomersRequest = ListCustomersQuery;
33
+ export type ListCustomersRequest = AcceptDateStrings<ListCustomersQuery>;
20
34
  export type ListCustomersResponse = CustomerPagePaginatedResponse;
21
- export type UpsertCustomerRequest = {
35
+ export type UpsertCustomerRequest = AcceptDateStrings<{
22
36
  customerId: string;
23
37
  body: UpsertCustomerRequestBody;
24
- };
38
+ }>;
25
39
  export type UpsertCustomerResponse = Customer;
26
40
  export type DeleteCustomerRequest = {
27
41
  customerId: string;
@@ -31,30 +45,30 @@ export type GetCustomerBillingRequest = {
31
45
  customerId: string;
32
46
  };
33
47
  export type GetCustomerBillingResponse = CustomerData;
34
- export type UpdateCustomerBillingRequest = {
48
+ export type UpdateCustomerBillingRequest = AcceptDateStrings<{
35
49
  customerId: string;
36
50
  body: UpsertCustomerBillingDataRequest;
37
- };
51
+ }>;
38
52
  export type UpdateCustomerBillingResponse = CustomerData;
39
- export type UpdateCustomerBillingAppDataRequest = {
53
+ export type UpdateCustomerBillingAppDataRequest = AcceptDateStrings<{
40
54
  customerId: string;
41
55
  body: UpsertAppCustomerDataRequest;
42
- };
56
+ }>;
43
57
  export type UpdateCustomerBillingAppDataResponse = AppCustomerData;
44
- export type CreateCustomerStripeCheckoutSessionRequest = {
58
+ export type CreateCustomerStripeCheckoutSessionRequest = AcceptDateStrings<{
45
59
  customerId: string;
46
60
  body: CustomerStripeCreateCheckoutSessionRequestInput;
47
- };
61
+ }>;
48
62
  export type CreateCustomerStripeCheckoutSessionResponse = AppStripeCreateCheckoutSessionResult;
49
- export type CreateCustomerStripePortalSessionRequest = {
63
+ export type CreateCustomerStripePortalSessionRequest = AcceptDateStrings<{
50
64
  customerId: string;
51
65
  body: CustomerStripeCreateCustomerPortalSessionRequest;
52
- };
66
+ }>;
53
67
  export type CreateCustomerStripePortalSessionResponse = AppStripeCreateCustomerPortalSessionResult;
54
- export type CreateCreditGrantRequest = {
68
+ export type CreateCreditGrantRequest = AcceptDateStrings<{
55
69
  customerId: string;
56
70
  body: CreateCreditGrantRequestInput;
57
- };
71
+ }>;
58
72
  export type CreateCreditGrantResponse = CreditGrant;
59
73
  export type GetCreditGrantRequest = {
60
74
  customerId: string;
@@ -70,32 +84,48 @@ export interface ListCreditGrantsQuery {
70
84
  /** Filter credit grants returned in the response. */
71
85
  filter?: ListCreditGrantsParamsFilter;
72
86
  }
73
- export type ListCreditGrantsRequest = ListCreditGrantsQuery & {
87
+ export type ListCreditGrantsRequest = AcceptDateStrings<ListCreditGrantsQuery & {
74
88
  customerId: string;
75
- };
89
+ }>;
76
90
  export type ListCreditGrantsResponse = CreditGrantPagePaginatedResponse;
77
91
  export interface GetCustomerCreditBalanceQuery {
78
- /** Return the credit balance as of this timestamp. Defaults to the current time. */
79
- timestamp?: string;
92
+ /**
93
+ * Return the credit balance as of this timestamp.
94
+ *
95
+ * Defaults to the current time.
96
+ */
97
+ timestamp?: Date;
80
98
  filter?: GetCreditBalanceParamsFilter;
81
99
  }
82
- export type GetCustomerCreditBalanceRequest = GetCustomerCreditBalanceQuery & {
100
+ export type GetCustomerCreditBalanceRequest = AcceptDateStrings<GetCustomerCreditBalanceQuery & {
83
101
  customerId: string;
84
- };
102
+ }>;
85
103
  export type GetCustomerCreditBalanceResponse = CreditBalances;
86
- export type CreateCreditAdjustmentRequest = {
104
+ export type CreateCreditAdjustmentRequest = AcceptDateStrings<{
87
105
  customerId: string;
88
106
  body: CreateCreditAdjustmentRequestBody;
89
- };
107
+ }>;
90
108
  export type CreateCreditAdjustmentResponse = CreditAdjustment;
109
+ export type VoidCreditGrantRequest = AcceptDateStrings<{
110
+ customerId: string;
111
+ creditGrantId: string;
112
+ body: VoidCreditGrantRequestInput;
113
+ }>;
114
+ export type VoidCreditGrantResponse = CreditGrant;
115
+ export type UpdateCreditGrantExternalSettlementRequest = AcceptDateStrings<{
116
+ customerId: string;
117
+ creditGrantId: string;
118
+ body: UpdateCreditGrantExternalSettlementRequestBody;
119
+ }>;
120
+ export type UpdateCreditGrantExternalSettlementResponse = CreditGrant;
91
121
  export interface ListCreditTransactionsQuery {
92
122
  page?: CursorPaginationQueryPage;
93
123
  /** Filter credit transactions returned in the response. */
94
124
  filter?: ListCreditTransactionsParamsFilter;
95
125
  }
96
- export type ListCreditTransactionsRequest = ListCreditTransactionsQuery & {
126
+ export type ListCreditTransactionsRequest = AcceptDateStrings<ListCreditTransactionsQuery & {
97
127
  customerId: string;
98
- };
128
+ }>;
99
129
  export type ListCreditTransactionsResponse = CreditTransactionPaginatedResponse;
100
130
  export interface ListCustomerChargesQuery {
101
131
  /** Determines which page of the collection to retrieve. */
@@ -103,15 +133,39 @@ export interface ListCustomerChargesQuery {
103
133
  size?: number;
104
134
  number?: number;
105
135
  };
106
- /** Sort charges returned in the response. Supported sort attributes are: - `id` - `created_at` - `service_period.from` - `billing_period.from` */
136
+ /**
137
+ * Sort charges returned in the response.
138
+ *
139
+ * Supported sort attributes are:
140
+ *
141
+ * - `id`
142
+ * - `created_at`
143
+ * - `service_period.from`
144
+ * - `billing_period.from`
145
+ */
107
146
  sort?: SortQueryInput;
108
- /** Filter charges. To filter charges by status add the following query param: `filter[status][oeq]=created,active` */
147
+ /**
148
+ * Filter charges.
149
+ *
150
+ * To filter charges by status add the following query param:
151
+ * `filter[status][oeq]=created,active`
152
+ */
109
153
  filter?: ListChargesParamsFilter;
110
- /** Expand full objects for referenced entities. Supported values are: - `real_time_usage`: Expand the charge's real-time usage. */
154
+ /**
155
+ * Expand full objects for referenced entities.
156
+ *
157
+ * Supported values are:
158
+ *
159
+ * - `real_time_usage`: Expand the charge's real-time usage.
160
+ */
111
161
  expand?: 'real_time_usage'[];
112
162
  }
113
- export type ListCustomerChargesRequest = ListCustomerChargesQuery & {
163
+ export type ListCustomerChargesRequest = AcceptDateStrings<ListCustomerChargesQuery & {
114
164
  customerId: string;
115
- };
165
+ }>;
116
166
  export type ListCustomerChargesResponse = ChargePagePaginatedResponse;
117
- //# sourceMappingURL=customers.d.ts.map
167
+ export type CreateCustomerChargesRequest = AcceptDateStrings<{
168
+ customerId: string;
169
+ body: CreateChargeRequest;
170
+ }>;
171
+ export type CreateCustomerChargesResponse = Charge;
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=customers.js.map
@@ -1,6 +1,6 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { OrganizationDefaultTaxCodes, UpdateOrganizationDefaultTaxCodesRequest as UpdateOrganizationDefaultTaxCodesRequestBody } from '../types.js';
2
3
  export type GetOrganizationDefaultTaxCodesRequest = Record<string, never>;
3
4
  export type GetOrganizationDefaultTaxCodesResponse = OrganizationDefaultTaxCodes;
4
- export type UpdateOrganizationDefaultTaxCodesRequest = UpdateOrganizationDefaultTaxCodesRequestBody;
5
+ export type UpdateOrganizationDefaultTaxCodesRequest = AcceptDateStrings<UpdateOrganizationDefaultTaxCodesRequestBody>;
5
6
  export type UpdateOrganizationDefaultTaxCodesResponse = OrganizationDefaultTaxCodes;
6
- //# sourceMappingURL=defaults.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=defaults.js.map
@@ -3,4 +3,3 @@ export type ListCustomerEntitlementAccessRequest = {
3
3
  customerId: string;
4
4
  };
5
5
  export type ListCustomerEntitlementAccessResponse = ListCustomerEntitlementAccessResponseData;
6
- //# sourceMappingURL=entitlements.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=entitlements.js.map
@@ -1,13 +1,28 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CursorPaginationQueryPage, EventInput, IngestedEventPaginatedResponse, ListEventsParamsFilter, SortQueryInput } from '../types.js';
2
3
  export interface ListMeteringEventsQuery {
3
4
  page?: CursorPaginationQueryPage;
4
- /** Filter events returned in the response. To filter events by subject add the following query param: filter[subject][eq]=customer-1 */
5
+ /**
6
+ * Filter events returned in the response.
7
+ *
8
+ * To filter events by subject add the following query param:
9
+ * filter[subject][eq]=customer-1
10
+ */
5
11
  filter?: ListEventsParamsFilter;
6
- /** Sort events returned in the response. Supported sort attributes are: - `time` (default) - `ingested_at` - `stored_at` When omitted, events are sorted by `time desc` (most recent first). When a sort field is provided without a suffix, it sorts descending. Append the `asc` suffix to sort ascending, or the `desc` suffix to sort descending. */
12
+ /**
13
+ * Sort events returned in the response. Supported sort attributes are:
14
+ *
15
+ * - `time` (default)
16
+ * - `ingested_at`
17
+ * - `stored_at`
18
+ *
19
+ * When omitted, events are sorted by `time desc` (most recent first). When a sort
20
+ * field is provided without a suffix, it sorts descending. Append the `asc` suffix
21
+ * to sort ascending, or the `desc` suffix to sort descending.
22
+ */
7
23
  sort?: SortQueryInput;
8
24
  }
9
- export type ListMeteringEventsRequest = ListMeteringEventsQuery;
25
+ export type ListMeteringEventsRequest = AcceptDateStrings<ListMeteringEventsQuery>;
10
26
  export type ListMeteringEventsResponse = IngestedEventPaginatedResponse;
11
- export type IngestMeteringEventsRequest = EventInput | EventInput[];
27
+ export type IngestMeteringEventsRequest = AcceptDateStrings<EventInput | EventInput[]>;
12
28
  export type IngestMeteringEventsResponse = void;
13
- //# sourceMappingURL=events.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=events.js.map
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CreateFeatureRequest as CreateFeatureRequestBody, Feature, FeatureCostQueryResult, FeaturePagePaginatedResponse, ListFeatureParamsFilter, MeterQueryRequestInput, SortQueryInput, UpdateFeatureRequest as UpdateFeatureRequestBody } from '../types.js';
2
3
  export interface ListFeaturesQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -5,31 +6,45 @@ export interface ListFeaturesQuery {
5
6
  size?: number;
6
7
  number?: number;
7
8
  };
8
- /** Sort features returned in the response. Supported sort attributes are: - `key` - `name` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order. */
9
+ /**
10
+ * Sort features returned in the response. Supported sort attributes are:
11
+ *
12
+ * - `key`
13
+ * - `name`
14
+ * - `created_at` (default)
15
+ * - `updated_at`
16
+ *
17
+ * The `asc` suffix is optional as the default sort order is ascending. The `desc`
18
+ * suffix is used to specify a descending order.
19
+ */
9
20
  sort?: SortQueryInput;
10
- /** Filter features returned in the response. To filter features by meter_id add the following query param: filter[meter_id][oeq]=<id> */
21
+ /**
22
+ * Filter features returned in the response.
23
+ *
24
+ * To filter features by meter_id add the following query param:
25
+ * filter[meter_id][oeq]=<id>
26
+ */
11
27
  filter?: ListFeatureParamsFilter;
12
28
  }
13
- export type ListFeaturesRequest = ListFeaturesQuery;
29
+ export type ListFeaturesRequest = AcceptDateStrings<ListFeaturesQuery>;
14
30
  export type ListFeaturesResponse = FeaturePagePaginatedResponse;
15
- export type CreateFeatureRequest = CreateFeatureRequestBody;
31
+ export type CreateFeatureRequest = AcceptDateStrings<CreateFeatureRequestBody>;
16
32
  export type CreateFeatureResponse = Feature;
17
33
  export type GetFeatureRequest = {
18
34
  featureId: string;
19
35
  };
20
36
  export type GetFeatureResponse = Feature;
21
- export type UpdateFeatureRequest = {
37
+ export type UpdateFeatureRequest = AcceptDateStrings<{
22
38
  featureId: string;
23
39
  body: UpdateFeatureRequestBody;
24
- };
40
+ }>;
25
41
  export type UpdateFeatureResponse = Feature;
26
42
  export type DeleteFeatureRequest = {
27
43
  featureId: string;
28
44
  };
29
45
  export type DeleteFeatureResponse = void;
30
- export type QueryFeatureCostRequest = {
46
+ export type QueryFeatureCostRequest = AcceptDateStrings<{
31
47
  featureId: string;
32
48
  body: MeterQueryRequestInput;
33
- };
49
+ }>;
34
50
  export type QueryFeatureCostResponse = FeatureCostQueryResult;
35
- //# sourceMappingURL=features.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=features.js.map
@@ -1,9 +1,9 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CursorPaginationQueryPage, GovernanceQueryRequestInput, GovernanceQueryResponse } from '../types.js';
2
3
  export interface QueryGovernanceAccessQuery {
3
4
  page?: CursorPaginationQueryPage;
4
5
  }
5
- export type QueryGovernanceAccessRequest = {
6
+ export type QueryGovernanceAccessRequest = AcceptDateStrings<{
6
7
  body: GovernanceQueryRequestInput;
7
- } & QueryGovernanceAccessQuery;
8
+ } & QueryGovernanceAccessQuery>;
8
9
  export type QueryGovernanceAccessResponse = GovernanceQueryResponse;
9
- //# sourceMappingURL=governance.d.ts.map
@@ -1,2 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export {};
2
- //# sourceMappingURL=governance.js.map
@@ -0,0 +1,45 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
2
+ import type { Invoice, InvoicePagePaginatedResponse, ListInvoicesParamsFilter, SortQueryInput, UpdateInvoiceRequestInput } from '../types.js';
3
+ export interface ListInvoicesQuery {
4
+ /** Determines which page of the collection to retrieve. */
5
+ page?: {
6
+ size?: number;
7
+ number?: number;
8
+ };
9
+ /**
10
+ * Sort invoices returned in the response. Supported sort attributes:
11
+ *
12
+ * - `issued_at`
13
+ * - `created_at` (default)
14
+ * - `service_period_start`
15
+ *
16
+ * The `asc` suffix is optional as the default sort order is ascending. The `desc`
17
+ * suffix is used to specify a descending order.
18
+ */
19
+ sort?: SortQueryInput;
20
+ /**
21
+ * Filter invoices returned in the response.
22
+ *
23
+ * Examples:
24
+ *
25
+ * - `filter[status][oeq]=draft,issued`
26
+ * - `filter[customer_id]=01KPDB8K...`
27
+ * - `filter[issued_at][gte]=2024-01-01T00:00:00Z`
28
+ */
29
+ filter?: ListInvoicesParamsFilter;
30
+ }
31
+ export type ListInvoicesRequest = AcceptDateStrings<ListInvoicesQuery>;
32
+ export type ListInvoicesResponse = InvoicePagePaginatedResponse;
33
+ export type GetInvoiceRequest = {
34
+ invoiceId: string;
35
+ };
36
+ export type GetInvoiceResponse = Invoice;
37
+ export type UpdateInvoiceRequest = AcceptDateStrings<{
38
+ invoiceId: string;
39
+ body: UpdateInvoiceRequestInput;
40
+ }>;
41
+ export type UpdateInvoiceResponse = Invoice;
42
+ export type DeleteInvoiceRequest = {
43
+ invoiceId: string;
44
+ };
45
+ export type DeleteInvoiceResponse = void;
@@ -0,0 +1,2 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
2
+ export {};