@ingestkorea/client-sens 1.1.0 → 1.2.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 +3 -1
- package/dist-cjs/commands/GetTemplateCommand.js +44 -0
- package/dist-cjs/commands/ListTemplatesCommand.js +44 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/GetTemplate.js +4 -0
- package/dist-cjs/models/ListTemplates.js +7 -0
- package/dist-cjs/models/index.js +2 -0
- package/dist-cjs/protocols/GetTemplate.js +51 -0
- package/dist-cjs/protocols/ListTemplates.js +94 -0
- package/dist-cjs/protocols/index.js +2 -0
- package/dist-es/commands/GetTemplateCommand.js +29 -0
- package/dist-es/commands/ListTemplatesCommand.js +29 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/GetTemplate.js +3 -0
- package/dist-es/models/ListTemplates.js +6 -0
- package/dist-es/models/index.js +2 -0
- package/dist-es/protocols/GetTemplate.js +38 -0
- package/dist-es/protocols/ListTemplates.js +78 -0
- package/dist-es/protocols/index.js +2 -0
- package/dist-types/commands/GetTemplateCommand.d.ts +13 -0
- package/dist-types/commands/ListTemplatesCommand.d.ts +13 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/GetTemplate.d.ts +6 -0
- package/dist-types/models/ListTemplates.d.ts +33 -0
- package/dist-types/models/index.d.ts +2 -0
- package/dist-types/protocols/GetTemplate.d.ts +7 -0
- package/dist-types/protocols/ListTemplates.d.ts +10 -0
- package/dist-types/protocols/index.d.ts +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@ingestkorea/client-sens)
|
|
5
5
|
|
|
6
6
|
## Description
|
|
7
|
-
INGESTKOREA SDK
|
|
7
|
+
INGESTKOREA SDK Naver Cloud Platform SENS Client for Node.js.
|
|
8
8
|
|
|
9
9
|
## Installing
|
|
10
10
|
```sh
|
|
@@ -26,6 +26,8 @@ npm install @ingestkorea/client-sens
|
|
|
26
26
|
+ GetRequestResult
|
|
27
27
|
+ ListChannels
|
|
28
28
|
+ SendSMS
|
|
29
|
+
+ ListTemplates
|
|
30
|
+
+ GetTemplate
|
|
29
31
|
|
|
30
32
|
### Import
|
|
31
33
|
```ts
|
|
@@ -0,0 +1,44 @@
|
|
|
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.GetTemplateCommand = void 0;
|
|
13
|
+
const models_1 = require("../models");
|
|
14
|
+
const GetTemplate_1 = require("../protocols/GetTemplate");
|
|
15
|
+
const util_error_handler_1 = require("@ingestkorea/util-error-handler");
|
|
16
|
+
;
|
|
17
|
+
;
|
|
18
|
+
class GetTemplateCommand 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.kakao)
|
|
27
|
+
throw new util_error_handler_1.IngestkoreaError({
|
|
28
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check Kakao ServiceId'
|
|
29
|
+
});
|
|
30
|
+
let request = yield (0, GetTemplate_1.serializeIngestkorea_restJson_GetTemplateCommand)(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, GetTemplate_1.deserializeIngestkorea_restJson_GetTemplateCommand)(response);
|
|
38
|
+
return output;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
}
|
|
43
|
+
exports.GetTemplateCommand = GetTemplateCommand;
|
|
44
|
+
;
|
|
@@ -0,0 +1,44 @@
|
|
|
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.ListTemplatesCommand = void 0;
|
|
13
|
+
const models_1 = require("../models");
|
|
14
|
+
const ListTemplates_1 = require("../protocols/ListTemplates");
|
|
15
|
+
const util_error_handler_1 = require("@ingestkorea/util-error-handler");
|
|
16
|
+
;
|
|
17
|
+
;
|
|
18
|
+
class ListTemplatesCommand 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.kakao)
|
|
27
|
+
throw new util_error_handler_1.IngestkoreaError({
|
|
28
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check Kakao ServiceId'
|
|
29
|
+
});
|
|
30
|
+
let request = yield (0, ListTemplates_1.serializeIngestkorea_restJson_ListTemplatesCommand)(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, ListTemplates_1.deserializeIngestkorea_restJson_ListTemplatesCommand)(response);
|
|
38
|
+
return output;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
}
|
|
43
|
+
exports.ListTemplatesCommand = ListTemplatesCommand;
|
|
44
|
+
;
|
|
@@ -19,3 +19,5 @@ __exportStar(require("./GetRequestStatusCommand"), exports);
|
|
|
19
19
|
__exportStar(require("./GetRequestResultCommand"), exports);
|
|
20
20
|
__exportStar(require("./ListChannelsCommand"), exports);
|
|
21
21
|
__exportStar(require("./SendSMSCommand"), exports);
|
|
22
|
+
__exportStar(require("./ListTemplatesCommand"), exports);
|
|
23
|
+
__exportStar(require("./GetTemplateCommand"), exports);
|
package/dist-cjs/models/index.js
CHANGED
|
@@ -20,3 +20,5 @@ __exportStar(require("./GetRequestStatus"), exports);
|
|
|
20
20
|
__exportStar(require("./GetRequestResult"), exports);
|
|
21
21
|
__exportStar(require("./ListChannels"), exports);
|
|
22
22
|
__exportStar(require("./SendSMS"), exports);
|
|
23
|
+
__exportStar(require("./ListTemplates"), exports);
|
|
24
|
+
__exportStar(require("./GetTemplate"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
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_GetTemplateOutput = exports.deserializeIngestkorea_restJson_GetTemplateCommand = exports.serializeIngestkorea_restJson_GetTemplateCommand = void 0;
|
|
13
|
+
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
14
|
+
const ListTemplates_1 = require("../protocols/ListTemplates");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const serializeIngestkorea_restJson_GetTemplateCommand = (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 + "/templates";
|
|
19
|
+
const headers = {
|
|
20
|
+
"host": hostname
|
|
21
|
+
};
|
|
22
|
+
const query = {
|
|
23
|
+
channelId: input.channelId,
|
|
24
|
+
templateCode: input.templateCode
|
|
25
|
+
};
|
|
26
|
+
return new util_http_handler_1.HttpRequest({
|
|
27
|
+
protocol: 'https:',
|
|
28
|
+
method: 'GET',
|
|
29
|
+
hostname: hostname,
|
|
30
|
+
path: path,
|
|
31
|
+
query: query,
|
|
32
|
+
headers: headers
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
exports.serializeIngestkorea_restJson_GetTemplateCommand = serializeIngestkorea_restJson_GetTemplateCommand;
|
|
36
|
+
const deserializeIngestkorea_restJson_GetTemplateCommand = (output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
if (output.statusCode > 300)
|
|
38
|
+
yield (0, constants_1.parseErrorBody)(output);
|
|
39
|
+
const data = yield (0, constants_1.parseBody)(output); // GetTemplateOutput
|
|
40
|
+
let contents = {};
|
|
41
|
+
contents = yield (0, exports.deserializeIngestkorea_restJson_GetTemplateOutput)(data);
|
|
42
|
+
const response = Object.assign({}, contents);
|
|
43
|
+
return response;
|
|
44
|
+
});
|
|
45
|
+
exports.deserializeIngestkorea_restJson_GetTemplateCommand = deserializeIngestkorea_restJson_GetTemplateCommand;
|
|
46
|
+
const deserializeIngestkorea_restJson_GetTemplateOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
return {
|
|
48
|
+
templates: (0, ListTemplates_1.deserializeIngestkorea_restJson_Template)(output)
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
exports.deserializeIngestkorea_restJson_GetTemplateOutput = deserializeIngestkorea_restJson_GetTemplateOutput;
|
|
@@ -0,0 +1,94 @@
|
|
|
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_Button = exports.deserializeIngestkorea_restJson_Comment = exports.deserializeIngestkorea_restJson_Template = exports.deserializeIngestkorea_restJson_ListTemplatesOutput = exports.deserializeIngestkorea_restJson_ListTemplatesCommand = exports.serializeIngestkorea_restJson_ListTemplatesCommand = void 0;
|
|
13
|
+
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
|
|
14
|
+
const constants_1 = require("./constants");
|
|
15
|
+
const serializeIngestkorea_restJson_ListTemplatesCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const hostname = "sens.apigw.ntruss.com";
|
|
17
|
+
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/templates";
|
|
18
|
+
const headers = {
|
|
19
|
+
"host": hostname
|
|
20
|
+
};
|
|
21
|
+
const query = {
|
|
22
|
+
channelId: input.channelId
|
|
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_ListTemplatesCommand = serializeIngestkorea_restJson_ListTemplatesCommand;
|
|
34
|
+
const deserializeIngestkorea_restJson_ListTemplatesCommand = (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); // ListTemplatesOutput
|
|
38
|
+
let contents = {};
|
|
39
|
+
contents = yield (0, exports.deserializeIngestkorea_restJson_ListTemplatesOutput)(data);
|
|
40
|
+
const response = Object.assign({}, contents);
|
|
41
|
+
return response;
|
|
42
|
+
});
|
|
43
|
+
exports.deserializeIngestkorea_restJson_ListTemplatesCommand = deserializeIngestkorea_restJson_ListTemplatesCommand;
|
|
44
|
+
const deserializeIngestkorea_restJson_ListTemplatesOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
return {
|
|
46
|
+
templates: (0, exports.deserializeIngestkorea_restJson_Template)(output)
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
exports.deserializeIngestkorea_restJson_ListTemplatesOutput = deserializeIngestkorea_restJson_ListTemplatesOutput;
|
|
50
|
+
const deserializeIngestkorea_restJson_Template = (outputs) => {
|
|
51
|
+
return 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_Comment)(output.comments) : undefined,
|
|
61
|
+
templateInspectionStatus: output.templateInspectionStatus != undefined
|
|
62
|
+
? output.templateInspectionStatus : undefined,
|
|
63
|
+
templateStatus: output.templateStatus != undefined ? output.templateStatus : undefined,
|
|
64
|
+
buttons: output.buttons != undefined
|
|
65
|
+
? (0, exports.deserializeIngestkorea_restJson_Button)(output.buttons) : undefined
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
exports.deserializeIngestkorea_restJson_Template = deserializeIngestkorea_restJson_Template;
|
|
70
|
+
const deserializeIngestkorea_restJson_Comment = (outputs) => {
|
|
71
|
+
return outputs.map(output => {
|
|
72
|
+
return {
|
|
73
|
+
commentId: output.commentId != undefined ? output.commentId : undefined,
|
|
74
|
+
content: output.content != undefined ? output.content : undefined,
|
|
75
|
+
status: output.status != undefined ? output.status : undefined,
|
|
76
|
+
createTime: output.createTime != undefined ? output.createTime : undefined
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
exports.deserializeIngestkorea_restJson_Comment = deserializeIngestkorea_restJson_Comment;
|
|
81
|
+
const deserializeIngestkorea_restJson_Button = (outputs) => {
|
|
82
|
+
return outputs.map(output => {
|
|
83
|
+
return {
|
|
84
|
+
order: output.order != undefined ? output.order : undefined,
|
|
85
|
+
type: output.type != undefined ? output.type : undefined,
|
|
86
|
+
name: output.name != undefined ? output.name : undefined,
|
|
87
|
+
linkMobile: output.linkMobile != undefined ? output.linkMobile : undefined,
|
|
88
|
+
linkPc: output.linkPc != undefined ? output.linkPc : undefined,
|
|
89
|
+
schemeIos: output.schemeIos != undefined ? output.schemeIos : undefined,
|
|
90
|
+
schemeAndroid: output.schemeAndroid != undefined ? output.schemeAndroid : undefined
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
exports.deserializeIngestkorea_restJson_Button = deserializeIngestkorea_restJson_Button;
|
|
@@ -19,3 +19,5 @@ __exportStar(require("./GetRequestStatus"), exports);
|
|
|
19
19
|
__exportStar(require("./GetRequestResult"), exports);
|
|
20
20
|
__exportStar(require("./ListChannels"), exports);
|
|
21
21
|
__exportStar(require("./SendSMS"), exports);
|
|
22
|
+
__exportStar(require("./ListTemplates"), exports);
|
|
23
|
+
__exportStar(require("./GetTemplate"), exports);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SensCommand } from '../models';
|
|
2
|
+
import { serializeIngestkorea_restJson_GetTemplateCommand, deserializeIngestkorea_restJson_GetTemplateCommand } from '../protocols/GetTemplate';
|
|
3
|
+
import { IngestkoreaError } from '@ingestkorea/util-error-handler';
|
|
4
|
+
;
|
|
5
|
+
;
|
|
6
|
+
export class GetTemplateCommand 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.kakao)
|
|
16
|
+
throw new IngestkoreaError({
|
|
17
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check Kakao ServiceId'
|
|
18
|
+
});
|
|
19
|
+
let request = await serializeIngestkorea_restJson_GetTemplateCommand(input, config);
|
|
20
|
+
return request;
|
|
21
|
+
}
|
|
22
|
+
;
|
|
23
|
+
async deserialize(response) {
|
|
24
|
+
let output = await deserializeIngestkorea_restJson_GetTemplateCommand(response);
|
|
25
|
+
return output;
|
|
26
|
+
}
|
|
27
|
+
;
|
|
28
|
+
}
|
|
29
|
+
;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SensCommand } from '../models';
|
|
2
|
+
import { serializeIngestkorea_restJson_ListTemplatesCommand, deserializeIngestkorea_restJson_ListTemplatesCommand } from '../protocols/ListTemplates';
|
|
3
|
+
import { IngestkoreaError } from '@ingestkorea/util-error-handler';
|
|
4
|
+
;
|
|
5
|
+
;
|
|
6
|
+
export class ListTemplatesCommand 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.kakao)
|
|
16
|
+
throw new IngestkoreaError({
|
|
17
|
+
code: 400, type: 'Bad Request', message: 'Invalid Params', description: 'Please Check Kakao ServiceId'
|
|
18
|
+
});
|
|
19
|
+
let request = await serializeIngestkorea_restJson_ListTemplatesCommand(input, config);
|
|
20
|
+
return request;
|
|
21
|
+
}
|
|
22
|
+
;
|
|
23
|
+
async deserialize(response) {
|
|
24
|
+
let output = await deserializeIngestkorea_restJson_ListTemplatesCommand(response);
|
|
25
|
+
return output;
|
|
26
|
+
}
|
|
27
|
+
;
|
|
28
|
+
}
|
|
29
|
+
;
|
package/dist-es/models/index.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HttpRequest } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { deserializeIngestkorea_restJson_Template } from '../protocols/ListTemplates';
|
|
3
|
+
import { parseBody, parseErrorBody } from './constants';
|
|
4
|
+
export const serializeIngestkorea_restJson_GetTemplateCommand = async (input, config) => {
|
|
5
|
+
const hostname = "sens.apigw.ntruss.com";
|
|
6
|
+
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/templates";
|
|
7
|
+
const headers = {
|
|
8
|
+
"host": hostname
|
|
9
|
+
};
|
|
10
|
+
const query = {
|
|
11
|
+
channelId: input.channelId,
|
|
12
|
+
templateCode: input.templateCode
|
|
13
|
+
};
|
|
14
|
+
return new HttpRequest({
|
|
15
|
+
protocol: 'https:',
|
|
16
|
+
method: 'GET',
|
|
17
|
+
hostname: hostname,
|
|
18
|
+
path: path,
|
|
19
|
+
query: query,
|
|
20
|
+
headers: headers
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export const deserializeIngestkorea_restJson_GetTemplateCommand = async (output) => {
|
|
24
|
+
if (output.statusCode > 300)
|
|
25
|
+
await parseErrorBody(output);
|
|
26
|
+
const data = await parseBody(output); // GetTemplateOutput
|
|
27
|
+
let contents = {};
|
|
28
|
+
contents = await deserializeIngestkorea_restJson_GetTemplateOutput(data);
|
|
29
|
+
const response = {
|
|
30
|
+
...contents
|
|
31
|
+
};
|
|
32
|
+
return response;
|
|
33
|
+
};
|
|
34
|
+
export const deserializeIngestkorea_restJson_GetTemplateOutput = async (output) => {
|
|
35
|
+
return {
|
|
36
|
+
templates: deserializeIngestkorea_restJson_Template(output)
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { HttpRequest } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { parseBody, parseErrorBody } from './constants';
|
|
3
|
+
export const serializeIngestkorea_restJson_ListTemplatesCommand = async (input, config) => {
|
|
4
|
+
const hostname = "sens.apigw.ntruss.com";
|
|
5
|
+
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/templates";
|
|
6
|
+
const headers = {
|
|
7
|
+
"host": hostname
|
|
8
|
+
};
|
|
9
|
+
const query = {
|
|
10
|
+
channelId: input.channelId
|
|
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_ListTemplatesCommand = async (output) => {
|
|
22
|
+
if (output.statusCode > 300)
|
|
23
|
+
await parseErrorBody(output);
|
|
24
|
+
const data = await parseBody(output); // ListTemplatesOutput
|
|
25
|
+
let contents = {};
|
|
26
|
+
contents = await deserializeIngestkorea_restJson_ListTemplatesOutput(data);
|
|
27
|
+
const response = {
|
|
28
|
+
...contents
|
|
29
|
+
};
|
|
30
|
+
return response;
|
|
31
|
+
};
|
|
32
|
+
export const deserializeIngestkorea_restJson_ListTemplatesOutput = async (output) => {
|
|
33
|
+
return {
|
|
34
|
+
templates: deserializeIngestkorea_restJson_Template(output)
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export const deserializeIngestkorea_restJson_Template = (outputs) => {
|
|
38
|
+
return outputs.map(output => {
|
|
39
|
+
return {
|
|
40
|
+
createTime: output.createTime != undefined ? output.createTime : undefined,
|
|
41
|
+
updateTime: output.updateTime != undefined ? output.updateTime : undefined,
|
|
42
|
+
channelId: output.channelId != undefined ? output.channelId : undefined,
|
|
43
|
+
templateCode: output.templateCode != undefined ? output.templateCode : undefined,
|
|
44
|
+
templateName: output.templateName != undefined ? output.templateName : undefined,
|
|
45
|
+
content: output.content != undefined ? output.content : undefined,
|
|
46
|
+
comments: output.comments != undefined
|
|
47
|
+
? deserializeIngestkorea_restJson_Comment(output.comments) : undefined,
|
|
48
|
+
templateInspectionStatus: output.templateInspectionStatus != undefined
|
|
49
|
+
? output.templateInspectionStatus : undefined,
|
|
50
|
+
templateStatus: output.templateStatus != undefined ? output.templateStatus : undefined,
|
|
51
|
+
buttons: output.buttons != undefined
|
|
52
|
+
? deserializeIngestkorea_restJson_Button(output.buttons) : undefined
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export const deserializeIngestkorea_restJson_Comment = (outputs) => {
|
|
57
|
+
return outputs.map(output => {
|
|
58
|
+
return {
|
|
59
|
+
commentId: output.commentId != undefined ? output.commentId : undefined,
|
|
60
|
+
content: output.content != undefined ? output.content : undefined,
|
|
61
|
+
status: output.status != undefined ? output.status : undefined,
|
|
62
|
+
createTime: output.createTime != undefined ? output.createTime : undefined
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
export const deserializeIngestkorea_restJson_Button = (outputs) => {
|
|
67
|
+
return outputs.map(output => {
|
|
68
|
+
return {
|
|
69
|
+
order: output.order != undefined ? output.order : undefined,
|
|
70
|
+
type: output.type != undefined ? output.type : undefined,
|
|
71
|
+
name: output.name != undefined ? output.name : undefined,
|
|
72
|
+
linkMobile: output.linkMobile != undefined ? output.linkMobile : undefined,
|
|
73
|
+
linkPc: output.linkPc != undefined ? output.linkPc : undefined,
|
|
74
|
+
schemeIos: output.schemeIos != undefined ? output.schemeIos : undefined,
|
|
75
|
+
schemeAndroid: output.schemeAndroid != undefined ? output.schemeAndroid : undefined
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { SensCommand, GetTemplateInput, GetTemplateOutput } from '../models';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
export interface GetTemplateCommandInput extends GetTemplateInput {
|
|
5
|
+
}
|
|
6
|
+
export interface GetTemplateCommandOutput extends GetTemplateOutput {
|
|
7
|
+
}
|
|
8
|
+
export declare class GetTemplateCommand extends SensCommand<GetTemplateCommandInput, GetTemplateCommandOutput, SensClientResolvedConfig> {
|
|
9
|
+
input: GetTemplateCommandInput;
|
|
10
|
+
constructor(input: GetTemplateCommandInput);
|
|
11
|
+
serialize(input: GetTemplateCommandInput, config: SensClientResolvedConfig): Promise<HttpRequest>;
|
|
12
|
+
deserialize(response: HttpResponse): Promise<GetTemplateCommandOutput>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { SensCommand, ListTemplatesInput, ListTemplatesOutput } from '../models';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
export interface ListTemplatesCommandInput extends ListTemplatesInput {
|
|
5
|
+
}
|
|
6
|
+
export interface ListTemplatesCommandOutput extends ListTemplatesOutput {
|
|
7
|
+
}
|
|
8
|
+
export declare class ListTemplatesCommand extends SensCommand<ListTemplatesCommandInput, ListTemplatesCommandOutput, SensClientResolvedConfig> {
|
|
9
|
+
input: ListTemplatesCommandInput;
|
|
10
|
+
constructor(input: ListTemplatesCommandInput);
|
|
11
|
+
serialize(input: ListTemplatesCommandInput, config: SensClientResolvedConfig): Promise<HttpRequest>;
|
|
12
|
+
deserialize(response: HttpResponse): Promise<ListTemplatesCommandOutput>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface ListTemplatesInput {
|
|
2
|
+
channelId: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ListTemplatesOutput {
|
|
5
|
+
templates?: Template[];
|
|
6
|
+
}
|
|
7
|
+
export interface Template {
|
|
8
|
+
createTime?: string;
|
|
9
|
+
updateTime?: string;
|
|
10
|
+
channelId?: string;
|
|
11
|
+
templateCode?: string;
|
|
12
|
+
templateName?: string;
|
|
13
|
+
content?: string;
|
|
14
|
+
comments?: Comment[];
|
|
15
|
+
templateInspectionStatus?: string;
|
|
16
|
+
templateStatus?: string;
|
|
17
|
+
buttons?: Button[];
|
|
18
|
+
}
|
|
19
|
+
export interface Comment {
|
|
20
|
+
commentId?: string;
|
|
21
|
+
content?: string;
|
|
22
|
+
status?: string;
|
|
23
|
+
createTime?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Button {
|
|
26
|
+
order?: number;
|
|
27
|
+
type?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
linkMobile?: string;
|
|
30
|
+
linkPc?: string;
|
|
31
|
+
schemeIos?: string;
|
|
32
|
+
schemeAndroid?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { GetTemplateOutput } from '../models/GetTemplate';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
import { GetTemplateCommandInput, GetTemplateCommandOutput } from '../commands/GetTemplateCommand';
|
|
5
|
+
export declare const serializeIngestkorea_restJson_GetTemplateCommand: (input: GetTemplateCommandInput, config: SensClientResolvedConfig) => Promise<HttpRequest>;
|
|
6
|
+
export declare const deserializeIngestkorea_restJson_GetTemplateCommand: (output: HttpResponse) => Promise<GetTemplateCommandOutput>;
|
|
7
|
+
export declare const deserializeIngestkorea_restJson_GetTemplateOutput: (output: any) => Promise<GetTemplateOutput>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from '@ingestkorea/util-http-handler';
|
|
2
|
+
import { ListTemplatesOutput, Template, Comment, Button } from '../models/ListTemplates';
|
|
3
|
+
import { SensClientResolvedConfig } from '../SensClient';
|
|
4
|
+
import { ListTemplatesCommandInput, ListTemplatesCommandOutput } from '../commands/ListTemplatesCommand';
|
|
5
|
+
export declare const serializeIngestkorea_restJson_ListTemplatesCommand: (input: ListTemplatesCommandInput, config: SensClientResolvedConfig) => Promise<HttpRequest>;
|
|
6
|
+
export declare const deserializeIngestkorea_restJson_ListTemplatesCommand: (output: HttpResponse) => Promise<ListTemplatesCommandOutput>;
|
|
7
|
+
export declare const deserializeIngestkorea_restJson_ListTemplatesOutput: (output: any) => Promise<ListTemplatesOutput>;
|
|
8
|
+
export declare const deserializeIngestkorea_restJson_Template: (outputs: any[]) => Template[];
|
|
9
|
+
export declare const deserializeIngestkorea_restJson_Comment: (outputs: any[]) => Comment[];
|
|
10
|
+
export declare const deserializeIngestkorea_restJson_Button: (outputs: any[]) => Button[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingestkorea/client-sens",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "INGESTKOREA SDK
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "INGESTKOREA SDK Naver Cloud Platform SENS Client for Node.js.",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"types": "./dist-types/index.d.ts",
|