@ingestkorea/client-sens 1.7.0 → 1.8.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 (148) 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 +9 -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 +8 -33
  9. package/dist-cjs/commands/ListAlimtalkChannelsCommand.js +6 -33
  10. package/dist-cjs/commands/ListAlimtalkStatusCommand.js +19 -35
  11. package/dist-cjs/commands/ListAlimtalkTemplatesCommand.js +5 -32
  12. package/dist-cjs/commands/SendAlimtalkCommand.js +35 -43
  13. package/dist-cjs/commands/SendMMSCommand.js +67 -103
  14. package/dist-cjs/commands/SendSMSCommand.js +38 -71
  15. package/dist-cjs/commands/constants.js +1 -15
  16. package/dist-cjs/commands/index.js +11 -11
  17. package/dist-cjs/index.js +2 -2
  18. package/dist-cjs/middleware/constants.js +10 -0
  19. package/dist-cjs/middleware/index.js +3 -4
  20. package/dist-cjs/middleware/middleware-metadata.js +4 -5
  21. package/dist-cjs/middleware/middleware-retry.js +32 -27
  22. package/dist-cjs/middleware/middleware-sign.js +10 -9
  23. package/dist-cjs/models/SendAlimtalk.js +3 -0
  24. package/dist-cjs/models/SendMMS.js +3 -0
  25. package/dist-cjs/models/SensErrorInfo.js +13 -0
  26. package/dist-cjs/models/SensMiddleware.js +2 -0
  27. package/dist-cjs/models/index.js +16 -14
  28. package/dist-cjs/protocols/GetAlimtalkResult.js +19 -22
  29. package/dist-cjs/protocols/GetAlimtalkStatus.js +36 -37
  30. package/dist-cjs/protocols/GetAlimtalkTemplate.js +56 -90
  31. package/dist-cjs/protocols/GetSMSResult.js +30 -48
  32. package/dist-cjs/protocols/GetSMSStatus.js +31 -34
  33. package/dist-cjs/protocols/ListAlimtalkChannels.js +27 -31
  34. package/dist-cjs/protocols/ListAlimtalkStatus.js +22 -19
  35. package/dist-cjs/protocols/ListAlimtalkTemplates.js +31 -23
  36. package/dist-cjs/protocols/SendAlimtalk.js +22 -26
  37. package/dist-cjs/protocols/SendMMS.js +8 -38
  38. package/dist-cjs/protocols/SendSMS.js +19 -21
  39. package/dist-cjs/protocols/constants.js +98 -34
  40. package/dist-es/SensClient.js +63 -30
  41. package/dist-es/commands/GetAlimtalkResultCommand.js +9 -19
  42. package/dist-es/commands/GetAlimtalkStatusCommand.js +14 -19
  43. package/dist-es/commands/GetAlimtalkTemplateCommand.js +9 -19
  44. package/dist-es/commands/GetSMSResultCommand.js +10 -20
  45. package/dist-es/commands/GetSMSStatusCommand.js +10 -20
  46. package/dist-es/commands/ListAlimtalkChannelsCommand.js +10 -22
  47. package/dist-es/commands/ListAlimtalkStatusCommand.js +28 -27
  48. package/dist-es/commands/ListAlimtalkTemplatesCommand.js +9 -19
  49. package/dist-es/commands/SendAlimtalkCommand.js +34 -30
  50. package/dist-es/commands/SendMMSCommand.js +70 -100
  51. package/dist-es/commands/SendSMSCommand.js +51 -66
  52. package/dist-es/commands/constants.js +9 -16
  53. package/dist-es/commands/index.js +27 -11
  54. package/dist-es/index.js +18 -2
  55. package/dist-es/middleware/constants.js +10 -0
  56. package/dist-es/middleware/index.js +19 -4
  57. package/dist-es/middleware/middleware-metadata.js +11 -5
  58. package/dist-es/middleware/middleware-retry.js +39 -30
  59. package/dist-es/middleware/middleware-sign.js +19 -14
  60. package/dist-es/models/GetAlimtalkResult.js +2 -1
  61. package/dist-es/models/GetAlimtalkStatus.js +2 -1
  62. package/dist-es/models/GetAlimtalkTemplate.js +2 -1
  63. package/dist-es/models/GetSMSResult.js +2 -1
  64. package/dist-es/models/GetSMSStatus.js +2 -1
  65. package/dist-es/models/ListAlimtalkChannels.js +2 -1
  66. package/dist-es/models/ListAlimtalkStatus.js +2 -1
  67. package/dist-es/models/ListAlimtalkTemplates.js +2 -1
  68. package/dist-es/models/MetadataBearer.js +2 -1
  69. package/dist-es/models/SendAlimtalk.js +5 -1
  70. package/dist-es/models/SendMMS.js +5 -1
  71. package/dist-es/models/SendSMS.js +2 -1
  72. package/dist-es/models/SensClient.js +2 -0
  73. package/dist-es/models/SensCommand.js +5 -1
  74. package/dist-es/models/SensErrorInfo.js +13 -0
  75. package/dist-es/models/SensMiddleware.js +2 -0
  76. package/dist-es/models/index.js +32 -14
  77. package/dist-es/protocols/GetAlimtalkResult.js +24 -23
  78. package/dist-es/protocols/GetAlimtalkStatus.js +40 -36
  79. package/dist-es/protocols/GetAlimtalkTemplate.js +78 -87
  80. package/dist-es/protocols/GetSMSResult.js +44 -47
  81. package/dist-es/protocols/GetSMSStatus.js +35 -34
  82. package/dist-es/protocols/ListAlimtalkChannels.js +31 -31
  83. package/dist-es/protocols/ListAlimtalkStatus.js +26 -32
  84. package/dist-es/protocols/ListAlimtalkTemplates.js +35 -22
  85. package/dist-es/protocols/SendAlimtalk.js +26 -25
  86. package/dist-es/protocols/SendMMS.js +10 -49
  87. package/dist-es/protocols/SendSMS.js +23 -30
  88. package/dist-es/protocols/constants.js +112 -37
  89. package/dist-types/SensClient.d.ts +3 -20
  90. package/dist-types/commands/GetAlimtalkResultCommand.d.ts +5 -10
  91. package/dist-types/commands/GetAlimtalkStatusCommand.d.ts +5 -10
  92. package/dist-types/commands/GetAlimtalkTemplateCommand.d.ts +5 -10
  93. package/dist-types/commands/GetSMSResultCommand.d.ts +5 -10
  94. package/dist-types/commands/GetSMSStatusCommand.d.ts +5 -10
  95. package/dist-types/commands/ListAlimtalkChannelsCommand.d.ts +5 -10
  96. package/dist-types/commands/ListAlimtalkStatusCommand.d.ts +5 -10
  97. package/dist-types/commands/ListAlimtalkTemplatesCommand.d.ts +5 -10
  98. package/dist-types/commands/SendAlimtalkCommand.d.ts +5 -10
  99. package/dist-types/commands/SendMMSCommand.d.ts +5 -10
  100. package/dist-types/commands/SendSMSCommand.d.ts +9 -10
  101. package/dist-types/commands/constants.d.ts +0 -7
  102. package/dist-types/commands/index.d.ts +11 -11
  103. package/dist-types/index.d.ts +2 -2
  104. package/dist-types/middleware/constants.d.ts +7 -0
  105. package/dist-types/middleware/index.d.ts +3 -4
  106. package/dist-types/middleware/middleware-metadata.d.ts +2 -2
  107. package/dist-types/middleware/middleware-retry.d.ts +2 -2
  108. package/dist-types/middleware/middleware-sign.d.ts +2 -2
  109. package/dist-types/models/GetAlimtalkResult.d.ts +3 -3
  110. package/dist-types/models/GetAlimtalkStatus.d.ts +8 -5
  111. package/dist-types/models/GetAlimtalkTemplate.d.ts +5 -5
  112. package/dist-types/models/GetSMSResult.d.ts +5 -9
  113. package/dist-types/models/GetSMSStatus.d.ts +4 -4
  114. package/dist-types/models/ListAlimtalkChannels.d.ts +4 -4
  115. package/dist-types/models/ListAlimtalkStatus.d.ts +8 -8
  116. package/dist-types/models/ListAlimtalkTemplates.d.ts +2 -2
  117. package/dist-types/models/MetadataBearer.d.ts +3 -3
  118. package/dist-types/models/SendAlimtalk.d.ts +6 -4
  119. package/dist-types/models/SendMMS.d.ts +5 -3
  120. package/dist-types/models/SendSMS.d.ts +2 -2
  121. package/dist-types/models/SensClient.d.ts +17 -0
  122. package/dist-types/models/SensCommand.d.ts +4 -6
  123. package/dist-types/models/SensErrorInfo.d.ts +21 -0
  124. package/dist-types/models/SensMiddleware.d.ts +8 -0
  125. package/dist-types/models/index.d.ts +16 -14
  126. package/dist-types/protocols/GetAlimtalkResult.d.ts +4 -11
  127. package/dist-types/protocols/GetAlimtalkStatus.d.ts +6 -12
  128. package/dist-types/protocols/GetAlimtalkTemplate.d.ts +4 -14
  129. package/dist-types/protocols/GetSMSResult.d.ts +4 -12
  130. package/dist-types/protocols/GetSMSStatus.d.ts +5 -11
  131. package/dist-types/protocols/ListAlimtalkChannels.d.ts +4 -11
  132. package/dist-types/protocols/ListAlimtalkStatus.d.ts +4 -10
  133. package/dist-types/protocols/ListAlimtalkTemplates.d.ts +5 -12
  134. package/dist-types/protocols/SendAlimtalk.d.ts +5 -12
  135. package/dist-types/protocols/SendMMS.d.ts +4 -10
  136. package/dist-types/protocols/SendSMS.d.ts +5 -10
  137. package/dist-types/protocols/constants.d.ts +3 -2
  138. package/package.json +20 -4
  139. package/.github/pull_request_template.md +0 -19
  140. package/dist-cjs/middleware/middleware-sort-headers.js +0 -25
  141. package/dist-cjs/protocols/index.js +0 -28
  142. package/dist-es/middleware/middleware-sort-headers.js +0 -12
  143. package/dist-es/models/Middleware.js +0 -1
  144. package/dist-es/protocols/index.js +0 -12
  145. package/dist-types/middleware/middleware-sort-headers.d.ts +0 -2
  146. package/dist-types/models/Middleware.d.ts +0 -12
  147. package/dist-types/protocols/index.d.ts +0 -12
  148. /package/dist-cjs/models/{Middleware.js → SensClient.js} +0 -0
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.deserializeIngestkorea_restJson_SMSStatusMessage = exports.deserializeIngestkorea_restJson_GetSMSStatusOutput = exports.deserializeIngestkorea_restJson_GetSMSStatusCommand = exports.serializeIngestkorea_restJson_GetSMSStatusCommand = void 0;
12
+ exports.de_SMSMessageRequestStatus = exports.de_GetSMSStatusCommand = exports.se_GetSMSStatusCommand = void 0;
13
13
  const util_http_handler_1 = require("@ingestkorea/util-http-handler");
14
- const constants_1 = require("./constants");
15
- const serializeIngestkorea_restJson_GetSMSStatusCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const constants_js_1 = require("./constants.js");
15
+ const se_GetSMSStatusCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  const hostname = "sens.apigw.ntruss.com";
17
17
  const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
18
18
  const headers = {
@@ -24,43 +24,40 @@ const serializeIngestkorea_restJson_GetSMSStatusCommand = (input, config) => __a
24
24
  return new util_http_handler_1.HttpRequest({
25
25
  protocol: "https:",
26
26
  method: "GET",
27
- hostname: hostname,
28
- path: path,
29
- query: query,
30
- headers: headers,
27
+ hostname,
28
+ path,
29
+ query,
30
+ headers,
31
31
  });
32
32
  });
33
- exports.serializeIngestkorea_restJson_GetSMSStatusCommand = serializeIngestkorea_restJson_GetSMSStatusCommand;
34
- const deserializeIngestkorea_restJson_GetSMSStatusCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
35
- const { response: httpResponse, output } = response;
36
- if (httpResponse.statusCode > 300)
37
- yield (0, constants_1.parseErrorBody)(httpResponse);
38
- const data = yield (0, constants_1.parseBody)(httpResponse);
39
- let contents = {};
40
- contents = yield (0, exports.deserializeIngestkorea_restJson_GetSMSStatusOutput)(data);
41
- return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, constants_1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
33
+ exports.se_GetSMSStatusCommand = se_GetSMSStatusCommand;
34
+ const de_GetSMSStatusCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () {
35
+ if (response.statusCode >= 300)
36
+ yield (0, constants_js_1.parseErrorBody)(response);
37
+ const data = yield (0, constants_js_1.parseBody)(response);
38
+ const contents = de_GetSMSStatusResult(data);
39
+ return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents));
42
40
  });
43
- exports.deserializeIngestkorea_restJson_GetSMSStatusCommand = deserializeIngestkorea_restJson_GetSMSStatusCommand;
44
- const deserializeIngestkorea_restJson_GetSMSStatusOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
41
+ exports.de_GetSMSStatusCommand = de_GetSMSStatusCommand;
42
+ const de_GetSMSStatusResult = (output) => {
45
43
  return {
46
44
  requestId: output.requestId ? output.requestId : undefined,
47
45
  statusCode: output.statusCode ? output.statusCode : undefined,
48
46
  statusName: output.statusName ? output.statusName : undefined,
49
- messages: output.messages ? (0, exports.deserializeIngestkorea_restJson_SMSStatusMessage)(output.messages) : undefined,
47
+ messages: output.messages ? de_SMSMessageRequestStatusList(output.messages) : [],
48
+ };
49
+ };
50
+ const de_SMSMessageRequestStatusList = (output) => {
51
+ return (output || []).filter((e) => e != null).map((entry) => (0, exports.de_SMSMessageRequestStatus)(entry));
52
+ };
53
+ const de_SMSMessageRequestStatus = (output) => {
54
+ return {
55
+ messageId: output.messageId != undefined ? output.messageId : undefined,
56
+ requestTime: output.requestTime != undefined ? output.requestTime : undefined,
57
+ contentType: output.contentType != undefined ? output.contentType : undefined,
58
+ countryCode: output.countryCode != undefined ? output.countryCode : undefined,
59
+ from: output.from != undefined ? output.from : undefined,
60
+ to: output.to != undefined ? output.to : undefined,
50
61
  };
51
- });
52
- exports.deserializeIngestkorea_restJson_GetSMSStatusOutput = deserializeIngestkorea_restJson_GetSMSStatusOutput;
53
- const deserializeIngestkorea_restJson_SMSStatusMessage = (outputs) => {
54
- let result = outputs.map((output) => {
55
- return {
56
- messageId: output.messageId != undefined ? output.messageId : undefined,
57
- requestTime: output.requestTime != undefined ? output.requestTime : undefined,
58
- contentType: output.contentType != undefined ? output.contentType : undefined,
59
- countryCode: output.countryCode != undefined ? output.countryCode : undefined,
60
- from: output.from != undefined ? output.from : undefined,
61
- to: output.to != undefined ? output.to : undefined,
62
- };
63
- });
64
- return result;
65
62
  };
66
- exports.deserializeIngestkorea_restJson_SMSStatusMessage = deserializeIngestkorea_restJson_SMSStatusMessage;
63
+ exports.de_SMSMessageRequestStatus = de_SMSMessageRequestStatus;
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.deserializeIngestkorea_restJson_Channel = exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput = exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand = exports.serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = void 0;
12
+ exports.de_ListAlimtalkChannelsCommand = exports.se_ListAlimtalkChannelsCommand = void 0;
13
13
  const util_http_handler_1 = require("@ingestkorea/util-http-handler");
14
- const constants_1 = require("./constants");
15
- const serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const constants_js_1 = require("./constants.js");
15
+ const se_ListAlimtalkChannelsCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  const hostname = "sens.apigw.ntruss.com";
17
17
  const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/channels";
18
18
  const headers = {
@@ -26,35 +26,31 @@ const serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = (input, config
26
26
  headers: headers,
27
27
  });
28
28
  });
29
- exports.serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = serializeIngestkorea_restJson_ListAlimtalkChannelsCommand;
30
- const deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
31
- const { response: httpResponse, output } = response;
32
- if (httpResponse.statusCode > 300)
33
- yield (0, constants_1.parseErrorBody)(httpResponse);
34
- const data = yield (0, constants_1.parseBody)(httpResponse); // ListAlimtalkChannelsOutput
35
- let contents = {};
36
- contents = yield (0, exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput)(data);
37
- return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, constants_1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
29
+ exports.se_ListAlimtalkChannelsCommand = se_ListAlimtalkChannelsCommand;
30
+ const de_ListAlimtalkChannelsCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () {
31
+ if (response.statusCode >= 300)
32
+ yield (0, constants_js_1.parseErrorBody)(response);
33
+ const data = yield (0, constants_js_1.parseBody)(response);
34
+ const contents = de_ListAlimtalkChannelsResult(data);
35
+ return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents));
38
36
  });
39
- exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand = deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand;
40
- const deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput = (outputs) => __awaiter(void 0, void 0, void 0, function* () {
37
+ exports.de_ListAlimtalkChannelsCommand = de_ListAlimtalkChannelsCommand;
38
+ const de_ListAlimtalkChannelsResult = (output) => {
41
39
  return {
42
- channels: (0, exports.deserializeIngestkorea_restJson_Channel)(outputs),
40
+ channels: output.channels ? de_AlimtalkChannelList(output.channels) : [],
41
+ };
42
+ };
43
+ const de_AlimtalkChannelList = (output) => {
44
+ return (output || []).filter((e) => e != null).map((entry) => de_AlimtalkChannel(entry));
45
+ };
46
+ const de_AlimtalkChannel = (output) => {
47
+ return {
48
+ createTime: output.createTime != undefined ? output.createTime : undefined,
49
+ updateTime: output.updateTime != undefined ? output.updateTime : undefined,
50
+ serviceId: output.serviceId != undefined ? output.serviceId : undefined,
51
+ channelId: output.channelId != undefined ? output.channelId : undefined,
52
+ channelName: output.channelName != undefined ? output.channelName : undefined,
53
+ channelStatus: output.channelStatus != undefined ? output.channelStatus : undefined,
54
+ useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
43
55
  };
44
- });
45
- exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput = deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput;
46
- const deserializeIngestkorea_restJson_Channel = (outputs) => {
47
- const result = outputs.map((output) => {
48
- return {
49
- createTime: output.createTime != undefined ? output.createTime : undefined,
50
- updateTime: output.updateTime != undefined ? output.updateTime : undefined,
51
- serviceId: output.serviceId != undefined ? output.serviceId : undefined,
52
- channelId: output.channelId != undefined ? output.channelId : undefined,
53
- channelName: output.channelName != undefined ? output.channelName : undefined,
54
- channelStatus: output.channelStatus != undefined ? output.channelStatus : undefined,
55
- useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
56
- };
57
- });
58
- return result;
59
56
  };
60
- exports.deserializeIngestkorea_restJson_Channel = deserializeIngestkorea_restJson_Channel;
@@ -9,37 +9,40 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.deserializeIngestkorea_restJson_ListAlimtalkStatusOutput = exports.deserializeIngestkorea_restJson_ListAlimtalkStatusCommand = exports.serializeIngestkorea_restJson_ListAlimtalkStatusCommand = void 0;
12
+ exports.de_ListAlimtalkStatusCommand = exports.se_ListAlimtalkStatusCommand = void 0;
13
13
  const util_http_handler_1 = require("@ingestkorea/util-http-handler");
14
- const _1 = require("./");
15
- const serializeIngestkorea_restJson_ListAlimtalkStatusCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const constants_js_1 = require("./constants.js");
15
+ const GetAlimtalkStatus_js_1 = require("./GetAlimtalkStatus.js");
16
+ const se_ListAlimtalkStatusCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
16
17
  const hostname = "sens.apigw.ntruss.com";
17
18
  const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
18
19
  const headers = {
19
20
  host: hostname,
20
21
  };
21
- const query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ plusFriendId: input.plusFriendId }, (input.requestId && { requestId: input.requestId })), (input.messageId && { messageId: input.messageId })), (input.requestStatusName && { requestStatusName: input.requestStatusName })), (input.messageStatusName && { messageStatusName: input.messageStatusName })), (input.templateCode && { templateCode: input.templateCode })), (input.to && { to: input.to.replace(/\-/gi, "") })), (input.requestStartTime && { requestStartTime: input.requestStartTime })), (input.requestEndTime && { requestEndTime: input.requestEndTime })), (input.pageIndex != null && { pageIndex: input.pageIndex.toString() })), (input.pageSize && { pageSize: input.pageSize.toString() }));
22
+ const query = Object.entries(input).reduce((acc, [key, value]) => {
23
+ if (value !== undefined && value !== null) {
24
+ acc[key] = String(value);
25
+ }
26
+ return acc;
27
+ }, {});
22
28
  return new util_http_handler_1.HttpRequest({
23
29
  protocol: "https:",
24
30
  method: "GET",
25
31
  hostname: hostname,
26
32
  path: path,
27
33
  headers: headers,
28
- query: query,
34
+ query,
29
35
  });
30
36
  });
31
- exports.serializeIngestkorea_restJson_ListAlimtalkStatusCommand = serializeIngestkorea_restJson_ListAlimtalkStatusCommand;
32
- const deserializeIngestkorea_restJson_ListAlimtalkStatusCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
33
- const { response: httpResponse, output } = response;
34
- if (httpResponse.statusCode > 300)
35
- yield (0, _1.parseErrorBody)(httpResponse);
36
- const data = yield (0, _1.parseBody)(httpResponse);
37
- let contents = {};
38
- contents = yield (0, exports.deserializeIngestkorea_restJson_ListAlimtalkStatusOutput)(data);
39
- return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, _1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
37
+ exports.se_ListAlimtalkStatusCommand = se_ListAlimtalkStatusCommand;
38
+ const de_ListAlimtalkStatusCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () {
39
+ if (response.statusCode >= 300)
40
+ yield (0, constants_js_1.parseErrorBody)(response);
41
+ const data = yield (0, constants_js_1.parseBody)(response);
42
+ const contents = de_ListAlimtalkStatusResult(data);
43
+ return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents));
40
44
  });
41
- exports.deserializeIngestkorea_restJson_ListAlimtalkStatusCommand = deserializeIngestkorea_restJson_ListAlimtalkStatusCommand;
42
- const deserializeIngestkorea_restJson_ListAlimtalkStatusOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
43
- return (0, _1.deserializeIngestkorea_restJson_GetAlimtalkStatusOutput)(output);
44
- });
45
- exports.deserializeIngestkorea_restJson_ListAlimtalkStatusOutput = deserializeIngestkorea_restJson_ListAlimtalkStatusOutput;
45
+ exports.de_ListAlimtalkStatusCommand = de_ListAlimtalkStatusCommand;
46
+ const de_ListAlimtalkStatusResult = (output) => {
47
+ return (0, GetAlimtalkStatus_js_1.de_GetAlimtalkStatusResult)(output);
48
+ };
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.parseTemplate = exports.deserializeIngestkorea_restJson_AlimtalkTemplates = exports.deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput = exports.deserializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = exports.serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = void 0;
12
+ exports.de_Template = exports.de_ListAlimtalkTemplatesCommand = exports.se_ListAlimtalkTemplatesCommand = void 0;
13
13
  const util_http_handler_1 = require("@ingestkorea/util-http-handler");
14
- const constants_1 = require("./constants");
15
- const serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const constants_js_1 = require("./constants.js");
15
+ const se_ListAlimtalkTemplatesCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  const hostname = "sens.apigw.ntruss.com";
17
17
  const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/templates";
18
18
  const headers = {
@@ -30,29 +30,37 @@ const serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = (input, confi
30
30
  headers: headers,
31
31
  });
32
32
  });
33
- exports.serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = serializeIngestkorea_restJson_ListAlimtalkTemplatesCommand;
34
- const deserializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
35
- const { response: httpResponse, output } = response;
36
- if (httpResponse.statusCode > 300)
37
- yield (0, constants_1.parseErrorBody)(httpResponse);
38
- const data = yield (0, constants_1.parseBody)(httpResponse); // ListAlimtalkTemplatesOutput
39
- let contents = {};
40
- contents = yield (0, exports.deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput)(data);
41
- return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, constants_1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
33
+ exports.se_ListAlimtalkTemplatesCommand = se_ListAlimtalkTemplatesCommand;
34
+ const de_ListAlimtalkTemplatesCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () {
35
+ if (response.statusCode >= 300)
36
+ yield (0, constants_js_1.parseErrorBody)(response);
37
+ const data = yield (0, constants_js_1.parseBody)(response);
38
+ const contents = de_ListAlimtalkTemplatesResult(data);
39
+ return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents));
42
40
  });
43
- exports.deserializeIngestkorea_restJson_ListAlimtalkTemplatesCommand = deserializeIngestkorea_restJson_ListAlimtalkTemplatesCommand;
44
- const deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
41
+ exports.de_ListAlimtalkTemplatesCommand = de_ListAlimtalkTemplatesCommand;
42
+ const de_ListAlimtalkTemplatesResult = (output) => {
45
43
  return {
46
- templates: (0, exports.deserializeIngestkorea_restJson_AlimtalkTemplates)(output),
44
+ templates: Array.isArray(output) ? de_TemplateList(output) : [],
47
45
  };
48
- });
49
- exports.deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput = deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput;
50
- const deserializeIngestkorea_restJson_AlimtalkTemplates = (outputs) => {
51
- let result = outputs.map(exports.parseTemplate);
52
- return result;
53
46
  };
54
- exports.deserializeIngestkorea_restJson_AlimtalkTemplates = deserializeIngestkorea_restJson_AlimtalkTemplates;
55
- const parseTemplate = (output) => {
47
+ const de_TemplateList = (output) => {
48
+ return (output || [])
49
+ .filter((e) => e != null)
50
+ .map((entry) => (0, exports.de_Template)(entry))
51
+ .sort((a, b) => {
52
+ var _a, _b;
53
+ // 생성 날짜 기준 내림차순
54
+ const dateA = ((_a = a.createTime) !== null && _a !== void 0 ? _a : "").replace(/\.\d{3}Z?$/, "");
55
+ const dateB = ((_b = b.createTime) !== null && _b !== void 0 ? _b : "").replace(/\.\d{3}Z?$/, "");
56
+ if (dateB < dateA)
57
+ return -1;
58
+ if (dateB > dateA)
59
+ return 1;
60
+ return 0;
61
+ });
62
+ };
63
+ const de_Template = (output) => {
56
64
  return {
57
65
  createTime: output.createTime != undefined ? output.createTime : undefined,
58
66
  updateTime: output.updateTime != undefined ? output.updateTime : undefined,
@@ -61,4 +69,4 @@ const parseTemplate = (output) => {
61
69
  templateName: output.templateName != undefined ? output.templateName : undefined,
62
70
  };
63
71
  };
64
- exports.parseTemplate = parseTemplate;
72
+ exports.de_Template = de_Template;
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.parseReceivedMessage = exports.deserializeIngestkorea_restJson_ReceivedMessages = exports.deserializeIngestkorea_restJson_SendMessageOutput = exports.deserializeIngestkorea_restJson_SendAlimtalkCommand = exports.serializeIngestkorea_restJson_SendAlimtalkCommand = void 0;
12
+ exports.de_AlimtalkMessageRequestStatus = exports.de_SendAlimtalkCommand = exports.se_SendAlimtalkCommand = void 0;
13
13
  const util_http_handler_1 = require("@ingestkorea/util-http-handler");
14
- const constants_1 = require("./constants");
15
- const serializeIngestkorea_restJson_SendAlimtalkCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const constants_js_1 = require("./constants.js");
15
+ const se_SendAlimtalkCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  const hostname = "sens.apigw.ntruss.com";
17
17
  const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
18
18
  const headers = {
@@ -27,39 +27,35 @@ const serializeIngestkorea_restJson_SendAlimtalkCommand = (input, config) => __a
27
27
  return new util_http_handler_1.HttpRequest({
28
28
  protocol: "https:",
29
29
  method: "POST",
30
- hostname: hostname,
31
- path: path,
32
- headers: headers,
33
- body: body,
30
+ hostname,
31
+ path,
32
+ headers,
33
+ body,
34
34
  });
35
35
  });
36
- exports.serializeIngestkorea_restJson_SendAlimtalkCommand = serializeIngestkorea_restJson_SendAlimtalkCommand;
37
- const deserializeIngestkorea_restJson_SendAlimtalkCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
38
- const { response: httpResponse, output } = response;
39
- if (httpResponse.statusCode > 300)
40
- yield (0, constants_1.parseErrorBody)(httpResponse);
41
- const data = yield (0, constants_1.parseBody)(httpResponse); // SendAlimtalkCommandOutput
42
- let contents = {};
43
- contents = yield (0, exports.deserializeIngestkorea_restJson_SendMessageOutput)(data);
44
- return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, constants_1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
36
+ exports.se_SendAlimtalkCommand = se_SendAlimtalkCommand;
37
+ const de_SendAlimtalkCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () {
38
+ if (response.statusCode >= 300)
39
+ yield (0, constants_js_1.parseErrorBody)(response);
40
+ const data = yield (0, constants_js_1.parseBody)(response);
41
+ const contents = de_SendAlimtalkResult(data);
42
+ return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents));
45
43
  });
46
- exports.deserializeIngestkorea_restJson_SendAlimtalkCommand = deserializeIngestkorea_restJson_SendAlimtalkCommand;
47
- const deserializeIngestkorea_restJson_SendMessageOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
44
+ exports.de_SendAlimtalkCommand = de_SendAlimtalkCommand;
45
+ const de_SendAlimtalkResult = (output) => {
48
46
  return {
49
47
  requestId: output.requestId != undefined ? output.requestId : undefined,
50
48
  requestTime: output.requestTime != undefined ? output.requestTime : undefined,
51
49
  statusCode: output.statusCode != undefined ? output.statusCode : undefined,
52
50
  statusName: output.statusName != undefined ? output.statusName : undefined,
53
- messages: output.messages != undefined ? (0, exports.deserializeIngestkorea_restJson_ReceivedMessages)(output.messages) : undefined,
51
+ messages: output.messages ? de_AlimtalkMessageRequestStatusList(output.messages) : [],
54
52
  };
55
- });
56
- exports.deserializeIngestkorea_restJson_SendMessageOutput = deserializeIngestkorea_restJson_SendMessageOutput;
57
- const deserializeIngestkorea_restJson_ReceivedMessages = (outputs) => {
58
- const result = outputs.map(exports.parseReceivedMessage);
53
+ };
54
+ const de_AlimtalkMessageRequestStatusList = (output) => {
55
+ const result = (output || []).filter((e) => e != null).map((entry) => (0, exports.de_AlimtalkMessageRequestStatus)(entry));
59
56
  return result;
60
57
  };
61
- exports.deserializeIngestkorea_restJson_ReceivedMessages = deserializeIngestkorea_restJson_ReceivedMessages;
62
- const parseReceivedMessage = (output) => {
58
+ const de_AlimtalkMessageRequestStatus = (output) => {
63
59
  return {
64
60
  messageId: output.messageId != undefined ? output.messageId : undefined,
65
61
  to: output.to != undefined ? output.to : undefined,
@@ -71,4 +67,4 @@ const parseReceivedMessage = (output) => {
71
67
  useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
72
68
  };
73
69
  };
74
- exports.parseReceivedMessage = parseReceivedMessage;
70
+ exports.de_AlimtalkMessageRequestStatus = de_AlimtalkMessageRequestStatus;
@@ -9,43 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.deserializeIngestkorea_restJson_SendMMSOutput = exports.deserializeIngestkorea_restJson_SendMMSCommand = exports.serializeIngestkorea_restJson_SendMMSCommand = void 0;
13
- const util_http_handler_1 = require("@ingestkorea/util-http-handler");
14
- const constants_1 = require("./constants");
15
- const serializeIngestkorea_restJson_SendMMSCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
16
- const hostname = "sens.apigw.ntruss.com";
17
- const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
18
- const headers = {
19
- "content-type": "application/json; charset=utf-8",
20
- host: hostname,
21
- };
22
- const body = JSON.stringify(Object.assign(Object.assign(Object.assign({ from: input.from, content: input.content, messages: input.messages, type: input.type != undefined ? input.type : "MMS", files: input.files }, (input.contentType != undefined && { contentType: input.contentType })), (input.countryCode != undefined && { countryCode: input.countryCode })), (input.subject != undefined && { subject: input.subject })));
23
- return new util_http_handler_1.HttpRequest({
24
- protocol: "https:",
25
- method: "POST",
26
- hostname: hostname,
27
- path: path,
28
- headers: headers,
29
- body: body,
30
- });
31
- });
32
- exports.serializeIngestkorea_restJson_SendMMSCommand = serializeIngestkorea_restJson_SendMMSCommand;
33
- const deserializeIngestkorea_restJson_SendMMSCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
34
- const { response: httpResponse, output } = response;
35
- if (httpResponse.statusCode > 300)
36
- yield (0, constants_1.parseErrorBody)(httpResponse);
37
- const data = yield (0, constants_1.parseBody)(httpResponse); // SendSMSOutput
38
- let contents = {};
39
- contents = yield (0, exports.deserializeIngestkorea_restJson_SendMMSOutput)(data);
40
- return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, constants_1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
12
+ exports.de_SendMMSCommand = exports.se_SendMMSCommand = void 0;
13
+ const SendSMS_js_1 = require("./SendSMS.js");
14
+ const se_SendMMSCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return (0, SendSMS_js_1.se_SendSMSCommand)(input, config);
41
16
  });
42
- exports.deserializeIngestkorea_restJson_SendMMSCommand = deserializeIngestkorea_restJson_SendMMSCommand;
43
- const deserializeIngestkorea_restJson_SendMMSOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
44
- return {
45
- requestId: output.requestId ? output.requestId : undefined,
46
- requestTime: output.requestTime ? output.requestTime : undefined,
47
- statusCode: output.statusCode ? output.statusCode : undefined,
48
- statusName: output.statusName ? output.statusName : undefined,
49
- };
17
+ exports.se_SendMMSCommand = se_SendMMSCommand;
18
+ const de_SendMMSCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () {
19
+ return (0, SendSMS_js_1.de_SendSMSCommand)(response, config);
50
20
  });
51
- exports.deserializeIngestkorea_restJson_SendMMSOutput = deserializeIngestkorea_restJson_SendMMSOutput;
21
+ exports.de_SendMMSCommand = de_SendMMSCommand;
@@ -9,43 +9,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.deserializeIngestkorea_restJson_SendSMSOutput = exports.deserializeIngestkorea_restJson_SendSMSCommand = exports.serializeIngestkorea_restJson_SendSMSCommand = void 0;
12
+ exports.de_SendSMSResult = exports.de_SendSMSCommand = exports.se_SendSMSCommand = void 0;
13
13
  const util_http_handler_1 = require("@ingestkorea/util-http-handler");
14
- const constants_1 = require("./constants");
15
- const serializeIngestkorea_restJson_SendSMSCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const constants_js_1 = require("./constants.js");
15
+ const se_SendSMSCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  const hostname = "sens.apigw.ntruss.com";
17
17
  const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
18
18
  const headers = {
19
19
  "content-type": "application/json; charset=utf-8",
20
20
  host: hostname,
21
21
  };
22
- const body = JSON.stringify(Object.assign(Object.assign(Object.assign({ from: input.from, content: input.content, messages: input.messages, type: input.type != undefined ? input.type : "SMS" }, (input.contentType != undefined && { contentType: input.contentType })), (input.countryCode != undefined && { countryCode: input.countryCode })), (input.subject != undefined && input.type === "LMS" && { subject: input.subject })));
22
+ const body = JSON.stringify(Object.assign({}, input));
23
23
  return new util_http_handler_1.HttpRequest({
24
24
  protocol: "https:",
25
25
  method: "POST",
26
- hostname: hostname,
27
- path: path,
28
- headers: headers,
29
- body: body,
26
+ hostname,
27
+ path,
28
+ headers,
29
+ body,
30
30
  });
31
31
  });
32
- exports.serializeIngestkorea_restJson_SendSMSCommand = serializeIngestkorea_restJson_SendSMSCommand;
33
- const deserializeIngestkorea_restJson_SendSMSCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
34
- const { response: httpResponse, output } = response;
35
- if (httpResponse.statusCode > 300)
36
- yield (0, constants_1.parseErrorBody)(httpResponse);
37
- const data = yield (0, constants_1.parseBody)(httpResponse); // SendSMSOutput
38
- let contents = {};
39
- contents = yield (0, exports.deserializeIngestkorea_restJson_SendSMSOutput)(data);
40
- return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, constants_1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
32
+ exports.se_SendSMSCommand = se_SendSMSCommand;
33
+ const de_SendSMSCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () {
34
+ if (response.statusCode >= 300)
35
+ yield (0, constants_js_1.parseErrorBody)(response);
36
+ const data = yield (0, constants_js_1.parseBody)(response);
37
+ const contents = (0, exports.de_SendSMSResult)(data);
38
+ return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents));
41
39
  });
42
- exports.deserializeIngestkorea_restJson_SendSMSCommand = deserializeIngestkorea_restJson_SendSMSCommand;
43
- const deserializeIngestkorea_restJson_SendSMSOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
40
+ exports.de_SendSMSCommand = de_SendSMSCommand;
41
+ const de_SendSMSResult = (output) => {
44
42
  return {
45
43
  requestId: output.requestId ? output.requestId : undefined,
46
44
  requestTime: output.requestTime ? output.requestTime : undefined,
47
45
  statusCode: output.statusCode ? output.statusCode : undefined,
48
46
  statusName: output.statusName ? output.statusName : undefined,
49
47
  };
50
- });
51
- exports.deserializeIngestkorea_restJson_SendSMSOutput = deserializeIngestkorea_restJson_SendSMSOutput;
48
+ };
49
+ exports.de_SendSMSResult = de_SendSMSResult;