This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ส่วนข้อความขึ้นต้น Task List | |
const changeHead = (boardName: string, changeDate: string) => ([ | |
{ | |
"type": "text", | |
"text": `ข้อมูล Change ของ ${boardName} ณ.วันที่ ${changeDate}`, | |
"size": "xs", | |
"color": "#8C8C8C", | |
}, | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const webhookLINE = functions.region(REGION).https.onRequest( async(req, res) => { | |
console.log('🚀 Start Webhook!!', JSON.stringify(req.body) ) | |
if(!req.body.events) { res.status(200).end()} | |
const event = req.body.events[0] | |
if(typeof(event) === 'undefined') { res.status(200).end()} | |
try { | |
await util_line.verify_signature(req, res) | |
let replyMessage: any = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ส่วน Carousel | |
const boardMain = (boardItems: any) => ([{ | |
"type": "flex", | |
"altText": "My Board", | |
"contents": { | |
"type": "carousel", | |
"contents": boardItems, | |
}, | |
}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"model": { | |
"name": "Test", | |
"id": "5e9460..........cbab52c1", | |
}, | |
"action": { | |
"appCreator": null, | |
"data": { | |
"card": { | |
"name": "card2", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const webhookTrello = functions.region(REGION).https.onRequest( async(req, res) => { | |
const action = req.body.action | |
if(action && action.display.translationKey !== 'unknown') { | |
const data = { | |
action: action, | |
changeTime: Date.now() + 25200000, | |
} | |
const board = action.data.board | |
board.changeTime = Date.now() + 25200000 | |
await firestore.collection('board').doc(action.data.board.id).set(board) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "bubble", | |
"size": "giga", | |
"body": { | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ | |
{ | |
"type": "box", | |
"layout": "vertical", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as functions from 'firebase-functions'; | |
import * as admin from 'firebase-admin'; | |
admin.initializeApp(); | |
const db = admin.firestore(); | |
// Start writing Firebase Functions | |
// https://firebase.google.com/docs/functions/typescript | |
export const helloWorld = functions.https.onRequest((request, response) => { | |
functions.logger.info("Hello logs!", {structuredData: true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"fields": [ | |
{ | |
"fields": [ | |
{ | |
"name": "id", | |
"type": "string" | |
}, | |
{ | |
"name": "text", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const REGION = "asia-northeast1" | |
import * as functions from 'firebase-functions' | |
exports.importInsight = functions.region(REGION).pubsub.schedule('every 10 minutes').onRun((context) => { | |
}) |