2024-11-07 03:53:05 -08:00
|
|
|
import type {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2021-04-02 09:29:20 -07:00
|
|
|
|
|
|
|
export class OuraApi implements ICredentialType {
|
|
|
|
name = 'ouraApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-04-02 09:29:20 -07:00
|
|
|
displayName = 'Oura API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-04-02 09:29:20 -07:00
|
|
|
documentationUrl = 'oura';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2021-04-02 09:29:20 -07:00
|
|
|
{
|
|
|
|
displayName: 'Personal Access Token',
|
|
|
|
name: 'accessToken',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2022-11-01 09:41:45 -07:00
|
|
|
typeOptions: { password: true },
|
2021-04-02 09:29:20 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2024-11-07 03:53:05 -08:00
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
Authorization: '=Bearer {{$credentials.accessToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.ouraring.com',
|
|
|
|
url: '/v2/usercollection/personal_info',
|
|
|
|
},
|
|
|
|
};
|
2021-04-02 09:29:20 -07:00
|
|
|
}
|