Options
All
  • Public
  • Public/Protected
  • All
Menu

Example:

import Parcel from '@oasislabs/parcel';
const parcel = new Parcel({
  clientId: serviceClientId,
  privateKey: serviceClientPrivateKey,
});
console.log(await parcel.searchDocuments());

Hierarchy

  • Parcel

Index

Constructors

constructor

  • new Parcel(tokenSource: TokenSource, config?: Partial<{ apiUrl: string; httpClientConfig: Options; storageUrl: string }>): Parcel
  • Parameters

    • tokenSource: TokenSource
    • Optional config: Partial<{ apiUrl: string; httpClientConfig: Options; storageUrl: string }>

    Returns Parcel

Properties

Private Readonly client

client: HttpClient

Private Optional currentIdentity

currentIdentity: Identity

Accessors

apiUrl

  • get apiUrl(): string
  • Returns string

Methods

createApp

createClient

createGrant

createIdentity

createPermission

deleteApp

  • deleteApp(id: AppId): Promise<void>
  • Parameters

    Returns Promise<void>

deleteClient

  • Parameters

    Returns Promise<void>

deleteDocument

  • Parameters

    Returns Promise<void>

deleteGrant

  • deleteGrant(id: GrantId): Promise<void>
  • Parameters

    Returns Promise<void>

deletePermission

  • Parameters

    Returns Promise<void>

downloadDocument

getApp

  • Parameters

    Returns Promise<App>

getClient

  • Parameters

    Returns Promise<Client>

getCurrentIdentity

  • getCurrentIdentity(): Promise<Identity>
  • Returns Promise<Identity>

getDocument

getDocumentHistory

  • getDocumentHistory(id: DocumentId, filter?: Partial<{ accessor: IdentityId; after: Date; before: Date }> & Partial<{ pageSize: number; pageToken: string }>): Promise<Page<AccessEvent>>
  • Parameters

    • id: DocumentId
    • Optional filter: Partial<{ accessor: IdentityId; after: Date; before: Date }> & Partial<{ pageSize: number; pageToken: string }>

    Returns Promise<Page<AccessEvent>>

getGrant

  • Parameters

    Returns Promise<Grant>

getJob

  • Returns the full description of a known job, including its status.

    Parameters

    Returns Promise<Job>

getJobStatus

  • Returns the status of the job. This method is faster than getJob() and throws if the job status is unknown. This makes it well suited for status polling.

    Parameters

    Returns Promise<JobStatusReport>

listApps

  • Parameters

    • Optional filter: Partial<{ owner: IdentityId; participation: AppParticipation }> & Partial<{ pageSize: number; pageToken: string }>

    Returns Promise<Page<App>>

listClients

  • listClients(appId: AppId, filter?: Partial<{ appId: AppId; creator: IdentityId }> & Partial<{ pageSize: number; pageToken: string }>): Promise<Page<Client>>
  • Parameters

    • appId: AppId
    • Optional filter: Partial<{ appId: AppId; creator: IdentityId }> & Partial<{ pageSize: number; pageToken: string }>

    Returns Promise<Page<Client>>

listGrants

  • listGrants(filter?: Partial<{ grantee?: IdentityId; granter?: IdentityId }> & Partial<{ pageSize: number; pageToken: string }>): Promise<Page<Grant>>
  • Parameters

    • Optional filter: Partial<{ grantee?: IdentityId; granter?: IdentityId }> & Partial<{ pageSize: number; pageToken: string }>

    Returns Promise<Page<Grant>>

listJobs

  • listJobs(filter?: ListJobsFilter & Partial<{ pageSize: number; pageToken: string }>): Promise<Page<Job>>
  • Lists all known jobs visible to the current user.

    result

    Job Lists known jobs. Includes recently completed jobs.

    Parameters

    • filter: ListJobsFilter & Partial<{ pageSize: number; pageToken: string }> = {}

      Controls pagination.

    Returns Promise<Page<Job>>

listPermissions

  • listPermissions(appId: AppId, filter?: Partial<{ pageSize: number; pageToken: string }>): Promise<Page<Permission>>
  • Parameters

    • appId: AppId
    • Optional filter: Partial<{ pageSize: number; pageToken: string }>

    Returns Promise<Page<Permission>>

searchDocuments

  • Parameters

    Returns Promise<Page<Document>>

submitJob

  • Enqueues a new job.

    result

    Job The new job, including a newly-assigned ID.

    Parameters

    • spec: JobSpec

      Specification for the job to enqueue.

    Returns Promise<Job>

terminateJob

  • terminateJob(jobId: JobId): Promise<void>
  • Schedules the job for eventual termination/deletion. The job will be terminated at some point in the future on a best-effort basis. It is not an error to request to terminate an already-terminated or non-existing job.

    Parameters

    • jobId: JobId

      The unique identifier of the job.

    Returns Promise<void>

updateApp

updateClient

updateDocument

uploadDocument

Generated using TypeDoc