@xylex-group/athena 2.14.0 → 3.0.2

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