@xylex-group/athena 2.14.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 (78) hide show
  1. package/README.md +91 -1398
  2. package/dist/admin.d.cts +1 -1
  3. package/dist/admin.d.ts +1 -1
  4. package/dist/billing.cjs +1199 -0
  5. package/dist/billing.cjs.map +1 -0
  6. package/dist/billing.d.cts +230 -0
  7. package/dist/billing.d.ts +230 -0
  8. package/dist/billing.js +1194 -0
  9. package/dist/billing.js.map +1 -0
  10. package/dist/browser.cjs +8892 -8533
  11. package/dist/browser.cjs.map +1 -1
  12. package/dist/browser.d.cts +11 -10
  13. package/dist/browser.d.ts +11 -10
  14. package/dist/browser.js +8889 -8531
  15. package/dist/browser.js.map +1 -1
  16. package/dist/cli/index.cjs +8294 -7528
  17. package/dist/cli/index.cjs.map +1 -1
  18. package/dist/cli/index.d.cts +4 -4
  19. package/dist/cli/index.d.ts +4 -4
  20. package/dist/cli/index.js +8294 -7528
  21. package/dist/cli/index.js.map +1 -1
  22. package/dist/index.cjs +8869 -8504
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +11 -10
  25. package/dist/index.d.ts +11 -10
  26. package/dist/index.js +8862 -8502
  27. package/dist/index.js.map +1 -1
  28. package/dist/{model-form-BE1_Bmdd.d.cts → model-form-BEfCGB5b.d.cts} +2 -2
  29. package/dist/{model-form-DcH3R7WD.d.ts → model-form-BKetpu6Q.d.ts} +2 -2
  30. package/dist/module-8dSMcy0K.d.cts +326 -0
  31. package/dist/module-8dSMcy0K.d.ts +326 -0
  32. package/dist/{module-Ca3_OQqR.d.ts → module-Bef_MAPO.d.ts} +6 -52
  33. package/dist/{module-DFGZXCtt.d.cts → module-CrrSmpML.d.cts} +6 -52
  34. package/dist/next/client.cjs +2 -9168
  35. package/dist/next/client.cjs.map +1 -1
  36. package/dist/next/client.d.cts +1 -27
  37. package/dist/next/client.d.ts +1 -27
  38. package/dist/next/client.js +3 -9168
  39. package/dist/next/client.js.map +1 -1
  40. package/dist/next/server.cjs +79 -9279
  41. package/dist/next/server.cjs.map +1 -1
  42. package/dist/next/server.d.cts +30 -46
  43. package/dist/next/server.d.ts +30 -46
  44. package/dist/next/server.js +79 -9279
  45. package/dist/next/server.js.map +1 -1
  46. package/dist/{payload-BbSCmILD.d.ts → payload-DWI1rw-e.d.cts} +1 -35
  47. package/dist/{payload-zXIwKTQf.d.cts → payload-DWI1rw-e.d.ts} +1 -35
  48. package/dist/{pipeline-DqwehoQV.d.ts → pipeline-BXFQbsUW.d.ts} +1 -1
  49. package/dist/{pipeline-CwQoD5G9.d.cts → pipeline-Dfsed4VD.d.cts} +1 -1
  50. package/dist/react.cjs +114 -13
  51. package/dist/react.cjs.map +1 -1
  52. package/dist/react.d.cts +46 -16
  53. package/dist/react.d.ts +46 -16
  54. package/dist/react.js +113 -14
  55. package/dist/react.js.map +1 -1
  56. package/dist/social-providers.cjs +9 -9
  57. package/dist/social-providers.cjs.map +1 -1
  58. package/dist/social-providers.d.cts +79 -82
  59. package/dist/social-providers.d.ts +79 -82
  60. package/dist/social-providers.js +9 -9
  61. package/dist/social-providers.js.map +1 -1
  62. package/dist/{types-eAKAh71s.d.cts → types-AOY-GLu8.d.cts} +27 -54
  63. package/dist/{types-eAKAh71s.d.ts → types-AOY-GLu8.d.ts} +27 -54
  64. package/dist/{types-YQUR7wu0.d.cts → types-Bltx6iL6.d.cts} +3 -5
  65. package/dist/{types-YQUR7wu0.d.ts → types-Bltx6iL6.d.ts} +3 -5
  66. package/dist/{types-C1swabT5.d.ts → types-CK7cBQbC.d.ts} +2 -2
  67. package/dist/{types-dHnjluBC.d.cts → types-Z3-rsiM3.d.cts} +2 -2
  68. package/dist/{types-CD6K05JQ.d.ts → types-jClgDy1J.d.ts} +2 -2
  69. package/dist/{types-6H575ITc.d.cts → types-kO_Ut5wU.d.cts} +2 -2
  70. package/dist/utils.cjs +7 -8
  71. package/dist/utils.cjs.map +1 -1
  72. package/dist/utils.d.cts +2 -5
  73. package/dist/utils.d.ts +2 -5
  74. package/dist/utils.js +7 -8
  75. package/dist/utils.js.map +1 -1
  76. package/dist/{client-uthENhaf.d.ts → v3-client-CuCNy-JJ.d.ts} +380 -515
  77. package/dist/{client-wU2J9yqb.d.cts → v3-client-G8JMOilK.d.cts} +380 -515
  78. package/package.json +10 -1
@@ -1,5 +1,5 @@
1
- import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-YQUR7wu0.cjs';
2
- import { r as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-6H575ITc.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-YQUR7wu0.js';
2
- import { r as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-CD6K05JQ.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 };