Performs a DOIP operation using a DoipRequest object.
The DOIP request to perform
Optional
options: OptionsOptional request options for this operation
A promise that resolves to a DoipResponse. The caller is responsible for closing the DoipResponse.
Performs a DOIP operation by specifying the target ID, operation ID, and optional input.
The ID of the target digital object or service
The ID of the operation to perform
Optional
input: Optional input for the operation
Optional
options: OptionsOptional request options for this operation
A promise that resolves to a DoipResponse. The caller is responsible for closing the DoipResponse.
Closes the client and releases any resources.
Determines the ID for a service, based on the options given.
If options
does not specify a service ID, there may be a client default.
Defaults to service
if no other info is specified.
Optional
options: OptionsOptional request options
The ID for the service
Sends a hello request to the service to get information about the service and verify connectivity.
Optional
options: OptionsOptional request options
A promise that resolves to a DigitalObject containing information about the service
DoipError for error responses
Retrieves a digital object by ID.
The ID of the digital object to retrieve
Optional
options: OptionsOptional request options
A promise that resolves to the retrieved DigitalObject, or null if not found
DoipError for error responses
Retrieves a list of operations that can be performed on the specified target.
The ID of the target digital object or service
Optional
options: OptionsOptional request options
A promise that resolves to an array of operation IDs
DoipError for error responses
Searches for digital objects matching the specified query and returns only their IDs.
The search query
Optional
params: QueryParamsOptional query parameters
Optional
options: OptionsOptional request options
A promise that resolves to SearchResults which among other properties is an async iterable iterator of digital object IDs The caller is responsible for closing the SearchResults.
DoipError for error responses
Searches for digital objects matching the specified query and returns the complete digital objects.
The search query
Optional
params: QueryParamsOptional query parameters
Optional
options: OptionsOptional request options
A promise that resolves to SearchResults which among other properties is an async iterable iterator of digital objects. The caller is responsible for closing the SearchResults.
DoipError for error responses
Retrieves the body of a specific element of a digital object by its ID.
The ID of the digital object
The ID of the element to retrieve
Optional
options: OptionsOptional request options
A promise that resolves to the element body, or null if not found
DoipError for error responses
// Get the bytes of a binary element payload
const elementBody = await client.retrieveElementBytes('20.500.123/1', 'attachment-binary');
if (elementBody) {
const buffer = await elementBody.arrayBuffer();
const bytes = new Uint8Array(buffer);
console.log(`length: ${bytes.length}`);
// process bytes
}
// Get text from a text element body
const elementBody = await client.retrieveElementBytes('20.500.123/1', 'attachment-text');
if (elementBody) {
const text = await elementBody.text();
console.log(text);
}
Retrieves a specific byte range of an element of a digital object.
The ID of the digital object
The ID of the element to retrieve
The starting byte position (inclusive)
The ending byte position (inclusive)
Optional
options: OptionsOptional request options
A promise that resolves to the partial element body, or null if not found
DoipError for error responses
// Retrieve the first 1000 bytes of a binary element body
const elementBody = await client.retrievePartialElementBytes('20.500.123/1', 'attachment-binary', 0, 999);
if (elementBody) {
const buffer = await elementBody.arrayBuffer();
const bytes = new Uint8Array(buffer);
console.log(`length: ${bytes.length}`);
}
// Retrieve bytes from the middle of a text element body
const elementBody = await client.retrievePartialElementBytes('20.500.123/1', 'text', 2, 5);
if (elementBody) {
console.log(await elementBody.text());
}
Creates a new digital object.
The digital object to create
Optional
options: OptionsOptional request options
A promise that resolves to the created digital object
DoipError for error responses
Updates an existing digital object.
The digital object to update
Optional
options: OptionsOptional request options
A promise that resolves to the updated digital object
DoipError for error responses
Interface for a client used to communicate with a DOIP service. It handles operations like retrieving, creating, updating, and deleting digital objects, as well as searching and other DOIP operations. All operations are accessible through performOperation; other methods are provided for convenience.