Movatterモバイル変換


[0]ホーム

URL:


Gist

Gist

A Gist can retrieve and modify gists.

Constructor

new Gist(id, authopt, apiBaseopt)

Create a Gist.

Parameters:
NameTypeAttributesDefaultDescription
idstring

the id of the gist (not required when creating a gist)

authRequestable.auth <optional>

information required to authenticate to Github

apiBasestring <optional>
https://api.github.com

the base Github API URL

Source:

Methods

create(gist, cbopt) → {Promise}

Create a new gist.

Parameters:
NameTypeAttributesDescription
gistObject

the data for the new gist

cbRequestable.callback <optional>

will receive the new gist upon creation

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

createComment(comment, cbopt) → {Promise}

Comment on a gist

Parameters:
NameTypeAttributesDescription
commentstring

the comment to add

cbRequestable.callback <optional>

the function that receives the API result

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

delete(cbopt) → {Promise}

Delete a gist.

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

will receive true if the request succeeds

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

deleteComment(comment, cbopt) → {Promise}

Delete a comment on the gist.

Parameters:
NameTypeAttributesDescription
commentnumber

the id of the comment

cbRequestable.callback <optional>

will receive true if the request succeeds

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

editComment(comment, body, cbopt) → {Promise}

Edit a comment on the gist

Parameters:
NameTypeAttributesDescription
commentnumber

the id of the comment

bodystring

the new comment

cbRequestable.callback <optional>

will receive the modified comment

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

fork(cbopt) → {Promise}

Fork a gist.

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

the function that will receive the gist

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

getComment(comment, cbopt) → {Promise}

Fetch one of the gist's comments

Parameters:
NameTypeAttributesDescription
commentnumber

the id of the comment

cbRequestable.callback <optional>

will receive the comment

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

getRevision(revision, cbopt) → {Promise}

Fetch one of the gist's revision.

Parameters:
NameTypeAttributesDescription
revisionstring

the id of the revision

cbRequestable.callback <optional>

will receive the revision

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

isStarred(cbopt) → {Promise}

Check if a gist is starred by the user.

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

will receive true if the gist is starred and false if the gist is not starred

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

listComments(cbopt) → {Promise}

List the gist's comments

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

will receive the array of comments

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

listCommits(cbopt) → {Promise}

List the gist's commits

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

will receive the array of commits

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

read(cbopt) → {Promise}

Fetch a gist.

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

will receive the gist

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

star(cbopt) → {Promise}

Star a gist.

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

will receive true if the request is successful

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

unstar(cbopt) → {Promise}

Unstar a gist.

Parameters:
NameTypeAttributesDescription
cbRequestable.callback <optional>

will receive true if the request is successful

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise

update(gist, cbopt) → {Promise}

Update a gist.

Parameters:
NameTypeAttributesDescription
gistObject

the new data for the gist

cbRequestable.callback <optional>

the function that receives the API result

Source:
See:
Returns:
  • the Promise for the http request
Type
Promise


[8]ページ先頭

©2009-2025 Movatter.jp