@ingestkorea/client-sens 1.7.0 → 1.9.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/LICENSE +1 -1
- package/README.md +98 -63
- package/dist-cjs/SensClient.js +57 -28
- package/dist-cjs/commands/GetAlimtalkResultCommand.js +5 -32
- package/dist-cjs/commands/GetAlimtalkStatusCommand.js +7 -35
- package/dist-cjs/commands/GetAlimtalkTemplateCommand.js +5 -32
- package/dist-cjs/commands/GetSMSResultCommand.js +8 -33
- package/dist-cjs/commands/GetSMSStatusCommand.js +7 -33
- package/dist-cjs/commands/ListAlimtalkChannelsCommand.js +6 -33
- package/dist-cjs/commands/ListAlimtalkStatusCommand.js +29 -35
- package/dist-cjs/commands/ListAlimtalkTemplatesCommand.js +5 -32
- package/dist-cjs/commands/ListSMSStatusCommand.js +37 -0
- package/dist-cjs/commands/SendAlimtalkCommand.js +36 -44
- package/dist-cjs/commands/SendMMSCommand.js +67 -103
- package/dist-cjs/commands/SendSMSCommand.js +38 -71
- package/dist-cjs/commands/constants.js +57 -14
- package/dist-cjs/commands/index.js +12 -11
- package/dist-cjs/index.js +2 -2
- package/dist-cjs/middleware/constants.js +10 -0
- package/dist-cjs/middleware/index.js +3 -4
- package/dist-cjs/middleware/middleware-metadata.js +4 -5
- package/dist-cjs/middleware/middleware-retry.js +32 -27
- package/dist-cjs/middleware/middleware-sign.js +10 -9
- package/dist-cjs/models/SendAlimtalk.js +3 -0
- package/dist-cjs/models/SendMMS.js +3 -0
- package/dist-cjs/models/SensClient.js +2 -0
- package/dist-cjs/models/SensErrorInfo.js +13 -0
- package/dist-cjs/models/SensMiddleware.js +2 -0
- package/dist-cjs/models/index.js +17 -14
- package/dist-cjs/protocols/GetAlimtalkResult.js +19 -22
- package/dist-cjs/protocols/GetAlimtalkStatus.js +39 -40
- package/dist-cjs/protocols/GetAlimtalkTemplate.js +56 -90
- package/dist-cjs/protocols/GetSMSResult.js +31 -48
- package/dist-cjs/protocols/GetSMSStatus.js +51 -37
- package/dist-cjs/protocols/ListAlimtalkChannels.js +27 -31
- package/dist-cjs/protocols/ListAlimtalkStatus.js +22 -19
- package/dist-cjs/protocols/ListAlimtalkTemplates.js +33 -25
- package/dist-cjs/protocols/ListSMSStatus.js +48 -0
- package/dist-cjs/protocols/SendAlimtalk.js +23 -27
- package/dist-cjs/protocols/SendMMS.js +8 -38
- package/dist-cjs/protocols/SendSMS.js +20 -22
- package/dist-cjs/protocols/constants.js +103 -34
- package/dist-es/SensClient.js +63 -30
- package/dist-es/commands/GetAlimtalkResultCommand.js +9 -19
- package/dist-es/commands/GetAlimtalkStatusCommand.js +12 -19
- package/dist-es/commands/GetAlimtalkTemplateCommand.js +9 -19
- package/dist-es/commands/GetSMSResultCommand.js +10 -20
- package/dist-es/commands/GetSMSStatusCommand.js +13 -20
- package/dist-es/commands/ListAlimtalkChannelsCommand.js +10 -22
- package/dist-es/commands/ListAlimtalkStatusCommand.js +39 -28
- package/dist-es/commands/ListAlimtalkTemplatesCommand.js +9 -19
- package/dist-es/commands/ListSMSStatusCommand.js +48 -0
- package/dist-es/commands/SendAlimtalkCommand.js +35 -30
- package/dist-es/commands/SendMMSCommand.js +70 -100
- package/dist-es/commands/SendSMSCommand.js +51 -66
- package/dist-es/commands/constants.js +65 -15
- package/dist-es/commands/index.js +28 -11
- package/dist-es/index.js +18 -2
- package/dist-es/middleware/constants.js +10 -0
- package/dist-es/middleware/index.js +19 -4
- package/dist-es/middleware/middleware-metadata.js +11 -5
- package/dist-es/middleware/middleware-retry.js +39 -30
- package/dist-es/middleware/middleware-sign.js +19 -14
- package/dist-es/models/GetAlimtalkResult.js +2 -1
- package/dist-es/models/GetAlimtalkStatus.js +2 -1
- package/dist-es/models/GetAlimtalkTemplate.js +2 -1
- package/dist-es/models/GetSMSResult.js +2 -1
- package/dist-es/models/GetSMSStatus.js +2 -1
- package/dist-es/models/ListAlimtalkChannels.js +2 -1
- package/dist-es/models/ListAlimtalkStatus.js +2 -1
- package/dist-es/models/ListAlimtalkTemplates.js +2 -1
- package/dist-es/models/ListSMSStatus.js +2 -0
- package/dist-es/models/MetadataBearer.js +2 -1
- package/dist-es/models/SendAlimtalk.js +5 -1
- package/dist-es/models/SendMMS.js +5 -1
- package/dist-es/models/SendSMS.js +2 -1
- package/dist-es/models/SensClient.js +2 -0
- package/dist-es/models/SensCommand.js +5 -1
- package/dist-es/models/SensErrorInfo.js +13 -0
- package/dist-es/models/SensMiddleware.js +2 -0
- package/dist-es/models/index.js +33 -14
- package/dist-es/protocols/GetAlimtalkResult.js +24 -23
- package/dist-es/protocols/GetAlimtalkStatus.js +51 -47
- package/dist-es/protocols/GetAlimtalkTemplate.js +78 -87
- package/dist-es/protocols/GetSMSResult.js +40 -47
- package/dist-es/protocols/GetSMSStatus.js +55 -37
- package/dist-es/protocols/ListAlimtalkChannels.js +31 -31
- package/dist-es/protocols/ListAlimtalkStatus.js +26 -32
- package/dist-es/protocols/ListAlimtalkTemplates.js +37 -24
- package/dist-es/protocols/ListSMSStatus.js +42 -0
- package/dist-es/protocols/SendAlimtalk.js +27 -26
- package/dist-es/protocols/SendMMS.js +10 -49
- package/dist-es/protocols/SendSMS.js +24 -31
- package/dist-es/protocols/constants.js +119 -39
- package/dist-types/SensClient.d.ts +3 -20
- package/dist-types/commands/GetAlimtalkResultCommand.d.ts +5 -10
- package/dist-types/commands/GetAlimtalkStatusCommand.d.ts +5 -10
- package/dist-types/commands/GetAlimtalkTemplateCommand.d.ts +5 -10
- package/dist-types/commands/GetSMSResultCommand.d.ts +5 -10
- package/dist-types/commands/GetSMSStatusCommand.d.ts +5 -10
- package/dist-types/commands/ListAlimtalkChannelsCommand.d.ts +5 -10
- package/dist-types/commands/ListAlimtalkStatusCommand.d.ts +5 -10
- package/dist-types/commands/ListAlimtalkTemplatesCommand.d.ts +5 -10
- package/dist-types/commands/ListSMSStatusCommand.d.ts +11 -0
- package/dist-types/commands/SendAlimtalkCommand.d.ts +5 -10
- package/dist-types/commands/SendMMSCommand.d.ts +5 -10
- package/dist-types/commands/SendSMSCommand.d.ts +9 -10
- package/dist-types/commands/constants.d.ts +14 -4
- package/dist-types/commands/index.d.ts +12 -11
- package/dist-types/index.d.ts +2 -2
- package/dist-types/middleware/constants.d.ts +7 -0
- package/dist-types/middleware/index.d.ts +3 -4
- package/dist-types/middleware/middleware-metadata.d.ts +2 -2
- package/dist-types/middleware/middleware-retry.d.ts +2 -2
- package/dist-types/middleware/middleware-sign.d.ts +2 -2
- package/dist-types/models/GetAlimtalkResult.d.ts +3 -3
- package/dist-types/models/GetAlimtalkStatus.d.ts +8 -5
- package/dist-types/models/GetAlimtalkTemplate.d.ts +5 -5
- package/dist-types/models/GetSMSResult.d.ts +7 -15
- package/dist-types/models/GetSMSStatus.d.ts +19 -4
- package/dist-types/models/ListAlimtalkChannels.d.ts +4 -4
- package/dist-types/models/ListAlimtalkStatus.d.ts +8 -8
- package/dist-types/models/ListAlimtalkTemplates.d.ts +2 -2
- package/dist-types/models/ListSMSStatus.d.ts +15 -0
- package/dist-types/models/MetadataBearer.d.ts +3 -3
- package/dist-types/models/SendAlimtalk.d.ts +7 -4
- package/dist-types/models/SendMMS.d.ts +5 -3
- package/dist-types/models/SendSMS.d.ts +2 -2
- package/dist-types/models/SensClient.d.ts +17 -0
- package/dist-types/models/SensCommand.d.ts +4 -6
- package/dist-types/models/SensErrorInfo.d.ts +21 -0
- package/dist-types/models/SensMiddleware.d.ts +8 -0
- package/dist-types/models/index.d.ts +17 -14
- package/dist-types/protocols/GetAlimtalkResult.d.ts +4 -11
- package/dist-types/protocols/GetAlimtalkStatus.d.ts +6 -12
- package/dist-types/protocols/GetAlimtalkTemplate.d.ts +4 -14
- package/dist-types/protocols/GetSMSResult.d.ts +4 -12
- package/dist-types/protocols/GetSMSStatus.d.ts +6 -11
- package/dist-types/protocols/ListAlimtalkChannels.d.ts +4 -11
- package/dist-types/protocols/ListAlimtalkStatus.d.ts +4 -10
- package/dist-types/protocols/ListAlimtalkTemplates.d.ts +5 -12
- package/dist-types/protocols/ListSMSStatus.d.ts +4 -0
- package/dist-types/protocols/SendAlimtalk.d.ts +5 -12
- package/dist-types/protocols/SendMMS.d.ts +4 -10
- package/dist-types/protocols/SendSMS.d.ts +5 -10
- package/dist-types/protocols/constants.d.ts +4 -2
- package/package.json +20 -4
- package/.github/pull_request_template.md +0 -19
- package/dist-cjs/middleware/middleware-sort-headers.js +0 -25
- package/dist-cjs/protocols/index.js +0 -28
- package/dist-es/middleware/middleware-sort-headers.js +0 -12
- package/dist-es/models/Middleware.js +0 -1
- package/dist-es/protocols/index.js +0 -12
- package/dist-types/middleware/middleware-sort-headers.d.ts +0 -2
- package/dist-types/models/Middleware.d.ts +0 -12
- package/dist-types/protocols/index.d.ts +0 -12
- /package/dist-cjs/models/{Middleware.js → ListSMSStatus.js} +0 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_ListAlimtalkChannelsCommand = exports.se_ListAlimtalkChannelsCommand = void 0;
|
|
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) => {
|
|
4
7
|
const hostname = "sens.apigw.ntruss.com";
|
|
5
8
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/channels";
|
|
6
9
|
const headers = {
|
|
7
10
|
host: hostname,
|
|
8
11
|
};
|
|
9
|
-
return new HttpRequest({
|
|
12
|
+
return new util_http_handler_1.HttpRequest({
|
|
10
13
|
protocol: "https:",
|
|
11
14
|
method: "GET",
|
|
12
15
|
hostname: hostname,
|
|
@@ -14,37 +17,34 @@ export const serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = async (
|
|
|
14
17
|
headers: headers,
|
|
15
18
|
});
|
|
16
19
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
await parseErrorBody(
|
|
21
|
-
const data = await parseBody(
|
|
22
|
-
|
|
23
|
-
contents = await deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput(data);
|
|
20
|
+
exports.se_ListAlimtalkChannelsCommand = se_ListAlimtalkChannelsCommand;
|
|
21
|
+
const de_ListAlimtalkChannelsCommand = async (response, config) => {
|
|
22
|
+
if (response.statusCode >= 300)
|
|
23
|
+
await (0, constants_js_1.parseErrorBody)(response);
|
|
24
|
+
const data = await (0, constants_js_1.parseBody)(response);
|
|
25
|
+
const contents = de_ListAlimtalkChannelsResult(data);
|
|
24
26
|
return {
|
|
25
|
-
$metadata:
|
|
26
|
-
|
|
27
|
-
...output.$metadata,
|
|
28
|
-
},
|
|
29
|
-
...contents,
|
|
27
|
+
$metadata: (0, constants_js_1.deserializeMetadata)(response),
|
|
28
|
+
...(0, constants_js_1.compact)(contents),
|
|
30
29
|
};
|
|
31
30
|
};
|
|
32
|
-
|
|
31
|
+
exports.de_ListAlimtalkChannelsCommand = de_ListAlimtalkChannelsCommand;
|
|
32
|
+
const de_ListAlimtalkChannelsResult = (output) => {
|
|
33
33
|
return {
|
|
34
|
-
channels:
|
|
34
|
+
channels: output.channels ? de_AlimtalkChannelList(output.channels) : [],
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
const de_AlimtalkChannelList = (output) => {
|
|
38
|
+
return (output || []).filter((e) => e != null).map((entry) => de_AlimtalkChannel(entry));
|
|
39
|
+
};
|
|
40
|
+
const de_AlimtalkChannel = (output) => {
|
|
41
|
+
return {
|
|
42
|
+
createTime: output.createTime != undefined ? (0, constants_js_1.convertToUtc)(output.createTime) : undefined,
|
|
43
|
+
updateTime: output.updateTime != undefined ? (0, constants_js_1.convertToUtc)(output.updateTime) : undefined,
|
|
44
|
+
serviceId: output.serviceId != undefined ? output.serviceId : undefined,
|
|
45
|
+
channelId: output.channelId != undefined ? output.channelId : undefined,
|
|
46
|
+
channelName: output.channelName != undefined ? output.channelName : undefined,
|
|
47
|
+
channelStatus: output.channelStatus != undefined ? output.channelStatus : undefined,
|
|
48
|
+
useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
|
|
49
|
+
};
|
|
50
50
|
};
|
|
@@ -1,48 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_ListAlimtalkStatusCommand = exports.se_ListAlimtalkStatusCommand = void 0;
|
|
4
|
+
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
5
|
+
const constants_js_1 = require("./constants.js");
|
|
6
|
+
const GetAlimtalkStatus_js_1 = require("./GetAlimtalkStatus.js");
|
|
7
|
+
const se_ListAlimtalkStatusCommand = async (input, config) => {
|
|
4
8
|
const hostname = "sens.apigw.ntruss.com";
|
|
5
9
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
|
|
6
10
|
const headers = {
|
|
7
11
|
host: hostname,
|
|
8
12
|
};
|
|
9
|
-
const query = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...(input.to && { to: input.to.replace(/\-/gi, "") }),
|
|
17
|
-
...(input.requestStartTime && { requestStartTime: input.requestStartTime }),
|
|
18
|
-
...(input.requestEndTime && { requestEndTime: input.requestEndTime }),
|
|
19
|
-
...(input.pageIndex != null && { pageIndex: input.pageIndex.toString() }),
|
|
20
|
-
...(input.pageSize && { pageSize: input.pageSize.toString() }),
|
|
21
|
-
};
|
|
22
|
-
return new HttpRequest({
|
|
13
|
+
const query = Object.entries(input).reduce((acc, [key, value]) => {
|
|
14
|
+
if (value !== undefined && value !== null) {
|
|
15
|
+
acc[key] = String(value);
|
|
16
|
+
}
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
19
|
+
return new util_http_handler_1.HttpRequest({
|
|
23
20
|
protocol: "https:",
|
|
24
21
|
method: "GET",
|
|
25
22
|
hostname: hostname,
|
|
26
23
|
path: path,
|
|
27
24
|
headers: headers,
|
|
28
|
-
query
|
|
25
|
+
query,
|
|
29
26
|
});
|
|
30
27
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
await parseErrorBody(
|
|
35
|
-
const data = await parseBody(
|
|
36
|
-
|
|
37
|
-
contents = await deserializeIngestkorea_restJson_ListAlimtalkStatusOutput(data);
|
|
28
|
+
exports.se_ListAlimtalkStatusCommand = se_ListAlimtalkStatusCommand;
|
|
29
|
+
const de_ListAlimtalkStatusCommand = async (response, config) => {
|
|
30
|
+
if (response.statusCode >= 300)
|
|
31
|
+
await (0, constants_js_1.parseErrorBody)(response);
|
|
32
|
+
const data = await (0, constants_js_1.parseBody)(response);
|
|
33
|
+
const contents = de_ListAlimtalkStatusResult(data);
|
|
38
34
|
return {
|
|
39
|
-
$metadata:
|
|
40
|
-
|
|
41
|
-
...output.$metadata,
|
|
42
|
-
},
|
|
43
|
-
...contents,
|
|
35
|
+
$metadata: (0, constants_js_1.deserializeMetadata)(response),
|
|
36
|
+
...(0, constants_js_1.compact)(contents),
|
|
44
37
|
};
|
|
45
38
|
};
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
exports.de_ListAlimtalkStatusCommand = de_ListAlimtalkStatusCommand;
|
|
40
|
+
const de_ListAlimtalkStatusResult = (output) => {
|
|
41
|
+
return (0, GetAlimtalkStatus_js_1.de_GetAlimtalkStatusResult)(output);
|
|
48
42
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_Template = exports.de_ListAlimtalkTemplatesCommand = exports.se_ListAlimtalkTemplatesCommand = void 0;
|
|
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) => {
|
|
4
7
|
const hostname = "sens.apigw.ntruss.com";
|
|
5
8
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/templates";
|
|
6
9
|
const headers = {
|
|
@@ -9,7 +12,7 @@ export const serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = async
|
|
|
9
12
|
const query = {
|
|
10
13
|
channelId: input.channelId,
|
|
11
14
|
};
|
|
12
|
-
return new HttpRequest({
|
|
15
|
+
return new util_http_handler_1.HttpRequest({
|
|
13
16
|
protocol: "https:",
|
|
14
17
|
method: "GET",
|
|
15
18
|
hostname: hostname,
|
|
@@ -18,36 +21,46 @@ export const serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = async
|
|
|
18
21
|
headers: headers,
|
|
19
22
|
});
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
await parseErrorBody(
|
|
25
|
-
const data = await parseBody(
|
|
26
|
-
|
|
27
|
-
contents = await deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput(data);
|
|
24
|
+
exports.se_ListAlimtalkTemplatesCommand = se_ListAlimtalkTemplatesCommand;
|
|
25
|
+
const de_ListAlimtalkTemplatesCommand = async (response, config) => {
|
|
26
|
+
if (response.statusCode >= 300)
|
|
27
|
+
await (0, constants_js_1.parseErrorBody)(response);
|
|
28
|
+
const data = await (0, constants_js_1.parseBody)(response);
|
|
29
|
+
const contents = de_ListAlimtalkTemplatesResult(data);
|
|
28
30
|
return {
|
|
29
|
-
$metadata:
|
|
30
|
-
|
|
31
|
-
...output.$metadata,
|
|
32
|
-
},
|
|
33
|
-
...contents,
|
|
31
|
+
$metadata: (0, constants_js_1.deserializeMetadata)(response),
|
|
32
|
+
...(0, constants_js_1.compact)(contents),
|
|
34
33
|
};
|
|
35
34
|
};
|
|
36
|
-
|
|
35
|
+
exports.de_ListAlimtalkTemplatesCommand = de_ListAlimtalkTemplatesCommand;
|
|
36
|
+
const de_ListAlimtalkTemplatesResult = (output) => {
|
|
37
37
|
return {
|
|
38
|
-
templates:
|
|
38
|
+
templates: Array.isArray(output) ? de_TemplateList(output) : [],
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const de_TemplateList = (output) => {
|
|
42
|
+
return (output || [])
|
|
43
|
+
.filter((e) => e != null)
|
|
44
|
+
.map((entry) => (0, exports.de_Template)(entry))
|
|
45
|
+
.sort((a, b) => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
// 생성 날짜 기준 내림차순
|
|
48
|
+
const dateA = ((_a = a.createTime) !== null && _a !== void 0 ? _a : "").replace(/\.\d{3}Z?$/, "");
|
|
49
|
+
const dateB = ((_b = b.createTime) !== null && _b !== void 0 ? _b : "").replace(/\.\d{3}Z?$/, "");
|
|
50
|
+
if (dateB < dateA)
|
|
51
|
+
return -1;
|
|
52
|
+
if (dateB > dateA)
|
|
53
|
+
return 1;
|
|
54
|
+
return 0;
|
|
55
|
+
});
|
|
44
56
|
};
|
|
45
|
-
|
|
57
|
+
const de_Template = (output) => {
|
|
46
58
|
return {
|
|
47
|
-
createTime: output.createTime
|
|
48
|
-
updateTime: output.updateTime
|
|
59
|
+
createTime: output.createTime ? (0, constants_js_1.convertToUtc)(output.createTime) : undefined,
|
|
60
|
+
updateTime: output.updateTime ? (0, constants_js_1.convertToUtc)(output.updateTime) : undefined,
|
|
49
61
|
channelId: output.channelId != undefined ? output.channelId : undefined,
|
|
50
62
|
templateCode: output.templateCode != undefined ? output.templateCode : undefined,
|
|
51
63
|
templateName: output.templateName != undefined ? output.templateName : undefined,
|
|
52
64
|
};
|
|
53
65
|
};
|
|
66
|
+
exports.de_Template = de_Template;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_ListSMSStatusCommand = exports.se_ListSMSStatusCommand = void 0;
|
|
4
|
+
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
5
|
+
const constants_js_1 = require("./constants.js");
|
|
6
|
+
const GetSMSStatus_js_1 = require("./GetSMSStatus.js");
|
|
7
|
+
const se_ListSMSStatusCommand = async (input, config) => {
|
|
8
|
+
const hostname = "sens.apigw.ntruss.com";
|
|
9
|
+
const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
|
|
10
|
+
const headers = {
|
|
11
|
+
host: hostname,
|
|
12
|
+
};
|
|
13
|
+
const query = Object.entries(input).reduce((acc, [key, value]) => {
|
|
14
|
+
if (value !== undefined && value !== null) {
|
|
15
|
+
acc[key] = String(value);
|
|
16
|
+
}
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
19
|
+
return new util_http_handler_1.HttpRequest({
|
|
20
|
+
protocol: "https:",
|
|
21
|
+
method: "GET",
|
|
22
|
+
hostname,
|
|
23
|
+
path,
|
|
24
|
+
query,
|
|
25
|
+
headers,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
exports.se_ListSMSStatusCommand = se_ListSMSStatusCommand;
|
|
29
|
+
const de_ListSMSStatusCommand = async (response, config) => {
|
|
30
|
+
if (response.statusCode >= 300)
|
|
31
|
+
await (0, constants_js_1.parseErrorBody)(response);
|
|
32
|
+
const data = await (0, constants_js_1.parseBody)(response);
|
|
33
|
+
const contents = de_ListSMSStatusResult(data);
|
|
34
|
+
return {
|
|
35
|
+
$metadata: (0, constants_js_1.deserializeMetadata)(response),
|
|
36
|
+
...(0, constants_js_1.compact)(contents),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.de_ListSMSStatusCommand = de_ListSMSStatusCommand;
|
|
40
|
+
const de_ListSMSStatusResult = (output) => {
|
|
41
|
+
return (0, GetSMSStatus_js_1.de_GetSMSStatusResult)(output);
|
|
42
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_AlimtalkMessageRequestStatus = exports.de_SendAlimtalkCommand = exports.se_SendAlimtalkCommand = void 0;
|
|
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) => {
|
|
4
7
|
const hostname = "sens.apigw.ntruss.com";
|
|
5
8
|
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
|
|
6
9
|
const headers = {
|
|
@@ -12,44 +15,41 @@ export const serializeIngestkorea_restJson_SendAlimtalkCommand = async (input, c
|
|
|
12
15
|
templateCode: input.templateCode,
|
|
13
16
|
messages: input.messages,
|
|
14
17
|
});
|
|
15
|
-
return new HttpRequest({
|
|
18
|
+
return new util_http_handler_1.HttpRequest({
|
|
16
19
|
protocol: "https:",
|
|
17
20
|
method: "POST",
|
|
18
|
-
hostname
|
|
19
|
-
path
|
|
20
|
-
headers
|
|
21
|
-
body
|
|
21
|
+
hostname,
|
|
22
|
+
path,
|
|
23
|
+
headers,
|
|
24
|
+
body,
|
|
22
25
|
});
|
|
23
26
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
await parseErrorBody(
|
|
28
|
-
const data = await parseBody(
|
|
29
|
-
|
|
30
|
-
contents = await deserializeIngestkorea_restJson_SendMessageOutput(data);
|
|
27
|
+
exports.se_SendAlimtalkCommand = se_SendAlimtalkCommand;
|
|
28
|
+
const de_SendAlimtalkCommand = async (response, config) => {
|
|
29
|
+
if (response.statusCode >= 300)
|
|
30
|
+
await (0, constants_js_1.parseErrorBody)(response);
|
|
31
|
+
const data = await (0, constants_js_1.parseBody)(response);
|
|
32
|
+
const contents = de_SendAlimtalkResult(data);
|
|
31
33
|
return {
|
|
32
|
-
$metadata:
|
|
33
|
-
|
|
34
|
-
...output.$metadata,
|
|
35
|
-
},
|
|
36
|
-
...contents,
|
|
34
|
+
$metadata: (0, constants_js_1.deserializeMetadata)(response),
|
|
35
|
+
...(0, constants_js_1.compact)(contents),
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
|
-
|
|
38
|
+
exports.de_SendAlimtalkCommand = de_SendAlimtalkCommand;
|
|
39
|
+
const de_SendAlimtalkResult = (output) => {
|
|
40
40
|
return {
|
|
41
41
|
requestId: output.requestId != undefined ? output.requestId : undefined,
|
|
42
|
-
requestTime: output.requestTime != undefined ? output.requestTime : undefined,
|
|
42
|
+
requestTime: output.requestTime != undefined ? (0, constants_js_1.convertToUtc)(output.requestTime) : undefined,
|
|
43
43
|
statusCode: output.statusCode != undefined ? output.statusCode : undefined,
|
|
44
44
|
statusName: output.statusName != undefined ? output.statusName : undefined,
|
|
45
|
-
messages: output.messages
|
|
45
|
+
messages: output.messages ? de_AlimtalkMessageRequestStatusList(output.messages) : [],
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
const result =
|
|
48
|
+
const de_AlimtalkMessageRequestStatusList = (output) => {
|
|
49
|
+
const result = (output || []).filter((e) => e != null).map((entry) => (0, exports.de_AlimtalkMessageRequestStatus)(entry));
|
|
50
50
|
return result;
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
const de_AlimtalkMessageRequestStatus = (output) => {
|
|
53
53
|
return {
|
|
54
54
|
messageId: output.messageId != undefined ? output.messageId : undefined,
|
|
55
55
|
to: output.to != undefined ? output.to : undefined,
|
|
@@ -61,3 +61,4 @@ export const parseReceivedMessage = (output) => {
|
|
|
61
61
|
useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
+
exports.de_AlimtalkMessageRequestStatus = de_AlimtalkMessageRequestStatus;
|
|
@@ -1,51 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"content-type": "application/json; charset=utf-8",
|
|
8
|
-
host: hostname,
|
|
9
|
-
};
|
|
10
|
-
const body = JSON.stringify({
|
|
11
|
-
from: input.from,
|
|
12
|
-
content: input.content,
|
|
13
|
-
messages: input.messages,
|
|
14
|
-
type: input.type != undefined ? input.type : "MMS",
|
|
15
|
-
files: input.files,
|
|
16
|
-
...(input.contentType != undefined && { contentType: input.contentType }),
|
|
17
|
-
...(input.countryCode != undefined && { countryCode: input.countryCode }),
|
|
18
|
-
...(input.subject != undefined && { subject: input.subject }),
|
|
19
|
-
});
|
|
20
|
-
return new HttpRequest({
|
|
21
|
-
protocol: "https:",
|
|
22
|
-
method: "POST",
|
|
23
|
-
hostname: hostname,
|
|
24
|
-
path: path,
|
|
25
|
-
headers: headers,
|
|
26
|
-
body: body,
|
|
27
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_SendMMSCommand = exports.se_SendMMSCommand = void 0;
|
|
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);
|
|
28
7
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
await parseErrorBody(httpResponse);
|
|
33
|
-
const data = await parseBody(httpResponse); // SendSMSOutput
|
|
34
|
-
let contents = {};
|
|
35
|
-
contents = await deserializeIngestkorea_restJson_SendMMSOutput(data);
|
|
36
|
-
return {
|
|
37
|
-
$metadata: {
|
|
38
|
-
...deserializeMetadata(httpResponse),
|
|
39
|
-
...output.$metadata,
|
|
40
|
-
},
|
|
41
|
-
...contents,
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export const deserializeIngestkorea_restJson_SendMMSOutput = async (output) => {
|
|
45
|
-
return {
|
|
46
|
-
requestId: output.requestId ? output.requestId : undefined,
|
|
47
|
-
requestTime: output.requestTime ? output.requestTime : undefined,
|
|
48
|
-
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
49
|
-
statusName: output.statusName ? output.statusName : undefined,
|
|
50
|
-
};
|
|
8
|
+
exports.se_SendMMSCommand = se_SendMMSCommand;
|
|
9
|
+
const de_SendMMSCommand = async (response, config) => {
|
|
10
|
+
return (0, SendSMS_js_1.de_SendSMSCommand)(response, config);
|
|
51
11
|
};
|
|
12
|
+
exports.de_SendMMSCommand = de_SendMMSCommand;
|
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_SendSMSResult = exports.de_SendSMSCommand = exports.se_SendSMSCommand = void 0;
|
|
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) => {
|
|
4
7
|
const hostname = "sens.apigw.ntruss.com";
|
|
5
8
|
const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
|
|
6
9
|
const headers = {
|
|
7
10
|
"content-type": "application/json; charset=utf-8",
|
|
8
11
|
host: hostname,
|
|
9
12
|
};
|
|
10
|
-
const body = JSON.stringify({
|
|
11
|
-
|
|
12
|
-
content: input.content,
|
|
13
|
-
messages: input.messages,
|
|
14
|
-
type: input.type != undefined ? input.type : "SMS",
|
|
15
|
-
...(input.contentType != undefined && { contentType: input.contentType }),
|
|
16
|
-
...(input.countryCode != undefined && { countryCode: input.countryCode }),
|
|
17
|
-
...(input.subject != undefined && input.type === "LMS" && { subject: input.subject }),
|
|
18
|
-
});
|
|
19
|
-
return new HttpRequest({
|
|
13
|
+
const body = JSON.stringify({ ...input });
|
|
14
|
+
return new util_http_handler_1.HttpRequest({
|
|
20
15
|
protocol: "https:",
|
|
21
16
|
method: "POST",
|
|
22
|
-
hostname
|
|
23
|
-
path
|
|
24
|
-
headers
|
|
25
|
-
body
|
|
17
|
+
hostname,
|
|
18
|
+
path,
|
|
19
|
+
headers,
|
|
20
|
+
body,
|
|
26
21
|
});
|
|
27
22
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
await parseErrorBody(
|
|
32
|
-
const data = await parseBody(
|
|
33
|
-
|
|
34
|
-
contents = await deserializeIngestkorea_restJson_SendSMSOutput(data);
|
|
23
|
+
exports.se_SendSMSCommand = se_SendSMSCommand;
|
|
24
|
+
const de_SendSMSCommand = async (response, config) => {
|
|
25
|
+
if (response.statusCode >= 300)
|
|
26
|
+
await (0, constants_js_1.parseErrorBody)(response);
|
|
27
|
+
const data = await (0, constants_js_1.parseBody)(response);
|
|
28
|
+
const contents = (0, exports.de_SendSMSResult)(data);
|
|
35
29
|
return {
|
|
36
|
-
$metadata:
|
|
37
|
-
|
|
38
|
-
...output.$metadata,
|
|
39
|
-
},
|
|
40
|
-
...contents,
|
|
30
|
+
$metadata: (0, constants_js_1.deserializeMetadata)(response),
|
|
31
|
+
...(0, constants_js_1.compact)(contents),
|
|
41
32
|
};
|
|
42
33
|
};
|
|
43
|
-
|
|
34
|
+
exports.de_SendSMSCommand = de_SendSMSCommand;
|
|
35
|
+
const de_SendSMSResult = (output) => {
|
|
44
36
|
return {
|
|
45
37
|
requestId: output.requestId ? output.requestId : undefined,
|
|
46
|
-
requestTime: output.requestTime ? output.requestTime : undefined,
|
|
38
|
+
requestTime: output.requestTime ? (0, constants_js_1.convertToUtc)(output.requestTime) : undefined,
|
|
47
39
|
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
48
40
|
statusName: output.statusName ? output.statusName : undefined,
|
|
49
41
|
};
|
|
50
42
|
};
|
|
43
|
+
exports.de_SendSMSResult = de_SendSMSResult;
|