2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2021-04-02 09:29:20 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const summaryOperations: INodeProperties[] = [
|
2021-04-02 09:29:20 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-04-02 09:29:20 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['summary'],
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get Activity Summary',
|
|
|
|
value: 'getActivity',
|
2022-08-17 08:50:24 -07:00
|
|
|
description: "Get the user's activity summary",
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get activity summary',
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get Readiness Summary',
|
|
|
|
value: 'getReadiness',
|
2022-08-17 08:50:24 -07:00
|
|
|
description: "Get the user's readiness summary",
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get readiness summary',
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get Sleep Periods',
|
|
|
|
value: 'getSleep',
|
2022-08-17 08:50:24 -07:00
|
|
|
description: "Get the user's sleep summary",
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get sleep summary',
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'getSleep',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-04-02 09:29:20 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const summaryFields: INodeProperties[] = [
|
2021-04-02 09:29:20 -07:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['summary'],
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['summary'],
|
|
|
|
returnAll: [false],
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 10,
|
|
|
|
},
|
|
|
|
default: 5,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Filters',
|
|
|
|
name: 'filters',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Filter',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['summary'],
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'End Date',
|
|
|
|
name: 'end',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'End date for the summary retrieval. If omitted, it defaults to the current day.',
|
2021-04-02 09:29:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Start Date',
|
|
|
|
name: 'start',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
description: 'Start date for the summary retrieval. If omitted, it defaults to a week ago.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|