@openmeter/sdk 1.0.0-beta.23 → 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 (165) hide show
  1. package/README.md +234 -146
  2. package/dist/cjs/index.cjs +18 -0
  3. package/dist/cjs/index.cjs.map +1 -0
  4. package/dist/cjs/index.d.cts +1 -0
  5. package/dist/cjs/src/client/addons.cjs +105 -0
  6. package/dist/cjs/src/client/addons.cjs.map +1 -0
  7. package/dist/cjs/src/client/addons.d.cts +152 -0
  8. package/dist/cjs/src/client/apps.cjs +247 -0
  9. package/dist/cjs/src/client/apps.cjs.map +1 -0
  10. package/dist/cjs/src/client/apps.d.cts +327 -0
  11. package/dist/cjs/src/client/billing.cjs +375 -0
  12. package/dist/cjs/src/client/billing.cjs.map +1 -0
  13. package/dist/cjs/src/client/billing.d.cts +563 -0
  14. package/dist/cjs/src/client/common.cjs +47 -0
  15. package/dist/cjs/src/client/common.cjs.map +1 -0
  16. package/dist/cjs/src/client/common.d.cts +30 -0
  17. package/dist/cjs/src/client/customers.cjs +469 -0
  18. package/dist/cjs/src/client/customers.cjs.map +1 -0
  19. package/dist/cjs/src/client/customers.d.cts +620 -0
  20. package/dist/cjs/src/client/debug.cjs +27 -0
  21. package/dist/cjs/src/client/debug.cjs.map +1 -0
  22. package/dist/cjs/src/client/debug.d.cts +17 -0
  23. package/dist/cjs/src/client/entitlements.cjs +372 -0
  24. package/dist/cjs/src/client/entitlements.cjs.map +1 -0
  25. package/dist/cjs/src/client/entitlements.d.cts +670 -0
  26. package/dist/cjs/src/client/events.cjs +113 -0
  27. package/dist/cjs/src/client/events.cjs.map +1 -0
  28. package/dist/cjs/src/client/events.d.cts +48 -0
  29. package/dist/cjs/src/client/features.cjs +78 -0
  30. package/dist/cjs/src/client/features.cjs.map +1 -0
  31. package/dist/cjs/src/client/features.d.cts +90 -0
  32. package/dist/cjs/src/client/index.cjs +122 -0
  33. package/dist/cjs/src/client/index.cjs.map +1 -0
  34. package/dist/cjs/src/client/index.d.cts +54 -0
  35. package/dist/cjs/src/client/info.cjs +42 -0
  36. package/dist/cjs/src/client/info.cjs.map +1 -0
  37. package/dist/cjs/src/client/info.d.cts +34 -0
  38. package/dist/cjs/src/client/meters.cjs +160 -0
  39. package/dist/cjs/src/client/meters.cjs.map +1 -0
  40. package/dist/cjs/src/client/meters.d.cts +220 -0
  41. package/dist/cjs/src/client/notifications.cjs +269 -0
  42. package/dist/cjs/src/client/notifications.cjs.map +1 -0
  43. package/dist/cjs/src/client/notifications.d.cts +412 -0
  44. package/dist/cjs/src/client/plans.cjs +204 -0
  45. package/dist/cjs/src/client/plans.cjs.map +1 -0
  46. package/dist/cjs/src/client/plans.d.cts +252 -0
  47. package/dist/cjs/src/client/portal.cjs +55 -0
  48. package/dist/cjs/src/client/portal.cjs.map +1 -0
  49. package/dist/cjs/src/client/portal.d.cts +48 -0
  50. package/dist/cjs/src/client/schemas.cjs +3 -0
  51. package/dist/cjs/src/client/schemas.cjs.map +1 -0
  52. package/dist/cjs/src/client/schemas.d.cts +28002 -0
  53. package/dist/cjs/src/client/subjects.cjs +76 -0
  54. package/dist/cjs/src/client/subjects.cjs.map +1 -0
  55. package/dist/cjs/src/client/subjects.d.cts +79 -0
  56. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  57. package/dist/cjs/src/client/subscription-addons.cjs.map +1 -0
  58. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  59. package/dist/cjs/src/client/subscriptions.cjs +132 -0
  60. package/dist/cjs/src/client/subscriptions.cjs.map +1 -0
  61. package/dist/cjs/src/client/subscriptions.d.cts +180 -0
  62. package/dist/cjs/src/client/utils.cjs +67 -0
  63. package/dist/cjs/src/client/utils.cjs.map +1 -0
  64. package/dist/cjs/src/client/utils.d.cts +12 -0
  65. package/dist/cjs/src/portal/index.cjs +89 -0
  66. package/dist/cjs/src/portal/index.cjs.map +1 -0
  67. package/dist/cjs/src/portal/index.d.cts +43 -0
  68. package/dist/cjs/src/react/context.cjs +35 -0
  69. package/dist/cjs/src/react/context.cjs.map +1 -0
  70. package/dist/cjs/src/react/context.d.cts +9 -0
  71. package/dist/cjs/src/zod/index.cjs +13679 -0
  72. package/dist/cjs/src/zod/index.cjs.map +1 -0
  73. package/dist/cjs/src/zod/index.d.cts +6360 -0
  74. package/dist/index.d.ts +1 -14
  75. package/dist/index.js +2 -15
  76. package/dist/index.js.map +1 -0
  77. package/dist/src/client/addons.d.ts +152 -0
  78. package/dist/src/client/addons.js +101 -0
  79. package/dist/src/client/addons.js.map +1 -0
  80. package/dist/src/client/apps.d.ts +327 -0
  81. package/dist/src/client/apps.js +240 -0
  82. package/dist/src/client/apps.js.map +1 -0
  83. package/dist/src/client/billing.d.ts +563 -0
  84. package/dist/src/client/billing.js +368 -0
  85. package/dist/src/client/billing.js.map +1 -0
  86. package/dist/src/client/common.d.ts +30 -0
  87. package/dist/src/client/common.js +42 -0
  88. package/dist/src/client/common.js.map +1 -0
  89. package/dist/src/client/customers.d.ts +620 -0
  90. package/dist/src/client/customers.js +461 -0
  91. package/dist/src/client/customers.js.map +1 -0
  92. package/dist/src/client/debug.d.ts +17 -0
  93. package/dist/src/client/debug.js +23 -0
  94. package/dist/src/client/debug.js.map +1 -0
  95. package/dist/src/client/entitlements.d.ts +670 -0
  96. package/dist/src/client/entitlements.js +365 -0
  97. package/dist/src/client/entitlements.js.map +1 -0
  98. package/dist/src/client/events.d.ts +48 -0
  99. package/dist/src/client/events.js +108 -0
  100. package/dist/src/client/events.js.map +1 -0
  101. package/dist/src/client/features.d.ts +90 -0
  102. package/dist/src/client/features.js +74 -0
  103. package/dist/src/client/features.js.map +1 -0
  104. package/dist/src/client/index.d.ts +54 -0
  105. package/dist/src/client/index.js +82 -0
  106. package/dist/src/client/index.js.map +1 -0
  107. package/dist/src/client/info.d.ts +34 -0
  108. package/dist/src/client/info.js +38 -0
  109. package/dist/src/client/info.js.map +1 -0
  110. package/dist/src/client/meters.d.ts +220 -0
  111. package/dist/src/client/meters.js +156 -0
  112. package/dist/src/client/meters.js.map +1 -0
  113. package/dist/src/client/notifications.d.ts +412 -0
  114. package/dist/src/client/notifications.js +262 -0
  115. package/dist/src/client/notifications.js.map +1 -0
  116. package/dist/src/client/plans.d.ts +252 -0
  117. package/dist/src/client/plans.js +199 -0
  118. package/dist/src/client/plans.js.map +1 -0
  119. package/dist/src/client/portal.d.ts +48 -0
  120. package/dist/src/client/portal.js +51 -0
  121. package/dist/src/client/portal.js.map +1 -0
  122. package/dist/src/client/schemas.d.ts +28002 -0
  123. package/dist/src/client/schemas.js +2 -0
  124. package/dist/src/client/schemas.js.map +1 -0
  125. package/dist/src/client/subjects.d.ts +79 -0
  126. package/dist/src/client/subjects.js +72 -0
  127. package/dist/src/client/subjects.js.map +1 -0
  128. package/dist/src/client/subscription-addons.d.ts +123 -0
  129. package/dist/src/client/subscription-addons.js +66 -0
  130. package/dist/src/client/subscription-addons.js.map +1 -0
  131. package/dist/src/client/subscriptions.d.ts +180 -0
  132. package/dist/src/client/subscriptions.js +128 -0
  133. package/dist/src/client/subscriptions.js.map +1 -0
  134. package/dist/src/client/utils.d.ts +12 -0
  135. package/dist/src/client/utils.js +61 -0
  136. package/dist/src/client/utils.js.map +1 -0
  137. package/dist/src/portal/index.d.ts +43 -0
  138. package/dist/src/portal/index.js +52 -0
  139. package/dist/src/portal/index.js.map +1 -0
  140. package/dist/src/react/context.d.ts +9 -0
  141. package/dist/src/react/context.js +16 -0
  142. package/dist/src/react/context.js.map +1 -0
  143. package/dist/src/zod/index.d.ts +6360 -0
  144. package/dist/src/zod/index.js +13615 -0
  145. package/dist/src/zod/index.js.map +1 -0
  146. package/dist/tsconfig.tsbuildinfo +1 -1
  147. package/package.json +82 -40
  148. package/dist/clients/client.d.ts +0 -40
  149. package/dist/clients/client.js +0 -104
  150. package/dist/clients/event.d.ts +0 -79
  151. package/dist/clients/event.js +0 -53
  152. package/dist/clients/meter.d.ts +0 -71
  153. package/dist/clients/meter.js +0 -64
  154. package/dist/clients/portal.d.ts +0 -23
  155. package/dist/clients/portal.js +0 -37
  156. package/dist/next.d.ts +0 -15
  157. package/dist/next.js +0 -46
  158. package/dist/schemas/openapi.d.ts +0 -460
  159. package/dist/schemas/openapi.js +0 -5
  160. package/dist/test/agent.d.ts +0 -2
  161. package/dist/test/agent.js +0 -178
  162. package/dist/test/mocks.d.ts +0 -12
  163. package/dist/test/mocks.js +0 -32
  164. package/index.ts +0 -22
  165. package/next.ts +0 -76
package/dist/index.d.ts CHANGED
@@ -1,14 +1 @@
1
- import { OpenMeterConfig } from './clients/client.js';
2
- import { EventsClient } from './clients/event.js';
3
- import { MetersClient } from './clients/meter.js';
4
- import { PortalClient } from './clients/portal.js';
5
- export { OpenMeterConfig, RequestOptions } from './clients/client.js';
6
- export { Event } from './clients/event.js';
7
- export { Meter, MeterAggregation, WindowSize } from './clients/meter.js';
8
- export { createOpenAIStreamCallback } from './next.js';
9
- export declare class OpenMeter {
10
- events: EventsClient;
11
- meters: MetersClient;
12
- portal: PortalClient;
13
- constructor(config: OpenMeterConfig);
14
- }
1
+ export * from './src/client/index.js';
package/dist/index.js CHANGED
@@ -1,15 +1,2 @@
1
- import { EventsClient } from './clients/event.js';
2
- import { MetersClient } from './clients/meter.js';
3
- import { PortalClient } from './clients/portal.js';
4
- export { MeterAggregation, WindowSize } from './clients/meter.js';
5
- export { createOpenAIStreamCallback } from './next.js';
6
- export class OpenMeter {
7
- events;
8
- meters;
9
- portal;
10
- constructor(config) {
11
- this.events = new EventsClient(config);
12
- this.meters = new MetersClient(config);
13
- this.portal = new PortalClient(config);
14
- }
15
- }
1
+ export * from './src/client/index.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,152 @@
1
+ import type { Client } from 'openapi-fetch';
2
+ import type { RequestOptions } from './common.js';
3
+ import type { AddonCreate, operations, paths } from './schemas.js';
4
+ export declare class Addons {
5
+ private client;
6
+ constructor(client: Client<paths, `${string}/${string}`>);
7
+ /**
8
+ * Create a addon
9
+ * @param addon - The addon to create
10
+ * @param options - Optional request options
11
+ * @returns The created addon
12
+ */
13
+ create(addon: AddonCreate, options?: RequestOptions): Promise<{
14
+ readonly id: string;
15
+ name: string;
16
+ description?: string;
17
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
18
+ readonly createdAt: Date;
19
+ readonly updatedAt: Date;
20
+ readonly deletedAt?: Date;
21
+ key: string;
22
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
23
+ readonly version: number;
24
+ instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
25
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
26
+ readonly effectiveFrom?: Date;
27
+ readonly effectiveTo?: Date;
28
+ readonly status: import("./schemas.js").components["schemas"]["AddonStatus"];
29
+ rateCards: import("./schemas.js").components["schemas"]["RateCard"][];
30
+ readonly validationErrors: import("./schemas.js").components["schemas"]["ValidationError"][] | null;
31
+ } | undefined>;
32
+ /**
33
+ * List addons
34
+ * @param params - Optional parameters for listing addons
35
+ * @param options - Optional request options
36
+ * @returns A list of addons
37
+ */
38
+ list(params?: operations['listAddons']['parameters']['query'], options?: RequestOptions): Promise<{
39
+ totalCount: number;
40
+ page: number;
41
+ pageSize: number;
42
+ items: import("./schemas.js").components["schemas"]["Addon"][];
43
+ } | undefined>;
44
+ /**
45
+ * Get an addon by ID
46
+ * @param addonId - The ID of the addon to retrieve
47
+ * @param options - Optional request options
48
+ * @returns The addon
49
+ */
50
+ get(addonId: string, options?: RequestOptions): Promise<{
51
+ readonly id: string;
52
+ name: string;
53
+ description?: string;
54
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
55
+ readonly createdAt: Date;
56
+ readonly updatedAt: Date;
57
+ readonly deletedAt?: Date;
58
+ key: string;
59
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
60
+ readonly version: number;
61
+ instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
62
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
63
+ readonly effectiveFrom?: Date;
64
+ readonly effectiveTo?: Date;
65
+ readonly status: import("./schemas.js").components["schemas"]["AddonStatus"];
66
+ rateCards: import("./schemas.js").components["schemas"]["RateCard"][];
67
+ readonly validationErrors: import("./schemas.js").components["schemas"]["ValidationError"][] | null;
68
+ } | undefined>;
69
+ /**
70
+ * Update an addon
71
+ * @param addonId - The ID of the addon to update
72
+ * @param addon - The addon data to update
73
+ * @param options - Optional request options
74
+ * @returns The updated addon
75
+ */
76
+ update(addonId: string, addon: operations['updateAddon']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
77
+ readonly id: string;
78
+ name: string;
79
+ description?: string;
80
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
81
+ readonly createdAt: Date;
82
+ readonly updatedAt: Date;
83
+ readonly deletedAt?: Date;
84
+ key: string;
85
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
86
+ readonly version: number;
87
+ instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
88
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
89
+ readonly effectiveFrom?: Date;
90
+ readonly effectiveTo?: Date;
91
+ readonly status: import("./schemas.js").components["schemas"]["AddonStatus"];
92
+ rateCards: import("./schemas.js").components["schemas"]["RateCard"][];
93
+ readonly validationErrors: import("./schemas.js").components["schemas"]["ValidationError"][] | null;
94
+ } | undefined>;
95
+ /**
96
+ * Delete an addon by ID
97
+ * @param addonId - The ID of the addon to delete
98
+ * @param options - Optional request options
99
+ * @returns void or standard error response structure
100
+ */
101
+ delete(addonId: string, options?: RequestOptions): Promise<undefined>;
102
+ /**
103
+ * Publish an addon
104
+ * @param addonId - The ID of the addon to publish
105
+ * @param options - Optional request options
106
+ * @returns The published addon
107
+ */
108
+ publish(addonId: string, options?: RequestOptions): Promise<{
109
+ readonly id: string;
110
+ name: string;
111
+ description?: string;
112
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
113
+ readonly createdAt: Date;
114
+ readonly updatedAt: Date;
115
+ readonly deletedAt?: Date;
116
+ key: string;
117
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
118
+ readonly version: number;
119
+ instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
120
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
121
+ readonly effectiveFrom?: Date;
122
+ readonly effectiveTo?: Date;
123
+ readonly status: import("./schemas.js").components["schemas"]["AddonStatus"];
124
+ rateCards: import("./schemas.js").components["schemas"]["RateCard"][];
125
+ readonly validationErrors: import("./schemas.js").components["schemas"]["ValidationError"][] | null;
126
+ } | undefined>;
127
+ /**
128
+ * Archive an addon
129
+ * @param addonId - The ID of the addon to archive
130
+ * @param options - Optional request options
131
+ * @returns The archived addon
132
+ */
133
+ archive(addonId: string, options?: RequestOptions): Promise<{
134
+ readonly id: string;
135
+ name: string;
136
+ description?: string;
137
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
138
+ readonly createdAt: Date;
139
+ readonly updatedAt: Date;
140
+ readonly deletedAt?: Date;
141
+ key: string;
142
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
143
+ readonly version: number;
144
+ instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
145
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
146
+ readonly effectiveFrom?: Date;
147
+ readonly effectiveTo?: Date;
148
+ readonly status: import("./schemas.js").components["schemas"]["AddonStatus"];
149
+ rateCards: import("./schemas.js").components["schemas"]["RateCard"][];
150
+ readonly validationErrors: import("./schemas.js").components["schemas"]["ValidationError"][] | null;
151
+ } | undefined>;
152
+ }
@@ -0,0 +1,101 @@
1
+ import { transformResponse } from './utils.js';
2
+ export class Addons {
3
+ client;
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ /**
8
+ * Create a addon
9
+ * @param addon - The addon to create
10
+ * @param options - Optional request options
11
+ * @returns The created addon
12
+ */
13
+ async create(addon, options) {
14
+ const resp = await this.client.POST('/api/v1/addons', {
15
+ body: addon,
16
+ ...options,
17
+ });
18
+ return transformResponse(resp);
19
+ }
20
+ /**
21
+ * List addons
22
+ * @param params - Optional parameters for listing addons
23
+ * @param options - Optional request options
24
+ * @returns A list of addons
25
+ */
26
+ async list(params, options) {
27
+ const resp = await this.client.GET('/api/v1/addons', {
28
+ params: { query: params },
29
+ ...options,
30
+ });
31
+ return transformResponse(resp);
32
+ }
33
+ /**
34
+ * Get an addon by ID
35
+ * @param addonId - The ID of the addon to retrieve
36
+ * @param options - Optional request options
37
+ * @returns The addon
38
+ */
39
+ async get(addonId, options) {
40
+ const resp = await this.client.GET('/api/v1/addons/{addonId}', {
41
+ params: { path: { addonId } },
42
+ ...options,
43
+ });
44
+ return transformResponse(resp);
45
+ }
46
+ /**
47
+ * Update an addon
48
+ * @param addonId - The ID of the addon to update
49
+ * @param addon - The addon data to update
50
+ * @param options - Optional request options
51
+ * @returns The updated addon
52
+ */
53
+ async update(addonId, addon, options) {
54
+ const resp = await this.client.PUT('/api/v1/addons/{addonId}', {
55
+ body: addon,
56
+ params: { path: { addonId } },
57
+ ...options,
58
+ });
59
+ return transformResponse(resp);
60
+ }
61
+ /**
62
+ * Delete an addon by ID
63
+ * @param addonId - The ID of the addon to delete
64
+ * @param options - Optional request options
65
+ * @returns void or standard error response structure
66
+ */
67
+ async delete(addonId, options) {
68
+ const resp = await this.client.DELETE('/api/v1/addons/{addonId}', {
69
+ params: { path: { addonId } },
70
+ ...options,
71
+ });
72
+ return transformResponse(resp);
73
+ }
74
+ /**
75
+ * Publish an addon
76
+ * @param addonId - The ID of the addon to publish
77
+ * @param options - Optional request options
78
+ * @returns The published addon
79
+ */
80
+ async publish(addonId, options) {
81
+ const resp = await this.client.POST('/api/v1/addons/{addonId}/publish', {
82
+ params: { path: { addonId } },
83
+ ...options,
84
+ });
85
+ return transformResponse(resp);
86
+ }
87
+ /**
88
+ * Archive an addon
89
+ * @param addonId - The ID of the addon to archive
90
+ * @param options - Optional request options
91
+ * @returns The archived addon
92
+ */
93
+ async archive(addonId, options) {
94
+ const resp = await this.client.POST('/api/v1/addons/{addonId}/archive', {
95
+ params: { path: { addonId } },
96
+ ...options,
97
+ });
98
+ return transformResponse(resp);
99
+ }
100
+ }
101
+ //# sourceMappingURL=addons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addons.js","sourceRoot":"","sources":["../../../src/client/addons.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,OAAO,MAAM;IACG;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,KAAkB,EAAE,OAAwB;QAC9D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACpD,IAAI,EAAE,KAAK;YACX,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CACf,MAAwD,EACxD,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE;YACnD,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CAAC,OAAe,EAAE,OAAwB;QACxD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,EAAE;YAC7D,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE;YAC7B,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CACjB,OAAe,EACf,KAA8E,EAC9E,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,EAAE;YAC7D,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE;YAC7B,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,OAAwB;QAC3D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,0BAA0B,EAAE;YAChE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE;YAC7B,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,OAAwB;QAC5D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;YACtE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE;YAC7B,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,OAAwB;QAC5D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;YACtE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE;YAC7B,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF"}
@@ -0,0 +1,327 @@
1
+ import type { Client } from 'openapi-fetch';
2
+ import type { RequestOptions } from './common.js';
3
+ import type { AppReplaceUpdate, CreateStripeCheckoutSessionRequest, operations, paths } from './schemas.js';
4
+ /**
5
+ * Apps
6
+ * Manage integrations for extending OpenMeter's functionality.
7
+ */
8
+ export declare class Apps {
9
+ private client;
10
+ marketplace: AppMarketplace;
11
+ stripe: AppStripe;
12
+ customInvoicing: AppCustomInvoicing;
13
+ constructor(client: Client<paths, `${string}/${string}`>);
14
+ /**
15
+ * List apps
16
+ * @param query - The query parameters
17
+ * @param signal - An optional abort signal
18
+ * @returns The apps
19
+ */
20
+ list(query?: operations['listApps']['parameters']['query'], options?: RequestOptions): Promise<{
21
+ totalCount: number;
22
+ page: number;
23
+ pageSize: number;
24
+ items: import("./schemas.js").components["schemas"]["App"][];
25
+ } | undefined>;
26
+ /**
27
+ * Get an app
28
+ * @param id - The ID of the app
29
+ * @param signal - An optional abort signal
30
+ * @returns The app
31
+ */
32
+ get(id: operations['getApp']['parameters']['path']['id'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
33
+ 200: {
34
+ headers: {
35
+ [name: string]: unknown;
36
+ };
37
+ content: {
38
+ "application/json": import("./schemas.js").components["schemas"]["App"];
39
+ };
40
+ };
41
+ 400: {
42
+ headers: {
43
+ [name: string]: unknown;
44
+ };
45
+ content: {
46
+ "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
47
+ };
48
+ };
49
+ 401: {
50
+ headers: {
51
+ [name: string]: unknown;
52
+ };
53
+ content: {
54
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
55
+ };
56
+ };
57
+ 403: {
58
+ headers: {
59
+ [name: string]: unknown;
60
+ };
61
+ content: {
62
+ "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
63
+ };
64
+ };
65
+ 404: {
66
+ headers: {
67
+ [name: string]: unknown;
68
+ };
69
+ content: {
70
+ "application/problem+json": import("./schemas.js").components["schemas"]["NotFoundProblemResponse"];
71
+ };
72
+ };
73
+ 412: {
74
+ headers: {
75
+ [name: string]: unknown;
76
+ };
77
+ content: {
78
+ "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
79
+ };
80
+ };
81
+ 500: {
82
+ headers: {
83
+ [name: string]: unknown;
84
+ };
85
+ content: {
86
+ "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
87
+ };
88
+ };
89
+ 503: {
90
+ headers: {
91
+ [name: string]: unknown;
92
+ };
93
+ content: {
94
+ "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
95
+ };
96
+ };
97
+ default: {
98
+ headers: {
99
+ [name: string]: unknown;
100
+ };
101
+ content: {
102
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
103
+ };
104
+ };
105
+ }, `${string}/${string}`> | undefined>;
106
+ /**
107
+ * Update an app
108
+ * @param id - The ID of the app
109
+ * @param body - The body of the request
110
+ * @param signal - An optional abort signal
111
+ * @returns The app
112
+ */
113
+ update(id: operations['updateApp']['parameters']['path']['id'], body: AppReplaceUpdate, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
114
+ 200: {
115
+ headers: {
116
+ [name: string]: unknown;
117
+ };
118
+ content: {
119
+ "application/json": import("./schemas.js").components["schemas"]["App"];
120
+ };
121
+ };
122
+ 400: {
123
+ headers: {
124
+ [name: string]: unknown;
125
+ };
126
+ content: {
127
+ "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
128
+ };
129
+ };
130
+ 401: {
131
+ headers: {
132
+ [name: string]: unknown;
133
+ };
134
+ content: {
135
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
136
+ };
137
+ };
138
+ 403: {
139
+ headers: {
140
+ [name: string]: unknown;
141
+ };
142
+ content: {
143
+ "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
144
+ };
145
+ };
146
+ 404: {
147
+ headers: {
148
+ [name: string]: unknown;
149
+ };
150
+ content: {
151
+ "application/problem+json": import("./schemas.js").components["schemas"]["NotFoundProblemResponse"];
152
+ };
153
+ };
154
+ 412: {
155
+ headers: {
156
+ [name: string]: unknown;
157
+ };
158
+ content: {
159
+ "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
160
+ };
161
+ };
162
+ 500: {
163
+ headers: {
164
+ [name: string]: unknown;
165
+ };
166
+ content: {
167
+ "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
168
+ };
169
+ };
170
+ 503: {
171
+ headers: {
172
+ [name: string]: unknown;
173
+ };
174
+ content: {
175
+ "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
176
+ };
177
+ };
178
+ default: {
179
+ headers: {
180
+ [name: string]: unknown;
181
+ };
182
+ content: {
183
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
184
+ };
185
+ };
186
+ }, `${string}/${string}`> | undefined>;
187
+ /**
188
+ * Uninstall an app
189
+ * @param id - The ID of the app
190
+ * @param signal - An optional abort signal
191
+ * @returns The app
192
+ */
193
+ uninstall(id: operations['uninstallApp']['parameters']['path']['id'], options?: RequestOptions): Promise<undefined>;
194
+ }
195
+ /**
196
+ * App Marketplace
197
+ * Available apps from the OpenMeter Marketplace.
198
+ */
199
+ export declare class AppMarketplace {
200
+ private client;
201
+ constructor(client: Client<paths, `${string}/${string}`>);
202
+ /**
203
+ * List available apps
204
+ * @param query - The query parameters
205
+ * @param signal - An optional abort signal
206
+ * @returns The apps
207
+ */
208
+ list(query?: operations['listMarketplaceListings']['parameters']['query'], options?: RequestOptions): Promise<{
209
+ totalCount: number;
210
+ page: number;
211
+ pageSize: number;
212
+ items: import("./schemas.js").components["schemas"]["MarketplaceListing"][];
213
+ } | undefined>;
214
+ /**
215
+ * Get details for a listing
216
+ * @param type - The type of the listing
217
+ * @param signal - An optional abort signal
218
+ * @returns The listing
219
+ */
220
+ get(type: operations['getMarketplaceListing']['parameters']['path']['type'], options?: RequestOptions): Promise<{
221
+ type: import("./schemas.js").components["schemas"]["AppType"];
222
+ name: string;
223
+ description: string;
224
+ capabilities: import("./schemas.js").components["schemas"]["AppCapability"][];
225
+ installMethods: import("./schemas.js").components["schemas"]["InstallMethod"][];
226
+ } | undefined>;
227
+ /**
228
+ * Install an app via OAuth. Returns a URL to start the OAuth 2.0 flow.
229
+ * @param type - The type of the listing
230
+ * @param signal - An optional abort signal
231
+ * @returns The OAuth2 install URL
232
+ */
233
+ getOauth2InstallUrl(type: operations['marketplaceOAuth2InstallGetURL']['parameters']['path']['type'], options?: RequestOptions): Promise<{
234
+ url: string;
235
+ } | undefined>;
236
+ /**
237
+ * Authorize OAuth2 code. Verifies the OAuth code and exchanges it for a token and refresh token
238
+ * @param type - The type of the listing
239
+ * @param signal - An optional abort signal
240
+ * @returns The authorization URL
241
+ */
242
+ authorizeOauth2(type: operations['marketplaceOAuth2InstallAuthorize']['parameters']['path']['type'], options?: RequestOptions): Promise<undefined>;
243
+ /**
244
+ * Install an app via API key.
245
+ * @param type - The type of the listing
246
+ * @param signal - An optional abort signal
247
+ * @returns The installation
248
+ */
249
+ installWithAPIKey(type: operations['marketplaceAppAPIKeyInstall']['parameters']['path']['type'], body: operations['marketplaceAppAPIKeyInstall']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
250
+ app: import("./schemas.js").components["schemas"]["App"];
251
+ defaultForCapabilityTypes: import("./schemas.js").components["schemas"]["AppCapabilityType"][];
252
+ } | undefined>;
253
+ }
254
+ /**
255
+ * Stripe App
256
+ */
257
+ export declare class AppStripe {
258
+ private client;
259
+ constructor(client: Client<paths, `${string}/${string}`>);
260
+ /**
261
+ * Create a checkout session
262
+ * @param body - The body of the request
263
+ * @param signal - An optional abort signal
264
+ * @returns The checkout session
265
+ */
266
+ createCheckoutSession(body: CreateStripeCheckoutSessionRequest, options?: RequestOptions): Promise<{
267
+ customerId: string;
268
+ stripeCustomerId: string;
269
+ sessionId: string;
270
+ setupIntentId: string;
271
+ clientSecret?: string;
272
+ clientReferenceId?: string;
273
+ customerEmail?: string;
274
+ currency?: import("./schemas.js").components["schemas"]["CurrencyCode"];
275
+ createdAt: Date;
276
+ expiresAt?: Date;
277
+ metadata?: {
278
+ [key: string]: string;
279
+ };
280
+ status?: string;
281
+ url?: string;
282
+ mode: import("./schemas.js").components["schemas"]["StripeCheckoutSessionMode"];
283
+ cancelURL?: string;
284
+ successURL?: string;
285
+ returnURL?: string;
286
+ } | undefined>;
287
+ /**
288
+ * Update Stripe API key
289
+ * @param id - The ID of the app
290
+ * @param body - The API key data
291
+ * @param options - The request options
292
+ * @returns The updated API key
293
+ * @deprecated
294
+ */
295
+ updateApiKey(id: string, body: operations['updateStripeAPIKey']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<undefined>;
296
+ }
297
+ /**
298
+ * Custom Invoicing App
299
+ */
300
+ export declare class AppCustomInvoicing {
301
+ private client;
302
+ constructor(client: Client<paths, `${string}/${string}`>);
303
+ /**
304
+ * Submit draft synchronization results
305
+ * @param invoiceId - The ID of the invoice
306
+ * @param body - The body of the request
307
+ * @param options - The request options
308
+ * @returns The synchronization result
309
+ */
310
+ draftSynchronized(invoiceId: string, body: operations['appCustomInvoicingDraftSynchronized']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<undefined>;
311
+ /**
312
+ * Submit issuing synchronization results
313
+ * @param invoiceId - The ID of the invoice
314
+ * @param body - The body of the request
315
+ * @param options - The request options
316
+ * @returns The synchronization result
317
+ */
318
+ issuingSynchronized(invoiceId: string, body: operations['appCustomInvoicingIssuingSynchronized']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<undefined>;
319
+ /**
320
+ * Update payment status
321
+ * @param invoiceId - The ID of the invoice
322
+ * @param body - The body of the request
323
+ * @param options - The request options
324
+ * @returns The payment status update result
325
+ */
326
+ updatePaymentStatus(invoiceId: string, body: operations['appCustomInvoicingUpdatePaymentStatus']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<undefined>;
327
+ }