N
Novu•9mo ago
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',
}
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={{
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={{
No description
8 Replies
dr.really
dr.really•9mo ago
ah, thanks Pawan!
Pawan Jain
Pawan Jain•9mo ago
Let me know if you face any other issue. Happy to help 🙌
dr.really
dr.really•9mo ago
Hey @Pawan Jain, so I got it updated from above and it's building and running. However, it looks like when the provider is triggered, it's not pulling the new field from the db. Sorry for all the questions, once all of this is done I can write up a PR for the docs for updating existing integrations if that will help lol For context, it is storing the new field value in the db, I can see it sitting in Mongo however, it's just not selecting it on trigger Hey @Pawan Jain just wanted to circle back around to see if you have had a chance to look at the above?
Pawan Jain
Pawan Jain•9mo ago
@dr.really Sure. I will check this today morning Give me some time Meantime could you add some logs around provider to check the root cause?
dr.really
dr.really•8mo ago
aye will do when I get home tonight and will report back I'm going to have to put this on hold. Apparently I have to register a new number with AWS SNS/Pinpoint for testing this. Will reach back out once that registration is complete
Pawan Jain
Pawan Jain•8mo ago
Sure @dr.really
dr.really
dr.really•8mo ago
my work said that i can't use the same number(s) we have, which is why I have to register a new one haha, thanks for your patience!
Want results from more Discord servers?
Add your server