@theholocron/http-client 1.58.0-alpha.8 → 1.58.0-alpha.9
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 +2 -0
- package/dist/index.d.mts +18 -3
- package/dist/index.mjs +8 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -93,6 +93,8 @@ It is per process, not per client, so nothing has to be handed to each client. I
|
|
|
93
93
|
|
|
94
94
|
### `createResolveToken(config)`
|
|
95
95
|
|
|
96
|
+
> **Deprecated.** The token resolver, `AuthError` and the input types now live in `@theholocron/kyber/secrets`, which has no dependency on a client library; this copy stays until the next major release.
|
|
97
|
+
|
|
96
98
|
Factory for the standard token resolution used by all holocron plugins. Resolution order:
|
|
97
99
|
|
|
98
100
|
1. `cliToken` — value from `--token` CLI flag
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { ErrorSink, Logger } from "@theholocron/observability/core";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Thrown by a token resolver when no token was found in any source.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated Moved to `AuthError` in `@theholocron/kyber/secrets`; this copy will be removed in the next major.
|
|
6
|
+
*/
|
|
3
7
|
export declare class AuthError extends Error {
|
|
4
8
|
/** The error name, `AuthError`. */
|
|
5
9
|
name: string;
|
|
6
10
|
}
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Where `resolveToken` looks for a token.
|
|
13
|
+
*
|
|
14
|
+
* @deprecated Moved to `ResolveTokenInput` in `@theholocron/kyber/secrets`; this copy will be removed in the next major.
|
|
15
|
+
*/
|
|
8
16
|
interface ResolveTokenInput {
|
|
9
17
|
/** From `--token` CLI flag. */
|
|
10
18
|
cliToken?: string;
|
|
@@ -15,7 +23,11 @@ interface ResolveTokenInput {
|
|
|
15
23
|
/** Active org name — drives namespaced keyring lookup (`<service>.<org>`). */
|
|
16
24
|
org?: string;
|
|
17
25
|
}
|
|
18
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* How `createResolveToken` finds a vendor's token.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Moved to `ResolveTokenConfig` in `@theholocron/kyber/secrets`; this copy will be removed in the next major.
|
|
30
|
+
*/
|
|
19
31
|
interface ResolveTokenConfig {
|
|
20
32
|
/** HOLOCRON_* env var (e.g. `"HOLOCRON_GH_TOKEN"`). */
|
|
21
33
|
envName: string;
|
|
@@ -32,6 +44,9 @@ interface ResolveTokenConfig {
|
|
|
32
44
|
* Returns a `resolveToken(input?)` function wired to the given env vars
|
|
33
45
|
* and keyring service. Plugins call this once at module level.
|
|
34
46
|
*
|
|
47
|
+
* @deprecated Moved to `createResolveToken` in `@theholocron/kyber/secrets`, which also reads the variables a
|
|
48
|
+
* `credentials` provider returned and takes the org variable's name; this copy will be removed in the next major.
|
|
49
|
+
*
|
|
35
50
|
* @remarks
|
|
36
51
|
* The resolver tries, in order: the `cliToken` input (the `--token` flag), the
|
|
37
52
|
* `HOLOCRON_*` env var, the vendor's own env var, the keyring entry
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { createEnvLookup, firstEnv } from "@theholocron/env-utils/lookup";
|
|
2
2
|
import { NoopErrorSink, NoopLogger } from "@theholocron/observability/core";
|
|
3
3
|
// src/auth-resolver.ts
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Thrown by a token resolver when no token was found in any source.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Moved to `AuthError` in `@theholocron/kyber/secrets`; this copy will be removed in the next major.
|
|
8
|
+
*/
|
|
5
9
|
var AuthError = class extends Error {
|
|
6
10
|
/** The error name, `AuthError`. */
|
|
7
11
|
name = "AuthError";
|
|
@@ -10,6 +14,9 @@ var AuthError = class extends Error {
|
|
|
10
14
|
* Returns a `resolveToken(input?)` function wired to the given env vars
|
|
11
15
|
* and keyring service. Plugins call this once at module level.
|
|
12
16
|
*
|
|
17
|
+
* @deprecated Moved to `createResolveToken` in `@theholocron/kyber/secrets`, which also reads the variables a
|
|
18
|
+
* `credentials` provider returned and takes the org variable's name; this copy will be removed in the next major.
|
|
19
|
+
*
|
|
13
20
|
* @remarks
|
|
14
21
|
* The resolver tries, in order: the `cliToken` input (the `--token` flag), the
|
|
15
22
|
* `HOLOCRON_*` env var, the vendor's own env var, the keyring entry
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/http-client",
|
|
3
|
-
"version": "1.58.0-alpha.
|
|
3
|
+
"version": "1.58.0-alpha.9",
|
|
4
4
|
"description": "Shared HTTP primitives for theholocron — REST client factory, auth resolver, and error types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"tsdown": "^0.23.4",
|
|
50
50
|
"typescript": "^5.9.3",
|
|
51
51
|
"vitest": "^5.0.5",
|
|
52
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.8",
|
|
53
52
|
"@theholocron/tsconfig": "^8.9.0-alpha.8",
|
|
54
53
|
"@theholocron/tsdown-config": "^8.9.0-alpha.8",
|
|
55
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.8"
|
|
54
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.8",
|
|
55
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.8"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"vitest": ">=4.0.0"
|