SIGNL4 Alerting avatar
SIGNL4 Alerting
Try for free

No credit card required

View all Actors
SIGNL4 Alerting

SIGNL4 Alerting

roncz/signl4
Try for free

No credit card required

SIGNL4 notifies through persistent mobile push, SMS text and voice calls with acknowledgement, tracking and escalation. Integrated on-call duty and shift scheduling ensures the right people are alerted at the right time.

.actor/Dockerfile

1# Specify the base Docker image. You can read more about
2# the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images
3# You can also use any other image from Docker Hub.
4FROM apify/actor-node:18
5
6# Copy just package.json and package-lock.json
7# to speed up the build using Docker layer cache.
8COPY package*.json ./
9
10# Install NPM packages, skip optional and development dependencies to
11# keep the image small. Avoid logging too much and print the dependency
12# tree for debugging
13RUN npm --quiet set progress=false \
14    && npm install --omit=dev --omit=optional \
15    && echo "Installed NPM packages:" \
16    && (npm list --omit=dev --all || true) \
17    && echo "Node.js version:" \
18    && node --version \
19    && echo "NPM version:" \
20    && npm --version \
21    && rm -r ~/.npm
22
23# Next, copy the remaining files and directories with the source code.
24# Since we do this after NPM install, quick build will be really fast
25# for most source file changes.
26COPY . ./
27
28
29# Run the image.
30CMD npm start --silent

.actor/actor.json

1{
2    "actorSpecification": 1,
3    "name": "signl4",
4    "title": "SIGNL4 Alerting",
5    "description": "SIGNL4 notifies through persistent mobile push, SMS text and voice calls with acknowledgement, tracking and escalation. Integrated on-call duty and shift scheduling ensures the right people are alerted at the right time. SIGNL4 thus provides for an up to 10x faster and effective response to critical situations.",
6    "version": "0.1",
7    "meta": {
8        "templateId": "js-start"
9    },
10    "input": "./input_schema.json",
11    "dockerfile": "./Dockerfile"
12}

.actor/input_schema.json

1{
2    "title": "SIGNL4 Alerting",
3    "type": "object",
4    "schemaVersion": 1,
5    "properties": {
6        "secret": {
7            "title": "SIGNL4 Secret",
8            "type": "string",
9            "description": "SIGNL4 team or integration secret.",
10            "editor": "textfield",
11            "isSecret": true
12        },
13        "title": {
14            "title": "Title",
15            "type": "string",
16            "description": "Alert title.",
17            "editor": "textfield",
18            "prefill": "Alert from APIFY"
19        },
20        "message": {
21            "title": "Message",
22            "type": "string",
23            "description": "Alert message.",
24            "editor": "textfield",
25            "prefill": ""
26        },
27        "data": {
28            "title": "Data",
29            "type": "object",
30            "description": "Data in JSON format.",
31            "editor": "json"
32        }
33    },
34    "required": ["secret", "title"]
35}

src/main.js

1import axios from 'axios';
2
3import { Actor, log } from 'apify';
4
5await Actor.init();
6
7// Structure of input is defined in input_schema.json
8const input = await Actor.getInput();
9const { secret, title, message, data } = input;
10
11// Alert data
12var jsonData = JSON.stringify({
13    'Title': title,
14    'Message': message,
15    'Data': data,
16    'X-S4-SourceSystem': 'Apify'
17})
18
19try {
20    // SIGNL4 webhook URL
21    const res = await axios.post('https://connect.signl4.com/webhook/' + secret, jsonData, {
22        headers: {
23            'Content-Type': 'application/json'
24        }
25    });
26
27    // Result
28    log.info('Result: ' + JSON.stringify(res.data));
29
30    await Actor.setValue('OUTPUT', res.data);
31}
32catch (error) {
33
34    // Error
35    log.error(error);
36
37    await Actor.setValue('OUTPUT', error);
38}
39
40// Gracefully exit the Actor process
41await Actor.exit();

.dockerignore

1# configurations
2.idea
3
4# crawlee and apify storage folders
5apify_storage
6crawlee_storage
7storage
8
9# installed files
10node_modules
11
12# git folder
13.git

.gitignore

1# This file tells Git which files shouldn't be added to source control
2.DS_Store
3.idea
4dist
5node_modules
6apify_storage
7storage/*
8!storage/key_value_stores
9storage/key_value_stores/*
10!storage/key_value_stores/default
11storage/key_value_stores/default/*
12!storage/key_value_stores/default/INPUT.json

package.json

1{
2    "name": "js-scrape-single-page",
3    "version": "0.0.1",
4    "type": "module",
5    "description": "This is an example of an Apify actor.",
6    "engines": {
7        "node": ">=18.0.0"
8    },
9    "dependencies": {
10        "apify": "^3.1.10",
11        "axios": "^1.5.0",
12        "cheerio": "^1.0.0-rc.12"
13    },
14    "scripts": {
15        "start": "node ./src/main.js",
16        "test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1"
17    },
18    "author": "It's not you it's me",
19    "license": "ISC"
20}
Developer
Maintained by Community
Actor metrics
  • 1 monthly users
  • days response time
  • Created in Jan 2024
  • Modified 4 months ago