// ----------------------------------------------------------------------------- // Enum Typedefs // ----------------------------------------------------------------------------- /** * @typedef {"file" | "dir" | "symlink" | "submodule"} ContentsType */ /** * @typedef {"base64" | "utf-8"} Encoding */ /** * @typedef {"push" | "pull_request"} HookEvent */ /** * @typedef {"blob" | "tree" | "commit"} NodeType */ /** * @typedef {"User"} OwnerType */ /** * @typedef {"all" | "public" | "private"} Visibility */ // ----------------------------------------------------------------------------- // Model Typedefs // ----------------------------------------------------------------------------- /** * @typedef {Object} Blob * @property {string} content * @property {Encoding} encoding * @property {string} url * @property {string} sha * @property {number} size */ /** * @typedef {Object} BlobCreated * @property {string} url * @property {string} sha */ /** * @typedef {Object} BlobForm * @property {string} content * @property {Encoding} encoding */ /** * @typedef {Object} Commit * @property {string} sha * @property {string} url * @property {string} html_url * @property {Person} author * @property {Person} committer * @property {TreeSummary} tree * @property {string} message * @property {CommitSummary[]} parents */ /** * @typedef {Object} CommitForm * @property {string} message * @property {string} tree * @property {string[]} parents * @property {Person} author * @property {Person} committer */ /** * @typedef {Object} CommitResponse * @property {string} sha * @property {string} url * @property {Person} author * @property {Person} committer * @property {string} message * @property {TreeSummary} tree * @property {TreeSummary[]} parents */ /** * @typedef {Object} CommitSummary * @property {string} sha * @property {string} url */ /** * @typedef {Object} Contents * @property {ContentsType} type * @property {Encoding} encoding * @property {number} size * @property {string} name * @property {string} path * @property {string} [content] If file, then present * @property {string} sha * @property {string} url * @property {string} git_url * @property {string} html_url * @property {string} download_url */ /** * @typedef {Object} CreateTreeForm * @property {string} base_tree * @property {TreeForm[]} tree */ /** * @typedef {Object} CreateTreeResponse * @property {string} sha * @property {string} url * @property {Tree} tree_result */ /** * @typedef {Object} Error * @property {string} resource * @property {string} field * @property {string} code */ /** * @typedef {Object} GithubObject * @property {string} type * @property {string} sha * @property {string} url */ /** * See https://developer.github.com/v3/repos/hooks/#create-a-hook * @typedef {Object} Hook * @property {number} id * @property {string} url * @property {string} test_url * @property {string} ping_url * @property {string} name * @property {HookEvent[]} events * @property {boolean} active * @property {HookConfig} config * @property {string} updated_at * @property {string} created_at */ /** * @typedef {Object} HookConfig * @property {string} [url] * @property {string} [content_type] */ /** * @typedef {Object} HookForm * @property {string} name * @property {HookConfig} config * @property {HookEvent[]} events * @property {boolean} active */ /** * @typedef {Object} Node * @property {string} path * @property {string} mode 100644 file (blob), 100755 executable (blob), 040000 subdirectory (tree), 160000 submodule (commit) * @property {NodeType} type * @property {number} size * @property {string} sha * @property {string} url */ /** * @typedef {Object} NodeForm * @property {string} path * @property {string} mode 100644 file (blob), 100755 executable (blob), 040000 subdirectory (tree), 160000 submodule (commit) * @property {NodeType} type * @property {string} sha */ /** * @typedef {Object} Person * @property {string} name * @property {string} email * @property {string} date */ /** * @typedef {Object} PullRequest * @property {number} id * @property {string} url * @property {number} number * @property {string} html_url * @property {PullRequestHead} head */ /** * @typedef {Object} PullRequestForm * @property {string} title * @property {string} head * @property {string} base * @property {string} [body] */ /** * @typedef {Object} PullRequestHead * @property {string} ref */ /** * @typedef {Object} Ref * @property {string} ref * @property {string} url * @property {GithubObject} object */ /** * @typedef {Object} RefForm * @property {string} ref * @property {string} sha */ /** * @typedef {Object} RefUpdateForm * @property {string} sha */ /** * @typedef {Object} Repository * @property {number} id * @property {User} owner * @property {string} name * @property {string} full_name * @property {boolean} private * @property {string} [description] * @property {string} url * @property {string} html_url * @property {string} default_branch */ /** * @typedef {Object} Tag * @property {string} tag * @property {string} sha * @property {string} url * @property {string} message * @property {Tagger} tagger * @property {GithubObject} object */ /** * @typedef {Object} TagForm * @property {string} tag * @property {string} message * @property {string} object The SHA of the git object this is tagging * @property {string} type * @property {Tagger} tagger */ /** * @typedef {Object} TagSummary * @property {string} name * @property {CommitSummary} commit */ /** * @typedef {Object} Tagger * @property {string} name * @property {string} email * @property {string} date */ /** * @typedef {Object} Tree * @property {string} sha * @property {string} url * @property {boolean} truncated * @property {Node[]} tree */ /** * @typedef {Object} TreeForm * @property {string} path * @property {string} mode 100644 file (blob), 100755 executable (blob), 040000 subdirectory (tree), 160000 submodule (commit) * @property {NodeType} type * @property {string} [sha] * @property {string} [content] */ /** * @typedef {Object} TreeResult * @property {string} path * @property {string} mode 100644 file (blob), 100755 executable (blob), 040000 subdirectory (tree), 160000 submodule (commit) * @property {NodeType} type * @property {number} size * @property {string} sha * @property {string} url */ /** * @typedef {Object} TreeSummary * @property {string} url * @property {string} sha */ /** * @typedef {Object} UnprocessableEntity * @property {string} message * @property {Error[]} [errors] */ /** * @typedef {Object} User * @property {number} id * @property {string} login * @property {string} [name] * @property {string} [email] * @property {string} [avatar_url] * @property {string} [gravatar_id] * @property {string} url * @property {string} html_url * @property {OwnerType} type */ /** * @typedef {Object} UserEmail * @property {string} email * @property {boolean} verified * @property {boolean} primary */ /** * @typedef {Object} UserOrg * @property {string} login */ // ----------------------------------------------------------------------------- // Union Typedefs // -----------------------------------------------------------------------------