-
-
Notifications
You must be signed in to change notification settings - Fork 598
Docs releases #522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs releases #522
Changes from all commits
d258fc7
8e0ba2d
36a4ee2
a0e9a7a
9da3b14
f8426c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ integration/test_logs | |
.idea/ | ||
integration/test_logs | ||
out/ | ||
docs/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
--- | ||
language: node_js | ||
dist: trusty | ||
node_js: | ||
- '6.11.4' | ||
|
||
branches: | ||
only: | ||
- master | ||
- /^greenkeeper/.*$/ | ||
- /^v?[0-9]+.[0-9]+.[0-9]+(-.*)?$/ | ||
|
||
env: | ||
- MONGODB_VERSION=3.2.13 | ||
cache: | ||
directories: | ||
- node_modules | ||
- "$HOME/.mongodb/versions" | ||
|
||
services: mongodb | ||
before_script: | ||
- npm install -g mongodb-runner | ||
- mongodb-runner start | ||
script: npm test -- --maxWorkers=4 && ./run_integration.sh | ||
after_script: cat ./coverage/coverage-final.json | ./node_modules/codecov.io/bin/codecov.io.js && rm -rf ./coverage | ||
jobs: | ||
include: | ||
- stage: test | ||
env: | ||
- MONGODB_VERSION=3.2.13 | ||
before_script: | ||
- npm install -g mongodb-runner | ||
- mongodb-runner start | ||
script: npm test -- --maxWorkers=4 && ./run_integration.sh | ||
after_script: cat ./coverage/coverage-final.json | ./node_modules/codecov.io/bin/codecov.io.js && rm -rf ./coverage | ||
# release on github latest branch | ||
- stage: release | ||
env: | ||
before_script: skip | ||
after_script: skip | ||
script: npm run release_docs | ||
deploy: | ||
- provider: pages | ||
skip_cleanup: true | ||
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard | ||
local_dir: docs/ | ||
on: | ||
all_branches: true | ||
- provider: npm | ||
skip_cleanup: true | ||
email: | ||
secure: "YweTGc22uqFWpzbfiUa5ptBLRAy6tt6d9TZLwEkPtmnsWzN9dguGyKWmXiw0qL+848FWQ5PWzUgBn5XdigV9tF3rJY6RGs8i38WulNjwSoGuRZa3AChsQHAb1KenANcJybzhnwgEj9gRsrGZPEsyI2whfake/xLDtG91kHjpJANsd4gseOh6fdS4FIYCbyXvSbC7S0yZzIJkgSkMqJO7RJ8r0HYQ7srYIw31dM3ZXSmUYu+GaMDUUu3RLAGYoKaROxhDRnzkjdeLLiwZH8hQ/6CaqwqX54iJ6OS+MOQU3fi5ZXalA7RZvtC4RmrcCkaTf3i0f+5xejYIFgzXdYGMVm8DUc82tDw1s4b6Pb19bgi1xXOQ0IKzRmZuGxnvkRN61dnYdnpnnNuG97HXgVjiOigZXVLZkWazUdnf9zXqmkC+KxPfa4Ldqg0TMjQ9J14n6TXxRti8Tt0xMa1Uzho7VdsxdJy35Bghy398O6X8VdX6parfzEkX7c/JzcA3TIMJ9+S1dy3J4Tb2URB5367W6h7cDeXtGmwLTFu75Q1CNqRJkUGbSrX2NyMqG5tc8oaTM+OWvLxcbKPRy9T6qN7x2JmCHHaapf8/8VR9wCy2PwE5j+KWhmctEHqqOgrtG5gsjC0eCPJsposxZWyM7M6aUpXe3w+olBfKq9apUGStUSU=" | ||
api_key: | ||
secure: "BI+JcD4Ly3OtyHZ+K/qxJ5B+iHZPgfTHjZLVZz0K7jGVBFPtElDXdvCosjUA518uDIQX2yM8l4qg3EMoHW1LKHqGkcN57bT5fAQ/W5OSD49qJPAqZ4Nxa2BKup+jshjNq6jzLNG/IzyQ+UXB1eRQBiWeCz95d80LEdFpIW33avo1G4lLBCCm3IxSExV5D1fjH2/vSuNnDDfgBImSBqWxiv/oojp4O0dfgS3yoqoxiRXMOayTXP9FmQ0Bu6xZXaCiVfaVjQ2M2JQixMNq9pOIwXkYbI7SCMLcU9zutwfSVnOGOHc5rwe+7FJSwnQvZGzjJztYbxk7IykHMIv9qiSTiMtHfSSn7933V666PW+NOl/Cp6qESOI7KBZpI+45vyeBCQDP0vYdIIMg9xFLKPdiCltBxLOcCpZTGlWi5kkYA7DpzferPIybn6uiLqLHgEN891blevYZgr4sGFnHU29rZF17hDvWlZiRi4IFKbDl10RH7voSot71xf/47Iiq/J0MnlndUqqS6Ufj0QWLshoUlQxNH7TREwnw/Fo3Kz0ADY7sVeWjwzlZX2t+qkd1Xt8U73bLVjitY87EDIGRo5bMu5FMlJCUff5QAVYXE98hNkDDogqFJyvK6vuZteFMw3ouU1RwJyyYJqQP2/anZ4JysrFVguGdxObOV5Meq7+Wa/w=" | ||
on: | ||
tags: true | ||
all_branches: true | ||
repo: parse-community/Parse-SDK-JS |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh -e | ||
set -x | ||
if [ "${TRAVIS_REPO_SLUG}" = "" ]; | ||
then | ||
echo "Cannot release docs without TRAVIS_REPO_SLUG set" | ||
exit 0; | ||
fi | ||
REPO="https://github.com/${TRAVIS_REPO_SLUG}" | ||
|
||
rm -rf docs | ||
git clone -b gh-pages --single-branch $REPO ./docs | ||
cd docs | ||
git pull origin gh-pages | ||
cd .. | ||
|
||
DEST="master" | ||
|
||
if [ "${TRAVIS_TAG}" != "" ]; | ||
then | ||
DEST="${TRAVIS_TAG}" | ||
# change the default page to the latest | ||
echo "<meta http-equiv='refresh' content='0; url=/Parse-SDK-JS/api/${DEST}'>" > "docs/api/index.html" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is interesting... So per release we're just redirecting via meta to the latest set? That's kind of cool actually. One thing I'm curious about is if we're maintaining an index or a table of contents for existing doc versions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So far we don’t, but with this strategy we’ll be able to :) |
||
fi | ||
|
||
npm run docs | ||
|
||
mkdir -p "docs/api/${DEST}" | ||
cp -R out/* "docs/api/${DEST}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
/** | ||
* Defines a Cloud Function. | ||
* | ||
* **Available in Cloud Code only.** | ||
* | ||
* @method define | ||
* @name Parse.Cloud.define | ||
* @param {String} name The name of the Cloud Function | ||
* @param {Function} data The Cloud Function to register. This function should take two parameters a {@link Parse.Cloud.FunctionRequest} and a {@link Parse.Cloud.FunctionResponse} | ||
*/ | ||
|
||
/** | ||
* Registers an after delete function. | ||
* | ||
* **Available in Cloud Code only.** | ||
* | ||
* If you want to use afterDelete for a predefined class in the Parse JavaScript SDK (e.g. {@link Parse.User}), you should pass the class itself and not the String for arg1. | ||
* ``` | ||
* Parse.Cloud.afterDelete('MyCustomClass', (request) => { | ||
* // code here | ||
* }) | ||
* | ||
* Parse.Cloud.afterDelete(Parse.User, (request) => { | ||
* // code here | ||
* }) | ||
*``` | ||
* | ||
* @method afterDelete | ||
* @name Parse.Cloud.afterDelete | ||
* @param {(String|Parse.Object)} arg1 The Parse.Object subclass to register the after delete function for. This can instead be a String that is the className of the subclass. | ||
* @param {Function} func The function to run after a delete. This function should take just one parameter, {@link Parse.Cloud.TriggerRequest}. | ||
*/ | ||
|
||
/** | ||
* | ||
* Registers an after save function. | ||
* | ||
* **Available in Cloud Code only.** | ||
* | ||
* If you want to use afterSave for a predefined class in the Parse JavaScript SDK (e.g. {@link Parse.User}), you should pass the class itself and not the String for arg1. | ||
* | ||
* ``` | ||
* Parse.Cloud.afterSave('MyCustomClass', function(request) { | ||
* // code here | ||
* }) | ||
* | ||
* Parse.Cloud.afterSave(Parse.User, function(request) { | ||
* // code here | ||
* }) | ||
* ``` | ||
* | ||
* @method afterSave | ||
* @name Parse.Cloud.afterSave | ||
* @param {(String|Parse.Object)} arg1 The Parse.Object subclass to register the after save function for. This can instead be a String that is the className of the subclass. | ||
* @param {Function} func The function to run after a save. This function should take just one parameter, {@link Parse.Cloud.TriggerRequest}. | ||
*/ | ||
|
||
/** | ||
* Registers an before delete function. | ||
* | ||
* **Available in Cloud Code only.** | ||
* | ||
* If you want to use beforeDelete for a predefined class in the Parse JavaScript SDK (e.g. {@link Parse.User}), you should pass the class itself and not the String for arg1. | ||
* ``` | ||
* Parse.Cloud.beforeDelete('MyCustomClass', (request, response) => { | ||
* // code here | ||
* }) | ||
* | ||
* Parse.Cloud.beforeDelete(Parse.User, (request, response) => { | ||
* // code here | ||
* }) | ||
*``` | ||
* | ||
* @method beforeDelete | ||
* @name Parse.Cloud.beforeDelete | ||
* @param {(String|Parse.Object)} arg1 The Parse.Object subclass to register the before delete function for. This can instead be a String that is the className of the subclass. | ||
* @param {Function} func The function to run before a delete. This function should take two parameters a {@link Parse.Cloud.TriggerRequest} and a {@link Parse.Cloud.BeforeDeleteResponse}. | ||
*/ | ||
|
||
/** | ||
* | ||
* Registers an before save function. | ||
* | ||
* **Available in Cloud Code only.** | ||
* | ||
* If you want to use beforeSave for a predefined class in the Parse JavaScript SDK (e.g. {@link Parse.User}), you should pass the class itself and not the String for arg1. | ||
* | ||
* ``` | ||
* Parse.Cloud.beforeSave('MyCustomClass', (request, response) => { | ||
* // code here | ||
* }) | ||
* | ||
* Parse.Cloud.beforeSave(Parse.User, (request, response) => { | ||
* // code here | ||
* }) | ||
* ``` | ||
* | ||
* @method beforeSave | ||
* @name Parse.Cloud.beforeSave | ||
* @param {(String|Parse.Object)} arg1 The Parse.Object subclass to register the after save function for. This can instead be a String that is the className of the subclass. | ||
* @param {Function} func The function to run before a save. This function should take two parameters a {@link Parse.Cloud.TriggerRequest} and a {@link Parse.Cloud.BeforeSaveResponse}. | ||
*/ | ||
|
||
/** | ||
* Makes an HTTP Request. | ||
* | ||
* **Available in Cloud Code only.** | ||
* | ||
* By default, Parse.Cloud.httpRequest does not follow redirects caused by HTTP 3xx response codes. You can use the followRedirects option in the {@link Parse.Cloud.HTTPOptions} object to change this behavior. | ||
* | ||
* Sample request: | ||
* ``` | ||
* Parse.Cloud.httpRequest({ | ||
* url: 'http://www.parse.com/' | ||
* }).then(function(httpResponse) { | ||
* // success | ||
* console.log(httpResponse.text); | ||
* },function(httpResponse) { | ||
* // error | ||
* console.error('Request failed with response code ' + httpResponse.status); | ||
* }); | ||
* ``` | ||
* | ||
* @method httpRequest | ||
* @name Parse.Cloud.httpRequest | ||
* @param {Parse.Cloud.HTTPOptions} options The Parse.Cloud.HTTPOptions object that makes the request. | ||
* @return {Parse.Promise<Parse.Cloud.HTTPResponse>} A promise that will be resolved with a {@link Parse.Cloud.HTTPResponse} object when the request completes. | ||
*/ | ||
|
||
/** | ||
* Defines a Background Job. | ||
* | ||
* **Available in Cloud Code only.** | ||
* | ||
* @method job | ||
* @name Parse.Cloud.job | ||
* @param {String} name The name of the Background Job | ||
* @param {Function} func The Background Job to register. This function should take two parameters a {@link Parse.Cloud.JobRequest} and a {@link Parse.Cloud.JobStatus} | ||
* | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.TriggerRequest | ||
* @property {String} installationId If set, the installationId triggering the request. | ||
* @property {Boolean} master If true, means the master key was used. | ||
* @property {Parse.User} user If set, the user that made the request. | ||
* @property {Parse.Object} object The object triggering the hook. | ||
* @property {String} ip The IP address of the client making the request. | ||
* @property {Object} headers The original HTTP headers for the request. | ||
* @property {String} triggerName The name of the trigger (`beforeSave`, `afterSave`, ...) | ||
* @property {Object} log The current logger inside Parse Server. | ||
* @property {Parse.Object} original If set, the object, as currently stored. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.FunctionRequest | ||
* @property {String} installationId If set, the installationId triggering the request. | ||
* @property {Boolean} master If true, means the master key was used. | ||
* @property {Parse.User} user If set, the user that made the request. | ||
* @property {Object} params The params passed to the cloud function. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.JobRequest | ||
* @property {Object} params The params passed to the background job. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.JobStatus | ||
* @property {function} error If error is called, will end the job unsuccessfully with an optional completion message to be stored in the job status. | ||
* @property {function} message If message is called with a string argument, will update the current message to be stored in the job status. | ||
* @property {function} success If success is called, will end the job successfullly with the optional completion message to be stored in the job status. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.BeforeSaveResponse | ||
* @property {function} success If called, will allow the save to happen. If a Parse.Object is passed in, then the passed in object will be saved instead. | ||
* @property {function} error If called, will reject the save. An optional error message may be passed in. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.BeforeDeleteResponse | ||
* @property {function} success If called, will allow the delete to happen. | ||
* @property {function} error If called, will reject the save. An optional error message may be passed in. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.FunctionResponse | ||
* @property {function} success If success is called, will return a successful response with the optional argument to the caller. | ||
* @property {function} error If error is called, will return an error response with an optionally passed message. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.HTTPOptions | ||
* @property {String|Object} body The body of the request. If it is a JSON object, then the Content-Type set in the headers must be application/x-www-form-urlencoded or application/json. You can also set this to a {@link Buffer} object to send raw bytes. If you use a Buffer, you should also set the Content-Type header explicitly to describe what these bytes represent. | ||
* @property {function} error The function that is called when the request fails. It will be passed a Parse.Cloud.HTTPResponse object. | ||
* @property {Boolean} followRedirects Whether to follow redirects caused by HTTP 3xx responses. Defaults to false. | ||
* @property {Object} headers The headers for the request. | ||
* @property {String} method The method of the request. GET, POST, PUT, DELETE, HEAD, and OPTIONS are supported. Will default to GET if not specified. | ||
* @property {String|Object} params The query portion of the url. You can pass a JSON object of key value pairs like params: {q : 'Sean Plott'} or a raw string like params:q=Sean Plott. | ||
* @property {function} success The function that is called when the request successfully completes. It will be passed a Parse.Cloud.HTTPResponse object. | ||
* @property {string} url The url to send the request to. | ||
*/ | ||
|
||
/** | ||
* @typedef Parse.Cloud.HTTPResponse | ||
* @property {Buffer} buffer The raw byte representation of the response body. Use this to receive binary data. See Buffer for more details. | ||
* @property {Object} cookies The cookies sent by the server. The keys in this object are the names of the cookies. The values are Parse.Cloud.Cookie objects. | ||
* @property {Object} data The parsed response body as a JavaScript object. This is only available when the response Content-Type is application/x-www-form-urlencoded or application/json. | ||
* @property {Object} headers The headers sent by the server. The keys in this object are the names of the headers. We do not support multiple response headers with the same name. In the common case of Set-Cookie headers, please use the cookies field instead. | ||
* @property {Number} status The status code. | ||
* @property {String} text The raw text representation of the response body. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me Gusta! Awesome that this would cut out a step we would have to do by hand 👍 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Figured we should do as much as we could!