import type {
  IAuthenticateGeneric,
  Icon,
  ICredentialType,
  INodeProperties,
} from 'n8n-workflow';

export class NdcDataProductReaderApi implements ICredentialType {
  name = 'ndcDataProductReaderApi';
  displayName = 'NDC Data Product Reader API';
  icon: Icon = {
    light: 'file:../icons/ndc.svg',
    dark: 'file:../icons/ndc.dark.svg',
  };
  documentationUrl = '';
  properties: INodeProperties[] = [
    {
      displayName: 'Opaque Reader Capability',
      name: 'capability',
      type: 'string',
      typeOptions: { password: true },
      default: '',
      required: true,
    },
  ];
  authenticate: IAuthenticateGeneric = {
    type: 'generic',
    properties: {
      headers: {
        Authorization: '=Bearer {{$credentials.capability}}',
      },
    },
  };
}
