hide-a-bed 5.1.3 → 5.1.5
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/README.md +14 -0
- package/cjs/schema/query.cjs +2 -2
- package/docs/compiler.png +0 -0
- package/package.json +3 -2
- package/schema/query.mjs +2 -2
package/README.md
CHANGED
|
@@ -40,9 +40,23 @@ A convience method to bind the config, so you dont need to pass it in.
|
|
|
40
40
|
```
|
|
41
41
|
import { bindConfig } from 'hide-a-bed'
|
|
42
42
|
const db = bindConfig(process.env)
|
|
43
|
+
const services = { db } // see example below
|
|
43
44
|
const doc = await db.get('doc-123')
|
|
44
45
|
```
|
|
45
46
|
|
|
47
|
+
If you need to force autocompletion/type-checking, you can add the following jsdoc to help your editor
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
function doSomething (services)
|
|
51
|
+
/** @type { import('hide-a-bed').DB} db */
|
|
52
|
+
const db = services.db;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Here is an example of compiler warnings:
|
|
56
|
+
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
|
|
46
60
|
##### Config Overrides
|
|
47
61
|
|
|
48
62
|
You also can quickly change one (or more) config settings for a particular call with the db.config(options)
|
package/cjs/schema/query.cjs
CHANGED
|
@@ -42,8 +42,8 @@ const SimpleViewOptions = import_zod.z.object({
|
|
|
42
42
|
startkey: import_zod.z.any().optional(),
|
|
43
43
|
endkey: import_zod.z.any().optional(),
|
|
44
44
|
descending: import_zod.z.boolean().optional().describe("sort results descending"),
|
|
45
|
-
skip: import_zod.z.number().
|
|
46
|
-
limit: import_zod.z.number().
|
|
45
|
+
skip: import_zod.z.number().nonnegative().optional().describe("skip this many rows"),
|
|
46
|
+
limit: import_zod.z.number().nonnegative().optional().describe("limit the results to this many rows"),
|
|
47
47
|
key: import_zod.z.any().optional(),
|
|
48
48
|
keys: import_zod.z.array(import_zod.z.any()).optional(),
|
|
49
49
|
include_docs: import_zod.z.boolean().optional().describe("join the id to the doc and return it"),
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hide-a-bed",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.5",
|
|
4
4
|
"description": "An abstraction over couchdb calls that includes easy mock/stubs with pouchdb",
|
|
5
5
|
"module": "index.mjs",
|
|
6
6
|
"main": "cjs/index.cjs",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"types": "index.d.mts",
|
|
8
9
|
"exports": {
|
|
9
10
|
"require": "./cjs/index.cjs",
|
|
10
11
|
"import": "./index.mjs",
|
|
@@ -57,4 +58,4 @@
|
|
|
57
58
|
"node": "20.17.0",
|
|
58
59
|
"npm": "10.8.2"
|
|
59
60
|
}
|
|
60
|
-
}
|
|
61
|
+
}
|
package/schema/query.mjs
CHANGED
|
@@ -20,8 +20,8 @@ export const SimpleViewOptions = z.object({
|
|
|
20
20
|
startkey: z.any().optional(),
|
|
21
21
|
endkey: z.any().optional(),
|
|
22
22
|
descending: z.boolean().optional().describe('sort results descending'),
|
|
23
|
-
skip: z.number().
|
|
24
|
-
limit: z.number().
|
|
23
|
+
skip: z.number().nonnegative().optional().describe('skip this many rows'),
|
|
24
|
+
limit: z.number().nonnegative().optional().describe('limit the results to this many rows'),
|
|
25
25
|
key: z.any().optional(),
|
|
26
26
|
keys: z.array(z.any()).optional(),
|
|
27
27
|
include_docs: z.boolean().optional().describe('join the id to the doc and return it'),
|