new DataPackageMember()
Store one data package member's manifest, editable, and upload state.
- Since:
- Source:
Methods
addSources(sources) → {void}
Add manifest sources without duplicates.
Parameters:
| Name |
Type |
Description |
sources |
string
|
Array.<string>
|
Sources to add |
- Source:
Returns:
-
Type
-
void
Add information inferred from a rendered metadata document.
Parameters:
| Name |
Type |
Description |
viewInfo |
object
|
Plain entity summary from
ViewServiceDoc |
- Source:
Throws:
-
When the view information belongs to another PID
-
-
Type
-
Error
Returns:
This member
-
Type
-
DataPackageMember
Build fresh System Metadata for a create or content update.
Parameters:
| Name |
Type |
Attributes |
Description |
defaults |
object
|
<optional>
|
Values not already present on the member
Properties
| Name |
Type |
Attributes |
Description |
useBlobMediaType |
boolean
|
<optional>
|
Whether to infer mediaType
from generated Blob content |
|
desiredSystemMetadata |
SystemMetadata
|
object
|
<optional>
|
Prepared desired
values to use instead of the member's stored source baseline |
- Source:
Throws:
-
When object content is missing or empty
-
-
Type
-
Error
Returns:
Desired System Metadata
-
Type
-
Promise.<SystemMetadata>
Build an update limited to System Metadata from the confirmed remote
baseline.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
freshRemoteSysMeta |
SystemMetadata
|
<optional>
|
null
|
Fresh preflight baseline |
- Source:
Throws:
-
When remote or desired system metadata is missing
-
-
Type
-
Error
Returns:
Desired System Metadata
-
Type
-
SystemMetadata
checkPermission(actionopt, optionsopt, authorizationServiceopt) → {Promise.<boolean>}
Check the current user's permission for this member. Results are cached
in memory on the member, keyed by user subject.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
action |
string
|
<optional>
|
write
|
Permission action. Defaults to "write" |
options |
object
|
boolean
|
<optional>
|
|
Options or refresh boolean
Properties
| Name |
Type |
Attributes |
Description |
refresh |
boolean
|
<optional>
|
Whether to bypass the cache and check again |
signal |
AbortSignal
|
<optional>
|
Signal used to cancel permission checks |
|
authorizationService |
AuthorizationService
|
<optional>
|
|
Service used to
resolve the current user and check permission |
- Source:
Returns:
Permission result
-
Type
-
Promise.<boolean>
checkWritePermission(optionsopt, authorizationServiceopt) → {Promise.<boolean>}
Check write permission for the current user.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
options |
object
|
boolean
|
<optional>
|
|
Options or refresh boolean |
authorizationService |
AuthorizationService
|
<optional>
|
null
|
Service used to
resolve the current user and check permission |
- Source:
Returns:
Write permission result
-
Type
-
Promise.<boolean>
Build this member's typed metadata model and download its content. The
member already knows its formatId from the manifest, so the typed model
is constructed without a Solr round trip or ScienceMetadata→EML
"replace" handshake. The model is created unsynced so fetch population
is not trickled up as a user edit; it flips `synced` to true on its own
"sync" event.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Fetch options
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
Signal used to cancel fetches |
|
- Source:
Returns:
The fetched metadata model
-
Type
-
Promise.<(EML211|ScienceMetadata)>
fetchObject(optionsopt) → {Promise.<(object|null)>}
Download and parse this member's object into a typed model, stored on
`this.objectModel`:
- metadata → an EML211 (EML) or ScienceMetadata (other format) model
- resourceMap → a ResourceMap model
- data/unknown → no model (data is fetched on demand for preview/download)
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Fetch options
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
Signal used to cancel downloads |
objectService |
ObjectService
|
<optional>
|
Service used to download a
Resource Map |
resolveServiceUrl |
string
|
<optional>
|
Resolver URL for Resource Map
identities, overriding the ObjectService setting |
|
- Source:
Returns:
The parsed object model, or null
-
Type
-
Promise.<(object|null)>
Download system metadata and update this member's remote baseline.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Download and service options
Properties
| Name |
Type |
Attributes |
Description |
sysMetaService |
SysMetaService
|
<optional>
|
Service instance |
sysMetaServiceOptions |
object
|
<optional>
|
Service constructor options |
|
- Source:
Returns:
Downloaded system metadata
-
Type
-
Promise.<SystemMetadata>
getFileName() → {string|null}
Return the best available member file name.
- Source:
Returns:
File name, or null
-
Type
-
string
|
null
Return the member's object format identifier.
- Source:
Returns:
Format identifier, or null
-
Type
-
string
|
null
Collect the format fields used for object format classification.
- Source:
Returns:
Format fields
-
Type
-
Object
Return the member's DataONE format type.
- Source:
Returns:
Format type, or null when unknown
-
Type
-
string
|
null
getRequiredOperation() → {string}
Return the remote operation required by the member's dirty state.
- Source:
Returns:
Required operation
-
Type
-
string
Return the fields used to verify an ambiguous object write: enough to
confirm the target PID exists with the intended bytes.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Verification options
Properties
| Name |
Type |
Attributes |
Description |
includeMutableFields |
boolean
|
<optional>
|
Include mutable fields |
|
- Source:
Returns:
Verification fields
-
Type
-
object
getXMLSafeID() → {string|null}
Convert this member's PID to the legacy XML-safe identifier form.
- Source:
Returns:
XML-safe identifier, or null for an empty PID
-
Type
-
string
|
null
initializeEditableState(stateopt) → {DataPackageMember}
Get the member ready for editing by initializing fields that are not set
by the manifest or Solr. It does not overwrite existing editable state.
Parameters:
| Name |
Type |
Attributes |
Description |
state |
object
|
<optional>
|
Editable state values |
- Source:
Returns:
This member
-
Type
-
DataPackageMember
isData() → {boolean}
Check whether the member is a data object.
- Source:
Returns:
Whether the member is data
-
Type
-
boolean
isEML() → {boolean}
Check whether the member uses an EML format.
- Source:
Returns:
Whether the member is EML
-
Type
-
boolean
isImage() → {boolean}
Check whether the member has a previewable image format.
- Source:
Returns:
Whether the member can use an image preview
-
Type
-
boolean
Check whether the member is science metadata.
- Source:
Returns:
Whether the member is metadata
-
Type
-
boolean
isPlaceholder() → {boolean}
Check whether the member is an index placeholder.
- Source:
Returns:
Whether the member is a placeholder
-
Type
-
boolean
isPublic(optionsopt) → {Promise.<(boolean|null)>}
Check whether the member's access policy is public.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Options forwarded to `fetchSysMeta` |
- Source:
Returns:
Public state, or null when unknown
-
Type
-
Promise.<(boolean|null)>
isResourceMap() → {boolean}
Check whether the member is a resource map.
- Source:
Returns:
Whether the member is a resource map
-
Type
-
boolean
markRemoteFailure(error, optionsopt) → {DataPackageMember}
Record a failed or ambiguous remote write.
Parameters:
| Name |
Type |
Attributes |
Description |
error |
Error
|
|
Write error |
options |
object
|
<optional>
|
Failure options
Properties
| Name |
Type |
Attributes |
Description |
ambiguous |
boolean
|
<optional>
|
Whether the write may have committed |
|
- Source:
Returns:
This member
-
Type
-
DataPackageMember
Record a confirmed remote write and clear local dirty state.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Confirmation details
Properties
| Name |
Type |
Attributes |
Description |
pid |
string
|
<optional>
|
Confirmed remote PID |
response |
object
|
<optional>
|
DataONE write response |
sysMeta |
SystemMetadata
|
object
|
<optional>
|
Confirmed system metadata |
|
- Source:
Throws:
-
When the confirmed PID is missing or does not match
-
-
Type
-
Error
Returns:
This member
-
Type
-
DataPackageMember
Mark the member's remote write as in progress.
- Source:
Returns:
This member
-
Type
-
DataPackageMember
Mark the member for removal from the package.
- Source:
Returns:
This member
-
Type
-
DataPackageMember
Merge enrichment data without overwriting editable lifecycle state.
Parameters:
- Source:
Throws:
-
When the incoming member has a different PID
-
-
Type
-
Error
Returns:
This member
-
Type
-
DataPackageMember
Align the aggregated PID with confirmed remote state.
- Source:
Throws:
-
When an active member is not confirmed remote
-
-
Type
-
Error
Returns:
This member
-
Type
-
DataPackageMember
serializeContent(optionsopt) → {Promise.<(Blob|string)>}
Serialize the member's desired object content for upload. Cached upload
bytes are returned as is so the payload matches the computed checksum;
otherwise the attached object model is serialized at the desired PID.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Serialization options
Properties
| Name |
Type |
Attributes |
Description |
pid |
string
|
<optional>
|
Desired PID to embed (for example, an EML
packageId) |
|
- Source:
Throws:
-
When the member has no serializable content
-
-
Type
-
Error
Returns:
Serialized content
-
Type
-
Promise.<(Blob|string)>
Serialize desired System Metadata for upload.
- Source:
Throws:
-
When system metadata is missing
-
-
Type
-
Error
Returns:
Canonical System Metadata XML
-
Type
-
string
Change the PID desired by the editable package without changing the
confirmed remote or last aggregated PID.
Parameters:
| Name |
Type |
Description |
pid |
string
|
Desired PID |
- Source:
Throws:
-
When an ambiguous remote write is unresolved
-
-
Type
-
Error
Returns:
This member
-
Type
-
DataPackageMember
Attach desired object bytes.
Parameters:
| Name |
Type |
Description |
file |
Blob
|
File
|
File or Blob to upload |
- Source:
Throws:
-
When the write is ambiguous or the file is invalid
-
-
Type
-
Error
Returns:
This member
-
Type
-
DataPackageMember
Inject the loaded ObjectFormats collection so this member can classify
its format type synchronously. Excluded from toJSON()/merge() so the
collection is never serialized or copied between members.
Parameters:
| Name |
Type |
Description |
objectFormats |
ObjectFormats
|
Loaded ObjectFormats collection |
- Source:
Returns:
This member
-
Type
-
DataPackageMember
Set desired System Metadata.
Parameters:
| Name |
Type |
Attributes |
Description |
sysMeta |
SystemMetadata
|
object
|
null
|
|
Desired System Metadata |
options |
object
|
<optional>
|
Update options
Properties
| Name |
Type |
Attributes |
Description |
markDirty |
boolean
|
<optional>
|
Whether this is a local edit |
|
- Source:
Throws:
-
When an ambiguous remote write is unresolved
-
-
Type
-
Error
Returns:
This member
-
Type
-
DataPackageMember
toJSON() → {object}
Serialize member state without runtime services, models, or upload bytes.
- Source:
Returns:
Serializable member state
-
Type
-
object
validateContent() → {Array.<object>}
Validate the member's desired object content before upload.
- Source:
Returns:
Validation issues (empty when valid)
-
Type
-
Array.<object>
Return a member instance for a member or plain object.
Parameters:
| Name |
Type |
Attributes |
Description |
value |
DataPackageMember
|
object
|
<optional>
|
Member value |
options |
object
|
<optional>
|
Conversion options
Properties
| Name |
Type |
Attributes |
Description |
sources |
Array.<string>
|
<optional>
|
Manifest sources to add |
|
- Source:
Returns:
Member instance
-
Type
-
DataPackageMember
normalizeViewInfo(viewInfoopt) → {object}
Normalize a rendered metadata entity summary for matching and merging.
Identifiers follow the same conventions as
ViewServiceDoc so the
summary can be matched against member PIDs.
Parameters:
| Name |
Type |
Attributes |
Description |
viewInfo |
object
|
<optional>
|
Entity summary from ViewServiceDoc |
- Source:
Returns:
Normalized summary with a normalized `pid` (or null)
-
Type
-
object
validateLocalFile(file) → {Blob|File}
Validate file content before allocating identifiers or editing state.
Parameters:
| Name |
Type |
Description |
file |
Blob
|
File
|
File or Blob to validate |
- Source:
Throws:
-
When the value is not a non empty Blob or File
-
-
Type
-
Error
Returns:
Validated file
-
Type
-
Blob
|
File