Bucket
Index
Properties
readonlyapi
The target API to send all underlying API calls to.
batchSize
The maximum size of query batches sent to the service. Must be greater than 0.
dpLib
The inner DoublePIR WASM client for this instance of the client.
optionalhint
The cached hint downloaded from a checklist-enabled bucket.
lib
The inner WASM client for this instance of the client.
metadata
The metadata of this bucket.
name
The name of this bucket.
scheme
The underlying PIR scheme to use to access this bucket.
optionalreadonlysecretSeed
The secret seed for this instance of the client, which can be saved and then later used to restore state.
optionaluuid
The public UUID of this client’s public parameters.
Methods
checkInclusion
Privately checks if the given key is in the checklist-enabled bucket. This method is only supported on special global buckets that are checklist-enabled. The
supportsChecklistInclusion()
method returns a boolean indicating support.Parameters
key: string
The key to privately check against the checklist.
Returns Promise<boolean>
clearEntireBucket
Clears the contents of the entire bucket, and all data inside of it. This action is permanent and irreversible.
Returns Promise<void>
deleteKey
Deletes the supplied key from the bucket.
Note that this does not remove the key from the Bloom filter, so subsequent calls to
privateIntersect
orprivateKeyIntersect
could still return this key.Parameters
key: string
The key to delete.
Returns Promise<void>
destroyEntireBucket
Destroys the entire bucket, and all data inside of it. This action is permanent and irreversible.
Returns Promise<void>
info
Gets information about this bucket from the service.
Returns Promise<any>
privateIntersect
Privately intersects the given set of keys with the keys in this bucket, returning the keys that intersected and their values. This is generally slower than a single private read.
No entity, including the Blyss service, should be able to determine which keys this method was called for.
The number of intersections could be determined by the Blyss service or a network observer.
Parameters
keys: string[]
The keys to privately intersect the value of.
retrieveValues: boolean = true
Returns Promise<any>
privateKeyIntersect
Privately intersects the given set of keys with the keys in this bucket, returning the keys that intersected. This is generally slower than a single private read.
No entity, including the Blyss service, should be able to determine which keys this method was called for.
Parameters
keys: string[]
The keys to privately intersect the value of.
Returns Promise<string[]>
privateRead
Privately reads the supplied key from the bucket, returning the value corresponding to the key.
No entity, including the Blyss service, should be able to determine which key this method was called for.
Parameters
key: string
The key to privately retrieve the value of.
Returns Promise<any>
rename
Renames this bucket, leaving all data and other bucket settings intact.
Parameters
newBucketName: string
Returns Promise<any>
setup
Prepares this bucket client for private reads.
This method will be called automatically by string), but clients may call it explicitly prior to make subsequent string) calls faster.
Can upload significant amounts of data (1-10 MB).
Parameters
optionaluuid: string
Optional previous UUID that the client should attempt to reuse, to avoid generating and uploading larger amounts of data.
Returns Promise<void>
supportsChecklistInclusion
Returns whether this bucket supports
checkInclusion()
Returns boolean
toSecretSeed
Serializes the state of the bucket client to a secret seed.
This secret seed is sensitive! It must stay local to the client to preserve query privacy.
Returns string
write
Make a write to this bucket.
Parameters
keyValuePairs: {}
An object containing the key-value pairs to write. Keys must be strings, and values may be any JSON-serializable value or a Uint8Array. The maximum size of a key is 1024 UTF-8 bytes.
Returns Promise<void>
staticinitialize
Initialize a client for a single existing Blyss bucket. You should not need to call this method directly. Instead, call
client.connect()
to connect to an existing bucket, orclient.create()
to create a new one.Parameters
api: Api
A target API to send all underlying API calls to.
name: string
The name of the bucket.
optionalsecretSeed: string
An optional secret seed to initialize the client with. A random one will be generated if not supplied.
Returns Promise<Bucket>
staticinitializeLocal
Initialize a client for a single existing Blyss bucket, connecting directly to it via a URL.
Parameters
url: string
A target bucket endpoint URL to send all underlying API calls to.
optionalsecretSeed: string
An optional secret seed to initialize the client with. A random one will be generated if not supplied.
Returns Promise<Bucket>
A client to a single Blyss bucket.
You should not need to construct this object directly. Instead, call
client.connect()
to connect to an existing bucket, orclient.create()
to create a new one.You can serialize and deserialize this object using
toSecretSeed()
andclient.connect(bucketName, secretSeed)
.