@konplit-services/common 1.0.57 → 1.0.59

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.
@@ -100,7 +100,10 @@ class Listener {
100
100
  subjects,
101
101
  storage: nats_1.StorageType.File,
102
102
  max_consumers: -1,
103
- retention: nats_1.RetentionPolicy.Workqueue,
103
+ retention: nats_1.RetentionPolicy.Limits,
104
+ max_msgs: 10000,
105
+ max_bytes: 1 * 1024 * 1024 * 1024,
106
+ max_age: 14 * 24 * 3600 * 1000, // 2 weeks in milliseconds
104
107
  };
105
108
  yield jsm.streams.add(streamConfig);
106
109
  console.log(`Stream '${streamName}' created`);
@@ -89,8 +89,11 @@ class Publisher {
89
89
  name: streamName,
90
90
  subjects,
91
91
  storage: nats_1.StorageType.File,
92
- retention: nats_1.RetentionPolicy.Workqueue,
92
+ retention: nats_1.RetentionPolicy.Limits,
93
93
  max_consumers: -1,
94
+ max_msgs: 10000,
95
+ max_bytes: 5 * 1024 * 1024 * 1024,
96
+ max_age: 14 * 24 * 3600 * 1000, // 2 weeks in milliseconds
94
97
  };
95
98
  yield jsm.streams.add(streamConfig);
96
99
  console.log(`Stream '${streamName}' created`);
@@ -4,4 +4,3 @@ export * from "./logs-events/interfaces";
4
4
  export * from "./notification-events/interfaces";
5
5
  export * from "./base-events";
6
6
  export * from "./types";
7
- export * from "./queue-group-name";
@@ -20,4 +20,3 @@ __exportStar(require("./logs-events/interfaces"), exports);
20
20
  __exportStar(require("./notification-events/interfaces"), exports);
21
21
  __exportStar(require("./base-events"), exports);
22
22
  __exportStar(require("./types"), exports);
23
- __exportStar(require("./queue-group-name"), exports);
@@ -14,16 +14,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.sendSms = void 0;
16
16
  const axios_1 = __importDefault(require("axios"));
17
- const node_querystring_1 = __importDefault(require("node:querystring"));
17
+ const node_url_1 = require("node:url");
18
18
  const sendSms = (request) => __awaiter(void 0, void 0, void 0, function* () {
19
19
  var _a;
20
20
  const url = "https://api.ng.termii.com/api/sms/send";
21
+ const query = new node_url_1.URLSearchParams(Object.assign({}, request));
21
22
  try {
22
- const response = yield axios_1.default.post(url, node_querystring_1.default.encode(Object.assign({}, request)), {
23
- headers: {
24
- "Content-Type": "application/x-www-form-urlencoded",
25
- },
26
- });
23
+ const response = yield axios_1.default.post(`${url}?${query.toString()}`);
27
24
  return response.data;
28
25
  }
29
26
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konplit-services/common",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",