1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | Object.defineProperty(exports, "__esModule", { value: true });
|
14 | exports.ShopClient = void 0;
|
15 | const Types = require("../../types");
|
16 | const http_fetch_1 = require("../../http-fetch");
|
17 | class ShopClient {
|
18 | constructor(config) {
|
19 | if (!config.baseURL) {
|
20 | config.baseURL = "https://api.line.me";
|
21 | }
|
22 | this.httpClient = new http_fetch_1.default({
|
23 | defaultHeaders: {
|
24 | Authorization: "Bearer " + config.channelAccessToken,
|
25 | },
|
26 | baseURL: config.baseURL,
|
27 | });
|
28 | }
|
29 | async parseHTTPResponse(response) {
|
30 | const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types;
|
31 | let resBody = Object.assign({}, (await response.json()));
|
32 | if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) {
|
33 | resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME);
|
34 | }
|
35 | return resBody;
|
36 | }
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | async missionStickerV3(missionStickerRequest) {
|
44 | return (await this.missionStickerV3WithHttpInfo(missionStickerRequest))
|
45 | .body;
|
46 | }
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | async missionStickerV3WithHttpInfo(missionStickerRequest) {
|
55 | const params = missionStickerRequest;
|
56 | const res = await this.httpClient.post("/shop/v3/mission", params);
|
57 | return { httpResponse: res, body: await res.json() };
|
58 | }
|
59 | }
|
60 | exports.ShopClient = ShopClient;
|