qualifire 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +5 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -29,7 +29,11 @@ class QualifireClient {
29
29
  console.error('error while getting the prompt', qualifireResponse.json());
30
30
  return defaultValue;
31
31
  }
32
- const { prompt, templateVariables } = (await qualifireResponse.json());
32
+ const regex = /\{[a-zA-Z0-9_-]+\}/gm;
33
+ const { prompt } = (await qualifireResponse.json());
34
+ const templateVariables = prompt
35
+ .match(regex)
36
+ ?.map(v => v.replace('{', '').replace('}', ''));
33
37
  let parsedPrompt = prompt;
34
38
  if (templateValues && templateVariables) {
35
39
  for (const variable of templateVariables) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qualifire",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "description": "Qualifire client SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [