1+ import { axios } from "@pipedream/platform" ;
2+
13export default {
24 type : "app" ,
35 app : "mural" ,
4- propDefinitions : { } ,
6+ propDefinitions : {
7+ muralId : {
8+ type : "string" ,
9+ label : "Mural ID" ,
10+ description : "The ID of the Mural." ,
11+ required : true ,
12+ } ,
13+ stickyId : {
14+ type : "string" ,
15+ label : "Sticky ID" ,
16+ description : "The ID of the Sticky Note." ,
17+ required : true ,
18+ } ,
19+ stickyContent : {
20+ type : "string" ,
21+ label : "Sticky Content" ,
22+ description : "The content of the Sticky Note." ,
23+ optional : true ,
24+ } ,
25+ userId : {
26+ type : "string" ,
27+ label : "User ID" ,
28+ description : "The ID of the User." ,
29+ required : true ,
30+ } ,
31+ muralTitle : {
32+ type : "string" ,
33+ label : "Mural Title" ,
34+ description : "The title of the Mural." ,
35+ optional : true ,
36+ } ,
37+ workspaceId : {
38+ type : "string" ,
39+ label : "Workspace ID" ,
40+ description : "The ID of the Workspace." ,
41+ required : true ,
42+ } ,
43+ name : {
44+ type : "string" ,
45+ label : "Name" ,
46+ description : "The name of the Mural." ,
47+ required : true ,
48+ } ,
49+ description : {
50+ type : "string" ,
51+ label : "Description" ,
52+ description : "A short description of the Mural." ,
53+ optional : true ,
54+ } ,
55+ templateId : {
56+ type : "string" ,
57+ label : "Template ID" ,
58+ description : "The ID of a pre-existing design." ,
59+ optional : true ,
60+ } ,
61+ color : {
62+ type : "string" ,
63+ label : "Color" ,
64+ description : "The color of the Sticky Note." ,
65+ optional : true ,
66+ } ,
67+ position : {
68+ type : "string" ,
69+ label : "Position" ,
70+ description : "The position of the Sticky Note." ,
71+ optional : true ,
72+ } ,
73+ } ,
574 methods : {
6- // this.$auth contains connected account data
7- authKeys ( ) {
8- console . log ( Object . keys ( this . $auth ) ) ;
75+ _baseUrl ( ) {
76+ return "https://app.mural.co/api/public" ;
77+ } ,
78+ async _makeRequest ( opts = { } ) {
79+ const {
80+ $ = this , method = "GET" , path, headers, ...otherOpts
81+ } = opts ;
82+ return axios ( $ , {
83+ ...otherOpts ,
84+ method,
85+ url : this . _baseUrl ( ) + path ,
86+ headers : {
87+ ...headers ,
88+ Authorization : `Bearer ${ this . $auth . oauth_access_token } ` ,
89+ } ,
90+ } ) ;
91+ } ,
92+ async createMural ( opts = { } ) {
93+ return this . _makeRequest ( {
94+ method : "POST" ,
95+ path : "/v1/murals" ,
96+ ...opts ,
97+ } ) ;
98+ } ,
99+ async createSticky ( opts = { } ) {
100+ return this . _makeRequest ( {
101+ method : "POST" ,
102+ path : "/v1/murals/sticky" ,
103+ ...opts ,
104+ } ) ;
9105 } ,
10106 } ,
11- } ;
107+ } ;
0 commit comments