/** * Package URL (PURL) utilities for Socket CLI. * Implements the PURL specification for universal package identification. * * PURL Format: * pkg:type/namespace/name@version?qualifiers#subpath * * Key Functions: * - createPurlObject: Create PURL from components * - isPurl: Check if string is valid PURL * - normalizePurl: Normalize PURL format * - parsePurl: Parse PURL string to object * - purlToString: Convert PURL object to string * * Supported Types: * - cargo: Rust packages * - gem: Ruby packages * - go: Go modules * - maven: Java packages * - npm: Node.js packages * - pypi: Python packages * * See: https://github.com/package-url/purl-spec */ import { PackageURL, type PurlQualifiers } from '@socketregistry/packageurl-js'; import type { SocketArtifact } from './alert/artifact.mts'; import type { PURL_Type } from './ecosystem.mts'; export type PurlObject = T & { type: PURL_Type; }; export type PurlLike = string | PackageURL | SocketArtifact; export type CreatePurlObjectOptions = { type?: string | undefined; namespace?: string | undefined; name?: string | undefined; version?: string | undefined; qualifiers?: PurlQualifiers | undefined; subpath?: string | undefined; throws?: boolean | undefined; }; export type CreatePurlOptionsWithThrows = CreatePurlObjectOptions & { throws?: true | undefined; }; export type CreatePurlOptionsNoThrows = CreatePurlObjectOptions & { throws: false; }; export declare function createPurlObject(options: CreatePurlOptionsWithThrows): PurlObject; export declare function createPurlObject(options: CreatePurlOptionsNoThrows): PurlObject | undefined; export declare function createPurlObject(type: string | CreatePurlObjectOptions, options?: CreatePurlOptionsWithThrows | undefined): PurlObject; export declare function createPurlObject(type: string | CreatePurlObjectOptions, options: CreatePurlOptionsNoThrows): PurlObject | undefined; export declare function createPurlObject(type: string | CreatePurlObjectOptions, options?: CreatePurlOptionsWithThrows | undefined): PurlObject; export declare function createPurlObject(type: string, name: string, options: CreatePurlOptionsNoThrows): PurlObject | undefined; export declare function createPurlObject(type: string, name: string, options?: CreatePurlOptionsWithThrows | undefined): PurlObject; export type PurlObjectOptions = { throws?: boolean | undefined; }; export type PurlOptionsWithThrows = PurlObjectOptions & { throws?: true | undefined; }; export type PurlOptionsNoThrows = PurlObjectOptions & { throws: false; }; export declare function getPurlObject(purl: string, options?: PurlOptionsWithThrows | undefined): PurlObject; export declare function getPurlObject(purl: string, options: PurlOptionsNoThrows): PurlObject | undefined; export declare function getPurlObject(purl: PackageURL, options?: PurlOptionsWithThrows | undefined): PurlObject; export declare function getPurlObject(purl: PackageURL, options: PurlOptionsNoThrows): PurlObject | undefined; export declare function getPurlObject(purl: SocketArtifact, options?: PurlOptionsWithThrows | undefined): PurlObject; export declare function getPurlObject(purl: SocketArtifact, options: PurlOptionsNoThrows): PurlObject | undefined; export declare function getPurlObject(purl: PurlLike, options?: PurlOptionsWithThrows | undefined): PurlObject; export declare function normalizePurl(rawPurl: string): string; //# sourceMappingURL=purl.d.mts.map