mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
feat(Strava Node): Add "Get Streams" operation (#2582)
* Strava node: adding getStreams operation * Changed the keys to use multiOptions Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
This commit is contained in:
parent
5f44b0dad5
commit
6bbb4df059
|
@ -46,6 +46,11 @@ export const activityOperations: INodeProperties[] = [
|
|||
value: 'getLaps',
|
||||
description: 'Get all activity laps',
|
||||
},
|
||||
{
|
||||
name: 'Get Streams',
|
||||
value: 'getStreams',
|
||||
description: 'Get activity streams',
|
||||
},
|
||||
{
|
||||
name: 'Get Zones',
|
||||
value: 'getZones',
|
||||
|
@ -316,6 +321,7 @@ export const activityFields: INodeProperties[] = [
|
|||
'getLaps',
|
||||
'getKudos',
|
||||
'getZones',
|
||||
'getStreams',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -369,7 +375,70 @@ export const activityFields: INodeProperties[] = [
|
|||
default: 50,
|
||||
description: 'How many results to return.',
|
||||
},
|
||||
|
||||
{
|
||||
displayName: 'Keys',
|
||||
name: 'keys',
|
||||
type: 'multiOptions',
|
||||
options: [
|
||||
{
|
||||
name: 'Altitude',
|
||||
value: 'altitude',
|
||||
},
|
||||
{
|
||||
name: 'Cadence',
|
||||
value: 'cadence',
|
||||
},
|
||||
{
|
||||
name: 'Distance',
|
||||
value: 'distance',
|
||||
},
|
||||
{
|
||||
name: 'Gradient',
|
||||
value: 'grade_smooth',
|
||||
},
|
||||
{
|
||||
name: 'Heartrate',
|
||||
value: 'heartrate',
|
||||
},
|
||||
{
|
||||
name: 'Latitude / Longitude',
|
||||
value: 'latlng',
|
||||
},
|
||||
{
|
||||
name: 'Moving',
|
||||
value: 'moving',
|
||||
},
|
||||
{
|
||||
name: 'Temperature',
|
||||
value: 'temp',
|
||||
},
|
||||
{
|
||||
name: 'Time',
|
||||
value: 'time',
|
||||
},
|
||||
{
|
||||
name: 'Velocity',
|
||||
value: 'velocity_smooth',
|
||||
},
|
||||
{
|
||||
name: 'Watts',
|
||||
value: 'watts',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'activity',
|
||||
],
|
||||
operation: [
|
||||
'getStreams',
|
||||
],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
default: [],
|
||||
description: 'Desired stream types to return',
|
||||
},
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* activity:getAll */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
|
|
@ -129,6 +129,15 @@ export class Strava implements INodeType {
|
|||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
//https://developers.strava.com/docs/reference/#api-Streams-getActivityStreams
|
||||
if (operation === 'getStreams') {
|
||||
const activityId = this.getNodeParameter('activityId', i) as string;
|
||||
const keys = this.getNodeParameter('keys', i) as string[];
|
||||
qs.keys = keys.toString();
|
||||
qs.key_by_type = true;
|
||||
|
||||
responseData = await stravaApiRequest.call(this, 'GET', `/activities/${activityId}/streams`, {}, qs);
|
||||
}
|
||||
//https://developers.mailerlite.com/reference#subscribers
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
|
|
Loading…
Reference in a new issue