posborne / anvil Goto Github PK
View Code? Open in Web Editor NEWA Library for making access to Kiln API Simple
License: MIT License
A Library for making access to Kiln API Simple
License: MIT License
Api/{version}/Bug/{ixBug} (GET)
Returns a list of changeset records readable by the user. A changeset is readable if it belongs to at least one repository readable by the user. This list corresponds to all the changesets associated with ixBug, a FogBugz case number.
https://developers.fogbugz.com/default.asp?W190
Repository Aliases
New in Kiln 2.4
Repositories aliases allow you to create a URL that points to a target repository, which is allowed to change while the alias' URL remains the same. Kiln provides a full read and write API to repo aliases.
Api/{version}/RepoAlias/Create (POST)
Creates a repository alias with the specified name for the given repository. You must be a project administrator to create an alias in a project.
Takes the following parameters:
ixRepo (required): the repository to attach the alias to.
sName (required): the name of the alias. May contain word characters, hyphens, and parentheses (i.e. must match ^[\w- ()]+$)
Returns a repository alias record. The alias's URL will be http://your.kilnhg.com/RepoAlias/sProject/sSlug, where sProject is the slug of repository's project, and the sSlug is the slug of the alias's name.
Api/{version}/RepoAlias/{ixRepoAlias} (GET)
Returns the repository alias record. Requires read permissions to the repository's project.
Api/{version}/RepoAlias/{ixRepoAlias} (POST)
Updates the specified alias. Takes either or both of the following parameters (see descriptions for Create method, above):
ixRepo
sName
Any parameter that is not specified remains unchanged. Requires administrator permissions on the repository's project.
Api/{version}/RepoAlias/{ixRepoAlias}/Delete (POST)
Deletes the specified alias. Requires administrator permissions on the associated repository's project. Returns true on success.
Api/{version}/RepoAlias/Find (GET)
Returns the repository alias record by that matches the given project slug and alias slug. Takes the following parameters:
sProjectSlug (required): slugified project name
sAliasSlug (required): slugified alias name
This method is useful for fetching an alias record if you have the alias's Kiln URL; for instance, the alias record for the alias at http://your.kilnhg.com/RepoAlias/my-project/my-alias will be found at http://your.kilnhg.com/Api/1.0/RepoAlias/Find?sProjectSlug=my-project&sAliasSlug=my-alias.
Api/{version}/Repo/{ixRepo}/Tags (GET)
Requires read permissions to the repository. Returns an array of tag records that belong to ixRepo. (Kiln 2.7.5 and higher only)
Api/{version}/Repo/{ixRepo}/Commit (POST)
Commits files to ixRepo. Files are committed directly to the repository and do not need to be pushed by the user. Uses multipart/form-data and takes
ixPerson: the author of the commit (optional; defaults to current user)
revParent1: the first parent changeset of the new commit (optional; defaults to tip)
revParent2: the second parent changeset of the new commit; used when merging (optional; defaults to none)
dt: the date of the commit (optional, defaults to the user's current day and time)
sMessage: commit message
: (at least one file must be given)
and returns the new revision which does not guarantee the backend has added the changeset yet. This is an asynchronous call. You should poll Api/{version}/Repo/{ixRepo}/History/{the new rev} until the new changeset is returned to determine when the backend has finished. (Kiln 2.7.5 and higher only)
Api/{version}/Repo/{ixRepo} (POST)
You need to be the repository creator or have administrator permissions to modify a branch repository; you need to have administrator permissions to modify a central repository. Takes
sName: the new repository name
sDescription: the new repository description
ixRepoGroup: the new repository group to move the repository
ixParent: the new repository parent (you must have read permission to the new parent).
Kiln 2.5.96 and higher only: Specify 0 to set the repository's parent to None (null).
fCentral: if true, converts the branch repository into a central repository (can only be set for branch repositories)
permissionDefault: the new default repository permission
(All optional.) and updates the repository with the fields. Returns the updated repository record.
Api/{version}/Repo/{ixRepo}/NamedBranches (GET)
Requires read permissions to the repository. Returns an array of NamedBranch records corresponding to ixRepo. (Kiln 2.7.5 and higher only)
Api/{version}/Reviews (GET)
Returns a record containing the keys
reviewsAssignedToMe: a list of open review records without changesets assigned to you (Deprecated in Kiln 2.5.9)
reviewsOpenedByMe: a list of open review records without changesets opened by you
reviewsReviewedByMe: a list of review records without changesets corresponding to reviews in which you are a reviewer, excluding reviews in reviewsOpenedByMe (Kiln 2.5.9 and up)
The reviews in the returned record are the same as the reviews in the review menu dropdown.
https://developers.fogbugz.com/default.asp?W166
Api/{version}/Repo/{ixRepo}/History (GET)
Requires read permissions to the repository. Takes
revs: a list of requested revisions from the same repository (optional; Kiln 2.7.5 and higher only)
revOldest: revision of the oldest changeset to return (optional)
nChangesetLimit: number of changesets to return, with a maximum of 100 (optional; defaults to 10)
and returns a list of the requested changesets corresponding to the revisions "revs". If revs is omitted, changeset records from the repository history, analogous to "hg log" are returned. If revOldest is omitted, the call returns "nChangesetLimit" records starting from the tip and working backward.
Api/{version}/Review/Create (POST)
Requires read permissions to the repository. Takes
ixRepo: the repository to create the new review against
revs: a list of revisions to review (Kiln 2.5.141 and higher only; see Deprecation Notice below)
ixReviewers: a list of people to add as reviewers (Kiln 2.4.101 and higher only; see Deprecation Notice below)
sTitle: the title of the new review (optional)
sDescription: the initial comment of the new review (optional)
and returns the new review's review record.
From Docs (https://developers.fogbugz.com/default.asp?W164)
Api/{version}/Project/{ixProject}/Delete (POST)
You must be an administrator to delete a project. Deletes the project corresponding to "ixProject". Returns true on success.
Api/{version}/Repo/{ixRepo}/Push/{ixTargetRepo} (POST)
Where ixTargetRepo is the target repository to push to. Requires read permissions to the ixRepo source repository and write permissions to to the ixTargetRepo target repository. The target repository must contain a strict subset of the changesets in the source repository; the source must be related to the target; and the push must not create new heads in the target. Takes no other parameters. Returns true on success.
Api/{version}/Review/{ixReview} (GET)
Requires read permission to the review. Returns the review record with changesets corresponding to ixReview.
Api/{version}/Review/{ixReview} (POST)
Takes
sStatus: the new review status (one of "approved", "rejected", "wontreview"; optional)
fClose: whether to close the review (optional; defaults to false)
fReopen: whether to reopen the review (optional; defaults to true)
and returns the updated review record with changesets. Note that some combinations of parameters are conflicting, such as closing and reopening a review at the same time. To address this, we simply mandate that "fReopen" being true takes first precedence. A review closes in the "approved" state unless otherwise specified by "sStatus".
Api/{version}/Repo/Create (POST)
You need to be a project administrator to create a central repository. You need to have at least project write permissions to the project to create a branch repository. Takes
sName (required): the new repository name
sDescription (optional): the new repository description
ixRepoGroup (required): the repository group the new repository will belong to
ixParent (optional; if given, the ixParent repository will be branched to create the new repository): the parent repository
fCentral (optional; defaults to true): true if the new repository should be central; false otherwise
permissionDefault (optional; defaults to "none"): the default repository permission, one of "none", "read", or "modify"
Returns the new repository's repository record, which does not guarantee the backend has created the repository yet. This is an asynchronous call. You should poll Api/{version}/Repo/{ixRepo} until "sStatus" becomes "good" to determine when the backend has finished. This call will be slower if the backend needs to branch a parent repository.
Important note: Setting ixParent on this call is how you branch repositories through the API.
As of Kiln 2.5.171: You can now also create branch repositories with project read + write permissions. (A previous announcement regarding this feature in 2.5.96 was incorrect due to a bug in the implementation; we apologize for this error.)
Api/{version}/Repo/{ixRepo}/File/{bpPath} (GET)
Requires read permissions to the repository. Takes
rev: the revision to read the file from (optional; default to tip)
fAnnotate: if true, returns annotation records as well (optional; defaults to false)
and returns the cat record corresponding to the file at "bpPath" at revision "rev", analogous to "hg cat". Note that "bpPath" must be an encoded byte path; see the API Idioms page for details.
https://developers.fogbugz.com/default.asp?W166
Api/{version}/Repo/{ixRepo}/History/{rev} (GET)
Requires read permissions to the repository. Returns the changeset-with-diffs record corresponding to the revision "rev" from the history, analogous to an amalgamation "hg diff" and "hg log".
To this point, I haven't had this use case but it would be a great starter feature to add to the project for anyone needing this support:
From Kiln API Docs (https://developers.fogbugz.com/default.asp?W164)
Api/{version}/Project/{ixProject} (POST)
You must be an administrator to write to a project. Takes
sName: the new project name (optional)
sDescription: the new project description (optional)
permissionDefault: the new default project permission (optional)
and updates the fields on the project corresponding to "ixProject". Returns the updated project record.
NOTE: I don't really understand this feature so it seems low priority
Api/{version}/Repo/Related (GET)
Takes
revTails: a list of revision tails
and returns a list of repository records that contains a tail from "revTails" and are readable by the user.
Api/{version}/Repo/{ixRepo}/Related (GET)
Requires read permissions to the repository. Returns a list of repository records that are related to the repository corresponding to "ixRepo" and are readable by the user.
Idea here would be to look for .hgsub files in all repos that point to a particular repo. Thinking it would be implemented as a where_used function in the KilnRepo class in entities.py that returns a list of repos that have the current repo listed as a subrepo.
Api/{version}/Project/{ixProject} (GET)
Requires read access. Returns the project record corresponding to "ixProject".
Api/{version}/Repo/{ixRepo}/Delete (POST)
You need to be the repository creator or have administrator permissions to delete a branch repository; you need to have administrator permissions on the repository and the project to delete a central repository. Repositories can be undeleted by a project administrator from the website user interface.
Api/{version}/Person (GET)
Returns a list of person records readable by the user. You'll need to call this in order to determine which ixPerson to pass to certain calls, for example Review.
Api/{version}/Repo/{ixRepo}/CaseAssociation/Create(POST)
Requires write permissions to the repository. Associates a list of changesets with a case or review. Takes
revs: the list of revisions to associate
ixBug: the case to associate
and returns the updated changesets. (Kiln 2.7.5 and higher only)
Api/{version}/Repo/{ixRepo}/CaseAssociation/Delete(POST)
Requires write permissions to the repository. Dissociates a list of changesets with a case or review. Takes
revs: the list of revisions to dissociate
ixBug: the case to dissociate
and returns the updated changesets. (Kiln 2.7.5 and higher only.)
This should go along with the ability to grab a file
Api/{version}/Repo/{ixRepo}/Manifest (GET)
Requires read permissions to the repository. Takes
rev: the revision to read the manifest from (optional; defaults to tip)
and returns a list of manifest records at revision "rev".
Api/{version}/Repo/{ixRepo} (GET)
You need read permissions to the repository. Returns the repository record.
Api/{version}/Repo/{ixRepo}/Outgoing (GET)
Requires read permissions to the repository. Takes
ixOtherRepo: the repository to compare to
revOlderThan: only include changesets older than this outgoing changeset (optional; defaults to tip)
nChangesetLimit: the number of changesets to return (optional; defaults to 30)
and returns a list of outgoing changeset records.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.