Skip to content
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

brapi v2.1 #26

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
409 changes: 214 additions & 195 deletions docs/README.md

Large diffs are not rendered by default.

39 changes: 37 additions & 2 deletions src/brapi_methods/allelematrices.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export function allelematrices (params,behavior){
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v1.0"
introduced:"v1.0",
deprecated:"v2.0"
});
return this.simple_brapi_call(call);
}
Expand Down Expand Up @@ -41,9 +42,43 @@ export function allelematrices_search(params,behavior){
} else {
call.urlTemplate = "/allelematrices-search"
this.version.check(call.urlTemplate,{
introduced:"v1.2"
introduced:"v1.2",
deprecated:"v2.0"
});
}

return this.simple_brapi_call(call);
};

/** `GET /allelematrix`
* @alias BrAPINode.prototype.allelematrix
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function allelematrix (params,behavior){
var call = {
'defaultMethod': 'get',
'urlTemplate': '/allelematrix',
'params': params,
'behaviorOptions': ['fork','map'],
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}

/** `POST /search/allelematrix -> GET /search/allelematrix`
* @alias BrAPINode.prototype.search_allelematrix
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function search_allelematrix(params,behavior){
this.version.check("POST /search/allelematrix -> GET /search/allelematrix",{
introduced:"v2.1"
});
return this.search("allelematrix",params,behavior);
};
20 changes: 20 additions & 0 deletions src/brapi_methods/calls.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,23 @@ export function search_calls(params,behavior){
});
return this.search("calls",params,behavior);
};

/** `PUT /calls`
* @alias BrAPINode.prototype.calls_modify
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function calls_modify (params,behavior){
var call = {
'defaultMethod': 'put',
'urlTemplate': '/calls',
'params': params,
'behaviorOptions': ['fork','map'],
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}
6 changes: 4 additions & 2 deletions src/brapi_methods/germplasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export function germplasm_pedigree (params){
'behavior': 'map',
}
this.version.check(call.urlTemplate,{
introduced:"v1.0"
introduced:"v1.0",
deprecated:"v2.1"
});
return this.simple_brapi_call(call);
}
Expand All @@ -164,7 +165,8 @@ export function germplasm_progeny (params,behavior){
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v1.2"
introduced:"v1.2",
deprecated:"v2.1"
});
return this.simple_brapi_call(call);
}
Expand Down
20 changes: 20 additions & 0 deletions src/brapi_methods/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ export function images_imagecontent_modify (params){
return this.simple_brapi_call(call);
}

/** `POST /delete/images`
* @alias BrAPINode.prototype.images_delete
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function images_delete (params,behavior){
var call = {
'defaultMethod': 'post',
'urlTemplate': '/delete/images',
'params': params,
'behaviorOptions': ['fork','map'],
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
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
Expand Down
21 changes: 20 additions & 1 deletion src/brapi_methods/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,30 @@ export function lists_items_store (params){
}
this.version.check(call.urlTemplate,{
introduced:"v1.3",
introduced:"v2.0"
introduced:"v2.0",
deprecated:"v2.1"
});
return this.simple_brapi_call(call);
}

/** `POST /lists/{listDbId}/data`
* @alias BrAPINode.prototype.lists_data_store
* @param {Object} params Parameters to provide to the call
* @param {String} params.imageDbId imageDbId
* @return {BrAPI_Behavior_Node}
*/
export function lists_data_store (params){
var call = {
'defaultMethod': 'post',
'urlTemplate': '/lists/{listDbId}/data',
'params': params,
'behavior': 'map',
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}

/** `POST /search/lists`
* @alias BrAPINode.prototype.lists_search
Expand Down
20 changes: 20 additions & 0 deletions src/brapi_methods/observations.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,26 @@ export function observations_table (params,behavior){
return this.simple_brapi_call(call);
}

/** `POST /delete/observations`
* @alias BrAPINode.prototype.observations_delete
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function observations_delete (params,behavior){
var call = {
'defaultMethod': 'post',
'urlTemplate': '/delete/observations',
'params': params,
'behaviorOptions': ['fork','map'],
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
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
Expand Down
59 changes: 59 additions & 0 deletions src/brapi_methods/ontologies.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,62 @@ export function ontologies (params,behavior){
});
return this.simple_brapi_call(call);
}

/** `POST /ontologies`
* @alias BrAPINode.prototype.ontologies_store
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function ontologies_store (params,behavior){
var call = {
'defaultMethod': 'post',
'urlTemplate': '/ontologies',
'params': params,
'behaviorOptions': ['fork','map'],
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}

/** `GET /ontologies/{ontologyDbId}`
* @alias BrAPINode.prototype.ontologies_detail
* @param {Object} params Parameters to provide to the call
* @param {String} params.ontologyDbId ontologyDbId
* @return {BrAPI_Behavior_Node}
*/
export function ontologies_detail (params){
var call = {
'defaultMethod': 'get',
'urlTemplate': '/ontologies/{ontologyDbId}',
'params': params,
'behavior': 'map',
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}

/** `PUT /ontologies/{ontologyDbId}`
* @alias BrAPINode.prototype.ontologies_modify
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function ontologies_modify (params,behavior){
var call = {
'defaultMethod': 'put',
'urlTemplate': '/ontologies/{ontologyDbId}',
'params': params,
'behaviorOptions': ['fork','map'],
'behavior': behavior,
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}
54 changes: 53 additions & 1 deletion src/brapi_methods/pedigree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** `GET /pedigree/{germplasmDbId}`
/** `GET /pedigree/`
* @alias BrAPINode.prototype.pedigree
* @param {Object} params Parameters to provide to the call
* @param {String} params.germplasmDbId germplasmDbId
Expand All @@ -17,3 +17,55 @@ export function pedigree (params){
});
return this.simple_brapi_call(call);
}


/** `POST /pedigree`
* @alias BrAPINode.prototype.pedigree_store
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function pedigree_store (params,behavior){
var call = {
'defaultMethod': 'post',
'urlTemplate': '/pedigree',
'params': params,
'behavior': 'map',
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}

/** `PUT /pedigree`
* @alias BrAPINode.prototype.pedigree_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 pedigree_modify (params,behavior){
var call = {
'defaultMethod': 'put',
'urlTemplate': '/pedigree',
'params': params,
'behavior': 'map',
}
this.version.check(call.urlTemplate,{
introduced:"v2.1"
});
return this.simple_brapi_call(call);
}

/** `POST /search/pedigree -> GET /search/pedigree`
* @alias BrAPINode.prototype.search_pedigree
* @param {Object} params Parameters to provide to the call
* @param {String} [behavior="fork"] Behavior of the node
* @return {BrAPI_Behavior_Node}
*/
export function search_pedigree(params,behavior){
this.version.check("POST /search/pedigree -> GET /search/pedigree",{
introduced:"v2.1"
});
return this.search("pedigree",params,behavior);
};
Loading