Interface: IImportService
Defined in: src/types/interfaces/plugin.interface.ts:1158
Import service interface for tracking imported preprints.
Remarks
Manages the AppView cache of imported preprints. All data is rebuildable from external sources (ATProto compliant).
Since
0.1.0
Methods
create()
create(
data):Promise<ImportedPreprint>
Defined in: src/types/interfaces/plugin.interface.ts:1191
Creates a new imported preprint.
Parameters
data
Import data
abstract
string
authors
readonly ExternalAuthor[]
categories
readonly string[]
doi
string
externalId
string
externalUrl
string
importedByPlugin
string
metadata
Record<string, unknown>
pdfUrl
string
publicationDate
Date
source
string
title
string
Returns
Promise<ImportedPreprint>
Created imported preprint
exists()
exists(
source,externalId):Promise<boolean>
Defined in: src/types/interfaces/plugin.interface.ts:1166
Checks if a preprint has been imported.
Parameters
source
string
External source
externalId
string
Source-specific ID
Returns
Promise<boolean>
True if already imported
get()
get(
source,externalId):Promise<null|ImportedPreprint>
Defined in: src/types/interfaces/plugin.interface.ts:1175
Gets an imported preprint by source and ID.
Parameters
source
string
External source
externalId
string
Source-specific ID
Returns
Promise<null | ImportedPreprint>
Imported preprint or null
getById()
getById(
id):Promise<null|ImportedPreprint>
Defined in: src/types/interfaces/plugin.interface.ts:1183
Gets an imported preprint by internal ID.
Parameters
id
number
Internal database ID
Returns
Promise<null | ImportedPreprint>
Imported preprint or null
markClaimed()
markClaimed(
id,canonicalUri,claimedByDid):Promise<void>
Defined in: src/types/interfaces/plugin.interface.ts:1253
Marks a preprint as claimed.
Parameters
id
number
Internal database ID
canonicalUri
string
AT-URI of user's canonical record
claimedByDid
string
DID of claiming user
Returns
Promise<void>
search()
search(
options):Promise<{cursor:string;preprints:ImportedPreprint[]; }>
Defined in: src/types/interfaces/plugin.interface.ts:1236
Searches imported preprints.
Parameters
options
Search options
authorName
string
authorOrcid
string
claimStatus
"pending" | "unclaimed" | "claimed"
cursor
string
limit
number
query
string
source
string
Returns
Promise<{ cursor: string; preprints: ImportedPreprint[]; }>
Matching preprints with cursor
update()
update(
id,data):Promise<ImportedPreprint>
Defined in: src/types/interfaces/plugin.interface.ts:1213
Updates an imported preprint.
Parameters
id
number
Internal database ID
data
Partial<{ abstract: string; authors: readonly ExternalAuthor[]; canonicalUri: string; claimedAt: Date; claimedByDid: string; claimStatus: "pending" | "unclaimed" | "claimed"; doi: string; lastSyncedAt: Date; pdfUrl: string; syncStatus: "active" | "stale" | "unavailable"; title: string; }>
Fields to update
Returns
Promise<ImportedPreprint>
Updated imported preprint