SongGuess
    Preparing search index...

    Handle for a single repository. Returned by Artifacts.get().

    Methods may throw ArtifactsError with code INTERNAL_ERROR if an unexpected service error occurs.

    interface ArtifactsRepo {
        createdAt: string;
        defaultBranch: string;
        description: string | null;
        id: string;
        lastPushAt: string | null;
        name: string;
        readOnly: boolean;
        remote: string;
        source: string | null;
        updatedAt: string;
        createToken(
            scope?: "read" | "write",
            ttl?: number,
        ): Promise<ArtifactsCreateTokenResult>;
        fork(
            name: string,
            opts?: {
                defaultBranchOnly?: boolean;
                description?: string;
                readOnly?: boolean;
            },
        ): Promise<ArtifactsCreateRepoResult>;
        listTokens(): Promise<ArtifactsTokenListResult>;
        revokeToken(tokenOrId: string): Promise<boolean>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    createdAt: string

    ISO 8601 creation timestamp.

    defaultBranch: string

    Default branch name (e.g. "main").

    description: string | null

    Repository description, or null if not set.

    id: string

    Unique repository ID.

    lastPushAt: string | null

    ISO 8601 timestamp of the last push, or null if never pushed.

    name: string

    Repository name.

    readOnly: boolean

    Whether the repository is read-only.

    remote: string

    HTTPS git remote URL.

    source: string | null

    Fork source (e.g. "github:owner/repo", "artifacts:namespace/repo"), or null if not a fork.

    updatedAt: string

    ISO 8601 last-updated timestamp.

    Methods

    • Create an access token for this repo.

      Parameters

      • Optionalscope: "read" | "write"

        Token scope: "write" (default) or "read".

      • Optionalttl: number

        Time-to-live in seconds (default 86400, min 60, max 31536000).

      Returns Promise<ArtifactsCreateTokenResult>

      with code INVALID_TTL if ttl is out of range.

    • Fork this repo to a new repo.

      Parameters

      • name: string

        Target repository name.

      • Optionalopts: { defaultBranchOnly?: boolean; description?: string; readOnly?: boolean }

        Optional: description, readOnly flag, defaultBranchOnly (default true).

      Returns Promise<ArtifactsCreateRepoResult>

      with code INVALID_REPO_NAME if name is invalid.

      with code ALREADY_EXISTS if the target repo already exists.

      with code FORK_IN_PROGRESS if a fork is already running.

    • Revoke a token by plaintext or ID.

      Parameters

      • tokenOrId: string

        Plaintext token or token ID.

      Returns Promise<boolean>

      true if revoked, false if not found.

      with code INVALID_INPUT if tokenOrId is empty.