backend-manager 3.2.141 → 3.2.143

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.2.141",
3
+ "version": "3.2.143",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -7,8 +7,11 @@ const PROMPT = `
7
7
  Company: {name}: {description}
8
8
  Current Date: {date}
9
9
  Instructions: {prompt}
10
- Topic Suggestions: {suggestion}
10
+
11
+ Use the following information to find a topic related to our company description:
12
+ {suggestion}
11
13
  `
14
+ const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36';
12
15
 
13
16
  function Module() {
14
17
 
@@ -47,6 +50,9 @@ Module.prototype.main = function (assistant, context) {
47
50
  return reject(self.appObject);
48
51
  }
49
52
 
53
+ // Log
54
+ assistant.log(`App object`, self.appObject);
55
+
50
56
  // Harvest articles
51
57
  const result = await self.harvest(settings).catch((e) => e);
52
58
  if (result instanceof Error) {
@@ -54,7 +60,7 @@ Module.prototype.main = function (assistant, context) {
54
60
  }
55
61
 
56
62
  // Log
57
- assistant.log(`Finished!`);
63
+ assistant.log(`Finished!`, result);
58
64
 
59
65
  // Resolve
60
66
  return resolve();
@@ -104,7 +110,7 @@ Module.prototype.harvest = function (settings) {
104
110
  // Set suggestion
105
111
  const final = powertools.template(PROMPT, {
106
112
  name: self.appObject.name,
107
- description: self.appObject.description,
113
+ description: self.appObject.brand.description,
108
114
  prompt: settings.prompt,
109
115
  date: date,
110
116
  suggestion: suggestion,
@@ -161,13 +167,14 @@ Module.prototype.getAppData = function (settings) {
161
167
  id: Manager.config.app.id,
162
168
  },
163
169
  })
164
- .then((r) => {
165
- return resolve({
166
- name: r?.name,
167
- description: r?.brand?.description || '',
168
- acceptable: r?.sponsorships?.acceptable || [],
169
- })
170
- })
170
+ // .then((r) => {
171
+ // return resolve({
172
+ // name: r?.name,
173
+ // description: r?.brand?.description || '',
174
+ // acceptable: r?.sponsorships?.acceptable || [],
175
+ // })
176
+ // })
177
+ .then((r) => resolve(r))
171
178
  .catch((e) => reject(e));
172
179
  });
173
180
  }
@@ -187,6 +194,9 @@ Module.prototype.getURLContent = function (url) {
187
194
  timeout: 30000,
188
195
  tries: 3,
189
196
  response: 'text',
197
+ headers: {
198
+ 'User-Agent': USER_AGENT,
199
+ }
190
200
  })
191
201
  .then((r) => {
192
202
  return resolve(extractBodyContent(r));
@@ -233,6 +243,7 @@ Module.prototype.requestGhostii = function (content) {
233
243
  keywords: [''],
234
244
  description: content,
235
245
  insertLinks: true,
246
+ headerImageUrl: 'unsplash',
236
247
  },
237
248
  })
238
249
  .then((r) => resolve(r))