@ingestkorea/client-sens 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist-cjs/commands/GetSMSResultCommand.js +43 -0
- package/dist-cjs/commands/GetSMSStatusCommand.js +43 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/GetSMSResult.js +6 -0
- package/dist-cjs/models/GetSMSStatus.js +5 -0
- package/dist-cjs/models/index.js +2 -0
- package/dist-cjs/protocols/GetSMSResult.js +77 -0
- package/dist-cjs/protocols/GetSMSStatus.js +66 -0
- package/dist-cjs/protocols/index.js +2 -0
- package/dist-es/commands/GetSMSResultCommand.js +28 -0
- package/dist-es/commands/GetSMSStatusCommand.js +28 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/GetSMSResult.js +5 -0
- package/dist-es/models/GetSMSStatus.js +4 -0
- package/dist-es/models/index.js +2 -0
- package/dist-es/protocols/GetSMSResult.js +62 -0
- package/dist-es/protocols/GetSMSStatus.js +52 -0
- package/dist-es/protocols/index.js +2 -0
- package/dist-types/commands/GetSMSResultCommand.d.ts +13 -0
- package/dist-types/commands/GetSMSStatusCommand.d.ts +13 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/GetSMSResult.d.ts +26 -0
- package/dist-types/models/GetSMSStatus.d.ts +17 -0
- package/dist-types/models/index.d.ts +2 -0
- package/dist-types/protocols/GetSMSResult.d.ts +9 -0
- package/dist-types/protocols/GetSMSStatus.d.ts +8 -0
- package/dist-types/protocols/index.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,13 +22,19 @@ npm install @ingestkorea/client-sens
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Support Commands
|
|
25
|
+
|
|
26
|
+
#### Kakao Alimtalk
|
|
25
27
|
+ SendAlimtalk
|
|
26
28
|
+ GetAlimtalkStatus (`GetRequestStatus` is deprecated)
|
|
27
29
|
+ GetAlimtalkResult (`GetRequestResult` is deprecated)
|
|
28
30
|
+ GetAlimtalkTemplate (`GetTemplate` is deprecated)
|
|
29
31
|
+ ListAlimtalkTemplates (`ListTemplates` is deprecated)
|
|
30
32
|
+ ListAlimtalkChannels (`ListChannels` is deprecated)
|
|
33
|
+
|
|
34
|
+
#### SMS(LMS)
|
|
31
35
|
+ SendSMS
|
|
36
|
+
+ GetSMSStatus
|
|
37
|
+
+ GetSMSResult
|
|
32
38
|
|
|
33
39
|
### Import
|
|
34
40
|
```ts
|
|
@@ -0,0 +1,43 @@
|
|
|
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.GetSMSResultCommand = void 0;
|
|
13
|
+
const models_1 = require("../models");
|
|
14
|
+
const GetSMSResult_1 = require("../protocols/GetSMSResult");
|
|
15
|
+
const util_error_handler_1 = require("@ingestkorea/util-error-handler");
|
|
16
|
+
;
|
|
17
|
+
;
|
|
18
|
+
class GetSMSResultCommand extends models_1.SensCommand {
|
|
19
|
+
constructor(input) {
|
|
20
|
+
super(input);
|
|
21
|
+
this.input = Object.assign({}, input);
|
|
22
|
+
}
|
|
23
|
+
;
|
|
24
|
+
serialize(input, config) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
if (!config.serviceId.sms)
|
|
27
|
+
throw new util_error_handler_1.IngestkoreaError({
|
|
28
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check SMS ServiceId'
|
|
29
|
+
});
|
|
30
|
+
let request = yield (0, GetSMSResult_1.serializeIngestkorea_restJson_GetSMSResultCommand)(input, config);
|
|
31
|
+
return request;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
;
|
|
35
|
+
deserialize(response) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
let output = yield (0, GetSMSResult_1.deserializeIngestkorea_restJson_GetSMSResultCommand)(response);
|
|
38
|
+
return output;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
}
|
|
43
|
+
exports.GetSMSResultCommand = GetSMSResultCommand;
|
|
@@ -0,0 +1,43 @@
|
|
|
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.GetSMSStatusCommand = void 0;
|
|
13
|
+
const models_1 = require("../models");
|
|
14
|
+
const GetSMSStatus_1 = require("../protocols/GetSMSStatus");
|
|
15
|
+
const util_error_handler_1 = require("@ingestkorea/util-error-handler");
|
|
16
|
+
;
|
|
17
|
+
;
|
|
18
|
+
class GetSMSStatusCommand extends models_1.SensCommand {
|
|
19
|
+
constructor(input) {
|
|
20
|
+
super(input);
|
|
21
|
+
this.input = Object.assign({}, input);
|
|
22
|
+
}
|
|
23
|
+
;
|
|
24
|
+
serialize(input, config) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
if (!config.serviceId.sms)
|
|
27
|
+
throw new util_error_handler_1.IngestkoreaError({
|
|
28
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check SMS ServiceId'
|
|
29
|
+
});
|
|
30
|
+
let request = yield (0, GetSMSStatus_1.serializeIngestkorea_restJson_GetSMSStatusCommand)(input, config);
|
|
31
|
+
return request;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
;
|
|
35
|
+
deserialize(response) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
let output = yield (0, GetSMSStatus_1.deserializeIngestkorea_restJson_GetSMSStatusCommand)(response);
|
|
38
|
+
return output;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
}
|
|
43
|
+
exports.GetSMSStatusCommand = GetSMSStatusCommand;
|
|
@@ -21,3 +21,5 @@ __exportStar(require("./GetAlimtalkTemplateCommand"), exports);
|
|
|
21
21
|
__exportStar(require("./ListAlimtalkTemplatesCommand"), exports);
|
|
22
22
|
__exportStar(require("./ListAlimtalkChannelsCommand"), exports);
|
|
23
23
|
__exportStar(require("./SendSMSCommand"), exports);
|
|
24
|
+
__exportStar(require("./GetSMSStatusCommand"), exports);
|
|
25
|
+
__exportStar(require("./GetSMSResultCommand"), exports);
|
package/dist-cjs/models/index.js
CHANGED
|
@@ -22,3 +22,5 @@ __exportStar(require("./GetAlimtalkTemplate"), exports);
|
|
|
22
22
|
__exportStar(require("./ListAlimtalkTemplates"), exports);
|
|
23
23
|
__exportStar(require("./ListAlimtalkChannels"), exports);
|
|
24
24
|
__exportStar(require("./SendSMS"), exports);
|
|
25
|
+
__exportStar(require("./GetSMSStatus"), exports);
|
|
26
|
+
__exportStar(require("./GetSMSResult"), exports);
|
|
@@ -0,0 +1,77 @@
|
|
|
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.deserializeIngestkorea_restJson_File = exports.deserializeIngestkorea_restJson_SMSResultMessage = exports.deserializeIngestkorea_restJson_GetSMSResultOutput = exports.deserializeIngestkorea_restJson_GetSMSResultCommand = exports.serializeIngestkorea_restJson_GetSMSResultCommand = void 0;
|
|
13
|
+
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
14
|
+
const constants_1 = require("../protocols/constants");
|
|
15
|
+
const serializeIngestkorea_restJson_GetSMSResultCommand = (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" + '/' + input.messageId;
|
|
18
|
+
const headers = {
|
|
19
|
+
"host": hostname
|
|
20
|
+
};
|
|
21
|
+
return new util_http_handler_1.HttpRequest({
|
|
22
|
+
protocol: 'https:',
|
|
23
|
+
method: 'GET',
|
|
24
|
+
hostname: hostname,
|
|
25
|
+
path: path,
|
|
26
|
+
headers: headers,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
exports.serializeIngestkorea_restJson_GetSMSResultCommand = serializeIngestkorea_restJson_GetSMSResultCommand;
|
|
30
|
+
const deserializeIngestkorea_restJson_GetSMSResultCommand = (output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
if (output.statusCode > 300)
|
|
32
|
+
yield (0, constants_1.parseErrorBody)(output);
|
|
33
|
+
const data = yield (0, constants_1.parseBody)(output); // GetSMSResultOutput
|
|
34
|
+
let contents = {};
|
|
35
|
+
contents = yield (0, exports.deserializeIngestkorea_restJson_GetSMSResultOutput)(data);
|
|
36
|
+
const response = Object.assign({}, contents);
|
|
37
|
+
return response;
|
|
38
|
+
});
|
|
39
|
+
exports.deserializeIngestkorea_restJson_GetSMSResultCommand = deserializeIngestkorea_restJson_GetSMSResultCommand;
|
|
40
|
+
const deserializeIngestkorea_restJson_GetSMSResultOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
return {
|
|
42
|
+
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
43
|
+
statusName: output.statusName ? output.statusName : undefined,
|
|
44
|
+
messages: output.messages ? (0, exports.deserializeIngestkorea_restJson_SMSResultMessage)(output.messages) : undefined
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
exports.deserializeIngestkorea_restJson_GetSMSResultOutput = deserializeIngestkorea_restJson_GetSMSResultOutput;
|
|
48
|
+
const deserializeIngestkorea_restJson_SMSResultMessage = (outputs) => {
|
|
49
|
+
let result = outputs.map(output => {
|
|
50
|
+
return {
|
|
51
|
+
requestTime: output.requestTime != undefined ? output.requestTime : undefined,
|
|
52
|
+
contentType: output.contentType != undefined ? output.contentType : undefined,
|
|
53
|
+
content: output.content != undefined ? output.content : undefined,
|
|
54
|
+
countryCode: output.countryCode != undefined ? output.countryCode : undefined,
|
|
55
|
+
from: output.from != undefined ? output.from : undefined,
|
|
56
|
+
to: output.to != undefined ? output.to : undefined,
|
|
57
|
+
status: output.status != undefined ? output.status : undefined,
|
|
58
|
+
statusCode: output.statusCode != undefined ? output.statusCode : undefined,
|
|
59
|
+
statusMessage: output.statusMessage != undefined ? output.statusMessage : undefined,
|
|
60
|
+
statusName: output.statusName != undefined ? output.statusName : undefined,
|
|
61
|
+
completeTime: output.completeTime != undefined ? output.completeTime : undefined,
|
|
62
|
+
telcoCode: output.telcoCode != undefined ? output.telcoCode : undefined,
|
|
63
|
+
files: output.files != undefined ? (0, exports.deserializeIngestkorea_restJson_File)(output.files) : undefined
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
exports.deserializeIngestkorea_restJson_SMSResultMessage = deserializeIngestkorea_restJson_SMSResultMessage;
|
|
69
|
+
const deserializeIngestkorea_restJson_File = (outputs) => {
|
|
70
|
+
let result = outputs.map(output => {
|
|
71
|
+
return {
|
|
72
|
+
name: output.name != undefined ? output.name : undefined
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
return result;
|
|
76
|
+
};
|
|
77
|
+
exports.deserializeIngestkorea_restJson_File = deserializeIngestkorea_restJson_File;
|
|
@@ -0,0 +1,66 @@
|
|
|
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.deserializeIngestkorea_restJson_SMSStatusMessage = exports.deserializeIngestkorea_restJson_GetSMSStatusOutput = exports.deserializeIngestkorea_restJson_GetSMSStatusCommand = exports.serializeIngestkorea_restJson_GetSMSStatusCommand = void 0;
|
|
13
|
+
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
14
|
+
const constants_1 = require("../protocols/constants");
|
|
15
|
+
const serializeIngestkorea_restJson_GetSMSStatusCommand = (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
|
+
"host": hostname
|
|
20
|
+
};
|
|
21
|
+
const query = {
|
|
22
|
+
requestId: input.requestId
|
|
23
|
+
};
|
|
24
|
+
return new util_http_handler_1.HttpRequest({
|
|
25
|
+
protocol: 'https:',
|
|
26
|
+
method: 'GET',
|
|
27
|
+
hostname: hostname,
|
|
28
|
+
path: path,
|
|
29
|
+
query: query,
|
|
30
|
+
headers: headers,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
exports.serializeIngestkorea_restJson_GetSMSStatusCommand = serializeIngestkorea_restJson_GetSMSStatusCommand;
|
|
34
|
+
const deserializeIngestkorea_restJson_GetSMSStatusCommand = (output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
if (output.statusCode > 300)
|
|
36
|
+
yield (0, constants_1.parseErrorBody)(output);
|
|
37
|
+
const data = yield (0, constants_1.parseBody)(output); // GetSMSStatusOutput
|
|
38
|
+
let contents = {};
|
|
39
|
+
contents = yield (0, exports.deserializeIngestkorea_restJson_GetSMSStatusOutput)(data);
|
|
40
|
+
const response = Object.assign({}, contents);
|
|
41
|
+
return response;
|
|
42
|
+
});
|
|
43
|
+
exports.deserializeIngestkorea_restJson_GetSMSStatusCommand = deserializeIngestkorea_restJson_GetSMSStatusCommand;
|
|
44
|
+
const deserializeIngestkorea_restJson_GetSMSStatusOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
return {
|
|
46
|
+
requestId: output.requestId ? output.requestId : undefined,
|
|
47
|
+
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
48
|
+
statusName: output.statusName ? output.statusName : undefined,
|
|
49
|
+
messages: output.messages ? (0, exports.deserializeIngestkorea_restJson_SMSStatusMessage)(output.messages) : undefined
|
|
50
|
+
};
|
|
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
|
+
};
|
|
66
|
+
exports.deserializeIngestkorea_restJson_SMSStatusMessage = deserializeIngestkorea_restJson_SMSStatusMessage;
|
|
@@ -21,3 +21,5 @@ __exportStar(require("./GetAlimtalkTemplate"), exports);
|
|
|
21
21
|
__exportStar(require("./ListAlimtalkTemplates"), exports);
|
|
22
22
|
__exportStar(require("./ListAlimtalkChannels"), exports);
|
|
23
23
|
__exportStar(require("./SendSMS"), exports);
|
|
24
|
+
__exportStar(require("./GetSMSStatus"), exports);
|
|
25
|
+
__exportStar(require("./GetSMSResult"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SensCommand } from '../models';
|
|
2
|
+
import { serializeIngestkorea_restJson_GetSMSResultCommand, deserializeIngestkorea_restJson_GetSMSResultCommand } from '../protocols/GetSMSResult';
|
|
3
|
+
import { IngestkoreaError } from '@ingestkorea/util-error-handler';
|
|
4
|
+
;
|
|
5
|
+
;
|
|
6
|
+
export class GetSMSResultCommand extends SensCommand {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super(input);
|
|
9
|
+
this.input = {
|
|
10
|
+
...input
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
;
|
|
14
|
+
async serialize(input, config) {
|
|
15
|
+
if (!config.serviceId.sms)
|
|
16
|
+
throw new IngestkoreaError({
|
|
17
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check SMS ServiceId'
|
|
18
|
+
});
|
|
19
|
+
let request = await serializeIngestkorea_restJson_GetSMSResultCommand(input, config);
|
|
20
|
+
return request;
|
|
21
|
+
}
|
|
22
|
+
;
|
|
23
|
+
async deserialize(response) {
|
|
24
|
+
let output = await deserializeIngestkorea_restJson_GetSMSResultCommand(response);
|
|
25
|
+
return output;
|
|
26
|
+
}
|
|
27
|
+
;
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SensCommand } from '../models';
|
|
2
|
+
import { serializeIngestkorea_restJson_GetSMSStatusCommand, deserializeIngestkorea_restJson_GetSMSStatusCommand } from '../protocols/GetSMSStatus';
|
|
3
|
+
import { IngestkoreaError } from '@ingestkorea/util-error-handler';
|
|
4
|
+
;
|
|
5
|
+
;
|
|
6
|
+
export class GetSMSStatusCommand extends SensCommand {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super(input);
|
|
9
|
+
this.input = {
|
|
10
|
+
...input
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
;
|
|
14
|
+
async serialize(input, config) {
|
|
15
|
+
if (!config.serviceId.sms)
|
|
16
|
+
throw new IngestkoreaError({
|
|
17
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check SMS ServiceId'
|
|
18
|
+
});
|
|
19
|
+
let request = await serializeIngestkorea_restJson_GetSMSStatusCommand(input, config);
|
|
20
|
+
return request;
|
|
21
|
+
}
|
|
22
|
+
;
|
|
23
|
+
async deserialize(response) {
|
|
24
|
+
let output = await deserializeIngestkorea_restJson_GetSMSStatusCommand(response);
|
|
25
|
+
return output;
|
|
26
|
+
}
|
|
27
|
+
;
|
|
28
|
+
}
|
package/dist-es/models/index.js
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HttpRequest } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { parseBody, parseErrorBody } from '../protocols/constants';
|
|
3
|
+
export const serializeIngestkorea_restJson_GetSMSResultCommand = async (input, config) => {
|
|
4
|
+
const hostname = "sens.apigw.ntruss.com";
|
|
5
|
+
const path = "/sms/v2/services/" + config.serviceId.sms + "/messages" + '/' + input.messageId;
|
|
6
|
+
const headers = {
|
|
7
|
+
"host": hostname
|
|
8
|
+
};
|
|
9
|
+
return new HttpRequest({
|
|
10
|
+
protocol: 'https:',
|
|
11
|
+
method: 'GET',
|
|
12
|
+
hostname: hostname,
|
|
13
|
+
path: path,
|
|
14
|
+
headers: headers,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export const deserializeIngestkorea_restJson_GetSMSResultCommand = async (output) => {
|
|
18
|
+
if (output.statusCode > 300)
|
|
19
|
+
await parseErrorBody(output);
|
|
20
|
+
const data = await parseBody(output); // GetSMSResultOutput
|
|
21
|
+
let contents = {};
|
|
22
|
+
contents = await deserializeIngestkorea_restJson_GetSMSResultOutput(data);
|
|
23
|
+
const response = {
|
|
24
|
+
...contents
|
|
25
|
+
};
|
|
26
|
+
return response;
|
|
27
|
+
};
|
|
28
|
+
export const deserializeIngestkorea_restJson_GetSMSResultOutput = async (output) => {
|
|
29
|
+
return {
|
|
30
|
+
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
31
|
+
statusName: output.statusName ? output.statusName : undefined,
|
|
32
|
+
messages: output.messages ? deserializeIngestkorea_restJson_SMSResultMessage(output.messages) : undefined
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export const deserializeIngestkorea_restJson_SMSResultMessage = (outputs) => {
|
|
36
|
+
let result = outputs.map(output => {
|
|
37
|
+
return {
|
|
38
|
+
requestTime: output.requestTime != undefined ? output.requestTime : undefined,
|
|
39
|
+
contentType: output.contentType != undefined ? output.contentType : undefined,
|
|
40
|
+
content: output.content != undefined ? output.content : undefined,
|
|
41
|
+
countryCode: output.countryCode != undefined ? output.countryCode : undefined,
|
|
42
|
+
from: output.from != undefined ? output.from : undefined,
|
|
43
|
+
to: output.to != undefined ? output.to : undefined,
|
|
44
|
+
status: output.status != undefined ? output.status : undefined,
|
|
45
|
+
statusCode: output.statusCode != undefined ? output.statusCode : undefined,
|
|
46
|
+
statusMessage: output.statusMessage != undefined ? output.statusMessage : undefined,
|
|
47
|
+
statusName: output.statusName != undefined ? output.statusName : undefined,
|
|
48
|
+
completeTime: output.completeTime != undefined ? output.completeTime : undefined,
|
|
49
|
+
telcoCode: output.telcoCode != undefined ? output.telcoCode : undefined,
|
|
50
|
+
files: output.files != undefined ? deserializeIngestkorea_restJson_File(output.files) : undefined
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
export const deserializeIngestkorea_restJson_File = (outputs) => {
|
|
56
|
+
let result = outputs.map(output => {
|
|
57
|
+
return {
|
|
58
|
+
name: output.name != undefined ? output.name : undefined
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { HttpRequest } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { parseBody, parseErrorBody } from '../protocols/constants';
|
|
3
|
+
export const serializeIngestkorea_restJson_GetSMSStatusCommand = async (input, config) => {
|
|
4
|
+
const hostname = "sens.apigw.ntruss.com";
|
|
5
|
+
const path = "/sms/v2/services/" + config.serviceId.sms + "/messages";
|
|
6
|
+
const headers = {
|
|
7
|
+
"host": hostname
|
|
8
|
+
};
|
|
9
|
+
const query = {
|
|
10
|
+
requestId: input.requestId
|
|
11
|
+
};
|
|
12
|
+
return new HttpRequest({
|
|
13
|
+
protocol: 'https:',
|
|
14
|
+
method: 'GET',
|
|
15
|
+
hostname: hostname,
|
|
16
|
+
path: path,
|
|
17
|
+
query: query,
|
|
18
|
+
headers: headers,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export const deserializeIngestkorea_restJson_GetSMSStatusCommand = async (output) => {
|
|
22
|
+
if (output.statusCode > 300)
|
|
23
|
+
await parseErrorBody(output);
|
|
24
|
+
const data = await parseBody(output); // GetSMSStatusOutput
|
|
25
|
+
let contents = {};
|
|
26
|
+
contents = await deserializeIngestkorea_restJson_GetSMSStatusOutput(data);
|
|
27
|
+
const response = {
|
|
28
|
+
...contents
|
|
29
|
+
};
|
|
30
|
+
return response;
|
|
31
|
+
};
|
|
32
|
+
export const deserializeIngestkorea_restJson_GetSMSStatusOutput = async (output) => {
|
|
33
|
+
return {
|
|
34
|
+
requestId: output.requestId ? output.requestId : undefined,
|
|
35
|
+
statusCode: output.statusCode ? output.statusCode : undefined,
|
|
36
|
+
statusName: output.statusName ? output.statusName : undefined,
|
|
37
|
+
messages: output.messages ? deserializeIngestkorea_restJson_SMSStatusMessage(output.messages) : undefined
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export const deserializeIngestkorea_restJson_SMSStatusMessage = (outputs) => {
|
|
41
|
+
let result = outputs.map(output => {
|
|
42
|
+
return {
|
|
43
|
+
messageId: output.messageId != undefined ? output.messageId : undefined,
|
|
44
|
+
requestTime: output.requestTime != undefined ? output.requestTime : undefined,
|
|
45
|
+
contentType: output.contentType != undefined ? output.contentType : undefined,
|
|
46
|
+
countryCode: output.countryCode != undefined ? output.countryCode : undefined,
|
|
47
|
+
from: output.from != undefined ? output.from : undefined,
|
|
48
|
+
to: output.to != undefined ? output.to : undefined
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { SensCommand, GetSMSResultInput, GetSMSResultOutput } from '../models';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
export interface GetSMSResultCommandInput extends GetSMSResultInput {
|
|
5
|
+
}
|
|
6
|
+
export interface GetSMSResultCommandOutput extends GetSMSResultOutput {
|
|
7
|
+
}
|
|
8
|
+
export declare class GetSMSResultCommand extends SensCommand<GetSMSResultCommandInput, GetSMSResultCommandOutput, SensClientResolvedConfig> {
|
|
9
|
+
input: GetSMSResultCommandInput;
|
|
10
|
+
constructor(input: GetSMSResultCommandInput);
|
|
11
|
+
serialize(input: GetSMSResultCommandInput, config: SensClientResolvedConfig): Promise<HttpRequest>;
|
|
12
|
+
deserialize(response: HttpResponse): Promise<GetSMSResultCommandOutput>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { SensCommand, GetSMSStatusInput, GetSMSStatusOutput } from '../models';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
export interface GetSMSStatusCommandInput extends GetSMSStatusInput {
|
|
5
|
+
}
|
|
6
|
+
export interface GetSMSStatusCommandOutput extends GetSMSStatusOutput {
|
|
7
|
+
}
|
|
8
|
+
export declare class GetSMSStatusCommand extends SensCommand<GetSMSStatusCommandInput, GetSMSStatusCommandOutput, SensClientResolvedConfig> {
|
|
9
|
+
input: GetSMSStatusCommandInput;
|
|
10
|
+
constructor(input: GetSMSStatusCommandInput);
|
|
11
|
+
serialize(input: GetSMSStatusCommandInput, config: SensClientResolvedConfig): Promise<HttpRequest>;
|
|
12
|
+
deserialize(response: HttpResponse): Promise<GetSMSStatusCommandOutput>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface GetSMSResultInput {
|
|
2
|
+
messageId: string;
|
|
3
|
+
}
|
|
4
|
+
export interface GetSMSResultOutput {
|
|
5
|
+
statusCode?: string;
|
|
6
|
+
statusName?: string;
|
|
7
|
+
messages?: SMSResultMessage[];
|
|
8
|
+
}
|
|
9
|
+
export interface SMSResultMessage {
|
|
10
|
+
requestTime?: string;
|
|
11
|
+
contentType?: string;
|
|
12
|
+
content?: string;
|
|
13
|
+
countryCode?: string;
|
|
14
|
+
from?: string;
|
|
15
|
+
to?: string;
|
|
16
|
+
status?: string;
|
|
17
|
+
statusCode?: string;
|
|
18
|
+
statusMessage?: string;
|
|
19
|
+
statusName?: string;
|
|
20
|
+
completeTime?: string;
|
|
21
|
+
telcoCode?: string;
|
|
22
|
+
files?: File[];
|
|
23
|
+
}
|
|
24
|
+
export interface File {
|
|
25
|
+
name?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface GetSMSStatusInput {
|
|
2
|
+
requestId: string;
|
|
3
|
+
}
|
|
4
|
+
export interface GetSMSStatusOutput {
|
|
5
|
+
requestId?: string;
|
|
6
|
+
statusCode?: string;
|
|
7
|
+
statusName?: string;
|
|
8
|
+
messages?: SMSStatusMessage[];
|
|
9
|
+
}
|
|
10
|
+
export interface SMSStatusMessage {
|
|
11
|
+
messageId?: string;
|
|
12
|
+
requestTime?: string;
|
|
13
|
+
contentType?: string;
|
|
14
|
+
countryCode?: string;
|
|
15
|
+
from?: string;
|
|
16
|
+
to?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { GetSMSResultOutput, SMSResultMessage, File } from '../models/GetSMSResult';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
import { GetSMSResultCommandInput, GetSMSResultCommandOutput } from '../commands/GetSMSResultCommand';
|
|
5
|
+
export declare const serializeIngestkorea_restJson_GetSMSResultCommand: (input: GetSMSResultCommandInput, config: SensClientResolvedConfig) => Promise<HttpRequest>;
|
|
6
|
+
export declare const deserializeIngestkorea_restJson_GetSMSResultCommand: (output: HttpResponse) => Promise<GetSMSResultCommandOutput>;
|
|
7
|
+
export declare const deserializeIngestkorea_restJson_GetSMSResultOutput: (output: any) => Promise<GetSMSResultOutput>;
|
|
8
|
+
export declare const deserializeIngestkorea_restJson_SMSResultMessage: (outputs: any[]) => SMSResultMessage[];
|
|
9
|
+
export declare const deserializeIngestkorea_restJson_File: (outputs: any[]) => File[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { GetSMSStatusOutput, SMSStatusMessage } from '../models/GetSMSStatus';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
import { GetSMSStatusCommandInput, GetSMSStatusCommandOutput } from '../commands/GetSMSStatusCommand';
|
|
5
|
+
export declare const serializeIngestkorea_restJson_GetSMSStatusCommand: (input: GetSMSStatusCommandInput, config: SensClientResolvedConfig) => Promise<HttpRequest>;
|
|
6
|
+
export declare const deserializeIngestkorea_restJson_GetSMSStatusCommand: (output: HttpResponse) => Promise<GetSMSStatusCommandOutput>;
|
|
7
|
+
export declare const deserializeIngestkorea_restJson_GetSMSStatusOutput: (output: any) => Promise<GetSMSStatusOutput>;
|
|
8
|
+
export declare const deserializeIngestkorea_restJson_SMSStatusMessage: (outputs: any[]) => SMSStatusMessage[];
|