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

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 (67) hide show
  1. package/README.md +130 -111
  2. package/dist/funcs/addons.js +115 -28
  3. package/dist/funcs/apps.js +37 -10
  4. package/dist/funcs/billing.js +79 -18
  5. package/dist/funcs/currencies.js +82 -22
  6. package/dist/funcs/customers.d.ts +3 -1
  7. package/dist/funcs/customers.js +396 -83
  8. package/dist/funcs/defaults.js +24 -4
  9. package/dist/funcs/entitlements.js +19 -5
  10. package/dist/funcs/events.js +26 -8
  11. package/dist/funcs/features.js +102 -24
  12. package/dist/funcs/governance.js +27 -5
  13. package/dist/funcs/index.d.ts +1 -0
  14. package/dist/funcs/index.js +1 -0
  15. package/dist/funcs/invoices.d.ts +8 -0
  16. package/dist/funcs/invoices.js +81 -0
  17. package/dist/funcs/llmCost.js +78 -22
  18. package/dist/funcs/meters.d.ts +2 -1
  19. package/dist/funcs/meters.js +121 -24
  20. package/dist/funcs/planAddons.js +106 -20
  21. package/dist/funcs/plans.js +115 -28
  22. package/dist/funcs/subscriptions.d.ts +2 -1
  23. package/dist/funcs/subscriptions.js +182 -38
  24. package/dist/funcs/tax.js +80 -19
  25. package/dist/index.d.ts +5 -1
  26. package/dist/index.js +2 -0
  27. package/dist/lib/config.d.ts +9 -0
  28. package/dist/lib/config.js +1 -7
  29. package/dist/lib/encodings.d.ts +1 -1
  30. package/dist/lib/encodings.js +5 -4
  31. package/dist/lib/wire.d.ts +18 -0
  32. package/dist/lib/wire.js +312 -0
  33. package/dist/models/operations/addons.d.ts +17 -5
  34. package/dist/models/operations/apps.d.ts +2 -1
  35. package/dist/models/operations/billing.d.ts +5 -4
  36. package/dist/models/operations/currencies.d.ts +27 -9
  37. package/dist/models/operations/customers.d.ts +84 -33
  38. package/dist/models/operations/defaults.d.ts +2 -1
  39. package/dist/models/operations/events.d.ts +20 -4
  40. package/dist/models/operations/features.d.ts +24 -8
  41. package/dist/models/operations/governance.d.ts +3 -2
  42. package/dist/models/operations/invoices.d.ts +48 -0
  43. package/dist/models/operations/invoices.js +2 -0
  44. package/dist/models/operations/llmCost.d.ts +16 -4
  45. package/dist/models/operations/meters.d.ts +29 -8
  46. package/dist/models/operations/planAddons.d.ts +7 -6
  47. package/dist/models/operations/plans.d.ts +14 -5
  48. package/dist/models/operations/subscriptions.d.ts +36 -10
  49. package/dist/models/operations/tax.d.ts +6 -5
  50. package/dist/models/schemas.d.ts +27219 -3021
  51. package/dist/models/schemas.js +7079 -1362
  52. package/dist/models/types.d.ts +4309 -1046
  53. package/dist/sdk/apps.js +1 -1
  54. package/dist/sdk/customers.d.ts +3 -1
  55. package/dist/sdk/customers.js +7 -1
  56. package/dist/sdk/entitlements.js +1 -1
  57. package/dist/sdk/events.js +1 -1
  58. package/dist/sdk/governance.js +1 -1
  59. package/dist/sdk/invoices.d.ts +12 -0
  60. package/dist/sdk/invoices.js +21 -0
  61. package/dist/sdk/meters.d.ts +2 -1
  62. package/dist/sdk/meters.js +4 -1
  63. package/dist/sdk/sdk.d.ts +3 -0
  64. package/dist/sdk/sdk.js +5 -0
  65. package/dist/sdk/subscriptions.d.ts +2 -1
  66. package/dist/sdk/subscriptions.js +4 -1
  67. package/package.json +4 -3
@@ -1,5 +1,6 @@
1
- import type { ListSubscriptionsParamsFilter, SortQueryInput, Subscription, SubscriptionAddon, SubscriptionAddonPagePaginatedResponse, SubscriptionCancelInput, SubscriptionChange, SubscriptionChangeResponse, SubscriptionCreate, SubscriptionPagePaginatedResponse } from '../types.js';
2
- export type CreateSubscriptionRequest = SubscriptionCreate;
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
2
+ import type { CreateSubscriptionAddonRequest as CreateSubscriptionAddonRequestBody, ListSubscriptionsParamsFilter, SortQueryInput, Subscription, SubscriptionAddon, SubscriptionAddonPagePaginatedResponse, SubscriptionCancelInput, SubscriptionChange, SubscriptionChangeResponse, SubscriptionCreate, SubscriptionPagePaginatedResponse } from '../types.js';
3
+ export type CreateSubscriptionRequest = AcceptDateStrings<SubscriptionCreate>;
3
4
  export type CreateSubscriptionResponse = Subscription;
4
5
  export interface ListSubscriptionsQuery {
5
6
  /** Determines which page of the collection to retrieve. */
@@ -7,42 +8,67 @@ export interface ListSubscriptionsQuery {
7
8
  size?: number;
8
9
  number?: number;
9
10
  };
10
- /** Sort subscriptions returned in the response. Supported sort attributes are: - `id` - `active_from` (default) - `active_to` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order. */
11
+ /**
12
+ * Sort subscriptions returned in the response. Supported sort attributes are:
13
+ *
14
+ * - `id`
15
+ * - `active_from` (default)
16
+ * - `active_to`
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
+ */
11
21
  sort?: SortQueryInput;
12
22
  /** Filter subscriptions. */
13
23
  filter?: ListSubscriptionsParamsFilter;
14
24
  }
15
- export type ListSubscriptionsRequest = ListSubscriptionsQuery;
25
+ export type ListSubscriptionsRequest = AcceptDateStrings<ListSubscriptionsQuery>;
16
26
  export type ListSubscriptionsResponse = SubscriptionPagePaginatedResponse;
17
27
  export type GetSubscriptionRequest = {
18
28
  subscriptionId: string;
19
29
  };
20
30
  export type GetSubscriptionResponse = Subscription;
21
- export type CancelSubscriptionRequest = {
31
+ export type CancelSubscriptionRequest = AcceptDateStrings<{
22
32
  subscriptionId: string;
23
33
  body: SubscriptionCancelInput;
24
- };
34
+ }>;
25
35
  export type CancelSubscriptionResponse = Subscription;
26
36
  export type UnscheduleCancelationRequest = {
27
37
  subscriptionId: string;
28
38
  };
29
39
  export type UnscheduleCancelationResponse = Subscription;
30
- export type ChangeSubscriptionRequest = {
40
+ export type ChangeSubscriptionRequest = AcceptDateStrings<{
31
41
  subscriptionId: string;
32
42
  body: SubscriptionChange;
33
- };
43
+ }>;
34
44
  export type ChangeSubscriptionResponse = SubscriptionChangeResponse;
45
+ export type CreateSubscriptionAddonRequest = AcceptDateStrings<{
46
+ subscriptionId: string;
47
+ body: CreateSubscriptionAddonRequestBody;
48
+ }>;
49
+ export type CreateSubscriptionAddonResponse = SubscriptionAddon;
35
50
  export interface ListSubscriptionAddonsQuery {
36
51
  /** Determines which page of the collection to retrieve. */
37
52
  page?: {
38
53
  size?: number;
39
54
  number?: number;
40
55
  };
56
+ /**
57
+ * Sort subscription addons returned in the response. Supported sort attributes
58
+ * are:
59
+ *
60
+ * - `id`
61
+ * - `created_at` (default)
62
+ * - `updated_at`
63
+ *
64
+ * The `asc` suffix is optional as the default sort order is ascending. The `desc`
65
+ * suffix is used to specify a descending order.
66
+ */
41
67
  sort?: SortQueryInput;
42
68
  }
43
- export type ListSubscriptionAddonsRequest = ListSubscriptionAddonsQuery & {
69
+ export type ListSubscriptionAddonsRequest = AcceptDateStrings<ListSubscriptionAddonsQuery & {
44
70
  subscriptionId: string;
45
- };
71
+ }>;
46
72
  export type ListSubscriptionAddonsResponse = SubscriptionAddonPagePaginatedResponse;
47
73
  export type GetSubscriptionAddonRequest = {
48
74
  subscriptionId: string;
@@ -1,5 +1,6 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CreateTaxCodeRequest as CreateTaxCodeRequestBody, TaxCode, TaxCodePagePaginatedResponse, UpsertTaxCodeRequest as UpsertTaxCodeRequestBody } from '../types.js';
2
- export type CreateTaxCodeRequest = CreateTaxCodeRequestBody;
3
+ export type CreateTaxCodeRequest = AcceptDateStrings<CreateTaxCodeRequestBody>;
3
4
  export type CreateTaxCodeResponse = TaxCode;
4
5
  export type GetTaxCodeRequest = {
5
6
  taxCodeId: string;
@@ -12,14 +13,14 @@ export interface ListTaxCodesQuery {
12
13
  number?: number;
13
14
  };
14
15
  /** Include deleted tax codes in the response. */
15
- include_deleted?: boolean;
16
+ includeDeleted?: boolean;
16
17
  }
17
- export type ListTaxCodesRequest = ListTaxCodesQuery;
18
+ export type ListTaxCodesRequest = AcceptDateStrings<ListTaxCodesQuery>;
18
19
  export type ListTaxCodesResponse = TaxCodePagePaginatedResponse;
19
- export type UpsertTaxCodeRequest = {
20
+ export type UpsertTaxCodeRequest = AcceptDateStrings<{
20
21
  taxCodeId: string;
21
22
  body: UpsertTaxCodeRequestBody;
22
- };
23
+ }>;
23
24
  export type UpsertTaxCodeResponse = TaxCode;
24
25
  export type DeleteTaxCodeRequest = {
25
26
  taxCodeId: string;