Skip to content

Commit

Permalink
Release. Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
bryaningl3 committed Jul 29, 2024
1 parent 6e4512c commit d0b8fb2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Barchart Alerting Service SDK <small>JavaScript 4.19.2</small>
# Barchart Alerting Service SDK <small>JavaScript 4.20.0</small>

> Continuously monitor market conditions and receive notifications
Expand Down
45 changes: 44 additions & 1 deletion example/browser/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,32 @@ module.exports = (() => {
});
}

/**
* Gets a single alert trigger.
*
* @public
* @async
* @param {Object} query
* @param {String} query.alert_id
* @param {String} query.trigger_date
* @returns {Promise<Schema.Trigger|null>}
*/
async retrieveTrigger(query) {
return Promise.resolve().then(() => {
checkStatus(this, 'retrieve alert trigger');
validate.trigger.forLookup(query);
}).then(() => {
return this._adapter.retrieveTrigger(query).then(response => {
console.log(response);
if (response.length === 1) {
return response[0];
} else {
return null;
}
});
});
}

/**
* Gets a set of alert triggers, matching query criteria.
*
Expand Down Expand Up @@ -2679,6 +2705,9 @@ module.exports = (() => {
subscribeAlerts(query) {
return null;
}
retrieveTrigger(query) {
return null;
}
retrieveTriggers(query) {
return null;
}
Expand Down Expand Up @@ -2814,6 +2843,9 @@ module.exports = (() => {
this._deleteAlertEndpoint = EndpointBuilder.for('delete-alert', 'Delete alert').withVerb(VerbType.DELETE).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(pb => {
pb.withLiteralParameter('alerts', 'alerts').withVariableParameter('alert_id', 'alert_id', 'alert_id');
}).withRequestInterceptor(requestInterceptor).withResponseInterceptor(ResponseInterceptor.DATA).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
this._retrieveTriggerEndpoint = EndpointBuilder.for('retrieve-alert-trigger', 'Retrieve alert trigger').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(pb => {
pb.withLiteralParameter('alert', 'alert').withLiteralParameter('triggers', 'triggers').withVariableParameter('alert_id', 'alert_id', 'alert_id').withVariableParameter('trigger_date', 'trigger_date', 'trigger_date');
}).withRequestInterceptor(requestInterceptor).withResponseInterceptor(ResponseInterceptor.DATA).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
this._retrieveTriggersEndpoint = EndpointBuilder.for('retrieve-alert-triggers', 'Retrieve alert triggers').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(pb => {
pb.withLiteralParameter('alert', 'alert').withLiteralParameter('triggers', 'triggers').withLiteralParameter('users', 'users').withVariableParameter('alert_system', 'alert_system', 'alert_system').withVariableParameter('user_id', 'user_id', 'user_id');
}).withQueryBuilder(pb => {
Expand Down Expand Up @@ -2934,6 +2966,9 @@ module.exports = (() => {
subscriber.dispose();
});
}
retrieveTrigger(query) {
return Gateway.invoke(this._retrieveTriggerEndpoint, query);
}
retrieveTriggers(query) {
return Gateway.invoke(this._retrieveTriggersEndpoint, query).then(triggers => {
const subscriber = getSubscriber(this._triggerSubscriberMap, query);
Expand Down Expand Up @@ -3516,6 +3551,9 @@ module.exports = (() => {
subscriber.dispose();
});
}
retrieveTrigger(query) {
return sendRequestToServer.call(this, 'alert/triggers/retrieve', query, true);
}
retrieveTriggers(query) {
return sendRequestToServer.call(this, 'alert/triggers/retrieve/user', query, true);
}
Expand Down Expand Up @@ -4170,6 +4208,11 @@ module.exports = (() => {
'use strict';

const validator = {
forLookup: (query, description) => {
const d = getDescription(description);
assert.argumentIsRequired(query.alert_id, `${d}.alert_id`, String);
assert.argumentIsRequired(query.trigger_date, `${d}.trigger_date`, Number);
},
forQuery: (query, description) => {
const d = getDescription(description);
validator.forUser(query, description);
Expand Down Expand Up @@ -4233,7 +4276,7 @@ module.exports = (() => {
'use strict';

return {
version: '4.19.2'
version: '4.20.0'
};
})();

Expand Down
2 changes: 1 addition & 1 deletion lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module.exports = (() => {
'use strict';

return {
version: '4.19.2'
version: '4.20.0'
};
})();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@barchart/alerts-client-js",
"version": "4.19.2",
"version": "4.20.0",
"description": "JavaScript SDK for Barchart Alert Service",
"author": {
"name": "Bryan Ingle",
Expand Down

0 comments on commit d0b8fb2

Please sign in to comment.