@flink-app/sms-plugin 0.12.1-alpha.0 → 0.12.1-alpha.2
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/dist/index.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/sms46elksClient.js +15 -12
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { client } from "./schemas/client";
|
|
|
3
3
|
export type { sms } from "./schemas/sms";
|
|
4
4
|
export { sms46elksClient } from "./sms46elksClient";
|
|
5
5
|
export * from "./schemas/client";
|
|
6
|
-
export
|
|
6
|
+
export type smsPluginOptions = {
|
|
7
7
|
/**
|
|
8
8
|
* Path for request
|
|
9
9
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/sms46elksClient.js
CHANGED
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -60,19 +60,22 @@ var sms46elksClient = /** @class */ (function () {
|
|
|
60
60
|
}
|
|
61
61
|
sms46elksClient.prototype.sendSMS = function (sms) {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
-
var authKey, _a, _b, _i, t, to, url, data, postData, config, res;
|
|
64
|
-
return __generator(this, function (
|
|
65
|
-
switch (
|
|
63
|
+
var authKey, _a, _b, _c, _i, t, to, url, data, postData, config, res;
|
|
64
|
+
return __generator(this, function (_d) {
|
|
65
|
+
switch (_d.label) {
|
|
66
66
|
case 0:
|
|
67
67
|
authKey = Buffer.from(this.username + ":" + this.password).toString("base64");
|
|
68
|
-
_a =
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
_a = sms.to;
|
|
69
|
+
_b = [];
|
|
70
|
+
for (_c in _a)
|
|
71
|
+
_b.push(_c);
|
|
71
72
|
_i = 0;
|
|
72
|
-
|
|
73
|
+
_d.label = 1;
|
|
73
74
|
case 1:
|
|
74
|
-
if (!(_i <
|
|
75
|
-
|
|
75
|
+
if (!(_i < _b.length)) return [3 /*break*/, 4];
|
|
76
|
+
_c = _b[_i];
|
|
77
|
+
if (!(_c in _a)) return [3 /*break*/, 3];
|
|
78
|
+
t = _c;
|
|
76
79
|
to = sms.to[t];
|
|
77
80
|
url = "https://api.46elks.com/a1/sms";
|
|
78
81
|
data = __assign(__assign({}, sms), { to: to });
|
|
@@ -84,8 +87,8 @@ var sms46elksClient = /** @class */ (function () {
|
|
|
84
87
|
};
|
|
85
88
|
return [4 /*yield*/, axios_1.default.post(url, postData, config)];
|
|
86
89
|
case 2:
|
|
87
|
-
res =
|
|
88
|
-
|
|
90
|
+
res = _d.sent();
|
|
91
|
+
_d.label = 3;
|
|
89
92
|
case 3:
|
|
90
93
|
_i++;
|
|
91
94
|
return [3 /*break*/, 1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/sms-plugin",
|
|
3
|
-
"version": "0.12.1-alpha.
|
|
3
|
+
"version": "0.12.1-alpha.2",
|
|
4
4
|
"description": "Flink plugin that makes it possible to send sms",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\"",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"axios": "^0.27.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@flink-app/flink": "^0.12.1-alpha.
|
|
21
|
-
"@types/node": "
|
|
20
|
+
"@flink-app/flink": "^0.12.1-alpha.2",
|
|
21
|
+
"@types/node": "22.13.10",
|
|
22
22
|
"ts-node": "^9.1.1",
|
|
23
|
-
"typescript": "
|
|
23
|
+
"typescript": "5.4.5"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "b5be77c75e10067c81e0ecab8716b30f99833b83"
|
|
26
26
|
}
|