hide-a-bed 5.2.7 → 6.0.0-beta.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/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +113 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/QueryBuilder.html +42 -0
- package/docs/functions/bindConfig.html +4 -0
- package/docs/functions/bulkGet.html +14 -0
- package/docs/functions/bulkGetDictionary.html +10 -0
- package/docs/functions/bulkRemove.html +12 -0
- package/docs/functions/bulkRemoveMap.html +11 -0
- package/docs/functions/bulkSave.html +10 -0
- package/docs/functions/bulkSaveTransaction.html +23 -0
- package/docs/functions/createLock.html +7 -0
- package/docs/functions/createQuery.html +1 -0
- package/docs/functions/get.html +1 -0
- package/docs/functions/getAtRev.html +1 -0
- package/docs/functions/getDBInfo.html +10 -0
- package/docs/functions/patch.html +8 -0
- package/docs/functions/patchDangerously.html +9 -0
- package/docs/functions/put.html +1 -0
- package/docs/functions/query.html +15 -0
- package/docs/functions/queryStream.html +6 -0
- package/docs/functions/remove.html +1 -0
- package/docs/functions/removeLock.html +6 -0
- package/docs/functions/watchDocs.html +9 -0
- package/docs/functions/withRetry.html +6 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +483 -0
- package/docs/interfaces/NetworkError.html +6 -0
- package/docs/interfaces/NotFoundError.html +10 -0
- package/docs/interfaces/RetryOptions.html +10 -0
- package/docs/interfaces/RetryableError.html +10 -0
- package/docs/interfaces/StandardSchemaV1.FailureResult.html +4 -0
- package/docs/interfaces/StandardSchemaV1.Issue.html +6 -0
- package/docs/interfaces/StandardSchemaV1.Options.html +3 -0
- package/docs/interfaces/StandardSchemaV1.PathSegment.html +4 -0
- package/docs/interfaces/StandardSchemaV1.Props.html +10 -0
- package/docs/interfaces/StandardSchemaV1.SuccessResult.html +6 -0
- package/docs/interfaces/StandardSchemaV1.Types.html +6 -0
- package/docs/interfaces/StandardSchemaV1.html +4 -0
- package/docs/modules/StandardSchemaV1.html +1 -0
- package/docs/modules.html +1 -0
- package/docs/types/BoundInstance.html +1 -0
- package/docs/types/BulkGetBound.html +2 -0
- package/docs/types/BulkGetDictionaryBound.html +1 -0
- package/docs/types/BulkGetDictionaryOptions.html +2 -0
- package/docs/types/BulkGetDictionaryResult.html +3 -0
- package/docs/types/BulkGetOptions.html +3 -0
- package/docs/types/BulkGetResponse.html +1 -0
- package/docs/types/CouchConfig-1.html +1 -0
- package/docs/types/CouchConfig.html +1 -0
- package/docs/types/CouchConfigInput.html +1 -0
- package/docs/types/CouchDoc-1.html +1 -0
- package/docs/types/CouchDoc.html +2 -0
- package/docs/types/CouchDocInput.html +2 -0
- package/docs/types/GetAtRevBound.html +1 -0
- package/docs/types/GetBound.html +1 -0
- package/docs/types/GetOptions.html +2 -0
- package/docs/types/LockDoc-1.html +1 -0
- package/docs/types/LockDoc.html +1 -0
- package/docs/types/LockOptions-1.html +1 -0
- package/docs/types/LockOptions.html +1 -0
- package/docs/types/LockOptionsInput.html +1 -0
- package/docs/types/OnInvalidDocAction.html +1 -0
- package/docs/types/OnRow.html +1 -0
- package/docs/types/QueryBound.html +1 -0
- package/docs/types/SimpleViewOptions-1.html +1 -0
- package/docs/types/SimpleViewOptions.html +1 -0
- package/docs/types/StandardSchemaV1.InferInput.html +2 -0
- package/docs/types/StandardSchemaV1.InferOutput.html +2 -0
- package/docs/types/StandardSchemaV1.Result.html +2 -0
- package/docs/types/ViewQueryResponse-1.html +1 -0
- package/docs/types/ViewQueryResponse.html +2 -0
- package/docs/types/ViewQueryResponseValidated.html +2 -0
- package/docs/types/ViewRow-1.html +1 -0
- package/docs/types/ViewRow.html +2 -0
- package/docs/types/ViewRowValidated.html +7 -0
- package/docs/types/ViewString.html +1 -0
- package/docs/types/WatchOptionsInput.html +1 -0
- package/docs/types/WatchOptionsSchema-1.html +1 -0
- package/docs/types/WatchOptionsSchema.html +1 -0
- package/eslint.config.js +15 -0
- package/impl/bindConfig.mts +140 -0
- package/impl/bulkGet.mts +256 -0
- package/impl/bulkGet.test.mts +159 -0
- package/impl/bulkRemove.mts +98 -0
- package/impl/bulkRemove.test.mts +102 -0
- package/impl/bulkSave.mts +286 -0
- package/impl/bulkSave.test.mts +319 -0
- package/impl/get.mts +137 -0
- package/impl/get.test.mts +114 -0
- package/impl/getDBInfo.mts +67 -0
- package/impl/getDBInfo.test.mts +62 -0
- package/impl/patch.mts +134 -0
- package/impl/patch.test.mts +142 -0
- package/impl/put.mts +56 -0
- package/impl/put.test.mts +114 -0
- package/impl/query.mts +224 -0
- package/impl/query.test.mts +280 -0
- package/impl/remove.mts +65 -0
- package/impl/remove.test.mts +82 -0
- package/impl/retry.mts +66 -0
- package/impl/retry.test.mts +77 -0
- package/impl/stream.mts +143 -0
- package/impl/stream.test.mts +205 -0
- package/impl/sugar/lock.mts +103 -0
- package/impl/sugar/lock.test.mts +113 -0
- package/impl/sugar/{watch.mjs → watch.mts} +56 -22
- package/impl/sugar/watch.test.mts +155 -0
- package/impl/utils/errors.mts +130 -0
- package/impl/utils/errors.test.mts +58 -0
- package/impl/utils/logger.mts +62 -0
- package/impl/utils/logger.test.mts +129 -0
- package/impl/utils/mergeNeedleOpts.mts +16 -0
- package/impl/utils/parseRows.mts +117 -0
- package/impl/utils/parseRows.test.mts +183 -0
- package/impl/utils/queryBuilder.mts +173 -0
- package/impl/utils/queryBuilder.test.mts +83 -0
- package/impl/utils/queryString.mts +44 -0
- package/impl/utils/queryString.test.mts +53 -0
- package/impl/{trackedEmitter.mjs → utils/trackedEmitter.mts} +9 -7
- package/impl/utils/transactionErrors.mts +71 -0
- package/index.mts +82 -0
- package/index.test.mts +415 -0
- package/package.json +45 -31
- 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/log.txt +0 -580
- 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/cjs/index.cjs
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var index_exports = {};
|
|
20
|
-
__export(index_exports, {
|
|
21
|
-
bindConfig: () => bindConfig,
|
|
22
|
-
bulkGet: () => import_bulk.bulkGet,
|
|
23
|
-
bulkGetDictionary: () => import_bulk.bulkGetDictionary,
|
|
24
|
-
bulkRemove: () => import_bulk.bulkRemove,
|
|
25
|
-
bulkSave: () => import_bulk.bulkSave,
|
|
26
|
-
bulkSaveTransaction: () => import_bulk.bulkSaveTransaction,
|
|
27
|
-
createLock: () => import_lock.createLock,
|
|
28
|
-
createQuery: () => import_queryBuilder.createQuery,
|
|
29
|
-
get: () => import_crud.get,
|
|
30
|
-
getAtRev: () => import_crud.getAtRev,
|
|
31
|
-
getDBInfo: () => import_util.getDBInfo,
|
|
32
|
-
patch: () => import_patch.patch,
|
|
33
|
-
patchDangerously: () => import_patch.patchDangerously,
|
|
34
|
-
put: () => import_crud.put,
|
|
35
|
-
query: () => import_query.query,
|
|
36
|
-
queryStream: () => import_stream.queryStream,
|
|
37
|
-
removeLock: () => import_lock.removeLock,
|
|
38
|
-
schema: () => schema,
|
|
39
|
-
withRetry: () => import_retry.withRetry
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(index_exports);
|
|
42
|
-
var import_zod = require("zod");
|
|
43
|
-
var import_bulk = require("./impl/bulk.cjs");
|
|
44
|
-
var import_crud = require("./impl/crud.cjs");
|
|
45
|
-
var import_changes = require("./impl/changes.cjs");
|
|
46
|
-
var import_patch = require("./impl/patch.cjs");
|
|
47
|
-
var import_lock = require("./impl/sugar/lock.cjs");
|
|
48
|
-
var import_watch = require("./impl/sugar/watch.cjs");
|
|
49
|
-
var import_query = require("./impl/query.cjs");
|
|
50
|
-
var import_stream = require("./impl/stream.cjs");
|
|
51
|
-
var import_queryBuilder = require("./impl/queryBuilder.cjs");
|
|
52
|
-
var import_util = require("./impl/util.cjs");
|
|
53
|
-
var import_retry = require("./impl/retry.cjs");
|
|
54
|
-
var import_bulk2 = require("./schema/bulk.cjs");
|
|
55
|
-
var import_config = require("./schema/config.cjs");
|
|
56
|
-
var import_query2 = require("./schema/query.cjs");
|
|
57
|
-
var import_changes2 = require("./schema/changes.cjs");
|
|
58
|
-
var import_stream2 = require("./schema/stream.cjs");
|
|
59
|
-
var import_patch2 = require("./schema/patch.cjs");
|
|
60
|
-
var import_lock2 = require("./schema/sugar/lock.cjs");
|
|
61
|
-
var import_watch2 = require("./schema/sugar/watch.cjs");
|
|
62
|
-
var import_crud2 = require("./schema/crud.cjs");
|
|
63
|
-
var import_bind = require("./schema/bind.cjs");
|
|
64
|
-
var import_util2 = require("./schema/util.cjs");
|
|
65
|
-
const schema = {
|
|
66
|
-
CouchConfig: import_config.CouchConfig,
|
|
67
|
-
SimpleViewQuery: import_query2.SimpleViewQuery,
|
|
68
|
-
SimpleViewQueryResponse: import_query2.SimpleViewQueryResponse,
|
|
69
|
-
SimpleViewQueryStream: import_stream2.SimpleViewQueryStream,
|
|
70
|
-
OnRow: import_stream2.OnRow,
|
|
71
|
-
BulkSave: import_bulk2.BulkSave,
|
|
72
|
-
BulkGet: import_bulk2.BulkGet,
|
|
73
|
-
BulkRemove: import_bulk2.BulkRemove,
|
|
74
|
-
BulkGetDictionary: import_bulk2.BulkGetDictionary,
|
|
75
|
-
BulkSaveTransaction: import_bulk2.BulkSaveTransaction,
|
|
76
|
-
CouchGet: import_crud2.CouchGet,
|
|
77
|
-
CouchPut: import_crud2.CouchPut,
|
|
78
|
-
CouchDoc: import_crud2.CouchDoc,
|
|
79
|
-
CouchDocResponse: import_crud2.CouchDocResponse,
|
|
80
|
-
Patch: import_patch2.Patch,
|
|
81
|
-
PatchDangerously: import_patch2.PatchDangerously,
|
|
82
|
-
CouchGetAtRev: import_crud2.CouchGetAtRev,
|
|
83
|
-
Bind: import_bind.Bind,
|
|
84
|
-
Lock: import_lock2.Lock,
|
|
85
|
-
WatchDocs: import_watch2.WatchDocs,
|
|
86
|
-
LockOptions: import_lock2.LockOptions,
|
|
87
|
-
CreateLock: import_lock2.CreateLock,
|
|
88
|
-
RemoveLock: import_lock2.RemoveLock,
|
|
89
|
-
Changes: import_changes2.Changes,
|
|
90
|
-
ChangesOptions: import_changes2.ChangesOptions,
|
|
91
|
-
ChangesResponse: import_changes2.ChangesResponse,
|
|
92
|
-
GetDBInfo: import_util2.GetDBInfo
|
|
93
|
-
};
|
|
94
|
-
function doBind(config) {
|
|
95
|
-
const retryOptions = {
|
|
96
|
-
maxRetries: config.maxRetries ?? 10,
|
|
97
|
-
initialDelay: config.initialDelay ?? 1e3,
|
|
98
|
-
backoffFactor: config.backoffFactor ?? 2
|
|
99
|
-
};
|
|
100
|
-
const result = {
|
|
101
|
-
get: config.bindWithRetry ? (0, import_retry.withRetry)(import_crud.get.bind(null, config), retryOptions) : import_crud.get.bind(null, config),
|
|
102
|
-
getAtRev: config.bindWithRetry ? (0, import_retry.withRetry)(import_crud.getAtRev.bind(null, config), retryOptions) : import_crud.getAtRev.bind(null, config),
|
|
103
|
-
put: config.bindWithRetry ? (0, import_retry.withRetry)(import_crud.put.bind(null, config), retryOptions) : import_crud.put.bind(null, config),
|
|
104
|
-
bulkGet: config.bindWithRetry ? (0, import_retry.withRetry)(import_bulk.bulkGet.bind(null, config), retryOptions) : import_bulk.bulkGet.bind(null, config),
|
|
105
|
-
bulkSave: config.bindWithRetry ? (0, import_retry.withRetry)(import_bulk.bulkSave.bind(null, config), retryOptions) : import_bulk.bulkSave.bind(null, config),
|
|
106
|
-
query: config.bindWithRetry ? (0, import_retry.withRetry)(import_query.query.bind(null, config), retryOptions) : import_query.query.bind(null, config),
|
|
107
|
-
queryStream: config.bindWithRetry ? (0, import_retry.withRetry)(import_stream.queryStream.bind(null, config), retryOptions) : import_stream.queryStream.bind(null, config),
|
|
108
|
-
// Sugar Methods
|
|
109
|
-
patch: config.bindWithRetry ? (0, import_retry.withRetry)(import_patch.patch.bind(null, config), retryOptions) : import_patch.patch.bind(null, config),
|
|
110
|
-
patchDangerously: import_patch.patchDangerously.bind(null, config),
|
|
111
|
-
// patchDangerously not included in retry
|
|
112
|
-
bulkRemove: config.bindWithRetry ? (0, import_retry.withRetry)(import_bulk.bulkRemove.bind(null, config), retryOptions) : import_bulk.bulkRemove.bind(null, config),
|
|
113
|
-
bulkGetDictionary: config.bindWithRetry ? (0, import_retry.withRetry)(import_bulk.bulkGetDictionary.bind(null, config), retryOptions) : import_bulk.bulkGetDictionary.bind(null, config),
|
|
114
|
-
bulkSaveTransaction: import_bulk.bulkSaveTransaction.bind(null, config),
|
|
115
|
-
createLock: import_lock.createLock.bind(null, config),
|
|
116
|
-
removeLock: import_lock.removeLock.bind(null, config),
|
|
117
|
-
watchDocs: import_watch.watchDocs.bind(null, config),
|
|
118
|
-
changes: import_changes.changes.bind(null, config),
|
|
119
|
-
getDBInfo: config.bindWithRetry ? (0, import_retry.withRetry)(import_util.getDBInfo.bind(null, config), retryOptions) : import_util.getDBInfo.bind(null, config)
|
|
120
|
-
};
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
const bindConfig = import_bind.Bind.implement((config) => {
|
|
124
|
-
const parsedConfig = import_config.CouchConfig.parse(config);
|
|
125
|
-
const funcs = doBind(parsedConfig);
|
|
126
|
-
const reconfig = (_overrides) => {
|
|
127
|
-
const newConfig = { ...config, ..._overrides };
|
|
128
|
-
return bindConfig(newConfig);
|
|
129
|
-
};
|
|
130
|
-
const all = { ...funcs, options: reconfig };
|
|
131
|
-
return all;
|
|
132
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var import_trackedEmitter = require("../impl/trackedEmitter.cjs");
|
|
25
|
-
var import_tap = __toESM(require("tap"), 1);
|
|
26
|
-
var import_child_process = require("child_process");
|
|
27
|
-
var import__ = require("../index.cjs");
|
|
28
|
-
var import_needle = __toESM(require("needle"), 1);
|
|
29
|
-
let DB_URL = `https://admin:iEZCEQhVR9PVCmYuZ5Bv@redman-couchdb.staging.brivity.io/testdb`;
|
|
30
|
-
const config = {
|
|
31
|
-
couch: DB_URL,
|
|
32
|
-
bindWithRetry: true,
|
|
33
|
-
logger: (level, ...args) => {
|
|
34
|
-
console.log(`[${level.toUpperCase()}]`, ...args);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import_tap.default.test("changes tests", async (t) => {
|
|
38
|
-
await (0, import_needle.default)("put", DB_URL);
|
|
39
|
-
t.teardown(async () => {
|
|
40
|
-
await (0, import_needle.default)("delete", DB_URL);
|
|
41
|
-
});
|
|
42
|
-
const db = (0, import__.bindConfig)(config);
|
|
43
|
-
t.test("basic changes feed", (t2) => new Promise(async (resolve) => {
|
|
44
|
-
const onChange = (change) => {
|
|
45
|
-
t2.equal(change.id, "test-changes-doc", "change notification received");
|
|
46
|
-
changesEmitter.stop();
|
|
47
|
-
t2.end();
|
|
48
|
-
resolve();
|
|
49
|
-
};
|
|
50
|
-
const changesEmitter = await db.changes(onChange, { since: "now", feed: "continuous" });
|
|
51
|
-
t2.ok(changesEmitter.on, "changes emitter has on method");
|
|
52
|
-
t2.ok(changesEmitter.removeListener, "changes emitter has removeListener method");
|
|
53
|
-
t2.ok(changesEmitter.stop, "changes emitter has stop method");
|
|
54
|
-
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
55
|
-
await db.put({ _id: "test-changes-doc", data: "test" });
|
|
56
|
-
}));
|
|
57
|
-
t.test("document id", (t2) => new Promise(async (resolve) => {
|
|
58
|
-
const opts = {
|
|
59
|
-
since: "now",
|
|
60
|
-
include_docs: true,
|
|
61
|
-
feed: "continuous"
|
|
62
|
-
};
|
|
63
|
-
const onChange = (change) => {
|
|
64
|
-
console.log("got a change", change);
|
|
65
|
-
if (change.id === "test-a") {
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
resolve();
|
|
68
|
-
}, 1e3);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const changesEmitter = await db.changes(onChange, opts);
|
|
72
|
-
await new Promise((resolve2) => setTimeout(resolve2, 4e3));
|
|
73
|
-
await db.put({ _id: "test-changes-doc-2", data: "test" });
|
|
74
|
-
await db.put({ _id: "test-a", data: "test" });
|
|
75
|
-
}));
|
|
76
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var import_watch = require("../impl/sugar/watch.cjs");
|
|
25
|
-
var import__ = require("../index.cjs");
|
|
26
|
-
var import_needle = __toESM(require("needle"), 1);
|
|
27
|
-
let DB_URL = `https://admin:iEZCEQhVR9PVCmYuZ5Bv@redman-couchdb.staging.brivity.io/testdb`;
|
|
28
|
-
const config = {
|
|
29
|
-
couch: DB_URL,
|
|
30
|
-
bindWithRetry: true,
|
|
31
|
-
logger: (level, ...args) => {
|
|
32
|
-
console.log(`[${level.toUpperCase()}]`, ...args);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const run = async () => {
|
|
36
|
-
await (0, import_needle.default)("put", DB_URL);
|
|
37
|
-
const db = (0, import__.bindConfig)(config);
|
|
38
|
-
const onChange = (change) => {
|
|
39
|
-
console.log(change);
|
|
40
|
-
};
|
|
41
|
-
const feed = (0, import_watch.watchDocs)(config, "doc-a-1", onChange, { include_docs: true });
|
|
42
|
-
feed.on("end", ({ lastSeq }) => {
|
|
43
|
-
console.log("ending");
|
|
44
|
-
console.log("lastSeq", lastSeq);
|
|
45
|
-
});
|
|
46
|
-
setTimeout(() => {
|
|
47
|
-
console.log("stopping...");
|
|
48
|
-
feed.stop();
|
|
49
|
-
console.log("stopped");
|
|
50
|
-
}, 19e4);
|
|
51
|
-
};
|
|
52
|
-
run();
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var import_watch = require("../impl/sugar/watch.cjs");
|
|
25
|
-
var import_tap = __toESM(require("tap"), 1);
|
|
26
|
-
var import__ = require("../index.cjs");
|
|
27
|
-
var import_needle = __toESM(require("needle"), 1);
|
|
28
|
-
let DB_URL = `https://admin:iEZCEQhVR9PVCmYuZ5Bv@redman-couchdb.staging.brivity.io/testdb`;
|
|
29
|
-
const config = {
|
|
30
|
-
couch: DB_URL,
|
|
31
|
-
bindWithRetry: true,
|
|
32
|
-
logger: (level, ...args) => {
|
|
33
|
-
console.log(`[${level.toUpperCase()}]`, ...args);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
import_tap.default.test("changes tests", async (t) => {
|
|
37
|
-
await (0, import_needle.default)("put", DB_URL);
|
|
38
|
-
t.teardown(async () => {
|
|
39
|
-
await (0, import_needle.default)("delete", DB_URL);
|
|
40
|
-
});
|
|
41
|
-
const db = (0, import__.bindConfig)(config);
|
|
42
|
-
t.test("watch a doc", (t2) => new Promise(async (resolve) => {
|
|
43
|
-
let feed = null;
|
|
44
|
-
const onChange = (change) => {
|
|
45
|
-
t2.equal(change.id, "doc-a-1");
|
|
46
|
-
t2.equal(change.doc._id, "doc-a-1");
|
|
47
|
-
t2.equal(change.doc.data, "test");
|
|
48
|
-
feed.stop();
|
|
49
|
-
resolve();
|
|
50
|
-
};
|
|
51
|
-
feed = db.watchDocs("doc-a-1", onChange, { include_docs: true });
|
|
52
|
-
feed.on("end", ({ lastSeq }) => {
|
|
53
|
-
console.log("ending");
|
|
54
|
-
console.log("lastSeq", lastSeq);
|
|
55
|
-
});
|
|
56
|
-
await db.put({ _id: "doc-a-fake-out", data: "test" });
|
|
57
|
-
await db.put({ _id: "doc-a-1", data: "test" });
|
|
58
|
-
}));
|
|
59
|
-
});
|
package/cjs/schema/bind.cjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var bind_exports = {};
|
|
20
|
-
__export(bind_exports, {
|
|
21
|
-
Bind: () => Bind,
|
|
22
|
-
BindBase: () => BindBase,
|
|
23
|
-
BindReturns: () => BindReturns
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(bind_exports);
|
|
26
|
-
var import_zod = require("zod");
|
|
27
|
-
var import_config = require("./config.cjs");
|
|
28
|
-
var import_bulk = require("./bulk.cjs");
|
|
29
|
-
var import_crud = require("./crud.cjs");
|
|
30
|
-
var import_patch = require("./patch.cjs");
|
|
31
|
-
var import_query = require("./query.cjs");
|
|
32
|
-
var import_stream = require("./stream.cjs");
|
|
33
|
-
var import_lock = require("./sugar/lock.cjs");
|
|
34
|
-
var import_changes = require("./changes.cjs");
|
|
35
|
-
var import_watch = require("./sugar/watch.cjs");
|
|
36
|
-
var import_util = require("./util.cjs");
|
|
37
|
-
const BindBase = import_zod.z.object({
|
|
38
|
-
bulkGet: import_bulk.BulkGetBound,
|
|
39
|
-
bulkSave: import_bulk.BulkSaveBound,
|
|
40
|
-
bulkRemove: import_bulk.BulkRemoveBound,
|
|
41
|
-
bulkGetDictionary: import_bulk.BulkGetDictionaryBound,
|
|
42
|
-
bulkSaveTransaction: import_bulk.BulkSaveTransactionBound,
|
|
43
|
-
get: import_crud.CouchGetBound,
|
|
44
|
-
getAtRev: import_crud.CouchGetAtRevBound,
|
|
45
|
-
put: import_crud.CouchPutBound,
|
|
46
|
-
patch: import_patch.PatchBound,
|
|
47
|
-
query: import_query.SimpleViewQueryBound,
|
|
48
|
-
queryStream: import_stream.SimpleViewQueryStreamBound,
|
|
49
|
-
createLock: import_lock.CreateLockBound,
|
|
50
|
-
removeLock: import_lock.RemoveLockBound,
|
|
51
|
-
changes: import_changes.ChangesBound,
|
|
52
|
-
watchDocs: import_watch.WatchDocsBound,
|
|
53
|
-
getDBInfo: import_util.GetDBInfoBound
|
|
54
|
-
});
|
|
55
|
-
const RebindOptions = import_config.CouchConfig.omit({ couch: true });
|
|
56
|
-
const BindReturns = BindBase.extend({
|
|
57
|
-
options: import_zod.z.function().args(RebindOptions).returns(BindBase)
|
|
58
|
-
});
|
|
59
|
-
const Bind = import_zod.z.function().args(import_config.CouchConfig).returns(BindReturns);
|
package/cjs/schema/bulk.cjs
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var bulk_exports = {};
|
|
20
|
-
__export(bulk_exports, {
|
|
21
|
-
BulkGet: () => BulkGet,
|
|
22
|
-
BulkGetBound: () => BulkGetBound,
|
|
23
|
-
BulkGetDictionary: () => BulkGetDictionary,
|
|
24
|
-
BulkGetDictionaryBound: () => BulkGetDictionaryBound,
|
|
25
|
-
BulkGetDictionaryResponse: () => BulkGetDictionaryResponse,
|
|
26
|
-
BulkRemove: () => BulkRemove,
|
|
27
|
-
BulkRemoveBound: () => BulkRemoveBound,
|
|
28
|
-
BulkSave: () => BulkSave,
|
|
29
|
-
BulkSaveBound: () => BulkSaveBound,
|
|
30
|
-
BulkSaveResponseSchema: () => BulkSaveResponseSchema,
|
|
31
|
-
BulkSaveRow: () => BulkSaveRow,
|
|
32
|
-
BulkSaveTransaction: () => BulkSaveTransaction,
|
|
33
|
-
BulkSaveTransactionBound: () => BulkSaveTransactionBound,
|
|
34
|
-
OptionalIdCouchDoc: () => OptionalIdCouchDoc
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(bulk_exports);
|
|
37
|
-
var import_zod = require("zod");
|
|
38
|
-
var import_config = require("./config.cjs");
|
|
39
|
-
var import_query = require("./query.cjs");
|
|
40
|
-
var import_crud = require("./crud.cjs");
|
|
41
|
-
const BulkSaveRow = import_zod.z.object({
|
|
42
|
-
ok: import_zod.z.boolean().nullish(),
|
|
43
|
-
id: import_zod.z.string().nullish(),
|
|
44
|
-
rev: import_zod.z.string().nullish(),
|
|
45
|
-
error: import_zod.z.string().nullish().describe("if an error occured, one word reason, eg conflict"),
|
|
46
|
-
reason: import_zod.z.string().nullish().describe("a full error message")
|
|
47
|
-
});
|
|
48
|
-
const BulkSaveResponseSchema = import_zod.z.array(BulkSaveRow);
|
|
49
|
-
const OptionalIdCouchDoc = import_crud.CouchDoc.extend({
|
|
50
|
-
_id: import_crud.CouchDoc.shape._id.optional()
|
|
51
|
-
});
|
|
52
|
-
const BulkSave = import_zod.z.function().args(
|
|
53
|
-
import_config.CouchConfig,
|
|
54
|
-
import_zod.z.array(OptionalIdCouchDoc)
|
|
55
|
-
).returns(import_zod.z.promise(BulkSaveResponseSchema));
|
|
56
|
-
const BulkSaveBound = import_zod.z.function().args(
|
|
57
|
-
import_zod.z.array(OptionalIdCouchDoc)
|
|
58
|
-
).returns(import_zod.z.promise(BulkSaveResponseSchema));
|
|
59
|
-
const BulkGet = import_zod.z.function().args(
|
|
60
|
-
import_config.CouchConfig,
|
|
61
|
-
import_zod.z.array(import_zod.z.string().describe("the ids to get"))
|
|
62
|
-
).returns(import_zod.z.promise(import_query.SimpleViewQueryResponse));
|
|
63
|
-
const BulkGetBound = import_zod.z.function().args(
|
|
64
|
-
import_zod.z.array(import_zod.z.string().describe("the ids to get"))
|
|
65
|
-
).returns(import_zod.z.promise(import_query.SimpleViewQueryResponse));
|
|
66
|
-
const BulkRemove = import_zod.z.function().args(
|
|
67
|
-
import_config.CouchConfig,
|
|
68
|
-
import_zod.z.array(import_zod.z.string().describe("the ids to delete"))
|
|
69
|
-
).returns(import_zod.z.promise(BulkSaveResponseSchema));
|
|
70
|
-
const BulkRemoveBound = import_zod.z.function().args(
|
|
71
|
-
import_zod.z.array(import_zod.z.string().describe("the ids to delete"))
|
|
72
|
-
).returns(import_zod.z.promise(BulkSaveResponseSchema));
|
|
73
|
-
const BulkGetDictionaryResponse = import_zod.z.object({
|
|
74
|
-
found: import_zod.z.record(import_zod.z.string(), import_crud.CouchDoc),
|
|
75
|
-
notFound: import_zod.z.record(import_zod.z.string(), import_query.ViewRow)
|
|
76
|
-
});
|
|
77
|
-
const BulkGetDictionary = import_zod.z.function().args(
|
|
78
|
-
import_config.CouchConfig,
|
|
79
|
-
import_zod.z.array(import_zod.z.string().describe("the ids to get"))
|
|
80
|
-
).returns(import_zod.z.promise(BulkGetDictionaryResponse));
|
|
81
|
-
const BulkGetDictionaryBound = import_zod.z.function().args(
|
|
82
|
-
import_zod.z.array(import_zod.z.string().describe("the ids to get"))
|
|
83
|
-
).returns(import_zod.z.promise(BulkGetDictionaryResponse));
|
|
84
|
-
const BulkSaveTransaction = import_zod.z.function().args(
|
|
85
|
-
import_config.CouchConfig,
|
|
86
|
-
import_zod.z.string().describe("transaction id"),
|
|
87
|
-
import_zod.z.array(import_crud.CouchDoc)
|
|
88
|
-
).returns(import_zod.z.promise(BulkSaveResponseSchema));
|
|
89
|
-
const BulkSaveTransactionBound = import_zod.z.function().args(
|
|
90
|
-
import_zod.z.string().describe("transaction id"),
|
|
91
|
-
import_zod.z.array(import_crud.CouchDoc)
|
|
92
|
-
).returns(import_zod.z.promise(BulkSaveResponseSchema));
|
package/cjs/schema/changes.cjs
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var changes_exports = {};
|
|
20
|
-
__export(changes_exports, {
|
|
21
|
-
Changes: () => Changes,
|
|
22
|
-
ChangesBound: () => ChangesBound,
|
|
23
|
-
ChangesEmitter: () => ChangesEmitter,
|
|
24
|
-
ChangesOptions: () => ChangesOptions,
|
|
25
|
-
ChangesResponse: () => ChangesResponse
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(changes_exports);
|
|
28
|
-
var import_zod = require("zod");
|
|
29
|
-
var import_config = require("./config.cjs");
|
|
30
|
-
var import_crud = require("./crud.cjs");
|
|
31
|
-
const ChangesOptions = import_zod.z.object({
|
|
32
|
-
feed: import_zod.z.enum(["continuous", "longpoll"]).default("continuous"),
|
|
33
|
-
filter: import_zod.z.any(),
|
|
34
|
-
// z.union([z.string(), z.array()]).optional(),
|
|
35
|
-
inactivity_ms: import_zod.z.number().default(60 * 60 * 1e3),
|
|
36
|
-
/** @type {number} */
|
|
37
|
-
timeout: import_zod.z.number().optional(),
|
|
38
|
-
requestTimeout: import_zod.z.number().default(2 * 60 * 1e3),
|
|
39
|
-
since: import_zod.z.union([import_zod.z.number(), import_zod.z.literal("now")]).default(0),
|
|
40
|
-
heartbeat: import_zod.z.number().default(30 * 1e3),
|
|
41
|
-
style: import_zod.z.enum(["main_only", "all_docs"]).default("main_only"),
|
|
42
|
-
include_docs: import_zod.z.boolean().default(false),
|
|
43
|
-
query_params: import_zod.z.record(import_zod.z.any()).default({}),
|
|
44
|
-
use_post: import_zod.z.boolean().default(false)
|
|
45
|
-
}).partial();
|
|
46
|
-
const ChangesResponse = import_zod.z.object({
|
|
47
|
-
id: import_zod.z.string(),
|
|
48
|
-
seq: import_zod.z.number(),
|
|
49
|
-
changes: import_zod.z.array(import_zod.z.object({
|
|
50
|
-
rev: import_zod.z.string()
|
|
51
|
-
})),
|
|
52
|
-
doc: import_crud.CouchDoc.nullish().optional(),
|
|
53
|
-
deleted: import_zod.z.boolean().optional()
|
|
54
|
-
});
|
|
55
|
-
const ChangesEmitter = import_zod.z.object({
|
|
56
|
-
on: import_zod.z.function().args(import_zod.z.string(), import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void())).returns(import_zod.z.any()),
|
|
57
|
-
removeListener: import_zod.z.function().args(import_zod.z.string(), import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void())).returns(import_zod.z.any()),
|
|
58
|
-
stop: import_zod.z.function().returns(import_zod.z.void())
|
|
59
|
-
});
|
|
60
|
-
const Changes = import_zod.z.function().args(
|
|
61
|
-
import_config.CouchConfig,
|
|
62
|
-
import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void()),
|
|
63
|
-
ChangesOptions
|
|
64
|
-
).returns(import_zod.z.promise(ChangesEmitter));
|
|
65
|
-
const ChangesBound = import_zod.z.function().args(
|
|
66
|
-
import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void()),
|
|
67
|
-
ChangesOptions
|
|
68
|
-
).returns(import_zod.z.promise(ChangesEmitter));
|
package/cjs/schema/config.cjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var config_exports = {};
|
|
20
|
-
__export(config_exports, {
|
|
21
|
-
CouchConfig: () => CouchConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(config_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const LoggerSchema = import_zod.z.object({
|
|
26
|
-
error: import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void()).optional(),
|
|
27
|
-
warn: import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void()).optional(),
|
|
28
|
-
info: import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void()).optional(),
|
|
29
|
-
debug: import_zod.z.function().args(import_zod.z.any()).returns(import_zod.z.void()).optional()
|
|
30
|
-
}).or(import_zod.z.function().args(
|
|
31
|
-
import_zod.z.string(),
|
|
32
|
-
// level
|
|
33
|
-
import_zod.z.any()
|
|
34
|
-
// message/args
|
|
35
|
-
).returns(import_zod.z.void()));
|
|
36
|
-
const CouchConfig = import_zod.z.object({
|
|
37
|
-
throwOnGetNotFound: import_zod.z.boolean().optional().default(false).describe("if a get is 404 should we throw or return undefined"),
|
|
38
|
-
couch: import_zod.z.string().describe("the url of the couch db"),
|
|
39
|
-
bindWithRetry: import_zod.z.boolean().optional().default(true).describe("should we bind with retry"),
|
|
40
|
-
maxRetries: import_zod.z.number().optional().default(3).describe("maximum number of retry attempts"),
|
|
41
|
-
initialDelay: import_zod.z.number().optional().default(1e3).describe("initial retry delay in milliseconds"),
|
|
42
|
-
backoffFactor: import_zod.z.number().optional().default(2).describe("multiplier for exponential backoff"),
|
|
43
|
-
useConsoleLogger: import_zod.z.boolean().optional().default(false).describe("turn on console as a fallback logger"),
|
|
44
|
-
logger: LoggerSchema.optional().describe("logging interface supporting winston-like or simple function interface"),
|
|
45
|
-
// _emitter: z.any().optional().describe('emitter for events'),
|
|
46
|
-
_normalizedLogger: import_zod.z.any().optional()
|
|
47
|
-
// Internal property for caching normalized logger
|
|
48
|
-
}).passthrough().describe("The std config object");
|
package/cjs/schema/crud.cjs
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var crud_exports = {};
|
|
20
|
-
__export(crud_exports, {
|
|
21
|
-
CouchDoc: () => CouchDoc,
|
|
22
|
-
CouchDocResponse: () => CouchDocResponse,
|
|
23
|
-
CouchGet: () => CouchGet,
|
|
24
|
-
CouchGetAtRev: () => CouchGetAtRev,
|
|
25
|
-
CouchGetAtRevBound: () => CouchGetAtRevBound,
|
|
26
|
-
CouchGetBound: () => CouchGetBound,
|
|
27
|
-
CouchGetOptions: () => CouchGetOptions,
|
|
28
|
-
CouchGetWithOptions: () => CouchGetWithOptions,
|
|
29
|
-
CouchPut: () => CouchPut,
|
|
30
|
-
CouchPutBound: () => CouchPutBound
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(crud_exports);
|
|
33
|
-
var import_zod = require("zod");
|
|
34
|
-
var import_config = require("./config.cjs");
|
|
35
|
-
const CouchDoc = import_zod.z.object({
|
|
36
|
-
_id: import_zod.z.string().describe("the couch doc id"),
|
|
37
|
-
_rev: import_zod.z.string().optional().nullish().describe("the doc revision"),
|
|
38
|
-
_deleted: import_zod.z.boolean().optional().describe("is the doc deleted")
|
|
39
|
-
}).passthrough();
|
|
40
|
-
const CouchDocResponse = import_zod.z.object({
|
|
41
|
-
ok: import_zod.z.boolean().optional().describe("did the request succeed"),
|
|
42
|
-
error: import_zod.z.string().optional().describe("the error message, if did not succed"),
|
|
43
|
-
statusCode: import_zod.z.number(),
|
|
44
|
-
id: import_zod.z.string().optional().describe("the couch doc id"),
|
|
45
|
-
rev: import_zod.z.string().optional().describe("the new rev of the doc")
|
|
46
|
-
});
|
|
47
|
-
const CouchPut = import_zod.z.function().args(
|
|
48
|
-
import_config.CouchConfig,
|
|
49
|
-
CouchDoc
|
|
50
|
-
).returns(import_zod.z.promise(CouchDocResponse));
|
|
51
|
-
const CouchPutBound = import_zod.z.function().args(
|
|
52
|
-
CouchDoc
|
|
53
|
-
).returns(import_zod.z.promise(CouchDocResponse));
|
|
54
|
-
const CouchGet = import_zod.z.function().args(
|
|
55
|
-
import_config.CouchConfig,
|
|
56
|
-
import_zod.z.string().describe("the couch doc id")
|
|
57
|
-
).returns(import_zod.z.promise(CouchDoc.nullable()));
|
|
58
|
-
const CouchGetBound = import_zod.z.function().args(
|
|
59
|
-
import_zod.z.string().describe("the couch doc id")
|
|
60
|
-
).returns(import_zod.z.promise(CouchDoc.nullable()));
|
|
61
|
-
const CouchGetAtRev = import_zod.z.function().args(
|
|
62
|
-
import_config.CouchConfig,
|
|
63
|
-
import_zod.z.string().describe("the couch doc id"),
|
|
64
|
-
import_zod.z.string().describe("the rev")
|
|
65
|
-
).returns(import_zod.z.promise(CouchDoc.nullable()));
|
|
66
|
-
const CouchGetAtRevBound = import_zod.z.function().args(
|
|
67
|
-
import_zod.z.string().describe("the couch doc id"),
|
|
68
|
-
import_zod.z.string().describe("the rev")
|
|
69
|
-
).returns(import_zod.z.promise(CouchDoc.nullable()));
|
|
70
|
-
const CouchGetOptions = import_zod.z.object({
|
|
71
|
-
rev: import_zod.z.string().optional().describe("the couch doc revision")
|
|
72
|
-
});
|
|
73
|
-
const CouchGetWithOptions = import_zod.z.function().args(
|
|
74
|
-
import_config.CouchConfig,
|
|
75
|
-
import_zod.z.string().describe("the couch doc id"),
|
|
76
|
-
CouchGetOptions
|
|
77
|
-
).returns(import_zod.z.promise(CouchDoc.nullable()));
|