hide-a-bed 7.0.0-beta.1 → 7.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 → .oxfmtrc.json} +4 -3
- package/.oxlintrc.json +31 -0
- package/README.md +15 -0
- package/dist/cjs/index.cjs +19 -2
- package/dist/esm/index.mjs +19 -2
- package/impl/bindConfig.mts +2 -5
- package/impl/bulkGet.mts +1 -1
- package/impl/patch.mts +5 -2
- package/impl/retry.mts +7 -3
- package/impl/sugar/watch.mts +1 -1
- package/impl/utils/errors.mts +12 -0
- package/impl/utils/parseRows.mts +1 -1
- package/impl/utils/queryBuilder.mts +1 -1
- package/impl/utils/trackedEmitter.mts +1 -1
- package/package.json +26 -29
- package/types/output/impl/bindConfig.d.mts.map +1 -1
- package/types/output/impl/patch.d.mts.map +1 -1
- package/types/output/impl/retry.d.mts +1 -0
- package/types/output/impl/retry.d.mts.map +1 -1
- package/types/output/impl/utils/errors.d.mts +4 -0
- package/types/output/impl/utils/errors.d.mts.map +1 -1
- package/types/output/types/types.utils.d.ts +3 -0
- package/types/output/types/types.utils.d.ts.map +1 -0
- package/types/types.utils.ts +7 -0
- package/eslint.config.js +0 -20
- package/types/output/eslint.config.d.ts +0 -3
- package/types/output/eslint.config.d.ts.map +0 -1
package/.oxlintrc.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": ["typescript"],
|
|
4
|
+
"ignorePatterns": ["dist/", "node_modules/", "docs/", "types/"],
|
|
5
|
+
"rules": {
|
|
6
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
7
|
+
"error",
|
|
8
|
+
{
|
|
9
|
+
"ts-expect-error": "allow-with-description",
|
|
10
|
+
"ts-ignore": "allow-with-description",
|
|
11
|
+
"ts-nocheck": "allow-with-description",
|
|
12
|
+
"ts-check": false
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
16
|
+
"no-unused-vars": [
|
|
17
|
+
"error",
|
|
18
|
+
{
|
|
19
|
+
"ignoreRestSiblings": true
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"overrides": [
|
|
24
|
+
{
|
|
25
|
+
"files": ["**/*.test.{js,ts,mjs,mts}"],
|
|
26
|
+
"rules": {
|
|
27
|
+
"@typescript-eslint/no-explicit-any": "off"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
package/README.md
CHANGED
|
@@ -779,6 +779,21 @@ const config = {
|
|
|
779
779
|
}
|
|
780
780
|
```
|
|
781
781
|
|
|
782
|
+
`bindConfig()` and `withRetry()` now perform a single built-in retry for transient `401` and `403` responses before surfacing the error.
|
|
783
|
+
|
|
784
|
+
### withRetry
|
|
785
|
+
|
|
786
|
+
`withRetry(fn, options)` wraps an async function and retries based on the built-in retry rules.
|
|
787
|
+
|
|
788
|
+
```javascript
|
|
789
|
+
import { withRetry, get } from 'hide-a-bed'
|
|
790
|
+
|
|
791
|
+
const getWithCustomRetry = withRetry(id => get({ couch: 'http://localhost:5984/mydb' }, id), {
|
|
792
|
+
maxRetries: 2,
|
|
793
|
+
initialDelay: 250
|
|
794
|
+
})
|
|
795
|
+
```
|
|
796
|
+
|
|
782
797
|
### Migration Note
|
|
783
798
|
|
|
784
799
|
`needleOpts` has been removed from the main `client` package. If you were passing transport-specific `needle` options through `config.needleOpts`, remove that configuration when upgrading. If you used `needleOpts.username` or `needleOpts.password`, move them to `config.auth.username` and `config.auth.password`. Couch URLs with embedded credentials are no longer supported and will fail validation. The package now uses native `fetch` internally and only supports the documented top-level config fields above.
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -279,6 +279,12 @@ const isSuccessStatusCode = (profile, statusCode) => {
|
|
|
279
279
|
return SUCCESS_STATUS_CODES[profile].includes(statusCode);
|
|
280
280
|
};
|
|
281
281
|
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region types/types.utils.ts
|
|
284
|
+
function isObject(value) {
|
|
285
|
+
return typeof value === "object" && value !== null;
|
|
286
|
+
}
|
|
287
|
+
|
|
282
288
|
//#endregion
|
|
283
289
|
//#region impl/utils/errors.mts
|
|
284
290
|
const RETRYABLE_STATUS_CODES = new Set([
|
|
@@ -310,6 +316,14 @@ const getNestedNetworkError = (value) => {
|
|
|
310
316
|
const candidate = value;
|
|
311
317
|
return isNetworkError(candidate.cause) ? candidate.cause : null;
|
|
312
318
|
};
|
|
319
|
+
const hasStatusCode = (error) => {
|
|
320
|
+
return isObject(error) && "statusCode" in error && typeof error.statusCode === "number";
|
|
321
|
+
};
|
|
322
|
+
const isTransientAuthError = (error, attempt) => {
|
|
323
|
+
if (!hasStatusCode(error)) return false;
|
|
324
|
+
if (attempt > 0) return false;
|
|
325
|
+
return error.statusCode === 401 || error.statusCode === 403;
|
|
326
|
+
};
|
|
313
327
|
/**
|
|
314
328
|
* Shared base class for operational errors thrown by hide-a-bed.
|
|
315
329
|
*
|
|
@@ -520,6 +534,9 @@ function isConflictError(err) {
|
|
|
520
534
|
|
|
521
535
|
//#endregion
|
|
522
536
|
//#region impl/retry.mts
|
|
537
|
+
const shouldRetryError = (error, attempt) => {
|
|
538
|
+
return error instanceof RetryableError || isTransientAuthError(error, attempt);
|
|
539
|
+
};
|
|
523
540
|
/**
|
|
524
541
|
* Wrap an async-capable function with retry semantics that respect {@link RetryableError}.
|
|
525
542
|
* @typeParam Fn - The function signature to decorate with retry handling.
|
|
@@ -534,7 +551,7 @@ function withRetry(fn, options = {}) {
|
|
|
534
551
|
for (let attempt = 0; attempt <= maxRetries; attempt++) try {
|
|
535
552
|
return await fn(...args);
|
|
536
553
|
} catch (error) {
|
|
537
|
-
if (!(error
|
|
554
|
+
if (!shouldRetryError(error, attempt)) throw error;
|
|
538
555
|
if (attempt === maxRetries) throw error;
|
|
539
556
|
await (0, node_timers_promises.setTimeout)(Math.min(delay, maxDelay));
|
|
540
557
|
delay *= backoffFactor;
|
|
@@ -1451,7 +1468,7 @@ const patchDangerously = async (configInput, id, properties) => {
|
|
|
1451
1468
|
return result;
|
|
1452
1469
|
} catch (err) {
|
|
1453
1470
|
if (!(err instanceof Error)) throw err;
|
|
1454
|
-
if (!(err instanceof ConflictError
|
|
1471
|
+
if (!(err instanceof ConflictError || shouldRetryError(err, attempts))) throw err;
|
|
1455
1472
|
lastError = err;
|
|
1456
1473
|
attempts++;
|
|
1457
1474
|
if (attempts > maxRetries) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -247,6 +247,12 @@ const isSuccessStatusCode = (profile, statusCode) => {
|
|
|
247
247
|
return SUCCESS_STATUS_CODES[profile].includes(statusCode);
|
|
248
248
|
};
|
|
249
249
|
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region types/types.utils.ts
|
|
252
|
+
function isObject(value) {
|
|
253
|
+
return typeof value === "object" && value !== null;
|
|
254
|
+
}
|
|
255
|
+
|
|
250
256
|
//#endregion
|
|
251
257
|
//#region impl/utils/errors.mts
|
|
252
258
|
const RETRYABLE_STATUS_CODES = new Set([
|
|
@@ -278,6 +284,14 @@ const getNestedNetworkError = (value) => {
|
|
|
278
284
|
const candidate = value;
|
|
279
285
|
return isNetworkError(candidate.cause) ? candidate.cause : null;
|
|
280
286
|
};
|
|
287
|
+
const hasStatusCode = (error) => {
|
|
288
|
+
return isObject(error) && "statusCode" in error && typeof error.statusCode === "number";
|
|
289
|
+
};
|
|
290
|
+
const isTransientAuthError = (error, attempt) => {
|
|
291
|
+
if (!hasStatusCode(error)) return false;
|
|
292
|
+
if (attempt > 0) return false;
|
|
293
|
+
return error.statusCode === 401 || error.statusCode === 403;
|
|
294
|
+
};
|
|
281
295
|
/**
|
|
282
296
|
* Shared base class for operational errors thrown by hide-a-bed.
|
|
283
297
|
*
|
|
@@ -488,6 +502,9 @@ function isConflictError(err) {
|
|
|
488
502
|
|
|
489
503
|
//#endregion
|
|
490
504
|
//#region impl/retry.mts
|
|
505
|
+
const shouldRetryError = (error, attempt) => {
|
|
506
|
+
return error instanceof RetryableError || isTransientAuthError(error, attempt);
|
|
507
|
+
};
|
|
491
508
|
/**
|
|
492
509
|
* Wrap an async-capable function with retry semantics that respect {@link RetryableError}.
|
|
493
510
|
* @typeParam Fn - The function signature to decorate with retry handling.
|
|
@@ -502,7 +519,7 @@ function withRetry(fn, options = {}) {
|
|
|
502
519
|
for (let attempt = 0; attempt <= maxRetries; attempt++) try {
|
|
503
520
|
return await fn(...args);
|
|
504
521
|
} catch (error) {
|
|
505
|
-
if (!(error
|
|
522
|
+
if (!shouldRetryError(error, attempt)) throw error;
|
|
506
523
|
if (attempt === maxRetries) throw error;
|
|
507
524
|
await setTimeout$1(Math.min(delay, maxDelay));
|
|
508
525
|
delay *= backoffFactor;
|
|
@@ -1419,7 +1436,7 @@ const patchDangerously = async (configInput, id, properties) => {
|
|
|
1419
1436
|
return result;
|
|
1420
1437
|
} catch (err) {
|
|
1421
1438
|
if (!(err instanceof Error)) throw err;
|
|
1422
|
-
if (!(err instanceof ConflictError
|
|
1439
|
+
if (!(err instanceof ConflictError || shouldRetryError(err, attempts))) throw err;
|
|
1423
1440
|
lastError = err;
|
|
1424
1441
|
attempts++;
|
|
1425
1442
|
if (attempts > maxRetries) {
|
package/impl/bindConfig.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// oxlint-disable typescript/no-explicit-any
|
|
1
2
|
import type z from 'zod'
|
|
2
3
|
import { CouchConfig, type CouchConfigInput } from '../schema/config.mts'
|
|
3
4
|
import { withRetry } from './retry.mts'
|
|
@@ -81,11 +82,7 @@ export const bindConfig = (config: CouchConfigInput): BoundInstance => {
|
|
|
81
82
|
* @param config The CouchDB configuration
|
|
82
83
|
* @returns The bound function, possibly wrapped with retry logic
|
|
83
84
|
*/
|
|
84
|
-
export function getBoundWithRetry<
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
-
TBound extends (...args: any[]) => Promise<any>
|
|
87
|
-
>(
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
+
export function getBoundWithRetry<TBound extends (...args: any[]) => Promise<any>>(
|
|
89
86
|
func: (config: CouchConfig, ...args: any[]) => Promise<any>,
|
|
90
87
|
config: CouchConfig
|
|
91
88
|
) {
|
package/impl/bulkGet.mts
CHANGED
|
@@ -257,7 +257,7 @@ export async function bulkGetDictionary<DocSchema extends StandardSchemaV1 = typ
|
|
|
257
257
|
|
|
258
258
|
const doc = row.doc
|
|
259
259
|
const docId =
|
|
260
|
-
//
|
|
260
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
261
261
|
typeof (doc as any)?._id === 'string' ? (doc as any)._id : row.id
|
|
262
262
|
|
|
263
263
|
if (!docId) {
|
package/impl/patch.mts
CHANGED
|
@@ -4,7 +4,8 @@ import { createLogger } from './utils/logger.mts'
|
|
|
4
4
|
import { setTimeout } from 'node:timers/promises'
|
|
5
5
|
import { CouchConfig, type CouchConfigInput } from '../schema/config.mts'
|
|
6
6
|
import { z } from 'zod'
|
|
7
|
-
import { ConflictError, HideABedError, OperationError
|
|
7
|
+
import { ConflictError, HideABedError, OperationError } from './utils/errors.mts'
|
|
8
|
+
import { shouldRetryError } from './retry.mts'
|
|
8
9
|
|
|
9
10
|
const PatchProperties = z
|
|
10
11
|
.looseObject({
|
|
@@ -106,7 +107,9 @@ export const patchDangerously = async (
|
|
|
106
107
|
throw err
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
|
|
110
|
+
const shouldRetry = err instanceof ConflictError || shouldRetryError(err, attempts)
|
|
111
|
+
|
|
112
|
+
if (!shouldRetry) {
|
|
110
113
|
throw err
|
|
111
114
|
}
|
|
112
115
|
|
package/impl/retry.mts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { setTimeout } from 'node:timers/promises'
|
|
2
|
-
import { RetryableError } from './utils/errors.mts'
|
|
2
|
+
import { isTransientAuthError, RetryableError } from './utils/errors.mts'
|
|
3
|
+
|
|
4
|
+
export const shouldRetryError = (error: unknown, attempt: number) => {
|
|
5
|
+
return error instanceof RetryableError || isTransientAuthError(error, attempt)
|
|
6
|
+
}
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* Settings that control how retry attempts are scheduled.
|
|
@@ -32,7 +36,7 @@ type MaybePromise<T> = PromiseLike<T> | T
|
|
|
32
36
|
* @param options Retry tuning parameters.
|
|
33
37
|
* @returns A function mirroring `fn` that automatically retries on {@link RetryableError}.
|
|
34
38
|
*/
|
|
35
|
-
//
|
|
39
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
36
40
|
export function withRetry<Fn extends (...args: any[]) => MaybePromise<any>>(
|
|
37
41
|
fn: Fn,
|
|
38
42
|
options: RetryOptions = {}
|
|
@@ -47,7 +51,7 @@ export function withRetry<Fn extends (...args: any[]) => MaybePromise<any>>(
|
|
|
47
51
|
const result = await fn(...args)
|
|
48
52
|
return result
|
|
49
53
|
} catch (error) {
|
|
50
|
-
if (!(error
|
|
54
|
+
if (!shouldRetryError(error, attempt)) {
|
|
51
55
|
throw error
|
|
52
56
|
}
|
|
53
57
|
|
package/impl/sugar/watch.mts
CHANGED
|
@@ -31,7 +31,7 @@ export type WatchHandle = {
|
|
|
31
31
|
export function watchDocs(
|
|
32
32
|
configInput: CouchConfigInput,
|
|
33
33
|
docIds: string | string[],
|
|
34
|
-
//
|
|
34
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
35
|
onChange: (change: any) => void,
|
|
36
36
|
optionsInput: WatchOptionsInput = {}
|
|
37
37
|
): WatchHandle {
|
package/impl/utils/errors.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getCouchError, getReason } from './response.mts'
|
|
2
2
|
import type { StandardSchemaV1 } from '../../types/standard-schema.ts'
|
|
3
|
+
import { isObject } from '../../types/types.utils.ts'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Represents a network-level error emitted by Node.js or HTTP client libraries.
|
|
@@ -80,6 +81,17 @@ const getNestedNetworkError = (
|
|
|
80
81
|
return isNetworkError(candidate.cause) ? candidate.cause : null
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
export const hasStatusCode = (error: unknown): error is { statusCode: number } => {
|
|
85
|
+
return isObject(error) && 'statusCode' in error && typeof error.statusCode === 'number'
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const isTransientAuthError = (error: unknown, attempt: number) => {
|
|
89
|
+
if (!hasStatusCode(error)) return false
|
|
90
|
+
if (attempt > 0) return false
|
|
91
|
+
|
|
92
|
+
return error.statusCode === 401 || error.statusCode === 403
|
|
93
|
+
}
|
|
94
|
+
|
|
83
95
|
/**
|
|
84
96
|
* Shared structured fields available on hide-a-bed operational errors.
|
|
85
97
|
*
|
package/impl/utils/parseRows.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { ViewRow } from '../../schema/couch/couch.output.schema.ts'
|
|
3
3
|
import type { StandardSchemaV1 } from '../../types/standard-schema.ts'
|
|
4
4
|
import { z } from 'zod'
|
|
@@ -167,7 +167,7 @@ export class QueryBuilder {
|
|
|
167
167
|
|
|
168
168
|
type AssertViewOptionsCovered =
|
|
169
169
|
Exclude<keyof ViewOptions, keyof QueryBuilder> extends never ? true : never
|
|
170
|
-
//
|
|
170
|
+
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
|
171
171
|
const _assertViewOptionsCovered: AssertViewOptionsCovered = true
|
|
172
172
|
|
|
173
173
|
export const createQuery = (): QueryBuilder => new QueryBuilder()
|
package/package.json
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hide-a-bed",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "An abstraction over couchdb calls that includes easy mock/stubs with pouchdb",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"couchdb",
|
|
7
|
+
"test"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/ryanramage/hide-a-bed#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/ryanramage/hide-a-bed/issues"
|
|
12
|
+
},
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"author": "ryan ramage",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/ryanramage/hide-a-bed.git"
|
|
18
|
+
},
|
|
5
19
|
"type": "module",
|
|
6
20
|
"main": "./dist/cjs/index.cjs",
|
|
7
21
|
"module": "./dist/esm/index.mjs",
|
|
@@ -18,6 +32,9 @@
|
|
|
18
32
|
"default": "./dist/esm/index.mjs"
|
|
19
33
|
}
|
|
20
34
|
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"registry": "https://registry.npmjs.org/"
|
|
37
|
+
},
|
|
21
38
|
"scripts": {
|
|
22
39
|
"clean": "rm -rf types/output && rm -rf dist && (find . -name \"log.txt\" -type f -delete || true)",
|
|
23
40
|
"build": "npm run clean && tsc && tsdown",
|
|
@@ -25,30 +42,16 @@
|
|
|
25
42
|
"dev": "typedoc --watch ./index.mts & npx -y serve ./docs",
|
|
26
43
|
"test": "node --test --test-global-setup ./test/setup.mts",
|
|
27
44
|
"test:watch": "node --test --watch --test-global-setup ./test/setup.mts",
|
|
28
|
-
"lint": "
|
|
29
|
-
"lint:fix": "
|
|
30
|
-
"format": "
|
|
31
|
-
"format:check": "
|
|
45
|
+
"lint": "oxlint .",
|
|
46
|
+
"lint:fix": "oxlint --fix .",
|
|
47
|
+
"format": "oxfmt --write .",
|
|
48
|
+
"format:check": "oxfmt --check .",
|
|
32
49
|
"typecheck": "tsc --noEmit",
|
|
33
50
|
"typecheck:watch": "tsc --noEmit --watch",
|
|
34
51
|
"prepublishOnly": "npm run build",
|
|
35
|
-
"validate": "npm run format && npm run lint && npm run typecheck",
|
|
52
|
+
"validate": "npm run format:check && npm run lint && npm run typecheck",
|
|
36
53
|
"full": "npm run lint:fix && npm run build && npm run clean"
|
|
37
54
|
},
|
|
38
|
-
"repository": {
|
|
39
|
-
"type": "git",
|
|
40
|
-
"url": "git+https://github.com/ryanramage/hide-a-bed.git"
|
|
41
|
-
},
|
|
42
|
-
"keywords": [
|
|
43
|
-
"couchdb",
|
|
44
|
-
"test"
|
|
45
|
-
],
|
|
46
|
-
"author": "ryan ramage",
|
|
47
|
-
"license": "ISC",
|
|
48
|
-
"bugs": {
|
|
49
|
-
"url": "https://github.com/ryanramage/hide-a-bed/issues"
|
|
50
|
-
},
|
|
51
|
-
"homepage": "https://github.com/ryanramage/hide-a-bed#readme",
|
|
52
55
|
"dependencies": {
|
|
53
56
|
"stream-chain": "3.4.0",
|
|
54
57
|
"stream-json": "1.9.1",
|
|
@@ -56,20 +59,14 @@
|
|
|
56
59
|
"zod": "4.2.1"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
|
-
"@eslint/js": "9.39.2",
|
|
60
62
|
"@types/node": "24.12.0",
|
|
61
63
|
"@types/stream-json": "1.7.8",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
+
"oxfmt": "0.41.0",
|
|
65
|
+
"oxlint": "1.56.0",
|
|
64
66
|
"pouchdb-server": "4.2.0",
|
|
65
|
-
"prettier": "3.7.4",
|
|
66
67
|
"tsdown": "0.18.1",
|
|
67
68
|
"typedoc": "0.28.15",
|
|
68
|
-
"typescript": "5.9.3"
|
|
69
|
-
"typescript-eslint": "8.50.1"
|
|
70
|
-
},
|
|
71
|
-
"publishConfig": {
|
|
72
|
-
"registry": "https://registry.npmjs.org/"
|
|
69
|
+
"typescript": "5.9.3"
|
|
73
70
|
},
|
|
74
71
|
"volta": {
|
|
75
72
|
"node": "24.12.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindConfig.d.mts","sourceRoot":"","sources":["../../../impl/bindConfig.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bindConfig.d.mts","sourceRoot":"","sources":["../../../impl/bindConfig.mts"],"names":[],"mappings":"AACA,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;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,IAAI,KAAK,MAAM,MAAM,GACvE,IAAI,SAAS,CAAC,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,GACnC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,MAAM,GACzB,KAAK,GACP,KAAK,CAAA;AAET,KAAK,YAAY,GAAG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IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAC/E,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAC3D,MAAM,EAAE,WAAW,UAYpB"}
|
|
@@ -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;AAIvB,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;;;;;EAgEpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.mts","sourceRoot":"","sources":["../../../impl/retry.mts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,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@@ export interface NetworkError {
|
|
|
16
16
|
}
|
|
17
17
|
export type ErrorCategory = 'conflict' | 'network' | 'not_found' | 'operation' | 'retryable' | 'validation' | 'transaction';
|
|
18
18
|
export type ErrorOperation = 'get' | 'getAtRev' | 'getDBInfo' | 'patch' | 'patchDangerously' | 'put' | 'query' | 'queryStream' | 'remove' | 'request' | 'watchDocs';
|
|
19
|
+
export declare const hasStatusCode: (error: unknown) => error is {
|
|
20
|
+
statusCode: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const isTransientAuthError: (error: unknown, attempt: number) => boolean;
|
|
19
23
|
/**
|
|
20
24
|
* Shared structured fields available on hide-a-bed operational errors.
|
|
21
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../../../../impl/utils/errors.mts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../../../../impl/utils/errors.mts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAGtE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAMD,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,WAAW,GACX,YAAY,GACZ,aAAa,CAAA;AAEjB,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,UAAU,GACV,WAAW,GACX,OAAO,GACP,kBAAkB,GAClB,KAAK,GACL,OAAO,GACP,aAAa,GACb,QAAQ,GACR,SAAS,GACT,WAAW,CAAA;AAsCf,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI;IAAE,UAAU,EAAE,MAAM,CAAA;CAE3E,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B,GAAG;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,cAAc,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAYD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,cAAc,EACd,KAAK,EACL,eAAe,EACf,SAAS,EACT,UAAU,EACX,EAAE,oBAAoB,GAAG,aAAa,CAwCtC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.utils.d.ts","sourceRoot":"","sources":["../../types.utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEtD"}
|
package/eslint.config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js'
|
|
2
|
-
import globals from 'globals'
|
|
3
|
-
import tseslint from 'typescript-eslint'
|
|
4
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
5
|
-
|
|
6
|
-
export default defineConfig([
|
|
7
|
-
globalIgnores(['dist/', 'node_modules/', 'docs/', 'types/']),
|
|
8
|
-
{
|
|
9
|
-
files: ['**/*.{js,mjs,cjs,ts,mts,cts}'],
|
|
10
|
-
plugins: { js },
|
|
11
|
-
extends: ['js/recommended'],
|
|
12
|
-
languageOptions: { globals: globals.browser }
|
|
13
|
-
},
|
|
14
|
-
tseslint.configs.recommended,
|
|
15
|
-
{
|
|
16
|
-
rules: {
|
|
17
|
-
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
])
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../eslint.config.js"],"names":[],"mappings":""}
|