Skip to content

Upload API — Publish and Update project files #12

@MariusStorhaug

Description

Parent: #4

Delivers functions for uploading new files to CurseForge projects and updating existing file metadata. These are the primary write operations for mod authors managing their releases.

Acceptance criteria:

  • Publish-CurseForgeProjectFile uploads a file with metadata (multipart/form-data)
  • All upload metadata fields supported: Changelog, ChangelogType, DisplayName, GameVersions, ReleaseType, Relations, ParentFileId
  • Update-CurseForgeProjectFile updates metadata on an existing file
  • Both functions return the file ID on success
  • SupportsShouldProcess enabled (state-mutating operations)
  • Unit tests cover metadata serialization and multipart form construction

Endpoints:

Function Method Path Content-Type
Publish-CurseForgeProjectFile POST /api/projects/{projectId}/upload-file multipart/form-data
Update-CurseForgeProjectFile POST /api/projects/{projectId}/update-file multipart/form-data

Upload metadata fields:

{
    "changelog": "string",
    "changelogType": "text|html|markdown",
    "displayName": "string",
    "parentFileID": 42,
    "gameVersions": [157, 158],
    "releaseType": "alpha|beta|release",
    "relations": {
        "projects": [{
            "slug": "string",
            "type": "embeddedLibrary|incompatible|optionalDependency|requiredDependency|tool"
        }]
    }
}

Update metadata fields: Same as upload minus the file, plus mandatory fileID.

Decision: Publish- verb for new uploads (creating a release), Update- verb for modifying existing (matches PowerShell verb semantics). Both use SupportsShouldProcess since they mutate remote state.

Blocked by: #11 (needs Upload API client)


Sub-issues

See linked Tasks below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions