auth0 / auth0-deploy-cli

The Auth0 Deploy CLI is a tool that helps you manage your Auth0 tenant configuration. It integrates into your development workflows as a standalone CLI or as a node module.
MIT License
248 stars 155 forks source link

Support keyword replacement for custom prompts when using the directory format #963

Closed jacobwood091 closed 1 month ago

jacobwood091 commented 1 month ago

🔧 Changes

This updates the prompt parser for the directory structure to support dynamic keyword replacement within the template file of a custom prompt partial. This was already handled by the basic mechanism for handling YAML, but not the other way around.

📚 References

Addresses #962

🔬 Testing

  1. Create a custom prompt partial with a given keyword:
<!-- resources/prompts/partials/signup/signup/form-content-end.html -->
<div>Hello, ##SOME_KEYWORD##</div>
  1. Deploy it, having configured the respective keyword mapping:

In your config:

{
  "SOME_KEYWORD": "world"
}
a0deploy import -c=config.json --input_file=resources

I tend to deploy using the method exported from the module, so the above may need adjustment to compensate for use of the CLI.

  1. Fetch the content of the prompt partial from Auth0. The expectation is:
<div>Hello, world!</div>

📝 Checklist

kushalshit27 commented 1 month ago

@jacobwood091 Thank you for submitting this PR! I really appreciate the time and effort you put into it. The code looks good overall.

I do have a suggestions for improvement:

Thank you again for your contribution!

Once you make these changes, I’ll be happy to merge your PR!

kushalshit27 commented 1 month ago

Thank you for your excellent work on this PR! 🚀 If you have further suggestions, feel free to share.