Skip to content

Commit f3aeccf

Browse files
authored
Expose AttachmentType enum (#36)
* Expose AttachmentType enum * add changeset * rename file * Include actual change πŸ™ƒ
1 parent 2736ad0 commit f3aeccf

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@team-plain/typescript-sdk': minor
3+
---
4+
5+
Expose `AttachmentType` for use when creating attachment upload urls
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { AttachmentType, PlainClient } from '../';
2+
3+
export async function createAttachmentUploadUrl() {
4+
const client = new PlainClient({ apiKey: 'XXX' });
5+
6+
const res = await client.createAttachmentUploadUrl({
7+
customerId: 'c_XXXXXXXXXXXXXXXXXXXXXXXXXX',
8+
fileName: 'the-filename.jpeg',
9+
fileSizeBytes: 32318,
10+
attachmentType: AttachmentType.CustomTimelineEntry,
11+
});
12+
13+
if (res.error) {
14+
console.error(res.error);
15+
} else {
16+
console.log(`Attachment upload url created!`, res.data);
17+
}
18+
}

β€Žsrc/index.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export { PlainClient } from './client';
44

55
export {
66
// Enums
7+
AttachmentType,
78
ComponentBadgeColor,
89
ComponentDividerSpacingSize,
910
ComponentPlainTextColor,

0 commit comments

Comments
Β (0)