@hasna/hooks 0.9.4 → 0.9.6

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.
@@ -16,10 +16,17 @@
16
16
  * opt-in (`HASNA_HOOKS_LOCAL=1`) is refused here by name: the SDK is a hosted
17
17
  * client and the on-box store is the CLI's, opt-in only.
18
18
  */
19
- import { hooksRegistryOrigin, type HooksRemoteAuthority, type HooksTransportOptions } from "../lib/transport.js";
19
+ import { hooksRegistryOrigin, type HooksRemoteAuthority } from "../lib/transport.js";
20
20
  import type { HooksCredentialOptions, HooksLocalOptInEnv } from "../lib/resolver-types.js";
21
+ import { type HooksClientOptions } from "./authority.js";
21
22
  export type { HooksRemoteAuthority, HooksCredentialOptions, HooksLocalOptInEnv };
22
23
  export { hooksRegistryOrigin };
24
+ export { resolveHooksSdkAuthority } from "./authority.js";
25
+ export type { HooksClientOptions } from "./authority.js";
26
+ export { HooksRegistryApiClient, ApiError as HooksRegistryApiError } from "./generated.js";
27
+ export type { HooksRegistryApiClientOptions, HooksHealth, HooksVersion, HooksCatalogEntry, HooksCatalog, HooksLockEntry, HooksLock, HooksManifest, HooksArtifact, HooksError, HooksPublishRequest, HooksPublishResponse, } from "./generated.js";
28
+ export { createHooksRegistryApiClient, hooksRegistryApiClientFor, } from "./registry-client.js";
29
+ export type { HooksRegistryApiClientAuthority, ResolvedHooksRegistryApiClient, } from "./registry-client.js";
23
30
  /** One row of `GET /api/v1/catalog` — the registry's latest version of a hook. */
24
31
  export interface HooksRegistryCatalogEntry {
25
32
  name: string;
@@ -56,23 +63,15 @@ export interface HooksRegistryArtifact {
56
63
  /** The registry's `x-hook-sha256` header for the served row, when present. */
57
64
  sha256: string | null;
58
65
  }
59
- export interface HooksClientOptions {
60
- /** Injectable environment (tests). Defaults to `process.env`. */
61
- env?: HooksLocalOptInEnv;
62
- /** Tier-1 credential inputs and the injectable `security` runner. */
63
- credentials?: HooksCredentialOptions;
64
- /** Injectable fetch (tests). Defaults to the global `fetch`. */
65
- fetch?: typeof fetch;
66
- }
67
- /**
68
- * Resolve the hosted authority the SDK will talk to. Throws — never returns a
69
- * local fallback — when nothing resolves, and refuses the local opt-in by
70
- * name: there is no SDK surface for the on-box store.
71
- */
72
- export declare function resolveHooksSdkAuthority(env?: HooksLocalOptInEnv, options?: Omit<HooksTransportOptions, "notice">): HooksRemoteAuthority;
73
66
  /**
74
- * Hosted registry client. Holds the resolved credential privately and sends
75
- * it only to the authority it was resolved together with (strict pair).
67
+ * Hosted registry client. Holds the authority binding privately and resolves
68
+ * its current credential for each request before dispatch to that authority.
69
+ *
70
+ * This is the hand-kept, stable surface: it pins the `REMOTE_API_*` error
71
+ * codes, the raw `x-hook-sha256` header on `artifact()`, and the
72
+ * never-follow-a-redirect rule. `HooksRegistryApiClient` (./generated.ts) is
73
+ * the generated counterpart over the same served routes; it is additive, not
74
+ * a replacement.
76
75
  */
77
76
  export declare class HooksClient {
78
77
  #private;