New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hydrogen-org/monitoring

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hydrogen-org/monitoring - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

18

dist/index.cjs.js

@@ -1,12 +0,12 @@

"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});(function(e,n,r){typeof exports=="object"?module.exports=exports=n(require("./core"),require("./x64-core"),require("./lib-typedarrays"),require("./enc-utf16"),require("./enc-base64"),require("./enc-base64url"),require("./md5"),require("./sha1"),require("./sha256"),require("./sha224"),require("./sha512"),require("./sha384"),require("./sha3"),require("./ripemd160"),require("./hmac"),require("./pbkdf2"),require("./evpkdf"),require("./cipher-core"),require("./mode-cfb"),require("./mode-ctr"),require("./mode-ctr-gladman"),require("./mode-ofb"),require("./mode-ecb"),require("./pad-ansix923"),require("./pad-iso10126"),require("./pad-iso97971"),require("./pad-zeropadding"),require("./pad-nopadding"),require("./format-hex"),require("./aes"),require("./tripledes"),require("./rc4"),require("./rabbit"),require("./rabbit-legacy")):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],n):e.CryptoJS=n(e.CryptoJS)})(globalThis,function(e){return e});const u=process.env.BRANCH_NAME,R=process.env.ENABLE_MONITORING_LOG_PROD,L=process.env.ENABLE_MONITORING_LOG_NON_PROD,w=process.env.VERSION_SDK,h={WEBHOOK_URL:process.env.MONITORING_SLACK_WEBHOOK,SLACK_CHANNEL_NAME:process.env.MONITORING_SLACK_CHANNEL};console.info("**build_timestamp**",process.env.CI_BUILD_TIMESTAMP);var b=(e=>(e.api_request="api_request",e.error="error",e.exception="exception",e))(b||{});const c={dev:"DEVELOP NON-PRODUCTION",qc:"QC NON-PRODUCTION",uat:"UAT NON-PRODUCTION",master:"PRODUCTION"},t={warning:{text:"Warning",emotion:":warning: :warning: :warning:",color:"#f2c744"},error:{text:"Error",emotion:":no_entry: :no_entry: :no_entry:",color:"#fa3434"},bug:{text:"Bug",emotion:":bug: :bug: :bug:",color:"#FA3434FF"}};function A(e){var n,r,d,l,N,O,s,q,y,g;try{const i=!!+R&&u==="master",x=!!+L&&u!=="master";if(!i&&!x)return;const f=(void 0).decrypt(h.WEBHOOK_URL,process.env.RABBIT).toString((void 0).Utf8);if(!new RegExp("[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\\.[a-zA-Z]{2,})+","g").test(f))return;const I={channel:`#${h.SLACK_CHANNEL_NAME}`,text:"CÓ HÀNG VỀ, CHECK LOG CÁC BẠN ƠI :sad_smile: :alert_red: :alert:",attachments:[{color:"#0084ea",blocks:[{type:"section",text:{type:"mrkdwn",text:[`• *${(n=t==null?void 0:t[e==null?void 0:e.type])==null?void 0:n.text}*: \`${(r=e==null?void 0:e.typeMonitor)==null?void 0:r.toUpperCase()}\` ${(d=t==null?void 0:t[e==null?void 0:e.type])==null?void 0:d.emotion}
`,`• *Tên module*: \`${(l=e==null?void 0:e.module)==null?void 0:l.toUpperCase()}\`
`,`• *Môi trường*: \`${c==null?void 0:c[u]}\`
`,`• *Version SDK*: \`${w}\`
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=void 0,b=void 0,D=void 0,I=process.env.VERSION_SDK,_={WEBHOOK_URL:"dW5kZWZpbmVk",SLACK_CHANNEL_NAME:void 0};console.info("**build_timestamp**",void 0);var $=(t=>(t.api_request="api_request",t.error="error",t.exception="exception",t))($||{});const d={dev:"DEVELOP NON-PRODUCTION",qc:"QC NON-PRODUCTION",uat:"UAT NON-PRODUCTION",master:"PRODUCTION"},e={warning:{text:"Warning",emotion:":warning: :warning: :warning:",color:"#f2c744"},error:{text:"Error",emotion:":no_entry: :no_entry: :no_entry:",color:"#fa3434"},bug:{text:"Bug",emotion:":bug: :bug: :bug:",color:"#FA3434FF"}};function k(t){var c,l,u,r,O,N,y,g,f,w;try{const n=!!+b&&i==="master",h=!!+D&&i!=="master";if(!n&&!h)return;const x=atob(_.WEBHOOK_URL);if(!new RegExp("[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\\.[a-zA-Z]{2,})+","g").test(x))return;const L={channel:`#${_.SLACK_CHANNEL_NAME}`,text:"CÓ HÀNG VỀ, CHECK LOG CÁC BẠN ƠI :sad_smile: :alert_red: :alert:",attachments:[{color:"#0084ea",blocks:[{type:"section",text:{type:"mrkdwn",text:[`• *${(c=e==null?void 0:e[t==null?void 0:t.type])==null?void 0:c.text}*: \`${(l=t==null?void 0:t.typeMonitor)==null?void 0:l.toUpperCase()}\` ${(u=e==null?void 0:e[t==null?void 0:t.type])==null?void 0:u.emotion}
`,`• *Tên module*: \`${(r=t==null?void 0:t.module)==null?void 0:r.toUpperCase()}\`
`,`• *Môi trường*: \`${d==null?void 0:d[i]}\`
`,`• *Version SDK*: \`${I}\`
`,`• *Domain*: \`${window.location.host||"Unknown"}\`
`,`• *Link truy cập*: ${window.location.href||"Unknown"}
`,`• *UserAgent*: ${navigator.userAgent}
`].join(" ")}},e!=null&&e.extraData?{type:"section",text:{type:"mrkdwn",text:[`• *Thông tin chung*: \`\`\`${JSON.stringify(e==null?void 0:e.extraData,null,4)}\`\`\`
`].join(" ")}}:null].filter(o=>!!o)},{color:(N=t==null?void 0:t[e==null?void 0:e.type])==null?void 0:N.color,blocks:e.typeMonitor==="api_request"?[{type:"section",text:{type:"mrkdwn",text:[`• *Http status code*: ${(O=e==null?void 0:e.data)==null?void 0:O.httpStatusCode}
`,`${(s=e==null?void 0:e.data)!=null&&s.httpStatusMessage?` • *Http status message*: ${(q=e==null?void 0:e.data)==null?void 0:q.httpStatusMessage}`:""}
`,`${(y=e==null?void 0:e.data)!=null&&y.errorResponse?` • *Error response*: \`\`\`${JSON.stringify((g=e==null?void 0:e.data)==null?void 0:g.errorResponse,null,4)}\`\`\` `:""}
`].join(" ")}}]:[{type:"section",text:{type:"mrkdwn",text:`*Chi tiết*: \`\`\`${JSON.stringify(e==null?void 0:e.data)}\`\`\``}}]},e.typeMonitor==="api_request"&&e.data.requestBody?{color:"#d1d5db",blocks:[{type:"section",text:{type:"mrkdwn",text:`*Request body*: \`\`\`${JSON.stringify(e.data.requestBody,null,4)}\`\`\``}}]}:null].filter(o=>!!o)},_=new Headers;_.append("Content-Type","application/x-www-form-urlencoded");const C=new URLSearchParams;C.append("payload",JSON.stringify(I)),fetch(f,{method:"POST",headers:_,body:C,redirect:"follow"}).then(o=>o.text()).catch(o=>console.log("error",o))}catch(i){console.error("LogMonitor error",i)}}exports.TypeMonitoring=b;exports.default=A;
`].join(" ")}},t!=null&&t.extraData?{type:"section",text:{type:"mrkdwn",text:[`• *Thông tin chung*: \`\`\`${JSON.stringify(t==null?void 0:t.extraData,null,4)}\`\`\`
`].join(" ")}}:null].filter(o=>!!o)},{color:(O=e==null?void 0:e[t==null?void 0:t.type])==null?void 0:O.color,blocks:t.typeMonitor==="api_request"?[{type:"section",text:{type:"mrkdwn",text:[`• *Http status code*: ${(N=t==null?void 0:t.data)==null?void 0:N.httpStatusCode}
`,`${(y=t==null?void 0:t.data)!=null&&y.httpStatusMessage?` • *Http status message*: ${(g=t==null?void 0:t.data)==null?void 0:g.httpStatusMessage}`:""}
`,`${(f=t==null?void 0:t.data)!=null&&f.errorResponse?` • *Error response*: \`\`\`${JSON.stringify((w=t==null?void 0:t.data)==null?void 0:w.errorResponse,null,4)}\`\`\` `:""}
`].join(" ")}}]:[{type:"section",text:{type:"mrkdwn",text:`*Chi tiết*: \`\`\`${JSON.stringify(t==null?void 0:t.data)}\`\`\``}}]},t.typeMonitor==="api_request"&&t.data.requestBody?{color:"#d1d5db",blocks:[{type:"section",text:{type:"mrkdwn",text:`*Request body*: \`\`\`${JSON.stringify(t.data.requestBody,null,4)}\`\`\``}}]}:null].filter(o=>!!o)},C=new Headers;C.append("Content-Type","application/x-www-form-urlencoded");const R=new URLSearchParams;R.append("payload",JSON.stringify(L)),fetch(x,{method:"POST",headers:C,body:R,redirect:"follow"}).then(o=>o.text()).catch(o=>console.log("error",o))}catch(n){console.error("LogMonitor error",n)}}exports.TypeMonitoring=$;exports.default=k;

@@ -1,13 +0,8 @@

(function(e, n, r) {
typeof exports == "object" ? module.exports = exports = n(require("./core"), require("./x64-core"), require("./lib-typedarrays"), require("./enc-utf16"), require("./enc-base64"), require("./enc-base64url"), require("./md5"), require("./sha1"), require("./sha256"), require("./sha224"), require("./sha512"), require("./sha384"), require("./sha3"), require("./ripemd160"), require("./hmac"), require("./pbkdf2"), require("./evpkdf"), require("./cipher-core"), require("./mode-cfb"), require("./mode-ctr"), require("./mode-ctr-gladman"), require("./mode-ofb"), require("./mode-ecb"), require("./pad-ansix923"), require("./pad-iso10126"), require("./pad-iso97971"), require("./pad-zeropadding"), require("./pad-nopadding"), require("./format-hex"), require("./aes"), require("./tripledes"), require("./rc4"), require("./rabbit"), require("./rabbit-legacy")) : typeof define == "function" && define.amd ? define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./enc-base64url", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy"], n) : e.CryptoJS = n(e.CryptoJS);
})(globalThis, function(e) {
return e;
});
const c = process.env.BRANCH_NAME, R = process.env.ENABLE_MONITORING_LOG_PROD, L = process.env.ENABLE_MONITORING_LOG_NON_PROD, b = process.env.VERSION_SDK, C = {
WEBHOOK_URL: process.env.MONITORING_SLACK_WEBHOOK,
SLACK_CHANNEL_NAME: process.env.MONITORING_SLACK_CHANNEL
const x = process.env.VERSION_SDK, I = {
WEBHOOK_URL: "dW5kZWZpbmVk",
SLACK_CHANNEL_NAME: void 0
};
console.info("**build_timestamp**", process.env.CI_BUILD_TIMESTAMP);
var w = /* @__PURE__ */ ((e) => (e.api_request = "api_request", e.error = "error", e.exception = "exception", e))(w || {});
const u = {
console.info("**build_timestamp**", void 0);
var w = /* @__PURE__ */ ((t) => (t.api_request = "api_request", t.error = "error", t.exception = "exception", t))(w || {});
const n = {
dev: "DEVELOP NON-PRODUCTION",

@@ -17,3 +12,3 @@ qc: "QC NON-PRODUCTION",

master: "PRODUCTION"
}, t = {
}, e = {
warning: {

@@ -35,13 +30,12 @@ text: "Warning",

};
function D(e) {
var n, r, d, l, N, O, q, s, y, f;
function D(t) {
var i, N, O, d, c, l, u, r, _, y;
try {
const i = !!+R && c === "master", h = !!+L && c !== "master";
if (!i && !h)
if (!!!NaN && !!!NaN)
return;
const g = (void 0).decrypt(C.WEBHOOK_URL, process.env.RABBIT).toString((void 0).Utf8);
if (!new RegExp("[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\\.[a-zA-Z]{2,})+", "g").test(g))
const R = atob(I.WEBHOOK_URL);
if (!new RegExp("[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\\.[a-zA-Z]{2,})+", "g").test(R))
return;
const I = {
channel: `#${C.SLACK_CHANNEL_NAME}`,
const f = {
channel: `#${I.SLACK_CHANNEL_NAME}`,
text: "CÓ HÀNG VỀ, CHECK LOG CÁC BẠN ƠI :sad_smile: :alert_red: :alert:",

@@ -57,9 +51,9 @@ attachments: [

text: [
`• *${(n = t == null ? void 0 : t[e == null ? void 0 : e.type]) == null ? void 0 : n.text}*: \`${(r = e == null ? void 0 : e.typeMonitor) == null ? void 0 : r.toUpperCase()}\` ${(d = t == null ? void 0 : t[e == null ? void 0 : e.type]) == null ? void 0 : d.emotion}
`• *${(i = e == null ? void 0 : e[t == null ? void 0 : t.type]) == null ? void 0 : i.text}*: \`${(N = t == null ? void 0 : t.typeMonitor) == null ? void 0 : N.toUpperCase()}\` ${(O = e == null ? void 0 : e[t == null ? void 0 : t.type]) == null ? void 0 : O.emotion}
`,
`• *Tên module*: \`${(l = e == null ? void 0 : e.module) == null ? void 0 : l.toUpperCase()}\`
`• *Tên module*: \`${(d = t == null ? void 0 : t.module) == null ? void 0 : d.toUpperCase()}\`
`,
`• *Môi trường*: \`${u == null ? void 0 : u[c]}\`
`• *Môi trường*: \`${n == null ? void 0 : n[void 0]}\`
`,
`• *Version SDK*: \`${b}\`
`• *Version SDK*: \`${x}\`
`,

@@ -75,3 +69,3 @@ `• *Domain*: \`${window.location.host || "Unknown"}\`

},
e != null && e.extraData ? {
t != null && t.extraData ? {
type: "section",

@@ -81,3 +75,3 @@ text: {

text: [
`• *Thông tin chung*: \`\`\`${JSON.stringify(e == null ? void 0 : e.extraData, null, 4)}\`\`\`
`• *Thông tin chung*: \`\`\`${JSON.stringify(t == null ? void 0 : t.extraData, null, 4)}\`\`\`
`

@@ -90,4 +84,4 @@ ].join(" ")

{
color: (N = t == null ? void 0 : t[e == null ? void 0 : e.type]) == null ? void 0 : N.color,
blocks: e.typeMonitor === "api_request" ? [{
color: (c = e == null ? void 0 : e[t == null ? void 0 : t.type]) == null ? void 0 : c.color,
blocks: t.typeMonitor === "api_request" ? [{
type: "section",

@@ -97,7 +91,7 @@ text: {

text: [
`• *Http status code*: ${(O = e == null ? void 0 : e.data) == null ? void 0 : O.httpStatusCode}
`• *Http status code*: ${(l = t == null ? void 0 : t.data) == null ? void 0 : l.httpStatusCode}
`,
`${(q = e == null ? void 0 : e.data) != null && q.httpStatusMessage ? ` • *Http status message*: ${(s = e == null ? void 0 : e.data) == null ? void 0 : s.httpStatusMessage}` : ""}
`${(u = t == null ? void 0 : t.data) != null && u.httpStatusMessage ? ` • *Http status message*: ${(r = t == null ? void 0 : t.data) == null ? void 0 : r.httpStatusMessage}` : ""}
`,
`${(y = e == null ? void 0 : e.data) != null && y.errorResponse ? ` • *Error response*: \`\`\`${JSON.stringify((f = e == null ? void 0 : e.data) == null ? void 0 : f.errorResponse, null, 4)}\`\`\` ` : ""}
`${(_ = t == null ? void 0 : t.data) != null && _.errorResponse ? ` • *Error response*: \`\`\`${JSON.stringify((y = t == null ? void 0 : t.data) == null ? void 0 : y.errorResponse, null, 4)}\`\`\` ` : ""}
`

@@ -110,7 +104,7 @@ ].join(" ")

type: "mrkdwn",
text: `*Chi tiết*: \`\`\`${JSON.stringify(e == null ? void 0 : e.data)}\`\`\``
text: `*Chi tiết*: \`\`\`${JSON.stringify(t == null ? void 0 : t.data)}\`\`\``
}
}]
},
e.typeMonitor === "api_request" && e.data.requestBody ? {
t.typeMonitor === "api_request" && t.data.requestBody ? {
color: "#d1d5db",

@@ -121,3 +115,3 @@ blocks: [{

type: "mrkdwn",
text: `*Request body*: \`\`\`${JSON.stringify(e.data.requestBody, null, 4)}\`\`\``
text: `*Request body*: \`\`\`${JSON.stringify(t.data.requestBody, null, 4)}\`\`\``
}

@@ -127,13 +121,13 @@ }]

].filter((o) => !!o)
}, _ = new Headers();
_.append("Content-Type", "application/x-www-form-urlencoded");
const x = new URLSearchParams();
x.append("payload", JSON.stringify(I)), fetch(g, {
}, L = new Headers();
L.append("Content-Type", "application/x-www-form-urlencoded");
const C = new URLSearchParams();
C.append("payload", JSON.stringify(f)), fetch(R, {
method: "POST",
headers: _,
body: x,
headers: L,
body: C,
redirect: "follow"
}).then((o) => o.text()).catch((o) => console.log("error", o));
} catch (i) {
console.error("LogMonitor error", i);
} catch (g) {
console.error("LogMonitor error", g);
}

@@ -140,0 +134,0 @@ }

@@ -1,5 +0,5 @@

(function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.MiniApp={}))})(this,function(t){"use strict";(function(e,i,c){typeof t=="object"?module.exports=t=i(require("./core"),require("./x64-core"),require("./lib-typedarrays"),require("./enc-utf16"),require("./enc-base64"),require("./enc-base64url"),require("./md5"),require("./sha1"),require("./sha256"),require("./sha224"),require("./sha512"),require("./sha384"),require("./sha3"),require("./ripemd160"),require("./hmac"),require("./pbkdf2"),require("./evpkdf"),require("./cipher-core"),require("./mode-cfb"),require("./mode-ctr"),require("./mode-ctr-gladman"),require("./mode-ofb"),require("./mode-ecb"),require("./pad-ansix923"),require("./pad-iso10126"),require("./pad-iso97971"),require("./pad-zeropadding"),require("./pad-nopadding"),require("./format-hex"),require("./aes"),require("./tripledes"),require("./rc4"),require("./rabbit"),require("./rabbit-legacy")):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],i):e.CryptoJS=i(e.CryptoJS)})(globalThis,function(e){return e});const n=process.env.BRANCH_NAME,I=process.env.ENABLE_MONITORING_LOG_PROD,R=process.env.ENABLE_MONITORING_LOG_NON_PROD,p=process.env.VERSION_SDK,l={WEBHOOK_URL:process.env.MONITORING_SLACK_WEBHOOK,SLACK_CHANNEL_NAME:process.env.MONITORING_SLACK_CHANNEL};console.info("**build_timestamp**",process.env.CI_BUILD_TIMESTAMP);var s=(e=>(e.api_request="api_request",e.error="error",e.exception="exception",e))(s||{});const d={dev:"DEVELOP NON-PRODUCTION",qc:"QC NON-PRODUCTION",uat:"UAT NON-PRODUCTION",master:"PRODUCTION"},o={warning:{text:"Warning",emotion:":warning: :warning: :warning:",color:"#f2c744"},error:{text:"Error",emotion:":no_entry: :no_entry: :no_entry:",color:"#fa3434"},bug:{text:"Bug",emotion:":bug: :bug: :bug:",color:"#FA3434FF"}};function L(e){var i,c,N,O,f,y,g,q,h,b;try{const u=!!+I&&n==="master",w=!!+R&&n!=="master";if(!u&&!w)return;const _=(void 0).decrypt(l.WEBHOOK_URL,process.env.RABBIT).toString((void 0).Utf8);if(!new RegExp("[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\\.[a-zA-Z]{2,})+","g").test(_))return;const A={channel:`#${l.SLACK_CHANNEL_NAME}`,text:"CÓ HÀNG VỀ, CHECK LOG CÁC BẠN ƠI :sad_smile: :alert_red: :alert:",attachments:[{color:"#0084ea",blocks:[{type:"section",text:{type:"mrkdwn",text:[`• *${(i=o==null?void 0:o[e==null?void 0:e.type])==null?void 0:i.text}*: \`${(c=e==null?void 0:e.typeMonitor)==null?void 0:c.toUpperCase()}\` ${(N=o==null?void 0:o[e==null?void 0:e.type])==null?void 0:N.emotion}
`,`• *Tên module*: \`${(O=e==null?void 0:e.module)==null?void 0:O.toUpperCase()}\`
`,`• *Môi trường*: \`${d==null?void 0:d[n]}\`
`,`• *Version SDK*: \`${p}\`
(function(o,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(o=typeof globalThis<"u"?globalThis:o||self,i(o.MiniApp={}))})(this,function(o){"use strict";const A=process.env.VERSION_SDK,N={WEBHOOK_URL:"dW5kZWZpbmVk",SLACK_CHANNEL_NAME:void 0};console.info("**build_timestamp**",void 0);var O=(e=>(e.api_request="api_request",e.error="error",e.exception="exception",e))(O||{});const d={dev:"DEVELOP NON-PRODUCTION",qc:"QC NON-PRODUCTION",uat:"UAT NON-PRODUCTION",master:"PRODUCTION"},t={warning:{text:"Warning",emotion:":warning: :warning: :warning:",color:"#f2c744"},error:{text:"Error",emotion:":no_entry: :no_entry: :no_entry:",color:"#fa3434"},bug:{text:"Bug",emotion:":bug: :bug: :bug:",color:"#FA3434FF"}};function h(e){var c,l,u,r,_,y,f,g,R,L;try{if(!!!NaN&&!!!NaN)return;const I=atob(N.WEBHOOK_URL);if(!new RegExp("[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\\.[a-zA-Z]{2,})+","g").test(I))return;const D={channel:`#${N.SLACK_CHANNEL_NAME}`,text:"CÓ HÀNG VỀ, CHECK LOG CÁC BẠN ƠI :sad_smile: :alert_red: :alert:",attachments:[{color:"#0084ea",blocks:[{type:"section",text:{type:"mrkdwn",text:[`• *${(c=t==null?void 0:t[e==null?void 0:e.type])==null?void 0:c.text}*: \`${(l=e==null?void 0:e.typeMonitor)==null?void 0:l.toUpperCase()}\` ${(u=t==null?void 0:t[e==null?void 0:e.type])==null?void 0:u.emotion}
`,`• *Tên module*: \`${(r=e==null?void 0:e.module)==null?void 0:r.toUpperCase()}\`
`,`• *Môi trường*: \`${d==null?void 0:d[void 0]}\`
`,`• *Version SDK*: \`${A}\`
`,`• *Domain*: \`${window.location.host||"Unknown"}\`

@@ -9,5 +9,5 @@ `,`• *Link truy cập*: ${window.location.href||"Unknown"}

`].join(" ")}},e!=null&&e.extraData?{type:"section",text:{type:"mrkdwn",text:[`• *Thông tin chung*: \`\`\`${JSON.stringify(e==null?void 0:e.extraData,null,4)}\`\`\`
`].join(" ")}}:null].filter(r=>!!r)},{color:(f=o==null?void 0:o[e==null?void 0:e.type])==null?void 0:f.color,blocks:e.typeMonitor==="api_request"?[{type:"section",text:{type:"mrkdwn",text:[`• *Http status code*: ${(y=e==null?void 0:e.data)==null?void 0:y.httpStatusCode}
`,`${(g=e==null?void 0:e.data)!=null&&g.httpStatusMessage?` • *Http status message*: ${(q=e==null?void 0:e.data)==null?void 0:q.httpStatusMessage}`:""}
`,`${(h=e==null?void 0:e.data)!=null&&h.errorResponse?` • *Error response*: \`\`\`${JSON.stringify((b=e==null?void 0:e.data)==null?void 0:b.errorResponse,null,4)}\`\`\` `:""}
`].join(" ")}}]:[{type:"section",text:{type:"mrkdwn",text:`*Chi tiết*: \`\`\`${JSON.stringify(e==null?void 0:e.data)}\`\`\``}}]},e.typeMonitor==="api_request"&&e.data.requestBody?{color:"#d1d5db",blocks:[{type:"section",text:{type:"mrkdwn",text:`*Request body*: \`\`\`${JSON.stringify(e.data.requestBody,null,4)}\`\`\``}}]}:null].filter(r=>!!r)},x=new Headers;x.append("Content-Type","application/x-www-form-urlencoded");const C=new URLSearchParams;C.append("payload",JSON.stringify(A)),fetch(_,{method:"POST",headers:x,body:C,redirect:"follow"}).then(r=>r.text()).catch(r=>console.log("error",r))}catch(u){console.error("LogMonitor error",u)}}t.TypeMonitoring=s,t.default=L,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
`].join(" ")}}:null].filter(n=>!!n)},{color:(_=t==null?void 0:t[e==null?void 0:e.type])==null?void 0:_.color,blocks:e.typeMonitor==="api_request"?[{type:"section",text:{type:"mrkdwn",text:[`• *Http status code*: ${(y=e==null?void 0:e.data)==null?void 0:y.httpStatusCode}
`,`${(f=e==null?void 0:e.data)!=null&&f.httpStatusMessage?` • *Http status message*: ${(g=e==null?void 0:e.data)==null?void 0:g.httpStatusMessage}`:""}
`,`${(R=e==null?void 0:e.data)!=null&&R.errorResponse?` • *Error response*: \`\`\`${JSON.stringify((L=e==null?void 0:e.data)==null?void 0:L.errorResponse,null,4)}\`\`\` `:""}
`].join(" ")}}]:[{type:"section",text:{type:"mrkdwn",text:`*Chi tiết*: \`\`\`${JSON.stringify(e==null?void 0:e.data)}\`\`\``}}]},e.typeMonitor==="api_request"&&e.data.requestBody?{color:"#d1d5db",blocks:[{type:"section",text:{type:"mrkdwn",text:`*Request body*: \`\`\`${JSON.stringify(e.data.requestBody,null,4)}\`\`\``}}]}:null].filter(n=>!!n)},x=new Headers;x.append("Content-Type","application/x-www-form-urlencoded");const w=new URLSearchParams;w.append("payload",JSON.stringify(D)),fetch(I,{method:"POST",headers:x,body:w,redirect:"follow"}).then(n=>n.text()).catch(n=>console.log("error",n))}catch(C){console.error("LogMonitor error",C)}}o.TypeMonitoring=O,o.default=h,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
{
"name": "@hydrogen-org/monitoring",
"version": "0.0.4",
"version": "0.0.5",
"description": "A monitoring package for platform sdk",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc