@xylex-group/athena 3.0.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.
- package/README.md +24 -10
- package/dist/{athena-auth-url-oLux_57a.d.cts → athena-request-headers-C7Jy-c_D.d.ts} +85 -1
- package/dist/{athena-auth-url-oLux_57a.d.ts → athena-request-headers-DujFFyMU.d.cts} +85 -1
- package/dist/billing.cjs +133 -21
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +41 -1
- package/dist/billing.d.ts +41 -1
- package/dist/billing.js +133 -21
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +138 -45
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +9 -9
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +138 -45
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +130 -45
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +3 -3
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +130 -45
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +138 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +138 -45
- package/dist/index.js.map +1 -1
- package/dist/{model-form-BKetpu6Q.d.ts → model-form-Dh0sisdL.d.ts} +1 -1
- package/dist/{model-form-BEfCGB5b.d.cts → model-form-oOAJUVd4.d.cts} +1 -1
- package/dist/{module-CrrSmpML.d.cts → module-CB25egcO.d.cts} +17 -5
- package/dist/{module-8dSMcy0K.d.cts → module-C_ab-MM1.d.cts} +46 -12
- package/dist/{module-8dSMcy0K.d.ts → module-C_ab-MM1.d.ts} +46 -12
- package/dist/{module-Bef_MAPO.d.ts → module-CkUM6v58.d.ts} +17 -5
- package/dist/next/client.cjs +9817 -3
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.d.cts +26 -1
- package/dist/next/client.d.ts +26 -1
- package/dist/next/client.js +9788 -4
- package/dist/next/client.js.map +1 -1
- package/dist/next/server.cjs +10398 -42
- package/dist/next/server.cjs.map +1 -1
- package/dist/next/server.d.cts +39 -4
- package/dist/next/server.d.ts +39 -4
- package/dist/next/server.js +10339 -43
- package/dist/next/server.js.map +1 -1
- package/dist/{pipeline-BXFQbsUW.d.ts → pipeline-B8aN2EHe.d.ts} +1 -1
- package/dist/{pipeline-Dfsed4VD.d.cts → pipeline-D4W-Cc-A.d.cts} +1 -1
- package/dist/proxy-request-headers-DGxdoyA0.d.cts +59 -0
- package/dist/proxy-request-headers-m4D2Tduy.d.ts +59 -0
- package/dist/react.cjs +7 -7
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +7 -7
- package/dist/react.js.map +1 -1
- package/dist/social-providers.cjs +15 -11
- package/dist/social-providers.cjs.map +1 -1
- package/dist/social-providers.d.cts +17 -57
- package/dist/social-providers.d.ts +17 -57
- package/dist/social-providers.js +15 -11
- package/dist/social-providers.js.map +1 -1
- package/dist/{types-jClgDy1J.d.ts → types-B75PdABb.d.ts} +1 -1
- package/dist/{types-Z3-rsiM3.d.cts → types-BBm-kEBL.d.cts} +1 -1
- package/dist/{types-CK7cBQbC.d.ts → types-BaAMXCqK.d.ts} +1 -1
- package/dist/{types-kO_Ut5wU.d.cts → types-CgCv5o6R.d.cts} +1 -1
- package/dist/utils.d.cts +4 -142
- package/dist/utils.d.ts +4 -142
- package/dist/{v3-client-G8JMOilK.d.cts → v3-client-CWfZHcKL.d.cts} +37 -21
- package/dist/{v3-client-CuCNy-JJ.d.ts → v3-client-DZp2NEhK.d.ts} +37 -21
- package/package.json +6 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-
|
|
1
|
+
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-BaAMXCqK.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-
|
|
1
|
+
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-BBm-kEBL.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { I as EnvLike } from './athena-request-headers-DujFFyMU.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Request header / Next.js helpers used by middleware and RSC session loaders.
|
|
5
|
+
* Framework-agnostic (no Next imports).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* True when Next.js threw because the route used dynamic APIs during static
|
|
9
|
+
* generation (`DYNAMIC_SERVER_USAGE` digest or matching message).
|
|
10
|
+
*
|
|
11
|
+
* Catch and rethrow (or handle) so Next can mark the route dynamic.
|
|
12
|
+
*/
|
|
13
|
+
declare function isDynamicServerUsageError(error: unknown): boolean;
|
|
14
|
+
interface GetOriginFromHeadersOptions {
|
|
15
|
+
/**
|
|
16
|
+
* When `x-forwarded-proto` / scheme is missing, use `http` if true else `https`.
|
|
17
|
+
* Typical: `process.env.NODE_ENV !== "production"`.
|
|
18
|
+
*/
|
|
19
|
+
preferHttpWhenMissingProto?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reconstruct public origin from request headers (Origin, or Host + proto).
|
|
23
|
+
*
|
|
24
|
+
* Prefers `Origin`, then `x-forwarded-host` / `host` with
|
|
25
|
+
* `x-forwarded-proto` (first value when comma-separated).
|
|
26
|
+
*/
|
|
27
|
+
declare function getOriginFromHeaders(headersList: {
|
|
28
|
+
get: (name: string) => string | null;
|
|
29
|
+
}, options?: GetOriginFromHeadersOptions): string | null;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Read the first non-empty trimmed environment variable from a name list.
|
|
33
|
+
*
|
|
34
|
+
* @param names - Candidate env keys in priority order
|
|
35
|
+
* @param env - Optional env map (defaults to `process.env`)
|
|
36
|
+
* @returns Trimmed value of the first key that is set and non-empty
|
|
37
|
+
* @throws {Error} When none of the keys yield a non-empty value
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { requireEnv } from "@xylex-group/athena/utils"
|
|
42
|
+
*
|
|
43
|
+
* const authUrl = requireEnv([
|
|
44
|
+
* "ATHENA_AUTH_UPSTREAM_URL",
|
|
45
|
+
* "ATHENA_AUTH_URL",
|
|
46
|
+
* "NEXT_PUBLIC_ATHENA_AUTH_URL",
|
|
47
|
+
* ])
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare function requireEnv(names: readonly string[], env?: EnvLike): string;
|
|
51
|
+
/**
|
|
52
|
+
* Like {@link requireEnv}, but returns `undefined` instead of throwing when
|
|
53
|
+
* none of the keys are set.
|
|
54
|
+
*/
|
|
55
|
+
declare function readEnv(names: readonly string[], env?: EnvLike): string | undefined;
|
|
56
|
+
|
|
57
|
+
declare function proxyRequestHeaders(request: Request): Headers;
|
|
58
|
+
|
|
59
|
+
export { type GetOriginFromHeadersOptions as G, requireEnv as a, getOriginFromHeaders as g, isDynamicServerUsageError as i, proxyRequestHeaders as p, readEnv as r };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { I as EnvLike } from './athena-request-headers-C7Jy-c_D.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Request header / Next.js helpers used by middleware and RSC session loaders.
|
|
5
|
+
* Framework-agnostic (no Next imports).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* True when Next.js threw because the route used dynamic APIs during static
|
|
9
|
+
* generation (`DYNAMIC_SERVER_USAGE` digest or matching message).
|
|
10
|
+
*
|
|
11
|
+
* Catch and rethrow (or handle) so Next can mark the route dynamic.
|
|
12
|
+
*/
|
|
13
|
+
declare function isDynamicServerUsageError(error: unknown): boolean;
|
|
14
|
+
interface GetOriginFromHeadersOptions {
|
|
15
|
+
/**
|
|
16
|
+
* When `x-forwarded-proto` / scheme is missing, use `http` if true else `https`.
|
|
17
|
+
* Typical: `process.env.NODE_ENV !== "production"`.
|
|
18
|
+
*/
|
|
19
|
+
preferHttpWhenMissingProto?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reconstruct public origin from request headers (Origin, or Host + proto).
|
|
23
|
+
*
|
|
24
|
+
* Prefers `Origin`, then `x-forwarded-host` / `host` with
|
|
25
|
+
* `x-forwarded-proto` (first value when comma-separated).
|
|
26
|
+
*/
|
|
27
|
+
declare function getOriginFromHeaders(headersList: {
|
|
28
|
+
get: (name: string) => string | null;
|
|
29
|
+
}, options?: GetOriginFromHeadersOptions): string | null;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Read the first non-empty trimmed environment variable from a name list.
|
|
33
|
+
*
|
|
34
|
+
* @param names - Candidate env keys in priority order
|
|
35
|
+
* @param env - Optional env map (defaults to `process.env`)
|
|
36
|
+
* @returns Trimmed value of the first key that is set and non-empty
|
|
37
|
+
* @throws {Error} When none of the keys yield a non-empty value
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { requireEnv } from "@xylex-group/athena/utils"
|
|
42
|
+
*
|
|
43
|
+
* const authUrl = requireEnv([
|
|
44
|
+
* "ATHENA_AUTH_UPSTREAM_URL",
|
|
45
|
+
* "ATHENA_AUTH_URL",
|
|
46
|
+
* "NEXT_PUBLIC_ATHENA_AUTH_URL",
|
|
47
|
+
* ])
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare function requireEnv(names: readonly string[], env?: EnvLike): string;
|
|
51
|
+
/**
|
|
52
|
+
* Like {@link requireEnv}, but returns `undefined` instead of throwing when
|
|
53
|
+
* none of the keys are set.
|
|
54
|
+
*/
|
|
55
|
+
declare function readEnv(names: readonly string[], env?: EnvLike): string | undefined;
|
|
56
|
+
|
|
57
|
+
declare function proxyRequestHeaders(request: Request): Headers;
|
|
58
|
+
|
|
59
|
+
export { type GetOriginFromHeadersOptions as G, requireEnv as a, getOriginFromHeaders as g, isDynamicServerUsageError as i, proxyRequestHeaders as p, readEnv as r };
|
package/dist/react.cjs
CHANGED
|
@@ -86,7 +86,7 @@ function isAthenaGatewayError(error) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
// src/gateway/url.ts
|
|
89
|
-
var ATHENA_DEFAULT_BASE_URL = "https://athena-
|
|
89
|
+
var ATHENA_DEFAULT_BASE_URL = "https://mirror2.athena-cluster.com";
|
|
90
90
|
function describeReceivedValue(value) {
|
|
91
91
|
if (value === void 0) return "undefined";
|
|
92
92
|
if (value === null) return "null";
|
|
@@ -109,14 +109,14 @@ function normalizeAthenaGatewayBaseUrl(input, options = {}) {
|
|
|
109
109
|
if (candidate === void 0 || candidate === null) {
|
|
110
110
|
throw invalidBaseUrlError(
|
|
111
111
|
`${label} must be a non-empty absolute http(s) URL. Received ${describeReceivedValue(input)}.`,
|
|
112
|
-
'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://
|
|
112
|
+
'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://mirror2.athena-cluster.com".'
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
const trimmed = candidate.trim();
|
|
116
116
|
if (!trimmed) {
|
|
117
117
|
throw invalidBaseUrlError(
|
|
118
118
|
`${label} must be a non-empty absolute http(s) URL. Received ${describeReceivedValue(candidate)}.`,
|
|
119
|
-
'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://
|
|
119
|
+
'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://mirror2.athena-cluster.com".'
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
let parsed;
|
|
@@ -125,13 +125,13 @@ function normalizeAthenaGatewayBaseUrl(input, options = {}) {
|
|
|
125
125
|
} catch {
|
|
126
126
|
throw invalidBaseUrlError(
|
|
127
127
|
`${label} must be a valid absolute http(s) URL. Received ${describeReceivedValue(candidate)}.`,
|
|
128
|
-
'Use a full URL including the protocol, for example "https://
|
|
128
|
+
'Use a full URL including the protocol, for example "https://mirror2.athena-cluster.com".'
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
132
132
|
throw invalidBaseUrlError(
|
|
133
133
|
`${label} must use http or https. Received ${JSON.stringify(trimmed)}.`,
|
|
134
|
-
'Use an Athena gateway URL such as "https://
|
|
134
|
+
'Use an Athena gateway URL such as "https://mirror2.athena-cluster.com".'
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
137
|
if (parsed.search || parsed.hash) {
|
|
@@ -413,7 +413,7 @@ function buildAthenaRequestHeaders(input) {
|
|
|
413
413
|
|
|
414
414
|
// package.json
|
|
415
415
|
var package_default = {
|
|
416
|
-
version: "3.0.
|
|
416
|
+
version: "3.0.2"
|
|
417
417
|
};
|
|
418
418
|
|
|
419
419
|
// src/sdk-version.ts
|
|
@@ -423,7 +423,7 @@ function buildSdkHeaderValue(sdkName) {
|
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
// src/gateway/client.ts
|
|
426
|
-
var DEFAULT_CLIENT = "
|
|
426
|
+
var DEFAULT_CLIENT = "DEFAULT_CLIENT";
|
|
427
427
|
var SDK_NAME = "xylex-group/athena";
|
|
428
428
|
var SDK_HEADER_VALUE = buildSdkHeaderValue(SDK_NAME);
|
|
429
429
|
function parseResponseBody(rawText, contentType) {
|