dymo-api 1.0.32 → 1.0.34

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.
@@ -68,8 +68,11 @@ const sendEmail = async (token, data) => {
68
68
  if (data.html && data.react)
69
69
  throw customError(1500, "You must provide only HTML or a React component, not both.");
70
70
  try {
71
- data.html = await (0, render_1.renderAsync)(data.react);
72
- delete data.react;
71
+ if (data.react) {
72
+ //@ts-ignore
73
+ data.html = await (0, render_1.renderAsync)(data.react);
74
+ delete data.react;
75
+ }
73
76
  }
74
77
  catch (error) {
75
78
  throw customError(1500, "An error occurred while rendering your React component.");
package/dist/dymo-api.js CHANGED
@@ -99,15 +99,15 @@ class DymoAPI {
99
99
  }
100
100
  // FUNCTIONS / Private.
101
101
  async isValidData(data) {
102
- return await PrivateAPI.isValidData(this.apiKey, data);
102
+ return await PrivateAPI.isValidData(this.rootApiKey || this.apiKey, data);
103
103
  }
104
104
  async sendEmail(data) {
105
105
  if (!this.serverEmailConfig && !this.rootApiKey)
106
106
  throw customError(5000, `You must configure the email client settings.`);
107
- return await PrivateAPI.sendEmail(this.apiKey, { serverEmailConfig: this.serverEmailConfig, ...data });
107
+ return await PrivateAPI.sendEmail(this.rootApiKey || this.apiKey, { serverEmailConfig: this.serverEmailConfig, ...data });
108
108
  }
109
109
  async getRandom(data) {
110
- return await PrivateAPI.getRandom(this.apiKey, data);
110
+ return await PrivateAPI.getRandom(this.rootApiKey || this.apiKey, data);
111
111
  }
112
112
  // FUNCTIONS / Public.
113
113
  async getPrayerTimes(data) {
package/dist/dymo-api.mjs CHANGED
@@ -99,15 +99,15 @@ class DymoAPI {
99
99
  }
100
100
  // FUNCTIONS / Private.
101
101
  async isValidData(data) {
102
- return await PrivateAPI.isValidData(this.apiKey, data);
102
+ return await PrivateAPI.isValidData(this.rootApiKey || this.apiKey, data);
103
103
  }
104
104
  async sendEmail(data) {
105
105
  if (!this.serverEmailConfig && !this.rootApiKey)
106
106
  throw customError(5000, `You must configure the email client settings.`);
107
- return await PrivateAPI.sendEmail(this.apiKey, { serverEmailConfig: this.serverEmailConfig, ...data });
107
+ return await PrivateAPI.sendEmail(this.rootApiKey || this.apiKey, { serverEmailConfig: this.serverEmailConfig, ...data });
108
108
  }
109
109
  async getRandom(data) {
110
- return await PrivateAPI.getRandom(this.apiKey, data);
110
+ return await PrivateAPI.getRandom(this.rootApiKey || this.apiKey, data);
111
111
  }
112
112
  // FUNCTIONS / Public.
113
113
  async getPrayerTimes(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dymo-api",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Flow system for Dymo API.",
5
5
  "main": "dist/dymo-api.js",
6
6
  "module": "dist/dymo-api.mjs",