@ingestkorea/client-sens 1.6.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 (149) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +114 -68
  3. package/dist-cjs/SensClient.js +59 -31
  4. package/dist-cjs/commands/GetAlimtalkResultCommand.js +8 -33
  5. package/dist-cjs/commands/GetAlimtalkStatusCommand.js +9 -33
  6. package/dist-cjs/commands/GetAlimtalkTemplateCommand.js +9 -33
  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 +27 -0
  11. package/dist-cjs/commands/ListAlimtalkTemplatesCommand.js +8 -33
  12. package/dist-cjs/commands/SendAlimtalkCommand.js +36 -40
  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 -4
  16. package/dist-cjs/commands/index.js +11 -10
  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 +5 -0
  24. package/dist-cjs/models/SendMMS.js +3 -0
  25. package/dist-cjs/models/SensClient.js +2 -0
  26. package/dist-cjs/models/SensErrorInfo.js +13 -0
  27. package/dist-cjs/models/SensMiddleware.js +2 -0
  28. package/dist-cjs/models/index.js +16 -13
  29. package/dist-cjs/protocols/GetAlimtalkResult.js +19 -40
  30. package/dist-cjs/protocols/GetAlimtalkStatus.js +40 -50
  31. package/dist-cjs/protocols/GetAlimtalkTemplate.js +60 -22
  32. package/dist-cjs/protocols/GetSMSResult.js +30 -48
  33. package/dist-cjs/protocols/GetSMSStatus.js +31 -34
  34. package/dist-cjs/protocols/ListAlimtalkChannels.js +27 -31
  35. package/dist-cjs/protocols/ListAlimtalkStatus.js +48 -0
  36. package/dist-cjs/protocols/ListAlimtalkTemplates.js +36 -62
  37. package/dist-cjs/protocols/SendAlimtalk.js +33 -35
  38. package/dist-cjs/protocols/SendMMS.js +8 -38
  39. package/dist-cjs/protocols/SendSMS.js +19 -21
  40. package/dist-cjs/protocols/constants.js +98 -34
  41. package/dist-es/SensClient.js +65 -33
  42. package/dist-es/commands/GetAlimtalkResultCommand.js +10 -20
  43. package/dist-es/commands/GetAlimtalkStatusCommand.js +15 -20
  44. package/dist-es/commands/GetAlimtalkTemplateCommand.js +11 -20
  45. package/dist-es/commands/GetSMSResultCommand.js +10 -20
  46. package/dist-es/commands/GetSMSStatusCommand.js +10 -20
  47. package/dist-es/commands/ListAlimtalkChannelsCommand.js +10 -22
  48. package/dist-es/commands/ListAlimtalkStatusCommand.js +39 -0
  49. package/dist-es/commands/ListAlimtalkTemplatesCommand.js +10 -20
  50. package/dist-es/commands/SendAlimtalkCommand.js +40 -32
  51. package/dist-es/commands/SendMMSCommand.js +70 -100
  52. package/dist-es/commands/SendSMSCommand.js +51 -66
  53. package/dist-es/commands/constants.js +9 -6
  54. package/dist-es/commands/index.js +27 -10
  55. package/dist-es/index.js +18 -2
  56. package/dist-es/middleware/constants.js +10 -0
  57. package/dist-es/middleware/index.js +19 -4
  58. package/dist-es/middleware/middleware-metadata.js +11 -5
  59. package/dist-es/middleware/middleware-retry.js +39 -30
  60. package/dist-es/middleware/middleware-sign.js +19 -14
  61. package/dist-es/models/GetAlimtalkResult.js +2 -1
  62. package/dist-es/models/GetAlimtalkStatus.js +2 -1
  63. package/dist-es/models/GetAlimtalkTemplate.js +2 -1
  64. package/dist-es/models/GetSMSResult.js +2 -1
  65. package/dist-es/models/GetSMSStatus.js +2 -1
  66. package/dist-es/models/ListAlimtalkChannels.js +2 -1
  67. package/dist-es/models/ListAlimtalkStatus.js +2 -0
  68. package/dist-es/models/ListAlimtalkTemplates.js +2 -1
  69. package/dist-es/models/MetadataBearer.js +2 -1
  70. package/dist-es/models/SendAlimtalk.js +7 -1
  71. package/dist-es/models/SendMMS.js +5 -1
  72. package/dist-es/models/SendSMS.js +2 -1
  73. package/dist-es/models/SensClient.js +2 -0
  74. package/dist-es/models/SensCommand.js +5 -1
  75. package/dist-es/models/SensErrorInfo.js +13 -0
  76. package/dist-es/models/SensMiddleware.js +2 -0
  77. package/dist-es/models/index.js +32 -13
  78. package/dist-es/protocols/GetAlimtalkResult.js +24 -38
  79. package/dist-es/protocols/GetAlimtalkStatus.js +54 -50
  80. package/dist-es/protocols/GetAlimtalkTemplate.js +82 -23
  81. package/dist-es/protocols/GetSMSResult.js +44 -47
  82. package/dist-es/protocols/GetSMSStatus.js +35 -34
  83. package/dist-es/protocols/ListAlimtalkChannels.js +31 -31
  84. package/dist-es/protocols/ListAlimtalkStatus.js +42 -0
  85. package/dist-es/protocols/ListAlimtalkTemplates.js +41 -61
  86. package/dist-es/protocols/SendAlimtalk.js +37 -35
  87. package/dist-es/protocols/SendMMS.js +10 -49
  88. package/dist-es/protocols/SendSMS.js +23 -30
  89. package/dist-es/protocols/constants.js +112 -37
  90. package/dist-types/SensClient.d.ts +3 -20
  91. package/dist-types/commands/GetAlimtalkResultCommand.d.ts +5 -10
  92. package/dist-types/commands/GetAlimtalkStatusCommand.d.ts +5 -10
  93. package/dist-types/commands/GetAlimtalkTemplateCommand.d.ts +5 -10
  94. package/dist-types/commands/GetSMSResultCommand.d.ts +5 -10
  95. package/dist-types/commands/GetSMSStatusCommand.d.ts +5 -10
  96. package/dist-types/commands/ListAlimtalkChannelsCommand.d.ts +5 -10
  97. package/dist-types/commands/ListAlimtalkStatusCommand.d.ts +11 -0
  98. package/dist-types/commands/ListAlimtalkTemplatesCommand.d.ts +5 -10
  99. package/dist-types/commands/SendAlimtalkCommand.d.ts +5 -10
  100. package/dist-types/commands/SendMMSCommand.d.ts +5 -10
  101. package/dist-types/commands/SendSMSCommand.d.ts +9 -10
  102. package/dist-types/commands/constants.d.ts +0 -3
  103. package/dist-types/commands/index.d.ts +11 -10
  104. package/dist-types/index.d.ts +2 -2
  105. package/dist-types/middleware/constants.d.ts +7 -0
  106. package/dist-types/middleware/index.d.ts +3 -4
  107. package/dist-types/middleware/middleware-metadata.d.ts +2 -2
  108. package/dist-types/middleware/middleware-retry.d.ts +2 -2
  109. package/dist-types/middleware/middleware-sign.d.ts +2 -2
  110. package/dist-types/models/GetAlimtalkResult.d.ts +3 -4
  111. package/dist-types/models/GetAlimtalkStatus.d.ts +13 -5
  112. package/dist-types/models/GetAlimtalkTemplate.d.ts +42 -3
  113. package/dist-types/models/GetSMSResult.d.ts +5 -9
  114. package/dist-types/models/GetSMSStatus.d.ts +4 -4
  115. package/dist-types/models/ListAlimtalkChannels.d.ts +4 -4
  116. package/dist-types/models/ListAlimtalkStatus.d.ts +16 -0
  117. package/dist-types/models/ListAlimtalkTemplates.d.ts +2 -22
  118. package/dist-types/models/MetadataBearer.d.ts +3 -3
  119. package/dist-types/models/SendAlimtalk.d.ts +19 -10
  120. package/dist-types/models/SendMMS.d.ts +5 -3
  121. package/dist-types/models/SendSMS.d.ts +2 -2
  122. package/dist-types/models/SensClient.d.ts +17 -0
  123. package/dist-types/models/SensCommand.d.ts +4 -6
  124. package/dist-types/models/SensErrorInfo.d.ts +21 -0
  125. package/dist-types/models/SensMiddleware.d.ts +8 -0
  126. package/dist-types/models/index.d.ts +16 -13
  127. package/dist-types/protocols/GetAlimtalkResult.d.ts +4 -11
  128. package/dist-types/protocols/GetAlimtalkStatus.d.ts +6 -11
  129. package/dist-types/protocols/GetAlimtalkTemplate.d.ts +4 -10
  130. package/dist-types/protocols/GetSMSResult.d.ts +4 -12
  131. package/dist-types/protocols/GetSMSStatus.d.ts +5 -11
  132. package/dist-types/protocols/ListAlimtalkChannels.d.ts +4 -11
  133. package/dist-types/protocols/ListAlimtalkStatus.d.ts +4 -0
  134. package/dist-types/protocols/ListAlimtalkTemplates.d.ts +5 -13
  135. package/dist-types/protocols/SendAlimtalk.d.ts +5 -11
  136. package/dist-types/protocols/SendMMS.d.ts +4 -10
  137. package/dist-types/protocols/SendSMS.d.ts +5 -10
  138. package/dist-types/protocols/constants.d.ts +3 -2
  139. package/package.json +22 -5
  140. package/.github/pull_request_template.md +0 -19
  141. package/dist-cjs/middleware/middleware-sort-headers.js +0 -25
  142. package/dist-cjs/protocols/index.js +0 -26
  143. package/dist-es/middleware/middleware-sort-headers.js +0 -12
  144. package/dist-es/models/Middleware.js +0 -1
  145. package/dist-es/protocols/index.js +0 -10
  146. package/dist-types/middleware/middleware-sort-headers.d.ts +0 -2
  147. package/dist-types/models/Middleware.d.ts +0 -12
  148. package/dist-types/protocols/index.d.ts +0 -10
  149. /package/dist-cjs/models/{Middleware.js → ListAlimtalkStatus.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;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.de_ListAlimtalkStatusCommand = exports.se_ListAlimtalkStatusCommand = void 0;
13
+ const util_http_handler_1 = require("@ingestkorea/util-http-handler");
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* () {
17
+ const hostname = "sens.apigw.ntruss.com";
18
+ const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
19
+ const headers = {
20
+ host: hostname,
21
+ };
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
+ }, {});
28
+ return new util_http_handler_1.HttpRequest({
29
+ protocol: "https:",
30
+ method: "GET",
31
+ hostname: hostname,
32
+ path: path,
33
+ headers: headers,
34
+ query,
35
+ });
36
+ });
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));
44
+ });
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.deserializeIngestkorea_restJson_AlimtalkTemplateButton = exports.deserializeIngestkorea_restJson_AlimtalkTemplateComment = exports.deserializeIngestkorea_restJson_AlimtalkTemplate = 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,69 +30,43 @@ 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_AlimtalkTemplate)(output),
44
+ templates: Array.isArray(output) ? de_TemplateList(output) : [],
47
45
  };
48
- });
49
- exports.deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput = deserializeIngestkorea_restJson_ListAlimtalkTemplatesOutput;
50
- const deserializeIngestkorea_restJson_AlimtalkTemplate = (outputs) => {
51
- let result = outputs.map((output) => {
52
- return {
53
- createTime: output.createTime != undefined ? output.createTime : undefined,
54
- updateTime: output.updateTime != undefined ? output.updateTime : undefined,
55
- channelId: output.channelId != undefined ? output.channelId : undefined,
56
- templateCode: output.templateCode != undefined ? output.templateCode : undefined,
57
- templateName: output.templateName != undefined ? output.templateName : undefined,
58
- content: output.content != undefined ? output.content : undefined,
59
- comments: output.comments != undefined
60
- ? (0, exports.deserializeIngestkorea_restJson_AlimtalkTemplateComment)(output.comments)
61
- : undefined,
62
- templateInspectionStatus: output.templateInspectionStatus != undefined ? output.templateInspectionStatus : undefined,
63
- templateStatus: output.templateStatus != undefined ? output.templateStatus : undefined,
64
- buttons: output.buttons != undefined
65
- ? (0, exports.deserializeIngestkorea_restJson_AlimtalkTemplateButton)(output.buttons)
66
- : undefined,
67
- };
68
- });
69
- return result;
70
46
  };
71
- exports.deserializeIngestkorea_restJson_AlimtalkTemplate = deserializeIngestkorea_restJson_AlimtalkTemplate;
72
- const deserializeIngestkorea_restJson_AlimtalkTemplateComment = (outputs) => {
73
- let result = outputs.map((output) => {
74
- return {
75
- commentId: output.commentId != undefined ? output.commentId : undefined,
76
- content: output.content != undefined ? output.content : undefined,
77
- status: output.status != undefined ? output.status : undefined,
78
- createTime: output.createTime != undefined ? output.createTime : undefined,
79
- };
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;
80
61
  });
81
- return result;
82
62
  };
83
- exports.deserializeIngestkorea_restJson_AlimtalkTemplateComment = deserializeIngestkorea_restJson_AlimtalkTemplateComment;
84
- const deserializeIngestkorea_restJson_AlimtalkTemplateButton = (outputs) => {
85
- let result = outputs.map((output) => {
86
- return {
87
- order: output.order != undefined ? output.order : undefined,
88
- type: output.type != undefined ? output.type : undefined,
89
- name: output.name != undefined ? output.name : undefined,
90
- linkMobile: output.linkMobile != undefined ? output.linkMobile : undefined,
91
- linkPc: output.linkPc != undefined ? output.linkPc : undefined,
92
- schemeIos: output.schemeIos != undefined ? output.schemeIos : undefined,
93
- schemeAndroid: output.schemeAndroid != undefined ? output.schemeAndroid : undefined,
94
- };
95
- });
96
- return result;
63
+ const de_Template = (output) => {
64
+ return {
65
+ createTime: output.createTime != undefined ? output.createTime : undefined,
66
+ updateTime: output.updateTime != undefined ? output.updateTime : undefined,
67
+ channelId: output.channelId != undefined ? output.channelId : undefined,
68
+ templateCode: output.templateCode != undefined ? output.templateCode : undefined,
69
+ templateName: output.templateName != undefined ? output.templateName : undefined,
70
+ };
97
71
  };
98
- exports.deserializeIngestkorea_restJson_AlimtalkTemplateButton = deserializeIngestkorea_restJson_AlimtalkTemplateButton;
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.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,46 +27,44 @@ 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((output) => {
59
- return {
60
- messageId: output.messageId != undefined ? output.messageId : undefined,
61
- to: output.to != undefined ? output.to : undefined,
62
- countryCode: output.countryCode != undefined ? output.countryCode : undefined,
63
- content: output.content != undefined ? output.content : undefined,
64
- requestStatusCode: output.requestStatusCode != undefined ? output.requestStatusCode : undefined,
65
- requestStatusName: output.requestStatusName != undefined ? output.requestStatusName : undefined,
66
- requestStatusDesc: output.requestStatusDesc != undefined ? output.requestStatusDesc : undefined,
67
- useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
68
- };
69
- });
53
+ };
54
+ const de_AlimtalkMessageRequestStatusList = (output) => {
55
+ const result = (output || []).filter((e) => e != null).map((entry) => (0, exports.de_AlimtalkMessageRequestStatus)(entry));
70
56
  return result;
71
57
  };
72
- exports.deserializeIngestkorea_restJson_ReceivedMessages = deserializeIngestkorea_restJson_ReceivedMessages;
58
+ const de_AlimtalkMessageRequestStatus = (output) => {
59
+ return {
60
+ messageId: output.messageId != undefined ? output.messageId : undefined,
61
+ to: output.to != undefined ? output.to : undefined,
62
+ countryCode: output.countryCode != undefined ? output.countryCode : undefined,
63
+ content: output.content != undefined ? output.content : undefined,
64
+ requestStatusCode: output.requestStatusCode != undefined ? output.requestStatusCode : undefined,
65
+ requestStatusName: output.requestStatusName != undefined ? output.requestStatusName : undefined,
66
+ requestStatusDesc: output.requestStatusDesc != undefined ? output.requestStatusDesc : undefined,
67
+ useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined,
68
+ };
69
+ };
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;