@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.
Files changed (157) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +98 -63
  3. package/dist-cjs/SensClient.js +57 -28
  4. package/dist-cjs/commands/GetAlimtalkResultCommand.js +5 -32
  5. package/dist-cjs/commands/GetAlimtalkStatusCommand.js +7 -35
  6. package/dist-cjs/commands/GetAlimtalkTemplateCommand.js +5 -32
  7. package/dist-cjs/commands/GetSMSResultCommand.js +8 -33
  8. package/dist-cjs/commands/GetSMSStatusCommand.js +7 -33
  9. package/dist-cjs/commands/ListAlimtalkChannelsCommand.js +6 -33
  10. package/dist-cjs/commands/ListAlimtalkStatusCommand.js +29 -35
  11. package/dist-cjs/commands/ListAlimtalkTemplatesCommand.js +5 -32
  12. package/dist-cjs/commands/ListSMSStatusCommand.js +37 -0
  13. package/dist-cjs/commands/SendAlimtalkCommand.js +36 -44
  14. package/dist-cjs/commands/SendMMSCommand.js +67 -103
  15. package/dist-cjs/commands/SendSMSCommand.js +38 -71
  16. package/dist-cjs/commands/constants.js +57 -14
  17. package/dist-cjs/commands/index.js +12 -11
  18. package/dist-cjs/index.js +2 -2
  19. package/dist-cjs/middleware/constants.js +10 -0
  20. package/dist-cjs/middleware/index.js +3 -4
  21. package/dist-cjs/middleware/middleware-metadata.js +4 -5
  22. package/dist-cjs/middleware/middleware-retry.js +32 -27
  23. package/dist-cjs/middleware/middleware-sign.js +10 -9
  24. package/dist-cjs/models/SendAlimtalk.js +3 -0
  25. package/dist-cjs/models/SendMMS.js +3 -0
  26. package/dist-cjs/models/SensClient.js +2 -0
  27. package/dist-cjs/models/SensErrorInfo.js +13 -0
  28. package/dist-cjs/models/SensMiddleware.js +2 -0
  29. package/dist-cjs/models/index.js +17 -14
  30. package/dist-cjs/protocols/GetAlimtalkResult.js +19 -22
  31. package/dist-cjs/protocols/GetAlimtalkStatus.js +39 -40
  32. package/dist-cjs/protocols/GetAlimtalkTemplate.js +56 -90
  33. package/dist-cjs/protocols/GetSMSResult.js +31 -48
  34. package/dist-cjs/protocols/GetSMSStatus.js +51 -37
  35. package/dist-cjs/protocols/ListAlimtalkChannels.js +27 -31
  36. package/dist-cjs/protocols/ListAlimtalkStatus.js +22 -19
  37. package/dist-cjs/protocols/ListAlimtalkTemplates.js +33 -25
  38. package/dist-cjs/protocols/ListSMSStatus.js +48 -0
  39. package/dist-cjs/protocols/SendAlimtalk.js +23 -27
  40. package/dist-cjs/protocols/SendMMS.js +8 -38
  41. package/dist-cjs/protocols/SendSMS.js +20 -22
  42. package/dist-cjs/protocols/constants.js +103 -34
  43. package/dist-es/SensClient.js +63 -30
  44. package/dist-es/commands/GetAlimtalkResultCommand.js +9 -19
  45. package/dist-es/commands/GetAlimtalkStatusCommand.js +12 -19
  46. package/dist-es/commands/GetAlimtalkTemplateCommand.js +9 -19
  47. package/dist-es/commands/GetSMSResultCommand.js +10 -20
  48. package/dist-es/commands/GetSMSStatusCommand.js +13 -20
  49. package/dist-es/commands/ListAlimtalkChannelsCommand.js +10 -22
  50. package/dist-es/commands/ListAlimtalkStatusCommand.js +39 -28
  51. package/dist-es/commands/ListAlimtalkTemplatesCommand.js +9 -19
  52. package/dist-es/commands/ListSMSStatusCommand.js +48 -0
  53. package/dist-es/commands/SendAlimtalkCommand.js +35 -30
  54. package/dist-es/commands/SendMMSCommand.js +70 -100
  55. package/dist-es/commands/SendSMSCommand.js +51 -66
  56. package/dist-es/commands/constants.js +65 -15
  57. package/dist-es/commands/index.js +28 -11
  58. package/dist-es/index.js +18 -2
  59. package/dist-es/middleware/constants.js +10 -0
  60. package/dist-es/middleware/index.js +19 -4
  61. package/dist-es/middleware/middleware-metadata.js +11 -5
  62. package/dist-es/middleware/middleware-retry.js +39 -30
  63. package/dist-es/middleware/middleware-sign.js +19 -14
  64. package/dist-es/models/GetAlimtalkResult.js +2 -1
  65. package/dist-es/models/GetAlimtalkStatus.js +2 -1
  66. package/dist-es/models/GetAlimtalkTemplate.js +2 -1
  67. package/dist-es/models/GetSMSResult.js +2 -1
  68. package/dist-es/models/GetSMSStatus.js +2 -1
  69. package/dist-es/models/ListAlimtalkChannels.js +2 -1
  70. package/dist-es/models/ListAlimtalkStatus.js +2 -1
  71. package/dist-es/models/ListAlimtalkTemplates.js +2 -1
  72. package/dist-es/models/ListSMSStatus.js +2 -0
  73. package/dist-es/models/MetadataBearer.js +2 -1
  74. package/dist-es/models/SendAlimtalk.js +5 -1
  75. package/dist-es/models/SendMMS.js +5 -1
  76. package/dist-es/models/SendSMS.js +2 -1
  77. package/dist-es/models/SensClient.js +2 -0
  78. package/dist-es/models/SensCommand.js +5 -1
  79. package/dist-es/models/SensErrorInfo.js +13 -0
  80. package/dist-es/models/SensMiddleware.js +2 -0
  81. package/dist-es/models/index.js +33 -14
  82. package/dist-es/protocols/GetAlimtalkResult.js +24 -23
  83. package/dist-es/protocols/GetAlimtalkStatus.js +51 -47
  84. package/dist-es/protocols/GetAlimtalkTemplate.js +78 -87
  85. package/dist-es/protocols/GetSMSResult.js +40 -47
  86. package/dist-es/protocols/GetSMSStatus.js +55 -37
  87. package/dist-es/protocols/ListAlimtalkChannels.js +31 -31
  88. package/dist-es/protocols/ListAlimtalkStatus.js +26 -32
  89. package/dist-es/protocols/ListAlimtalkTemplates.js +37 -24
  90. package/dist-es/protocols/ListSMSStatus.js +42 -0
  91. package/dist-es/protocols/SendAlimtalk.js +27 -26
  92. package/dist-es/protocols/SendMMS.js +10 -49
  93. package/dist-es/protocols/SendSMS.js +24 -31
  94. package/dist-es/protocols/constants.js +119 -39
  95. package/dist-types/SensClient.d.ts +3 -20
  96. package/dist-types/commands/GetAlimtalkResultCommand.d.ts +5 -10
  97. package/dist-types/commands/GetAlimtalkStatusCommand.d.ts +5 -10
  98. package/dist-types/commands/GetAlimtalkTemplateCommand.d.ts +5 -10
  99. package/dist-types/commands/GetSMSResultCommand.d.ts +5 -10
  100. package/dist-types/commands/GetSMSStatusCommand.d.ts +5 -10
  101. package/dist-types/commands/ListAlimtalkChannelsCommand.d.ts +5 -10
  102. package/dist-types/commands/ListAlimtalkStatusCommand.d.ts +5 -10
  103. package/dist-types/commands/ListAlimtalkTemplatesCommand.d.ts +5 -10
  104. package/dist-types/commands/ListSMSStatusCommand.d.ts +11 -0
  105. package/dist-types/commands/SendAlimtalkCommand.d.ts +5 -10
  106. package/dist-types/commands/SendMMSCommand.d.ts +5 -10
  107. package/dist-types/commands/SendSMSCommand.d.ts +9 -10
  108. package/dist-types/commands/constants.d.ts +14 -4
  109. package/dist-types/commands/index.d.ts +12 -11
  110. package/dist-types/index.d.ts +2 -2
  111. package/dist-types/middleware/constants.d.ts +7 -0
  112. package/dist-types/middleware/index.d.ts +3 -4
  113. package/dist-types/middleware/middleware-metadata.d.ts +2 -2
  114. package/dist-types/middleware/middleware-retry.d.ts +2 -2
  115. package/dist-types/middleware/middleware-sign.d.ts +2 -2
  116. package/dist-types/models/GetAlimtalkResult.d.ts +3 -3
  117. package/dist-types/models/GetAlimtalkStatus.d.ts +8 -5
  118. package/dist-types/models/GetAlimtalkTemplate.d.ts +5 -5
  119. package/dist-types/models/GetSMSResult.d.ts +7 -15
  120. package/dist-types/models/GetSMSStatus.d.ts +19 -4
  121. package/dist-types/models/ListAlimtalkChannels.d.ts +4 -4
  122. package/dist-types/models/ListAlimtalkStatus.d.ts +8 -8
  123. package/dist-types/models/ListAlimtalkTemplates.d.ts +2 -2
  124. package/dist-types/models/ListSMSStatus.d.ts +15 -0
  125. package/dist-types/models/MetadataBearer.d.ts +3 -3
  126. package/dist-types/models/SendAlimtalk.d.ts +7 -4
  127. package/dist-types/models/SendMMS.d.ts +5 -3
  128. package/dist-types/models/SendSMS.d.ts +2 -2
  129. package/dist-types/models/SensClient.d.ts +17 -0
  130. package/dist-types/models/SensCommand.d.ts +4 -6
  131. package/dist-types/models/SensErrorInfo.d.ts +21 -0
  132. package/dist-types/models/SensMiddleware.d.ts +8 -0
  133. package/dist-types/models/index.d.ts +17 -14
  134. package/dist-types/protocols/GetAlimtalkResult.d.ts +4 -11
  135. package/dist-types/protocols/GetAlimtalkStatus.d.ts +6 -12
  136. package/dist-types/protocols/GetAlimtalkTemplate.d.ts +4 -14
  137. package/dist-types/protocols/GetSMSResult.d.ts +4 -12
  138. package/dist-types/protocols/GetSMSStatus.d.ts +6 -11
  139. package/dist-types/protocols/ListAlimtalkChannels.d.ts +4 -11
  140. package/dist-types/protocols/ListAlimtalkStatus.d.ts +4 -10
  141. package/dist-types/protocols/ListAlimtalkTemplates.d.ts +5 -12
  142. package/dist-types/protocols/ListSMSStatus.d.ts +4 -0
  143. package/dist-types/protocols/SendAlimtalk.d.ts +5 -12
  144. package/dist-types/protocols/SendMMS.d.ts +4 -10
  145. package/dist-types/protocols/SendSMS.d.ts +5 -10
  146. package/dist-types/protocols/constants.d.ts +4 -2
  147. package/package.json +20 -4
  148. package/.github/pull_request_template.md +0 -19
  149. package/dist-cjs/middleware/middleware-sort-headers.js +0 -25
  150. package/dist-cjs/protocols/index.js +0 -28
  151. package/dist-es/middleware/middleware-sort-headers.js +0 -12
  152. package/dist-es/models/Middleware.js +0 -1
  153. package/dist-es/protocols/index.js +0 -12
  154. package/dist-types/middleware/middleware-sort-headers.d.ts +0 -2
  155. package/dist-types/models/Middleware.d.ts +0 -12
  156. package/dist-types/protocols/index.d.ts +0 -12
  157. /package/dist-cjs/models/{Middleware.js → ListSMSStatus.js} +0 -0
@@ -1,12 +1,15 @@
1
- import { HttpRequest } from "@ingestkorea/util-http-handler";
2
- import { parseBody, parseErrorBody, deserializeMetadata } from "./constants";
3
- export const serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = async (input, config) => {
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
- export const deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand = async (response) => {
18
- const { response: httpResponse, output } = response;
19
- if (httpResponse.statusCode > 300)
20
- await parseErrorBody(httpResponse);
21
- const data = await parseBody(httpResponse); // ListAlimtalkChannelsOutput
22
- let contents = {};
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
- ...deserializeMetadata(httpResponse),
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
- export const deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput = async (outputs) => {
31
+ exports.de_ListAlimtalkChannelsCommand = de_ListAlimtalkChannelsCommand;
32
+ const de_ListAlimtalkChannelsResult = (output) => {
33
33
  return {
34
- channels: deserializeIngestkorea_restJson_Channel(outputs),
34
+ channels: output.channels ? de_AlimtalkChannelList(output.channels) : [],
35
35
  };
36
36
  };
37
- export const deserializeIngestkorea_restJson_Channel = (outputs) => {
38
- const result = outputs.map((output) => {
39
- return {
40
- createTime: output.createTime != undefined ? output.createTime : undefined,
41
- updateTime: output.updateTime != undefined ? output.updateTime : undefined,
42
- serviceId: output.serviceId != undefined ? output.serviceId : undefined,
43
- channelId: output.channelId != undefined ? output.channelId : undefined,
44
- channelName: output.channelName != undefined ? output.channelName : undefined,
45
- channelStatus: output.channelStatus != undefined ? output.channelStatus : undefined,
46
- useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
47
- };
48
- });
49
- return result;
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
- import { HttpRequest } from "@ingestkorea/util-http-handler";
2
- import { parseBody, parseErrorBody, deserializeMetadata, deserializeIngestkorea_restJson_GetAlimtalkStatusOutput, } from "./";
3
- export const serializeIngestkorea_restJson_ListAlimtalkStatusCommand = async (input, config) => {
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
- plusFriendId: input.plusFriendId,
11
- ...(input.requestId && { requestId: input.requestId }),
12
- ...(input.messageId && { messageId: input.messageId }),
13
- ...(input.requestStatusName && { requestStatusName: input.requestStatusName }),
14
- ...(input.messageStatusName && { messageStatusName: input.messageStatusName }),
15
- ...(input.templateCode && { templateCode: input.templateCode }),
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: query,
25
+ query,
29
26
  });
30
27
  };
31
- export const deserializeIngestkorea_restJson_ListAlimtalkStatusCommand = async (response) => {
32
- const { response: httpResponse, output } = response;
33
- if (httpResponse.statusCode > 300)
34
- await parseErrorBody(httpResponse);
35
- const data = await parseBody(httpResponse);
36
- let contents = {};
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
- ...deserializeMetadata(httpResponse),
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
- export const deserializeIngestkorea_restJson_ListAlimtalkStatusOutput = async (output) => {
47
- return deserializeIngestkorea_restJson_GetAlimtalkStatusOutput(output);
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
- import { HttpRequest } from "@ingestkorea/util-http-handler";
2
- import { parseBody, parseErrorBody, deserializeMetadata } from "./constants";
3
- export const serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = async (input, config) => {
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
- export const deserializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = async (response) => {
22
- const { response: httpResponse, output } = response;
23
- if (httpResponse.statusCode > 300)
24
- await parseErrorBody(httpResponse);
25
- const data = await parseBody(httpResponse); // ListAlimtalkTemplatesOutput
26
- let contents = {};
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
- ...deserializeMetadata(httpResponse),
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
- export const deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput = async (output) => {
35
+ exports.de_ListAlimtalkTemplatesCommand = de_ListAlimtalkTemplatesCommand;
36
+ const de_ListAlimtalkTemplatesResult = (output) => {
37
37
  return {
38
- templates: deserializeIngestkorea_restJson_AlimtalkTemplates(output),
38
+ templates: Array.isArray(output) ? de_TemplateList(output) : [],
39
39
  };
40
40
  };
41
- export const deserializeIngestkorea_restJson_AlimtalkTemplates = (outputs) => {
42
- let result = outputs.map(parseTemplate);
43
- return result;
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
- export const parseTemplate = (output) => {
57
+ const de_Template = (output) => {
46
58
  return {
47
- createTime: output.createTime != undefined ? output.createTime : undefined,
48
- updateTime: output.updateTime != undefined ? output.updateTime : undefined,
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
- import { HttpRequest } from "@ingestkorea/util-http-handler";
2
- import { parseBody, parseErrorBody, deserializeMetadata } from "./constants";
3
- export const serializeIngestkorea_restJson_SendAlimtalkCommand = async (input, config) => {
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: hostname,
19
- path: path,
20
- headers: headers,
21
- body: body,
21
+ hostname,
22
+ path,
23
+ headers,
24
+ body,
22
25
  });
23
26
  };
24
- export const deserializeIngestkorea_restJson_SendAlimtalkCommand = async (response) => {
25
- const { response: httpResponse, output } = response;
26
- if (httpResponse.statusCode > 300)
27
- await parseErrorBody(httpResponse);
28
- const data = await parseBody(httpResponse); // SendAlimtalkCommandOutput
29
- let contents = {};
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
- ...deserializeMetadata(httpResponse),
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
- export const deserializeIngestkorea_restJson_SendMessageOutput = async (output) => {
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 != undefined ? deserializeIngestkorea_restJson_ReceivedMessages(output.messages) : undefined,
45
+ messages: output.messages ? de_AlimtalkMessageRequestStatusList(output.messages) : [],
46
46
  };
47
47
  };
48
- export const deserializeIngestkorea_restJson_ReceivedMessages = (outputs) => {
49
- const result = outputs.map(parseReceivedMessage);
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
- export const parseReceivedMessage = (output) => {
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
- import { HttpRequest } from "@ingestkorea/util-http-handler";
2
- import { parseBody, parseErrorBody, deserializeMetadata } from "./constants";
3
- export const serializeIngestkorea_restJson_SendMMSCommand = async (input, config) => {
4
- const hostname = "sens.apigw.ntruss.com";
5
- const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
6
- const headers = {
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
- export const deserializeIngestkorea_restJson_SendMMSCommand = async (response) => {
30
- const { response: httpResponse, output } = response;
31
- if (httpResponse.statusCode > 300)
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
- import { HttpRequest } from "@ingestkorea/util-http-handler";
2
- import { parseBody, parseErrorBody, deserializeMetadata } from "./constants";
3
- export const serializeIngestkorea_restJson_SendSMSCommand = async (input, config) => {
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
- from: input.from,
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: hostname,
23
- path: path,
24
- headers: headers,
25
- body: body,
17
+ hostname,
18
+ path,
19
+ headers,
20
+ body,
26
21
  });
27
22
  };
28
- export const deserializeIngestkorea_restJson_SendSMSCommand = async (response) => {
29
- const { response: httpResponse, output } = response;
30
- if (httpResponse.statusCode > 300)
31
- await parseErrorBody(httpResponse);
32
- const data = await parseBody(httpResponse); // SendSMSOutput
33
- let contents = {};
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
- ...deserializeMetadata(httpResponse),
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
- export const deserializeIngestkorea_restJson_SendSMSOutput = async (output) => {
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;