codehooks-js 1.2.16 → 1.2.18

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.
@@ -20,6 +20,7 @@ export function agg(readable, spec) {
20
20
  resolve(accum)
21
21
  })
22
22
  } catch (error) {
23
+ console.error('Aggretation error', error)
23
24
  reject(error)
24
25
  }
25
26
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codehooks-js",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
4
4
  "type": "module",
5
5
  "description": "Codehooks.io official library - provides express.JS like syntax",
6
6
  "main": "index.js",
package/types/index.d.ts CHANGED
@@ -221,10 +221,16 @@ export type NoSQLAPI = {
221
221
  /**
222
222
  * - Update one data object by ID in a datastore collection.
223
223
  * - Input document is patched with the matched database object
224
+ * @param query string | object
225
+ * @param document object
226
+ * @param updateoperators object
227
+ * @param options object - {upsert: true}
228
+ * @returns Promise<object>
224
229
  */
225
230
  updateOne: (
226
231
  query: string | object,
227
232
  document: object,
233
+ updateoperators?: object,
228
234
  options?: object
229
235
  ) => Promise<object>;
230
236
  /**
@@ -324,10 +330,16 @@ export type DatastoreAPI = {
324
330
  /**
325
331
  * - Update one data object by ID in a datastore collection.
326
332
  * - Input document is patched with the matched database object
333
+ * @param collection string
334
+ * @param query string | object
335
+ * @param updateoperators object
336
+ * @param options object - {upsert: true}
337
+ * @returns Promise<any>
327
338
  */
328
339
  updateOne: (
329
340
  collection: string,
330
341
  query: string | object,
342
+ updateoperators?: object,
331
343
  options?: object
332
344
  ) => Promise<any>;
333
345
  /**
@@ -338,7 +350,7 @@ export type DatastoreAPI = {
338
350
  collection: string,
339
351
  query: object,
340
352
  document: object,
341
- options?: object
353
+ updateoperators?: object
342
354
  ) => Promise<any>;
343
355
  /**
344
356
  * - Replace one data object by ID in a datastore collection.
@@ -577,7 +589,7 @@ export type httpResponse = {
577
589
  * @param value string
578
590
  * @returns
579
591
  */
580
- setHeader: (header: string, value: string) => any;
592
+ setHeader: (header: string, value: string | string[]) => any;
581
593
  /**
582
594
  * Remove any default headers from a response
583
595
  * @param header string
package/webserver.mjs CHANGED
@@ -86,9 +86,9 @@ export function serveStatic(options, app, filestore, hook, fsoptions) {
86
86
  })
87
87
 
88
88
  } catch (error) {
89
- console.error("Error message", error.message)
90
- console.error(error)
91
- res.status(404).end('No file here:' + filePath)
89
+ console.debug("Error message", error.message)
90
+ console.debug(error)
91
+ res.status(404).end(`No file here: ${filePath} (${error.message})`)
92
92
  }
93
93
  }
94
94
  const farr = [readFunc]