NovuN
Novu3y ago
13 replies
dr.really

Adding a new Credentials Enum

So i'm working on issue 5033, and when I go to add a new CredentialEnum to
provider.enum.ts
to the
CredentialsKeyEnum
, i'm getting the error in the attached screenshot. Once placed, i run
pnpm run setup:project
and it fails. I'm following the guide just to make sure I'm putting the new field where it needs to go, but i'm not entirely sure if I'm missing a step that isn't documented or what.

Modified
provider.enum.ts
snipping:

export enum CredentialsKeyEnum {
...
  state = 'state',
  externalLink = 'externalLink',
  OriginationNumber = 'originationNumber',
}


error in text format vs picture:

 Failed to compile.

       TS2322: Type '"credentials.title" | "credentials.accessKey" | "credentials.webhookUrl" | "credentials.password" | "credentials.from" | "credentials.region" | "credentials.senderName" | ... 35 more ... | "credentials.originationNumber"' is not assignable to type '"name" | "conditions" | `conditions.${number}` | `conditions.${number}.value` | `conditions.${number}.children` | `conditions.${number}.type` | `conditions.${number}.isNegated` | `conditions.${number}.children.${number}` | `conditions.${number}.children.${number}.value` | `conditions.${number}.children.${number}.on`...'.
         Type '"credentials.originationNumber"' is not assignable to type '"name" | "conditions" | `conditions.${number}` | `conditions.${number}.value` | `conditions.${number}.children` | `conditions.${number}.type` | `conditions.${number}.isNegated` | `conditions.${number}.children.${number}` | `conditions.${number}.children.${number}.value` | `conditions.${number}.children.${number}.on`...'.
           344 |             <InputWrapper key={credential.key}>
           345 |               <Controller
         > 346 |                 name={`credentials.${credential.key}`}
               |                 ^^^^
           347 |                 control={control}
           348 |                 {...(credential.type === 'boolean' || credential.type === 'switch' ? { defaultValue: false } : {})}
           349 |                 rules={{
image.png
Was this page helpful?