hide-a-bed 5.2.8 → 6.0.0
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/.prettierrc +7 -0
- package/README.md +270 -218
- package/dist/cjs/index.cjs +1952 -0
- package/dist/esm/index.mjs +1898 -0
- package/eslint.config.js +15 -0
- package/impl/bindConfig.mts +140 -0
- package/impl/bulkGet.mts +256 -0
- package/impl/bulkRemove.mts +98 -0
- package/impl/bulkSave.mts +286 -0
- package/impl/get.mts +137 -0
- package/impl/getDBInfo.mts +67 -0
- package/impl/patch.mts +134 -0
- package/impl/put.mts +56 -0
- package/impl/query.mts +224 -0
- package/impl/remove.mts +65 -0
- package/impl/retry.mts +66 -0
- package/impl/stream.mts +143 -0
- package/impl/sugar/lock.mts +103 -0
- package/impl/sugar/{watch.mjs → watch.mts} +56 -22
- package/impl/utils/errors.mts +130 -0
- package/impl/utils/logger.mts +62 -0
- package/impl/utils/mergeNeedleOpts.mts +16 -0
- package/impl/utils/parseRows.mts +117 -0
- package/impl/utils/queryBuilder.mts +173 -0
- package/impl/utils/queryString.mts +44 -0
- package/impl/{trackedEmitter.mjs → utils/trackedEmitter.mts} +9 -7
- package/impl/utils/transactionErrors.mts +71 -0
- package/index.mts +82 -0
- package/migration_guides/v6.md +70 -0
- package/package.json +49 -32
- package/schema/config.mts +81 -0
- package/schema/couch/couch.input.schema.ts +43 -0
- package/schema/couch/couch.output.schema.ts +169 -0
- package/schema/sugar/lock.mts +18 -0
- package/schema/sugar/watch.mts +14 -0
- package/schema/util.mts +8 -0
- package/tsconfig.json +10 -4
- package/tsdown.config.ts +16 -0
- package/typedoc.json +4 -0
- package/types/output/eslint.config.d.ts +3 -0
- package/types/output/eslint.config.d.ts.map +1 -0
- package/types/output/impl/bindConfig.d.mts +174 -0
- package/types/output/impl/bindConfig.d.mts.map +1 -0
- package/types/output/impl/bulkGet.d.mts +75 -0
- package/types/output/impl/bulkGet.d.mts.map +1 -0
- package/types/output/impl/bulkGet.test.d.mts +2 -0
- package/types/output/impl/bulkGet.test.d.mts.map +1 -0
- package/types/output/impl/bulkRemove.d.mts +63 -0
- package/types/output/impl/bulkRemove.d.mts.map +1 -0
- package/types/output/impl/bulkRemove.test.d.mts +2 -0
- package/types/output/impl/bulkRemove.test.d.mts.map +1 -0
- package/types/output/impl/bulkSave.d.mts +64 -0
- package/types/output/impl/bulkSave.d.mts.map +1 -0
- package/types/output/impl/bulkSave.test.d.mts +2 -0
- package/types/output/impl/bulkSave.test.d.mts.map +1 -0
- package/types/output/impl/get.d.mts +20 -0
- package/types/output/impl/get.d.mts.map +1 -0
- package/types/output/impl/get.test.d.mts +2 -0
- package/types/output/impl/get.test.d.mts.map +1 -0
- package/types/output/impl/getDBInfo.d.mts +52 -0
- package/types/output/impl/getDBInfo.d.mts.map +1 -0
- package/types/output/impl/getDBInfo.test.d.mts +2 -0
- package/types/output/impl/getDBInfo.test.d.mts.map +1 -0
- package/types/output/impl/patch.d.mts +45 -0
- package/types/output/impl/patch.d.mts.map +1 -0
- package/types/output/impl/patch.test.d.mts +2 -0
- package/types/output/impl/patch.test.d.mts.map +1 -0
- package/types/output/impl/put.d.mts +5 -0
- package/types/output/impl/put.d.mts.map +1 -0
- package/types/output/impl/put.test.d.mts +2 -0
- package/types/output/impl/put.test.d.mts.map +1 -0
- package/types/output/impl/query.d.mts +47 -0
- package/types/output/impl/query.d.mts.map +1 -0
- package/types/output/impl/query.test.d.mts +2 -0
- package/types/output/impl/query.test.d.mts.map +1 -0
- package/types/output/impl/remove.d.mts +9 -0
- package/types/output/impl/remove.d.mts.map +1 -0
- package/types/output/impl/remove.test.d.mts +2 -0
- package/types/output/impl/remove.test.d.mts.map +1 -0
- package/types/output/impl/retry.d.mts +32 -0
- package/types/output/impl/retry.d.mts.map +1 -0
- package/types/output/impl/retry.test.d.mts +2 -0
- package/types/output/impl/retry.test.d.mts.map +1 -0
- package/types/output/impl/stream.d.mts +13 -0
- package/types/output/impl/stream.d.mts.map +1 -0
- package/types/output/impl/stream.test.d.mts +2 -0
- package/types/output/impl/stream.test.d.mts.map +1 -0
- package/types/output/impl/sugar/lock.d.mts +24 -0
- package/types/output/impl/sugar/lock.d.mts.map +1 -0
- package/types/output/impl/sugar/lock.test.d.mts +2 -0
- package/types/output/impl/sugar/lock.test.d.mts.map +1 -0
- package/types/output/impl/sugar/watch.d.mts +21 -0
- package/types/output/impl/sugar/watch.d.mts.map +1 -0
- package/types/output/impl/sugar/watch.test.d.mts +2 -0
- package/types/output/impl/sugar/watch.test.d.mts.map +1 -0
- package/types/output/impl/utils/errors.d.mts +78 -0
- package/types/output/impl/utils/errors.d.mts.map +1 -0
- package/types/output/impl/utils/errors.test.d.mts +2 -0
- package/types/output/impl/utils/errors.test.d.mts.map +1 -0
- package/types/output/impl/utils/logger.d.mts +11 -0
- package/types/output/impl/utils/logger.d.mts.map +1 -0
- package/types/output/impl/utils/logger.test.d.mts +2 -0
- package/types/output/impl/utils/logger.test.d.mts.map +1 -0
- package/types/output/impl/utils/mergeNeedleOpts.d.mts +53 -0
- package/types/output/impl/utils/mergeNeedleOpts.d.mts.map +1 -0
- package/types/output/impl/utils/parseRows.d.mts +15 -0
- package/types/output/impl/utils/parseRows.d.mts.map +1 -0
- package/types/output/impl/utils/parseRows.test.d.mts +2 -0
- package/types/output/impl/utils/parseRows.test.d.mts.map +1 -0
- package/types/output/impl/utils/queryBuilder.d.mts +68 -0
- package/types/output/impl/utils/queryBuilder.d.mts.map +1 -0
- package/types/output/impl/utils/queryBuilder.test.d.mts +2 -0
- package/types/output/impl/utils/queryBuilder.test.d.mts.map +1 -0
- package/types/output/impl/utils/queryString.d.mts +9 -0
- package/types/output/impl/utils/queryString.d.mts.map +1 -0
- package/types/output/impl/utils/queryString.test.d.mts +2 -0
- package/types/output/impl/utils/queryString.test.d.mts.map +1 -0
- package/types/output/impl/utils/trackedEmitter.d.mts +7 -0
- package/types/output/impl/utils/trackedEmitter.d.mts.map +1 -0
- package/{impl → types/output/impl/utils}/transactionErrors.d.mts +16 -31
- package/types/output/impl/utils/transactionErrors.d.mts.map +1 -0
- package/types/output/index.d.mts +32 -0
- package/types/output/index.d.mts.map +1 -0
- package/types/output/index.test.d.mts +2 -0
- package/types/output/index.test.d.mts.map +1 -0
- package/types/output/schema/config.d.mts +90 -0
- package/types/output/schema/config.d.mts.map +1 -0
- package/types/output/schema/couch/couch.input.schema.d.ts +29 -0
- package/types/output/schema/couch/couch.input.schema.d.ts.map +1 -0
- package/types/output/schema/couch/couch.output.schema.d.ts +113 -0
- package/types/output/schema/couch/couch.output.schema.d.ts.map +1 -0
- package/types/output/schema/sugar/lock.d.mts +19 -0
- package/types/output/schema/sugar/lock.d.mts.map +1 -0
- package/types/output/schema/sugar/watch.d.mts +11 -0
- package/types/output/schema/sugar/watch.d.mts.map +1 -0
- package/types/output/schema/util.d.mts +85 -0
- package/types/output/schema/util.d.mts.map +1 -0
- package/types/output/tsdown.config.d.ts +3 -0
- package/types/output/tsdown.config.d.ts.map +1 -0
- package/types/output/types/standard-schema.d.ts +60 -0
- package/types/output/types/standard-schema.d.ts.map +1 -0
- package/types/standard-schema.ts +76 -0
- package/types/utils.d.ts +1 -0
- package/cjs/impl/bulk.cjs +0 -275
- package/cjs/impl/changes.cjs +0 -67
- package/cjs/impl/crud.cjs +0 -127
- package/cjs/impl/errors.cjs +0 -75
- package/cjs/impl/logger.cjs +0 -70
- package/cjs/impl/patch.cjs +0 -95
- package/cjs/impl/query.cjs +0 -116
- package/cjs/impl/queryBuilder.cjs +0 -163
- package/cjs/impl/retry.cjs +0 -55
- package/cjs/impl/stream.cjs +0 -121
- package/cjs/impl/sugar/lock.cjs +0 -81
- package/cjs/impl/sugar/watch.cjs +0 -159
- package/cjs/impl/trackedEmitter.cjs +0 -54
- package/cjs/impl/transactionErrors.cjs +0 -70
- package/cjs/impl/util.cjs +0 -64
- package/cjs/index.cjs +0 -132
- package/cjs/integration/changes.cjs +0 -76
- package/cjs/integration/disconnect-watch.cjs +0 -52
- package/cjs/integration/watch.cjs +0 -59
- package/cjs/schema/bind.cjs +0 -59
- package/cjs/schema/bulk.cjs +0 -92
- package/cjs/schema/changes.cjs +0 -68
- package/cjs/schema/config.cjs +0 -48
- package/cjs/schema/crud.cjs +0 -77
- package/cjs/schema/patch.cjs +0 -53
- package/cjs/schema/query.cjs +0 -62
- package/cjs/schema/stream.cjs +0 -42
- package/cjs/schema/sugar/lock.cjs +0 -59
- package/cjs/schema/sugar/watch.cjs +0 -42
- package/cjs/schema/util.cjs +0 -39
- package/config.json +0 -5
- package/docs/compiler.png +0 -0
- package/dualmode.config.json +0 -11
- package/impl/bulk.d.mts +0 -11
- package/impl/bulk.d.mts.map +0 -1
- package/impl/bulk.mjs +0 -291
- package/impl/changes.d.mts +0 -12
- package/impl/changes.d.mts.map +0 -1
- package/impl/changes.mjs +0 -53
- package/impl/crud.d.mts +0 -7
- package/impl/crud.d.mts.map +0 -1
- package/impl/crud.mjs +0 -108
- package/impl/errors.d.mts +0 -43
- package/impl/errors.d.mts.map +0 -1
- package/impl/errors.mjs +0 -65
- package/impl/logger.d.mts +0 -32
- package/impl/logger.d.mts.map +0 -1
- package/impl/logger.mjs +0 -59
- package/impl/patch.d.mts +0 -6
- package/impl/patch.d.mts.map +0 -1
- package/impl/patch.mjs +0 -88
- package/impl/query.d.mts +0 -195
- package/impl/query.d.mts.map +0 -1
- package/impl/query.mjs +0 -122
- package/impl/queryBuilder.d.mts +0 -154
- package/impl/queryBuilder.d.mts.map +0 -1
- package/impl/queryBuilder.mjs +0 -175
- package/impl/retry.d.mts +0 -2
- package/impl/retry.d.mts.map +0 -1
- package/impl/retry.mjs +0 -39
- package/impl/stream.d.mts +0 -3
- package/impl/stream.d.mts.map +0 -1
- package/impl/stream.mjs +0 -98
- package/impl/sugar/lock.d.mts +0 -5
- package/impl/sugar/lock.d.mts.map +0 -1
- package/impl/sugar/lock.mjs +0 -70
- package/impl/sugar/watch.d.mts +0 -34
- package/impl/sugar/watch.d.mts.map +0 -1
- package/impl/trackedEmitter.d.mts +0 -8
- package/impl/trackedEmitter.d.mts.map +0 -1
- package/impl/transactionErrors.d.mts.map +0 -1
- package/impl/transactionErrors.mjs +0 -47
- package/impl/util.d.mts +0 -3
- package/impl/util.d.mts.map +0 -1
- package/impl/util.mjs +0 -35
- package/index.d.mts +0 -80
- package/index.d.mts.map +0 -1
- package/index.mjs +0 -141
- package/integration/changes.mjs +0 -60
- package/integration/disconnect-watch.mjs +0 -36
- package/integration/watch.mjs +0 -40
- package/schema/bind.d.mts +0 -5461
- package/schema/bind.d.mts.map +0 -1
- package/schema/bind.mjs +0 -43
- package/schema/bulk.d.mts +0 -923
- package/schema/bulk.d.mts.map +0 -1
- package/schema/bulk.mjs +0 -83
- package/schema/changes.d.mts +0 -191
- package/schema/changes.d.mts.map +0 -1
- package/schema/changes.mjs +0 -59
- package/schema/config.d.mts +0 -79
- package/schema/config.d.mts.map +0 -1
- package/schema/config.mjs +0 -26
- package/schema/crud.d.mts +0 -491
- package/schema/crud.d.mts.map +0 -1
- package/schema/crud.mjs +0 -64
- package/schema/patch.d.mts +0 -255
- package/schema/patch.d.mts.map +0 -1
- package/schema/patch.mjs +0 -42
- package/schema/query.d.mts +0 -406
- package/schema/query.d.mts.map +0 -1
- package/schema/query.mjs +0 -45
- package/schema/stream.d.mts +0 -211
- package/schema/stream.d.mts.map +0 -1
- package/schema/stream.mjs +0 -23
- package/schema/sugar/lock.d.mts +0 -238
- package/schema/sugar/lock.d.mts.map +0 -1
- package/schema/sugar/lock.mjs +0 -50
- package/schema/sugar/watch.d.mts +0 -127
- package/schema/sugar/watch.d.mts.map +0 -1
- package/schema/sugar/watch.mjs +0 -29
- package/schema/util.d.mts +0 -160
- package/schema/util.d.mts.map +0 -1
- package/schema/util.mjs +0 -35
- package/types/changes-stream.d.ts +0 -11
package/impl/queryBuilder.mjs
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {Object} QueryOptions
|
|
5
|
-
* @property {any} [key] - Exact key to match
|
|
6
|
-
* @property {any} [startkey] - Start of key range
|
|
7
|
-
* @property {any} [endkey] - End of key range
|
|
8
|
-
* @property {boolean} [reduce] - Whether to use reduce function
|
|
9
|
-
* @property {boolean} [group] - Whether to group results
|
|
10
|
-
* @property {number} [group_level] - Level at which to group
|
|
11
|
-
* @property {boolean} [include_docs] - Whether to include full couch docs
|
|
12
|
-
* @property {string} [stale] - Stale parameter value
|
|
13
|
-
* @property {number} [limit] - Max number of results
|
|
14
|
-
* @property {boolean} [descending] - Whether to return results in descending order
|
|
15
|
-
* @property {number} [skip] - Number of results to skip
|
|
16
|
-
* @property {any[]} [keys] - Array of keys to match
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
export class QueryBuilder {
|
|
20
|
-
/** @type {QueryOptions} */
|
|
21
|
-
#options = {}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {any} key
|
|
25
|
-
* @returns {QueryBuilder}
|
|
26
|
-
*/
|
|
27
|
-
key (key) {
|
|
28
|
-
this.#options.key = key
|
|
29
|
-
return this
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @param {any} startkey
|
|
34
|
-
* @returns {QueryBuilder}
|
|
35
|
-
*/
|
|
36
|
-
startKey (startkey) {
|
|
37
|
-
this.#options.startkey = startkey
|
|
38
|
-
return this
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @param {any} startkey
|
|
43
|
-
* @returns {QueryBuilder}
|
|
44
|
-
*/
|
|
45
|
-
startkey (startkey) {
|
|
46
|
-
this.#options.startkey = startkey
|
|
47
|
-
return this
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @param {any} endkey
|
|
52
|
-
* @returns {QueryBuilder}
|
|
53
|
-
*/
|
|
54
|
-
endKey (endkey) {
|
|
55
|
-
this.#options.endkey = endkey
|
|
56
|
-
return this
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @param {any} endkey
|
|
61
|
-
* @returns {QueryBuilder}
|
|
62
|
-
*/
|
|
63
|
-
endkey (endkey) {
|
|
64
|
-
this.#options.endkey = endkey
|
|
65
|
-
return this
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @param {boolean} reduce
|
|
70
|
-
* @returns {QueryBuilder}
|
|
71
|
-
*/
|
|
72
|
-
reduce (reduce = true) {
|
|
73
|
-
this.#options.reduce = reduce
|
|
74
|
-
return this
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @param {boolean} group
|
|
79
|
-
* @returns {QueryBuilder}
|
|
80
|
-
*/
|
|
81
|
-
group (group = true) {
|
|
82
|
-
this.#options.group = group
|
|
83
|
-
return this
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @param {number} level
|
|
88
|
-
* @returns {QueryBuilder}
|
|
89
|
-
*/
|
|
90
|
-
groupLevel (level) {
|
|
91
|
-
this.#options.group_level = level
|
|
92
|
-
return this
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @param {number} level
|
|
97
|
-
* @returns {QueryBuilder}
|
|
98
|
-
*/
|
|
99
|
-
group_level (level) {
|
|
100
|
-
this.#options.group_level = level
|
|
101
|
-
return this
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @param {boolean} includeDocs
|
|
106
|
-
* @returns {QueryBuilder}
|
|
107
|
-
*/
|
|
108
|
-
includeDocs (includeDocs = true) {
|
|
109
|
-
this.#options.include_docs = includeDocs
|
|
110
|
-
return this
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @param {boolean} includeDocs
|
|
115
|
-
* @returns {QueryBuilder}
|
|
116
|
-
*/
|
|
117
|
-
include_docs (includeDocs = true) {
|
|
118
|
-
this.#options.include_docs = includeDocs
|
|
119
|
-
return this
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* @param {string} stale
|
|
124
|
-
* @returns {QueryBuilder}
|
|
125
|
-
*/
|
|
126
|
-
stale (stale) {
|
|
127
|
-
this.#options.stale = stale
|
|
128
|
-
return this
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @param {number} limit
|
|
133
|
-
* @returns {QueryBuilder}
|
|
134
|
-
*/
|
|
135
|
-
limit (limit) {
|
|
136
|
-
this.#options.limit = limit
|
|
137
|
-
return this
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* @param {boolean} descending
|
|
142
|
-
* @returns {QueryBuilder}
|
|
143
|
-
*/
|
|
144
|
-
descending (descending = true) {
|
|
145
|
-
this.#options.descending = descending
|
|
146
|
-
return this
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* @param {number} skip
|
|
151
|
-
* @returns {QueryBuilder}
|
|
152
|
-
*/
|
|
153
|
-
skip (skip) {
|
|
154
|
-
this.#options.skip = skip
|
|
155
|
-
return this
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* @param {any[]} keys
|
|
160
|
-
* @returns {QueryBuilder}
|
|
161
|
-
*/
|
|
162
|
-
keys (keys) {
|
|
163
|
-
this.#options.keys = keys
|
|
164
|
-
return this
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* @returns {QueryOptions}
|
|
169
|
-
*/
|
|
170
|
-
build () {
|
|
171
|
-
return { ...this.#options }
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export const createQuery = () => new QueryBuilder()
|
package/impl/retry.d.mts
DELETED
package/impl/retry.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.mts","sourceRoot":"","sources":["retry.mjs"],"names":[],"mappings":"AAGA,mFAmCC"}
|
package/impl/retry.mjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { RetryableError } from './errors.mjs'
|
|
2
|
-
import { sleep } from './patch.mjs'
|
|
3
|
-
|
|
4
|
-
export function withRetry (fn, options = {}) {
|
|
5
|
-
const {
|
|
6
|
-
maxRetries = 3,
|
|
7
|
-
initialDelay = 1000, // 1 second
|
|
8
|
-
backoffFactor = 2, // exponential backoff multiplier
|
|
9
|
-
maxDelay = 30000 // 30 seconds max delay
|
|
10
|
-
} = options
|
|
11
|
-
|
|
12
|
-
return async (...args) => {
|
|
13
|
-
let delay = initialDelay
|
|
14
|
-
|
|
15
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
16
|
-
try {
|
|
17
|
-
// Clear any references to previous attempts
|
|
18
|
-
const result = await fn(...args)
|
|
19
|
-
return result
|
|
20
|
-
} catch (error) {
|
|
21
|
-
// Only retry if it's a RetryableError
|
|
22
|
-
if (!(error instanceof RetryableError)) {
|
|
23
|
-
throw error
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// If we've used all retries, throw the error
|
|
27
|
-
if (attempt === maxRetries) {
|
|
28
|
-
throw error
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Calculate next delay with a maximum cap
|
|
32
|
-
const nextDelay = Math.min(delay, maxDelay)
|
|
33
|
-
// Wait with exponential backoff
|
|
34
|
-
await sleep(nextDelay)
|
|
35
|
-
delay *= backoffFactor
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
package/impl/stream.d.mts
DELETED
package/impl/stream.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.mts","sourceRoot":"","sources":["stream.mjs"],"names":[],"mappings":"AASA,uFAAuF;AACvF,0BADY,OAAO,sBAAsB,EAAE,2BAA2B,CAwFpE"}
|
package/impl/stream.mjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import needle from 'needle'
|
|
3
|
-
import { CouchConfig } from '../schema/config.mjs'
|
|
4
|
-
import { queryString } from './query.mjs'
|
|
5
|
-
import { RetryableError } from './errors.mjs'
|
|
6
|
-
import { createLogger } from './logger.mjs'
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
import JSONStream from 'JSONStream'
|
|
9
|
-
|
|
10
|
-
/** @type { import('../schema/stream.mjs').SimpleViewQueryStreamSchema } queryStream */
|
|
11
|
-
export const queryStream = (rawConfig, view, options, onRow) => new Promise((resolve, reject) => {
|
|
12
|
-
const config = CouchConfig.parse(rawConfig)
|
|
13
|
-
const logger = createLogger(config)
|
|
14
|
-
logger.info(`Starting view query stream: ${view}`)
|
|
15
|
-
logger.debug('Query options:', options)
|
|
16
|
-
|
|
17
|
-
if (!options) options = {}
|
|
18
|
-
|
|
19
|
-
let method = 'GET'
|
|
20
|
-
let payload = null
|
|
21
|
-
let qs = queryString(options, ['key', 'startkey', 'endkey', 'reduce', 'group', 'group_level', 'stale', 'limit'])
|
|
22
|
-
logger.debug('Generated query string:', qs)
|
|
23
|
-
|
|
24
|
-
// If keys are supplied, issue a POST to circumvent GET query string limits
|
|
25
|
-
if (typeof options.keys !== 'undefined') {
|
|
26
|
-
const MAX_URL_LENGTH = 2000
|
|
27
|
-
const keysAsString = `keys=${encodeURIComponent(JSON.stringify(options.keys))}`
|
|
28
|
-
|
|
29
|
-
if (keysAsString.length + qs.length + 1 <= MAX_URL_LENGTH) {
|
|
30
|
-
// If the keys are short enough, do a GET
|
|
31
|
-
qs += (qs[0] === '?' ? '&' : '?') + keysAsString
|
|
32
|
-
} else {
|
|
33
|
-
method = 'POST'
|
|
34
|
-
payload = { keys: options.keys }
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const url = `${config.couch}/${view}?${qs.toString()}`
|
|
39
|
-
const opts = {
|
|
40
|
-
json: true,
|
|
41
|
-
headers: {
|
|
42
|
-
'Content-Type': 'application/json'
|
|
43
|
-
},
|
|
44
|
-
parse_response: false // Keep as stream
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const streamer = JSONStream.parse('rows.*')
|
|
48
|
-
|
|
49
|
-
let rowCount = 0
|
|
50
|
-
streamer.on('data', /** @param {object} row */ row => {
|
|
51
|
-
rowCount++
|
|
52
|
-
onRow(row)
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
streamer.on('error', /** @param {Error} err */ err => {
|
|
56
|
-
logger.error('Stream parsing error:', err)
|
|
57
|
-
reject(new Error(`Stream parsing error: ${err.message}`))
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
streamer.on('done', /** @param {Error|null} err */ err => {
|
|
61
|
-
try {
|
|
62
|
-
RetryableError.handleNetworkError(err)
|
|
63
|
-
} catch (e) {
|
|
64
|
-
reject(e)
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
streamer.on('end', () => {
|
|
69
|
-
logger.info(`Stream completed, processed ${rowCount} rows`)
|
|
70
|
-
resolve(undefined) // all work should be done in the stream
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
const req = method === 'GET'
|
|
74
|
-
? needle.get(url, opts)
|
|
75
|
-
: needle.post(url, payload, opts)
|
|
76
|
-
|
|
77
|
-
req.on('response', response => {
|
|
78
|
-
logger.debug(`Received response with status code: ${response.statusCode}`)
|
|
79
|
-
if (RetryableError.isRetryableStatusCode(response.statusCode)) {
|
|
80
|
-
logger.warn(`Retryable status code received: ${response.statusCode}`)
|
|
81
|
-
reject(new RetryableError('retryable error during stream query', response.statusCode))
|
|
82
|
-
// req.abort()
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
req.on('error', err => {
|
|
87
|
-
logger.error('Network error during stream query:', err)
|
|
88
|
-
try {
|
|
89
|
-
RetryableError.handleNetworkError(err)
|
|
90
|
-
} catch (retryErr) {
|
|
91
|
-
reject(retryErr)
|
|
92
|
-
return
|
|
93
|
-
}
|
|
94
|
-
reject(err)
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
req.pipe(streamer)
|
|
98
|
-
})
|
package/impl/sugar/lock.d.mts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** @type {import('../../schema/sugar/lock.mjs').CreateLockSchema} */
|
|
2
|
-
export const createLock: import("../../schema/sugar/lock.mjs").CreateLockSchema;
|
|
3
|
-
/** @type {import('../../schema/sugar/lock.mjs').RemoveLockSchema} */
|
|
4
|
-
export const removeLock: import("../../schema/sugar/lock.mjs").RemoveLockSchema;
|
|
5
|
-
//# sourceMappingURL=lock.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.mts","sourceRoot":"","sources":["lock.mjs"],"names":[],"mappings":"AAIA,qEAAqE;AACrE,yBADW,OAAO,6BAA6B,EAAE,gBAAgB,CA8B/D;AAEF,qEAAqE;AACrE,yBADW,OAAO,6BAA6B,EAAE,gBAAgB,CAiC/D"}
|
package/impl/sugar/lock.mjs
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { CreateLock, RemoveLock } from '../../schema/sugar/lock.mjs'
|
|
2
|
-
import { put, get } from '../crud.mjs'
|
|
3
|
-
import { createLogger } from '../logger.mjs'
|
|
4
|
-
|
|
5
|
-
/** @type {import('../../schema/sugar/lock.mjs').CreateLockSchema} */
|
|
6
|
-
export const createLock = CreateLock.implement(async (config, docId, options) => {
|
|
7
|
-
const logger = createLogger(config)
|
|
8
|
-
|
|
9
|
-
if (!options.enableLocking) {
|
|
10
|
-
logger.debug('Locking disabled, returning true')
|
|
11
|
-
return true
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const _id = `lock-${docId}`
|
|
15
|
-
const lock = {
|
|
16
|
-
_id,
|
|
17
|
-
type: 'lock',
|
|
18
|
-
locks: docId,
|
|
19
|
-
lockedAt: new Date().toISOString(),
|
|
20
|
-
lockedBy: options.username
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
const result = await put(config, lock)
|
|
25
|
-
logger.info(`Lock created for ${docId} by ${options.username}`)
|
|
26
|
-
return result.ok === true
|
|
27
|
-
} catch (error) {
|
|
28
|
-
if (error.status === 409) {
|
|
29
|
-
logger.warn(`Lock conflict for ${docId} - already locked`)
|
|
30
|
-
} else {
|
|
31
|
-
logger.error(`Error creating lock for ${docId}:`, error)
|
|
32
|
-
}
|
|
33
|
-
return false
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
/** @type {import('../../schema/sugar/lock.mjs').RemoveLockSchema} */
|
|
38
|
-
export const removeLock = RemoveLock.implement(async (config, docId, options) => {
|
|
39
|
-
const logger = createLogger(config)
|
|
40
|
-
|
|
41
|
-
if (!options.enableLocking) {
|
|
42
|
-
logger.debug('Locking disabled, skipping unlock')
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (!docId) {
|
|
47
|
-
logger.warn('No docId provided for unlock')
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const _id = `lock-${docId}`
|
|
52
|
-
const existingLock = await get(config, _id)
|
|
53
|
-
|
|
54
|
-
if (!existingLock) {
|
|
55
|
-
logger.debug(`No lock found for ${docId}`)
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (existingLock.lockedBy !== options.username) {
|
|
60
|
-
logger.warn(`Cannot remove lock for ${docId} - owned by ${existingLock.lockedBy}`)
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
await put(config, { ...existingLock, _deleted: true })
|
|
66
|
-
logger.info(`Lock removed for ${docId}`)
|
|
67
|
-
} catch (error) {
|
|
68
|
-
logger.error(`Error removing lock for ${docId}:`, error)
|
|
69
|
-
}
|
|
70
|
-
})
|
package/impl/sugar/watch.d.mts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export const watchDocs: (args_0: import("zod").objectInputType<{
|
|
2
|
-
throwOnGetNotFound: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
3
|
-
couch: import("zod").ZodString;
|
|
4
|
-
bindWithRetry: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
5
|
-
maxRetries: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
6
|
-
initialDelay: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
7
|
-
backoffFactor: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
8
|
-
useConsoleLogger: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
9
|
-
logger: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
10
|
-
error: import("zod").ZodOptional<import("zod").ZodFunction<import("zod").ZodTuple<[import("zod").ZodAny], import("zod").ZodUnknown>, import("zod").ZodVoid>>;
|
|
11
|
-
warn: import("zod").ZodOptional<import("zod").ZodFunction<import("zod").ZodTuple<[import("zod").ZodAny], import("zod").ZodUnknown>, import("zod").ZodVoid>>;
|
|
12
|
-
info: import("zod").ZodOptional<import("zod").ZodFunction<import("zod").ZodTuple<[import("zod").ZodAny], import("zod").ZodUnknown>, import("zod").ZodVoid>>;
|
|
13
|
-
debug: import("zod").ZodOptional<import("zod").ZodFunction<import("zod").ZodTuple<[import("zod").ZodAny], import("zod").ZodUnknown>, import("zod").ZodVoid>>;
|
|
14
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
15
|
-
error?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
16
|
-
warn?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
17
|
-
info?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
18
|
-
debug?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
error?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
21
|
-
warn?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
22
|
-
info?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
23
|
-
debug?: ((args_0: any, ...args: unknown[]) => void) | undefined;
|
|
24
|
-
}>, import("zod").ZodFunction<import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodAny], import("zod").ZodUnknown>, import("zod").ZodVoid>]>>;
|
|
25
|
-
_normalizedLogger: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
26
|
-
}, import("zod").ZodTypeAny, "passthrough">, args_1: string | string[], args_2: (args_0: any, ...args: unknown[]) => void, args_3: {
|
|
27
|
-
include_docs?: boolean | undefined;
|
|
28
|
-
}, ...args: unknown[]) => {
|
|
29
|
-
on: (event: string, listener: (args_0: any, ...args: unknown[]) => void) => EventEmitter<[never]>;
|
|
30
|
-
removeListener: (event: string, listener: (args_0: any, ...args: unknown[]) => void) => EventEmitter<[never]>;
|
|
31
|
-
stop: () => void;
|
|
32
|
-
};
|
|
33
|
-
import { EventEmitter } from 'events';
|
|
34
|
-
//# sourceMappingURL=watch.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.mts","sourceRoot":"","sources":["watch.mjs"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiJE;6BAxJ2B,QAAQ"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export class TrackedEmitter extends EventEmitter<[never]> {
|
|
2
|
-
constructor(options: any);
|
|
3
|
-
delay: any;
|
|
4
|
-
emit(event: any, ...args: any[]): Promise<any>;
|
|
5
|
-
}
|
|
6
|
-
export function setupEmitter(config: any): any;
|
|
7
|
-
import { EventEmitter } from 'events';
|
|
8
|
-
//# sourceMappingURL=trackedEmitter.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackedEmitter.d.mts","sourceRoot":"","sources":["trackedEmitter.mjs"],"names":[],"mappings":"AAEA;IAEE,0BAGC;IADoB,WAA0B;IAG/C,+CAiBC;CACF;AAEM,+CAGN;6BAhC4B,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transactionErrors.d.mts","sourceRoot":"","sources":["transactionErrors.mjs"],"names":[],"mappings":"AAAA;IACE;;;OAGG;IACH,qBAHW,MAAM,YACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAM7B;IADC,6BAAsB;CAEzB;AAED;IACE;;OAEG;IACH,4BAFW,MAAM,EAAE,EAMlB;IADC,yBAAoC;CAEvC;AAED;IACE;;OAEG;IACH,wBAFW,KAAK,CAAC;QAAC,EAAE,CAAC,EAAE,OAAO,GAAC,IAAI,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAC,IAAI,CAAA;KAAC,CAAC,EAMpH;IADC;aALqB,OAAO,GAAC,IAAI;aAAO,MAAM,GAAC,IAAI;cAAQ,MAAM,GAAC,IAAI;gBAAU,MAAM,GAAC,IAAI;iBAAW,MAAM,GAAC,IAAI;QAKrF;CAE/B;AAED;IACE;;;;OAIG;IACH,qBAJW,MAAM,iBACN,KAAK,mBACL,KAAK,CAAC;QAAC,EAAE,CAAC,EAAE,OAAO,GAAC,IAAI,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAC,IAAI,CAAA;KAAC,CAAC,EAOpH;IAFC,qBAAkC;IAClC;aANqB,OAAO,GAAC,IAAI;aAAO,MAAM,GAAC,IAAI;cAAQ,MAAM,GAAC,IAAI;gBAAU,MAAM,GAAC,IAAI;iBAAW,MAAM,GAAC,IAAI;QAM3E;CAEzC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export class TransactionSetupError extends Error {
|
|
2
|
-
/**
|
|
3
|
-
* @param {string} message
|
|
4
|
-
* @param {Record<string, any>} details
|
|
5
|
-
*/
|
|
6
|
-
constructor (message, details = {}) {
|
|
7
|
-
super(message)
|
|
8
|
-
this.name = 'TransactionSetupError'
|
|
9
|
-
this.details = details
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class TransactionVersionConflictError extends Error {
|
|
14
|
-
/**
|
|
15
|
-
* @param {string[]} conflictingIds
|
|
16
|
-
*/
|
|
17
|
-
constructor (conflictingIds) {
|
|
18
|
-
super(`Revision mismatch for documents: ${conflictingIds.join(', ')}`)
|
|
19
|
-
this.name = 'TransactionVersionConflictError'
|
|
20
|
-
this.conflictingIds = conflictingIds
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export class TransactionBulkOperationError extends Error {
|
|
25
|
-
/**
|
|
26
|
-
* @param {Array<{ok?: boolean|null, id?: string|null, rev?: string|null, error?: string|null, reason?: string|null}>} failedDocs
|
|
27
|
-
*/
|
|
28
|
-
constructor (failedDocs) {
|
|
29
|
-
super(`Failed to save documents: ${failedDocs.map(d => d.id).join(', ')}`)
|
|
30
|
-
this.name = 'TransactionBulkOperationError'
|
|
31
|
-
this.failedDocs = failedDocs
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class TransactionRollbackError extends Error {
|
|
36
|
-
/**
|
|
37
|
-
* @param {string} message
|
|
38
|
-
* @param {Error} originalError
|
|
39
|
-
* @param {Array<{ok?: boolean|null, id?: string|null, rev?: string|null, error?: string|null, reason?: string|null}>} rollbackResults
|
|
40
|
-
*/
|
|
41
|
-
constructor (message, originalError, rollbackResults) {
|
|
42
|
-
super(message)
|
|
43
|
-
this.name = 'TransactionRollbackError'
|
|
44
|
-
this.originalError = originalError
|
|
45
|
-
this.rollbackResults = rollbackResults
|
|
46
|
-
}
|
|
47
|
-
}
|
package/impl/util.d.mts
DELETED
package/impl/util.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.mts","sourceRoot":"","sources":["util.mjs"],"names":[],"mappings":"AAMA,4DAA4D;AAC5D,wBADY,OAAO,oBAAoB,EAAE,eAAe,CA4BtD"}
|
package/impl/util.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import needle from 'needle'
|
|
3
|
-
import { RetryableError, NotFoundError } from './errors.mjs'
|
|
4
|
-
import { createLogger } from './logger.mjs'
|
|
5
|
-
import { GetDBInfo } from '../schema/util.mjs'
|
|
6
|
-
|
|
7
|
-
/** @type { import('../schema/util.mjs').GetDBInfoSchema} */
|
|
8
|
-
export const getDBInfo = GetDBInfo.implement(async (config) => {
|
|
9
|
-
const logger = createLogger(config)
|
|
10
|
-
const url = `${config.couch}`
|
|
11
|
-
const opts = {
|
|
12
|
-
json: true,
|
|
13
|
-
headers: {
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
let resp
|
|
18
|
-
try {
|
|
19
|
-
resp = await needle('get', url, opts)
|
|
20
|
-
} catch (err) {
|
|
21
|
-
logger.error('Error during put operation:', err)
|
|
22
|
-
RetryableError.handleNetworkError(err)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!resp) {
|
|
26
|
-
logger.error('No response received from put request')
|
|
27
|
-
throw new RetryableError('no response', 503)
|
|
28
|
-
}
|
|
29
|
-
const result = resp.body
|
|
30
|
-
if (RetryableError.isRetryableStatusCode(resp.statusCode)) {
|
|
31
|
-
logger.warn(`Retryable status code received: ${resp.statusCode}`)
|
|
32
|
-
throw new RetryableError(result.reason || 'retryable error', resp.statusCode)
|
|
33
|
-
}
|
|
34
|
-
return result
|
|
35
|
-
})
|
package/index.d.mts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
export type DB = z.infer<typeof BindReturns>;
|
|
2
|
-
import { get } from './impl/crud.mjs';
|
|
3
|
-
import { getAtRev } from './impl/crud.mjs';
|
|
4
|
-
import { put } from './impl/crud.mjs';
|
|
5
|
-
import { bulkGet } from './impl/bulk.mjs';
|
|
6
|
-
import { bulkSave } from './impl/bulk.mjs';
|
|
7
|
-
import { query } from './impl/query.mjs';
|
|
8
|
-
import { queryStream } from './impl/stream.mjs';
|
|
9
|
-
export namespace schema {
|
|
10
|
-
export { CouchConfig };
|
|
11
|
-
export { SimpleViewQuery };
|
|
12
|
-
export { SimpleViewQueryResponse };
|
|
13
|
-
export { SimpleViewQueryStream };
|
|
14
|
-
export { OnRow };
|
|
15
|
-
export { BulkSave };
|
|
16
|
-
export { BulkGet };
|
|
17
|
-
export { BulkRemove };
|
|
18
|
-
export { BulkGetDictionary };
|
|
19
|
-
export { BulkSaveTransaction };
|
|
20
|
-
export { CouchGet };
|
|
21
|
-
export { CouchPut };
|
|
22
|
-
export { CouchDoc };
|
|
23
|
-
export { CouchDocResponse };
|
|
24
|
-
export { Patch };
|
|
25
|
-
export { PatchDangerously };
|
|
26
|
-
export { CouchGetAtRev };
|
|
27
|
-
export { Bind };
|
|
28
|
-
export { Lock };
|
|
29
|
-
export { WatchDocs };
|
|
30
|
-
export { LockOptions };
|
|
31
|
-
export { CreateLock };
|
|
32
|
-
export { RemoveLock };
|
|
33
|
-
export { Changes };
|
|
34
|
-
export { ChangesOptions };
|
|
35
|
-
export { ChangesResponse };
|
|
36
|
-
export { GetDBInfo };
|
|
37
|
-
}
|
|
38
|
-
import { getDBInfo } from './impl/util.mjs';
|
|
39
|
-
import { patch } from './impl/patch.mjs';
|
|
40
|
-
import { patchDangerously } from './impl/patch.mjs';
|
|
41
|
-
import { bulkRemove } from './impl/bulk.mjs';
|
|
42
|
-
import { bulkGetDictionary } from './impl/bulk.mjs';
|
|
43
|
-
import { bulkSaveTransaction } from './impl/bulk.mjs';
|
|
44
|
-
/** @type { import('./schema/bind.mjs').BindSchema } */
|
|
45
|
-
export const bindConfig: import("./schema/bind.mjs").BindSchema;
|
|
46
|
-
import { withRetry } from './impl/retry.mjs';
|
|
47
|
-
import { createQuery } from './impl/queryBuilder.mjs';
|
|
48
|
-
import { createLock } from './impl/sugar/lock.mjs';
|
|
49
|
-
import { removeLock } from './impl/sugar/lock.mjs';
|
|
50
|
-
import { z } from 'zod';
|
|
51
|
-
import { BindReturns } from './schema/bind.mjs';
|
|
52
|
-
import { CouchConfig } from './schema/config.mjs';
|
|
53
|
-
import { SimpleViewQuery } from './schema/query.mjs';
|
|
54
|
-
import { SimpleViewQueryResponse } from './schema/query.mjs';
|
|
55
|
-
import { SimpleViewQueryStream } from './schema/stream.mjs';
|
|
56
|
-
import { OnRow } from './schema/stream.mjs';
|
|
57
|
-
import { BulkSave } from './schema/bulk.mjs';
|
|
58
|
-
import { BulkGet } from './schema/bulk.mjs';
|
|
59
|
-
import { BulkRemove } from './schema/bulk.mjs';
|
|
60
|
-
import { BulkGetDictionary } from './schema/bulk.mjs';
|
|
61
|
-
import { BulkSaveTransaction } from './schema/bulk.mjs';
|
|
62
|
-
import { CouchGet } from './schema/crud.mjs';
|
|
63
|
-
import { CouchPut } from './schema/crud.mjs';
|
|
64
|
-
import { CouchDoc } from './schema/crud.mjs';
|
|
65
|
-
import { CouchDocResponse } from './schema/crud.mjs';
|
|
66
|
-
import { Patch } from './schema/patch.mjs';
|
|
67
|
-
import { PatchDangerously } from './schema/patch.mjs';
|
|
68
|
-
import { CouchGetAtRev } from './schema/crud.mjs';
|
|
69
|
-
import { Bind } from './schema/bind.mjs';
|
|
70
|
-
import { Lock } from './schema/sugar/lock.mjs';
|
|
71
|
-
import { WatchDocs } from './schema/sugar/watch.mjs';
|
|
72
|
-
import { LockOptions } from './schema/sugar/lock.mjs';
|
|
73
|
-
import { CreateLock } from './schema/sugar/lock.mjs';
|
|
74
|
-
import { RemoveLock } from './schema/sugar/lock.mjs';
|
|
75
|
-
import { Changes } from './schema/changes.mjs';
|
|
76
|
-
import { ChangesOptions } from './schema/changes.mjs';
|
|
77
|
-
import { ChangesResponse } from './schema/changes.mjs';
|
|
78
|
-
import { GetDBInfo } from './schema/util.mjs';
|
|
79
|
-
export { get, getAtRev, put, bulkGet, bulkSave, query, queryStream, getDBInfo, patch, patchDangerously, bulkRemove, bulkGetDictionary, bulkSaveTransaction, withRetry, createQuery, createLock, removeLock };
|
|
80
|
-
//# sourceMappingURL=index.d.mts.map
|
package/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mjs"],"names":[],"mappings":"iBAmHe,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;oBAhHP,iBAAiB;yBAAjB,iBAAiB;oBAAjB,iBAAiB;wBADkC,iBAAiB;yBAAjB,iBAAiB;sBAMjF,kBAAkB;4BACZ,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAErB,iBAAiB;sBANH,kBAAkB;iCAAlB,kBAAkB;2BAH4B,iBAAiB;kCAAjB,iBAAiB;oCAAjB,iBAAiB;AAwFvG,uDAAuD;AACvD,yBADY,OAAO,mBAAmB,EAAE,UAAU,CAuBhD;0BArGwB,kBAAkB;4BAFhB,yBAAyB;2BAJd,uBAAuB;2BAAvB,uBAAuB;kBAL5C,KAAK;4BAqBW,mBAAmB;4BARzB,qBAAqB;gCACQ,oBAAoB;wCAApB,oBAAoB;sCAEhC,qBAAqB;sBAArB,qBAAqB;yBAJoB,mBAAmB;wBAAnB,mBAAmB;2BAAnB,mBAAmB;kCAAnB,mBAAmB;oCAAnB,mBAAmB;yBAQ3B,mBAAmB;yBAAnB,mBAAmB;yBAAnB,mBAAmB;iCAAnB,mBAAmB;sBAHzD,oBAAoB;iCAApB,oBAAoB;8BAGkB,mBAAmB;qBAC/D,mBAAmB;qBAHK,yBAAyB;0BACzD,0BAA0B;4BADM,yBAAyB;2BAAzB,yBAAyB;2BAAzB,yBAAyB;wBAH1B,sBAAsB;+BAAtB,sBAAsB;gCAAtB,sBAAsB;0BAOrD,mBAAmB"}
|