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

createDatabase

createGrant

createIdentity

createPermission

deleteApp

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

    Returns Promise<void>

deleteClient

  • Parameters

    Returns Promise<void>

deleteDatabase

  • 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>

getDatabase

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>>

getEscrowedAsset

  • Returns information about an asset held by the escrow identity.

    Parameters

    Returns Promise<EscrowedAsset>

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>

getQuota

  • Gets your monthly API usage quota limits.

    Returns Promise<MeteringQuota>

getToken

  • Returns information about a token.

    Parameters

    Returns Promise<Token>

getTokenBalance

  • Returns the amount of the token held by the identity.

    Parameters

    Returns Promise<TokenBalance>

getTransferReceipt

getUsage

  • getUsage(filter?: Partial<{ after: Date; before: Date }>): Promise<MeteringReport>
  • Gets a metering report for your API usage.

    Parameters

    • Optional filter: Partial<{ after: Date; before: Date }>

      Controls API usage window.

    Returns Promise<MeteringReport>

insertRows

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>>

listDatabases

  • listDatabases(params: Partial<{ name?: string; owner?: IdentityId }> & Partial<{ pageSize: number; pageToken: string }>): Promise<Page<Database>>
  • Parameters

    • params: Partial<{ name?: string; owner?: IdentityId }> & Partial<{ pageSize: number; pageToken: string }>

    Returns Promise<Page<Database>>

listGrants

  • Parameters

    • Optional filter: ListGrantsFilter & 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>>

mintToken

queryDatabase

searchDocuments

  • Parameters

    Returns Promise<Page<Document>>

searchEscrowedAssets

  • Returns information about an asset held by the escrow identity.

    Parameters

    Returns Promise<Page<EscrowedAsset>>

searchTokens

  • Parameters

    • Optional filter: TokenSearchParams & Partial<{ pageSize: number; pageToken: string }>

    Returns Promise<Page<Token>>

setQuota

  • setQuota(params: Partial<{ accessedBytesLimit: number; apiCallsLimit: number; computeMsecLimit: number }>): Promise<MeteringQuota>
  • Updates your monthly API usage quota limits.

    Parameters

    • params: Partial<{ accessedBytesLimit: number; apiCallsLimit: number; computeMsecLimit: number }>

      Specifies monthly quota limits to enforce until you change them again.

    Returns Promise<MeteringQuota>

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>

transferToken

updateApp

updateClient

updateDatabase

updateDocument

uploadDocument

Generated using TypeDoc