@bsv/sdk 1.8.8 → 1.8.9
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/dist/cjs/package.json +1 -1
- package/dist/cjs/src/auth/transports/SimplifiedFetchTransport.js +7 -2
- package/dist/cjs/src/auth/transports/SimplifiedFetchTransport.js.map +1 -1
- package/dist/cjs/src/overlay-tools/LookupResolver.js +7 -2
- package/dist/cjs/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/auth/transports/SimplifiedFetchTransport.js +7 -2
- package/dist/esm/src/auth/transports/SimplifiedFetchTransport.js.map +1 -1
- package/dist/esm/src/overlay-tools/LookupResolver.js +7 -2
- package/dist/esm/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/auth/transports/SimplifiedFetchTransport.d.ts +1 -1
- package/dist/types/src/auth/transports/SimplifiedFetchTransport.d.ts.map +1 -1
- package/dist/types/src/overlay-tools/LookupResolver.d.ts +1 -1
- package/dist/types/src/overlay-tools/LookupResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/dist/umd/bundle.js.map +1 -1
- package/docs/reference/kvstore.md +11 -0
- package/package.json +1 -1
- package/src/auth/transports/SimplifiedFetchTransport.ts +10 -2
- package/src/overlay-tools/LookupResolver.ts +10 -2
|
@@ -248,6 +248,7 @@ export interface KVStoreQuery {
|
|
|
248
248
|
controller?: PubKeyHex;
|
|
249
249
|
protocolID?: WalletProtocol;
|
|
250
250
|
tags?: string[];
|
|
251
|
+
tagQueryMode?: "all" | "any";
|
|
251
252
|
limit?: number;
|
|
252
253
|
skip?: number;
|
|
253
254
|
sortOrder?: "asc" | "desc";
|
|
@@ -256,6 +257,16 @@ export interface KVStoreQuery {
|
|
|
256
257
|
|
|
257
258
|
See also: [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
258
259
|
|
|
260
|
+
#### Property tagQueryMode
|
|
261
|
+
|
|
262
|
+
Controls tag matching behavior when tags are specified.
|
|
263
|
+
- 'all': Requires all specified tags to be present (default)
|
|
264
|
+
- 'any': Requires at least one of the specified tags to be present
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
tagQueryMode?: "all" | "any"
|
|
268
|
+
```
|
|
269
|
+
|
|
259
270
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
260
271
|
|
|
261
272
|
---
|
package/package.json
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import { AuthMessage, RequestedCertificateSet, Transport } from '../types.js'
|
|
4
4
|
import * as Utils from '../../primitives/utils.js'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const defaultFetch: typeof fetch =
|
|
7
|
+
typeof globalThis !== 'undefined' && typeof globalThis.fetch === 'function'
|
|
8
|
+
? globalThis.fetch.bind(globalThis)
|
|
9
|
+
: fetch
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Implements an HTTP-specific transport for handling Peer mutual authentication messages.
|
|
@@ -21,6 +23,12 @@ export class SimplifiedFetchTransport implements Transport {
|
|
|
21
23
|
* @param fetchClient - A fetch implementation to use for HTTP requests (default: global fetch).
|
|
22
24
|
*/
|
|
23
25
|
constructor (baseUrl: string, fetchClient = defaultFetch) {
|
|
26
|
+
if (typeof fetchClient !== 'function') {
|
|
27
|
+
throw new Error(
|
|
28
|
+
'SimplifiedFetchTransport requires a fetch implementation. ' +
|
|
29
|
+
'In environments without fetch, provide a polyfill or custom implementation.'
|
|
30
|
+
)
|
|
31
|
+
}
|
|
24
32
|
this.fetchClient = fetchClient
|
|
25
33
|
this.baseUrl = baseUrl
|
|
26
34
|
}
|
|
@@ -2,8 +2,10 @@ import { Transaction } from '../transaction/index.js'
|
|
|
2
2
|
import OverlayAdminTokenTemplate from './OverlayAdminTokenTemplate.js'
|
|
3
3
|
import * as Utils from '../primitives/utils.js'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const defaultFetch: typeof fetch =
|
|
6
|
+
typeof globalThis !== 'undefined' && typeof globalThis.fetch === 'function'
|
|
7
|
+
? globalThis.fetch.bind(globalThis)
|
|
8
|
+
: fetch
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* The question asked to the Overlay Services Engine when a consumer of state wishes to look up information.
|
|
@@ -113,6 +115,12 @@ export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
|
|
|
113
115
|
allowHTTP: boolean
|
|
114
116
|
|
|
115
117
|
constructor (httpClient = defaultFetch, allowHTTP: boolean = false) {
|
|
118
|
+
if (typeof httpClient !== 'function') {
|
|
119
|
+
throw new Error(
|
|
120
|
+
'HTTPSOverlayLookupFacilitator requires a fetch implementation. ' +
|
|
121
|
+
'In environments without fetch, provide a polyfill or custom implementation.'
|
|
122
|
+
)
|
|
123
|
+
}
|
|
116
124
|
this.fetchClient = httpClient
|
|
117
125
|
this.allowHTTP = allowHTTP
|
|
118
126
|
}
|