Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silver-berries-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@team-plain/typescript-sdk': minor
---

Expose `AttachmentType` for use when creating attachment upload urls
18 changes: 18 additions & 0 deletions src/examples/createAttachmentUploadUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { AttachmentType, PlainClient } from '../';

export async function createAttachmentUploadUrl() {
const client = new PlainClient({ apiKey: 'XXX' });

const res = await client.createAttachmentUploadUrl({
customerId: 'c_XXXXXXXXXXXXXXXXXXXXXXXXXX',
fileName: 'the-filename.jpeg',
fileSizeBytes: 32318,
attachmentType: AttachmentType.CustomTimelineEntry,
});

if (res.error) {
console.error(res.error);
} else {
console.log(`Attachment upload url created!`, res.data);
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export { PlainClient } from './client';

export {
// Enums
AttachmentType,
ComponentBadgeColor,
ComponentDividerSpacingSize,
ComponentPlainTextColor,
Expand Down