codehooks-js 1.2.17 → 1.2.19

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.17",
3
+ "version": "1.2.19",
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,6 +221,11 @@ 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,
@@ -325,6 +330,11 @@ export type DatastoreAPI = {
325
330
  /**
326
331
  * - Update one data object by ID in a datastore collection.
327
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>
328
338
  */
329
339
  updateOne: (
330
340
  collection: string,
@@ -371,7 +381,7 @@ export type DatastoreAPI = {
371
381
  /**
372
382
  * - Set a key-value pair in the current Datastore
373
383
  */
374
- set: (key: string, value: string, options?: object) => Promise<any>;
384
+ set: (key: string, value: string | object, options?: object) => Promise<any>;
375
385
  /**
376
386
  * - Get a key-value pair in the current Datastore
377
387
  */
@@ -579,7 +589,7 @@ export type httpResponse = {
579
589
  * @param value string
580
590
  * @returns
581
591
  */
582
- setHeader: (header: string, value: string) => any;
592
+ setHeader: (header: string, value: string | string[]) => any;
583
593
  /**
584
594
  * Remove any default headers from a response
585
595
  * @param header string