@agentxm/registry-client 0.28.4-bootstrap.0
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/LICENSE +110 -0
- package/README.md +9 -0
- package/dist/src/__generated__/registry-client.d.ts +6501 -0
- package/dist/src/__generated__/registry-client.js +2270 -0
- package/dist/src/admin-client.d.ts +181 -0
- package/dist/src/admin-client.js +165 -0
- package/dist/src/archive-cache.d.ts +46 -0
- package/dist/src/archive-cache.js +179 -0
- package/dist/src/atomic-write.d.ts +49 -0
- package/dist/src/atomic-write.js +60 -0
- package/dist/src/axm-package-meta.d.ts +31 -0
- package/dist/src/axm-package-meta.js +31 -0
- package/dist/src/cache-root.d.ts +11 -0
- package/dist/src/cache-root.js +43 -0
- package/dist/src/client.d.ts +270 -0
- package/dist/src/client.js +43 -0
- package/dist/src/deprecation-warning.d.ts +3 -0
- package/dist/src/deprecation-warning.js +16 -0
- package/dist/src/error-mapping.d.ts +82 -0
- package/dist/src/error-mapping.js +186 -0
- package/dist/src/errors.d.ts +107 -0
- package/dist/src/errors.js +98 -0
- package/dist/src/failure-mapping.d.ts +14 -0
- package/dist/src/failure-mapping.js +100 -0
- package/dist/src/fs-helpers.d.ts +12 -0
- package/dist/src/fs-helpers.js +13 -0
- package/dist/src/index.d.ts +33 -0
- package/dist/src/index.js +37 -0
- package/dist/src/integrity.d.ts +13 -0
- package/dist/src/integrity.js +17 -0
- package/dist/src/local-client.d.ts +24 -0
- package/dist/src/local-client.js +815 -0
- package/dist/src/network.d.ts +6 -0
- package/dist/src/network.js +6 -0
- package/dist/src/path-safety.d.ts +18 -0
- package/dist/src/path-safety.js +26 -0
- package/dist/src/purl-match.d.ts +28 -0
- package/dist/src/purl-match.js +35 -0
- package/dist/src/registry-url.d.ts +14 -0
- package/dist/src/registry-url.js +12 -0
- package/dist/src/remote-client.d.ts +27 -0
- package/dist/src/remote-client.js +725 -0
- package/dist/src/request-policy.d.ts +29 -0
- package/dist/src/request-policy.js +190 -0
- package/dist/src/response-body.d.ts +11 -0
- package/dist/src/response-body.js +32 -0
- package/dist/src/retry-after.d.ts +9 -0
- package/dist/src/retry-after.js +28 -0
- package/dist/src/translate.d.ts +20 -0
- package/dist/src/translate.js +170 -0
- package/dist/src/utils.d.ts +60 -0
- package/dist/src/utils.js +187 -0
- package/package.json +55 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the hostname represents a loopback address.
|
|
3
|
+
* Covers localhost, IPv4 loopback (127.0.0.1), and IPv6 loopback (::1).
|
|
4
|
+
*/
|
|
5
|
+
export const isLoopbackAddress = (hostname) => hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
|
|
6
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path containment helper for archive extraction.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately duplicated from the workspace-state kernel: an integration
|
|
5
|
+
* may not depend on a kernel, and this helper is within the sanctioned
|
|
6
|
+
* duplication budget for small pure functions.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Option from "effect/Option";
|
|
12
|
+
import * as Path from "effect/Path";
|
|
13
|
+
import { type AbsolutePath } from "@agentxm/extension-model/unstable/path-types";
|
|
14
|
+
/**
|
|
15
|
+
* Resolve `target` and return it only when it stays inside `base`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const safeChildPath: (base: AbsolutePath, target: string) => Effect.Effect<Option.Option<AbsolutePath>, never, Path.Path>;
|
|
18
|
+
//# sourceMappingURL=path-safety.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path containment helper for archive extraction.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately duplicated from the workspace-state kernel: an integration
|
|
5
|
+
* may not depend on a kernel, and this helper is within the sanctioned
|
|
6
|
+
* duplication budget for small pure functions.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Option from "effect/Option";
|
|
12
|
+
import * as Path from "effect/Path";
|
|
13
|
+
import { makeAbsolutePath } from "@agentxm/extension-model/unstable/path-types";
|
|
14
|
+
/**
|
|
15
|
+
* Resolve `target` and return it only when it stays inside `base`.
|
|
16
|
+
*/
|
|
17
|
+
export const safeChildPath = (base, target) => Effect.gen(function* () {
|
|
18
|
+
const path = yield* Path.Path;
|
|
19
|
+
const resolvedBase = path.resolve(base);
|
|
20
|
+
const resolvedTarget = path.isAbsolute(target)
|
|
21
|
+
? path.resolve(target)
|
|
22
|
+
: path.resolve(resolvedBase, target);
|
|
23
|
+
const safe = resolvedTarget === resolvedBase || resolvedTarget.startsWith(resolvedBase + path.sep);
|
|
24
|
+
return safe ? Option.some(makeAbsolutePath(path, resolvedTarget)) : Option.none();
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=path-safety.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package URL matching functions for comparing detected packages
|
|
3
|
+
* against declared compatible packages.
|
|
4
|
+
*
|
|
5
|
+
* @experimental This API is unstable and may change without notice.
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import type { PackageUrlParts } from "@agentxm/extension-model/unstable/packaging/package-url";
|
|
9
|
+
/**
|
|
10
|
+
* Check whether two purl parts share the same identity (type, namespace, name).
|
|
11
|
+
* Version is ignored.
|
|
12
|
+
*
|
|
13
|
+
* @experimental This API is unstable and may change without notice.
|
|
14
|
+
*/
|
|
15
|
+
export declare const purlIdentityMatch: (a: PackageUrlParts, b: PackageUrlParts) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check whether a detected purl matches a declared compatible purl.
|
|
18
|
+
*
|
|
19
|
+
* Matching rules:
|
|
20
|
+
* - Identity (type, namespace, name) must match exactly
|
|
21
|
+
* - Versionless declaration matches any detected version
|
|
22
|
+
* - Versionless detection matches any declaration
|
|
23
|
+
* - Both exact versions match only if equal
|
|
24
|
+
*
|
|
25
|
+
* @experimental This API is unstable and may change without notice.
|
|
26
|
+
*/
|
|
27
|
+
export declare const purlMatch: (detected: PackageUrlParts, declared: PackageUrlParts) => boolean;
|
|
28
|
+
//# sourceMappingURL=purl-match.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package URL matching functions for comparing detected packages
|
|
3
|
+
* against declared compatible packages.
|
|
4
|
+
*
|
|
5
|
+
* @experimental This API is unstable and may change without notice.
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Check whether two purl parts share the same identity (type, namespace, name).
|
|
10
|
+
* Version is ignored.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is unstable and may change without notice.
|
|
13
|
+
*/
|
|
14
|
+
export const purlIdentityMatch = (a, b) => a.type === b.type && a.namespace === b.namespace && a.name === b.name;
|
|
15
|
+
/**
|
|
16
|
+
* Check whether a detected purl matches a declared compatible purl.
|
|
17
|
+
*
|
|
18
|
+
* Matching rules:
|
|
19
|
+
* - Identity (type, namespace, name) must match exactly
|
|
20
|
+
* - Versionless declaration matches any detected version
|
|
21
|
+
* - Versionless detection matches any declaration
|
|
22
|
+
* - Both exact versions match only if equal
|
|
23
|
+
*
|
|
24
|
+
* @experimental This API is unstable and may change without notice.
|
|
25
|
+
*/
|
|
26
|
+
export const purlMatch = (detected, declared) => {
|
|
27
|
+
if (!purlIdentityMatch(detected, declared))
|
|
28
|
+
return false;
|
|
29
|
+
if (declared.version === undefined)
|
|
30
|
+
return true;
|
|
31
|
+
if (detected.version === undefined)
|
|
32
|
+
return true;
|
|
33
|
+
return detected.version === declared.version;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=purl-match.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegistryUrl service tag — configures which URL is the default registry.
|
|
3
|
+
*
|
|
4
|
+
* Lives with the Registry transport so authentication depends on the
|
|
5
|
+
* Registry client and never the reverse.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import * as ServiceMap from "effect/Context";
|
|
10
|
+
declare const RegistryUrl_base: ServiceMap.ServiceClass<RegistryUrl, "@agentxm/registry-client/registry-url/RegistryUrl", string>;
|
|
11
|
+
export declare class RegistryUrl extends RegistryUrl_base {
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=registry-url.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegistryUrl service tag — configures which URL is the default registry.
|
|
3
|
+
*
|
|
4
|
+
* Lives with the Registry transport so authentication depends on the
|
|
5
|
+
* Registry client and never the reverse.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import * as ServiceMap from "effect/Context";
|
|
10
|
+
export class RegistryUrl extends ServiceMap.Service()("@agentxm/registry-client/registry-url/RegistryUrl") {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=registry-url.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote HTTPS registry client.
|
|
3
|
+
*
|
|
4
|
+
* Implements `RegistryClient` by delegating HTTP transport to the generated
|
|
5
|
+
* registry client and mapping all errors to the typed registry failure
|
|
6
|
+
* vocabulary with per-operation categories.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
12
|
+
import type { RegistryClient } from "./client.js";
|
|
13
|
+
import { type RegistryRequestPolicy } from "./request-policy.js";
|
|
14
|
+
import type { ArchiveCache } from "./archive-cache.js";
|
|
15
|
+
/**
|
|
16
|
+
* Creates a remote HTTPS registry client.
|
|
17
|
+
*
|
|
18
|
+
* Uses the generated registry client for all HTTP transport and maps
|
|
19
|
+
* generated errors to typed registry failure categories per-operation.
|
|
20
|
+
*
|
|
21
|
+
* @param baseUrl - Base URL of the remote registry (e.g. `https://registry.example.com`)
|
|
22
|
+
* @param httpClient - Effect HttpClient instance for making HTTP requests
|
|
23
|
+
*
|
|
24
|
+
* @experimental This API is unstable and may change without notice.
|
|
25
|
+
*/
|
|
26
|
+
export declare const createRemoteRegistryClient: (baseUrl: string, httpClient: HttpClient.HttpClient, archiveCache?: ArchiveCache, requestPolicy?: RegistryRequestPolicy) => RegistryClient;
|
|
27
|
+
//# sourceMappingURL=remote-client.d.ts.map
|