@xylex-group/athena 2.13.0 → 3.0.0

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 (79) hide show
  1. package/README.md +91 -1398
  2. package/bin/athena-js.js +0 -0
  3. package/dist/admin.d.cts +1 -1
  4. package/dist/admin.d.ts +1 -1
  5. package/dist/billing.cjs +1199 -0
  6. package/dist/billing.cjs.map +1 -0
  7. package/dist/billing.d.cts +230 -0
  8. package/dist/billing.d.ts +230 -0
  9. package/dist/billing.js +1194 -0
  10. package/dist/billing.js.map +1 -0
  11. package/dist/browser.cjs +8934 -8075
  12. package/dist/browser.cjs.map +1 -1
  13. package/dist/browser.d.cts +11 -10
  14. package/dist/browser.d.ts +11 -10
  15. package/dist/browser.js +8931 -8073
  16. package/dist/browser.js.map +1 -1
  17. package/dist/cli/index.cjs +8328 -7062
  18. package/dist/cli/index.cjs.map +1 -1
  19. package/dist/cli/index.d.cts +4 -4
  20. package/dist/cli/index.d.ts +4 -4
  21. package/dist/cli/index.js +8328 -7062
  22. package/dist/cli/index.js.map +1 -1
  23. package/dist/index.cjs +9391 -8526
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +11 -10
  26. package/dist/index.d.ts +11 -10
  27. package/dist/index.js +9384 -8524
  28. package/dist/index.js.map +1 -1
  29. package/dist/{model-form-Dw4zEL5a.d.cts → model-form-BEfCGB5b.d.cts} +2 -2
  30. package/dist/{model-form-yRg71q3H.d.ts → model-form-BKetpu6Q.d.ts} +2 -2
  31. package/dist/module-8dSMcy0K.d.cts +326 -0
  32. package/dist/module-8dSMcy0K.d.ts +326 -0
  33. package/dist/{module-DBteUIob.d.ts → module-Bef_MAPO.d.ts} +6 -52
  34. package/dist/{module-yoX49uQC.d.cts → module-CrrSmpML.d.cts} +6 -52
  35. package/dist/next/client.cjs +2 -8668
  36. package/dist/next/client.cjs.map +1 -1
  37. package/dist/next/client.d.cts +1 -27
  38. package/dist/next/client.d.ts +1 -27
  39. package/dist/next/client.js +3 -8668
  40. package/dist/next/client.js.map +1 -1
  41. package/dist/next/server.cjs +79 -8779
  42. package/dist/next/server.cjs.map +1 -1
  43. package/dist/next/server.d.cts +30 -46
  44. package/dist/next/server.d.ts +30 -46
  45. package/dist/next/server.js +79 -8779
  46. package/dist/next/server.js.map +1 -1
  47. package/dist/{payload-DEOWN_oo.d.ts → payload-DWI1rw-e.d.cts} +1 -35
  48. package/dist/{payload-BzVbUgY_.d.cts → payload-DWI1rw-e.d.ts} +1 -35
  49. package/dist/{pipeline-Bj6RWt1A.d.ts → pipeline-BXFQbsUW.d.ts} +1 -1
  50. package/dist/{pipeline-Dwck-wZO.d.cts → pipeline-Dfsed4VD.d.cts} +1 -1
  51. package/dist/react.cjs +114 -13
  52. package/dist/react.cjs.map +1 -1
  53. package/dist/react.d.cts +46 -16
  54. package/dist/react.d.ts +46 -16
  55. package/dist/react.js +113 -14
  56. package/dist/react.js.map +1 -1
  57. package/dist/social-providers.cjs +33 -24
  58. package/dist/social-providers.cjs.map +1 -1
  59. package/dist/social-providers.d.cts +79 -82
  60. package/dist/social-providers.d.ts +79 -82
  61. package/dist/social-providers.js +33 -24
  62. package/dist/social-providers.js.map +1 -1
  63. package/dist/{types-eAKAh71s.d.cts → types-AOY-GLu8.d.cts} +27 -54
  64. package/dist/{types-eAKAh71s.d.ts → types-AOY-GLu8.d.ts} +27 -54
  65. package/dist/{types-CH78O90i.d.cts → types-Bltx6iL6.d.cts} +4 -6
  66. package/dist/{types-CH78O90i.d.ts → types-Bltx6iL6.d.ts} +4 -6
  67. package/dist/{types-DPgejxYC.d.ts → types-CK7cBQbC.d.ts} +2 -2
  68. package/dist/{types-CjC9_5ZQ.d.cts → types-Z3-rsiM3.d.cts} +2 -2
  69. package/dist/{types-BRP7sfSF.d.ts → types-jClgDy1J.d.ts} +2 -2
  70. package/dist/{types-BU8uJH_b.d.cts → types-kO_Ut5wU.d.cts} +2 -2
  71. package/dist/utils.cjs +7 -8
  72. package/dist/utils.cjs.map +1 -1
  73. package/dist/utils.d.cts +2 -5
  74. package/dist/utils.d.ts +2 -5
  75. package/dist/utils.js +7 -8
  76. package/dist/utils.js.map +1 -1
  77. package/dist/{client-DVOKSYDI.d.ts → v3-client-CuCNy-JJ.d.ts} +532 -470
  78. package/dist/{client-BJjUwDSg.d.cts → v3-client-G8JMOilK.d.cts} +532 -470
  79. package/package.json +31 -21
@@ -1,5 +1,5 @@
1
- import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-CH78O90i.cjs';
2
- import { r as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-BU8uJH_b.cjs';
1
+ import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-Bltx6iL6.cjs';
2
+ import { r as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-kO_Ut5wU.cjs';
3
3
 
4
4
  interface AthenaGatewayErrorInput {
5
5
  code: AthenaGatewayErrorCode;
@@ -1,5 +1,5 @@
1
- import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-CH78O90i.js';
2
- import { r as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-BRP7sfSF.js';
1
+ import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-Bltx6iL6.js';
2
+ import { r as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-jClgDy1J.js';
3
3
 
4
4
  interface AthenaGatewayErrorInput {
5
5
  code: AthenaGatewayErrorCode;
@@ -0,0 +1,326 @@
1
+ /**
2
+ * Athena billing HTTP client for live `/billing/v1/*`, `/admin/billing/*`,
3
+ * provider webhook, and `/debug/billing` routes.
4
+ *
5
+ * Methods map 1:1 onto the registered Actix handlers. Auth uses the static
6
+ * Athena admin key (`X-Athena-Key` / configured API key) matching the server
7
+ * `authorize_static_admin_key` gate.
8
+ *
9
+ * Contract spine: `billingSdkManifest` METHOD+path entries must match the
10
+ * permanent Rust inventory `athena_billing::LIVE_HTTP_ROUTES`
11
+ * (exported as `./live-http-routes.json`). Export with
12
+ * `cargo run -p athena-billing --bin billing-contract-spine -- --write`.
13
+ */
14
+ type AthenaBillingHttpMethod = 'GET' | 'POST' | 'PATCH' | 'DELETE';
15
+ type AthenaBillingJson = null | boolean | number | string | AthenaBillingJson[] | {
16
+ [key: string]: AthenaBillingJson;
17
+ };
18
+ interface AthenaBillingCallOptions {
19
+ headers?: Record<string, string>;
20
+ signal?: AbortSignal;
21
+ apiKey?: string | null;
22
+ }
23
+ interface AthenaBillingClientConfig {
24
+ baseUrl: string;
25
+ apiKey: string;
26
+ client?: string | null;
27
+ headers?: Record<string, string>;
28
+ fetchImpl?: typeof fetch;
29
+ }
30
+ interface AthenaBillingEnvelope<T = unknown> {
31
+ status?: string;
32
+ message?: string;
33
+ data: T;
34
+ }
35
+ declare class AthenaBillingError extends Error {
36
+ status: number;
37
+ endpoint: string;
38
+ method: string;
39
+ body: unknown;
40
+ constructor(input: {
41
+ message: string;
42
+ status: number;
43
+ endpoint: string;
44
+ method: string;
45
+ body: unknown;
46
+ });
47
+ }
48
+ interface BillingConnectionRefInput {
49
+ connectionId: string;
50
+ clientName?: string;
51
+ }
52
+ interface BillingListQuery extends BillingConnectionRefInput {
53
+ cursor?: string;
54
+ source?: 'provider' | 'persistence' | string;
55
+ limit?: number;
56
+ offset?: number;
57
+ }
58
+ interface BillingEnsureCustomerInput extends BillingConnectionRefInput {
59
+ email?: string | null;
60
+ name?: string | null;
61
+ metadata?: Record<string, AthenaBillingJson>;
62
+ idempotencyKey: string;
63
+ }
64
+ interface BillingUpdateCustomerInput extends BillingConnectionRefInput {
65
+ email?: string | null;
66
+ name?: string | null;
67
+ }
68
+ interface BillingCreateConnectionInput {
69
+ ownerKind: string;
70
+ ownerId: string;
71
+ provider: string;
72
+ mode?: string;
73
+ status?: string;
74
+ credentialKind?: string;
75
+ providerAccountId: string;
76
+ providerProfileId?: string | null;
77
+ scopes?: string[];
78
+ config?: Record<string, AthenaBillingJson>;
79
+ metadata?: Record<string, AthenaBillingJson>;
80
+ }
81
+ interface BillingUpdateConnectionInput {
82
+ status?: string;
83
+ mode?: string;
84
+ credentialKind?: string;
85
+ providerAccountId?: string;
86
+ providerProfileId?: string | null;
87
+ scopes?: string[];
88
+ config?: Record<string, AthenaBillingJson>;
89
+ metadata?: Record<string, AthenaBillingJson>;
90
+ }
91
+ interface BillingReconcileInput {
92
+ resourceKind: string;
93
+ resourceId: string;
94
+ customerId?: string | null;
95
+ }
96
+ interface BillingProvisionSinksInput {
97
+ targetSchema?: string;
98
+ instance?: string;
99
+ }
100
+ declare const billingSdkManifest: {
101
+ readonly namespace: "billing";
102
+ readonly envelopeKind: "athena";
103
+ readonly methods: readonly [{
104
+ readonly name: "getCapabilities";
105
+ readonly method: "GET";
106
+ readonly path: "/billing/v1/capabilities";
107
+ }, {
108
+ readonly name: "createCheckout";
109
+ readonly method: "POST";
110
+ readonly path: "/billing/v1/checkouts";
111
+ }, {
112
+ readonly name: "listCustomers";
113
+ readonly method: "GET";
114
+ readonly path: "/billing/v1/customers";
115
+ }, {
116
+ readonly name: "createCustomer";
117
+ readonly method: "POST";
118
+ readonly path: "/billing/v1/customers";
119
+ }, {
120
+ readonly name: "getCustomer";
121
+ readonly method: "GET";
122
+ readonly path: "/billing/v1/customers/{id}";
123
+ }, {
124
+ readonly name: "updateCustomer";
125
+ readonly method: "PATCH";
126
+ readonly path: "/billing/v1/customers/{id}";
127
+ }, {
128
+ readonly name: "deleteCustomer";
129
+ readonly method: "DELETE";
130
+ readonly path: "/billing/v1/customers/{id}";
131
+ }, {
132
+ readonly name: "listPayments";
133
+ readonly method: "GET";
134
+ readonly path: "/billing/v1/payments";
135
+ }, {
136
+ readonly name: "createPayment";
137
+ readonly method: "POST";
138
+ readonly path: "/billing/v1/payments";
139
+ }, {
140
+ readonly name: "getPayment";
141
+ readonly method: "GET";
142
+ readonly path: "/billing/v1/payments/{id}";
143
+ }, {
144
+ readonly name: "cancelPayment";
145
+ readonly method: "POST";
146
+ readonly path: "/billing/v1/payments/{id}/cancel";
147
+ }, {
148
+ readonly name: "listPaymentLinks";
149
+ readonly method: "GET";
150
+ readonly path: "/billing/v1/payment-links";
151
+ }, {
152
+ readonly name: "createPaymentLink";
153
+ readonly method: "POST";
154
+ readonly path: "/billing/v1/payment-links";
155
+ }, {
156
+ readonly name: "getPaymentLink";
157
+ readonly method: "GET";
158
+ readonly path: "/billing/v1/payment-links/{id}";
159
+ }, {
160
+ readonly name: "updatePaymentLink";
161
+ readonly method: "PATCH";
162
+ readonly path: "/billing/v1/payment-links/{id}";
163
+ }, {
164
+ readonly name: "deletePaymentLink";
165
+ readonly method: "DELETE";
166
+ readonly path: "/billing/v1/payment-links/{id}";
167
+ }, {
168
+ readonly name: "listRefunds";
169
+ readonly method: "GET";
170
+ readonly path: "/billing/v1/refunds";
171
+ }, {
172
+ readonly name: "createRefund";
173
+ readonly method: "POST";
174
+ readonly path: "/billing/v1/refunds";
175
+ }, {
176
+ readonly name: "getRefund";
177
+ readonly method: "GET";
178
+ readonly path: "/billing/v1/refunds/{id}";
179
+ }, {
180
+ readonly name: "cancelRefund";
181
+ readonly method: "POST";
182
+ readonly path: "/billing/v1/refunds/{id}/cancel";
183
+ }, {
184
+ readonly name: "listSubscriptions";
185
+ readonly method: "GET";
186
+ readonly path: "/billing/v1/subscriptions";
187
+ }, {
188
+ readonly name: "createSubscription";
189
+ readonly method: "POST";
190
+ readonly path: "/billing/v1/subscriptions";
191
+ }, {
192
+ readonly name: "getSubscription";
193
+ readonly method: "GET";
194
+ readonly path: "/billing/v1/subscriptions/{id}";
195
+ }, {
196
+ readonly name: "updateSubscription";
197
+ readonly method: "PATCH";
198
+ readonly path: "/billing/v1/subscriptions/{id}";
199
+ }, {
200
+ readonly name: "cancelSubscription";
201
+ readonly method: "POST";
202
+ readonly path: "/billing/v1/subscriptions/{id}/cancel";
203
+ }, {
204
+ readonly name: "listInvoices";
205
+ readonly method: "GET";
206
+ readonly path: "/billing/v1/invoices";
207
+ }, {
208
+ readonly name: "getInvoice";
209
+ readonly method: "GET";
210
+ readonly path: "/billing/v1/invoices/{id}";
211
+ }, {
212
+ readonly name: "listConnections";
213
+ readonly method: "GET";
214
+ readonly path: "/admin/billing/clients/{client_name}/connections";
215
+ }, {
216
+ readonly name: "createConnection";
217
+ readonly method: "POST";
218
+ readonly path: "/admin/billing/clients/{client_name}/connections";
219
+ }, {
220
+ readonly name: "getConnection";
221
+ readonly method: "GET";
222
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
223
+ }, {
224
+ readonly name: "updateConnection";
225
+ readonly method: "PATCH";
226
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
227
+ }, {
228
+ readonly name: "deleteConnection";
229
+ readonly method: "DELETE";
230
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
231
+ }, {
232
+ readonly name: "reconcileDocument";
233
+ readonly method: "POST";
234
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}/reconcile";
235
+ }, {
236
+ readonly name: "listWebhookEvents";
237
+ readonly method: "GET";
238
+ readonly path: "/admin/billing/clients/{client_name}/webhook-events";
239
+ }, {
240
+ readonly name: "provisionWebhookSinks";
241
+ readonly method: "POST";
242
+ readonly path: "/admin/billing/clients/{client_name}/webhook-sinks/provision";
243
+ }, {
244
+ readonly name: "listGrants";
245
+ readonly method: "GET";
246
+ readonly path: "/admin/billing/grants";
247
+ }, {
248
+ readonly name: "listProviders";
249
+ readonly method: "GET";
250
+ readonly path: "/admin/billing/providers";
251
+ }, {
252
+ readonly name: "listSinkHelpers";
253
+ readonly method: "GET";
254
+ readonly path: "/admin/webhook-sinks/helpers/billing";
255
+ }, {
256
+ readonly name: "ingestProviderWebhook";
257
+ readonly method: "POST";
258
+ readonly path: "/billing/providers/{provider}/clients/{client_name}/connections/{connection_id}/webhook";
259
+ }, {
260
+ readonly name: "getDebugBilling";
261
+ readonly method: "GET";
262
+ readonly path: "/debug/billing";
263
+ }];
264
+ };
265
+ interface AthenaBillingModule {
266
+ getCapabilities(input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
267
+ createCheckout(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
268
+ listCustomers(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
269
+ createCustomer(input: BillingEnsureCustomerInput, options?: AthenaBillingCallOptions): Promise<unknown>;
270
+ getCustomer(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
271
+ updateCustomer(id: string, input: BillingUpdateCustomerInput, options?: AthenaBillingCallOptions): Promise<unknown>;
272
+ deleteCustomer(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
273
+ listPayments(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
274
+ createPayment(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
275
+ getPayment(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
276
+ cancelPayment(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
277
+ listPaymentLinks(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
278
+ createPaymentLink(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
279
+ getPaymentLink(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
280
+ updatePaymentLink(id: string, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
281
+ deletePaymentLink(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
282
+ listRefunds(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
283
+ createRefund(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
284
+ getRefund(id: string, input: BillingConnectionRefInput & {
285
+ paymentId?: string;
286
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
287
+ cancelRefund(id: string, input: BillingConnectionRefInput & {
288
+ paymentId?: string;
289
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
290
+ listSubscriptions(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
291
+ createSubscription(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
292
+ getSubscription(id: string, input: BillingConnectionRefInput & {
293
+ customerId?: string;
294
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
295
+ updateSubscription(id: string, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
296
+ cancelSubscription(id: string, input: BillingConnectionRefInput & {
297
+ customerId: string;
298
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
299
+ listInvoices(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
300
+ getInvoice(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
301
+ listConnections(clientName: string, options?: AthenaBillingCallOptions): Promise<unknown>;
302
+ createConnection(clientName: string, input: BillingCreateConnectionInput, options?: AthenaBillingCallOptions): Promise<unknown>;
303
+ getConnection(clientName: string, connectionId: string, options?: AthenaBillingCallOptions): Promise<unknown>;
304
+ updateConnection(clientName: string, connectionId: string, input: BillingUpdateConnectionInput, options?: AthenaBillingCallOptions): Promise<unknown>;
305
+ deleteConnection(clientName: string, connectionId: string, options?: AthenaBillingCallOptions): Promise<unknown>;
306
+ reconcileDocument(clientName: string, connectionId: string, input: BillingReconcileInput, options?: AthenaBillingCallOptions): Promise<unknown>;
307
+ listWebhookEvents(clientName: string, options?: AthenaBillingCallOptions): Promise<unknown>;
308
+ provisionWebhookSinks(clientName: string, input?: BillingProvisionSinksInput, options?: AthenaBillingCallOptions): Promise<unknown>;
309
+ listGrants(options?: AthenaBillingCallOptions): Promise<unknown>;
310
+ listProviders(options?: AthenaBillingCallOptions): Promise<unknown>;
311
+ listSinkHelpers(query?: {
312
+ targetSchema?: string;
313
+ instance?: string;
314
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
315
+ ingestProviderWebhook(input: {
316
+ provider: string;
317
+ clientName: string;
318
+ connectionId: string;
319
+ body: BodyInit | Record<string, unknown> | string;
320
+ signatureHeaders?: Record<string, string>;
321
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
322
+ getDebugBilling(jwtSecret: string, options?: AthenaBillingCallOptions): Promise<string>;
323
+ }
324
+ declare function createBillingModule(config: AthenaBillingClientConfig): AthenaBillingModule;
325
+
326
+ export { type AthenaBillingCallOptions as A, type BillingConnectionRefInput as B, type AthenaBillingClientConfig as a, AthenaBillingError as b, type AthenaBillingModule as c, billingSdkManifest as d, createBillingModule as e, type AthenaBillingEnvelope as f, type AthenaBillingHttpMethod as g, type AthenaBillingJson as h, type BillingCreateConnectionInput as i, type BillingEnsureCustomerInput as j, type BillingListQuery as k, type BillingProvisionSinksInput as l, type BillingReconcileInput as m, type BillingUpdateConnectionInput as n, type BillingUpdateCustomerInput as o };
@@ -0,0 +1,326 @@
1
+ /**
2
+ * Athena billing HTTP client for live `/billing/v1/*`, `/admin/billing/*`,
3
+ * provider webhook, and `/debug/billing` routes.
4
+ *
5
+ * Methods map 1:1 onto the registered Actix handlers. Auth uses the static
6
+ * Athena admin key (`X-Athena-Key` / configured API key) matching the server
7
+ * `authorize_static_admin_key` gate.
8
+ *
9
+ * Contract spine: `billingSdkManifest` METHOD+path entries must match the
10
+ * permanent Rust inventory `athena_billing::LIVE_HTTP_ROUTES`
11
+ * (exported as `./live-http-routes.json`). Export with
12
+ * `cargo run -p athena-billing --bin billing-contract-spine -- --write`.
13
+ */
14
+ type AthenaBillingHttpMethod = 'GET' | 'POST' | 'PATCH' | 'DELETE';
15
+ type AthenaBillingJson = null | boolean | number | string | AthenaBillingJson[] | {
16
+ [key: string]: AthenaBillingJson;
17
+ };
18
+ interface AthenaBillingCallOptions {
19
+ headers?: Record<string, string>;
20
+ signal?: AbortSignal;
21
+ apiKey?: string | null;
22
+ }
23
+ interface AthenaBillingClientConfig {
24
+ baseUrl: string;
25
+ apiKey: string;
26
+ client?: string | null;
27
+ headers?: Record<string, string>;
28
+ fetchImpl?: typeof fetch;
29
+ }
30
+ interface AthenaBillingEnvelope<T = unknown> {
31
+ status?: string;
32
+ message?: string;
33
+ data: T;
34
+ }
35
+ declare class AthenaBillingError extends Error {
36
+ status: number;
37
+ endpoint: string;
38
+ method: string;
39
+ body: unknown;
40
+ constructor(input: {
41
+ message: string;
42
+ status: number;
43
+ endpoint: string;
44
+ method: string;
45
+ body: unknown;
46
+ });
47
+ }
48
+ interface BillingConnectionRefInput {
49
+ connectionId: string;
50
+ clientName?: string;
51
+ }
52
+ interface BillingListQuery extends BillingConnectionRefInput {
53
+ cursor?: string;
54
+ source?: 'provider' | 'persistence' | string;
55
+ limit?: number;
56
+ offset?: number;
57
+ }
58
+ interface BillingEnsureCustomerInput extends BillingConnectionRefInput {
59
+ email?: string | null;
60
+ name?: string | null;
61
+ metadata?: Record<string, AthenaBillingJson>;
62
+ idempotencyKey: string;
63
+ }
64
+ interface BillingUpdateCustomerInput extends BillingConnectionRefInput {
65
+ email?: string | null;
66
+ name?: string | null;
67
+ }
68
+ interface BillingCreateConnectionInput {
69
+ ownerKind: string;
70
+ ownerId: string;
71
+ provider: string;
72
+ mode?: string;
73
+ status?: string;
74
+ credentialKind?: string;
75
+ providerAccountId: string;
76
+ providerProfileId?: string | null;
77
+ scopes?: string[];
78
+ config?: Record<string, AthenaBillingJson>;
79
+ metadata?: Record<string, AthenaBillingJson>;
80
+ }
81
+ interface BillingUpdateConnectionInput {
82
+ status?: string;
83
+ mode?: string;
84
+ credentialKind?: string;
85
+ providerAccountId?: string;
86
+ providerProfileId?: string | null;
87
+ scopes?: string[];
88
+ config?: Record<string, AthenaBillingJson>;
89
+ metadata?: Record<string, AthenaBillingJson>;
90
+ }
91
+ interface BillingReconcileInput {
92
+ resourceKind: string;
93
+ resourceId: string;
94
+ customerId?: string | null;
95
+ }
96
+ interface BillingProvisionSinksInput {
97
+ targetSchema?: string;
98
+ instance?: string;
99
+ }
100
+ declare const billingSdkManifest: {
101
+ readonly namespace: "billing";
102
+ readonly envelopeKind: "athena";
103
+ readonly methods: readonly [{
104
+ readonly name: "getCapabilities";
105
+ readonly method: "GET";
106
+ readonly path: "/billing/v1/capabilities";
107
+ }, {
108
+ readonly name: "createCheckout";
109
+ readonly method: "POST";
110
+ readonly path: "/billing/v1/checkouts";
111
+ }, {
112
+ readonly name: "listCustomers";
113
+ readonly method: "GET";
114
+ readonly path: "/billing/v1/customers";
115
+ }, {
116
+ readonly name: "createCustomer";
117
+ readonly method: "POST";
118
+ readonly path: "/billing/v1/customers";
119
+ }, {
120
+ readonly name: "getCustomer";
121
+ readonly method: "GET";
122
+ readonly path: "/billing/v1/customers/{id}";
123
+ }, {
124
+ readonly name: "updateCustomer";
125
+ readonly method: "PATCH";
126
+ readonly path: "/billing/v1/customers/{id}";
127
+ }, {
128
+ readonly name: "deleteCustomer";
129
+ readonly method: "DELETE";
130
+ readonly path: "/billing/v1/customers/{id}";
131
+ }, {
132
+ readonly name: "listPayments";
133
+ readonly method: "GET";
134
+ readonly path: "/billing/v1/payments";
135
+ }, {
136
+ readonly name: "createPayment";
137
+ readonly method: "POST";
138
+ readonly path: "/billing/v1/payments";
139
+ }, {
140
+ readonly name: "getPayment";
141
+ readonly method: "GET";
142
+ readonly path: "/billing/v1/payments/{id}";
143
+ }, {
144
+ readonly name: "cancelPayment";
145
+ readonly method: "POST";
146
+ readonly path: "/billing/v1/payments/{id}/cancel";
147
+ }, {
148
+ readonly name: "listPaymentLinks";
149
+ readonly method: "GET";
150
+ readonly path: "/billing/v1/payment-links";
151
+ }, {
152
+ readonly name: "createPaymentLink";
153
+ readonly method: "POST";
154
+ readonly path: "/billing/v1/payment-links";
155
+ }, {
156
+ readonly name: "getPaymentLink";
157
+ readonly method: "GET";
158
+ readonly path: "/billing/v1/payment-links/{id}";
159
+ }, {
160
+ readonly name: "updatePaymentLink";
161
+ readonly method: "PATCH";
162
+ readonly path: "/billing/v1/payment-links/{id}";
163
+ }, {
164
+ readonly name: "deletePaymentLink";
165
+ readonly method: "DELETE";
166
+ readonly path: "/billing/v1/payment-links/{id}";
167
+ }, {
168
+ readonly name: "listRefunds";
169
+ readonly method: "GET";
170
+ readonly path: "/billing/v1/refunds";
171
+ }, {
172
+ readonly name: "createRefund";
173
+ readonly method: "POST";
174
+ readonly path: "/billing/v1/refunds";
175
+ }, {
176
+ readonly name: "getRefund";
177
+ readonly method: "GET";
178
+ readonly path: "/billing/v1/refunds/{id}";
179
+ }, {
180
+ readonly name: "cancelRefund";
181
+ readonly method: "POST";
182
+ readonly path: "/billing/v1/refunds/{id}/cancel";
183
+ }, {
184
+ readonly name: "listSubscriptions";
185
+ readonly method: "GET";
186
+ readonly path: "/billing/v1/subscriptions";
187
+ }, {
188
+ readonly name: "createSubscription";
189
+ readonly method: "POST";
190
+ readonly path: "/billing/v1/subscriptions";
191
+ }, {
192
+ readonly name: "getSubscription";
193
+ readonly method: "GET";
194
+ readonly path: "/billing/v1/subscriptions/{id}";
195
+ }, {
196
+ readonly name: "updateSubscription";
197
+ readonly method: "PATCH";
198
+ readonly path: "/billing/v1/subscriptions/{id}";
199
+ }, {
200
+ readonly name: "cancelSubscription";
201
+ readonly method: "POST";
202
+ readonly path: "/billing/v1/subscriptions/{id}/cancel";
203
+ }, {
204
+ readonly name: "listInvoices";
205
+ readonly method: "GET";
206
+ readonly path: "/billing/v1/invoices";
207
+ }, {
208
+ readonly name: "getInvoice";
209
+ readonly method: "GET";
210
+ readonly path: "/billing/v1/invoices/{id}";
211
+ }, {
212
+ readonly name: "listConnections";
213
+ readonly method: "GET";
214
+ readonly path: "/admin/billing/clients/{client_name}/connections";
215
+ }, {
216
+ readonly name: "createConnection";
217
+ readonly method: "POST";
218
+ readonly path: "/admin/billing/clients/{client_name}/connections";
219
+ }, {
220
+ readonly name: "getConnection";
221
+ readonly method: "GET";
222
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
223
+ }, {
224
+ readonly name: "updateConnection";
225
+ readonly method: "PATCH";
226
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
227
+ }, {
228
+ readonly name: "deleteConnection";
229
+ readonly method: "DELETE";
230
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
231
+ }, {
232
+ readonly name: "reconcileDocument";
233
+ readonly method: "POST";
234
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}/reconcile";
235
+ }, {
236
+ readonly name: "listWebhookEvents";
237
+ readonly method: "GET";
238
+ readonly path: "/admin/billing/clients/{client_name}/webhook-events";
239
+ }, {
240
+ readonly name: "provisionWebhookSinks";
241
+ readonly method: "POST";
242
+ readonly path: "/admin/billing/clients/{client_name}/webhook-sinks/provision";
243
+ }, {
244
+ readonly name: "listGrants";
245
+ readonly method: "GET";
246
+ readonly path: "/admin/billing/grants";
247
+ }, {
248
+ readonly name: "listProviders";
249
+ readonly method: "GET";
250
+ readonly path: "/admin/billing/providers";
251
+ }, {
252
+ readonly name: "listSinkHelpers";
253
+ readonly method: "GET";
254
+ readonly path: "/admin/webhook-sinks/helpers/billing";
255
+ }, {
256
+ readonly name: "ingestProviderWebhook";
257
+ readonly method: "POST";
258
+ readonly path: "/billing/providers/{provider}/clients/{client_name}/connections/{connection_id}/webhook";
259
+ }, {
260
+ readonly name: "getDebugBilling";
261
+ readonly method: "GET";
262
+ readonly path: "/debug/billing";
263
+ }];
264
+ };
265
+ interface AthenaBillingModule {
266
+ getCapabilities(input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
267
+ createCheckout(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
268
+ listCustomers(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
269
+ createCustomer(input: BillingEnsureCustomerInput, options?: AthenaBillingCallOptions): Promise<unknown>;
270
+ getCustomer(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
271
+ updateCustomer(id: string, input: BillingUpdateCustomerInput, options?: AthenaBillingCallOptions): Promise<unknown>;
272
+ deleteCustomer(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
273
+ listPayments(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
274
+ createPayment(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
275
+ getPayment(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
276
+ cancelPayment(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
277
+ listPaymentLinks(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
278
+ createPaymentLink(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
279
+ getPaymentLink(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
280
+ updatePaymentLink(id: string, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
281
+ deletePaymentLink(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
282
+ listRefunds(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
283
+ createRefund(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
284
+ getRefund(id: string, input: BillingConnectionRefInput & {
285
+ paymentId?: string;
286
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
287
+ cancelRefund(id: string, input: BillingConnectionRefInput & {
288
+ paymentId?: string;
289
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
290
+ listSubscriptions(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
291
+ createSubscription(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
292
+ getSubscription(id: string, input: BillingConnectionRefInput & {
293
+ customerId?: string;
294
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
295
+ updateSubscription(id: string, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
296
+ cancelSubscription(id: string, input: BillingConnectionRefInput & {
297
+ customerId: string;
298
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
299
+ listInvoices(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
300
+ getInvoice(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
301
+ listConnections(clientName: string, options?: AthenaBillingCallOptions): Promise<unknown>;
302
+ createConnection(clientName: string, input: BillingCreateConnectionInput, options?: AthenaBillingCallOptions): Promise<unknown>;
303
+ getConnection(clientName: string, connectionId: string, options?: AthenaBillingCallOptions): Promise<unknown>;
304
+ updateConnection(clientName: string, connectionId: string, input: BillingUpdateConnectionInput, options?: AthenaBillingCallOptions): Promise<unknown>;
305
+ deleteConnection(clientName: string, connectionId: string, options?: AthenaBillingCallOptions): Promise<unknown>;
306
+ reconcileDocument(clientName: string, connectionId: string, input: BillingReconcileInput, options?: AthenaBillingCallOptions): Promise<unknown>;
307
+ listWebhookEvents(clientName: string, options?: AthenaBillingCallOptions): Promise<unknown>;
308
+ provisionWebhookSinks(clientName: string, input?: BillingProvisionSinksInput, options?: AthenaBillingCallOptions): Promise<unknown>;
309
+ listGrants(options?: AthenaBillingCallOptions): Promise<unknown>;
310
+ listProviders(options?: AthenaBillingCallOptions): Promise<unknown>;
311
+ listSinkHelpers(query?: {
312
+ targetSchema?: string;
313
+ instance?: string;
314
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
315
+ ingestProviderWebhook(input: {
316
+ provider: string;
317
+ clientName: string;
318
+ connectionId: string;
319
+ body: BodyInit | Record<string, unknown> | string;
320
+ signatureHeaders?: Record<string, string>;
321
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
322
+ getDebugBilling(jwtSecret: string, options?: AthenaBillingCallOptions): Promise<string>;
323
+ }
324
+ declare function createBillingModule(config: AthenaBillingClientConfig): AthenaBillingModule;
325
+
326
+ export { type AthenaBillingCallOptions as A, type BillingConnectionRefInput as B, type AthenaBillingClientConfig as a, AthenaBillingError as b, type AthenaBillingModule as c, billingSdkManifest as d, createBillingModule as e, type AthenaBillingEnvelope as f, type AthenaBillingHttpMethod as g, type AthenaBillingJson as h, type BillingCreateConnectionInput as i, type BillingEnsureCustomerInput as j, type BillingListQuery as k, type BillingProvisionSinksInput as l, type BillingReconcileInput as m, type BillingUpdateConnectionInput as n, type BillingUpdateCustomerInput as o };