Proofs
Extends:
Member Summary
Public Members | ||
public |
The Proofs Owners API. |
Method Summary
Public Methods | ||
public |
Manually archives a proof. |
|
public |
Creates a proof, with the ability of assigning a workflow and a file. |
|
public |
Deletes a proof from PageProof (permanently). |
|
public |
Assigns a file to a proof. |
|
public |
setWorkflow(proofId: string, workflowId: string): Promise Assigns a workflow to a proof. |
|
public |
Starts a proof. |
|
public |
Un-archives a previously (manually) archived proof. |
Public Members
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:
Name | Type | Attribute | Description |
proofId | string | The id of the proof to archive |
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:
Name | Type | Attribute | Description |
options | object | The options |
|
options.name | string | The name of the proof |
|
options.tags | Array<string> |
|
The tags to add to the proof (defaults to no tags) |
options.dueDate | Date |
|
The due date of the proof (defaults to 3 days in the future) |
options.messageToReviewers | string |
|
The message to reviewers |
options.workflow | Workflow |
|
The workflow instance (not template) (can be omitted if deferring workflow creation) |
options.workflow.id | string |
|
The workflow id to assign to the proof |
options.file | File |
|
The proof file (can be omitted if deferring file uploading) |
options.file.id | string |
|
The file id to assign to the proof |
options.start | boolean |
|
Whether to immediately start the proof (sends invitation emails to reviewers in the workflow) |
Example:
const proof = await client.proofs.create({
name: 'My proof',
tags: ['example', 'first'],
messageToReviewers: 'Take a look at this proof!',
});
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
}),
});
const proof = await client.proofs.create({
name: 'Not another one?! Wow.',
tags: ['example', 'another'],
workflow: await client.workflows.use('WDLCTT14CPOPJN6Z'),
});
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',
}),
}),
});
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:
Name | Type | Attribute | Description |
proofId | string | The id of the proof to delete |
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.
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.
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:
Name | Type | Attribute | Description |
proofId | strings | The id of the proof to start |