From adc79456df76901bbd93f4533573da10aca98b27 Mon Sep 17 00:00:00 2001 From: "sagar.takle" Date: Mon, 16 Aug 2021 14:01:24 +0530 Subject: [PATCH 1/5] Feat: new --- package.json | 22 ++++++++++++++++++++++ src/main.js | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 package.json create mode 100644 src/main.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..537f3ac --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "x-admin-logger", + "version": "1.0.0", + "description": "Logging utility for x-admin", + "main": "src/main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sagar-techjoomla/x-admin-logger.git" + }, + "keywords": [ + "logger" + ], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/sagar-techjoomla/x-admin-logger/issues" + }, + "homepage": "https://github.com/sagar-techjoomla/x-admin-logger#readme" +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..63aac29 --- /dev/null +++ b/src/main.js @@ -0,0 +1,21 @@ +import axios from 'axios'; + +const sendLog = async (msg, channelId) => { + const response = await axios({ + method: 'POST', + url: 'https://slack.com/api/chat.postMessage', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${process.env.SLACK_ADMIN_LOGGER_AUTH_TOKEN}`, + }, + data: { + channel: channelId, + text: msg, + }, + }); + + const responseObject = response.data; + return responseObject; +}; + +export default sendLog; From 3cc04ac74f21ce345aff0d3ef2b46dd2de2ce4e8 Mon Sep 17 00:00:00 2001 From: "sagar.takle" Date: Mon, 16 Aug 2021 14:51:23 +0530 Subject: [PATCH 2/5] version: "0.0.1" --- package.json | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 537f3ac..4fdb8a0 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,19 @@ { - "name": "x-admin-logger", - "version": "1.0.0", - "description": "Logging utility for x-admin", - "main": "src/main.js", + "name": "@samagra-x/x-admin-logger", + "version": "0.0.1", + "description": "A logging utility for *x-admin*, a low-code framework for building admin platforms", + "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", - "url": "git+https://github.com/sagar-techjoomla/x-admin-logger.git" + "url": "git+https://github.com/samagra-development/x-admin-logger.git" }, - "keywords": [ - "logger" - ], - "author": "", - "license": "ISC", + "author": "Bharat Kashyap", + "license": "MIT", "bugs": { - "url": "https://github.com/sagar-techjoomla/x-admin-logger/issues" + "url": "https://github.com/samagra-development/x-admin-logger/issues" }, - "homepage": "https://github.com/sagar-techjoomla/x-admin-logger#readme" -} + "homepage": "https://github.com/samagra-development/x-admin-logger#readme" +} \ No newline at end of file From 5f2e20771f1527f06b2a5161dd8fede1d2bf1ab6 Mon Sep 17 00:00:00 2001 From: "sagar.takle" Date: Tue, 17 Aug 2021 10:44:57 +0530 Subject: [PATCH 3/5] fix: main path --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4fdb8a0..fa0a202 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@samagra-x/x-admin-logger", - "version": "0.0.1", + "version": "0.0.2", "description": "A logging utility for *x-admin*, a low-code framework for building admin platforms", - "main": "index.js", + "main": "src/main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, From 01a56b320e5acd1baebaea8721356018135ac63c Mon Sep 17 00:00:00 2001 From: "sagar.takle" Date: Tue, 17 Aug 2021 12:08:54 +0530 Subject: [PATCH 4/5] fix: main and typings path --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fa0a202..9ca7e5f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "@samagra-x/x-admin-logger", "version": "0.0.2", "description": "A logging utility for *x-admin*, a low-code framework for building admin platforms", - "main": "src/main.js", + "main": "src/main", + "typings": "src/main", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, From 62e724408b683aedb6a5274b99a7bdfab6017d7c Mon Sep 17 00:00:00 2001 From: "sagar.takle" Date: Tue, 17 Aug 2021 12:09:50 +0530 Subject: [PATCH 5/5] fix: main and typings path --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fa0a202..ee02bfb 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "@samagra-x/x-admin-logger", - "version": "0.0.2", + "version": "0.0.3", "description": "A logging utility for *x-admin*, a low-code framework for building admin platforms", - "main": "src/main.js", + "main": "src/main", + "typings": "src/main", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },