hide-a-bed 6.0.0 → 7.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/README.md +89 -28
- package/dist/cjs/index.cjs +888 -443
- package/dist/esm/index.mjs +883 -443
- package/eslint.config.js +6 -1
- package/impl/bindConfig.mts +30 -3
- package/impl/bulkGet.mts +50 -27
- package/impl/bulkRemove.mts +4 -2
- package/impl/bulkSave.mts +50 -28
- package/impl/get.mts +49 -40
- package/impl/getDBInfo.mts +26 -24
- package/impl/patch.mts +46 -42
- package/impl/put.mts +39 -21
- package/impl/query.mts +101 -81
- package/impl/remove.mts +33 -33
- package/impl/stream.mts +163 -102
- package/impl/sugar/watch.mts +165 -97
- package/impl/utils/errors.mts +261 -35
- package/impl/utils/fetch.mts +201 -0
- package/impl/utils/parseRows.mts +47 -6
- package/impl/utils/request.mts +22 -0
- package/impl/utils/response.mts +50 -0
- package/impl/utils/transactionErrors.mts +14 -8
- package/impl/utils/url.mts +21 -0
- package/index.mts +19 -2
- package/migration_guides/v7.md +353 -0
- package/package.json +4 -4
- package/schema/config.mts +17 -34
- package/schema/request.mts +36 -0
- package/schema/sugar/watch.mts +1 -1
- package/tsconfig.json +9 -1
- package/types/output/impl/bindConfig.d.mts +31 -149
- package/types/output/impl/bindConfig.d.mts.map +1 -1
- package/types/output/impl/bindConfig.test.d.mts +2 -0
- package/types/output/impl/bindConfig.test.d.mts.map +1 -0
- package/types/output/impl/bulkGet.d.mts +5 -5
- package/types/output/impl/bulkGet.d.mts.map +1 -1
- package/types/output/impl/bulkRemove.d.mts +4 -2
- package/types/output/impl/bulkRemove.d.mts.map +1 -1
- package/types/output/impl/bulkSave.d.mts +2 -2
- package/types/output/impl/bulkSave.d.mts.map +1 -1
- package/types/output/impl/get.d.mts +2 -2
- package/types/output/impl/get.d.mts.map +1 -1
- package/types/output/impl/getDBInfo.d.mts +1 -1
- package/types/output/impl/getDBInfo.d.mts.map +1 -1
- package/types/output/impl/patch.d.mts +8 -3
- package/types/output/impl/patch.d.mts.map +1 -1
- package/types/output/impl/put.d.mts.map +1 -1
- package/types/output/impl/query.d.mts +8 -23
- package/types/output/impl/query.d.mts.map +1 -1
- package/types/output/impl/remove.d.mts.map +1 -1
- package/types/output/impl/request-controls.test.d.mts +2 -0
- package/types/output/impl/request-controls.test.d.mts.map +1 -0
- package/types/output/impl/stream.d.mts +1 -1
- package/types/output/impl/stream.d.mts.map +1 -1
- package/types/output/impl/sugar/watch.d.mts +7 -5
- package/types/output/impl/sugar/watch.d.mts.map +1 -1
- package/types/output/impl/utils/errors.d.mts +84 -26
- package/types/output/impl/utils/errors.d.mts.map +1 -1
- package/types/output/impl/utils/fetch.d.mts +27 -0
- package/types/output/impl/utils/fetch.d.mts.map +1 -0
- package/types/output/impl/utils/fetch.test.d.mts +2 -0
- package/types/output/impl/utils/fetch.test.d.mts.map +1 -0
- package/types/output/impl/utils/parseRows.d.mts +3 -0
- package/types/output/impl/utils/parseRows.d.mts.map +1 -1
- package/types/output/impl/utils/request.d.mts +6 -0
- package/types/output/impl/utils/request.d.mts.map +1 -0
- package/types/output/impl/utils/response.d.mts +7 -0
- package/types/output/impl/utils/response.d.mts.map +1 -0
- package/types/output/impl/utils/response.test.d.mts +2 -0
- package/types/output/impl/utils/response.test.d.mts.map +1 -0
- package/types/output/impl/utils/trackedEmitter.test.d.mts +2 -0
- package/types/output/impl/utils/trackedEmitter.test.d.mts.map +1 -0
- package/types/output/impl/utils/transactionErrors.d.mts +5 -4
- package/types/output/impl/utils/transactionErrors.d.mts.map +1 -1
- package/types/output/impl/utils/transactionErrors.test.d.mts +2 -0
- package/types/output/impl/utils/transactionErrors.test.d.mts.map +1 -0
- package/types/output/impl/utils/url.d.mts +4 -0
- package/types/output/impl/utils/url.d.mts.map +1 -0
- package/types/output/impl/utils/url.test.d.mts +2 -0
- package/types/output/impl/utils/url.test.d.mts.map +1 -0
- package/types/output/index.d.mts +5 -2
- package/types/output/index.d.mts.map +1 -1
- package/types/output/schema/config.d.mts +13 -69
- package/types/output/schema/config.d.mts.map +1 -1
- package/types/output/schema/config.test.d.mts +2 -0
- package/types/output/schema/config.test.d.mts.map +1 -0
- package/types/output/schema/request.d.mts +10 -0
- package/types/output/schema/request.d.mts.map +1 -0
- package/types/output/schema/sugar/lock.test.d.mts +2 -0
- package/types/output/schema/sugar/lock.test.d.mts.map +1 -0
- package/types/output/schema/sugar/watch.d.mts +1 -1
- package/types/output/schema/sugar/watch.d.mts.map +1 -1
- package/types/output/schema/sugar/watch.test.d.mts +2 -0
- package/types/output/schema/sugar/watch.test.d.mts.map +1 -0
- package/impl/utils/mergeNeedleOpts.mts +0 -16
- package/schema/util.mts +0 -8
- package/types/output/impl/utils/mergeNeedleOpts.d.mts +0 -53
- package/types/output/impl/utils/mergeNeedleOpts.d.mts.map +0 -1
- package/types/output/schema/util.d.mts +0 -85
- package/types/output/schema/util.d.mts.map +0 -1
package/tsconfig.json
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
"exclude": ["node_modules", "dist", "types/output", "docs"],
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"module": "nodenext",
|
|
5
|
-
"target": "
|
|
5
|
+
"target": "es2024",
|
|
6
|
+
"lib": [
|
|
7
|
+
"es2024",
|
|
8
|
+
"ESNext.Array",
|
|
9
|
+
"ESNext.Collection",
|
|
10
|
+
"ESNext.Error",
|
|
11
|
+
"ESNext.Iterator",
|
|
12
|
+
"ESNext.Promise"
|
|
13
|
+
],
|
|
6
14
|
"erasableSyntaxOnly": true,
|
|
7
15
|
"rewriteRelativeImportExtensions": true,
|
|
8
16
|
"allowImportingTsExtensions": true,
|
|
@@ -2,8 +2,38 @@ import type z from 'zod';
|
|
|
2
2
|
import { CouchConfig, type CouchConfigInput } from '../schema/config.mts';
|
|
3
3
|
import { type BulkGetBound, type BulkGetDictionaryBound } from './bulkGet.mts';
|
|
4
4
|
import { type GetBound, type GetAtRevBound } from './get.mts';
|
|
5
|
+
import { queryStream } from './stream.mts';
|
|
6
|
+
import { patch, patchDangerously } from './patch.mts';
|
|
7
|
+
import { put } from './put.mts';
|
|
5
8
|
import type { QueryBound } from './query.mts';
|
|
6
|
-
|
|
9
|
+
import { bulkRemove, bulkRemoveMap } from './bulkRemove.mts';
|
|
10
|
+
import { bulkSave, bulkSaveTransaction } from './bulkSave.mts';
|
|
11
|
+
import { getDBInfo } from './getDBInfo.mts';
|
|
12
|
+
import { remove } from './remove.mts';
|
|
13
|
+
import { createLock, removeLock } from './sugar/lock.mts';
|
|
14
|
+
import { watchDocs } from './sugar/watch.mts';
|
|
15
|
+
type BoundConfigMethod<T> = T extends (...args: infer Args) => infer Result ? Args extends [unknown, ...infer Rest] ? (...args: Rest) => Result : never : never;
|
|
16
|
+
type BoundMethods = {
|
|
17
|
+
bulkGet: BulkGetBound;
|
|
18
|
+
bulkGetDictionary: BulkGetDictionaryBound;
|
|
19
|
+
get: GetBound;
|
|
20
|
+
getAtRev: GetAtRevBound;
|
|
21
|
+
query: QueryBound;
|
|
22
|
+
bulkRemove: BoundConfigMethod<typeof bulkRemove>;
|
|
23
|
+
bulkRemoveMap: BoundConfigMethod<typeof bulkRemoveMap>;
|
|
24
|
+
bulkSave: BoundConfigMethod<typeof bulkSave>;
|
|
25
|
+
bulkSaveTransaction: BoundConfigMethod<typeof bulkSaveTransaction>;
|
|
26
|
+
getDBInfo: BoundConfigMethod<typeof getDBInfo>;
|
|
27
|
+
patch: BoundConfigMethod<typeof patch>;
|
|
28
|
+
patchDangerously: BoundConfigMethod<typeof patchDangerously>;
|
|
29
|
+
put: BoundConfigMethod<typeof put>;
|
|
30
|
+
queryStream: BoundConfigMethod<typeof queryStream>;
|
|
31
|
+
remove: BoundConfigMethod<typeof remove>;
|
|
32
|
+
createLock: BoundConfigMethod<typeof createLock>;
|
|
33
|
+
removeLock: BoundConfigMethod<typeof removeLock>;
|
|
34
|
+
watchDocs: BoundConfigMethod<typeof watchDocs>;
|
|
35
|
+
};
|
|
36
|
+
export type BoundInstance = BoundMethods & {
|
|
7
37
|
options(overrides: Partial<z.input<typeof CouchConfig>>): BoundInstance;
|
|
8
38
|
};
|
|
9
39
|
/**
|
|
@@ -22,153 +52,5 @@ export declare const bindConfig: (config: CouchConfigInput) => BoundInstance;
|
|
|
22
52
|
* @returns The bound function, possibly wrapped with retry logic
|
|
23
53
|
*/
|
|
24
54
|
export declare function getBoundWithRetry<TBound extends (...args: any[]) => Promise<any>>(func: (config: CouchConfig, ...args: any[]) => Promise<any>, config: CouchConfig): TBound;
|
|
25
|
-
/**
|
|
26
|
-
* @internal
|
|
27
|
-
*
|
|
28
|
-
* Bind core CouchDB operations to a specific configuration, optionally applying retry wrappers.
|
|
29
|
-
* @param config The CouchDB configuration
|
|
30
|
-
* @returns An object with CouchDB operations bound to the provided configuration
|
|
31
|
-
*/
|
|
32
|
-
declare function doBind(config: CouchConfig): {
|
|
33
|
-
/**
|
|
34
|
-
* These functions use overloaded signatures when bound.
|
|
35
|
-
* To preserve the overloads we need dedicated Bound types
|
|
36
|
-
*/
|
|
37
|
-
bulkGet: BulkGetBound;
|
|
38
|
-
bulkGetDictionary: BulkGetDictionaryBound;
|
|
39
|
-
get: GetBound;
|
|
40
|
-
getAtRev: GetAtRevBound;
|
|
41
|
-
query: QueryBound;
|
|
42
|
-
/**
|
|
43
|
-
* These functions have single signatures and can be bound directly
|
|
44
|
-
*/
|
|
45
|
-
bulkRemove: (ids: string[]) => Promise<{
|
|
46
|
-
ok?: boolean | null | undefined;
|
|
47
|
-
id?: string | null | undefined;
|
|
48
|
-
rev?: string | null | undefined;
|
|
49
|
-
error?: string | null | undefined;
|
|
50
|
-
reason?: string | null | undefined;
|
|
51
|
-
}[]>;
|
|
52
|
-
bulkRemoveMap: (ids: string[]) => Promise<{
|
|
53
|
-
statusCode: number;
|
|
54
|
-
ok?: boolean | undefined;
|
|
55
|
-
error?: string | undefined;
|
|
56
|
-
id?: string | undefined;
|
|
57
|
-
rev?: string | undefined;
|
|
58
|
-
}[]>;
|
|
59
|
-
bulkSave: (docs: import("../index.mts").CouchDocInput[]) => Promise<{
|
|
60
|
-
ok?: boolean | null | undefined;
|
|
61
|
-
id?: string | null | undefined;
|
|
62
|
-
rev?: string | null | undefined;
|
|
63
|
-
error?: string | null | undefined;
|
|
64
|
-
reason?: string | null | undefined;
|
|
65
|
-
}[]>;
|
|
66
|
-
bulkSaveTransaction: (transactionId: string, docs: import("../index.mts").CouchDocInput[]) => Promise<{
|
|
67
|
-
ok?: boolean | null | undefined;
|
|
68
|
-
id?: string | null | undefined;
|
|
69
|
-
rev?: string | null | undefined;
|
|
70
|
-
error?: string | null | undefined;
|
|
71
|
-
reason?: string | null | undefined;
|
|
72
|
-
}[]>;
|
|
73
|
-
getDBInfo: () => Promise<{
|
|
74
|
-
[x: string]: unknown;
|
|
75
|
-
db_name: string;
|
|
76
|
-
cluster?: {
|
|
77
|
-
n?: number | undefined;
|
|
78
|
-
q?: number | undefined;
|
|
79
|
-
r?: number | undefined;
|
|
80
|
-
w?: number | undefined;
|
|
81
|
-
} | undefined;
|
|
82
|
-
compact_running?: boolean | undefined;
|
|
83
|
-
disk_format_version?: number | undefined;
|
|
84
|
-
doc_count?: number | undefined;
|
|
85
|
-
doc_del_count?: number | undefined;
|
|
86
|
-
instance_start_time?: string | undefined;
|
|
87
|
-
purge_seq?: string | undefined;
|
|
88
|
-
sizes?: {
|
|
89
|
-
active?: number | undefined;
|
|
90
|
-
external?: number | undefined;
|
|
91
|
-
file?: number | undefined;
|
|
92
|
-
} | undefined;
|
|
93
|
-
update_seq?: string | number | undefined;
|
|
94
|
-
props?: {
|
|
95
|
-
partitioned?: boolean | undefined;
|
|
96
|
-
} | undefined;
|
|
97
|
-
}>;
|
|
98
|
-
patch: (id: string, _properties: {
|
|
99
|
-
[x: string]: unknown;
|
|
100
|
-
_rev: string;
|
|
101
|
-
}) => Promise<{
|
|
102
|
-
statusCode: number;
|
|
103
|
-
ok?: boolean | undefined;
|
|
104
|
-
error?: string | undefined;
|
|
105
|
-
id?: string | undefined;
|
|
106
|
-
rev?: string | undefined;
|
|
107
|
-
}>;
|
|
108
|
-
patchDangerously: (id: string, properties: Record<string, unknown>) => Promise<{
|
|
109
|
-
statusCode: number;
|
|
110
|
-
ok?: boolean | undefined;
|
|
111
|
-
error?: string | undefined;
|
|
112
|
-
id?: string | undefined;
|
|
113
|
-
rev?: string | undefined;
|
|
114
|
-
} | undefined>;
|
|
115
|
-
put: (doc: {
|
|
116
|
-
[x: string]: unknown;
|
|
117
|
-
_id: string;
|
|
118
|
-
_rev?: string | null | undefined;
|
|
119
|
-
_deleted?: boolean | undefined;
|
|
120
|
-
}) => Promise<{
|
|
121
|
-
statusCode: number;
|
|
122
|
-
ok?: boolean | undefined;
|
|
123
|
-
error?: string | undefined;
|
|
124
|
-
id?: string | undefined;
|
|
125
|
-
rev?: string | undefined;
|
|
126
|
-
}>;
|
|
127
|
-
queryStream: (view: string, options: {
|
|
128
|
-
descending?: boolean | undefined;
|
|
129
|
-
endkey_docid?: string | undefined;
|
|
130
|
-
endkey?: any;
|
|
131
|
-
group_level?: number | undefined;
|
|
132
|
-
group?: boolean | undefined;
|
|
133
|
-
include_docs?: boolean | undefined;
|
|
134
|
-
inclusive_end?: boolean | undefined;
|
|
135
|
-
key?: any;
|
|
136
|
-
keys?: any[] | undefined;
|
|
137
|
-
limit?: number | undefined;
|
|
138
|
-
reduce?: boolean | undefined;
|
|
139
|
-
skip?: number | undefined;
|
|
140
|
-
sorted?: boolean | undefined;
|
|
141
|
-
stable?: boolean | undefined;
|
|
142
|
-
startkey?: any;
|
|
143
|
-
startkey_docid?: string | undefined;
|
|
144
|
-
update?: "lazy" | "true" | "false" | undefined;
|
|
145
|
-
update_seq?: boolean | undefined;
|
|
146
|
-
} | undefined, onRow: import("./stream.mts").OnRow) => Promise<void>;
|
|
147
|
-
remove: (id: string, rev: string) => Promise<{
|
|
148
|
-
statusCode: number;
|
|
149
|
-
ok?: boolean | undefined;
|
|
150
|
-
error?: string | undefined;
|
|
151
|
-
id?: string | undefined;
|
|
152
|
-
rev?: string | undefined;
|
|
153
|
-
}>;
|
|
154
|
-
createLock: (docId: string, lockOptions: {
|
|
155
|
-
enableLocking: boolean;
|
|
156
|
-
username: string;
|
|
157
|
-
}) => Promise<boolean>;
|
|
158
|
-
removeLock: (docId: string, lockOptions: {
|
|
159
|
-
enableLocking: boolean;
|
|
160
|
-
username: string;
|
|
161
|
-
}) => Promise<void>;
|
|
162
|
-
watchDocs: (docIds: string | string[], onChange: (change: any) => void, optionsInput?: {
|
|
163
|
-
include_docs?: boolean | undefined;
|
|
164
|
-
maxRetries?: number | undefined;
|
|
165
|
-
initialDelay?: number | undefined;
|
|
166
|
-
maxDelay?: number | undefined;
|
|
167
|
-
} | undefined) => {
|
|
168
|
-
on: (event: string, listener: EventListener) => import("events")<[never]>;
|
|
169
|
-
removeListener: (event: string, listener: EventListener) => import("events")<[never]>;
|
|
170
|
-
stop: () => void;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
55
|
export {};
|
|
174
56
|
//# sourceMappingURL=bindConfig.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindConfig.d.mts","sourceRoot":"","sources":["../../../impl/bindConfig.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEzE,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAiB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"bindConfig.d.mts","sourceRoot":"","sources":["../../../impl/bindConfig.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAA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|
|
1
|
+
{"version":3,"file":"bindConfig.test.d.mts","sourceRoot":"","sources":["../../../impl/bindConfig.test.mts"],"names":[],"mappings":""}
|
|
@@ -30,8 +30,8 @@ export type BulkGetOptions<DocSchema extends StandardSchemaV1> = {
|
|
|
30
30
|
* @returns The bulk get response with rows optionally validated against the supplied document schema.
|
|
31
31
|
*
|
|
32
32
|
* @throws {RetryableError} When a retryable HTTP status code is encountered or no response is received.
|
|
33
|
-
* @throws {
|
|
34
|
-
* @throws {
|
|
33
|
+
* @throws {ValidationError} When returned documents fail schema validation.
|
|
34
|
+
* @throws {OperationError} When CouchDB returns a non-retryable request-level failure.
|
|
35
35
|
*/
|
|
36
36
|
export declare function bulkGet<DocSchema extends StandardSchemaV1 = typeof CouchDoc>(config: CouchConfigInput, ids: Array<string | undefined>, options?: BulkGetOptions<DocSchema>): Promise<BulkGetResponse<DocSchema>>;
|
|
37
37
|
/**
|
|
@@ -56,7 +56,7 @@ export type BulkGetDictionaryResult<DocSchema extends StandardSchemaV1 = Standar
|
|
|
56
56
|
/**
|
|
57
57
|
* Bulk get documents by IDs and return a dictionary of found and not found documents.
|
|
58
58
|
*
|
|
59
|
-
* @template DocSchema - Schema used to validate each returned document, if provided. Note: if a document is found and it fails validation this will throw a
|
|
59
|
+
* @template DocSchema - Schema used to validate each returned document, if provided. Note: if a document is found and it fails validation this will throw a ValidationError.
|
|
60
60
|
*
|
|
61
61
|
* @param config - CouchDB configuration data that is validated before use.
|
|
62
62
|
* @param ids - Array of document IDs to retrieve.
|
|
@@ -65,8 +65,8 @@ export type BulkGetDictionaryResult<DocSchema extends StandardSchemaV1 = Standar
|
|
|
65
65
|
* @returns An object containing found documents and not found rows.
|
|
66
66
|
*
|
|
67
67
|
* @throws {RetryableError} When a retryable HTTP status code is encountered or no response is received.
|
|
68
|
-
* @throws {
|
|
69
|
-
* @throws {
|
|
68
|
+
* @throws {ValidationError} When returned documents fail schema validation.
|
|
69
|
+
* @throws {OperationError} When CouchDB returns a non-retryable request-level failure.
|
|
70
70
|
*/
|
|
71
71
|
export declare function bulkGetDictionary<DocSchema extends StandardSchemaV1 = typeof CouchDoc>(config: CouchConfigInput, ids: Array<string | undefined>, options?: Omit<BulkGetDictionaryOptions<DocSchema>, 'includeDocs'>): Promise<BulkGetDictionaryResult<DocSchema>>;
|
|
72
72
|
export type BulkGetDictionaryBound = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulkGet.d.mts","sourceRoot":"","sources":["../../../impl/bulkGet.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bulkGet.d.mts","sourceRoot":"","sources":["../../../impl/bulkGet.mts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAGzE,OAAO,EACL,iBAAiB,EACjB,KAAK,0BAA0B,EAC/B,QAAQ,EACR,KAAK,gBAAgB,EACtB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAW1E,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,gBAAgB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IACzF,0BAA0B,CACxB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,CAAC;IACf,GAAG,EAAE,MAAM,CAAA;CACZ,CAAC,CACH,CAAA;AAEH,MAAM,MAAM,cAAc,CAAC,SAAS,SAAS,gBAAgB,IAAI;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE;QACT,SAAS,EAAE,SAAS,CAAA;QACpB,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAClC,CAAA;CACF,CAAA;AAmHD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,OAAO,CAAC,SAAS,SAAS,gBAAgB,GAAG,OAAO,QAAQ,EAChF,MAAM,EAAE,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ACjE,OAAO,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAkC7C;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,CAAC,SAAS,SAAS,gBAAgB,GAAG,OAAO,QAAQ,EACnD,GAAG,EAAE,MAAM,EAAE,EACb,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,GAC3C,OAAO,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAAA;CAC/C,CAAA"}
|
|
@@ -21,7 +21,8 @@ import { type CouchConfigInput } from '../schema/config.mts';
|
|
|
21
21
|
* console.log(results);
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
|
-
* @throws
|
|
24
|
+
* @throws {RetryableError} When the bulk request fails with a retryable transport or HTTP error.
|
|
25
|
+
* @throws {OperationError} When CouchDB returns a non-retryable request-level failure.
|
|
25
26
|
*/
|
|
26
27
|
export declare const bulkRemove: (configInput: CouchConfigInput, ids: string[]) => Promise<{
|
|
27
28
|
ok?: boolean | null | undefined;
|
|
@@ -51,7 +52,8 @@ export declare const bulkRemove: (configInput: CouchConfigInput, ids: string[])
|
|
|
51
52
|
* console.log(results);
|
|
52
53
|
* ```
|
|
53
54
|
*
|
|
54
|
-
* @throws
|
|
55
|
+
* @throws {RetryableError} When a request-level transport or retryable HTTP failure occurs.
|
|
56
|
+
* @throws {OperationError} When a request fails in a non-retryable way.
|
|
55
57
|
*/
|
|
56
58
|
export declare const bulkRemoveMap: (configInput: CouchConfigInput, ids: string[]) => Promise<{
|
|
57
59
|
statusCode: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulkRemove.d.mts","sourceRoot":"","sources":["../../../impl/bulkRemove.mts"],"names":[],"mappings":"AAKA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEzE
|
|
1
|
+
{"version":3,"file":"bulkRemove.d.mts","sourceRoot":"","sources":["../../../impl/bulkRemove.mts"],"names":[],"mappings":"AAKA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,UAAU,GAAU,aAAa,gBAAgB,EAAE,KAAK,MAAM,EAAE;;;;;;IAmB5E,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,aAAa,GAAU,aAAa,gBAAgB,EAAE,KAAK,MAAM,EAAE;;;;;;IAsB/E,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BulkSaveResponse, type CouchDocInput } from '../schema/couch/couch.output.schema.ts';
|
|
2
|
-
import type
|
|
2
|
+
import { type CouchConfigInput } from '../schema/config.mts';
|
|
3
3
|
/**
|
|
4
4
|
* Bulk saves documents to CouchDB using the _bulk_docs endpoint.
|
|
5
5
|
*
|
|
@@ -11,7 +11,7 @@ import type { CouchConfigInput } from '../schema/config.mts';
|
|
|
11
11
|
* @returns {Promise<BulkSaveResponse>} - The response from CouchDB after the bulk save operation.
|
|
12
12
|
*
|
|
13
13
|
* @throws {RetryableError} When a retryable HTTP status code is encountered or no response is received.
|
|
14
|
-
* @throws {
|
|
14
|
+
* @throws {OperationError} When bulk save input is invalid or CouchDB returns a non-retryable request-level failure.
|
|
15
15
|
*/
|
|
16
16
|
export declare const bulkSave: (config: CouchConfigInput, docs: CouchDocInput[]) => Promise<{
|
|
17
17
|
ok?: boolean | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulkSave.d.mts","sourceRoot":"","sources":["../../../impl/bulkSave.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bulkSave.d.mts","sourceRoot":"","sources":["../../../impl/bulkSave.mts"],"names":[],"mappings":"AASA,OAAO,EACL,gBAAgB,EAEhB,KAAK,aAAa,EACnB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAazE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GAAU,QAAQ,gBAAgB,EAAE,MAAM,aAAa,EAAE;;;;;;IAiD7E,CAAA;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,gBAAgB,EACxB,eAAe,MAAM,EACrB,MAAM,aAAa,EAAE,KACpB,OAAO,CAAC,gBAAgB,CAkK1B,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { CouchConfigInput } from '../schema/config.mts';
|
|
3
2
|
import type { StandardSchemaV1 } from '../types/standard-schema.ts';
|
|
4
3
|
import { CouchDoc } from '../schema/couch/couch.output.schema.ts';
|
|
4
|
+
import { type CouchConfigInput } from '../schema/config.mts';
|
|
5
5
|
export type GetOptions<DocSchema extends StandardSchemaV1> = {
|
|
6
6
|
validate?: {
|
|
7
7
|
docSchema?: DocSchema;
|
|
@@ -12,7 +12,7 @@ export declare const CouchGetOptions: z.ZodObject<{
|
|
|
12
12
|
validate: z.ZodOptional<z.ZodObject<{
|
|
13
13
|
docSchema: z.ZodOptional<z.ZodCustom<unknown, unknown>>;
|
|
14
14
|
}, z.core.$strip>>;
|
|
15
|
-
}, z.core.$
|
|
15
|
+
}, z.core.$strict>;
|
|
16
16
|
export declare function get<DocSchema extends StandardSchemaV1 = typeof CouchDoc>(config: CouchConfigInput, id: string, options?: GetOptions<DocSchema>): Promise<StandardSchemaV1.InferOutput<DocSchema> | null>;
|
|
17
17
|
export type GetBound = <DocSchema extends StandardSchemaV1 = typeof CouchDoc>(id: string, options?: GetOptions<DocSchema>) => Promise<StandardSchemaV1.InferOutput<DocSchema> | null>;
|
|
18
18
|
export declare function getAtRev<DocSchema extends StandardSchemaV1>(config: CouchConfigInput, id: string, rev: string, options?: GetOptions<DocSchema>): Promise<StandardSchemaV1.InferOutput<DocSchema> | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.mts","sourceRoot":"","sources":["../../../impl/get.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get.d.mts","sourceRoot":"","sources":["../../../impl/get.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAA;AAEjE,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAIzE,MAAM,MAAM,UAAU,CAAC,SAAS,SAAS,gBAAgB,IAAI;IAC3D,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,SAAS,CAAA;KACtB,CAAA;CACF,CAAA;AAeD,eAAO,MAAM,eAAe;;;;;kBAQ1B,CAAA;AA0EF,wBAAsB,GAAG,CAAC,SAAS,SAAS,gBAAgB,GAAG,OAAO,QAAQ,EAC5E,MAAM,EAAE,gBAAgB,EACxB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,GAC9B,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAEzD;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,SAAS,SAAS,gBAAgB,GAAG,OAAO,QAAQ,EAC1E,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,KAC5B,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAA;AAE5D,wBAAsB,QAAQ,CAAC,SAAS,SAAS,gBAAgB,EAC/D,MAAM,EAAE,gBAAgB,EACxB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,GAC9B,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAKzD;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,SAAS,SAAS,gBAAgB,GAAG,OAAO,QAAQ,EAC/E,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS,KACxC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { type CouchConfigInput } from '../schema/config.mts';
|
|
|
7
7
|
* @param configInput - The CouchDB configuration input.
|
|
8
8
|
* @returns A promise that resolves to the CouchDB database information.
|
|
9
9
|
* @throws {RetryableError} `RetryableError` If a retryable error occurs during the request.
|
|
10
|
-
* @throws {
|
|
10
|
+
* @throws {OperationError} `OperationError` For other non-retryable response failures.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDBInfo.d.mts","sourceRoot":"","sources":["../../../impl/getDBInfo.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDBInfo.d.mts","sourceRoot":"","sources":["../../../impl/getDBInfo.mts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAMzE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,SAAS,GAAU,aAAa,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAmC5D,CAAA"}
|
|
@@ -12,7 +12,10 @@ declare const PatchProperties: z.ZodObject<{
|
|
|
12
12
|
* @param _properties - Properties to merge into the document (must include _rev)
|
|
13
13
|
* @returns The result of the put operation
|
|
14
14
|
*
|
|
15
|
-
* @throws
|
|
15
|
+
* @throws {ConflictError} When the supplied `_rev` does not match the current document revision.
|
|
16
|
+
* @throws {NotFoundError} When the document does not exist.
|
|
17
|
+
* @throws {RetryableError} When a retryable transport or HTTP failure occurs while reading or saving.
|
|
18
|
+
* @throws {OperationError} When a non-retryable operational failure occurs.
|
|
16
19
|
*/
|
|
17
20
|
export declare const patch: (configInput: CouchConfigInput, id: string, _properties: z.infer<typeof PatchProperties>) => Promise<{
|
|
18
21
|
statusCode: number;
|
|
@@ -32,7 +35,9 @@ export declare const patch: (configInput: CouchConfigInput, id: string, _propert
|
|
|
32
35
|
* @param properties - Properties to merge into the document
|
|
33
36
|
* @returns The result of the put operation or an error if max retries are exceeded
|
|
34
37
|
*
|
|
35
|
-
* @throws
|
|
38
|
+
* @throws {NotFoundError} When the document does not exist.
|
|
39
|
+
* @throws {RetryableError} When a retryable transport or HTTP failure occurs before retries are exhausted.
|
|
40
|
+
* @throws {OperationError} When retries are exhausted or a non-retryable operational failure occurs.
|
|
36
41
|
*/
|
|
37
42
|
export declare const patchDangerously: (configInput: CouchConfigInput, id: string, properties: Record<string, unknown>) => Promise<{
|
|
38
43
|
statusCode: number;
|
|
@@ -40,6 +45,6 @@ export declare const patchDangerously: (configInput: CouchConfigInput, id: strin
|
|
|
40
45
|
error?: string | undefined;
|
|
41
46
|
id?: string | undefined;
|
|
42
47
|
rev?: string | undefined;
|
|
43
|
-
}
|
|
48
|
+
}>;
|
|
44
49
|
export {};
|
|
45
50
|
//# sourceMappingURL=patch.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch.d.mts","sourceRoot":"","sources":["../../../impl/patch.mts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"patch.d.mts","sourceRoot":"","sources":["../../../impl/patch.mts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,QAAA,MAAM,eAAe;;iBAIiB,CAAA;AAEtC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK,GAChB,aAAa,gBAAgB,EAC7B,IAAI,MAAM,EACV,aAAa,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC;;;;;;EAwB7C,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,gBAAgB,EAC7B,IAAI,MAAM,EACV,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;EA8DpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put.d.mts","sourceRoot":"","sources":["../../../impl/put.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"put.d.mts","sourceRoot":"","sources":["../../../impl/put.mts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAE,KAAK,QAAQ,EAAE,MAAM,wCAAwC,CAAA;AACxF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB,eAAO,MAAM,GAAG,GACd,aAAa,gBAAgB,EAC7B,KAAK,QAAQ,KACZ,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAsD1C,CAAA"}
|
|
@@ -4,44 +4,29 @@ import { ViewOptions, type ViewString } from '../schema/couch/couch.input.schema
|
|
|
4
4
|
import type { CouchDoc, ViewQueryResponseValidated } from '../schema/couch/couch.output.schema.ts';
|
|
5
5
|
import type { StandardSchemaV1 } from '../types/standard-schema.ts';
|
|
6
6
|
import { type OnInvalidDocAction } from './utils/parseRows.mts';
|
|
7
|
-
|
|
8
|
-
include_docs: true;
|
|
7
|
+
type QueryRequestOptions<DocSchema extends StandardSchemaV1, KeySchema extends StandardSchemaV1, ValueSchema extends StandardSchemaV1> = ViewOptions & {
|
|
9
8
|
validate?: {
|
|
10
9
|
onInvalidDoc?: OnInvalidDocAction;
|
|
11
10
|
docSchema?: DocSchema;
|
|
12
11
|
keySchema?: KeySchema;
|
|
13
12
|
valueSchema?: ValueSchema;
|
|
14
13
|
};
|
|
14
|
+
};
|
|
15
|
+
export declare function query<DocSchema extends StandardSchemaV1 = typeof CouchDoc, KeySchema extends StandardSchemaV1 = ZodAny, ValueSchema extends StandardSchemaV1 = ZodAny>(config: CouchConfigInput, view: ViewString, options: QueryRequestOptions<DocSchema, KeySchema, ValueSchema> & {
|
|
16
|
+
include_docs: true;
|
|
15
17
|
}): Promise<ViewQueryResponseValidated<DocSchema, KeySchema, ValueSchema>>;
|
|
16
|
-
export declare function query<DocSchema extends StandardSchemaV1 = ZodNever, KeySchema extends StandardSchemaV1 = ZodAny, ValueSchema extends StandardSchemaV1 = ZodAny>(config: CouchConfigInput, view: ViewString, options:
|
|
18
|
+
export declare function query<DocSchema extends StandardSchemaV1 = ZodNever, KeySchema extends StandardSchemaV1 = ZodAny, ValueSchema extends StandardSchemaV1 = ZodAny>(config: CouchConfigInput, view: ViewString, options: QueryRequestOptions<DocSchema, KeySchema, ValueSchema> & {
|
|
17
19
|
include_docs?: false | undefined;
|
|
18
|
-
validate?: {
|
|
19
|
-
onInvalidDoc?: OnInvalidDocAction;
|
|
20
|
-
docSchema?: DocSchema;
|
|
21
|
-
keySchema?: KeySchema;
|
|
22
|
-
valueSchema?: ValueSchema;
|
|
23
|
-
};
|
|
24
20
|
}): Promise<ViewQueryResponseValidated<ZodNever, KeySchema, ValueSchema>>;
|
|
25
21
|
export declare function query(config: CouchConfigInput, view: ViewString, options?: ViewOptions): Promise<ViewQueryResponseValidated<ZodNever, ZodAny, ZodAny>>;
|
|
26
22
|
export type QueryBound = {
|
|
27
|
-
<DocSchema extends StandardSchemaV1 = typeof CouchDoc, KeySchema extends StandardSchemaV1 = ZodAny, ValueSchema extends StandardSchemaV1 = ZodAny>(view: ViewString, options:
|
|
23
|
+
<DocSchema extends StandardSchemaV1 = typeof CouchDoc, KeySchema extends StandardSchemaV1 = ZodAny, ValueSchema extends StandardSchemaV1 = ZodAny>(view: ViewString, options: QueryRequestOptions<DocSchema, KeySchema, ValueSchema> & {
|
|
28
24
|
include_docs: true;
|
|
29
|
-
validate?: {
|
|
30
|
-
onInvalidDoc?: OnInvalidDocAction;
|
|
31
|
-
docSchema?: DocSchema;
|
|
32
|
-
keySchema?: KeySchema;
|
|
33
|
-
valueSchema?: ValueSchema;
|
|
34
|
-
};
|
|
35
25
|
}): Promise<ViewQueryResponseValidated<DocSchema, KeySchema, ValueSchema>>;
|
|
36
|
-
<DocSchema extends StandardSchemaV1 = ZodNever, KeySchema extends StandardSchemaV1 = ZodAny, ValueSchema extends StandardSchemaV1 = ZodAny>(view: ViewString, options:
|
|
26
|
+
<DocSchema extends StandardSchemaV1 = ZodNever, KeySchema extends StandardSchemaV1 = ZodAny, ValueSchema extends StandardSchemaV1 = ZodAny>(view: ViewString, options: QueryRequestOptions<DocSchema, KeySchema, ValueSchema> & {
|
|
37
27
|
include_docs?: false | undefined;
|
|
38
|
-
validate?: {
|
|
39
|
-
onInvalidDoc?: OnInvalidDocAction;
|
|
40
|
-
docSchema?: DocSchema;
|
|
41
|
-
keySchema?: KeySchema;
|
|
42
|
-
valueSchema?: ValueSchema;
|
|
43
|
-
};
|
|
44
28
|
}): Promise<ViewQueryResponseValidated<ZodNever, KeySchema, ValueSchema>>;
|
|
45
29
|
(view: ViewString, options?: ViewOptions): Promise<ViewQueryResponseValidated<ZodNever, ZodAny, ZodAny>>;
|
|
46
30
|
};
|
|
31
|
+
export {};
|
|
47
32
|
//# sourceMappingURL=query.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.mts","sourceRoot":"","sources":["../../../impl/query.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.mts","sourceRoot":"","sources":["../../../impl/query.mts"],"names":[],"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,GACpB,OAAO,CAAC,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACjE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.mts","sourceRoot":"","sources":["../../../impl/remove.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove.d.mts","sourceRoot":"","sources":["../../../impl/remove.mts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAYzE,eAAO,MAAM,MAAM,GAAU,aAAa,gBAAgB,EAAE,IAAI,MAAM,EAAE,KAAK,MAAM;;;;;;EAiDlF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-controls.test.d.mts","sourceRoot":"","sources":["../../../impl/request-controls.test.mts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CouchConfigInput } from '../schema/config.mts';
|
|
2
2
|
import type { ViewRow } from '../schema/couch/couch.output.schema.ts';
|
|
3
|
-
import
|
|
3
|
+
import { ViewOptions } from '../schema/couch/couch.input.schema.ts';
|
|
4
4
|
export type OnRow = (row: ViewRow) => void;
|
|
5
5
|
/**
|
|
6
6
|
* Execute a CouchDB view query and stream rows as they are received.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.mts","sourceRoot":"","sources":["../../../impl/stream.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream.d.mts","sourceRoot":"","sources":["../../../impl/stream.mts"],"names":[],"mappings":"AAKA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAIzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAA;AAWnE,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAA;AAG1C;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,SAAS,EAAE,gBAAgB,EAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,IAAI,CAAC,CAuKf"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import { type WatchOptionsInput } from '../../schema/sugar/watch.mts';
|
|
3
3
|
import { type CouchConfigInput } from '../../schema/config.mts';
|
|
4
|
+
export type WatchListener = (...args: Array<unknown>) => void;
|
|
5
|
+
export type WatchHandle = {
|
|
6
|
+
on: (event: string, listener: WatchListener) => EventEmitter;
|
|
7
|
+
removeListener: (event: string, listener: WatchListener) => EventEmitter;
|
|
8
|
+
stop: () => void;
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* Watch for changes to specified document IDs in CouchDB.
|
|
6
12
|
* Calls the onChange callback for each change detected.
|
|
@@ -13,9 +19,5 @@ import { type CouchConfigInput } from '../../schema/config.mts';
|
|
|
13
19
|
*
|
|
14
20
|
* @return WatchEmitter with methods to manage the watch
|
|
15
21
|
*/
|
|
16
|
-
export declare function watchDocs(configInput: CouchConfigInput, docIds: string | string[], onChange: (change: any) => void, optionsInput?: WatchOptionsInput):
|
|
17
|
-
on: (event: string, listener: EventListener) => EventEmitter<[never]>;
|
|
18
|
-
removeListener: (event: string, listener: EventListener) => EventEmitter<[never]>;
|
|
19
|
-
stop: () => void;
|
|
20
|
-
};
|
|
22
|
+
export declare function watchDocs(configInput: CouchConfigInput, docIds: string | string[], onChange: (change: any) => void, optionsInput?: WatchOptionsInput): WatchHandle;
|
|
21
23
|
//# sourceMappingURL=watch.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.mts","sourceRoot":"","sources":["../../../../impl/sugar/watch.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watch.d.mts","sourceRoot":"","sources":["../../../../impl/sugar/watch.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAGrC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEnF,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAK5E,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;AAE7D,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,YAAY,CAAA;IAC5D,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,YAAY,CAAA;IACxE,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,gBAAgB,EAC7B,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAEzB,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,EAC/B,YAAY,GAAE,iBAAsB,GACnC,WAAW,CA2Nb"}
|