FusionAuth / fusionauth-node-cli

https://fusionauth.io
Other
1 stars 6 forks source link

feat: add email commands #4

Closed ColinFrick closed 1 year ago

ColinFrick commented 1 year ago

This PR adds the following email commands:

The email directory is as follows:

emails
├── 004e5f2e-ec50-4eda-998e-c58afd2a048d
│   ├── body.html
│   ├── body.txt
│   ├── from_email.txt
│   ├── from_name.txt
│   ├── fuubar.txt
│   ├── name.txt
│   └── subject.txt
├── 530100f3-e25b-49e3-bdd0-46e4c2f06b9e
│   ├── de
│   │   ├── body.html
│   │   ├── body.txt
│   │   ├── from_name.txt
│   │   └── subject.txt
│   ├── fr
│   │   ├── body.html
│   │   ├── body.txt
│   │   ├── from_name.txt
│   │   └── subject.txt
│   ├── body.html
│   ├── body.txt
│   ├── from_email.txt
│   ├── from_name.txt
│   ├── name.txt
│   └── subject.txt

So we have a directory for each template containing the base properties and default templates. Locales are subdirectory containing the localized templates.

Closes #2

mooreds commented 1 year ago

@vcampitelli did you have a chance to look at this?

mooreds commented 1 year ago

@vcampitelli can you take another look, please?

vcampitelli commented 1 year ago

I pushed f1a38d94278af88ec41b8592a03947faa5ae761b to remove an export because the script was trying to add it as a command and it's just a helper function.


src/index.ts:23:63 - error TS2345: Argument of type 'Command<[], { output: string; locales: [] | string[]; }> | Command<[string | undefined], { output: string; }> | Command<[string | undefined], { output: string; key: string; host: string; clean: boolean; }> | ... 8 more ... | Command<...>' is not assignable to parameter of type 'CommandUnknownOpts'.
  Type '(emailTemplate: EmailTemplate) => string[]' is not assignable to type 'Command<unknown[], OptionValues>'.

23 Object.values(commands).forEach(command => program.addCommand(command));
```                                                                 ~~~~~~~