@sapphire-sh/utils 1.36.0 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/notify.js CHANGED
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.notifySlack = notifySlack;
4
4
  exports.notifyMattermost = notifyMattermost;
5
+ const logger_1 = require("./logger");
5
6
  async function notifySlack(url, text) {
7
+ logger_1.logger.debug('[notifySlack] posting to webhook', { textLength: text.length });
6
8
  const resp = await fetch(url, {
7
9
  method: 'POST',
8
10
  headers: {
@@ -10,11 +12,13 @@ async function notifySlack(url, text) {
10
12
  },
11
13
  body: JSON.stringify({ text }),
12
14
  });
15
+ logger_1.logger.debug('[notifySlack] response received', { status: resp.status });
13
16
  if (!resp.ok) {
14
17
  throw new Error(`Slack webhook failed: HTTP ${resp.status}`);
15
18
  }
16
19
  }
17
20
  async function notifyMattermost(baseUrl, token, channelId, message) {
21
+ logger_1.logger.debug('[notifyMattermost] posting to channel', { channelId, messageLength: message.length });
18
22
  const resp = await fetch(`${baseUrl}/api/v4/posts`, {
19
23
  method: 'POST',
20
24
  headers: {
@@ -23,6 +27,7 @@ async function notifyMattermost(baseUrl, token, channelId, message) {
23
27
  },
24
28
  body: JSON.stringify({ channel_id: channelId, message }),
25
29
  });
30
+ logger_1.logger.debug('[notifyMattermost] response received', { status: resp.status });
26
31
  if (!resp.ok) {
27
32
  throw new Error(`Mattermost post failed: HTTP ${resp.status}`);
28
33
  }
package/lib/prettier.js CHANGED
@@ -6,6 +6,9 @@ const config = {
6
6
  tabWidth: 2,
7
7
  useTabs: true,
8
8
  printWidth: 120,
9
+ trailingComma: 'all',
10
+ arrowParens: 'always',
11
+ endOfLine: 'lf',
9
12
  plugins: ['prettier-plugin-organize-imports'],
10
13
  };
11
14
  exports.default = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire-sh/utils",
3
- "version": "1.36.0",
3
+ "version": "1.37.0",
4
4
  "description": "@sapphire-sh/utils",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",