Source code

Diff one source file

Returns a bounded unified diff for one file name between two version refs, defaulting from published to head.

get/websiteSourceCode/files/diff

Request

  • Base URL: https://api.cactal.ai/v1
  • URL: https://api.cactal.ai/v1/websiteSourceCode/files/diff
  • Auth: HTTP bearer

Query parameters

websiteIdstring required
fromstring

Base side of the diff: a version number, head, or published. Defaults to published.

tostring

Target side of the diff: a version number, head, or published. Defaults to head.

namestring required

File name to compare.

Response

The selected file comparison and unified diff.

websiteIdstring required

Id of the website.

namestring required

Compared file name.

fromVersioninteger required

Resolved base version.

toVersioninteger required

Resolved target version.

fromType'page' | 'component' | 'module' | 'server_function' | 'global_css' | 'not_found' | 'website_config' | 'custom_head_start' | 'custom_head_end' | 'custom_body_start' | 'custom_body_end'

File type at the base version, when present.

toType'page' | 'component' | 'module' | 'server_function' | 'global_css' | 'not_found' | 'website_config' | 'custom_head_start' | 'custom_head_end' | 'custom_body_start' | 'custom_body_end'

File type at the target version, when present.

status'added' | 'removed' | 'modified' | 'unchanged' required

How the file differs between the two versions.

diffstring required

Unified diff hunks.

truncatedboolean

true when diff computation or output reached its bound. Read both versions for the full content.

Changes

No recorded changes to this operation across all 1 revision of this API.