@ingestkorea/client-sens 1.9.0 → 1.11.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/README.md +99 -57
- package/dist-cjs/SensClient.js +42 -43
- package/dist-cjs/commands/GetAlimtalkResultCommand.js +3 -0
- package/dist-cjs/commands/GetAlimtalkStatusCommand.js +8 -1
- package/dist-cjs/commands/GetAlimtalkTemplateCommand.js +3 -0
- package/dist-cjs/commands/GetSMSResultCommand.js +3 -0
- package/dist-cjs/commands/GetSMSStatusCommand.js +8 -1
- package/dist-cjs/commands/ListAlimtalkChannelsCommand.js +3 -0
- package/dist-cjs/commands/ListAlimtalkStatusCommand.js +22 -10
- package/dist-cjs/commands/ListAlimtalkTemplatesCommand.js +3 -0
- package/dist-cjs/commands/ListSMSStatusCommand.js +21 -10
- package/dist-cjs/commands/SendAlimtalkCommand.js +15 -14
- package/dist-cjs/commands/SendMMSCommand.js +16 -23
- package/dist-cjs/commands/SendSMSCommand.js +28 -16
- package/dist-cjs/commands/constants.js +8 -19
- package/dist-cjs/index.js +1 -0
- package/dist-cjs/middleware/constants.js +2 -1
- package/dist-cjs/middleware/middleware-metadata.js +7 -12
- package/dist-cjs/middleware/middleware-retry.js +48 -38
- package/dist-cjs/middleware/middleware-sign.js +8 -12
- package/dist-cjs/models/SensApiError.js +21 -0
- package/dist-cjs/models/{SensErrorInfo.js → SensClientError.js} +6 -1
- package/dist-cjs/models/SensCommand.js +1 -0
- package/dist-cjs/models/index.js +2 -1
- package/dist-cjs/protocols/GetAlimtalkResult.js +14 -17
- package/dist-cjs/protocols/GetAlimtalkStatus.js +21 -17
- package/dist-cjs/protocols/GetAlimtalkTemplate.js +29 -17
- package/dist-cjs/protocols/GetSMSResult.js +16 -17
- package/dist-cjs/protocols/GetSMSStatus.js +10 -16
- package/dist-cjs/protocols/ListAlimtalkChannels.js +10 -16
- package/dist-cjs/protocols/ListAlimtalkStatus.js +10 -16
- package/dist-cjs/protocols/ListAlimtalkTemplates.js +12 -19
- package/dist-cjs/protocols/ListSMSStatus.js +10 -16
- package/dist-cjs/protocols/SendAlimtalk.js +10 -16
- package/dist-cjs/protocols/SendMMS.js +4 -13
- package/dist-cjs/protocols/SendSMS.js +11 -17
- package/dist-cjs/protocols/constants.js +124 -82
- package/dist-es/SensClient.js +37 -31
- package/dist-es/commands/GetAlimtalkResultCommand.js +8 -9
- package/dist-es/commands/GetAlimtalkStatusCommand.js +8 -9
- package/dist-es/commands/GetAlimtalkTemplateCommand.js +8 -9
- package/dist-es/commands/GetSMSResultCommand.js +8 -9
- package/dist-es/commands/GetSMSStatusCommand.js +8 -9
- package/dist-es/commands/ListAlimtalkChannelsCommand.js +8 -9
- package/dist-es/commands/ListAlimtalkStatusCommand.js +24 -28
- package/dist-es/commands/ListAlimtalkTemplatesCommand.js +8 -9
- package/dist-es/commands/ListSMSStatusCommand.js +25 -29
- package/dist-es/commands/SendAlimtalkCommand.js +18 -26
- package/dist-es/commands/SendMMSCommand.js +37 -48
- package/dist-es/commands/SendSMSCommand.js +25 -29
- package/dist-es/commands/constants.js +18 -39
- package/dist-es/commands/index.js +12 -28
- package/dist-es/index.js +3 -18
- package/dist-es/middleware/constants.js +8 -10
- package/dist-es/middleware/index.js +3 -19
- package/dist-es/middleware/middleware-metadata.js +4 -7
- package/dist-es/middleware/middleware-retry.js +47 -38
- package/dist-es/middleware/middleware-sign.js +9 -13
- package/dist-es/models/GetAlimtalkResult.js +1 -2
- package/dist-es/models/GetAlimtalkStatus.js +1 -2
- package/dist-es/models/GetAlimtalkTemplate.js +1 -2
- package/dist-es/models/GetSMSResult.js +1 -2
- package/dist-es/models/GetSMSStatus.js +1 -2
- package/dist-es/models/ListAlimtalkChannels.js +1 -2
- package/dist-es/models/ListAlimtalkStatus.js +1 -2
- package/dist-es/models/ListAlimtalkTemplates.js +1 -2
- package/dist-es/models/ListSMSStatus.js +1 -2
- package/dist-es/models/MetadataBearer.js +1 -2
- package/dist-es/models/SendAlimtalk.js +2 -5
- package/dist-es/models/SendMMS.js +2 -5
- package/dist-es/models/SendSMS.js +1 -2
- package/dist-es/models/SensApiError.js +18 -0
- package/dist-es/models/SensClient.js +1 -2
- package/dist-es/models/SensClientError.js +14 -0
- package/dist-es/models/SensCommand.js +2 -5
- package/dist-es/models/SensMiddleware.js +1 -2
- package/dist-es/models/index.js +18 -33
- package/dist-es/protocols/GetAlimtalkResult.js +11 -16
- package/dist-es/protocols/GetAlimtalkStatus.js +17 -24
- package/dist-es/protocols/GetAlimtalkTemplate.js +12 -17
- package/dist-es/protocols/GetSMSResult.js +11 -16
- package/dist-es/protocols/GetSMSStatus.js +15 -22
- package/dist-es/protocols/ListAlimtalkChannels.js +11 -16
- package/dist-es/protocols/ListAlimtalkStatus.js +11 -16
- package/dist-es/protocols/ListAlimtalkTemplates.js +15 -22
- package/dist-es/protocols/ListSMSStatus.js +11 -16
- package/dist-es/protocols/SendAlimtalk.js +12 -18
- package/dist-es/protocols/SendMMS.js +5 -10
- package/dist-es/protocols/SendSMS.js +12 -18
- package/dist-es/protocols/constants.js +126 -88
- package/dist-types/SensClient.d.ts +0 -1
- package/dist-types/index.d.ts +1 -0
- package/dist-types/middleware/constants.d.ts +1 -0
- package/dist-types/models/MetadataBearer.d.ts +1 -0
- package/dist-types/models/SensApiError.d.ts +55 -0
- package/dist-types/models/SensClient.d.ts +8 -1
- package/dist-types/models/SensClientError.d.ts +18 -0
- package/dist-types/models/index.d.ts +2 -1
- package/dist-types/protocols/constants.d.ts +1 -1
- package/package.json +4 -5
- package/dist-es/models/SensErrorInfo.js +0 -13
- package/dist-types/models/SensErrorInfo.d.ts +0 -21
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
5
|
-
const constants_js_1 = require("./constants.js");
|
|
6
|
-
const se_GetSMSStatusCommand = async (input, config) => {
|
|
1
|
+
import { HttpRequest } from "@ingestkorea/util-http-handler";
|
|
2
|
+
import { deserializeMetadata, parseBody, parseErrorBody, compact, convertToUtc } from "./constants.js";
|
|
3
|
+
export const se_GetSMSStatusCommand = async (input, config) => {
|
|
7
4
|
const hostname = "sens.apigw.ntruss.com";
|
|
8
5
|
const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
|
|
9
6
|
const headers = {
|
|
@@ -15,7 +12,7 @@ const se_GetSMSStatusCommand = async (input, config) => {
|
|
|
15
12
|
}
|
|
16
13
|
return acc;
|
|
17
14
|
}, {});
|
|
18
|
-
return new
|
|
15
|
+
return new HttpRequest({
|
|
19
16
|
protocol: "https:",
|
|
20
17
|
method: "GET",
|
|
21
18
|
hostname,
|
|
@@ -24,19 +21,17 @@ const se_GetSMSStatusCommand = async (input, config) => {
|
|
|
24
21
|
headers,
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
|
-
|
|
28
|
-
const de_GetSMSStatusCommand = async (response, config) => {
|
|
24
|
+
export const de_GetSMSStatusCommand = async (response, config) => {
|
|
29
25
|
if (response.statusCode >= 300)
|
|
30
|
-
await
|
|
31
|
-
const data = await
|
|
32
|
-
const contents =
|
|
26
|
+
await parseErrorBody(response);
|
|
27
|
+
const data = await parseBody(response);
|
|
28
|
+
const contents = de_GetSMSStatusResult(data);
|
|
33
29
|
return {
|
|
34
|
-
$metadata:
|
|
35
|
-
...
|
|
30
|
+
$metadata: deserializeMetadata(response),
|
|
31
|
+
...compact(contents),
|
|
36
32
|
};
|
|
37
33
|
};
|
|
38
|
-
|
|
39
|
-
const de_GetSMSStatusResult = (output) => {
|
|
34
|
+
export const de_GetSMSStatusResult = (output) => {
|
|
40
35
|
return {
|
|
41
36
|
requestId: output.requestId ? output.requestId : undefined,
|
|
42
37
|
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
@@ -49,21 +44,20 @@ const de_GetSMSStatusResult = (output) => {
|
|
|
49
44
|
nextToken: output.nextToken ? output.nextToken : undefined,
|
|
50
45
|
};
|
|
51
46
|
};
|
|
52
|
-
exports.de_GetSMSStatusResult = de_GetSMSStatusResult;
|
|
53
47
|
const de_SMSMessageRequestStatusList = (output) => {
|
|
54
|
-
return (output || []).filter((e) => e != null).map((entry) =>
|
|
48
|
+
return (output || []).filter((e) => e != null).map((entry) => de_SMSMessageRequestStatus(entry));
|
|
55
49
|
};
|
|
56
|
-
const de_SMSMessageRequestStatus = (output) => {
|
|
50
|
+
export const de_SMSMessageRequestStatus = (output) => {
|
|
57
51
|
return {
|
|
58
52
|
requestId: output.requestId ? output.requestId : undefined,
|
|
59
53
|
messageId: output.messageId ? output.messageId : undefined,
|
|
60
|
-
requestTime: output.requestTime ?
|
|
54
|
+
requestTime: output.requestTime ? convertToUtc(output.requestTime) : undefined,
|
|
61
55
|
contentType: output.contentType ? output.contentType : undefined,
|
|
62
56
|
type: output.type ? output.type : undefined,
|
|
63
57
|
countryCode: output.countryCode ? output.countryCode : undefined,
|
|
64
58
|
from: output.from ? output.from : undefined,
|
|
65
59
|
to: output.to ? output.to : undefined,
|
|
66
|
-
completeTime: output.completeTime ?
|
|
60
|
+
completeTime: output.completeTime ? convertToUtc(output.completeTime) : undefined,
|
|
67
61
|
telcoCode: output.telcoCode ? output.telcoCode : undefined,
|
|
68
62
|
status: output.status ? output.status : undefined,
|
|
69
63
|
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
@@ -71,4 +65,3 @@ const de_SMSMessageRequestStatus = (output) => {
|
|
|
71
65
|
statusMessage: output.statusMessage ? output.statusMessage : undefined,
|
|
72
66
|
};
|
|
73
67
|
};
|
|
74
|
-
exports.de_SMSMessageRequestStatus = de_SMSMessageRequestStatus;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
5
|
-
const constants_js_1 = require("./constants.js");
|
|
6
|
-
const se_ListAlimtalkChannelsCommand = async (input, config) => {
|
|
1
|
+
import { HttpRequest } from "@ingestkorea/util-http-handler";
|
|
2
|
+
import { deserializeMetadata, parseBody, parseErrorBody, compact, convertToUtc } from "./constants.js";
|
|
3
|
+
export const se_ListAlimtalkChannelsCommand = async (input, config) => {
|
|
7
4
|
const hostname = "sens.apigw.ntruss.com";
|
|
8
5
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/channels";
|
|
9
6
|
const headers = {
|
|
10
7
|
host: hostname,
|
|
11
8
|
};
|
|
12
|
-
return new
|
|
9
|
+
return new HttpRequest({
|
|
13
10
|
protocol: "https:",
|
|
14
11
|
method: "GET",
|
|
15
12
|
hostname: hostname,
|
|
@@ -17,18 +14,16 @@ const se_ListAlimtalkChannelsCommand = async (input, config) => {
|
|
|
17
14
|
headers: headers,
|
|
18
15
|
});
|
|
19
16
|
};
|
|
20
|
-
|
|
21
|
-
const de_ListAlimtalkChannelsCommand = async (response, config) => {
|
|
17
|
+
export const de_ListAlimtalkChannelsCommand = async (response, config) => {
|
|
22
18
|
if (response.statusCode >= 300)
|
|
23
|
-
await
|
|
24
|
-
const data = await
|
|
19
|
+
await parseErrorBody(response);
|
|
20
|
+
const data = await parseBody(response);
|
|
25
21
|
const contents = de_ListAlimtalkChannelsResult(data);
|
|
26
22
|
return {
|
|
27
|
-
$metadata:
|
|
28
|
-
...
|
|
23
|
+
$metadata: deserializeMetadata(response),
|
|
24
|
+
...compact(contents),
|
|
29
25
|
};
|
|
30
26
|
};
|
|
31
|
-
exports.de_ListAlimtalkChannelsCommand = de_ListAlimtalkChannelsCommand;
|
|
32
27
|
const de_ListAlimtalkChannelsResult = (output) => {
|
|
33
28
|
return {
|
|
34
29
|
channels: output.channels ? de_AlimtalkChannelList(output.channels) : [],
|
|
@@ -39,8 +34,8 @@ const de_AlimtalkChannelList = (output) => {
|
|
|
39
34
|
};
|
|
40
35
|
const de_AlimtalkChannel = (output) => {
|
|
41
36
|
return {
|
|
42
|
-
createTime: output.createTime != undefined ?
|
|
43
|
-
updateTime: output.updateTime != undefined ?
|
|
37
|
+
createTime: output.createTime != undefined ? convertToUtc(output.createTime) : undefined,
|
|
38
|
+
updateTime: output.updateTime != undefined ? convertToUtc(output.updateTime) : undefined,
|
|
44
39
|
serviceId: output.serviceId != undefined ? output.serviceId : undefined,
|
|
45
40
|
channelId: output.channelId != undefined ? output.channelId : undefined,
|
|
46
41
|
channelName: output.channelName != undefined ? output.channelName : undefined,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const constants_js_1 = require("./constants.js");
|
|
6
|
-
const GetAlimtalkStatus_js_1 = require("./GetAlimtalkStatus.js");
|
|
7
|
-
const se_ListAlimtalkStatusCommand = async (input, config) => {
|
|
1
|
+
import { HttpRequest } from "@ingestkorea/util-http-handler";
|
|
2
|
+
import { deserializeMetadata, parseBody, parseErrorBody, compact } from "./constants.js";
|
|
3
|
+
import { de_GetAlimtalkStatusResult } from "./GetAlimtalkStatus.js";
|
|
4
|
+
export const se_ListAlimtalkStatusCommand = async (input, config) => {
|
|
8
5
|
const hostname = "sens.apigw.ntruss.com";
|
|
9
6
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
|
|
10
7
|
const headers = {
|
|
@@ -16,7 +13,7 @@ const se_ListAlimtalkStatusCommand = async (input, config) => {
|
|
|
16
13
|
}
|
|
17
14
|
return acc;
|
|
18
15
|
}, {});
|
|
19
|
-
return new
|
|
16
|
+
return new HttpRequest({
|
|
20
17
|
protocol: "https:",
|
|
21
18
|
method: "GET",
|
|
22
19
|
hostname: hostname,
|
|
@@ -25,18 +22,16 @@ const se_ListAlimtalkStatusCommand = async (input, config) => {
|
|
|
25
22
|
query,
|
|
26
23
|
});
|
|
27
24
|
};
|
|
28
|
-
|
|
29
|
-
const de_ListAlimtalkStatusCommand = async (response, config) => {
|
|
25
|
+
export const de_ListAlimtalkStatusCommand = async (response, config) => {
|
|
30
26
|
if (response.statusCode >= 300)
|
|
31
|
-
await
|
|
32
|
-
const data = await
|
|
27
|
+
await parseErrorBody(response);
|
|
28
|
+
const data = await parseBody(response);
|
|
33
29
|
const contents = de_ListAlimtalkStatusResult(data);
|
|
34
30
|
return {
|
|
35
|
-
$metadata:
|
|
36
|
-
...
|
|
31
|
+
$metadata: deserializeMetadata(response),
|
|
32
|
+
...compact(contents),
|
|
37
33
|
};
|
|
38
34
|
};
|
|
39
|
-
exports.de_ListAlimtalkStatusCommand = de_ListAlimtalkStatusCommand;
|
|
40
35
|
const de_ListAlimtalkStatusResult = (output) => {
|
|
41
|
-
return
|
|
36
|
+
return de_GetAlimtalkStatusResult(output);
|
|
42
37
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
5
|
-
const constants_js_1 = require("./constants.js");
|
|
6
|
-
const se_ListAlimtalkTemplatesCommand = async (input, config) => {
|
|
1
|
+
import { HttpRequest } from "@ingestkorea/util-http-handler";
|
|
2
|
+
import { deserializeMetadata, parseBody, parseErrorBody, compact, convertToUtc } from "./constants.js";
|
|
3
|
+
export const se_ListAlimtalkTemplatesCommand = async (input, config) => {
|
|
7
4
|
const hostname = "sens.apigw.ntruss.com";
|
|
8
5
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/templates";
|
|
9
6
|
const headers = {
|
|
@@ -12,7 +9,7 @@ const se_ListAlimtalkTemplatesCommand = async (input, config) => {
|
|
|
12
9
|
const query = {
|
|
13
10
|
channelId: input.channelId,
|
|
14
11
|
};
|
|
15
|
-
return new
|
|
12
|
+
return new HttpRequest({
|
|
16
13
|
protocol: "https:",
|
|
17
14
|
method: "GET",
|
|
18
15
|
hostname: hostname,
|
|
@@ -21,18 +18,16 @@ const se_ListAlimtalkTemplatesCommand = async (input, config) => {
|
|
|
21
18
|
headers: headers,
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
|
-
|
|
25
|
-
const de_ListAlimtalkTemplatesCommand = async (response, config) => {
|
|
21
|
+
export const de_ListAlimtalkTemplatesCommand = async (response, config) => {
|
|
26
22
|
if (response.statusCode >= 300)
|
|
27
|
-
await
|
|
28
|
-
const data = await
|
|
23
|
+
await parseErrorBody(response);
|
|
24
|
+
const data = await parseBody(response);
|
|
29
25
|
const contents = de_ListAlimtalkTemplatesResult(data);
|
|
30
26
|
return {
|
|
31
|
-
$metadata:
|
|
32
|
-
...
|
|
27
|
+
$metadata: deserializeMetadata(response),
|
|
28
|
+
...compact(contents),
|
|
33
29
|
};
|
|
34
30
|
};
|
|
35
|
-
exports.de_ListAlimtalkTemplatesCommand = de_ListAlimtalkTemplatesCommand;
|
|
36
31
|
const de_ListAlimtalkTemplatesResult = (output) => {
|
|
37
32
|
return {
|
|
38
33
|
templates: Array.isArray(output) ? de_TemplateList(output) : [],
|
|
@@ -41,12 +36,11 @@ const de_ListAlimtalkTemplatesResult = (output) => {
|
|
|
41
36
|
const de_TemplateList = (output) => {
|
|
42
37
|
return (output || [])
|
|
43
38
|
.filter((e) => e != null)
|
|
44
|
-
.map((entry) =>
|
|
39
|
+
.map((entry) => de_Template(entry))
|
|
45
40
|
.sort((a, b) => {
|
|
46
|
-
var _a, _b;
|
|
47
41
|
// 생성 날짜 기준 내림차순
|
|
48
|
-
const dateA = (
|
|
49
|
-
const dateB = (
|
|
42
|
+
const dateA = (a.createTime ?? "").replace(/\.\d{3}Z?$/, "");
|
|
43
|
+
const dateB = (b.createTime ?? "").replace(/\.\d{3}Z?$/, "");
|
|
50
44
|
if (dateB < dateA)
|
|
51
45
|
return -1;
|
|
52
46
|
if (dateB > dateA)
|
|
@@ -54,13 +48,12 @@ const de_TemplateList = (output) => {
|
|
|
54
48
|
return 0;
|
|
55
49
|
});
|
|
56
50
|
};
|
|
57
|
-
const de_Template = (output) => {
|
|
51
|
+
export const de_Template = (output) => {
|
|
58
52
|
return {
|
|
59
|
-
createTime: output.createTime ?
|
|
60
|
-
updateTime: output.updateTime ?
|
|
53
|
+
createTime: output.createTime ? convertToUtc(output.createTime) : undefined,
|
|
54
|
+
updateTime: output.updateTime ? convertToUtc(output.updateTime) : undefined,
|
|
61
55
|
channelId: output.channelId != undefined ? output.channelId : undefined,
|
|
62
56
|
templateCode: output.templateCode != undefined ? output.templateCode : undefined,
|
|
63
57
|
templateName: output.templateName != undefined ? output.templateName : undefined,
|
|
64
58
|
};
|
|
65
59
|
};
|
|
66
|
-
exports.de_Template = de_Template;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const constants_js_1 = require("./constants.js");
|
|
6
|
-
const GetSMSStatus_js_1 = require("./GetSMSStatus.js");
|
|
7
|
-
const se_ListSMSStatusCommand = async (input, config) => {
|
|
1
|
+
import { HttpRequest } from "@ingestkorea/util-http-handler";
|
|
2
|
+
import { deserializeMetadata, parseBody, parseErrorBody, compact } from "./constants.js";
|
|
3
|
+
import { de_GetSMSStatusResult } from "./GetSMSStatus.js";
|
|
4
|
+
export const se_ListSMSStatusCommand = async (input, config) => {
|
|
8
5
|
const hostname = "sens.apigw.ntruss.com";
|
|
9
6
|
const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
|
|
10
7
|
const headers = {
|
|
@@ -16,7 +13,7 @@ const se_ListSMSStatusCommand = async (input, config) => {
|
|
|
16
13
|
}
|
|
17
14
|
return acc;
|
|
18
15
|
}, {});
|
|
19
|
-
return new
|
|
16
|
+
return new HttpRequest({
|
|
20
17
|
protocol: "https:",
|
|
21
18
|
method: "GET",
|
|
22
19
|
hostname,
|
|
@@ -25,18 +22,16 @@ const se_ListSMSStatusCommand = async (input, config) => {
|
|
|
25
22
|
headers,
|
|
26
23
|
});
|
|
27
24
|
};
|
|
28
|
-
|
|
29
|
-
const de_ListSMSStatusCommand = async (response, config) => {
|
|
25
|
+
export const de_ListSMSStatusCommand = async (response, config) => {
|
|
30
26
|
if (response.statusCode >= 300)
|
|
31
|
-
await
|
|
32
|
-
const data = await
|
|
27
|
+
await parseErrorBody(response);
|
|
28
|
+
const data = await parseBody(response);
|
|
33
29
|
const contents = de_ListSMSStatusResult(data);
|
|
34
30
|
return {
|
|
35
|
-
$metadata:
|
|
36
|
-
...
|
|
31
|
+
$metadata: deserializeMetadata(response),
|
|
32
|
+
...compact(contents),
|
|
37
33
|
};
|
|
38
34
|
};
|
|
39
|
-
exports.de_ListSMSStatusCommand = de_ListSMSStatusCommand;
|
|
40
35
|
const de_ListSMSStatusResult = (output) => {
|
|
41
|
-
return
|
|
36
|
+
return de_GetSMSStatusResult(output);
|
|
42
37
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
5
|
-
const constants_js_1 = require("./constants.js");
|
|
6
|
-
const se_SendAlimtalkCommand = async (input, config) => {
|
|
1
|
+
import { HttpRequest } from "@ingestkorea/util-http-handler";
|
|
2
|
+
import { deserializeMetadata, parseBody, parseErrorBody, compact, convertToUtc } from "./constants.js";
|
|
3
|
+
export const se_SendAlimtalkCommand = async (input, config) => {
|
|
7
4
|
const hostname = "sens.apigw.ntruss.com";
|
|
8
5
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
|
|
9
6
|
const headers = {
|
|
@@ -15,7 +12,7 @@ const se_SendAlimtalkCommand = async (input, config) => {
|
|
|
15
12
|
templateCode: input.templateCode,
|
|
16
13
|
messages: input.messages,
|
|
17
14
|
});
|
|
18
|
-
return new
|
|
15
|
+
return new HttpRequest({
|
|
19
16
|
protocol: "https:",
|
|
20
17
|
method: "POST",
|
|
21
18
|
hostname,
|
|
@@ -24,32 +21,30 @@ const se_SendAlimtalkCommand = async (input, config) => {
|
|
|
24
21
|
body,
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
|
-
|
|
28
|
-
const de_SendAlimtalkCommand = async (response, config) => {
|
|
24
|
+
export const de_SendAlimtalkCommand = async (response, config) => {
|
|
29
25
|
if (response.statusCode >= 300)
|
|
30
|
-
await
|
|
31
|
-
const data = await
|
|
26
|
+
await parseErrorBody(response);
|
|
27
|
+
const data = await parseBody(response);
|
|
32
28
|
const contents = de_SendAlimtalkResult(data);
|
|
33
29
|
return {
|
|
34
|
-
$metadata:
|
|
35
|
-
...
|
|
30
|
+
$metadata: deserializeMetadata(response),
|
|
31
|
+
...compact(contents),
|
|
36
32
|
};
|
|
37
33
|
};
|
|
38
|
-
exports.de_SendAlimtalkCommand = de_SendAlimtalkCommand;
|
|
39
34
|
const de_SendAlimtalkResult = (output) => {
|
|
40
35
|
return {
|
|
41
36
|
requestId: output.requestId != undefined ? output.requestId : undefined,
|
|
42
|
-
requestTime: output.requestTime != undefined ?
|
|
37
|
+
requestTime: output.requestTime != undefined ? convertToUtc(output.requestTime) : undefined,
|
|
43
38
|
statusCode: output.statusCode != undefined ? output.statusCode : undefined,
|
|
44
39
|
statusName: output.statusName != undefined ? output.statusName : undefined,
|
|
45
40
|
messages: output.messages ? de_AlimtalkMessageRequestStatusList(output.messages) : [],
|
|
46
41
|
};
|
|
47
42
|
};
|
|
48
43
|
const de_AlimtalkMessageRequestStatusList = (output) => {
|
|
49
|
-
const result = (output || []).filter((e) => e != null).map((entry) =>
|
|
44
|
+
const result = (output || []).filter((e) => e != null).map((entry) => de_AlimtalkMessageRequestStatus(entry));
|
|
50
45
|
return result;
|
|
51
46
|
};
|
|
52
|
-
const de_AlimtalkMessageRequestStatus = (output) => {
|
|
47
|
+
export const de_AlimtalkMessageRequestStatus = (output) => {
|
|
53
48
|
return {
|
|
54
49
|
messageId: output.messageId != undefined ? output.messageId : undefined,
|
|
55
50
|
to: output.to != undefined ? output.to : undefined,
|
|
@@ -61,4 +56,3 @@ const de_AlimtalkMessageRequestStatus = (output) => {
|
|
|
61
56
|
useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
|
|
62
57
|
};
|
|
63
58
|
};
|
|
64
|
-
exports.de_AlimtalkMessageRequestStatus = de_AlimtalkMessageRequestStatus;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const SendSMS_js_1 = require("./SendSMS.js");
|
|
5
|
-
const se_SendMMSCommand = async (input, config) => {
|
|
6
|
-
return (0, SendSMS_js_1.se_SendSMSCommand)(input, config);
|
|
1
|
+
import { se_SendSMSCommand, de_SendSMSCommand } from "./SendSMS.js";
|
|
2
|
+
export const se_SendMMSCommand = async (input, config) => {
|
|
3
|
+
return se_SendSMSCommand(input, config);
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return (0, SendSMS_js_1.de_SendSMSCommand)(response, config);
|
|
5
|
+
export const de_SendMMSCommand = async (response, config) => {
|
|
6
|
+
return de_SendSMSCommand(response, config);
|
|
11
7
|
};
|
|
12
|
-
exports.de_SendMMSCommand = de_SendMMSCommand;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
5
|
-
const constants_js_1 = require("./constants.js");
|
|
6
|
-
const se_SendSMSCommand = async (input, config) => {
|
|
1
|
+
import { HttpRequest } from "@ingestkorea/util-http-handler";
|
|
2
|
+
import { deserializeMetadata, parseBody, parseErrorBody, compact, convertToUtc } from "./constants.js";
|
|
3
|
+
export const se_SendSMSCommand = async (input, config) => {
|
|
7
4
|
const hostname = "sens.apigw.ntruss.com";
|
|
8
5
|
const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
|
|
9
6
|
const headers = {
|
|
@@ -11,7 +8,7 @@ const se_SendSMSCommand = async (input, config) => {
|
|
|
11
8
|
host: hostname,
|
|
12
9
|
};
|
|
13
10
|
const body = JSON.stringify({ ...input });
|
|
14
|
-
return new
|
|
11
|
+
return new HttpRequest({
|
|
15
12
|
protocol: "https:",
|
|
16
13
|
method: "POST",
|
|
17
14
|
hostname,
|
|
@@ -20,24 +17,21 @@ const se_SendSMSCommand = async (input, config) => {
|
|
|
20
17
|
body,
|
|
21
18
|
});
|
|
22
19
|
};
|
|
23
|
-
|
|
24
|
-
const de_SendSMSCommand = async (response, config) => {
|
|
20
|
+
export const de_SendSMSCommand = async (response, config) => {
|
|
25
21
|
if (response.statusCode >= 300)
|
|
26
|
-
await
|
|
27
|
-
const data = await
|
|
28
|
-
const contents =
|
|
22
|
+
await parseErrorBody(response);
|
|
23
|
+
const data = await parseBody(response);
|
|
24
|
+
const contents = de_SendSMSResult(data);
|
|
29
25
|
return {
|
|
30
|
-
$metadata:
|
|
31
|
-
...
|
|
26
|
+
$metadata: deserializeMetadata(response),
|
|
27
|
+
...compact(contents),
|
|
32
28
|
};
|
|
33
29
|
};
|
|
34
|
-
|
|
35
|
-
const de_SendSMSResult = (output) => {
|
|
30
|
+
export const de_SendSMSResult = (output) => {
|
|
36
31
|
return {
|
|
37
32
|
requestId: output.requestId ? output.requestId : undefined,
|
|
38
|
-
requestTime: output.requestTime ?
|
|
33
|
+
requestTime: output.requestTime ? convertToUtc(output.requestTime) : undefined,
|
|
39
34
|
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
40
35
|
statusName: output.statusName ? output.statusName : undefined,
|
|
41
36
|
};
|
|
42
37
|
};
|
|
43
|
-
exports.de_SendSMSResult = de_SendSMSResult;
|