Skip to content

Instantly share code, notes, and snippets.

View urbanisierung's full-sized avatar
🚀
to the moon

Adam Urban urbanisierung

🚀
to the moon
View GitHub Profile
@urbanisierung
urbanisierung / restzeebe-topology.ts
Created December 3, 2020 18:38
Restzeebe: get status of Zeebe Cluster
const { ZBClient } = require('zeebe-node')
const zbc = new ZBClient({
camundaCloud: {
clientId: connectionInfo.clientId,
clientSecret: connectionInfo.clientSecret,
clusterId: connectionInfo.clusterId,
},
})
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'
import * as functions from 'firebase-functions'
import { v4 } from 'uuid'
import { Document } from '../types/Document.type'
import { StorageController } from './storage.controller'
const BASEURL = 'https://api.trello.com/1'
export enum TRELLO {
KEY = 'key',
import { StorageController } from '../storage.controller'
import { TrelloController } from '../trello.controller'
import { ZeebeController } from '../zeebe.controller'
export class TrelloWorkerController {
constructor(
private zeebeController: ZeebeController,
private store: StorageController,
) {}
const express = require('express')
import { NextFunction, Request, Response } from 'express'
import { StorageController } from '../../controller/storage.controller'
import { ZeebeController } from '../../controller/zeebe.controller'
import { TrelloBoardType } from '../../types/TrelloBoard.type'
import { Error, ErrorType } from '../../utils/Error'
export class TrelloWebhookRouter {
public router = express.Router({ mergeParams: true })
import { v4 } from 'uuid'
import { Document } from '../types/Document.type'
import { Mood, MoodRequest } from '../types/Mood.type'
import { User } from '../types/User.type'
import { Error, ErrorType } from '../utils/Error'
import { StorageController } from './storage.controller'
export class MoodController {
constructor(private store: StorageController) {}
const nodemailer = require('nodemailer')
import * as functions from 'firebase-functions'
import { User } from '../../types/User.type'
import { MoodController } from '../mood.controller'
import { StorageController } from '../storage.controller'
import { ZeebeController } from '../zeebe.controller'
const PORT = 465
export class MailWorkerController {
const express = require('express')
import { NextFunction, Request, Response } from 'express'
import { MoodController } from '../../controller/mood.controller'
import { StorageController } from '../../controller/storage.controller'
import { Error, ErrorType } from '../../utils/Error'
export class MoodRouter {
public router = express.Router({ mergeParams: true })
constructor(store: StorageController) {
import { IncomingWebhook } from '@slack/webhook'
import { ZeebeController } from '../zeebe.controller'
const SLACK_WEBHOOK_BASE = 'https://hooks.slack.com/services'
export class SlackWorkerController {
private webhook: IncomingWebhook | null = null
constructor(private zeebeController: ZeebeController) {}
@urbanisierung
urbanisierung / websiteshot.worker.ts
Created February 11, 2021 16:02
websiteshot.worker.ts
export class WebsiteshotWorker {
constructor(private zeebeController: ZeebeController) {}
public create() {
this.zeebeController.getZeebeClient().createWorker({
taskType: Worker.WEBSITESHOT_CREATE_JOB,
taskHandler: async (job: any, complete: any, worker: any) => {
const templateId = job.customHeaders.templateid;
if (!templateId) {
@urbanisierung
urbanisierung / bucket.worker.ts
Created February 11, 2021 16:13
bucket.worker.ts
export class BucketWorker {
constructor(private zeebeController: ZeebeController) {}
public create() {
this.zeebeController.getZeebeClient().createWorker({
taskType: Worker.AWS_BUCKET_UPLOAD,
taskHandler: async (job: any, complete: any, worker: any) => {
const jobId = job.variables.jobId;
if (!jobId) {
complete.failure('Job Id not found on process context: <jobId>');