diff --git a/docs/README.md b/docs/README.md index 594e153..4359cb4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ BrAPI.js is a JavaScript client library for [BrAPI](https://brapi.org). The call style of this library is inspired by [D3.js](https://d3js.org/). It can be used in either a browser or a Node.js application. It uses the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) (or [node-fetch](https://www.npmjs.com/package/node-fetch) in Node.js) for making AJAX calls. BrAPI.js is dependent on ES6 classes. -BrAPI.js supports BrAPI versions `v1.0`-`v1.3`. Currently, it expects a server to use a single version. +BrAPI.js supports BrAPI versions `v1.0`-`v2.0`. Currently, it expects a server to use a single version. ### Contents @@ -41,7 +41,7 @@ import BrAPI from './build/BrAPI.js'; ``` ```js // Node.js -const BrAPI = require('BrAPI.js'); +const BrAPI = require('./BrAPI.js'); ``` ## How it Works @@ -194,99 +194,198 @@ This method registers a callback function which is called once a node has loaded ### Available BrAPI Methods -| BrAPI.js Method | BrAPI Call | Default HTTPMethod | -| --------------- | ---------- | ------------------ | -| _node_.allelematrices_search(_params_,...) | `/allelematrices-search`(>=v1.2) or `/allelematrix-search`(=v1.2) or `/crops`(=v1.2) or `/observationLevels`(GET` | -| _node_.search_images(_params_,...) | `/search/images` | `POST-->GET` | -| _node_.search_markers(_params_,...) | `/markers-search`, `/search/markers` | `POST-->GET` | -| _node_.search_observationtables(_params_,...) | `/search/observationtables` | `POST-->GET` | -| _node_.search_observationunits(_params_,...) | `/search/observationunits` | `POST-->GET` | -| _node_.search_programs(_params_,...) | `/programs-search`, `/search/programs` | `POST-->GET` | -| _node_.search_samples(_params_,...) | `/samples-search`, `/search/samples` | `POST-->GET` | -| _node_.search_studies(_params_,...) | `/studies-search`, `/search/studies` | `POST-->GET` | -| _node_.search_variables(_params_,...) | `/variables-search`, `/search/variables` | `POST-->GET` | -| _node_.search(_entity_, _params_,...) | `/search/{entity-->search/{entity}/{searchResultDbId}` | `POST-->GET` | -| _node_.search_POST(_entity_, _params_,...)| `/search/{entity}` | `POST` | -| _node_.search_GET(_entity_, _params_,...)| `/search/{entity}/{searchResultDbId}` | `GET` | -| _node_.seasons(_params_,...) | `/seasons` | `GET` | -| _node_.studies_detail(_params_,...) | `/studies/{studyDbId}` | `GET` | -| _node_.studies_germplasm(_params_,...) | `/studies/{studyDbId}/germplasm` | `GET` | -| _node_.studies_layouts(_params_,...) | `/studies/{studyDbId}/layouts`, `/studies/{studyDbId}/layout` | `GET` | -| _node_.studies_observations_modify(_params_,...) | `/studies/{studyDbId}/observations/zip` | `POST` | -| _node_.studies_observations_modify(_params_,...) | `PUT /studies/{studyDbId}/observations`(>=v1.1) or `/studies/{studyDbId}/observations`(=v1.1) or `/studyTypes`(=v1.2) or `/vendor/plate-search`(=v1.2) or `/allelematrix-search`(=v1.2) or `/crops`(GET` | +| _node_.germplasm_store(_params_,...)||`/germplasm` | `POST` | +| _node_.germplasm(_params_,...) | `/germplasm` | `/germplasm` | `GET` | +| _node_.images_detail(_params_,...) | `/images/{imageDbId}` | `/images/{imageDbId}` | `GET` | +| _node_.images_imagecontent(_params_,...) | `/images/{imageDbId}/imagecontent` | | `PUT` | +| _node_.images_imagecontent_modify(_params_,...) | | `/images/{imageDbId}/imagecontent` | `PUT` | +| _node_.images_modify(_params_,...)||`/images/{imageDbId}` | `PUT` | +| _node_.images_store(_params_,...)||`/images` | `POST` | +| _node_.images(_params_,...) | `/images` | `/images` | `GET` | +| _node_.lists_detail(_params_,...) | `/lists/{listDbId}` | `/lists/{listDbId}` | `GET` | +| _node_.lists_modify(_params_,...)||`/lists/{listDbId}` | `PUT` | +| _node_.lists_items_store(_params_,...)||`/lists/{listDbId}/items` | `POST` | +| _node_.lists_store(_params_,...)||`/lists` | `POST` | +| _node_.lists(_params_,...) | `/lists` | `/lists` | `GET` | +| _node_.locations_detail(_params_,...) | `/locations/{locationDbId}` | `/locations/{locationDbId}` | `GET` | +| _node_.locations_modify(_params_,...)||`/locations/{locationDbId}` | `PUT` | +| _node_.locations_store(_params_,...)||`/locations` | `POST` | +| _node_.locations(_params_,...) | `/locations` | `/locations` | `GET` | +| _node_.maps_detail(_params_,...) | `/maps/{mapDbId}` | `/maps/{mapDbId}` | `GET` | +| _node_.maps_linkagegroups_detail(_params_,...) | `/maps/{mapsDbId}/positions/{linkageGroupId}` | | `GET` | +| _node_.maps_linkagegroups(_params_,...)||`/maps/{mapDbId}/linkagegroups `| `GET` | +| _node_.maps_positions(_params_,...) | `/maps/{mapsDbId}/positions` | | `GET` | +| _node_.maps(_params_,...) | `/maps` | `/maps` | `GET` | +| _node_.markerpositions(_params_,...)||`/markerpositions`|`GET`| +| _node_.markerprofiles_detail(_params_,...) | `/markerprofiles/{markerprofileDbId}` | | `GET` | +| _node_.markerprofiles_search(_params_,...) | `/markerprofiles-search` | | `POST` | +| _node_.markerprofiles(_params_,...) | `/markerprofiles` | | `GET` | +| _node_.markers_detail(_params_,...) | `/markers/{markerDbId}` | | `GET` | +| _node_.markers_search(_params_,...) | `/markers-search` | | `POST` | +| _node_.markers(_params_,...) | `/markers` | | `GET` | +| _node_.methods_detail(_params_,...) | `/methods/{methodDbId}` | `/methods/{methodDbId}` | `GET` | +| _node_.methods_modify(_params_,...)||`/methods/{methodDbId}` | `PUT` | +| _node_.methods_store(_params_,...)||`/methods` | `POST` | +| _node_.methods(_params_,...) | `/methods` | `/methods` | `GET` | +| _node_.observationlevels(_params_,...) | `/observationlevels`(>=v1.2) or `/observationLevels`(GET` | +| _node_.search_attributevalues(_params_,...)||`/search/attributevalues` | `POST-->GET` | +| _node_.search_calls(_params_,...)||`/search/calls` | `POST-->GET` | +| _node_.search_callsets(_params_,...)||`/search/callsets` | `POST-->GET` | +| _node_.search_germplasm(_params_,...) | `/germplasm-search` | `/search/germplasm` | `POST-->GET` | +| _node_.search_GET(_entity_, _params_,...)| `/search/{entity}/{searchResultDbId}` | | `GET` | +| _node_.search_images(_params_,...) | `/search/images` | `/search/images` | `POST-->GET` | +| _node_.search_lists(_params_,...)||`/search/lists` | `POST-->GET` | +| _node_.search_locations(_params_,...)||`/search/locations` | `POST-->GET` | +| _node_.search_markerpositions(_params_,...)||`/search/markerpositions` | `POST-->GET` | +| _node_.search_markers(_params_,...) | `/markers-search` | `/search/markers` | `POST-->GET` | +| _node_.search_observations(_params_,...)||`/search/observations` | `POST-->GET` | +| _node_.search_observationtables(_params_,...) | `/search/observationtables` | | `POST-->GET` | +| _node_.search_observationunits(_params_,...) | `/search/observationunits` | `/search/observationunits` | `POST-->GET` | +| _node_.search_people(_params_,...)||`/search/people` | `POST-->GET` | +| _node_.search_POST(_entity_, _params_,...)| `/search/{entity}` | | `POST` | +| _node_.search_programs(_params_,...) | `/programs-search` | `/search/programs` | `POST-->GET` | +| _node_.search_references(_params_,...)||`/search/references` | `POST-->GET` | +| _node_.search_referencesets(_params_,...)||`/search/referencesets` | `POST-->GET` | +| _node_.search_samples(_params_,...) | `/samples-search` | `/search/samples` | `POST-->GET` | +| _node_.search_studies(_params_,...) | `/studies-search` | `/search/studies` | `POST-->GET` | +| _node_.search_trials(_params_,...)||`/search/trials` | `POST-->GET` | +| _node_.search_variants(_params_,...)||`/search/variants` | `POST-->GET` | +| _node_.search_variantsets(_params_,...)||`/search/variantsets` | `POST-->GET` | +| _node_.search(_entity_, _params_,...) | `/search/{entity-->search/{entity}/{searchResultDbId}` | | `POST-->GET` | +| _node_.seasons_detail(_params_,...)||`/seasons/{seasonDbId}` | `GET` | +| _node_.seasons_modify(_params_,...)||`/seasons/{seasonDbId}` | `PUT` | +| _node_.seasons_store(_params_,...)||`/seasons` | `POST` | +| _node_.seasons(_params_,...) | `/seasons` | `/seasons` | `GET` | +| _node_.seedlots_detail_transactions(_params_,...)||`/seedlots/{seedLotDbId}/transactions` | `GET` | +| _node_.seedlots_detail(_params_,...)||`/seedlots/{seedLotDbId}` | `GET` | +| _node_.seedlots_modify(_params_,...)||`/seedlots/{seedLotDbId}` | `PUT` | +| _node_.seedlots_store(_params_,...)||`/seedlots` | `POST` | +| _node_.seedlots_transactions_store(_params_,...)||`/seedlots/transactions` | `POST` | +| _node_.seedlots_transactions(_params_,...)||`/seedlots/transactions` | `GET` | +| _node_.seedlots(_params_,...)||`/seedlots` | `GET` | +| _node_.studies_detail(_params_,...) | `/studies/{studyDbId}` | `/studies/{studyDbId}` | `GET` | +| _node_.studies_germplasm(_params_,...) | `/studies/{studyDbId}/germplasm` | | `GET` | +| _node_.studies_layouts(_params_,...) | `/studies/{studyDbId}/layouts` | `/studies/{studyDbId}/layout` | `GET` | +| _node_.studies_modify(_params_,...)||`/studies/{studyDbId}` | `PUT` | +| _node_.studies_observations_modify(_params_,...) | `PUT /studies/{studyDbId}/observations`(>=v1.1) or `/studies/{studyDbId}/observations`(=v1.1) or `/studyTypes`(=v1.2) or `/vendor/plate-search`( GET /search/attributes` +* @alias BrAPINode.prototype.search_attributes +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_attributes(params,behavior){ + this.version.check("POST /search/attributes -> GET /search/attributes",{ + introduced:"v2.0" + }); + return this.search("attributes",params,behavior); +}; diff --git a/src/brapi_methods/attributevalues.js b/src/brapi_methods/attributevalues.js new file mode 100644 index 0000000..217f4e6 --- /dev/null +++ b/src/brapi_methods/attributevalues.js @@ -0,0 +1,92 @@ +/** `GET /attributevalues` + * @alias BrAPINode.prototype.attributevalues + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function attributevalues (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/attributevalues', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /attributevalues` +* @alias BrAPINode.prototype.attributevalues_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function attributevalues_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/attributevalues', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /attributevalues/{attributeValueDbId}` + * @alias BrAPINode.prototype.attributevalues_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.attributeValueDbId attributeValueDbId + * @return {BrAPI_Behavior_Node} + */ +export function attributevalues_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/attributevalues/{attributeValueDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /attributevalues/{attributeValueDbId}` +* @alias BrAPINode.prototype.attributevalues_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function attributevalues_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/attributevalues/{attributeValueDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `POST /search/attributevalues -> GET /search/attributevalues` +* @alias BrAPINode.prototype.search_attributevalues +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_attributevalues(params,behavior){ + this.version.check("POST /search/attributevalues -> GET /search/attributevalues",{ + introduced:"v2.0" + }); + return this.search("attributevalues",params,behavior); +}; diff --git a/src/brapi_methods/calls.js b/src/brapi_methods/calls.js index 774dfdd..a8fc8cc 100644 --- a/src/brapi_methods/calls.js +++ b/src/brapi_methods/calls.js @@ -17,3 +17,16 @@ export function calls (params,behavior){ }); return this.simple_brapi_call(call); } + +/** `POST /search/calls -> GET /search/calls` +* @alias BrAPINode.prototype.search_calls +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_calls(params,behavior){ + this.version.check("POST /search/calls -> GET /search/calls",{ + introduced:"v2.0" + }); + return this.search("calls",params,behavior); +}; diff --git a/src/brapi_methods/callsets.js b/src/brapi_methods/callsets.js new file mode 100644 index 0000000..8fb630c --- /dev/null +++ b/src/brapi_methods/callsets.js @@ -0,0 +1,73 @@ + +/** `GET /callsets` + * @alias BrAPINode.prototype.callsets + * @param {Object} params Parameters to provide to the call + * @param {String} params.germplasmDbId germplasmDbId + * @return {BrAPI_Behavior_Node} + */ +export function callsets (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/callsets', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `GET /callsets/{callSetDbId}` + * @alias BrAPINode.prototype.callsets_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.callSetDbId callSetDbId + * @return {BrAPI_Behavior_Node} + */ +export function callsets_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/callsets/{callSetDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `GET /callsets/{callSetDbId}/calls` + * @alias BrAPINode.prototype.callsets_calls + * @param {Object} params Parameters to provide to the call + * @param {String} params.callSetDbId callSetDbId + * @return {BrAPI_Behavior_Node} + */ +export function callsets_calls (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/callsets/{callSetDbId}/calls', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `POST /search/callsets -> GET /search/callsets` +* @alias BrAPINode.prototype.search_callsets +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_callsets(params,behavior){ + this.version.check("POST /search/callsets -> GET /search/callsets",{ + introduced:"v2.0" + }); + return this.search("callsets",params,behavior); +}; diff --git a/src/brapi_methods/commoncropnames.js b/src/brapi_methods/commoncropnames.js index fc9d236..19ae353 100644 --- a/src/brapi_methods/commoncropnames.js +++ b/src/brapi_methods/commoncropnames.js @@ -11,16 +11,17 @@ export function commoncropnames (params,behavior){ 'behaviorOptions': ['fork','map'], 'behavior': behavior, } - if (this.version.predates("v1.2")){ + if (this.version.predates("v1.3")){ call.urlTemplate = "/crops" this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.2" + deprecated:"v1.3", + deprecated:"v2.0" }); } else { - call.urlTemplate = "/commonCropNames" + call.urlTemplate = "/commoncropnames" this.version.check(call.urlTemplate,{ - introduced:"v1.2" + introduced:"v1.3" }); } return this.simple_brapi_call(call); diff --git a/src/brapi_methods/crosses.js b/src/brapi_methods/crosses.js new file mode 100644 index 0000000..8257545 --- /dev/null +++ b/src/brapi_methods/crosses.js @@ -0,0 +1,59 @@ +/** `GET /crosses` + * @alias BrAPINode.prototype.crosses + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function crosses (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/crosses', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /crosses` +* @alias BrAPINode.prototype.crosses_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function crosses_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/crosses', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /crosses` +* @alias BrAPINode.prototype.crosses_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function crosses_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/crosses', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} \ No newline at end of file diff --git a/src/brapi_methods/crossingprojects.js b/src/brapi_methods/crossingprojects.js new file mode 100644 index 0000000..d7e05d5 --- /dev/null +++ b/src/brapi_methods/crossingprojects.js @@ -0,0 +1,79 @@ +/** `GET /crossingprojects` + * @alias BrAPINode.prototype.crossingprojects + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function crossingprojects (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/crossingprojects', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /crossingprojects` +* @alias BrAPINode.prototype.crossingprojects_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function crossingprojects_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/crossingprojects', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /crossingprojects/{crossingProjectDbId}` + * @alias BrAPINode.prototype.crossingprojects_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.crossingProjectDbId crossingProjectDbId + * @return {BrAPI_Behavior_Node} + */ +export function crossingprojects_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/crossingprojects/{crossingProjectDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `PUT /crossingprojects/{crossingProjectDbId}` +* @alias BrAPINode.prototype.crossingprojects_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function crossingprojects_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/crossingprojects/{crossingProjectDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} diff --git a/src/brapi_methods/events.js b/src/brapi_methods/events.js new file mode 100644 index 0000000..26e6301 --- /dev/null +++ b/src/brapi_methods/events.js @@ -0,0 +1,19 @@ +/** `GET /events` + * @alias BrAPINode.prototype.events + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function events (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/events', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} \ No newline at end of file diff --git a/src/brapi_methods/germplasm.js b/src/brapi_methods/germplasm.js index b5ec187..de7d79a 100644 --- a/src/brapi_methods/germplasm.js +++ b/src/brapi_methods/germplasm.js @@ -18,6 +18,27 @@ export function germplasm (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /germplasm` +* @alias BrAPINode.prototype.germplasm_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function germplasm_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/germplasm', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + /** `POST /germplasm-search` * @alias BrAPINode.prototype.germplasm_search * @param {Object} params Parameters to provide to the call @@ -47,6 +68,26 @@ export function germplasm_detail (params){ return this.simple_brapi_call(call); } +/** `PUT /germplasm/{germplasmDbId}` +* @alias BrAPINode.prototype.germplasm_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function germplasm_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/germplasm/{germplasmDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /germplasm/{germplasmDbId}/mcpd` * @alias BrAPINode.prototype.germplasm_mcpd * @param {Object} params Parameters to provide to the call @@ -82,7 +123,8 @@ export function germplasm_attributes (params,behavior){ 'behavior': behavior, } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } @@ -141,7 +183,8 @@ export function germplasm_markerprofiles (params){ 'behavior': 'map', } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } @@ -163,7 +206,8 @@ export function search_germplasm(params,behavior,useOld){ } this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.3" + deprecated:"v1.3", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } diff --git a/src/brapi_methods/images.js b/src/brapi_methods/images.js index beb339a..90d3400 100644 --- a/src/brapi_methods/images.js +++ b/src/brapi_methods/images.js @@ -18,6 +18,26 @@ export function images (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /images` +* @alias BrAPINode.prototype.images_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function images_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/images', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /images/{imageDbId}` * @alias BrAPINode.prototype.images_detail * @param {Object} params Parameters to provide to the call @@ -37,6 +57,26 @@ export function images_detail (params){ return this.simple_brapi_call(call); } +/** `PUT /images/{imageDbId}` +* @alias BrAPINode.prototype.images_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function images_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/images/{imageDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `PUT /images/{imageDbId}/imagecontent` * @alias BrAPINode.prototype.images_imagecontent * @param {Object} params Parameters to provide to the call @@ -56,6 +96,25 @@ export function images_imagecontent (params){ return this.simple_brapi_call(call); } +/** `PUT /images/{imageDbId}/imagecontent` + * @alias BrAPINode.prototype.images_imagecontent_modify + * @param {Object} params Parameters to provide to the call + * @param {String} params.imageDbId imageDbId + * @return {BrAPI_Behavior_Node} + */ +export function images_imagecontent_modify (params){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/images/{imageDbId}/imagecontent', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `POST /search/images -> GET /search/images` * @alias BrAPINode.prototype.search_images * @param {Object} params Parameters to provide to the call diff --git a/src/brapi_methods/lists.js b/src/brapi_methods/lists.js index 757ad5f..6055776 100644 --- a/src/brapi_methods/lists.js +++ b/src/brapi_methods/lists.js @@ -18,6 +18,26 @@ export function lists (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /lists` +* @alias BrAPINode.prototype.lists_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function lists_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/lists', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /lists/{listDbId}` * @alias BrAPINode.prototype.lists_detail * @param {Object} params Parameters to provide to the call @@ -37,21 +57,66 @@ export function lists_detail (params){ return this.simple_brapi_call(call); } -/** `PUT /lists/{listDbId}/items` - * @alias BrAPINode.prototype.lists_items +/** `PUT /lists/{listDbId}` +* @alias BrAPINode.prototype.lists_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function lists_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/lists/{listDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /lists/{listDbId}/items` + * @alias BrAPINode.prototype.lists_items_store * @param {Object} params Parameters to provide to the call * @param {String} params.imageDbId imageDbId * @return {BrAPI_Behavior_Node} */ -export function lists_items (params){ +export function lists_items_store (params){ var call = { - 'defaultMethod': 'put', + 'defaultMethod': 'post', 'urlTemplate': '/lists/{listDbId}/items', 'params': params, 'behavior': 'map', } this.version.check(call.urlTemplate,{ - introduced:"v1.3" + introduced:"v1.3", + introduced:"v2.0" }); return this.simple_brapi_call(call); } + + +/** `POST /search/lists` +* @alias BrAPINode.prototype.lists_search +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function lists_search(params,behavior){ + return this.search_lists(params,behavior,true); +}; + +/** `POST /search/lists -> GET /search/lists` +* @alias BrAPINode.prototype.search_lists +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_lists(params,behavior){ + this.version.check("POST /search/lists -> GET /search/lists",{ + introduced:"v2.0" + }); + return this.search("lists",params,behavior); +}; diff --git a/src/brapi_methods/locations.js b/src/brapi_methods/locations.js index 648c7df..52c2ab5 100644 --- a/src/brapi_methods/locations.js +++ b/src/brapi_methods/locations.js @@ -18,6 +18,26 @@ export function locations (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /locations` +* @alias BrAPINode.prototype.locations_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function locations_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/locations', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /locations/{locationDbId}` * @alias BrAPINode.prototype.locations_detail * @param {Object} params Parameters to provide to the call @@ -36,3 +56,47 @@ export function locations_detail (params){ }); return this.simple_brapi_call(call); } + + +/** `PUT /locations/{locationDbId}` +* @alias BrAPINode.prototype.locations_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function locations_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/locations/{locationDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /search/locations` +* @alias BrAPINode.prototype.locations_search +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function locations_search(params,behavior){ + return this.search_locations(params,behavior,true); +}; + +/** `POST /search/locations -> GET /search/locations` +* @alias BrAPINode.prototype.search_locations +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_locations(params,behavior){ + this.version.check("POST /search/locations -> GET /search/locations",{ + introduced:"v2.0" + }); + return this.search("locations",params,behavior); +}; diff --git a/src/brapi_methods/maps.js b/src/brapi_methods/maps.js index 3929674..ebafeca 100644 --- a/src/brapi_methods/maps.js +++ b/src/brapi_methods/maps.js @@ -62,7 +62,8 @@ export function maps_positions (params,behavior){ 'behavior': behavior, } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } @@ -84,7 +85,29 @@ export function maps_linkagegroups_detail (params,behavior){ 'behavior': behavior, } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /maps/{mapsDbId}/linkagegroups` + * @alias BrAPINode.prototype.maps_linkagegroups + * @param {Object} params Parameters to provide to the call + * @param {String} params.mapsDbId mapsDbId + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function maps_linkagegroups (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/maps/{mapsDbId}/linkagegroups', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" }); return this.simple_brapi_call(call); } diff --git a/src/brapi_methods/markers.js b/src/brapi_methods/markers.js index c4e84a4..580d34e 100644 --- a/src/brapi_methods/markers.js +++ b/src/brapi_methods/markers.js @@ -16,12 +16,14 @@ export function markers(params,behavior){ if(this.version.predates("v1.3")){ this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.1" + deprecated:"v1.1", + deprecated:"v2.0" }); } else { this.version.check(call.urlTemplate,{ - introduced:"v1.3" + introduced:"v1.3", + deprecated:"v2.0" }); } return this.simple_brapi_call(call); @@ -41,7 +43,28 @@ export function markers_detail (params){ 'behavior': 'map', } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /markerpositions` + * @alias BrAPINode.prototype.markerpositions + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function markerpositions (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/markerpositions', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" }); return this.simple_brapi_call(call); } @@ -73,13 +96,29 @@ export function search_markers(params,behavior,useOld){ call.defaultMethod = "post"; this.version.check(call.urlTemplate,{ introduced:"v1.1", - deprecated:"v1.3" + deprecated:"v1.3", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } else { this.version.check("POST /search/markers -> GET /search/markers",{ - introduced:"v1.3" + introduced:"v1.3", + deprecated:"v2.0" }); return this.search("markers",params,behavior); } }; + + +/** `POST /search/markerpositions -> GET /search/markerpositions` +* @alias BrAPINode.prototype.search_markerpositions +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_markerpositions(params,behavior){ + this.version.check("POST /search/markerpositions -> GET /search/markerpositions",{ + introduced:"v2.0" + }); + return this.search("markerpositions",params,behavior); +}; diff --git a/src/brapi_methods/methods.js b/src/brapi_methods/methods.js index cb75c41..8f9f9a0 100644 --- a/src/brapi_methods/methods.js +++ b/src/brapi_methods/methods.js @@ -18,6 +18,26 @@ export function methods (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /methods` +* @alias BrAPINode.prototype.methods_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function methods_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/methods', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /methods/{methodDbId}` * @alias BrAPINode.prototype.methods_detail * @param {Object} params Parameters to provide to the call @@ -36,3 +56,23 @@ export function methods_detail (params){ }); return this.simple_brapi_call(call); } + +/** `PUT /methods/{methodDbId}` +* @alias BrAPINode.prototype.methods_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function methods_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/methods/{methodDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} \ No newline at end of file diff --git a/src/brapi_methods/observationlevels.js b/src/brapi_methods/observationlevels.js index fd482da..66b265f 100644 --- a/src/brapi_methods/observationlevels.js +++ b/src/brapi_methods/observationlevels.js @@ -16,7 +16,8 @@ export function observationlevels (params,behavior){ call.urlTemplate = "/observationLevels" this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.2" + deprecated:"v1.2", + deprecated:"v2.0" }); } else { call.urlTemplate = "/observationlevels" diff --git a/src/brapi_methods/observations.js b/src/brapi_methods/observations.js new file mode 100644 index 0000000..a26c06b --- /dev/null +++ b/src/brapi_methods/observations.js @@ -0,0 +1,133 @@ +/** `GET /observations` + * @alias BrAPINode.prototype.observations + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function observations (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/observations', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /observations` + * @alias BrAPINode.prototype.observations_store + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function observations_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/observations', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /observations` + * @alias BrAPINode.prototype.observations_modify_multiple + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function observations_modify_multiple (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/observations', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `GET /observations/{observationDbId}` + * @alias BrAPINode.prototype.observations_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.observationDbId observationDbId + * @return {BrAPI_Behavior_Node} + */ +export function observations_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/observations/{observationDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `PUT /observations/{observationDbId}` +* @alias BrAPINode.prototype.observations_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function observations_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/observations/{observationDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `GET /observations/table` + * @alias BrAPINode.prototype.observations_table + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function observations_table (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate':'/observations/table', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + + return this.simple_brapi_call(call); +} + +/** `POST /search/observations -> GET /search/observations` +* @alias BrAPINode.prototype.search_observations +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_observations(params,behavior){ + this.version.check("POST /search/observations -> GET /search/observations",{ + introduced:"v2.0" + }); + return this.search("observations",params,behavior); +}; diff --git a/src/brapi_methods/observationunits.js b/src/brapi_methods/observationunits.js index 1609d48..ccf0c39 100644 --- a/src/brapi_methods/observationunits.js +++ b/src/brapi_methods/observationunits.js @@ -18,6 +18,108 @@ export function observationunits (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /observationunits` +* @alias BrAPINode.prototype.observationunits_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function observationunits_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/observationunits', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /observationunits` +* @alias BrAPINode.prototype.observationunits_modify_multiple +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function observationunits_modify_multiple (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/observationunits', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /observationunits/{observationUnitDbId}` + * @alias BrAPINode.prototype.observationunits_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.observationUnitDbId observationUnitDbId + * @return {BrAPI_Behavior_Node} + */ +export function observationunits_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/observationunits/{observationUnitDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v1.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /observationunits/{observationUnitDbId}` +* @alias BrAPINode.prototype.observationunits_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function observationunits_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/observationunits/{observationUnitDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /observationunits/table` + * @alias BrAPINode.prototype.observationunits_table + * @param {Object} params Parameters to provide to the call + * @param {String} params.studyDbId studyDbId + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function observationunits_table (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate':'/observationunits/table', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + + return this.simple_brapi_call(call); +} + + /** `POST /search/observationunits -> GET /search/observationunits` * @alias BrAPINode.prototype.search_observationunits * @param {Object} params Parameters to provide to the call @@ -39,7 +141,8 @@ export function search_observationunits(params,behavior){ */ export function search_observationtables(params,behavior){ this.version.check("POST /search/observationtables -> GET /search/observationtables",{ - introduced:"v1.3" + introduced:"v1.3", + deprecated:"v2.0" }); return this.search("observationtables",params,behavior); }; diff --git a/src/brapi_methods/people.js b/src/brapi_methods/people.js index 50cb334..a1b5052 100644 --- a/src/brapi_methods/people.js +++ b/src/brapi_methods/people.js @@ -18,6 +18,26 @@ export function people (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /people` +* @alias BrAPINode.prototype.people_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function people_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/people', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /people/{personDbId}` * @alias BrAPINode.prototype.people_detail * @param {Object} params Parameters to provide to the call @@ -36,3 +56,37 @@ export function people_detail (params){ }); return this.simple_brapi_call(call); } + + +/** `PUT /people/{personDbId}` +* @alias BrAPINode.prototype.people_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function people_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/people/{personDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /search/people -> GET /search/people` +* @alias BrAPINode.prototype.search_people +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_people(params,behavior){ + this.version.check("POST /search/people -> GET /search/people",{ + introduced:"v2.0" + }); + return this.search("people",params,behavior); +}; diff --git a/src/brapi_methods/phenotypes.js b/src/brapi_methods/phenotypes.js index db9b2fb..f7415ac 100644 --- a/src/brapi_methods/phenotypes.js +++ b/src/brapi_methods/phenotypes.js @@ -40,7 +40,7 @@ export function phenotypes_search (params,behavior){ } /** `POST /phenotypes-search/csv` - * @alias BrAPINode.prototype.phenotypes_search + * @alias BrAPINode.prototype.phenotypes_search_csv * @param {Object} params Parameters to provide to the call * @param {String} [behavior="fork"] Behavior of the node * @return {BrAPI_Behavior_Node} @@ -61,7 +61,7 @@ export function phenotypes_search_csv (params,behavior){ } /** `POST /phenotypes-search/table` - * @alias BrAPINode.prototype.phenotypes_search + * @alias BrAPINode.prototype.phenotypes_search_table * @param {Object} params Parameters to provide to the call * @param {String} [behavior="fork"] Behavior of the node * @return {BrAPI_Behavior_Node} @@ -82,7 +82,7 @@ export function phenotypes_search_table (params,behavior){ } /** `POST /phenotypes-search/tsv` - * @alias BrAPINode.prototype.phenotypes_search + * @alias BrAPINode.prototype.phenotypes_search_tsv * @param {Object} params Parameters to provide to the call * @param {String} [behavior="fork"] Behavior of the node * @return {BrAPI_Behavior_Node} diff --git a/src/brapi_methods/plannedcrosses.js b/src/brapi_methods/plannedcrosses.js new file mode 100644 index 0000000..6a9f271 --- /dev/null +++ b/src/brapi_methods/plannedcrosses.js @@ -0,0 +1,60 @@ +/** `GET /plannedcrosses` + * @alias BrAPINode.prototype.plannedcrosses + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function plannedcrosses (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/plannedcrosses', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /plannedcrosses` +* @alias BrAPINode.prototype.plannedcrosses_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function plannedcrosses_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/plannedcrosses', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + +/** `PUT /plannedcrosses` +* @alias BrAPINode.prototype.plannedcrosses_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function plannedcrosses_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/plannedcrosses', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} \ No newline at end of file diff --git a/src/brapi_methods/programs.js b/src/brapi_methods/programs.js index abfb722..aa7b52d 100644 --- a/src/brapi_methods/programs.js +++ b/src/brapi_methods/programs.js @@ -18,6 +18,65 @@ export function programs (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /programs` +* @alias BrAPINode.prototype.programs_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function programs_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/programs', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /programs/{programDbId}` + * @alias BrAPINode.prototype.programs_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.programDbId programDbId + * @return {BrAPI_Behavior_Node} + */ +export function programs_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/programs/{programDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /programs/{programDbId}` +* @alias BrAPINode.prototype.programs_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function programs_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/programs/{programDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `POST /programs-search` * @alias BrAPINode.prototype.programs_search * @param {Object} params Parameters to provide to the call @@ -45,7 +104,8 @@ export function search_programs(params,behavior,useOld){ call.defaultMethod = "post"; this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.3" + deprecated:"v1.3", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } else { diff --git a/src/brapi_methods/references.js b/src/brapi_methods/references.js new file mode 100644 index 0000000..8bb1972 --- /dev/null +++ b/src/brapi_methods/references.js @@ -0,0 +1,70 @@ +/** `GET /references` + * @alias BrAPINode.prototype.references + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function references (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/references', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /references/{referenceDbId}` + * @alias BrAPINode.prototype.references_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.referenceDbId referenceDbId + * @return {BrAPI_Behavior_Node} + */ +export function references_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/references/{referenceDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /references/{referenceDbId}/bases` + * @alias BrAPINode.prototype.references_bases + * @param {Object} params Parameters to provide to the call + * @param {String} params.referenceDbId referenceDbId + * @return {BrAPI_Behavior_Node} + */ +export function references_bases (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/references/{referenceDbId}/bases', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /search/references -> GET /search/references` +* @alias BrAPINode.prototype.search_references +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_references(params,behavior){ + this.version.check("POST /search/references -> GET /search/references",{ + introduced:"v2.0" + }); + return this.search("references",params,behavior); +}; diff --git a/src/brapi_methods/referencesets.js b/src/brapi_methods/referencesets.js new file mode 100644 index 0000000..6a68b76 --- /dev/null +++ b/src/brapi_methods/referencesets.js @@ -0,0 +1,51 @@ +/** `GET /referencesets` + * @alias BrAPINode.prototype.referencesets + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function referencesets (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/referencesets', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /referencesets/{referenceSetDbId}` + * @alias BrAPINode.prototype.referencesets_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.referenceSetDbId referenceSetDbId + * @return {BrAPI_Behavior_Node} + */ +export function referencesets_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/referencesets/{referenceSetDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /search/referencesets -> GET /search/referencesets` +* @alias BrAPINode.prototype.search_referencesets +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_referencesets(params,behavior){ + this.version.check("POST /search/referencesets -> GET /search/referencesets",{ + introduced:"v2.0" + }); + return this.search("referencesets",params,behavior); +}; diff --git a/src/brapi_methods/samples.js b/src/brapi_methods/samples.js index 9eff650..dfbb301 100644 --- a/src/brapi_methods/samples.js +++ b/src/brapi_methods/samples.js @@ -16,16 +16,36 @@ export function samples (params){ return this.simple_brapi_call(call); } -/** `GET /samples/{sampleId}` +/** `POST /samples` +* @alias BrAPINode.prototype.samples_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function samples_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/samples', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /samples/{sampleDbId}` * @alias BrAPINode.prototype.samples_detail * @param {Object} params Parameters to provide to the call - * @param {String} params.sampleId sampleId + * @param {String} params.sampleDbId sampleDbId * @return {BrAPI_Behavior_Node} */ export function samples_detail (params){ var call = { - 'defaultMethod': 'put', - 'urlTemplate': '/samples/{sampleId}', + 'defaultMethod': 'get', + 'urlTemplate': '/samples/{sampleDbId}', 'params': params, 'behavior': 'map', } @@ -35,6 +55,25 @@ export function samples_detail (params){ return this.simple_brapi_call(call); } +/** `PUT /samples/{sampleDbId}` + * @alias BrAPINode.prototype.samples_modify + * @param {Object} params Parameters to provide to the call + * @param {String} params.sampleDbId sampleDbId + * @return {BrAPI_Behavior_Node} + */ +export function samples_modify (params){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/samples/{sampleDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `POST /samples-search` * @alias BrAPINode.prototype.samples_search * @param {Object} params Parameters to provide to the call @@ -62,7 +101,8 @@ export function search_samples(params,behavior,useOld){ call.defaultMethod = "post"; this.version.check(call.urlTemplate,{ introduced:"v1.1", - deprecated:"v1.3" + deprecated:"v1.3", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } else { diff --git a/src/brapi_methods/scales.js b/src/brapi_methods/scales.js index 2bf9c2a..e7c16f2 100644 --- a/src/brapi_methods/scales.js +++ b/src/brapi_methods/scales.js @@ -18,6 +18,26 @@ export function scales (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /scales` +* @alias BrAPINode.prototype.scales_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function scales_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/scales', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /scales/{scaleDbId}` * @alias BrAPINode.prototype.scales_detail * @param {Object} params Parameters to provide to the call @@ -36,3 +56,23 @@ export function scales_detail (params){ }); return this.simple_brapi_call(call); } + +/** `PUT /scales/{scaleDbId}` +* @alias BrAPINode.prototype.scales_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function scales_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/scales/{scaleDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} \ No newline at end of file diff --git a/src/brapi_methods/seasons.js b/src/brapi_methods/seasons.js index dd00f2d..caf9f97 100644 --- a/src/brapi_methods/seasons.js +++ b/src/brapi_methods/seasons.js @@ -17,3 +17,62 @@ export function seasons (params,behavior){ }); return this.simple_brapi_call(call); } + +/** `POST /seasons` +* @alias BrAPINode.prototype.seasons_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function seasons_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/seasons', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /seasons/{seasonDbId}` + * @alias BrAPINode.prototype.seasons_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.seasonDbId seasonDbId + * @return {BrAPI_Behavior_Node} + */ +export function seasons_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/seasons/{seasonDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /seasons/{seasonDbId}` +* @alias BrAPINode.prototype.seasons_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function seasons_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/seasons/{seasonDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} diff --git a/src/brapi_methods/seedlots.js b/src/brapi_methods/seedlots.js new file mode 100644 index 0000000..470024f --- /dev/null +++ b/src/brapi_methods/seedlots.js @@ -0,0 +1,139 @@ +/** `GET /seedlots` + * @alias BrAPINode.prototype.seedlots + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function seedlots (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/seedlots', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /seedlots` +* @alias BrAPINode.prototype.seedlots_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function seedlots_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/seedlots', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /seedlots/{seedLotDbId}` + * @alias BrAPINode.prototype.seedlots_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.seedLotDbId seedLotDbId + * @return {BrAPI_Behavior_Node} + */ +export function seedlots_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/seedlots/{seedLotDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `PUT /seedlots/{seedLotDbId}` +* @alias BrAPINode.prototype.seedlots_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function seedlots_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/seedlots/{seedLotDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /seedlots/transactions` + * @alias BrAPINode.prototype.seedlots_transactions + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function seedlots_transactions (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/seedlots/transactions', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /seedlots/transactions` +* @alias BrAPINode.prototype.seedlots_transactions_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ + +export function seedlots_transactions_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/seedlots/transactions', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /seedlots/{seedLotDbId}/transactions` + * @alias BrAPINode.prototype.seedlots_detail_transactions + * @param {Object} params Parameters to provide to the call + * @param {String} params.seedLotDbId seedLotDbId + * @return {BrAPI_Behavior_Node} + */ + +export function seedlots_detail_transactions (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/seedlots/{seedLotDbId}/transactions', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} diff --git a/src/brapi_methods/serverinfo.js b/src/brapi_methods/serverinfo.js new file mode 100644 index 0000000..0f03fb5 --- /dev/null +++ b/src/brapi_methods/serverinfo.js @@ -0,0 +1,19 @@ +/** `GET /serverinfo` + * @alias BrAPINode.prototype.serverinfo + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function serverinfo (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/serverinfo', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} \ No newline at end of file diff --git a/src/brapi_methods/studies.js b/src/brapi_methods/studies.js index c8e1131..1acf263 100644 --- a/src/brapi_methods/studies.js +++ b/src/brapi_methods/studies.js @@ -25,7 +25,8 @@ export function search_studies(params,behavior,useOld){ call.defaultMethod = "post"; this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.3" + deprecated:"v1.3", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } else { @@ -56,6 +57,26 @@ export function studies (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /studies` + * @alias BrAPINode.prototype.studies_store + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function studies_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/studies', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + + /** `GET /studies/{studyDbId}` * @alias BrAPINode.prototype.studies_detail * @param {Object} params Parameters to provide to the call @@ -75,6 +96,25 @@ export function studies_detail (params){ return this.simple_brapi_call(call); } +/** `PUT /studies/{studyDbId}` + * @alias BrAPINode.prototype.studies_modify + * @param {Object} params Parameters to provide to the call + * @param {String} params.studyDbId studyDbId + * @return {BrAPI_Behavior_Node} + */ +export function studies_modify (params){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/studies/{studyDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /studies/{studyDbId}/germplasm` * @alias BrAPINode.prototype.studies_germplasm * @param {Object} params Parameters to provide to the call @@ -91,7 +131,8 @@ export function studies_germplasm (params,behavior){ 'behavior': behavior, } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } @@ -113,12 +154,14 @@ export function studies_layouts (params,behavior){ if(this.version.predates("v1.3")){ call.urlTemplate = '/studies/{studyDbId}/layout'; this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); } else { call.urlTemplate = '/studies/{studyDbId}/layouts'; this.version.check(call.urlTemplate,{ - introduced:"v1.3" + introduced:"v1.3", + deprecated:"v2.0" }); } return this.simple_brapi_call(call); @@ -140,7 +183,8 @@ export function studies_observations (params,behavior){ 'behavior': behavior, } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } @@ -162,12 +206,14 @@ export function studies_observations_modify (params){ call.defaultMethod = "post" this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.1" + deprecated:"v1.1", + deprecated:"v2.0" }); } else { call.defaultMethod = "put" this.version.check(call.urlTemplate,{ - introduced:"v1.1" + introduced:"v1.1", + deprecated:"v2.0" }); } @@ -175,7 +221,7 @@ export function studies_observations_modify (params){ } /** `POST /studies/{studyDbId}/observations/zip` - * @alias BrAPINode.prototype.studies_observations_modify + * @alias BrAPINode.prototype.studies_observations_zip * @param {Object} params Parameters to provide to the call * @param {String} params.studyDbId studyDbId * @return {BrAPI_Behavior_Node} @@ -188,7 +234,8 @@ export function studies_observations_zip (params){ 'behavior': 'map', } this.version.check(call.urlTemplate,{ - introduced:"v1.1" + introduced:"v1.1", + deprecated:"v2.0" }); return this.simple_brapi_call(call); @@ -212,12 +259,14 @@ export function studies_observationvariables (params,behavior){ call.urlTemplate= '/studies/{studyDbId}/observationVariables', this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.1" + deprecated:"v1.1", + deprecated:"v2.0" }); } else { call.urlTemplate= '/studies/{studyDbId}/observationvariables', this.version.check(call.urlTemplate,{ - introduced:"v1.1" + introduced:"v1.1", + deprecated:"v2.0" }); } @@ -240,7 +289,8 @@ export function studies_table (params,behavior){ 'behavior': behavior, } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); return this.simple_brapi_call(call); @@ -262,7 +312,8 @@ export function studies_table_add (params,behavior){ 'behavior': behavior, } this.version.check(call.urlTemplate,{ - introduced:"v1.0" + introduced:"v1.0", + deprecated:"v2.0" }); return this.simple_brapi_call(call); @@ -285,7 +336,8 @@ export function studytypes (params,behavior){ call.urlTemplate = '/studyTypes'; this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.1" + deprecated:"v1.1", + deprecated:"v2.0" }); } else { call.urlTemplate = '/studytypes'; diff --git a/src/brapi_methods/traits.js b/src/brapi_methods/traits.js index d0ba539..194984a 100644 --- a/src/brapi_methods/traits.js +++ b/src/brapi_methods/traits.js @@ -18,6 +18,26 @@ export function traits (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /traits` +* @alias BrAPINode.prototype.traits_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function traits_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/traits', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /traits/{traitDbId}` * @alias BrAPINode.prototype.traits_detail * @param {Object} params Parameters to provide to the call @@ -36,3 +56,23 @@ export function traits_detail (params){ }); return this.simple_brapi_call(call); } + +/** `PUT /traits/{traitDbId}` +* @alias BrAPINode.prototype.traits_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function traits_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/traits/{traitDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} diff --git a/src/brapi_methods/trials.js b/src/brapi_methods/trials.js index 7d6ead1..5847719 100644 --- a/src/brapi_methods/trials.js +++ b/src/brapi_methods/trials.js @@ -18,6 +18,26 @@ export function trials (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /trials` +* @alias BrAPINode.prototype.trials_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function trials_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/trials', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /trials/{trialDbId}` * @alias BrAPINode.prototype.trials_detail * @param {Object} params Parameters to provide to the call @@ -36,3 +56,47 @@ export function trials_detail (params){ }); return this.simple_brapi_call(call); } + + +/** `PUT /trials/{trialDbId}` +* @alias BrAPINode.prototype.trials_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function trials_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/trials/{trialDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /search/trials` +* @alias BrAPINode.prototype.trials_search +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function trials_search(params,behavior){ + return this.search_trials(params,behavior,true); +}; + +/** `POST /search/trials -> GET /search/trials` +* @alias BrAPINode.prototype.search_trials +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_trials(params,behavior){ + this.version.check("POST /search/trials -> GET /search/trials",{ + introduced:"v2.0" + }); + return this.search("trials",params,behavior); +}; diff --git a/src/brapi_methods/variables.js b/src/brapi_methods/variables.js index 2d66e05..9e023a3 100644 --- a/src/brapi_methods/variables.js +++ b/src/brapi_methods/variables.js @@ -18,6 +18,26 @@ export function variables (params,behavior){ return this.simple_brapi_call(call); } +/** `POST /variables` +* @alias BrAPINode.prototype.variables_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function variables_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/variables', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `POST /variables-search` * @alias BrAPINode.prototype.variables_search * @param {Object} params Parameters to provide to the call @@ -75,6 +95,26 @@ export function variables_detail (params){ return this.simple_brapi_call(call); } +/** `PUT /variables/{observationVariableDbId}` +* @alias BrAPINode.prototype.variables_modify +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function variables_modify (params,behavior){ + var call = { + 'defaultMethod': 'put', + 'urlTemplate': '/variables/{observationVariableDbId}', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /variables/datatypes` * @alias BrAPINode.prototype.variables_datatypes * @param {Object} params Parameters to provide to the call @@ -91,7 +131,8 @@ export function variables_datatypes (params,behavior){ } this.version.check(call.urlTemplate,{ introduced:"v1.0", - deprecated:"v1.3" + deprecated:"v1.3", + deprecated:"v2.0" }); return this.simple_brapi_call(call); } diff --git a/src/brapi_methods/variants.js b/src/brapi_methods/variants.js new file mode 100644 index 0000000..3089040 --- /dev/null +++ b/src/brapi_methods/variants.js @@ -0,0 +1,70 @@ +/** `GET /variants` + * @alias BrAPINode.prototype.variants + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function variants (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variants', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /variants/{variantDbId}` + * @alias BrAPINode.prototype.variants_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.variantDbId variantDbId + * @return {BrAPI_Behavior_Node} + */ +export function variants_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variants/{variantDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /variants/{variantDbId}/calls` + * @alias BrAPINode.prototype.variants_calls + * @param {Object} params Parameters to provide to the call + * @param {String} params.variantDbId variantDbId + * @return {BrAPI_Behavior_Node} + */ +export function variants_calls (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variants/{variantDbId}/calls', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /search/variants -> GET /search/variants` +* @alias BrAPINode.prototype.search_variants +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_variants(params,behavior){ + this.version.check("POST /search/variants -> GET /search/variants",{ + introduced:"v2.0" + }); + return this.search("variants",params,behavior); +}; diff --git a/src/brapi_methods/variantsets.js b/src/brapi_methods/variantsets.js new file mode 100644 index 0000000..d584f7b --- /dev/null +++ b/src/brapi_methods/variantsets.js @@ -0,0 +1,134 @@ +/** `GET /variantsets` + * @alias BrAPINode.prototype.variantsets + * @param {Object} params Parameters to provide to the call + * @param {String} [behavior="fork"] Behavior of the node + * @return {BrAPI_Behavior_Node} + */ +export function variantsets (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variantsets', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /variantsets/extract` +* @alias BrAPINode.prototype.variantsets_extract_store +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function variantsets_extract_store (params,behavior){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/variantsets/extract', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /variantsets/{variantSetDbId}` + * @alias BrAPINode.prototype.variantsets_detail + * @param {Object} params Parameters to provide to the call + * @param {String} params.variantSetDbId variantSetDbId + * @return {BrAPI_Behavior_Node} + */ +export function variantsets_detail (params){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variantsets/{variantSetDbId}', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /variantsets/{variantSetDbId}/calls` +* @alias BrAPINode.prototype.variantsets_calls +* @param {Object} params Parameters to provide to the call +* @param {String} params.variantSetDbId variantSetDbId +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function variantsets_calls (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variantsets/{variantSetDbId}/calls', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /variantsets/{variantSetDbId}/callsets` +* @alias BrAPINode.prototype.variantsets_callsets +* @param {Object} params Parameters to provide to the call +* @param {String} params.variantSetDbId variantSetDbId +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function variantsets_callsets (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variantsets/{variantSetDbId}/callsets', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `GET /variantsets/{variantSetDbId}/variants` +* @alias BrAPINode.prototype.variantsets_variants +* @param {Object} params Parameters to provide to the call +* @param {String} params.variantSetDbId variantSetDbId +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function variantsets_variants (params,behavior){ + var call = { + 'defaultMethod': 'get', + 'urlTemplate': '/variantsets/{variantSetDbId}/variants', + 'params': params, + 'behaviorOptions': ['fork','map'], + 'behavior': behavior, + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + +/** `POST /search/variantsets -> GET /search/variantsets` +* @alias BrAPINode.prototype.search_variantsets +* @param {Object} params Parameters to provide to the call +* @param {String} [behavior="fork"] Behavior of the node +* @return {BrAPI_Behavior_Node} +*/ +export function search_variantsets(params,behavior){ + this.version.check("POST /search/variantsets -> GET /search/variantsets",{ + introduced:"v2.0" + }); + return this.search("variantsets",params,behavior); +}; diff --git a/src/brapi_methods/vendor.js b/src/brapi_methods/vendor.js index aad0cfd..ac1441e 100644 --- a/src/brapi_methods/vendor.js +++ b/src/brapi_methods/vendor.js @@ -34,13 +34,15 @@ export function vendor_plates_search(params,behavior){ call.urlTemplate = '/vendor/plate-search'; this.version.check(call.urlTemplate,{ introduced:"v1.1", - deprecated:"v1.2" + deprecated:"v1.2", + deprecated:"v2.0" }); } else { call.urlTemplate = '/vendor/plates-search'; this.version.check(call.urlTemplate,{ introduced:"v1.2", - deprecated:"v1.3" + deprecated:"v1.3", + deprecated:"v2.0" }); } return this.simple_brapi_call(call); @@ -109,6 +111,24 @@ export function vendor_orders (params){ return this.simple_brapi_call(call); } +/** `POST /vendor/orders` + * @alias BrAPINode.prototype.vendor_orders_store + * @param {Object} params Parameters to provide to the call + * @return {BrAPI_Behavior_Node} + */ +export function vendor_orders_store (params){ + var call = { + 'defaultMethod': 'post', + 'urlTemplate': '/vendor/orders', + 'params': params, + 'behavior': 'map', + } + this.version.check(call.urlTemplate,{ + introduced:"v2.0" + }); + return this.simple_brapi_call(call); +} + /** `GET /vendor/orders/{orderId}/results` * @alias BrAPINode.prototype.vendor_orders_results * @param {Object} params Parameters to provide to the call