in src/Worker.ts [328:355]
async getRecordIdAndLabelIdsFromCard() {
const client = await this.kintoneClientCreator.createKintoneClient([
this.apps.cards.token,
this.apps.labels.token,
]);
const cardInfo = await ApiExecutor.getRecordIdAndLabelIdsFromCard(
client,
this.apps.cards.id,
this.trelloAction.data
);
if (cardInfo === undefined) {
throw new Error("Card is no such exists");
}
const labelRecordId = await ApiExecutor.getRecordIdFromLabelOfSame(
client,
this.apps.labels.id,
this.trelloAction.data
);
if (labelRecordId === undefined) {
await ApiExecutor.createLabel(
client,
this.apps.labels.id,
this.trelloAction.data
);
}
return cardInfo;
}