File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @team-plain/typescript-sdk ' : minor
3+ ---
4+
5+ Expose ` AttachmentType ` for use when creating attachment upload urls
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ export { PlainClient } from './client';
44
55export {
66 // Enums
7+ AttachmentType ,
78 ComponentBadgeColor ,
89 ComponentDividerSpacingSize ,
910 ComponentPlainTextColor ,
You canβt perform that action at this time.
0 commit comments