codehooks-js 1.3.24 → 1.3.25

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/package.json +1 -1
  2. package/types/index.d.ts +14 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codehooks-js",
3
- "version": "1.3.24",
3
+ "version": "1.3.25",
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
@@ -313,8 +313,9 @@ export type DatastoreAPI = {
313
313
  collection: (collection: string) => NoSQLAPI;
314
314
  /**
315
315
  * - Get object by ID (objectID) or query (NoSQL query {...}), returns a Promise with the object
316
+ * @throws {Error} Rejects if the object is not found
316
317
  */
317
- getOne: (collection: string, query: string | object) => Promise<any>;
318
+ getOne: (collection: string, query: string | object) => Promise<object>;
318
319
  /**
319
320
  * - Get stream of objects by query
320
321
  * * https://codehooks.io/docs/nosql-database-api#getmanycollection-query-options
@@ -322,12 +323,13 @@ export type DatastoreAPI = {
322
323
  getMany: (collection: string, query?: object, options?: object) => DataStream;
323
324
  /**
324
325
  * - Get object by ID (objectID) or query (NoSQL query {...}), returns a Promise with the object (alias for getOne)
326
+ * @throws {Error} Rejects if the object is not found
325
327
  */
326
- findOne: (collection: string, query: string | object) => Promise<any>;
328
+ findOne: (collection: string, query: string | object) => Promise<object>;
327
329
  /**
328
330
  * - Get object by ID (objectID) or query (NoSQL query {...}), returns a Promise with the object or null if not found
329
331
  */
330
- findOneOrNull: (collection: string, query: string | object) => Promise<any>;
332
+ findOneOrNull: (collection: string, query: string | object) => Promise<object | null>;
331
333
  /**
332
334
  * - Alias for getMany
333
335
  * https://codehooks.io/docs/nosql-database-api#getmanycollection-query-options
@@ -344,14 +346,14 @@ export type DatastoreAPI = {
344
346
  * @param query string | object
345
347
  * @param updateoperators object
346
348
  * @param options object - {upsert: true}
347
- * @returns Promise<any>
349
+ * @returns Promise<object>
348
350
  */
349
351
  updateOne: (
350
352
  collection: string,
351
353
  query: string | object,
352
354
  updateoperators?: object,
353
355
  options?: object
354
- ) => Promise<any>;
356
+ ) => Promise<object>;
355
357
  /**
356
358
  * - Update multiple data objects in a datastore collection.
357
359
  * - Input document is patched with the matched database objects
@@ -361,7 +363,7 @@ export type DatastoreAPI = {
361
363
  query: object,
362
364
  document: object,
363
365
  updateoperators?: object
364
- ) => Promise<any>;
366
+ ) => Promise<object>;
365
367
  /**
366
368
  * - Replace one data object by ID in a datastore collection.
367
369
  * - Input document overwrites the matched database object, the _id value is not overwritten.
@@ -369,8 +371,9 @@ export type DatastoreAPI = {
369
371
  replaceOne: (
370
372
  collection: string,
371
373
  query: string | object,
374
+ document: object,
372
375
  options?: object
373
- ) => Promise<any>;
376
+ ) => Promise<object>;
374
377
  /**
375
378
  * - Replace multiple data objects in a datastore collection.
376
379
  * - Input document overwrites the matched database objects. The _id value is not overwritten
@@ -378,16 +381,17 @@ export type DatastoreAPI = {
378
381
  replaceMany: (
379
382
  collection: string,
380
383
  query: object,
384
+ document: object,
381
385
  options?: object
382
- ) => Promise<any>;
386
+ ) => Promise<object>;
383
387
  /**
384
388
  * - Remove one data object by ID in a collection in the current Datastore
385
389
  */
386
- removeOne: (collection: string, query: string | object) => Promise<any>;
390
+ removeOne: (collection: string, query: string | object) => Promise<object>;
387
391
  /**
388
392
  * - Remove multiple data objects in a collection in the current Datastore
389
393
  */
390
- removeMany: (collection: string, query: object) => Promise<any>;
394
+ removeMany: (collection: string, query: object) => Promise<object>;
391
395
  /**
392
396
  * - Set a key-value pair in the current Datastore
393
397
  */