SongGuess
    Preparing search index...

    Artifacts binding — namespace-level operations.

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

    interface Artifacts {
        create(
            name: string,
            opts?: {
                description?: string;
                readOnly?: boolean;
                setDefaultBranch?: string;
            },
        ): Promise<ArtifactsCreateRepoResult>;
        delete(name: string): Promise<boolean>;
        get(name: string): Promise<ArtifactsRepo>;
        import(
            params: {
                source: { branch?: string; depth?: number; url: string };
                target: {
                    name: string;
                    opts?: { description?: string; readOnly?: boolean };
                };
            },
        ): Promise<ArtifactsCreateRepoResult>;
        list(
            opts?: { cursor?: string; limit?: number },
        ): Promise<ArtifactsRepoListResult>;
    }
    Index

    Methods

    • Create a new repository with an initial access token.

      Parameters

      • name: string

        Repository name (alphanumeric, dots, hyphens, underscores).

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

        Optional: readOnly flag, description, default branch name.

      Returns Promise<ArtifactsCreateRepoResult>

      Repo metadata with initial token.

      with code INVALID_REPO_NAME if name is invalid.

      with code ALREADY_EXISTS if the repo already exists.

    • Delete a repository and all associated tokens.

      Parameters

      • name: string

        Repository name.

      Returns Promise<boolean>

      true if deleted, false if not found.

      with code INVALID_REPO_NAME if name is invalid.

    • Get a handle to an existing repository.

      Parameters

      • name: string

        Repository name.

      Returns Promise<ArtifactsRepo>

      Repo handle.

      with code NOT_FOUND if the repo does not exist.

      with code IMPORT_IN_PROGRESS if the repo is still importing.

      with code FORK_IN_PROGRESS if the repo is still forking.

    • Import a repository from an external git remote.

      Parameters

      • params: {
            source: { branch?: string; depth?: number; url: string };
            target: {
                name: string;
                opts?: { description?: string; readOnly?: boolean };
            };
        }

        Source URL and optional branch/depth, plus target name and options.

      Returns Promise<ArtifactsCreateRepoResult>

      Repo metadata with initial token.

      with code INVALID_REPO_NAME if the target name is invalid.

      with code INVALID_INPUT if the source URL is not valid HTTPS.

      with code INVALID_URL if the source URL does not point to a git repository.

      with code REMOTE_AUTH_REQUIRED if the remote requires authentication.

      with code NOT_FOUND if the remote repository does not exist.

      with code UPSTREAM_UNAVAILABLE if the remote cannot be reached.

      with code MEMORY_LIMIT if the import exceeds service memory limits.

      with code ALREADY_EXISTS if the target repo already exists.

    • List repositories with cursor-based pagination.

      Parameters

      • Optionalopts: { cursor?: string; limit?: number }

        Optional: limit (1–200, default 50), cursor for next page.

      Returns Promise<ArtifactsRepoListResult>