@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
@@ -0,0 +1,1194 @@
1
+ // package.json
2
+ var package_default = {
3
+ version: "3.0.0"
4
+ };
5
+
6
+ // src/sdk-version.ts
7
+ var PACKAGE_VERSION = package_default.version;
8
+ function buildSdkHeaderValue(sdkName) {
9
+ return `${sdkName} ${PACKAGE_VERSION}`;
10
+ }
11
+
12
+ // src/cookies/cookie-utils.ts
13
+ var SECURE_COOKIE_PREFIX = "__Secure-";
14
+ function parseCookies(cookieHeader) {
15
+ const cookies = cookieHeader.split("; ");
16
+ const cookieMap = /* @__PURE__ */ new Map();
17
+ cookies.forEach((cookie) => {
18
+ const [name, value] = cookie.split(/=(.*)/s);
19
+ cookieMap.set(name, value);
20
+ });
21
+ return cookieMap;
22
+ }
23
+ var getSessionCookie = (request, config) => {
24
+ const cookies = (request instanceof Headers || !("headers" in request) ? request : request.headers).get("cookie");
25
+ if (!cookies) {
26
+ return null;
27
+ }
28
+ const { cookieName = "session_token", cookiePrefix = "athena-auth" } = {};
29
+ const parsedCookie = parseCookies(cookies);
30
+ const getCookie = (name) => parsedCookie.get(name) || parsedCookie.get(`${SECURE_COOKIE_PREFIX}${name}`);
31
+ const candidateCookieNames = Array.from(/* @__PURE__ */ new Set([
32
+ cookieName,
33
+ cookieName.replace(/_/g, "-"),
34
+ cookieName.replace(/-/g, "_")
35
+ ])).filter(Boolean);
36
+ for (const candidateName of candidateCookieNames) {
37
+ const sessionToken = getCookie(`${cookiePrefix}.${candidateName}`) || getCookie(`${cookiePrefix}-${candidateName}`);
38
+ if (sessionToken) {
39
+ return sessionToken;
40
+ }
41
+ }
42
+ return null;
43
+ };
44
+
45
+ // src/utils/athena-request-headers.ts
46
+ var NO_CACHE_HEADER_VALUE = "no-cache";
47
+ var API_KEY_HEADER_CANDIDATES = ["X-Athena-Key", "x-athena-key", "X-Api-Key", "x-api-key", "apikey"];
48
+ var ATHENA_KEY_HEADER_CANDIDATES = ["X-Athena-Key", "x-athena-key"];
49
+ var SESSION_TOKEN_HEADER_CANDIDATES = ["X-Athena-Auth-Session-Token"];
50
+ var BEARER_MIRROR_HEADER_CANDIDATES = ["X-Athena-Auth-Bearer-Token"];
51
+ var CLIENT_HEADER_CANDIDATES = ["X-Athena-Client", "x-athena-client"];
52
+ var PG_URI_HEADER_CANDIDATES = ["x-pg-uri"];
53
+ var JDBC_URI_HEADER_CANDIDATES = ["x-athena-jdbc-url", "x-jdbc-url"];
54
+ var PROFILE_RULES = {
55
+ gateway: { apiKeys: true, routing: true, authMirror: true, authBearer: false, contentType: true, stripNullsDefault: true },
56
+ chat: { apiKeys: true, routing: true, authMirror: true, authBearer: true, accept: true },
57
+ storage: { apiKeys: true, routing: true, authMirror: true, authBearer: false, contentType: true },
58
+ auth: { apiKeys: true, routing: true, authMirror: false, authBearer: true, contentType: true },
59
+ minimal: { apiKeys: false, routing: false, authMirror: false, authBearer: false }
60
+ };
61
+ function normalizeHeaderValue(value) {
62
+ return value ? value : void 0;
63
+ }
64
+ function mergeExtraHeaders(configHeaders, callHeaders) {
65
+ return { ...configHeaders ?? {}, ...callHeaders ?? {} };
66
+ }
67
+ function hasHeaderIgnoreCase(headers, targetKey) {
68
+ const normalizedTargetKey = targetKey.toLowerCase();
69
+ return Object.keys(headers).some((key) => key.toLowerCase() === normalizedTargetKey);
70
+ }
71
+ function resolveHeaderValue(headers, candidates) {
72
+ for (const candidate of candidates) {
73
+ const direct = normalizeHeaderValue(headers[candidate]);
74
+ if (direct) return direct;
75
+ }
76
+ const loweredCandidates = new Set(candidates.map((candidate) => candidate.toLowerCase()));
77
+ for (const [key, value] of Object.entries(headers)) {
78
+ if (!loweredCandidates.has(key.toLowerCase())) {
79
+ continue;
80
+ }
81
+ const normalized = normalizeHeaderValue(value);
82
+ if (normalized) return normalized;
83
+ }
84
+ return void 0;
85
+ }
86
+ function isCacheControlHeaderName(name) {
87
+ return name.toLowerCase() === "cache-control";
88
+ }
89
+ function normalizeBearerToken(value) {
90
+ const trimmed = value.trim();
91
+ const match = trimmed.match(/^Bearer\s+(.+)$/i);
92
+ return match?.[1]?.trim() ?? trimmed;
93
+ }
94
+ function resolveBearerTokenFromAuthorizationHeader(headers) {
95
+ const authorization = resolveHeaderValue(headers, ["Authorization"]);
96
+ if (!authorization) {
97
+ return void 0;
98
+ }
99
+ const token = normalizeBearerToken(authorization);
100
+ return token ? token : void 0;
101
+ }
102
+ function resolveSessionTokenFromCookieHeader(headers) {
103
+ const cookie = resolveHeaderValue(headers, ["Cookie"]);
104
+ if (!cookie) {
105
+ return void 0;
106
+ }
107
+ return getSessionCookie(new Headers({ cookie })) ?? void 0;
108
+ }
109
+ function resolveBackendType(backend) {
110
+ if (!backend) {
111
+ return void 0;
112
+ }
113
+ return typeof backend === "string" ? backend : backend.type;
114
+ }
115
+ function applyAthenaApiKeyHeaders(headers, apiKey) {
116
+ const resolvedApiKey = normalizeHeaderValue(apiKey);
117
+ if (resolvedApiKey && !hasHeaderIgnoreCase(headers, "X-Athena-Key")) {
118
+ headers["X-Athena-Key"] = resolvedApiKey;
119
+ }
120
+ }
121
+ function applyAthenaAuthContextHeaders(headers, input) {
122
+ const mergedExtraHeaders = mergeExtraHeaders(input.configHeaders, input.callHeaders);
123
+ const rules = PROFILE_RULES[input.profile];
124
+ const explicitCookie = normalizeHeaderValue(input.cookie);
125
+ if (explicitCookie) {
126
+ mergedExtraHeaders.Cookie = explicitCookie;
127
+ }
128
+ const explicitSessionToken = normalizeHeaderValue(input.sessionToken) ?? resolveHeaderValue(mergedExtraHeaders, SESSION_TOKEN_HEADER_CANDIDATES);
129
+ const derivedSessionToken = explicitSessionToken ?? resolveSessionTokenFromCookieHeader(mergedExtraHeaders);
130
+ const cookieFromHeaders = resolveHeaderValue(mergedExtraHeaders, ["Cookie"]);
131
+ if (explicitCookie && !hasHeaderIgnoreCase(headers, "Cookie")) {
132
+ headers.Cookie = explicitCookie;
133
+ } else if (cookieFromHeaders && !hasHeaderIgnoreCase(headers, "Cookie")) {
134
+ headers.Cookie = cookieFromHeaders;
135
+ }
136
+ const explicitBearerToken = (() => {
137
+ const configured = normalizeHeaderValue(input.bearerToken);
138
+ if (configured) {
139
+ return normalizeBearerToken(configured);
140
+ }
141
+ const mirrored = resolveHeaderValue(mergedExtraHeaders, BEARER_MIRROR_HEADER_CANDIDATES);
142
+ return mirrored ? normalizeBearerToken(mirrored) : void 0;
143
+ })();
144
+ const derivedBearerToken = explicitBearerToken ?? resolveBearerTokenFromAuthorizationHeader(mergedExtraHeaders);
145
+ if (rules.authBearer && derivedBearerToken && !hasHeaderIgnoreCase(headers, "Authorization")) {
146
+ headers.Authorization = `Bearer ${derivedBearerToken}`;
147
+ }
148
+ if (rules.authMirror) {
149
+ if (derivedSessionToken && !hasHeaderIgnoreCase(headers, "X-Athena-Auth-Session-Token")) {
150
+ headers["X-Athena-Auth-Session-Token"] = derivedSessionToken;
151
+ }
152
+ if (derivedBearerToken && !hasHeaderIgnoreCase(headers, "X-Athena-Auth-Bearer-Token")) {
153
+ headers["X-Athena-Auth-Bearer-Token"] = derivedBearerToken;
154
+ }
155
+ } else if (derivedSessionToken && !hasHeaderIgnoreCase(headers, "X-Athena-Auth-Session-Token")) {
156
+ headers["X-Athena-Auth-Session-Token"] = derivedSessionToken;
157
+ }
158
+ }
159
+ function applyAthenaPgUriHeaders(headers, input) {
160
+ const mergedExtraHeaders = mergeExtraHeaders(input.configHeaders, input.callHeaders);
161
+ const pgUri = normalizeHeaderValue(input.pgUri) ?? resolveHeaderValue(mergedExtraHeaders, PG_URI_HEADER_CANDIDATES);
162
+ if (pgUri && !hasHeaderIgnoreCase(headers, "x-pg-uri")) {
163
+ headers["x-pg-uri"] = pgUri;
164
+ }
165
+ const jdbcUrl = normalizeHeaderValue(input.jdbcUrl) ?? resolveHeaderValue(mergedExtraHeaders, JDBC_URI_HEADER_CANDIDATES);
166
+ if (jdbcUrl) {
167
+ if (!hasHeaderIgnoreCase(headers, "x-athena-jdbc-url")) {
168
+ headers["x-athena-jdbc-url"] = jdbcUrl;
169
+ }
170
+ if (!hasHeaderIgnoreCase(headers, "x-jdbc-url")) {
171
+ headers["x-jdbc-url"] = jdbcUrl;
172
+ }
173
+ }
174
+ }
175
+ function buildAthenaRequestHeaders(input) {
176
+ const forceNoCache = Boolean(input.forceNoCache);
177
+ const mergedExtraHeaders = mergeExtraHeaders(input.configHeaders, input.callHeaders);
178
+ const rules = PROFILE_RULES[input.profile];
179
+ const headerClient = resolveHeaderValue(mergedExtraHeaders, CLIENT_HEADER_CANDIDATES);
180
+ const finalClient = normalizeHeaderValue(input.client) ?? headerClient;
181
+ const finalApiKey = normalizeHeaderValue(input.apiKey) ?? resolveHeaderValue(mergedExtraHeaders, API_KEY_HEADER_CANDIDATES);
182
+ const finalAthenaKey = resolveHeaderValue(mergedExtraHeaders, ATHENA_KEY_HEADER_CANDIDATES) ?? finalApiKey;
183
+ const headers = {
184
+ "X-Athena-Sdk": input.sdkHeaderValue
185
+ };
186
+ if (rules.contentType) {
187
+ headers["Content-Type"] = input.contentType ?? "application/json";
188
+ }
189
+ if (input.accept ?? rules.accept) {
190
+ headers.Accept = input.accept ?? "application/json";
191
+ }
192
+ if (rules.routing) {
193
+ if (normalizeHeaderValue(input.userId)) {
194
+ headers["X-User-Id"] = input.userId ?? "";
195
+ }
196
+ if (normalizeHeaderValue(input.organizationId)) {
197
+ headers["X-Organization-Id"] = input.organizationId ?? "";
198
+ }
199
+ if (finalClient) {
200
+ headers["X-Athena-Client"] = finalClient;
201
+ }
202
+ const backendType = resolveBackendType(input.backend);
203
+ if (backendType) {
204
+ headers["X-Backend-Type"] = backendType;
205
+ }
206
+ if (typeof input.stripNulls === "boolean") {
207
+ headers["X-Strip-Nulls"] = input.stripNulls ? "true" : "false";
208
+ } else if (rules.stripNullsDefault) {
209
+ headers["X-Strip-Nulls"] = "true";
210
+ }
211
+ if (normalizeHeaderValue(input.publishEvent)) {
212
+ headers["X-Publish-Event"] = input.publishEvent ?? "";
213
+ }
214
+ }
215
+ if (rules.apiKeys && (finalApiKey || finalAthenaKey)) {
216
+ applyAthenaApiKeyHeaders(headers, finalAthenaKey);
217
+ }
218
+ applyAthenaAuthContextHeaders(headers, input);
219
+ applyAthenaPgUriHeaders(headers, input);
220
+ const reservedClientHeaderKeys = new Set(CLIENT_HEADER_CANDIDATES.map((key) => key.toLowerCase()));
221
+ Object.entries(mergedExtraHeaders).forEach(([key, value]) => {
222
+ if (reservedClientHeaderKeys.has(key.toLowerCase())) {
223
+ return;
224
+ }
225
+ if (forceNoCache && isCacheControlHeaderName(key)) {
226
+ return;
227
+ }
228
+ const normalized = normalizeHeaderValue(value);
229
+ if (normalized) {
230
+ headers[key] = normalized;
231
+ }
232
+ });
233
+ if (forceNoCache) {
234
+ headers["Cache-Control"] = NO_CACHE_HEADER_VALUE;
235
+ }
236
+ return headers;
237
+ }
238
+
239
+ // src/gateway/errors.ts
240
+ var AthenaGatewayError = class _AthenaGatewayError extends Error {
241
+ code;
242
+ status;
243
+ endpoint;
244
+ method;
245
+ requestId;
246
+ hint;
247
+ causeDetail;
248
+ constructor(input) {
249
+ super(input.message);
250
+ this.name = "AthenaGatewayError";
251
+ this.code = input.code;
252
+ this.status = input.status ?? 0;
253
+ this.endpoint = input.endpoint;
254
+ this.method = input.method;
255
+ this.requestId = input.requestId;
256
+ this.hint = input.hint;
257
+ this.causeDetail = input.cause;
258
+ }
259
+ toDetails() {
260
+ return {
261
+ code: this.code,
262
+ message: this.message,
263
+ status: this.status,
264
+ endpoint: this.endpoint,
265
+ method: this.method,
266
+ requestId: this.requestId,
267
+ hint: this.hint,
268
+ cause: this.causeDetail
269
+ };
270
+ }
271
+ static fromResponse(response, fallback) {
272
+ const details = response.errorDetails;
273
+ if (details) {
274
+ return new _AthenaGatewayError({
275
+ code: details.code,
276
+ message: details.message,
277
+ status: details.status,
278
+ endpoint: details.endpoint ?? fallback.endpoint,
279
+ method: details.method ?? fallback.method,
280
+ requestId: details.requestId ?? fallback.requestId,
281
+ hint: details.hint,
282
+ cause: details.cause
283
+ });
284
+ }
285
+ return new _AthenaGatewayError({
286
+ code: "HTTP_ERROR",
287
+ message: response.error ?? "Gateway request failed",
288
+ status: response.status,
289
+ endpoint: fallback.endpoint,
290
+ method: fallback.method,
291
+ requestId: fallback.requestId
292
+ });
293
+ }
294
+ };
295
+
296
+ // src/gateway/url.ts
297
+ function describeReceivedValue(value) {
298
+ if (value === void 0) return "undefined";
299
+ if (value === null) return "null";
300
+ if (typeof value === "string") {
301
+ return value.trim().length > 0 ? JSON.stringify(value) : "an empty string";
302
+ }
303
+ return `${typeof value} ${JSON.stringify(value)}`;
304
+ }
305
+ function invalidBaseUrlError(message, hint) {
306
+ return new AthenaGatewayError({
307
+ code: "INVALID_URL",
308
+ message,
309
+ status: 0,
310
+ hint
311
+ });
312
+ }
313
+ function normalizeAthenaGatewayBaseUrl(input, options = {}) {
314
+ const label = options.label ?? "Athena gateway base URL";
315
+ const candidate = input ?? options.defaultBaseUrl;
316
+ if (candidate === void 0 || candidate === null) {
317
+ throw invalidBaseUrlError(
318
+ `${label} must be a non-empty absolute http(s) URL. Received ${describeReceivedValue(input)}.`,
319
+ 'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://mirror3.athena-db.com".'
320
+ );
321
+ }
322
+ const trimmed = candidate.trim();
323
+ if (!trimmed) {
324
+ throw invalidBaseUrlError(
325
+ `${label} must be a non-empty absolute http(s) URL. Received ${describeReceivedValue(candidate)}.`,
326
+ 'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://mirror3.athena-db.com".'
327
+ );
328
+ }
329
+ let parsed;
330
+ try {
331
+ parsed = new URL(trimmed);
332
+ } catch {
333
+ throw invalidBaseUrlError(
334
+ `${label} must be a valid absolute http(s) URL. Received ${describeReceivedValue(candidate)}.`,
335
+ 'Use a full URL including the protocol, for example "https://mirror3.athena-db.com".'
336
+ );
337
+ }
338
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
339
+ throw invalidBaseUrlError(
340
+ `${label} must use http or https. Received ${JSON.stringify(trimmed)}.`,
341
+ 'Use an Athena gateway URL such as "https://mirror3.athena-db.com".'
342
+ );
343
+ }
344
+ if (parsed.search || parsed.hash) {
345
+ throw invalidBaseUrlError(
346
+ `${label} must not include query parameters or hash fragments. Received ${JSON.stringify(trimmed)}.`,
347
+ 'Pass only the base URL. Endpoint paths such as "/gateway/fetch" are appended by the SDK.'
348
+ );
349
+ }
350
+ return parsed.toString().replace(/\/+$/, "");
351
+ }
352
+
353
+ // src/billing/module.ts
354
+ var SDK_NAME = "xylex-group/athena-billing";
355
+ var SDK_HEADER_VALUE = buildSdkHeaderValue(SDK_NAME);
356
+ var AthenaBillingError = class extends Error {
357
+ status;
358
+ endpoint;
359
+ method;
360
+ body;
361
+ constructor(input) {
362
+ super(input.message);
363
+ this.name = "AthenaBillingError";
364
+ this.status = input.status;
365
+ this.endpoint = input.endpoint;
366
+ this.method = input.method;
367
+ this.body = input.body;
368
+ }
369
+ };
370
+ var billingSdkManifest = {
371
+ namespace: "billing",
372
+ envelopeKind: "athena",
373
+ methods: [
374
+ { name: "getCapabilities", method: "GET", path: "/billing/v1/capabilities" },
375
+ { name: "createCheckout", method: "POST", path: "/billing/v1/checkouts" },
376
+ { name: "listCustomers", method: "GET", path: "/billing/v1/customers" },
377
+ { name: "createCustomer", method: "POST", path: "/billing/v1/customers" },
378
+ { name: "getCustomer", method: "GET", path: "/billing/v1/customers/{id}" },
379
+ { name: "updateCustomer", method: "PATCH", path: "/billing/v1/customers/{id}" },
380
+ { name: "deleteCustomer", method: "DELETE", path: "/billing/v1/customers/{id}" },
381
+ { name: "listPayments", method: "GET", path: "/billing/v1/payments" },
382
+ { name: "createPayment", method: "POST", path: "/billing/v1/payments" },
383
+ { name: "getPayment", method: "GET", path: "/billing/v1/payments/{id}" },
384
+ { name: "cancelPayment", method: "POST", path: "/billing/v1/payments/{id}/cancel" },
385
+ { name: "listPaymentLinks", method: "GET", path: "/billing/v1/payment-links" },
386
+ { name: "createPaymentLink", method: "POST", path: "/billing/v1/payment-links" },
387
+ { name: "getPaymentLink", method: "GET", path: "/billing/v1/payment-links/{id}" },
388
+ { name: "updatePaymentLink", method: "PATCH", path: "/billing/v1/payment-links/{id}" },
389
+ { name: "deletePaymentLink", method: "DELETE", path: "/billing/v1/payment-links/{id}" },
390
+ { name: "listRefunds", method: "GET", path: "/billing/v1/refunds" },
391
+ { name: "createRefund", method: "POST", path: "/billing/v1/refunds" },
392
+ { name: "getRefund", method: "GET", path: "/billing/v1/refunds/{id}" },
393
+ { name: "cancelRefund", method: "POST", path: "/billing/v1/refunds/{id}/cancel" },
394
+ { name: "listSubscriptions", method: "GET", path: "/billing/v1/subscriptions" },
395
+ { name: "createSubscription", method: "POST", path: "/billing/v1/subscriptions" },
396
+ { name: "getSubscription", method: "GET", path: "/billing/v1/subscriptions/{id}" },
397
+ { name: "updateSubscription", method: "PATCH", path: "/billing/v1/subscriptions/{id}" },
398
+ { name: "cancelSubscription", method: "POST", path: "/billing/v1/subscriptions/{id}/cancel" },
399
+ { name: "listInvoices", method: "GET", path: "/billing/v1/invoices" },
400
+ { name: "getInvoice", method: "GET", path: "/billing/v1/invoices/{id}" },
401
+ {
402
+ name: "listConnections",
403
+ method: "GET",
404
+ path: "/admin/billing/clients/{client_name}/connections"
405
+ },
406
+ {
407
+ name: "createConnection",
408
+ method: "POST",
409
+ path: "/admin/billing/clients/{client_name}/connections"
410
+ },
411
+ {
412
+ name: "getConnection",
413
+ method: "GET",
414
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}"
415
+ },
416
+ {
417
+ name: "updateConnection",
418
+ method: "PATCH",
419
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}"
420
+ },
421
+ {
422
+ name: "deleteConnection",
423
+ method: "DELETE",
424
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}"
425
+ },
426
+ {
427
+ name: "reconcileDocument",
428
+ method: "POST",
429
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}/reconcile"
430
+ },
431
+ {
432
+ name: "listWebhookEvents",
433
+ method: "GET",
434
+ path: "/admin/billing/clients/{client_name}/webhook-events"
435
+ },
436
+ {
437
+ name: "provisionWebhookSinks",
438
+ method: "POST",
439
+ path: "/admin/billing/clients/{client_name}/webhook-sinks/provision"
440
+ },
441
+ { name: "listGrants", method: "GET", path: "/admin/billing/grants" },
442
+ { name: "listProviders", method: "GET", path: "/admin/billing/providers" },
443
+ {
444
+ name: "listSinkHelpers",
445
+ method: "GET",
446
+ path: "/admin/webhook-sinks/helpers/billing"
447
+ },
448
+ {
449
+ name: "ingestProviderWebhook",
450
+ method: "POST",
451
+ path: "/billing/providers/{provider}/clients/{client_name}/connections/{connection_id}/webhook"
452
+ },
453
+ { name: "getDebugBilling", method: "GET", path: "/debug/billing" }
454
+ ]
455
+ };
456
+ function withPathParam(path, name, value) {
457
+ return path.replace(`{${name}}`, encodeURIComponent(value));
458
+ }
459
+ function appendQuery(path, query) {
460
+ if (!query) return path;
461
+ const params = new URLSearchParams();
462
+ for (const [key, value] of Object.entries(query)) {
463
+ if (value === void 0 || value === null) continue;
464
+ params.set(key, String(value));
465
+ }
466
+ const serialized = params.toString();
467
+ return serialized ? `${path}?${serialized}` : path;
468
+ }
469
+ function connectionQuery(input) {
470
+ const query = {
471
+ connectionId: input.connectionId
472
+ };
473
+ if (input.clientName) query.clientName = input.clientName;
474
+ if ("cursor" in input && input.cursor) query.cursor = input.cursor;
475
+ if ("source" in input && input.source) query.source = input.source;
476
+ if ("limit" in input && input.limit !== void 0) query.limit = String(input.limit);
477
+ if ("offset" in input && input.offset !== void 0) query.offset = String(input.offset);
478
+ return query;
479
+ }
480
+ function parseEnvelopeData(body) {
481
+ if (body && typeof body === "object" && "data" in body) {
482
+ return body.data;
483
+ }
484
+ return body;
485
+ }
486
+ function createBillingModule(config) {
487
+ const baseUrl = normalizeAthenaGatewayBaseUrl(config.baseUrl, {
488
+ label: "Athena billing base URL"
489
+ });
490
+ const fetchImpl = config.fetchImpl ?? globalThis.fetch.bind(globalThis);
491
+ async function call(method, path, body, options, responseType = "json") {
492
+ const headers = buildAthenaRequestHeaders({
493
+ profile: "gateway",
494
+ sdkHeaderValue: SDK_HEADER_VALUE,
495
+ apiKey: options?.apiKey ?? config.apiKey,
496
+ client: config.client,
497
+ configHeaders: {
498
+ ...config.headers ?? {}
499
+ },
500
+ callHeaders: options?.headers,
501
+ contentType: "application/json"
502
+ });
503
+ let requestBody;
504
+ if (body !== void 0 && body !== null) {
505
+ if (typeof body === "string" || body instanceof Blob || body instanceof ArrayBuffer || ArrayBuffer.isView(body) || body instanceof FormData || body instanceof URLSearchParams) {
506
+ requestBody = body;
507
+ } else {
508
+ requestBody = JSON.stringify(body);
509
+ if (!hasHeaderIgnoreCase(headers, "Content-Type")) {
510
+ headers["Content-Type"] = "application/json";
511
+ }
512
+ }
513
+ }
514
+ const targetUrl = `${baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
515
+ const response = await fetchImpl(targetUrl, {
516
+ method,
517
+ headers,
518
+ body: requestBody,
519
+ signal: options?.signal
520
+ });
521
+ if (responseType === "text") {
522
+ const text = await response.text();
523
+ if (!response.ok) {
524
+ throw new AthenaBillingError({
525
+ message: `Billing request failed (${response.status})`,
526
+ status: response.status,
527
+ endpoint: path,
528
+ method,
529
+ body: text
530
+ });
531
+ }
532
+ return text;
533
+ }
534
+ const rawText = await response.text();
535
+ let parsed = rawText;
536
+ if (rawText) {
537
+ try {
538
+ parsed = JSON.parse(rawText);
539
+ } catch {
540
+ parsed = rawText;
541
+ }
542
+ } else {
543
+ parsed = null;
544
+ }
545
+ if (!response.ok) {
546
+ const message = parsed && typeof parsed === "object" && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `Billing request failed (${response.status})`;
547
+ throw new AthenaBillingError({
548
+ message,
549
+ status: response.status,
550
+ endpoint: path,
551
+ method,
552
+ body: parsed
553
+ });
554
+ }
555
+ return parseEnvelopeData(parsed);
556
+ }
557
+ return {
558
+ getCapabilities(input, options) {
559
+ return call(
560
+ "GET",
561
+ appendQuery("/billing/v1/capabilities", connectionQuery(input)),
562
+ void 0,
563
+ options
564
+ );
565
+ },
566
+ createCheckout(body, options) {
567
+ return call("POST", "/billing/v1/checkouts", body, options);
568
+ },
569
+ listCustomers(input, options) {
570
+ return call(
571
+ "GET",
572
+ appendQuery("/billing/v1/customers", connectionQuery(input)),
573
+ void 0,
574
+ options
575
+ );
576
+ },
577
+ createCustomer(input, options) {
578
+ return call(
579
+ "POST",
580
+ "/billing/v1/customers",
581
+ {
582
+ connectionId: input.connectionId,
583
+ clientName: input.clientName,
584
+ email: input.email,
585
+ name: input.name,
586
+ metadata: input.metadata ?? {},
587
+ idempotencyKey: input.idempotencyKey
588
+ },
589
+ options
590
+ );
591
+ },
592
+ getCustomer(id, input, options) {
593
+ return call(
594
+ "GET",
595
+ appendQuery(
596
+ withPathParam("/billing/v1/customers/{id}", "id", id),
597
+ connectionQuery(input)
598
+ ),
599
+ void 0,
600
+ options
601
+ );
602
+ },
603
+ updateCustomer(id, input, options) {
604
+ return call(
605
+ "PATCH",
606
+ withPathParam("/billing/v1/customers/{id}", "id", id),
607
+ {
608
+ connectionId: input.connectionId,
609
+ clientName: input.clientName,
610
+ email: input.email,
611
+ name: input.name
612
+ },
613
+ options
614
+ );
615
+ },
616
+ deleteCustomer(id, input, options) {
617
+ return call(
618
+ "DELETE",
619
+ appendQuery(
620
+ withPathParam("/billing/v1/customers/{id}", "id", id),
621
+ connectionQuery(input)
622
+ ),
623
+ void 0,
624
+ options
625
+ );
626
+ },
627
+ listPayments(input, options) {
628
+ return call(
629
+ "GET",
630
+ appendQuery("/billing/v1/payments", connectionQuery(input)),
631
+ void 0,
632
+ options
633
+ );
634
+ },
635
+ createPayment(body, options) {
636
+ return call("POST", "/billing/v1/payments", body, options);
637
+ },
638
+ getPayment(id, input, options) {
639
+ return call(
640
+ "GET",
641
+ appendQuery(
642
+ withPathParam("/billing/v1/payments/{id}", "id", id),
643
+ connectionQuery(input)
644
+ ),
645
+ void 0,
646
+ options
647
+ );
648
+ },
649
+ cancelPayment(id, input, options) {
650
+ return call(
651
+ "POST",
652
+ appendQuery(
653
+ withPathParam("/billing/v1/payments/{id}/cancel", "id", id),
654
+ connectionQuery(input)
655
+ ),
656
+ {},
657
+ options
658
+ );
659
+ },
660
+ listPaymentLinks(input, options) {
661
+ return call(
662
+ "GET",
663
+ appendQuery("/billing/v1/payment-links", connectionQuery(input)),
664
+ void 0,
665
+ options
666
+ );
667
+ },
668
+ createPaymentLink(body, options) {
669
+ return call("POST", "/billing/v1/payment-links", body, options);
670
+ },
671
+ getPaymentLink(id, input, options) {
672
+ return call(
673
+ "GET",
674
+ appendQuery(
675
+ withPathParam("/billing/v1/payment-links/{id}", "id", id),
676
+ connectionQuery(input)
677
+ ),
678
+ void 0,
679
+ options
680
+ );
681
+ },
682
+ updatePaymentLink(id, body, options) {
683
+ return call(
684
+ "PATCH",
685
+ withPathParam("/billing/v1/payment-links/{id}", "id", id),
686
+ body,
687
+ options
688
+ );
689
+ },
690
+ deletePaymentLink(id, input, options) {
691
+ return call(
692
+ "DELETE",
693
+ appendQuery(
694
+ withPathParam("/billing/v1/payment-links/{id}", "id", id),
695
+ connectionQuery(input)
696
+ ),
697
+ void 0,
698
+ options
699
+ );
700
+ },
701
+ listRefunds(input, options) {
702
+ return call(
703
+ "GET",
704
+ appendQuery("/billing/v1/refunds", connectionQuery(input)),
705
+ void 0,
706
+ options
707
+ );
708
+ },
709
+ createRefund(body, options) {
710
+ return call("POST", "/billing/v1/refunds", body, options);
711
+ },
712
+ getRefund(id, input, options) {
713
+ return call(
714
+ "GET",
715
+ appendQuery(withPathParam("/billing/v1/refunds/{id}", "id", id), {
716
+ ...connectionQuery(input),
717
+ ...input.paymentId ? { paymentId: input.paymentId } : {}
718
+ }),
719
+ void 0,
720
+ options
721
+ );
722
+ },
723
+ cancelRefund(id, input, options) {
724
+ return call(
725
+ "POST",
726
+ appendQuery(withPathParam("/billing/v1/refunds/{id}/cancel", "id", id), {
727
+ ...connectionQuery(input),
728
+ ...input.paymentId ? { paymentId: input.paymentId } : {}
729
+ }),
730
+ {},
731
+ options
732
+ );
733
+ },
734
+ listSubscriptions(input, options) {
735
+ return call(
736
+ "GET",
737
+ appendQuery("/billing/v1/subscriptions", connectionQuery(input)),
738
+ void 0,
739
+ options
740
+ );
741
+ },
742
+ createSubscription(body, options) {
743
+ return call("POST", "/billing/v1/subscriptions", body, options);
744
+ },
745
+ getSubscription(id, input, options) {
746
+ return call(
747
+ "GET",
748
+ appendQuery(withPathParam("/billing/v1/subscriptions/{id}", "id", id), {
749
+ ...connectionQuery(input),
750
+ ...input.customerId ? { customerId: input.customerId } : {}
751
+ }),
752
+ void 0,
753
+ options
754
+ );
755
+ },
756
+ updateSubscription(id, body, options) {
757
+ return call(
758
+ "PATCH",
759
+ withPathParam("/billing/v1/subscriptions/{id}", "id", id),
760
+ body,
761
+ options
762
+ );
763
+ },
764
+ cancelSubscription(id, input, options) {
765
+ return call(
766
+ "POST",
767
+ appendQuery(withPathParam("/billing/v1/subscriptions/{id}/cancel", "id", id), {
768
+ ...connectionQuery(input),
769
+ customerId: input.customerId
770
+ }),
771
+ {},
772
+ options
773
+ );
774
+ },
775
+ listInvoices(input, options) {
776
+ return call(
777
+ "GET",
778
+ appendQuery("/billing/v1/invoices", connectionQuery(input)),
779
+ void 0,
780
+ options
781
+ );
782
+ },
783
+ getInvoice(id, input, options) {
784
+ return call(
785
+ "GET",
786
+ appendQuery(
787
+ withPathParam("/billing/v1/invoices/{id}", "id", id),
788
+ connectionQuery(input)
789
+ ),
790
+ void 0,
791
+ options
792
+ );
793
+ },
794
+ listConnections(clientName, options) {
795
+ return call(
796
+ "GET",
797
+ withPathParam("/admin/billing/clients/{client_name}/connections", "client_name", clientName),
798
+ void 0,
799
+ options
800
+ );
801
+ },
802
+ createConnection(clientName, input, options) {
803
+ return call(
804
+ "POST",
805
+ withPathParam("/admin/billing/clients/{client_name}/connections", "client_name", clientName),
806
+ {
807
+ ownerKind: input.ownerKind,
808
+ ownerId: input.ownerId,
809
+ provider: input.provider,
810
+ mode: input.mode,
811
+ status: input.status,
812
+ credentialKind: input.credentialKind,
813
+ providerAccountId: input.providerAccountId,
814
+ providerProfileId: input.providerProfileId,
815
+ scopes: input.scopes,
816
+ config: input.config,
817
+ metadata: input.metadata
818
+ },
819
+ options
820
+ );
821
+ },
822
+ getConnection(clientName, connectionId, options) {
823
+ return call(
824
+ "GET",
825
+ withPathParam(
826
+ withPathParam(
827
+ "/admin/billing/clients/{client_name}/connections/{connection_id}",
828
+ "client_name",
829
+ clientName
830
+ ),
831
+ "connection_id",
832
+ connectionId
833
+ ),
834
+ void 0,
835
+ options
836
+ );
837
+ },
838
+ updateConnection(clientName, connectionId, input, options) {
839
+ return call(
840
+ "PATCH",
841
+ withPathParam(
842
+ withPathParam(
843
+ "/admin/billing/clients/{client_name}/connections/{connection_id}",
844
+ "client_name",
845
+ clientName
846
+ ),
847
+ "connection_id",
848
+ connectionId
849
+ ),
850
+ input,
851
+ options
852
+ );
853
+ },
854
+ deleteConnection(clientName, connectionId, options) {
855
+ return call(
856
+ "DELETE",
857
+ withPathParam(
858
+ withPathParam(
859
+ "/admin/billing/clients/{client_name}/connections/{connection_id}",
860
+ "client_name",
861
+ clientName
862
+ ),
863
+ "connection_id",
864
+ connectionId
865
+ ),
866
+ void 0,
867
+ options
868
+ );
869
+ },
870
+ reconcileDocument(clientName, connectionId, input, options) {
871
+ return call(
872
+ "POST",
873
+ withPathParam(
874
+ withPathParam(
875
+ "/admin/billing/clients/{client_name}/connections/{connection_id}/reconcile",
876
+ "client_name",
877
+ clientName
878
+ ),
879
+ "connection_id",
880
+ connectionId
881
+ ),
882
+ {
883
+ resourceKind: input.resourceKind,
884
+ resourceId: input.resourceId,
885
+ customerId: input.customerId
886
+ },
887
+ options
888
+ );
889
+ },
890
+ listWebhookEvents(clientName, options) {
891
+ return call(
892
+ "GET",
893
+ withPathParam(
894
+ "/admin/billing/clients/{client_name}/webhook-events",
895
+ "client_name",
896
+ clientName
897
+ ),
898
+ void 0,
899
+ options
900
+ );
901
+ },
902
+ provisionWebhookSinks(clientName, input, options) {
903
+ return call(
904
+ "POST",
905
+ appendQuery(
906
+ withPathParam(
907
+ "/admin/billing/clients/{client_name}/webhook-sinks/provision",
908
+ "client_name",
909
+ clientName
910
+ ),
911
+ {
912
+ targetSchema: input?.targetSchema,
913
+ instance: input?.instance
914
+ }
915
+ ),
916
+ {},
917
+ options
918
+ );
919
+ },
920
+ listGrants(options) {
921
+ return call("GET", "/admin/billing/grants", void 0, options);
922
+ },
923
+ listProviders(options) {
924
+ return call("GET", "/admin/billing/providers", void 0, options);
925
+ },
926
+ listSinkHelpers(query, options) {
927
+ return call(
928
+ "GET",
929
+ appendQuery("/admin/webhook-sinks/helpers/billing", {
930
+ targetSchema: query?.targetSchema,
931
+ instance: query?.instance
932
+ }),
933
+ void 0,
934
+ options
935
+ );
936
+ },
937
+ ingestProviderWebhook(input, options) {
938
+ const path = withPathParam(
939
+ withPathParam(
940
+ withPathParam(
941
+ "/billing/providers/{provider}/clients/{client_name}/connections/{connection_id}/webhook",
942
+ "provider",
943
+ input.provider
944
+ ),
945
+ "client_name",
946
+ input.clientName
947
+ ),
948
+ "connection_id",
949
+ input.connectionId
950
+ );
951
+ return call("POST", path, input.body, {
952
+ ...options,
953
+ headers: {
954
+ ...options?.headers ?? {},
955
+ ...input.signatureHeaders ?? {}
956
+ }
957
+ });
958
+ },
959
+ getDebugBilling(jwtSecret, options) {
960
+ return call(
961
+ "GET",
962
+ appendQuery("/debug/billing", { jwt_secret: jwtSecret }),
963
+ void 0,
964
+ options,
965
+ "text"
966
+ );
967
+ }
968
+ };
969
+ }
970
+
971
+ // src/billing/live-http-routes.json
972
+ var live_http_routes_default = {
973
+ consumers: [
974
+ "openapi.yaml",
975
+ "openapi.json",
976
+ "packages/athena-js billingSdkManifest",
977
+ "tests/billing_contract_spine.rs"
978
+ ],
979
+ description: "Live Athena billing HTTP surface. Owned by athena_billing::live_http_routes (Rust). Export with: cargo run -p athena-billing --bin billing-contract-spine -- --write",
980
+ domain: "billing",
981
+ routes: [
982
+ {
983
+ method: "GET",
984
+ path: "/admin/billing/clients/{client_name}/connections",
985
+ surface: "admin"
986
+ },
987
+ {
988
+ method: "POST",
989
+ path: "/admin/billing/clients/{client_name}/connections",
990
+ surface: "admin"
991
+ },
992
+ {
993
+ method: "DELETE",
994
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}",
995
+ surface: "admin"
996
+ },
997
+ {
998
+ method: "GET",
999
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}",
1000
+ surface: "admin"
1001
+ },
1002
+ {
1003
+ method: "PATCH",
1004
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}",
1005
+ surface: "admin"
1006
+ },
1007
+ {
1008
+ method: "POST",
1009
+ path: "/admin/billing/clients/{client_name}/connections/{connection_id}/reconcile",
1010
+ surface: "admin"
1011
+ },
1012
+ {
1013
+ method: "GET",
1014
+ path: "/admin/billing/clients/{client_name}/webhook-events",
1015
+ surface: "admin"
1016
+ },
1017
+ {
1018
+ method: "POST",
1019
+ path: "/admin/billing/clients/{client_name}/webhook-sinks/provision",
1020
+ surface: "admin"
1021
+ },
1022
+ {
1023
+ method: "GET",
1024
+ path: "/admin/billing/grants",
1025
+ surface: "admin"
1026
+ },
1027
+ {
1028
+ method: "GET",
1029
+ path: "/admin/billing/providers",
1030
+ surface: "admin"
1031
+ },
1032
+ {
1033
+ method: "GET",
1034
+ path: "/admin/webhook-sinks/helpers/billing",
1035
+ surface: "admin"
1036
+ },
1037
+ {
1038
+ method: "POST",
1039
+ path: "/billing/providers/{provider}/clients/{client_name}/connections/{connection_id}/webhook",
1040
+ surface: "providerWebhook"
1041
+ },
1042
+ {
1043
+ method: "GET",
1044
+ path: "/billing/v1/capabilities",
1045
+ surface: "billingV1"
1046
+ },
1047
+ {
1048
+ method: "POST",
1049
+ path: "/billing/v1/checkouts",
1050
+ surface: "billingV1"
1051
+ },
1052
+ {
1053
+ method: "GET",
1054
+ path: "/billing/v1/customers",
1055
+ surface: "billingV1"
1056
+ },
1057
+ {
1058
+ method: "POST",
1059
+ path: "/billing/v1/customers",
1060
+ surface: "billingV1"
1061
+ },
1062
+ {
1063
+ method: "DELETE",
1064
+ path: "/billing/v1/customers/{id}",
1065
+ surface: "billingV1"
1066
+ },
1067
+ {
1068
+ method: "GET",
1069
+ path: "/billing/v1/customers/{id}",
1070
+ surface: "billingV1"
1071
+ },
1072
+ {
1073
+ method: "PATCH",
1074
+ path: "/billing/v1/customers/{id}",
1075
+ surface: "billingV1"
1076
+ },
1077
+ {
1078
+ method: "GET",
1079
+ path: "/billing/v1/invoices",
1080
+ surface: "billingV1"
1081
+ },
1082
+ {
1083
+ method: "GET",
1084
+ path: "/billing/v1/invoices/{id}",
1085
+ surface: "billingV1"
1086
+ },
1087
+ {
1088
+ method: "GET",
1089
+ path: "/billing/v1/payment-links",
1090
+ surface: "billingV1"
1091
+ },
1092
+ {
1093
+ method: "POST",
1094
+ path: "/billing/v1/payment-links",
1095
+ surface: "billingV1"
1096
+ },
1097
+ {
1098
+ method: "DELETE",
1099
+ path: "/billing/v1/payment-links/{id}",
1100
+ surface: "billingV1"
1101
+ },
1102
+ {
1103
+ method: "GET",
1104
+ path: "/billing/v1/payment-links/{id}",
1105
+ surface: "billingV1"
1106
+ },
1107
+ {
1108
+ method: "PATCH",
1109
+ path: "/billing/v1/payment-links/{id}",
1110
+ surface: "billingV1"
1111
+ },
1112
+ {
1113
+ method: "GET",
1114
+ path: "/billing/v1/payments",
1115
+ surface: "billingV1"
1116
+ },
1117
+ {
1118
+ method: "POST",
1119
+ path: "/billing/v1/payments",
1120
+ surface: "billingV1"
1121
+ },
1122
+ {
1123
+ method: "GET",
1124
+ path: "/billing/v1/payments/{id}",
1125
+ surface: "billingV1"
1126
+ },
1127
+ {
1128
+ method: "POST",
1129
+ path: "/billing/v1/payments/{id}/cancel",
1130
+ surface: "billingV1"
1131
+ },
1132
+ {
1133
+ method: "GET",
1134
+ path: "/billing/v1/refunds",
1135
+ surface: "billingV1"
1136
+ },
1137
+ {
1138
+ method: "POST",
1139
+ path: "/billing/v1/refunds",
1140
+ surface: "billingV1"
1141
+ },
1142
+ {
1143
+ method: "GET",
1144
+ path: "/billing/v1/refunds/{id}",
1145
+ surface: "billingV1"
1146
+ },
1147
+ {
1148
+ method: "POST",
1149
+ path: "/billing/v1/refunds/{id}/cancel",
1150
+ surface: "billingV1"
1151
+ },
1152
+ {
1153
+ method: "GET",
1154
+ path: "/billing/v1/subscriptions",
1155
+ surface: "billingV1"
1156
+ },
1157
+ {
1158
+ method: "POST",
1159
+ path: "/billing/v1/subscriptions",
1160
+ surface: "billingV1"
1161
+ },
1162
+ {
1163
+ method: "GET",
1164
+ path: "/billing/v1/subscriptions/{id}",
1165
+ surface: "billingV1"
1166
+ },
1167
+ {
1168
+ method: "PATCH",
1169
+ path: "/billing/v1/subscriptions/{id}",
1170
+ surface: "billingV1"
1171
+ },
1172
+ {
1173
+ method: "POST",
1174
+ path: "/billing/v1/subscriptions/{id}/cancel",
1175
+ surface: "billingV1"
1176
+ },
1177
+ {
1178
+ method: "GET",
1179
+ path: "/debug/billing",
1180
+ surface: "debug"
1181
+ }
1182
+ ],
1183
+ schemaVersion: 1,
1184
+ sourceOfTruth: "crates/athena-billing/src/live_http_routes.rs",
1185
+ sources: [
1186
+ "src/api/billing.rs",
1187
+ "src/api/billing_v1/**",
1188
+ "src/api/debug/billing.rs"
1189
+ ]
1190
+ };
1191
+
1192
+ export { AthenaBillingError, live_http_routes_default as billingLiveHttpRoutes, billingSdkManifest, createBillingModule };
1193
+ //# sourceMappingURL=billing.js.map
1194
+ //# sourceMappingURL=billing.js.map