@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
@@ -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 { s as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-B75PdABb.js';
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.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 { s as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-CgCv5o6R.cjs';
3
3
 
4
4
  interface AthenaGatewayErrorInput {
5
5
  code: AthenaGatewayErrorCode;
@@ -1,11 +1,22 @@
1
- import { o as SchemaDef, r as AnyModelDef, D as DatabaseDef, k as ModelMetadata, j as ModelDef, R as RegistryDef, h as ModelColumnKind, q as TenantKeyMap, T as TenantContext, A as AthenaModelTarget, n as RowOf, a as InsertOf, U as UpdateOf, M as ModelAt, S as SchemaIntrospectionProvider, b as IntrospectionColumn, I as IntrospectionSnapshot } from './types-6H575ITc.cjs';
2
- import { b as ModelFormNullishMode, c as ModelFormValues } from './model-form-BE1_Bmdd.cjs';
1
+ import { o as SchemaDef, s as AnyModelDef, D as DatabaseDef, k as ModelMetadata, j as ModelDef, R as RegistryDef, h as ModelColumnKind, S as SchemaIntrospectionProvider, b as IntrospectionColumn, I as IntrospectionSnapshot } from './types-CgCv5o6R.cjs';
2
+ import { b as ModelFormNullishMode, c as ModelFormValues } from './model-form-oOAJUVd4.cjs';
3
3
  import { ZodType } from 'zod';
4
- import { aV as AthenaSdkClient, d5 as TableQueryBuilder, aH as AthenaFromOptions, ae as AthenaClientContextOptions, al as AthenaClientSessionLike, am as AthenaClientSessionOptions, an as AthenaCreateClientAuthOptions, af as AthenaClientExperimentalOptions, o as AthenaChatMessageCreatedResponse, n as AthenaChatMessage, C as AthenaChatRoomCreatedResponse, B as AthenaChatRoom } from './client-wU2J9yqb.cjs';
5
- import { a as AthenaGatewayCallOptions } from './types-YQUR7wu0.cjs';
6
- import { o as GeneratorSchemaSelection, b as GeneratorProviderConfig, r as NormalizedGeneratorFilterConfig, p as GeneratorTableSelection } from './types-dHnjluBC.cjs';
7
- import { F as AthenaAuthClientConfig, ac as AthenaAuthSdkClient, aS as AuthSocialProvider, a4 as AthenaAuthReactEmailProps, a1 as AthenaAuthReactEmailComponent, a6 as AthenaAuthReactEmailRenderInput, L as AthenaAuthEmailTemplateDefinition, J as AthenaAuthEmailTemplateBuilder, a7 as AthenaAuthReactEmailRenderOptions, a5 as AthenaAuthReactEmailRenderEvent, a2 as AthenaAuthReactEmailConfig } from './types-eAKAh71s.cjs';
4
+ import { o as GeneratorSchemaSelection, b as GeneratorProviderConfig, r as NormalizedGeneratorFilterConfig, p as GeneratorTableSelection } from './types-BBm-kEBL.cjs';
8
5
  import { A as AthenaCookiesOptions, a as AthenaSessionPair, b as AthenaCookieOptions, c as AthenaAuthCookies, g as getCookieCache, d as getSessionCookie, e as AthenaCookieContextRuntime } from './index-CFL9xbFR.cjs';
6
+ import { aQ as AuthSocialProvider, a4 as AthenaAuthReactEmailProps, a1 as AthenaAuthReactEmailComponent, a6 as AthenaAuthReactEmailRenderInput, L as AthenaAuthEmailTemplateDefinition, J as AthenaAuthEmailTemplateBuilder, a7 as AthenaAuthReactEmailRenderOptions, a5 as AthenaAuthReactEmailRenderEvent, a2 as AthenaAuthReactEmailConfig } from './types-AOY-GLu8.cjs';
7
+ import { r as AthenaChatMessageCreatedResponse, q as AthenaChatMessage, F as AthenaChatRoomCreatedResponse, E as AthenaChatRoom } from './v3-client-CWfZHcKL.cjs';
8
+
9
+ type AthenaService = 'db' | 'auth' | 'chat' | 'storage' | 'billing';
10
+ type AthenaConfigurationErrorCode = 'ATHENA_NO_SERVICE_CONFIGURED' | 'ATHENA_SERVICE_NOT_CONFIGURED' | 'ATHENA_API_KEY_REQUIRED' | 'ATHENA_INVALID_URL' | 'ATHENA_NEXT_SERVER_RUNTIME_REQUIRED';
11
+ /**
12
+ * Structured configuration failure raised during client construction or
13
+ * unavailable-service access. Distinct from transport/auth/gateway errors.
14
+ */
15
+ declare class AthenaConfigurationError extends Error {
16
+ readonly code: AthenaConfigurationErrorCode;
17
+ readonly service?: AthenaService;
18
+ constructor(code: AthenaConfigurationErrorCode, message: string, service?: AthenaService);
19
+ }
9
20
 
10
21
  interface NormalizeAthenaGatewayBaseUrlOptions {
11
22
  defaultBaseUrl?: string;
@@ -156,46 +167,6 @@ interface AthenaTableColumnsBuilder<TName extends string, TMappedName extends st
156
167
  }
157
168
  declare function table<TName extends string>(name: TName): AthenaTableBuilder<TName, undefined>;
158
169
 
159
- type RegistryConstraint = RegistryDef<Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>;
160
- /**
161
- * Options for creating typed Athena clients.
162
- */
163
- interface TypedClientOptions<TMap extends TenantKeyMap = TenantKeyMap> extends Pick<AthenaGatewayCallOptions, 'backend' | 'client' | 'headers' | 'forceNoCache' | 'userId' | 'organizationId'> {
164
- auth?: Omit<AthenaCreateClientAuthOptions, 'url' | 'baseUrl' | 'apiKey'>;
165
- tenantKeyMap?: TMap;
166
- tenantContext?: TenantContext<TMap>;
167
- experimental?: AthenaClientExperimentalOptions;
168
- }
169
- interface TypedClientOptionsWithTypecheckedColumns<TMap extends TenantKeyMap = TenantKeyMap> extends TypedClientOptions<TMap> {
170
- experimental: AthenaClientExperimentalOptions & {
171
- typecheckColumns: true;
172
- };
173
- }
174
- /**
175
- * Typed Athena client with registry-driven model resolution and tenant-context propagation.
176
- */
177
- interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>, TStrict extends boolean = false> extends Omit<AthenaSdkClient<TStrict>, 'from' | 'withContext' | 'withSession'> {
178
- readonly registry: TRegistry;
179
- readonly tenantKeyMap: Readonly<TTenantMap>;
180
- readonly tenantContext: TenantContext<TTenantMap>;
181
- from<TModel extends AthenaModelTarget>(model: TModel): TableQueryBuilder<RowOf<TModel>, InsertOf<TModel>, UpdateOf<TModel>, unknown, TStrict>;
182
- from<Row = Record<string, unknown>, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update, unknown, TStrict>;
183
- withContext(context?: AthenaClientContextOptions): TypedAthenaClient<TRegistry, TTenantMap, TStrict>;
184
- withSession(session?: AthenaClientSessionLike | null, options?: AthenaClientSessionOptions): TypedAthenaClient<TRegistry, TTenantMap, TStrict>;
185
- withTenantContext(context: TenantContext<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap, TStrict>;
186
- fromModel<TDatabase extends keyof TRegistry & string, TSchema extends keyof TRegistry[TDatabase]['schemas'] & string, TModel extends keyof TRegistry[TDatabase]['schemas'][TSchema]['models'] & string>(database: TDatabase, schema: TSchema, model: TModel): TableQueryBuilder<RowOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, InsertOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, UpdateOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, {
187
- registry: TRegistry;
188
- database: TDatabase;
189
- schema: TSchema;
190
- model: ModelAt<TRegistry, TDatabase, TSchema, TModel>;
191
- }, TStrict>;
192
- }
193
- /**
194
- * Creates a typed client bound to a registry contract and optional tenant header mapping.
195
- */
196
- declare function createTypedClient<TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>>(registry: TRegistry, url: string, apiKey: string, options: TypedClientOptionsWithTypecheckedColumns<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap, true>;
197
- declare function createTypedClient<TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>>(registry: TRegistry, url: string, apiKey: string, options?: TypedClientOptions<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap, false>;
198
-
199
170
  /**
200
171
  * Constructor options for the PostgreSQL introspection provider.
201
172
  */
@@ -265,11 +236,6 @@ declare function resolveProviderSchemas(providerConfig: GeneratorProviderConfig)
265
236
  declare function normalizeTableSelection(value: GeneratorTableSelection | undefined): string[];
266
237
  declare function filterIntrospectionSnapshot(snapshot: IntrospectionSnapshot, filter: NormalizedGeneratorFilterConfig): IntrospectionSnapshot;
267
238
 
268
- /**
269
- * @deprecated Prefer `createClient(...).auth` from `@xylex-group/athena`.
270
- */
271
- declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
272
-
273
239
  interface AthenaAuthAdminLimits {
274
240
  maxAdminJsonBytes: number;
275
241
  maxAdminJsonDepth: number;
@@ -541,4 +507,4 @@ declare const chatSdkManifest: {
541
507
  declare function unwrapChatRoom(payload: AthenaChatRoomCreatedResponse): AthenaChatRoom;
542
508
  declare function unwrapChatMessage(payload: AthenaChatMessageCreatedResponse): AthenaChatMessage;
543
509
 
544
- export { type AthenaAuthDatabaseFactory as $, ATHENA_AUTH_ADMIN_LIMITS as A, filterIntrospectionSnapshot as B, type ColumnRuntimeConfig as C, DEFAULT_POSTGRES_SCHEMAS as D, generatorEnv as E, type FormValuesFromColumns as F, identifier as G, json as H, type InsertFromColumns as I, normalizeAthenaGatewayBaseUrl as J, normalizeSchemaSelection as K, normalizeTableSelection as L, number as M, renderAthenaReactEmail as N, resolvePostgresColumnType as O, type PostgresIntrospectionProviderOptions as P, resolveProviderSchemas as Q, type RowFromColumns as R, string as S, type TypedAthenaClient as T, type UpdateFromColumns as U, table as V, unwrapChatMessage as W, unwrapChatRoom as X, type AthenaAuthBaseURLConfig as Y, type AthenaAuthContext as Z, type AthenaAuthCookieRuntimeInput as _, ATHENA_AUTH_BASE_ERROR_CODES as a, type AthenaAuthHandlerResult as a0, type AthenaAuthPlugin as a1, type AthenaAuthPluginContext as a2, type AthenaAuthPluginHandlerContext as a3, type AthenaAuthRequestContext as a4, type AthenaAuthServer as a5, type AthenaAuthServerApi as a6, type AthenaAuthServerConfig as a7, type AthenaAuthServerRuntimeOptions as a8, type AthenaAuthSocialProviderConfig as a9, type AthenaAuthTrustedOrigins as aa, type AthenaAuthTrustedProviders as ab, type GeneratorEnvBooleanOptions as ac, type GeneratorEnvJsonOptions as ad, type GeneratorEnvListOptions as ae, type GeneratorEnvOneOfOptions as af, type GeneratorEnvStringOptions as ag, createPostgresIntrospectionProvider as ah, ATHENA_AUTH_MAX_ADMIN_JSON_BYTES as b, ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH as c, ATHENA_AUTH_MAX_TEMPLATE_VARIABLES as d, ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH as e, type AnyColumnBuilder as f, type AthenaAuthAdminLimits as g, AthenaChatError as h, type AthenaColumnBuilder as i, type AthenaTableDef as j, type AthenaTableSchemaBundle as k, type TypedClientOptions as l, type TypedClientOptionsWithTypecheckedColumns as m, athenaAuth as n, boolean as o, chatSdkManifest as p, createAuthClient as q, createAuthReactEmailInput as r, createTypedClient as s, defineAthenaAuthConfig as t, defineAuthEmailTemplate as u, defineDatabase as v, defineModel as w, defineRegistry as x, defineSchema as y, enumeration as z };
510
+ export { type AthenaAuthPlugin as $, ATHENA_AUTH_ADMIN_LIMITS as A, generatorEnv as B, type ColumnRuntimeConfig as C, DEFAULT_POSTGRES_SCHEMAS as D, identifier as E, type FormValuesFromColumns as F, json as G, normalizeAthenaGatewayBaseUrl as H, type InsertFromColumns as I, normalizeSchemaSelection as J, normalizeTableSelection as K, number as L, renderAthenaReactEmail as M, resolvePostgresColumnType as N, resolveProviderSchemas as O, type PostgresIntrospectionProviderOptions as P, string as Q, type RowFromColumns as R, table as S, unwrapChatMessage as T, type UpdateFromColumns as U, unwrapChatRoom as V, type AthenaAuthBaseURLConfig as W, type AthenaAuthContext as X, type AthenaAuthCookieRuntimeInput as Y, type AthenaAuthDatabaseFactory as Z, type AthenaAuthHandlerResult as _, ATHENA_AUTH_BASE_ERROR_CODES as a, type AthenaAuthPluginContext as a0, type AthenaAuthPluginHandlerContext as a1, type AthenaAuthRequestContext as a2, type AthenaAuthServer as a3, type AthenaAuthServerApi as a4, type AthenaAuthServerConfig as a5, type AthenaAuthServerRuntimeOptions as a6, type AthenaAuthSocialProviderConfig as a7, type AthenaAuthTrustedOrigins as a8, type AthenaAuthTrustedProviders as a9, type GeneratorEnvBooleanOptions as aa, type GeneratorEnvJsonOptions as ab, type GeneratorEnvListOptions as ac, type GeneratorEnvOneOfOptions as ad, type GeneratorEnvStringOptions as ae, createPostgresIntrospectionProvider as af, ATHENA_AUTH_MAX_ADMIN_JSON_BYTES as b, ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH as c, ATHENA_AUTH_MAX_TEMPLATE_VARIABLES as d, ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH as e, type AnyColumnBuilder as f, type AthenaAuthAdminLimits as g, AthenaChatError as h, type AthenaColumnBuilder as i, AthenaConfigurationError as j, type AthenaConfigurationErrorCode as k, type AthenaService as l, type AthenaTableDef as m, type AthenaTableSchemaBundle as n, athenaAuth as o, boolean as p, chatSdkManifest as q, createAuthReactEmailInput as r, defineAthenaAuthConfig as s, defineAuthEmailTemplate as t, defineDatabase as u, defineModel as v, defineRegistry as w, defineSchema as x, enumeration as y, filterIntrospectionSnapshot as z };
@@ -0,0 +1,360 @@
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: "listProducts";
113
+ readonly method: "GET";
114
+ readonly path: "/billing/v1/products";
115
+ }, {
116
+ readonly name: "listPrices";
117
+ readonly method: "GET";
118
+ readonly path: "/billing/v1/prices";
119
+ }, {
120
+ readonly name: "listCustomers";
121
+ readonly method: "GET";
122
+ readonly path: "/billing/v1/customers";
123
+ }, {
124
+ readonly name: "createCustomer";
125
+ readonly method: "POST";
126
+ readonly path: "/billing/v1/customers";
127
+ }, {
128
+ readonly name: "getCustomer";
129
+ readonly method: "GET";
130
+ readonly path: "/billing/v1/customers/{id}";
131
+ }, {
132
+ readonly name: "updateCustomer";
133
+ readonly method: "PATCH";
134
+ readonly path: "/billing/v1/customers/{id}";
135
+ }, {
136
+ readonly name: "deleteCustomer";
137
+ readonly method: "DELETE";
138
+ readonly path: "/billing/v1/customers/{id}";
139
+ }, {
140
+ readonly name: "listPayments";
141
+ readonly method: "GET";
142
+ readonly path: "/billing/v1/payments";
143
+ }, {
144
+ readonly name: "createPayment";
145
+ readonly method: "POST";
146
+ readonly path: "/billing/v1/payments";
147
+ }, {
148
+ readonly name: "getPayment";
149
+ readonly method: "GET";
150
+ readonly path: "/billing/v1/payments/{id}";
151
+ }, {
152
+ readonly name: "cancelPayment";
153
+ readonly method: "POST";
154
+ readonly path: "/billing/v1/payments/{id}/cancel";
155
+ }, {
156
+ readonly name: "listPaymentLinks";
157
+ readonly method: "GET";
158
+ readonly path: "/billing/v1/payment-links";
159
+ }, {
160
+ readonly name: "createPaymentLink";
161
+ readonly method: "POST";
162
+ readonly path: "/billing/v1/payment-links";
163
+ }, {
164
+ readonly name: "getPaymentLink";
165
+ readonly method: "GET";
166
+ readonly path: "/billing/v1/payment-links/{id}";
167
+ }, {
168
+ readonly name: "updatePaymentLink";
169
+ readonly method: "PATCH";
170
+ readonly path: "/billing/v1/payment-links/{id}";
171
+ }, {
172
+ readonly name: "deletePaymentLink";
173
+ readonly method: "DELETE";
174
+ readonly path: "/billing/v1/payment-links/{id}";
175
+ }, {
176
+ readonly name: "listRefunds";
177
+ readonly method: "GET";
178
+ readonly path: "/billing/v1/refunds";
179
+ }, {
180
+ readonly name: "createRefund";
181
+ readonly method: "POST";
182
+ readonly path: "/billing/v1/refunds";
183
+ }, {
184
+ readonly name: "getRefund";
185
+ readonly method: "GET";
186
+ readonly path: "/billing/v1/refunds/{id}";
187
+ }, {
188
+ readonly name: "cancelRefund";
189
+ readonly method: "POST";
190
+ readonly path: "/billing/v1/refunds/{id}/cancel";
191
+ }, {
192
+ readonly name: "listSubscriptions";
193
+ readonly method: "GET";
194
+ readonly path: "/billing/v1/subscriptions";
195
+ }, {
196
+ readonly name: "createSubscription";
197
+ readonly method: "POST";
198
+ readonly path: "/billing/v1/subscriptions";
199
+ }, {
200
+ readonly name: "getSubscription";
201
+ readonly method: "GET";
202
+ readonly path: "/billing/v1/subscriptions/{id}";
203
+ }, {
204
+ readonly name: "updateSubscription";
205
+ readonly method: "PATCH";
206
+ readonly path: "/billing/v1/subscriptions/{id}";
207
+ }, {
208
+ readonly name: "cancelSubscription";
209
+ readonly method: "POST";
210
+ readonly path: "/billing/v1/subscriptions/{id}/cancel";
211
+ }, {
212
+ readonly name: "listInvoices";
213
+ readonly method: "GET";
214
+ readonly path: "/billing/v1/invoices";
215
+ }, {
216
+ readonly name: "getInvoice";
217
+ readonly method: "GET";
218
+ readonly path: "/billing/v1/invoices/{id}";
219
+ }, {
220
+ readonly name: "listWebhooks";
221
+ readonly method: "GET";
222
+ readonly path: "/billing/v1/webhooks";
223
+ }, {
224
+ readonly name: "createWebhook";
225
+ readonly method: "POST";
226
+ readonly path: "/billing/v1/webhooks";
227
+ }, {
228
+ readonly name: "getWebhook";
229
+ readonly method: "GET";
230
+ readonly path: "/billing/v1/webhooks/{id}";
231
+ }, {
232
+ readonly name: "updateWebhook";
233
+ readonly method: "PATCH";
234
+ readonly path: "/billing/v1/webhooks/{id}";
235
+ }, {
236
+ readonly name: "deleteWebhook";
237
+ readonly method: "DELETE";
238
+ readonly path: "/billing/v1/webhooks/{id}";
239
+ }, {
240
+ readonly name: "testWebhook";
241
+ readonly method: "POST";
242
+ readonly path: "/billing/v1/webhooks/{id}/test";
243
+ }, {
244
+ readonly name: "listConnections";
245
+ readonly method: "GET";
246
+ readonly path: "/admin/billing/clients/{client_name}/connections";
247
+ }, {
248
+ readonly name: "createConnection";
249
+ readonly method: "POST";
250
+ readonly path: "/admin/billing/clients/{client_name}/connections";
251
+ }, {
252
+ readonly name: "getConnection";
253
+ readonly method: "GET";
254
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
255
+ }, {
256
+ readonly name: "updateConnection";
257
+ readonly method: "PATCH";
258
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
259
+ }, {
260
+ readonly name: "deleteConnection";
261
+ readonly method: "DELETE";
262
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}";
263
+ }, {
264
+ readonly name: "reconcileDocument";
265
+ readonly method: "POST";
266
+ readonly path: "/admin/billing/clients/{client_name}/connections/{connection_id}/reconcile";
267
+ }, {
268
+ readonly name: "listWebhookEvents";
269
+ readonly method: "GET";
270
+ readonly path: "/admin/billing/clients/{client_name}/webhook-events";
271
+ }, {
272
+ readonly name: "provisionWebhookSinks";
273
+ readonly method: "POST";
274
+ readonly path: "/admin/billing/clients/{client_name}/webhook-sinks/provision";
275
+ }, {
276
+ readonly name: "listGrants";
277
+ readonly method: "GET";
278
+ readonly path: "/admin/billing/grants";
279
+ }, {
280
+ readonly name: "listProviders";
281
+ readonly method: "GET";
282
+ readonly path: "/admin/billing/providers";
283
+ }, {
284
+ readonly name: "listSinkHelpers";
285
+ readonly method: "GET";
286
+ readonly path: "/admin/webhook-sinks/helpers/billing";
287
+ }, {
288
+ readonly name: "ingestProviderWebhook";
289
+ readonly method: "POST";
290
+ readonly path: "/billing/providers/{provider}/clients/{client_name}/connections/{connection_id}/webhook";
291
+ }, {
292
+ readonly name: "getDebugBilling";
293
+ readonly method: "GET";
294
+ readonly path: "/debug/billing";
295
+ }];
296
+ };
297
+ interface AthenaBillingModule {
298
+ getCapabilities(input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
299
+ createCheckout(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
300
+ listProducts(input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
301
+ listPrices(input: BillingConnectionRefInput & {
302
+ productId?: string;
303
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
304
+ listCustomers(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
305
+ createCustomer(input: BillingEnsureCustomerInput, options?: AthenaBillingCallOptions): Promise<unknown>;
306
+ getCustomer(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
307
+ updateCustomer(id: string, input: BillingUpdateCustomerInput, options?: AthenaBillingCallOptions): Promise<unknown>;
308
+ deleteCustomer(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
309
+ listPayments(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
310
+ createPayment(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
311
+ getPayment(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
312
+ cancelPayment(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
313
+ listPaymentLinks(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
314
+ createPaymentLink(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
315
+ getPaymentLink(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
316
+ updatePaymentLink(id: string, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
317
+ deletePaymentLink(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
318
+ listRefunds(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
319
+ createRefund(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
320
+ getRefund(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
321
+ cancelRefund(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
322
+ listSubscriptions(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
323
+ createSubscription(body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
324
+ getSubscription(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
325
+ updateSubscription(id: string, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
326
+ cancelSubscription(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
327
+ listInvoices(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
328
+ getInvoice(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
329
+ listWebhooks(input: BillingListQuery, options?: AthenaBillingCallOptions): Promise<unknown>;
330
+ createWebhook(input: BillingConnectionRefInput, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
331
+ getWebhook(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
332
+ updateWebhook(id: string, input: BillingConnectionRefInput, body: Record<string, unknown>, options?: AthenaBillingCallOptions): Promise<unknown>;
333
+ deleteWebhook(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
334
+ testWebhook(id: string, input: BillingConnectionRefInput, options?: AthenaBillingCallOptions): Promise<unknown>;
335
+ listConnections(clientName: string, options?: AthenaBillingCallOptions): Promise<unknown>;
336
+ createConnection(clientName: string, input: BillingCreateConnectionInput, options?: AthenaBillingCallOptions): Promise<unknown>;
337
+ getConnection(clientName: string, connectionId: string, options?: AthenaBillingCallOptions): Promise<unknown>;
338
+ updateConnection(clientName: string, connectionId: string, input: BillingUpdateConnectionInput, options?: AthenaBillingCallOptions): Promise<unknown>;
339
+ deleteConnection(clientName: string, connectionId: string, options?: AthenaBillingCallOptions): Promise<unknown>;
340
+ reconcileDocument(clientName: string, connectionId: string, input: BillingReconcileInput, options?: AthenaBillingCallOptions): Promise<unknown>;
341
+ listWebhookEvents(clientName: string, options?: AthenaBillingCallOptions): Promise<unknown>;
342
+ provisionWebhookSinks(clientName: string, input?: BillingProvisionSinksInput, options?: AthenaBillingCallOptions): Promise<unknown>;
343
+ listGrants(options?: AthenaBillingCallOptions): Promise<unknown>;
344
+ listProviders(options?: AthenaBillingCallOptions): Promise<unknown>;
345
+ listSinkHelpers(query?: {
346
+ targetSchema?: string;
347
+ instance?: string;
348
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
349
+ ingestProviderWebhook(input: {
350
+ provider: string;
351
+ clientName: string;
352
+ connectionId: string;
353
+ body: BodyInit | Record<string, unknown> | string;
354
+ signatureHeaders?: Record<string, string>;
355
+ }, options?: AthenaBillingCallOptions): Promise<unknown>;
356
+ getDebugBilling(jwtSecret: string, options?: AthenaBillingCallOptions): Promise<string>;
357
+ }
358
+ declare function createBillingModule(config: AthenaBillingClientConfig): AthenaBillingModule;
359
+
360
+ 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 };