Home Manual Reference Source
public class | source

Proofs

Extends:

API → Proofs

Member Summary

Public Members
public

The Proofs Owners API.

Method Summary

Public Methods
public

archive(proofId: string): Promise

Manually archives a proof.

public

create(options: object): Promise<Proof>

Creates a proof, with the ability of assigning a workflow and a file.

public

delete(proofId: string): Promise

Deletes a proof from PageProof (permanently).

public

setFile(proofId: string, fileId: string): Promise

Assigns a file to a proof.

public

setWorkflow(proofId: string, workflowId: string): Promise

Assigns a workflow to a proof.

public

start(proofId: strings): Promise

Starts a proof.

public

unarchive(proofId: string): Promise

Un-archives a previously (manually) archived proof.

Inherited Summary

From class API
public

Public Members

public owners: ProofsOwners source

The Proofs Owners API.

Public Methods

public archive(proofId: string): Promise source

Manually archives a proof. This action hides the proof from all user's who have access to it, but can still be found by manually searching for it (by name), or by calling Dashboard.archived.

Params:

NameTypeAttributeDescription
proofId string

The id of the proof to archive

Return:

Promise

public create(options: object): Promise<Proof> source

Creates a proof, with the ability of assigning a workflow and a file.

Does not handle uploading the file or attaching a workflow, you must use the Files and Workflows API (respectively) and pass the results to this method. See examples below.

By default the proof will be sent out to the reviewers who need to see it, once the file has finished processing, and when a workflow has been attached to it. If you wish to defer the proof starting until a later stage, you can set the start option to false. This requires you to call {@see Proofs.start}.

Params:

NameTypeAttributeDescription
options object

The options

options.name string

The name of the proof

options.tags Array<string>
  • optional

The tags to add to the proof (defaults to no tags)

options.dueDate Date
  • optional
  • default: +3 days

The due date of the proof (defaults to 3 days in the future)

options.messageToReviewers string
  • optional

The message to reviewers

options.workflow Workflow
  • optional

The workflow instance (not template) (can be omitted if deferring workflow creation)

options.workflow.id string
  • optional

The workflow id to assign to the proof

options.file File
  • optional

The proof file (can be omitted if deferring file uploading)

options.file.id string
  • optional

The file id to assign to the proof

options.start boolean
  • optional
  • default: true

Whether to immediately start the proof (sends invitation emails to reviewers in the workflow)

Return:

Promise<Proof>

Example:

Creating a proof (without a workflow or file)
const proof = await client.proofs.create({
  name: 'My proof',
  tags: ['example', 'first'],
  messageToReviewers: 'Take a look at this proof!',
});
Create a proof and upload the file (without a workflow)
const proof = await client.proofs.create({
  name: 'Another proof',
  tags: ['example', 'second'],
  file: await client.files.upload({
    name: 'example.pdf',
    contents: file, // where `file` is the browser "File" or "Blob" object
  }),
});
Create a proof and attach a workflow (from template) (without file)
const proof = await client.proofs.create({
  name: 'Not another one?! Wow.',
  tags: ['example', 'another'],
  workflow: await client.workflows.use('WDLCTT14CPOPJN6Z'),
});
Create a proof with file and workflow (from template)
const proof = await client.proofs.create({
  name: 'A proper proof',
  tags: ['example', 'full'],
  messageToReviewers: 'You *must* take a look at this proof!',
  workflow: await client.workflows.use('WDLCTT14CPOPJN6Z'),
  file: await client.files.upload({
    name: 'image.png',
    contents: new Blob([image], {
      type: 'image/png',
    }),
  }),
});
Create a proof with file and workflow (created & saved as template)
const proof = await client.proofs.create({
  name: 'A brand new proof',
  tags: ['example', 'brand', 'new'],
  messageToReviewers: 'Forget the previous proof, this one rules!',
  workflow: await client.workflows.create({
    save: true, // saves the workflow as a template (requires a name)
    name: 'My example workflow',
    steps: [ <omitted> ],
    approver: <omitted>,
  }),
  file: await client.files.upload({
    name: 'image.png',
    contents: new Blob(<omitted>),
  }),
});

See:

public delete(proofId: string): Promise source

Deletes a proof from PageProof (permanently).

PageProof immediately schedules the proof to be deleted, when calling this method, ensure that there has been a decent amount of confirmation (either from the user), or however appropriate.

Params:

NameTypeAttributeDescription
proofId string

The id of the proof to delete

Return:

Promise

public setFile(proofId: string, fileId: string): Promise source

Assigns a file to a proof.

This method is usually not necessary, unless you defer uploading the file until a later stage. However it's recommended that you upload the file as soon as possible, to prevent orphans.

Params:

NameTypeAttributeDescription
proofId string

The proof id

fileId string

The file id

Return:

Promise

See:

public setWorkflow(proofId: string, workflowId: string): Promise source

Assigns a workflow to a proof.

Make sure you pass the correct type of workflow id before calling this method. If a workflow template id is passed, it will automatically convert the template into a workflow, meaning it will no longer be usable as a template.

Params:

NameTypeAttributeDescription
proofId string

The proof id to attach the workflow to

workflowId string

The workflow id

Return:

Promise

See:

public start(proofId: strings): Promise source

Starts a proof.

By default, creating a proof only creates a proof "shell". Only when the Proofs.start method, or Proofs.create's start option is true, will the proof be sent out to the proof's reviewers. Until then, the proof will sit in the owner(s) outbox.

Calling this method before the file has finished processing will tell PageProof to queue the delivery of any invitation emails etc... It's best to start the proof as early as possible to prevent is sitting in the outbox indefinitely.

Params:

NameTypeAttributeDescription
proofId strings

The id of the proof to start

Return:

Promise

public unarchive(proofId: string): Promise source

Un-archives a previously (manually) archived proof.

Params:

NameTypeAttributeDescription
proofId string

The id of the proof to un-archive

Return:

Promise

See: